diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index 033939551b..8457af3af9 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -114,6 +114,7 @@ src/info.* @akohlmey @rbberger src/timer.* @akohlmey src/min* @sjplimp @stanmoore1 src/utils.* @akohlmey @rbberger +src/math_eigen_impl.h @jewettaij # tools tools/msi2lmp/* @akohlmey @@ -134,6 +135,9 @@ cmake/presets/*.cmake @junghans @rbberger @akohlmey # python python/* @rbberger +# fortran +fortran/* @akohlmey + # docs doc/utils/*/* @rbberger doc/Makefile @rbberger diff --git a/.github/CONTRIBUTING.md b/.github/CONTRIBUTING.md index b61a753518..60fe82d86c 100644 --- a/.github/CONTRIBUTING.md +++ b/.github/CONTRIBUTING.md @@ -67,6 +67,7 @@ How quickly your contribution will be integrated depends largely on how much eff Here is a checklist of steps you need to follow to submit a single file or user package for our consideration. Following these steps will save both you and us time. See existing files in packages in the source directory for examples. If you are uncertain, please ask on the lammps-users mailing list. +* C++ source code must be compatible with the C++-11 standard. Packages may require a later standard, if justified. * All source files you provide must compile with the most current version of LAMMPS with multiple configurations. In particular you need to test compiling LAMMPS from scratch with `-DLAMMPS_BIGBIG` set in addition to the default `-DLAMMPS_SMALLBIG` setting. Your code will need to work correctly in serial and in parallel using MPI. * For consistency with the rest of LAMMPS and especially, if you want your contribution(s) to be added to main LAMMPS code or one of its standard packages, it needs to be written in a style compatible with other LAMMPS source files. This means: 2-character indentation per level, no tabs, no trailing whitespace, no lines over 80 characters. I/O is done via the C-style stdio library, style class header files should not import any system headers, STL containers should be avoided in headers, and forward declarations used where possible or needed. All added code should be placed into the LAMMPS_NS namespace or a sub-namespace; global or static variables should be avoided, as they conflict with the modular nature of LAMMPS and the C++ class structure. There MUST NOT be any "using namespace XXX;" statements in headers. In the implementation file (.cpp) system includes should be placed in angular brackets (<>) and for c-library functions the C++ style header files should be included ( instead of , or instead of ). This all is so the developers can more easily understand, integrate, and maintain your contribution and reduce conflicts with other parts of LAMMPS. This basically means that the code accesses data structures, performs its operations, and is formatted similar to other LAMMPS source files, including the use of the error class for error and warning messages. * Source, style name, and documentation file should follow the following naming convention: style names should be lowercase and words separated by a forward slash; for a new fix style 'foo/bar', the class should be named FixFooBar, the name of the source files should be 'fix_foo_bar.h' and 'fix_foo_bar.cpp' and the corresponding documentation should be in a file 'fix_foo_bar.rst'. diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 921295f6e6..62b80d6044 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -2,7 +2,7 @@ -**Related Issues** +**Related Issue(s)** diff --git a/.github/PULL_REQUEST_TEMPLATE/bug_fix.md b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md index a5a0b8c489..d359c23a84 100644 --- a/.github/PULL_REQUEST_TEMPLATE/bug_fix.md +++ b/.github/PULL_REQUEST_TEMPLATE/bug_fix.md @@ -9,34 +9,37 @@ assignees: '' **Summary** - + **Related Issue(s)** - + **Author(s)** - + **Licensing** -By submitting this pull request I implicitly accept, that my submission is subject to the same licensing terms as the files that are modified. +By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1). **Backward Compatibility** - + **Detailed Description** -## Post Submission Checklist +**Post Submission Checklist** - -- [ ] The code in this pull request is complete + + +- [ ] The feature or features in this pull request is complete +- [ ] Licensing information is complete +- [ ] Corresponding author information is complete - [ ] The source code follows the LAMMPS formatting guidelines +- [ ] The feature has been verified to work with the conventional build system +- [ ] The feature has been verified to work with the CMake based build system +- [ ] Suitable tests have been added to the unittest tree. -## Further Information, Files, and Links - - diff --git a/.github/PULL_REQUEST_TEMPLATE/maintenance_refactoring.md b/.github/PULL_REQUEST_TEMPLATE/maintenance_refactoring.md index b7bf40a1e8..ef5add65d8 100644 --- a/.github/PULL_REQUEST_TEMPLATE/maintenance_refactoring.md +++ b/.github/PULL_REQUEST_TEMPLATE/maintenance_refactoring.md @@ -13,23 +13,31 @@ assignees: '' **Related Issue(s)** - **Author(s)** - + **Licensing** -By submitting this pull request I implicitly accept, that my submission is subject to the same licensing terms as the files that are modified. +By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1). + +**Backward Compatibility** + + **Detailed Description** - + -## Post Submission Checklist +**Post Submission Checklist** - [ ] The pull request is complete - [ ] The source code follows the LAMMPS formatting guidelines +- [ ] The feature has been verified to work with the conventional build system +- [ ] The feature has been verified to work with the CMake based build system +- [ ] Suitable tests have been added to the unittest tree. + diff --git a/.github/PULL_REQUEST_TEMPLATE/new_feature.md b/.github/PULL_REQUEST_TEMPLATE/new_feature.md index 563a9be4aa..aaeeb94660 100644 --- a/.github/PULL_REQUEST_TEMPLATE/new_feature.md +++ b/.github/PULL_REQUEST_TEMPLATE/new_feature.md @@ -11,32 +11,29 @@ assignees: '' -**Related Issues** +**Related Issue(s)** - + **Author(s)** - + **Licensing** - - -My contribution may be licensed as GPL v2 (default LAMMPS license): -My contribution may be licensed as LGPL (for use as a library with proprietary software): +By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1). **Backward Compatibility** - + **Implementation Notes** - + -## Post Submission Checklist +**Post Submission Checklist** - + - [ ] The feature or features in this pull request is complete - [ ] Licensing information is complete @@ -46,10 +43,11 @@ My contribution may be licensed as LGPL (for use as a library with proprietary s - [ ] The added/updated documentation is integrated and tested with the documentation build system - [ ] The feature has been verified to work with the conventional build system - [ ] The feature has been verified to work with the CMake based build system +- [ ] Suitable tests have been added to the unittest tree. - [ ] A package specific README file has been included or updated - [ ] One or more example input decks are included -## Further Information, Files, and Links +**Further Information, Files, and Links** diff --git a/.github/PULL_REQUEST_TEMPLATE/update_enhancement.md b/.github/PULL_REQUEST_TEMPLATE/update_enhancement.md index 9edfb587c0..467d8db6b7 100644 --- a/.github/PULL_REQUEST_TEMPLATE/update_enhancement.md +++ b/.github/PULL_REQUEST_TEMPLATE/update_enhancement.md @@ -11,17 +11,21 @@ assignees: '' +**Related Issue(s)** + + + **Author(s)** **Licensing** -By submitting this pull request I implicitly accept, that my submission is subject to the same licensing terms as the original package or feature(s) that are updated or amended by this pull request. +By submitting this pull request, I agree, that my contribution will be included in LAMMPS and redistributed under either the GNU General Public License version 2 (GPL v2) or the GNU Lesser General Public License version 2.1 (LGPL v2.1). **Backward Compatibility** - + **Implementation Notes** @@ -29,11 +33,19 @@ By submitting this pull request I implicitly accept, that my submission is subje **Post Submission Checklist** - + + - [ ] The feature or features in this pull request is complete -- [ ] Suitable updates to the existing docs are included -- [ ] One or more example input decks are included +- [ ] Licensing information is complete +- [ ] Corresponding author information is complete - [ ] The source code follows the LAMMPS formatting guidelines +- [ ] Suitable updates to the existing docs are included +- [ ] The updated documentation is integrated and tested with the documentation build system +- [ ] The feature has been verified to work with the conventional build system +- [ ] The feature has been verified to work with the CMake based build system +- [ ] Suitable tests have been updated or added to the unittest tree. +- [ ] A package specific README file has been updated +- [ ] One or more example input decks are included **Further Information, Files, and Links** diff --git a/.gitignore b/.gitignore index 5c90b0f39c..0f1b01775d 100644 --- a/.gitignore +++ b/.gitignore @@ -37,6 +37,7 @@ vgcore.* ehthumbs.db Thumbs.db .clang-format +.lammps_history #cmake /build* diff --git a/README b/README index 680986bf61..7b30b891ed 100644 --- a/README +++ b/README @@ -22,28 +22,32 @@ more information about the code and its uses. The LAMMPS distribution includes the following files and directories: -README this file -LICENSE the GNU General Public License (GPL) -bench benchmark problems -cmake CMake build system -doc documentation -examples simple test problems -lib libraries LAMMPS can be linked with -potentials interatomic potential files -python Python wrapper on LAMMPS as a library -src source files -tools pre- and post-processing tools +README this file +LICENSE the GNU General Public License (GPL) +bench benchmark problems +cmake CMake build files +doc documentation +examples simple test problems +fortran Fortran wrapper for LAMMPS +lib additional provided or external libraries +potentials interatomic potential files +python Python wrappers for LAMMPS +src source files +tools pre- and post-processing tools Point your browser at any of these files to get started: -http://lammps.sandia.gov/doc/Manual.html the LAMMPS manual -http://lammps.sandia.gov/doc/Intro.html hi-level introduction -http://lammps.sandia.gov/doc/Build.html how to build LAMMPS -http://lammps.sandia.gov/doc/Run_head.html how to run LAMMPS -http://lammps.sandia.gov/doc/Developer.pdf LAMMPS developer guide +https://lammps.sandia.gov/doc/Manual.html LAMMPS user manual +https://lammps.sandia.gov/doc/Intro.html hi-level introduction +https://lammps.sandia.gov/doc/Build.html how to build LAMMPS +https://lammps.sandia.gov/doc/Run_head.html how to run LAMMPS +https://lammps.sandia.gov/doc/Commands_all.html Table of available commands +https://lammps.sandia.gov/doc/pg_library.html LAMMPS programmer guide +https://lammps.sandia.gov/doc/Modify.html how to modify and extend LAMMPS +https://lammps.sandia.gov/doc/pg_developer.html LAMMPS developer guide You can also create these doc pages locally: % cd doc % make html # creates HTML pages in doc/html -% make pdf # creates Manual.pdf and Developer.pdf +% make pdf # creates Manual.pdf diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt index cc4c1cc905..6a0b6b7cc9 100644 --- a/cmake/CMakeLists.txt +++ b/cmake/CMakeLists.txt @@ -90,6 +90,7 @@ if(BUILD_SHARED_LIBS) # for all pkg libs, mpi_stubs and linalg endif() option(BUILD_TOOLS "Build and install LAMMPS tools (msi2lmp, binary2txt, chain)" OFF) +option(BUILD_LAMMPS_SHELL "Build and install the LAMMPS shell" OFF) include(GNUInstallDirs) file(GLOB ALL_SOURCES ${LAMMPS_SOURCE_DIR}/[^.]*.cpp) @@ -157,11 +158,11 @@ else() file(GLOB MPI_SOURCES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.c) add_library(mpi_stubs STATIC ${MPI_SOURCES}) set_target_properties(mpi_stubs PROPERTIES OUTPUT_NAME lammps_mpi_stubs${LAMMPS_MACHINE}) - target_include_directories(mpi_stubs PUBLIC $ $) - install(FILES ${LAMMPS_SOURCE_DIR}/STUBS/mpi.h DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}/lammps/mpi) + target_include_directories(mpi_stubs PUBLIC $) if(BUILD_SHARED_LIBS) target_link_libraries(lammps PRIVATE mpi_stubs) - target_include_directories(lammps INTERFACE $ $) + target_include_directories(lammps INTERFACE $) + target_compile_definitions(lammps INTERFACE $) else() target_link_libraries(lammps PUBLIC mpi_stubs) endif() @@ -218,10 +219,9 @@ if(BUILD_OMP) message(FATAL_ERROR "Cannot find the 'omp.h' header file required for full OpenMP support") endif() - if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 8.99.9)) OR - ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 9.99.9)) OR - ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 18.99.9)) - ) + if (((CMAKE_CXX_COMPILER_ID STREQUAL "GNU") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 9.0)) OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Clang") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 10.0)) OR + ((CMAKE_CXX_COMPILER_ID STREQUAL "Intel") AND (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER_EQUAL 19.0))) # GCC 9.x and later plus Clang 10.x and later implement strict OpenMP 4.0 semantics for consts. # Intel 18.0 was tested to support both, so we switch to OpenMP 4+ from 19.x onward to be safe. target_compile_definitions(lammps PRIVATE -DLAMMPS_OMP_COMPAT=4) @@ -249,6 +249,26 @@ if(${CMAKE_CXX_COMPILER_ID} STREQUAL "GNU") endif() endif() +####################################### +# add custom target for IWYU analysis +####################################### +set(ENABLE_IWYU OFF CACHE BOOL "Add 'iwyu' build target to call the include-what-you-use tool") +mark_as_advanced(ENABLE_IWYU) +if(ENABLE_IWYU) + find_program(IWYU_EXE NAMES include-what-you-use iwyu) + find_program(IWYU_TOOL NAMES iwyu_tool iwyu-tool iwyu_tool.py) + if (IWYU_EXE AND IWYU_TOOL) + add_custom_target( + iwyu + ${IWYU_TOOL} -o clang -p ${CMAKE_CURRENT_BINARY_DIR} -- -Xiwyu --mapping_file=${CMAKE_CURRENT_SOURCE_DIR}/iwyu/iwyu-extra-map.imp + COMMENT "Running IWYU") + add_dependencies(iwyu lammps) + else() + message(FATAL_ERROR "To use IWYU you need the include-what-you-use/iwyu executable" + "and the iwyu-tool/iwyu_tool script installed in your PATH") + endif() +endif() + set(ENABLE_SANITIZER "none" CACHE STRING "Select a code sanitizer option (none (default), address, leak, thread, undefined)") mark_as_advanced(ENABLE_SANITIZER) set(ENABLE_SANITIZER_VALUES none address leak thread undefined) @@ -293,14 +313,13 @@ if(PKG_MSCG OR PKG_USER-ATC OR PKG_USER-AWPMD OR PKG_USER-QUIP OR PKG_LATTE) endif() endif() - find_package(JPEG QUIET) option(WITH_JPEG "Enable JPEG support" ${JPEG_FOUND}) if(WITH_JPEG) find_package(JPEG REQUIRED) target_compile_definitions(lammps PRIVATE -DLAMMPS_JPEG) if(CMAKE_VERSION VERSION_LESS 3.12) - target_include_directories(lammps PRIVATE ${JPEG_INCLUDE_DIR}) + target_include_directories(lammps PRIVATE ${JPEG_INCLUDE_DIRS}) target_link_libraries(lammps PRIVATE ${JPEG_LIBRARIES}) else() target_link_libraries(lammps PRIVATE JPEG::JPEG) @@ -325,20 +344,22 @@ find_program(GZIP_EXECUTABLE gzip) find_package_handle_standard_args(GZIP REQUIRED_VARS GZIP_EXECUTABLE) option(WITH_GZIP "Enable GZIP support" ${GZIP_FOUND}) if(WITH_GZIP) - if(NOT GZIP_FOUND) + if(GZIP_FOUND OR ((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)) + target_compile_definitions(lammps PRIVATE -DLAMMPS_GZIP) + else() message(FATAL_ERROR "gzip executable not found") endif() - target_compile_definitions(lammps PRIVATE -DLAMMPS_GZIP) endif() find_program(FFMPEG_EXECUTABLE ffmpeg) find_package_handle_standard_args(FFMPEG REQUIRED_VARS FFMPEG_EXECUTABLE) option(WITH_FFMPEG "Enable FFMPEG support" ${FFMPEG_FOUND}) if(WITH_FFMPEG) - if(NOT FFMPEG_FOUND) + if(FFMPEG_FOUND OR ((CMAKE_SYSTEM_NAME STREQUAL Windows) AND CMAKE_CROSSCOMPILING)) + target_compile_definitions(lammps PRIVATE -DLAMMPS_FFMPEG) + else() message(FATAL_ERROR "ffmpeg executable not found") endif() - target_compile_definitions(lammps PRIVATE -DLAMMPS_FFMPEG) endif() if(BUILD_SHARED_LIBS) @@ -556,7 +577,7 @@ if (${_index} GREATER -1) endif() set(LAMMPS_CXX_HEADERS angle.h atom.h bond.h citeme.h comm.h compute.h dihedral.h domain.h error.h fix.h force.h group.h improper.h input.h info.h kspace.h lammps.h lattice.h library.h lmppython.h lmptype.h memory.h modify.h neighbor.h neigh_list.h output.h - pair.h pointers.h region.h timer.h universe.h update.h variable.h) + pair.h pointers.h region.h timer.h universe.h update.h utils.h variable.h) if(LAMMPS_EXCEPTIONS) list(APPEND LAMMPS_CXX_HEADERS exceptions.h) endif() @@ -622,6 +643,18 @@ if(BUILD_TOOLS) install(FILES ${LAMMPS_DOC_DIR}/msi2lmp.1 DESTINATION ${CMAKE_INSTALL_MANDIR}/man1) endif() +if(BUILD_LAMMPS_SHELL) + find_package(PkgConfig REQUIRED) + pkg_check_modules(READLINE IMPORTED_TARGET REQUIRED readline) + if(NOT LAMMPS_EXCEPTIONS) + message(WARNING "The LAMMPS shell needs LAMMPS_EXCEPTIONS enabled for full functionality") + endif() + add_executable(lammps-shell ${LAMMPS_TOOLS_DIR}/lammps-shell/lammps-shell.cpp) + target_compile_definitions(lammps-shell PRIVATE -DLAMMPS_LIB_NO_MPI) + target_link_libraries(lammps-shell PRIVATE lammps PkgConfig::READLINE) + install(TARGETS lammps-shell EXPORT LAMMPS_Targets DESTINATION ${CMAKE_INSTALL_BINDIR}) +endif() + include(Documentation) ############################################################################### diff --git a/cmake/Modules/CodeCoverage.cmake b/cmake/Modules/CodeCoverage.cmake index 3b323e37ff..054e08fc1a 100644 --- a/cmake/Modules/CodeCoverage.cmake +++ b/cmake/Modules/CodeCoverage.cmake @@ -3,11 +3,16 @@ # # Requires latest gcovr (for GCC 8.1 support):# # pip install git+https://github.com/gcovr/gcovr.git +# +# For Python coverage the coverage package needs to be installed ############################################################################### if(ENABLE_COVERAGE) find_program(GCOVR_BINARY gcovr) find_package_handle_standard_args(GCOVR DEFAULT_MSG GCOVR_BINARY) + find_program(COVERAGE_BINARY coverage) + find_package_handle_standard_args(COVERAGE DEFAULT_MSG COVERAGE_BINARY) + if(GCOVR_FOUND) get_filename_component(ABSOLUTE_LAMMPS_SOURCE_DIR ${LAMMPS_SOURCE_DIR} ABSOLUTE) @@ -46,4 +51,30 @@ if(ENABLE_COVERAGE) ) add_dependencies(reset_coverage clean_coverage_html) endif() + + if(COVERAGE_FOUND) + set(PYTHON_COVERAGE_HTML_DIR ${CMAKE_BINARY_DIR}/python_coverage_html) + add_custom_command( + OUTPUT ${CMAKE_BINARY_DIR}/unittest/python/.coverage + COMMAND ${COVERAGE_BINARY} combine + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python + COMMENT "Combine Python coverage files..." + ) + + add_custom_target( + gen_python_coverage_html + COMMAND ${COVERAGE_BINARY} html -d ${PYTHON_COVERAGE_HTML_DIR} + DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python + COMMENT "Generating HTML Python coverage report..." + ) + + add_custom_target( + gen_python_coverage_xml + COMMAND ${COVERAGE_BINARY} xml -o ${CMAKE_BINARY_DIR}/python_coverage.xml + DEPENDS ${CMAKE_BINARY_DIR}/unittest/python/.coverage + WORKING_DIRECTORY ${CMAKE_BINARY_DIR}/unittest/python + COMMENT "Generating XML Python coverage report..." + ) + endif() endif() diff --git a/cmake/Modules/Documentation.cmake b/cmake/Modules/Documentation.cmake index 282253eede..6125155ad5 100644 --- a/cmake/Modules/Documentation.cmake +++ b/cmake/Modules/Documentation.cmake @@ -15,75 +15,93 @@ if(BUILD_DOC) endif() set(VIRTUALENV ${Python3_EXECUTABLE} -m virtualenv -p ${Python3_EXECUTABLE}) endif() + find_package(Doxygen 1.8.10 REQUIRED) file(GLOB DOC_SOURCES ${LAMMPS_DOC_DIR}/src/[^.]*.rst) + add_custom_command( OUTPUT docenv COMMAND ${VIRTUALENV} docenv ) set(DOCENV_BINARY_DIR ${CMAKE_BINARY_DIR}/docenv/bin) + set(DOCENV_REQUIREMENTS_FILE ${LAMMPS_DOC_DIR}/utils/requirements.txt) + + set(SPHINX_CONFIG_DIR ${LAMMPS_DOC_DIR}/utils/sphinx-config) + set(SPHINX_CONFIG_FILE_TEMPLATE ${SPHINX_CONFIG_DIR}/conf.py.in) + set(SPHINX_STATIC_DIR ${SPHINX_CONFIG_DIR}/_static) + + # configuration and static files are copied to binary dir to avoid collisions with parallel builds + set(DOC_BUILD_DIR ${CMAKE_CURRENT_BINARY_DIR}/doc) + set(DOC_BUILD_CONFIG_FILE ${DOC_BUILD_DIR}/conf.py) + set(DOC_BUILD_STATIC_DIR ${DOC_BUILD_DIR}/_static) + set(DOXYGEN_BUILD_DIR ${DOC_BUILD_DIR}/doxygen) + set(DOXYGEN_XML_DIR ${DOXYGEN_BUILD_DIR}/xml) + + # copy entire configuration folder to doc build directory + # files in _static are automatically copied during sphinx-build, so no need to copy them individually + file(COPY ${SPHINX_CONFIG_DIR}/ DESTINATION ${DOC_BUILD_DIR}) + + # configure paths in conf.py, since relative paths change when file is copied + configure_file(${SPHINX_CONFIG_FILE_TEMPLATE} ${DOC_BUILD_CONFIG_FILE}) add_custom_command( - OUTPUT requirements.txt - DEPENDS docenv - COMMAND ${CMAKE_COMMAND} -E copy ${LAMMPS_DOC_DIR}/utils/requirements.txt requirements.txt + OUTPUT ${DOC_BUILD_DIR}/requirements.txt + DEPENDS docenv ${DOCENV_REQUIREMENTS_FILE} + COMMAND ${CMAKE_COMMAND} -E copy ${DOCENV_REQUIREMENTS_FILE} ${DOC_BUILD_DIR}/requirements.txt + COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade pip COMMAND ${DOCENV_BINARY_DIR}/pip install --upgrade ${LAMMPS_DOC_DIR}/utils/converters - COMMAND ${DOCENV_BINARY_DIR}/pip install --use-feature=2020-resolver -r requirements.txt --upgrade + COMMAND ${DOCENV_BINARY_DIR}/pip install --use-feature=2020-resolver -r ${DOC_BUILD_DIR}/requirements.txt --upgrade ) # download mathjax distribution and unpack to folder "mathjax" - if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/mathjax/es5) + if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/mathjax/es5) file(DOWNLOAD "https://github.com/mathjax/MathJax/archive/3.0.5.tar.gz" "${CMAKE_CURRENT_BINARY_DIR}/mathjax.tar.gz" EXPECTED_MD5 5d9d3799cce77a1a95eee6be04eb68e7) execute_process(COMMAND ${CMAKE_COMMAND} -E tar xzf mathjax.tar.gz WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}) file(GLOB MATHJAX_VERSION_DIR ${CMAKE_CURRENT_BINARY_DIR}/MathJax-*) - execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${CMAKE_CURRENT_BINARY_DIR}/mathjax) + execute_process(COMMAND ${CMAKE_COMMAND} -E rename ${MATHJAX_VERSION_DIR} ${DOC_BUILD_STATIC_DIR}/mathjax) endif() - file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax) - file(COPY ${CMAKE_CURRENT_BINARY_DIR}/mathjax/es5 DESTINATION ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax/) # for increased browser compatibility - if(NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/html/_static/polyfill.js) + if(NOT EXISTS ${DOC_BUILD_STATIC_DIR}/polyfill.js) file(DOWNLOAD "https://polyfill.io/v3/polyfill.min.js?features=es6" - "${CMAKE_CURRENT_BINARY_DIR}/html/_static/polyfill.js") + "${DOC_BUILD_STATIC_DIR}/polyfill.js") endif() - # note, this may run in parallel with other tasks, so we must not use multiple processes here + # set up doxygen and add targets to run it + file(MAKE_DIRECTORY ${DOXYGEN_BUILD_DIR}) + file(COPY ${LAMMPS_DOC_DIR}/doxygen/lammps-logo.png DESTINATION ${DOXYGEN_BUILD_DIR}/lammps-logo.png) + configure_file(${LAMMPS_DOC_DIR}/doxygen/Doxyfile.in ${DOXYGEN_BUILD_DIR}/Doxyfile) + get_target_property(LAMMPS_SOURCES lammps SOURCES) add_custom_command( - OUTPUT html - DEPENDS ${DOC_SOURCES} docenv requirements.txt - COMMAND ${DOCENV_BINARY_DIR}/sphinx-build -b html -c ${LAMMPS_DOC_DIR}/utils/sphinx-config -d ${CMAKE_BINARY_DIR}/doctrees ${LAMMPS_DOC_DIR}/src html - COMMAND ${CMAKE_COMMAND} -E create_symlink Manual.html ${CMAKE_CURRENT_BINARY_DIR}/html/index.html + OUTPUT ${DOXYGEN_XML_DIR}/index.xml + DEPENDS ${DOC_SOURCES} ${LAMMPS_SOURCES} + COMMAND Doxygen::doxygen ${DOXYGEN_BUILD_DIR}/Doxyfile WORKING_DIRECTORY ${DOXYGEN_BUILD_DIR} + COMMAND ${CMAKE_COMMAND} -E touch ${DOXYGEN_XML_DIR}/run.stamp ) - # copy selected image files to html output tree - file(MAKE_DIRECTORY ${CMAKE_BINARY_DIR}/html/JPG) - set(HTML_EXTRA_IMAGES balance_nonuniform.jpg balance_rcb.jpg - balance_uniform.jpg bow_tutorial_01.png bow_tutorial_02.png - bow_tutorial_03.png bow_tutorial_04.png bow_tutorial_05.png - dump1.jpg dump2.jpg examples_mdpd.gif gran_funnel.png gran_mixer.png - hop1.jpg hop2.jpg saed_ewald_intersect.jpg saed_mesh.jpg - screenshot_atomeye.jpg screenshot_gl.jpg screenshot_pymol.jpg - screenshot_vmd.jpg sinusoid.jpg xrd_mesh.jpg) - set(HTML_IMAGE_TARGETS "") - foreach(_IMG ${HTML_EXTRA_IMAGES}) - string(PREPEND _IMG JPG/) - list(APPEND HTML_IMAGE_TARGETS "${CMAKE_CURRENT_BINARY_DIR}/html/${_IMG}") - add_custom_command( - OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/${_IMG} - DEPENDS ${LAMMPS_DOC_DIR}/src/${_IMG} ${CMAKE_CURRENT_BINARY_DIR}/html/JPG - COMMAND ${CMAKE_COMMAND} -E copy ${LAMMPS_DOC_DIR}/src/${_IMG} ${CMAKE_BINARY_DIR}/html/${_IMG} - ) - endforeach() + if(EXISTS ${DOXYGEN_XML_DIR}/run.stamp) + set(SPHINX_EXTRA_OPTS "-E") + else() + set(SPHINX_EXTRA_OPTS "") + endif() + add_custom_command( + OUTPUT html + DEPENDS ${DOC_SOURCES} docenv ${DOC_BUILD_DIR}/requirements.txt ${DOXYGEN_XML_DIR}/index.xml ${BUILD_DOC_CONFIG_FILE} + COMMAND ${DOCENV_BINARY_DIR}/sphinx-build ${SPHINX_EXTRA_OPTS} -b html -c ${DOC_BUILD_DIR} -d ${DOC_BUILD_DIR}/doctrees ${LAMMPS_DOC_DIR}/src ${DOC_BUILD_DIR}/html + COMMAND ${CMAKE_COMMAND} -E create_symlink Manual.html ${DOC_BUILD_DIR}/html/index.html + COMMAND ${CMAKE_COMMAND} -E copy_directory ${LAMMPS_DOC_DIR}/src/PDF ${DOC_BUILD_DIR}/html/PDF + COMMAND ${CMAKE_COMMAND} -E remove -f ${DOXYGEN_XML_DIR}/run.stamp + ) add_custom_target( doc ALL - DEPENDS html ${CMAKE_CURRENT_BINARY_DIR}/html/_static/mathjax/es5 ${HTML_IMAGE_TARGETS} + DEPENDS html ${DOC_BUILD_STATIC_DIR}/mathjax/es5 SOURCES ${LAMMPS_DOC_DIR}/utils/requirements.txt ${DOC_SOURCES} ) - install(DIRECTORY ${CMAKE_BINARY_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR}) + install(DIRECTORY ${DOC_BUILD_DIR}/html DESTINATION ${CMAKE_INSTALL_DOCDIR}) endif() diff --git a/cmake/Modules/GTest.cmake b/cmake/Modules/GTest.cmake index f8a8bf6e47..060a7e42f9 100644 --- a/cmake/Modules/GTest.cmake +++ b/cmake/Modules/GTest.cmake @@ -7,9 +7,11 @@ else() endif() include(ExternalProject) +set(GTEST_URL "https://github.com/google/googletest/archive/release-1.10.0.tar.gz" CACHE STRING "URL for GTest tarball") +mark_as_advanced(GTEST_URL) ExternalProject_Add(googletest - GIT_REPOSITORY https://github.com/google/googletest.git - GIT_TAG release-1.10.0 + URL ${GTEST_URL} + URL_MD5 ecd1fa65e7de707cd5c00bdac56022cd SOURCE_DIR "${CMAKE_BINARY_DIR}/gtest-src" BINARY_DIR "${CMAKE_BINARY_DIR}/gtest-build" CMAKE_ARGS ${CMAKE_REQUEST_PIC} ${CMAKE_EXTRA_GTEST_OPTS} diff --git a/cmake/Modules/GenerateBinaryHeader.cmake b/cmake/Modules/GenerateBinaryHeader.cmake index 512f69e09d..498a4f68f5 100644 --- a/cmake/Modules/GenerateBinaryHeader.cmake +++ b/cmake/Modules/GenerateBinaryHeader.cmake @@ -1,3 +1,3 @@ # utility script to call GenerateBinaryHeader function include(${SOURCE_DIR}/Modules/LAMMPSUtils.cmake) -GenerateBinaryHeader(${VARNAME} ${HEADER_FILE} ${SOURCE_FILES}) +GenerateBinaryHeader(${VARNAME} ${HEADER_FILE} ${SOURCE_FILE}) diff --git a/cmake/Modules/LAMMPSUtils.cmake b/cmake/Modules/LAMMPSUtils.cmake index a87c0f567c..339ba867bd 100644 --- a/cmake/Modules/LAMMPSUtils.cmake +++ b/cmake/Modules/LAMMPSUtils.cmake @@ -71,19 +71,15 @@ macro(pkg_depends PKG1 PKG2) endmacro() # CMake-only replacement for bin2c and xxd -function(GenerateBinaryHeader varname outfile files) +function(GenerateBinaryHeader varname outfile infile) message("Creating ${outfile}...") file(WRITE ${outfile} "// CMake generated file\n") - math(EXPR ARG_END "${ARGC}-1") - foreach(IDX RANGE 2 ${ARG_END}) - list(GET ARGV ${IDX} filename) - file(READ ${filename} content HEX) - string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," content "${content}") - string(REGEX REPLACE ",$" "" content "${content}") - file(APPEND ${outfile} "const unsigned char ${varname}[] = { ${content} };\n") - file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n") - endforeach() + file(READ ${infile} content HEX) + string(REGEX REPLACE "([0-9a-f][0-9a-f])" "0x\\1," content "${content}") + string(REGEX REPLACE ",$" "" content "${content}") + file(APPEND ${outfile} "const unsigned char ${varname}[] = { ${content} };\n") + file(APPEND ${outfile} "const unsigned int ${varname}_size = sizeof(${varname});\n") endfunction(GenerateBinaryHeader) # fetch missing potential files diff --git a/cmake/Modules/Packages/COMPRESS.cmake b/cmake/Modules/Packages/COMPRESS.cmake index 801a38a215..887dfb88a6 100644 --- a/cmake/Modules/Packages/COMPRESS.cmake +++ b/cmake/Modules/Packages/COMPRESS.cmake @@ -1,2 +1,10 @@ find_package(ZLIB REQUIRED) target_link_libraries(lammps PRIVATE ZLIB::ZLIB) + +find_package(PkgConfig REQUIRED) +pkg_check_modules(Zstd IMPORTED_TARGET libzstd>=1.4) + +if(Zstd_FOUND) + target_compile_definitions(lammps PRIVATE -DLAMMPS_ZSTD) + target_link_libraries(lammps PRIVATE PkgConfig::Zstd) +endif() diff --git a/cmake/Modules/Packages/GPU.cmake b/cmake/Modules/Packages/GPU.cmake index 04c320226a..cad6e2bf9a 100644 --- a/cmake/Modules/Packages/GPU.cmake +++ b/cmake/Modules/Packages/GPU.cmake @@ -75,7 +75,7 @@ if(GPU_API STREQUAL "CUDA") endif() # Kepler (GPU Arch 3.5) is supported by CUDA 5 to CUDA 11 if((CUDA_VERSION VERSION_GREATER_EQUAL "5.0") AND (CUDA_VERSION VERSION_LESS "12.0")) - string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35]") + string(APPEND GPU_CUDA_GENCODE " -gencode arch=compute_35,code=[sm_35,compute_35]") endif() # Maxwell (GPU Arch 5.x) is supported by CUDA 6 and later if(CUDA_VERSION VERSION_GREATER_EQUAL "6.0") @@ -309,7 +309,7 @@ elseif(GPU_API STREQUAL "HIP") endif() add_custom_command(OUTPUT ${CUBIN_H_FILE} - COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILES=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake + COMMAND ${CMAKE_COMMAND} -D SOURCE_DIR=${CMAKE_CURRENT_SOURCE_DIR} -D VARNAME=${CU_NAME} -D HEADER_FILE=${CUBIN_H_FILE} -D SOURCE_FILE=${CUBIN_FILE} -P ${CMAKE_CURRENT_SOURCE_DIR}/Modules/GenerateBinaryHeader.cmake DEPENDS ${CUBIN_FILE} COMMENT "Generating ${CU_NAME}_cubin.h") diff --git a/cmake/Modules/Packages/KOKKOS.cmake b/cmake/Modules/Packages/KOKKOS.cmake index 620f1c65c6..bb27a56e2d 100644 --- a/cmake/Modules/Packages/KOKKOS.cmake +++ b/cmake/Modules/Packages/KOKKOS.cmake @@ -35,8 +35,8 @@ if(DOWNLOAD_KOKKOS) list(APPEND KOKKOS_LIB_BUILD_ARGS "-DCMAKE_TOOLCHAIN_FILE=${CMAKE_TOOLCHAIN_FILE}") include(ExternalProject) ExternalProject_Add(kokkos_build - URL https://github.com/kokkos/kokkos/archive/3.1.01.tar.gz - URL_MD5 3ccb2100f7fc316891e7dad3bc33fa37 + URL https://github.com/kokkos/kokkos/archive/3.2.00.tar.gz + URL_MD5 81569170fe232e5e64ab074f7cca5e50 CMAKE_ARGS ${KOKKOS_LIB_BUILD_ARGS} BUILD_BYPRODUCTS /lib/libkokkoscore.a ) @@ -50,7 +50,7 @@ if(DOWNLOAD_KOKKOS) target_link_libraries(lammps PRIVATE LAMMPS::KOKKOS) add_dependencies(LAMMPS::KOKKOS kokkos_build) elseif(EXTERNAL_KOKKOS) - find_package(Kokkos 3.1.01 REQUIRED CONFIG) + find_package(Kokkos 3.2.00 REQUIRED CONFIG) target_link_libraries(lammps PRIVATE Kokkos::kokkos) else() set(LAMMPS_LIB_KOKKOS_SRC_DIR ${LAMMPS_LIB_SOURCE_DIR}/kokkos) diff --git a/cmake/Modules/Packages/KSPACE.cmake b/cmake/Modules/Packages/KSPACE.cmake index 5e79813ac0..de7e7e5b20 100644 --- a/cmake/Modules/Packages/KSPACE.cmake +++ b/cmake/Modules/Packages/KSPACE.cmake @@ -19,16 +19,16 @@ if(FFT STREQUAL "FFTW3") find_package(${FFTW} REQUIRED) target_compile_definitions(lammps PRIVATE -DFFT_FFTW3) target_link_libraries(lammps PRIVATE ${FFTW}::${FFTW}) - if(FFTW3_OMP_LIBRARY OR FFTW3F_OMP_LIBRARY) + if(FFTW3_OMP_LIBRARIES OR FFTW3F_OMP_LIBRARIES) option(FFT_FFTW_THREADS "Use threaded FFTW library" ON) else() option(FFT_FFTW_THREADS "Use threaded FFT library" OFF) endif() if(FFT_FFTW_THREADS) - if(FFTW3_OMP_LIBRARY OR FFTW3F_OMP_LIBRARY) - target_compile_definitions(lammps PRIVATE -DFFT_FFTW_THREADS) - target_link_libraries(lammps PRIVATE ${FFTW}::${FFTW}_OMP) + if(FFTW3_OMP_LIBRARIES OR FFTW3F_OMP_LIBRARIES) + target_compile_definitions(lammps PRIVATE -DFFT_FFTW_THREADS) + target_link_libraries(lammps PRIVATE ${FFTW}::${FFTW}_OMP) else() message(FATAL_ERROR "Need OpenMP enabled FFTW3 library for FFT_THREADS") endif() diff --git a/cmake/Modules/Packages/MSCG.cmake b/cmake/Modules/Packages/MSCG.cmake index 55f71588fe..6cb389fb13 100644 --- a/cmake/Modules/Packages/MSCG.cmake +++ b/cmake/Modules/Packages/MSCG.cmake @@ -38,7 +38,7 @@ if(DOWNLOAD_MSCG) else() find_package(MSCG) if(NOT MSCG_FOUND) - message(FATAL_ERROR "MSCG not found, help CMake to find it by setting MSCG_LIBRARY and MSCG_INCLUDE_DIRS, or set DOWNLOAD_MSCG=ON to download it") + message(FATAL_ERROR "MSCG not found, help CMake to find it by setting MSCG_LIBRARY and MSCG_INCLUDE_DIR, or set DOWNLOAD_MSCG=ON to download it") endif() target_link_libraries(lammps PRIVATE MSCG::MSCG) endif() diff --git a/cmake/Modules/Packages/PYTHON.cmake b/cmake/Modules/Packages/PYTHON.cmake index a577f824fe..7be25a6b05 100644 --- a/cmake/Modules/Packages/PYTHON.cmake +++ b/cmake/Modules/Packages/PYTHON.cmake @@ -1,7 +1,7 @@ if(CMAKE_VERSION VERSION_LESS 3.12) find_package(PythonLibs REQUIRED) # Deprecated since version 3.12 - target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIR}) - target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARY}) + target_include_directories(lammps PRIVATE ${PYTHON_INCLUDE_DIRS}) + target_link_libraries(lammps PRIVATE ${PYTHON_LIBRARIES}) else() find_package(Python REQUIRED COMPONENTS Development) target_link_libraries(lammps PRIVATE Python::Python) diff --git a/cmake/Modules/Packages/USER-COLVARS.cmake b/cmake/Modules/Packages/USER-COLVARS.cmake index 92595a9c8a..3488aa62b1 100644 --- a/cmake/Modules/Packages/USER-COLVARS.cmake +++ b/cmake/Modules/Packages/USER-COLVARS.cmake @@ -2,6 +2,8 @@ set(COLVARS_SOURCE_DIR ${LAMMPS_LIB_SOURCE_DIR}/colvars) file(GLOB COLVARS_SOURCES ${COLVARS_SOURCE_DIR}/[^.]*.cpp) +option(COLVARS_DEBUG "Debugging messages for Colvars (quite verbose)" OFF) + # Build Lepton by default option(COLVARS_LEPTON "Build and link the Lepton library" ON) @@ -16,11 +18,18 @@ if(COLVARS_LEPTON) endif() add_library(colvars STATIC ${COLVARS_SOURCES}) -target_compile_definitions(colvars PRIVATE -DLAMMPS_${LAMMPS_SIZES}) +target_compile_definitions(colvars PRIVATE -DCOLVARS_LAMMPS) set_target_properties(colvars PROPERTIES OUTPUT_NAME lammps_colvars${LAMMPS_MACHINE}) target_include_directories(colvars PUBLIC ${LAMMPS_LIB_SOURCE_DIR}/colvars) +# The line below is needed to locate math_eigen_impl.h +target_include_directories(colvars PRIVATE ${LAMMPS_SOURCE_DIR}) target_link_libraries(lammps PRIVATE colvars) +if(COLVARS_DEBUG) + # Need to export the macro publicly to also affect the proxy + target_compile_definitions(colvars PUBLIC -DCOLVARS_DEBUG) +endif() + if(COLVARS_LEPTON) target_link_libraries(lammps PRIVATE lepton) target_compile_definitions(colvars PRIVATE -DLEPTON) diff --git a/cmake/Modules/Packages/USER-MOLFILE.cmake b/cmake/Modules/Packages/USER-MOLFILE.cmake index 1a2df2202b..4d414acead 100644 --- a/cmake/Modules/Packages/USER-MOLFILE.cmake +++ b/cmake/Modules/Packages/USER-MOLFILE.cmake @@ -1,4 +1,5 @@ -set(MOLFILE_INCLUDE_DIRS "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers") +set(MOLFILE_INCLUDE_DIR "${LAMMPS_LIB_SOURCE_DIR}/molfile" CACHE STRING "Path to VMD molfile plugin headers") +set(MOLFILE_INCLUDE_DIRS "${MOLFILE_INCLUDE_DIR}") add_library(molfile INTERFACE) target_include_directories(molfile INTERFACE ${MOLFILE_INCLUDE_DIRS}) # no need to link with -ldl on windows diff --git a/cmake/Modules/Packages/USER-PLUMED.cmake b/cmake/Modules/Packages/USER-PLUMED.cmake index 39148bdf3d..74add65cdc 100644 --- a/cmake/Modules/Packages/USER-PLUMED.cmake +++ b/cmake/Modules/Packages/USER-PLUMED.cmake @@ -55,8 +55,8 @@ if(DOWNLOAD_PLUMED) endif() include(ExternalProject) ExternalProject_Add(plumed_build - URL https://github.com/plumed/plumed2/releases/download/v2.6.0/plumed-src-2.6.0.tgz - URL_MD5 204d2edae58d9b10ba3ad460cad64191 + URL https://github.com/plumed/plumed2/releases/download/v2.6.1/plumed-src-2.6.1.tgz + URL_MD5 89a9a450fc6025299fe16af235957163 BUILD_IN_SOURCE 1 CONFIGURE_COMMAND /configure --prefix= ${CONFIGURE_REQUEST_PIC} diff --git a/cmake/Modules/Packages/USER-SMD.cmake b/cmake/Modules/Packages/USER-SMD.cmake index 158df83712..67f4aae99d 100644 --- a/cmake/Modules/Packages/USER-SMD.cmake +++ b/cmake/Modules/Packages/USER-SMD.cmake @@ -9,8 +9,8 @@ if(DOWNLOAD_EIGEN3) message(STATUS "Eigen3 download requested - we will build our own") include(ExternalProject) ExternalProject_Add(Eigen3_build - URL https://bitbucket.org/eigen/eigen/get/3.3.7.tar.gz - URL_MD5 f2a417d083fe8ca4b8ed2bc613d20f07 + URL https://gitlab.com/libeigen/eigen/-/archive/3.3.7/eigen-3.3.7.tar.gz + URL_MD5 9e30f67e8531477de4117506fe44669b CONFIGURE_COMMAND "" BUILD_COMMAND "" INSTALL_COMMAND "" ) ExternalProject_get_property(Eigen3_build SOURCE_DIR) diff --git a/cmake/iwyu/iwyu-extra-map.imp b/cmake/iwyu/iwyu-extra-map.imp new file mode 100644 index 0000000000..4fadea73fb --- /dev/null +++ b/cmake/iwyu/iwyu-extra-map.imp @@ -0,0 +1,7 @@ +[ + { include: [ "", private, "", public ] }, + { include: [ "", public, "", public ] }, + { include: [ "@", private, "", public ] }, + { include: [ "@", private, "\"gtest/gtest.h\"", public ] }, + { include: [ "@", private, "\"gmock/gmock.h\"", public ] }, +] diff --git a/cmake/presets/intel.cmake b/cmake/presets/intel.cmake index 099d744ad3..d101a0f699 100644 --- a/cmake/presets/intel.cmake +++ b/cmake/presets/intel.cmake @@ -1,7 +1,8 @@ -# preset that will enable clang/clang++ with support for MPI and OpenMP (on Linux boxes) +# preset that will enable Intel compilers with support for MPI and OpenMP (on Linux boxes) set(CMAKE_CXX_COMPILER "icpc" CACHE STRING "" FORCE) set(CMAKE_C_COMPILER "icc" CACHE STRING "" FORCE) +set(CMAKE_Fortran_COMPILER "ifort" CACHE STRING "" FORCE) set(MPI_CXX "icpc" CACHE STRING "" FORCE) set(MPI_CXX_COMPILER "mpicxx" CACHE STRING "" FORCE) unset(HAVE_OMP_H_INCLUDE CACHE) @@ -12,5 +13,6 @@ set(OpenMP_C_LIB_NAMES "omp" CACHE STRING "" FORCE) set(OpenMP_CXX "icpc" CACHE STRING "" FORCE) set(OpenMP_CXX_FLAGS "-qopenmp" CACHE STRING "" FORCE) set(OpenMP_CXX_LIB_NAMES "omp" CACHE STRING "" FORCE) +set(OpenMP_Fortran_FLAGS "-qopenmp" CACHE STRING "" FORCE) set(OpenMP_omp_LIBRARY "libiomp5.so" CACHE PATH "" FORCE) diff --git a/doc/.gitignore b/doc/.gitignore index 55b25960db..7649fb34f1 100644 --- a/doc/.gitignore +++ b/doc/.gitignore @@ -1,6 +1,7 @@ /old /html /html-offline +/epub /latex /mathjax /spelling @@ -10,3 +11,9 @@ /Developer.pdf /doctrees /docenv +/doxygen-warn.log +/utils/sphinx-config/conf.py +/doxygen/Doxyfile +*.el +/utils/sphinx-config/_static/mathjax +/utils/sphinx-config/_static/polyfill.js diff --git a/doc/Makefile b/doc/Makefile index 293884b17f..2b9849d9e8 100644 --- a/doc/Makefile +++ b/doc/Makefile @@ -1,21 +1,35 @@ # Makefile for LAMMPS documentation -SHELL = /bin/bash -BUILDDIR = ${CURDIR} -RSTDIR = $(BUILDDIR)/src -VENV = $(BUILDDIR)/docenv -MATHJAX = $(BUILDDIR)/mathjax -TXT2RST = $(VENV)/bin/txt2rst -ANCHORCHECK = $(VENV)/bin/rst_anchor_check +SHELL = /bin/bash +HAS_BASH = YES +ifeq (,$(wildcard $(SHELL))) +OSHELL := $(SHELL) +override SHELL = /bin/sh +HAS_BASH = NO +endif +BUILDDIR = ${CURDIR} +RSTDIR = $(BUILDDIR)/src +VENV = $(BUILDDIR)/docenv +TXT2RST = $(VENV)/bin/txt2rst +ANCHORCHECK = $(VENV)/bin/rst_anchor_check +SPHINXCONFIG = $(BUILDDIR)/utils/sphinx-config +MATHJAX = $(SPHINXCONFIG)/_static/mathjax +POLYFILL = $(SPHINXCONFIG)/_static/polyfill.js -PYTHON = $(shell which python3) +PYTHON = $(shell which python3) +DOXYGEN = $(shell which doxygen) VIRTUALENV = virtualenv HAS_PYTHON3 = NO HAS_VIRTUALENV = NO +HAS_DOXYGEN = NO HAS_PDFLATEX = NO ifeq ($(shell which python3 >/dev/null 2>&1; echo $$?), 0) -HAS_PYTHON3 = YES +HAS_PYTHON3 = YES +endif + +ifeq ($(shell which doxygen >/dev/null 2>&1; echo $$?), 0) +HAS_DOXYGEN = YES endif ifeq ($(shell which virtualenv-3 >/dev/null 2>&1; echo $$?), 0) @@ -29,20 +43,30 @@ HAS_VIRTUALENV = YES endif ifeq ($(shell which pdflatex >/dev/null 2>&1; echo $$?), 0) +ifeq ($(shell which latexmk >/dev/null 2>&1; echo $$?), 0) HAS_PDFLATEX = YES endif +endif -SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') +#SPHINXEXTRA = -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') $(shell test -f $(BUILDDIR)/doxygen/xml/run.stamp && printf -- "-E") -.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check +# temporarily disable caching so that the hack for the sphinx-tabs extensions to get proper non-html output works +SPHINXEXTRA = -E -j $(shell $(PYTHON) -c 'import multiprocessing;print(multiprocessing.cpu_count())') + +# grab list of sources from doxygen config file. +# we only want to use explicitly listed files. +DOXYFILES = $(shell sed -n -e 's/\#.*$$//' -e '/^ *INPUT \+=/,/^[A-Z_]\+ \+=/p' doxygen/Doxyfile.in | sed -e 's/@LAMMPS_SOURCE_DIR@/..\/src/g' -e 's/\\//g' -e 's/ \+/ /' -e 's/[A-Z_]\+ \+= *\(YES\|NO\|\)//') + +.PHONY: help clean-all clean clean-spelling epub mobi rst html pdf spelling anchor_check style_check xmlgen # ------------------------------------------ help: + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @echo "Please use \`make ' where is one of" @echo " html create HTML doc pages in html dir" - @echo " pdf create Developer.pdf and Manual.pdf in this dir" + @echo " pdf create Manual.pdf in this dir" @echo " fetch fetch HTML and PDF files from LAMMPS web site" @echo " epub create ePUB format manual for e-book readers" @echo " mobi convert ePUB to MOBI format manual for e-book readers (e.g. Kindle)" @@ -57,23 +81,33 @@ help: # ------------------------------------------ clean-all: clean - rm -rf $(BUILDDIR)/docenv $(BUILDDIR)/doctrees $(BUILDDIR)/mathjax Manual.pdf Developer.pdf + rm -rf $(BUILDDIR)/docenv $(MATHJAX) $(POLYFILL) $(BUILDDIR)/LAMMPS.mobi $(BUILDDIR)/LAMMPS.epub $(BUILDDIR)/Manual.pdf clean: clean-spelling - rm -rf html epub latex + rm -rf $(BUILDDIR)/html $(BUILDDIR)/epub $(BUILDDIR)/latex $(BUILDDIR)/doctrees $(BUILDDIR)/doxygen/xml $(BUILDDIR)/doxygen-warn.log $(BUILDDIR)/doxygen/Doxyfile $(SPHINXCONFIG)/conf.py clean-spelling: - rm -rf spelling + rm -rf $(BUILDDIR)/spelling -html: $(ANCHORCHECK) $(MATHJAX) +$(SPHINXCONFIG)/conf.py: $(SPHINXCONFIG)/conf.py.in + sed -e 's,@DOXYGEN_XML_DIR@,$(BUILDDIR)/doxygen/xml,g' \ + -e 's,@LAMMPS_SOURCE_DIR@,$(BUILDDIR)/../src,g' \ + -e 's,@LAMMPS_PYTHON_DIR@,$(BUILDDIR)/../python,g' \ + -e 's,@LAMMPS_DOC_DIR@,$(BUILDDIR),g' $< > $@ + +html: xmlgen $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) $(MATHJAX) $(POLYFILL) + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi + @$(MAKE) $(MFLAGS) -C graphviz all @(\ - . $(VENV)/bin/activate ;\ - sphinx-build $(SPHINXEXTRA) -b html -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\ + . $(VENV)/bin/activate ; env PYTHONWARNINGS= \ + sphinx-build $(SPHINXEXTRA) -b html -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) html ;\ + ln -sf Manual.html html/index.html;\ + rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\ echo "############################################" ;\ rst_anchor_check src/*.rst ;\ - python utils/check-packages.py -s ../src -d src ;\ + python $(BUILDDIR)/utils/check-packages.py -s ../src -d src ;\ env LC_ALL=C grep -n '[^ -~]' $(RSTDIR)/*.rst ;\ - python utils/check-styles.py -s ../src -d src ;\ + python $(BUILDDIR)/utils/check-styles.py -s ../src -d src ;\ echo "############################################" ;\ deactivate ;\ ) @@ -82,30 +116,30 @@ html: $(ANCHORCHECK) $(MATHJAX) @rm -rf html/USER @rm -rf html/JPG @cp -r src/PDF html/PDF - @mkdir -p html/JPG - @cp `grep -A2 '\.\. .*\(image\|figure\)::' src/*.rst | grep ':target: JPG' | sed -e 's,.*:target: JPG/,src/JPG/,' | sort | uniq` html/JPG/ @rm -rf html/PDF/.[sg]* - @mkdir -p html/_static/mathjax - @cp -r $(MATHJAX)/es5 html/_static/mathjax/ @echo "Build finished. The HTML pages are in doc/html." -spelling: $(VENV) utils/sphinx-config/false_positives.txt +spelling: xmlgen $(VENV) $(SPHINXCONFIG)/false_positives.txt + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi @(\ - . $(VENV)/bin/activate ;\ - cp utils/sphinx-config/false_positives.txt $(RSTDIR)/ ; env PYTHONWARNINGS= \ - sphinx-build -b spelling -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) spelling ;\ + . $(VENV)/bin/activate ; env PYTHONWARNINGS= \ + cp $(SPHINXCONFIG)/false_positives.txt $(RSTDIR)/ ; env PYTHONWARNINGS= \ + sphinx-build -b spelling -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) spelling ;\ + rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\ deactivate ;\ ) @echo "Spell check finished." -epub: $(VENV) +epub: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi + @$(MAKE) $(MFLAGS) -C graphviz all @mkdir -p epub/JPG @rm -f LAMMPS.epub - @cp src/JPG/lammps-logo.png epub/ @cp src/JPG/*.* epub/JPG @(\ . $(VENV)/bin/activate ;\ - sphinx-build $(SPHINXEXTRA) -b epub -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\ + sphinx-build $(SPHINXEXTRA) -b epub -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) epub ;\ + rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\ deactivate ;\ ) @mv epub/LAMMPS.epub . @@ -117,18 +151,14 @@ mobi: epub @ebook-convert LAMMPS.epub LAMMPS.mobi @echo "Conversion finished. The MOBI manual file is created." -pdf: $(ANCHORCHECK) - @if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX was not found! Please check README.md for further instructions" 1>&2; exit 1; fi +pdf: xmlgen $(VENV) $(SPHINXCONFIG)/conf.py $(ANCHORCHECK) + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi + @$(MAKE) $(MFLAGS) -C graphviz all + @if [ "$(HAS_PDFLATEX)" == "NO" ] ; then echo "PDFLaTeX or latexmk were not found! Please check README for further instructions" 1>&2; exit 1; fi @(\ - cd src/Developer; \ - pdflatex developer; \ - pdflatex developer; \ - mv developer.pdf ../../Developer.pdf; \ - cd ../../; \ - ) - @(\ - . $(VENV)/bin/activate ;\ - sphinx-build $(SPHINXEXTRA) -b latex -c utils/sphinx-config -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\ + . $(VENV)/bin/activate ; env PYTHONWARNINGS= \ + sphinx-build $(SPHINXEXTRA) -b latex -c $(SPHINXCONFIG) -d $(BUILDDIR)/doctrees $(RSTDIR) latex ;\ + rm -f $(BUILDDIR)/doxygen/xml/run.stamp;\ echo "############################################" ;\ rst_anchor_check src/*.rst ;\ python utils/check-packages.py -s ../src -d src ;\ @@ -138,15 +168,13 @@ pdf: $(ANCHORCHECK) deactivate ;\ ) @cd latex && \ - sed 's/latexmk -pdf -dvi- -ps-/pdflatex/g' Makefile > temp && \ - mv temp Makefile && \ sed 's/\\begin{equation}//g' LAMMPS.tex > tmp.tex && \ mv tmp.tex LAMMPS.tex && \ sed 's/\\end{equation}//g' LAMMPS.tex > tmp.tex && \ mv tmp.tex LAMMPS.tex && \ - make && \ - make && \ - make && \ + sed 's/\\contentsname}{.*}}/\\contentsname}{LAMMPS Documentation}}/g' LAMMPS.tex > tmp.tex && \ + mv tmp.tex LAMMPS.tex && \ + $(MAKE) $(MFLAGS) && \ mv LAMMPS.pdf ../Manual.pdf && \ cd ../; @rm -rf latex/_sources @@ -154,12 +182,11 @@ pdf: $(ANCHORCHECK) @rm -rf latex/USER @cp -r src/PDF latex/PDF @rm -rf latex/PDF/.[sg]* - @echo "Build finished. Manual.pdf and Developer.pdf are in this directory." + @echo "Build finished. Manual.pdf is in this directory." fetch: - @rm -rf html_www Manual_www.pdf Developer_www.pdf + @rm -rf html_www Manual_www.pdf @curl -s -o Manual_www.pdf http://lammps.sandia.gov/doc/Manual.pdf - @curl -s -o Developer_www.pdf http://lammps.sandia.gov/doc/Developer.pdf @curl -s -o lammps-doc.tar.gz http://lammps.sandia.gov/tars/lammps-doc.tar.gz @tar xzf lammps-doc.tar.gz @rm -f lammps-doc.tar.gz @@ -185,21 +212,37 @@ package_check : $(VENV) deactivate ;\ ) +xmlgen : doxygen/xml/index.xml + +doxygen/Doxyfile: doxygen/Doxyfile.in + sed -e 's/@LAMMPS_SOURCE_DIR@/..\/..\/src/g' $< > $@ + +doxygen/xml/index.xml : $(VENV) doxygen/Doxyfile $(DOXYFILES) + @(cd doxygen; $(DOXYGEN) Doxyfile && touch xml/run.stamp) # ------------------------------------------ $(VENV): - @if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "Python3 was not found! Please check README.md for further instructions" 1>&2; exit 1; fi - @if [ "$(HAS_VIRTUALENV)" == "NO" ] ; then echo "virtualenv was not found! Please check README.md for further instructions" 1>&2; exit 1; fi + @if [ "$(HAS_BASH)" == "NO" ] ; then echo "bash was not found at $(OSHELL)! Please use: $(MAKE) SHELL=/path/to/bash" 1>&2; exit 1; fi + @if [ "$(HAS_PYTHON3)" == "NO" ] ; then echo "python3 was not found! Please see README for further instructions" 1>&2; exit 1; fi + @if [ "$(HAS_DOXYGEN)" == "NO" ] ; then echo "doxygen was not found! Please see README for further instructions" 1>&2; exit 1; fi + @if [ "$(HAS_VIRTUALENV)" == "NO" ] ; then echo "virtualenv was not found! Please see README for further instructions" 1>&2; exit 1; fi @( \ $(VIRTUALENV) -p $(PYTHON) $(VENV); \ . $(VENV)/bin/activate; \ pip install --upgrade pip; \ - pip install --use-feature=2020-resolver -r requirements.txt; \ + pip install --use-feature=2020-resolver -r $(BUILDDIR)/utils/requirements.txt; \ deactivate;\ ) $(MATHJAX): - @git clone --depth 1 https://github.com/mathjax/MathJax.git mathjax + @git clone --depth 1 https://github.com/mathjax/MathJax.git $@ + +# fall back to using wget and/or unencrypted download, if curl fails +$(POLYFILL): $(MATHJAX) + @curl -s -o $@ "https://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 || \ + curl -s -o $@ "http://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 || \ + wget -O $@ "https://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 || \ + wget -O $@ "http://polyfill.io/v3/polyfill.min.js?features=es6" > /dev/null 2>&1 $(TXT2RST) $(ANCHORCHECK): $(VENV) @( \ diff --git a/doc/README b/doc/README index cbc0c425dc..8af4021a60 100644 --- a/doc/README +++ b/doc/README @@ -1,97 +1,58 @@ LAMMPS Documentation -Depending on how you obtained LAMMPS, this directory has 2 or 3 -sub-directories and optionally 2 PDF files and an ePUB file: +Depending on how you obtained LAMMPS and whether you have built +the manual yourself, this directory has a varying number of +sub-directories and files. Here is a list with descriptions: -src content files for LAMMPS documentation -html HTML version of the LAMMPS manual (see html/Manual.html) -utils utilities and settings for building the documentation -Manual.pdf large PDF version of entire manual -Developer.pdf small PDF with info about how LAMMPS is structured -LAMMPS.epub Manual in ePUB format +README this file +src content files for LAMMPS documentation +html HTML version of the LAMMPS manual (see html/Manual.html) +utils utilities and settings for building the documentation +Manual.pdf PDF version of entire manual +LAMMPS.epub Manual in ePUB format +LAMMPS.mobi Manual in MOBI (Kindle) format +lammps.1 man page for the lammps command +msi2lmp.1 man page for the msi2lmp command +doctree temporary data +docenv python virtual environment for generating the manual +doxygen Doxygen configuration and output +.gitignore list of files and folders to be ignored by git +doxygen-warn.log logfile with warnings from running doxygen -If you downloaded LAMMPS as a tarball from the web site, all these -directories and files should be included. +and: -If you downloaded LAMMPS from the public SVN or Git repositories, then -the HTML and PDF files are not included. Instead you need to create -them, in one of three ways: +github-development-workflow.md notes on the LAMMPS development workflow +include-file-conventions.md notes on LAMMPS' include file conventions +documentation_conventions.md notes on writing documentation for LAMMPS + +If you downloaded a LAMMPS tarball from lammps.sandia.gov, then the html +folder and the PDF manual should be included. If you downloaded LAMMPS +from GitHub then you either need to download them or build them. (a) You can "fetch" the current HTML and PDF files from the LAMMPS web -site. Just type "make fetch". This should create a html_www dir and -Manual_www.pdf/Developer_www.pdf files. Note that if new LAMMPS -features have been added more recently than the date of your version, -the fetched documentation will include those changes (but your source -code will not, unless you update your local repository). +site. Just type "make fetch". This should create a html_www directory +and Manual_www.pdf file. These will always represent the latest published +patch/development version of LAMMPS. -(b) You can build the HTML and PDF files yourself, by typing "make -html" or by "make pdf", respectively. This requires various tools -including the Python documentation processing tool Sphinx, which the -build process will attempt to download and install on your system into -a python virtual environment, if not already available. The PDF file -will require a working LaTeX installation with several add-on packages -in addition to the Python/Sphinx setup. See more details below. +(b) You can build the HTML and PDF files yourself, by typing "make html" +or by "make pdf", respectively. This requires various tools and files. +Some of them have to be installed (more on that below). For the rest the +build process will attempt to download and install into a python virtual +environment and local folders. ---------------- -The generation of all documentation is managed by the Makefile in this -dir. +Installing prerequisites for the documentation build -Options: +To run the HTML documention build toolchain, python 3.x, doxygen, git, +and virtualenv have to be installed. Also internet access is initially +required to download external files and tools. -make html # generate HTML in html dir using Sphinx -make pdf # generate 2 PDF files (Manual.pdf,Developer.pdf) - # in this dir via Sphinx and PDFLaTeX -make fetch # fetch HTML doc pages and 2 PDF files from web site - # as a tarball and unpack into html dir and 2 PDFs -make epub # generate LAMMPS.epub in ePUB format using Sphinx -make clean # remove intermediate RST files created by HTML build -make clean-all # remove entire build folder and any cached data - ----------------- - -Installing prerequisites for HTML build - -To run the HTML documention build toolchain, Python 3 and virtualenv -have to be installed. Here are instructions for common setups: - -# Ubuntu - -sudo apt-get install python-virtualenv - -# Fedora (up to version 21) -# Red Hat Enterprise Linux or CentOS (up to version 7.x) - -sudo yum install python3-virtualenv - -# Fedora (since version 22) - -sudo dnf install python3-virtualenv - -# MacOS X - -## Python 3 - -Download the latest Python 3 MacOS X package from -https://www.python.org and install it. This will install both Python -3 and pip3. - -## virtualenv - -Once Python 3 is installed, open a Terminal and type - -pip3 install virtualenv - -This will install virtualenv from the Python Package Index. - ----------------- - -Installing prerequisites for PDF build - -Same as for HTML plus a compatible LaTeX installation with -support for PDFLaTeX. Also the following LaTeX packages need -to be installed (e.g. from texlive): +Building the PDF format manual requires in addition a compatible LaTeX +installation with support for PDFLaTeX and several add-on LaTeX packages +installed. This includes: - amsmath +- anysize - babel - capt-of - cmap @@ -105,24 +66,16 @@ to be installed (e.g. from texlive): - tabulary - upquote - wrapfig +Also the latexmk script is required to run PDFLaTeX and related tools. +the required number of times to have self-consistent output and include +updated bibliography and indices. + +Building the EPUB format requires LaTeX installation with the same packages +as for the PDF format plus the 'dvipng' command to convert the embedded math +into images. The MOBI format is generated from the EPUB format file by using +the tool 'ebook-convert' from the 'calibre' e-book management software +(https://calibre-ebook.com). ---------------- -Installing prerequisites for epub build - -## ePUB - -Same as for HTML. This uses the same tools and configuration -files as the HTML tree. The ePUB format conversion currently -does not support processing mathematical expressions via MathJAX, -so there will be limitations on some pages. For the time being -until this is resolved, building and using the PDF format file -is recommended instead. - -For converting the generated ePUB file to a mobi format file -(for e-book readers like Kindle, that cannot read ePUB), you -also need to have the 'ebook-convert' tool from the "calibre" -software installed. http://calibre-ebook.com/ -You first create the ePUB file with 'make epub' and then do: - -ebook-convert LAMMPS.epub LAMMPS.mobi - +More details this can be found in the manual itself. The online +version is at: https://lammps.sandia.gov/doc/Manual_build.html diff --git a/doc/documentation_conventions.md b/doc/documentation_conventions.md new file mode 100644 index 0000000000..40526d940d --- /dev/null +++ b/doc/documentation_conventions.md @@ -0,0 +1,93 @@ +# Outline of LAMMPS documentation file conventions + +This purpose of this document is to provide a point of reference +for LAMMPS developers and contributors as to what conventions +should be used to structure and format files in the LAMMPS manual. + +Last change: 2020-04-23 + +## File format and tools + +In fall 2019, the LAMMPS documentation file format has changed from +a home grown minimal markup designed to generate HTML format files +from a mostly plain text format to using the reStructuredText file +format. For a transition period all files in the old .txt format +were transparently converted to .rst and then processed. The txt2rst +tool is still included in the distribution to obtain an initial .rst +file for integration into the manual. Since the transition to +reStructured text as source format, many of the artifacts or the +translation have been removed though and parts of the documentation +refactored and expanded to take advantage of the capabilities +reStructuredText and associated tools. The conversion from the +source to the final formats (HTML, PDF, and optionally e-book +reader formats ePUB and MOBI) is mostly automated and controlled +by a Makefile in the `doc` folder. This makefile assumes that the +processing is done on a Unix-like machine and Python 3.5 or later +and a matching virtualenv module are available. Additional Python +packages (like the Sphinx tool and several extensions) are +transparently installed into a virtual environment over the +internet using the `pip` package manager. Further requirements +and details are discussed in the manual. + +## Work in progress + +The refactoring and improving of the documentation is an ongoing +process, so statements in this document may not always be fully +up-to-date. If in doubt, contact the LAMMPS developers. + +## General structure + +The layout and formatting of added files should follow the example +of the existing files. Since those are directly derived from their +former .txt format versions and the manual has been maintained in +that format for many years, there is a large degree of consistency +already, so comparision with similar files should give you a good +idea what kind of information and sections are needed. + +## Formatting conventions + +Filenames, folders, paths, (shell) commands, definitions, makefile +settings and similar should be formatted as "literals" with +double backward quotes bracketing the item: \`\`path/to/some/file\`\` + +Keywords and options are formatted in italics: \*option\* + +Mathematical expressions, equations, symbols are typeset using +either a `.. math:`` block or the `:math:` role. + +Groups of shell commands or LAMMPS input script or C/C++ source +code should be typeset into a `.. code-block::` section. A syntax +highlighting extension for LAMMPS input scripts is provided, so +`LAMMPS` can be used to indicate the language in the code block +in addition to `bash`, `c`, or `python`. When no syntax style +is indicated, no syntax highlighting is performed. + +As an alternative, e.g. to typeset the syntax of file formats +a `.. parsed-literal::` block can be used, which allows some +formatting directives, which means that related characters need +to be escaped with a preceding backslash: `\*`. + +Special remarks can be highlighted with a `.. note::` block and +strong warnings can be put into a `.. warning::` block. + +## Required steps when adding a custom style to LAMMPS + +When adding a new style (e.g. pair style or a compute or a fix) +or a new command, it is **required** to include the corresponding +documentation. Those are often new files that need to be added. +In order to be included in the documentation, those new files +need to be reference in a `.. toctree::` block. Most of those +use patterns with wildcards, so the addition will be automatic. +However, those additions also need to be added to some lists of +styles or commands. The `make style\_check` command will perform +a test and report any missing entries and list the affected files. +Any references defined with `.. \_refname:` have to be unique +across all documentation files and this can be checked for with +`make anchor\_check`. Finally, a spell-check should be done, +which is triggered via `make spelling`. Any offenses need to +be corrected and false positives should be added to the file +`utils/sphinx-config/false\_positives.txt`. + +## Required additional steps when adding a new package to LAMMPS + +TODO diff --git a/doc/doxygen/.gitignore b/doc/doxygen/.gitignore new file mode 100644 index 0000000000..2539ab748e --- /dev/null +++ b/doc/doxygen/.gitignore @@ -0,0 +1 @@ +/xml diff --git a/doc/doxygen/Doxyfile.in b/doc/doxygen/Doxyfile.in new file mode 100644 index 0000000000..f8a5bc6cdb --- /dev/null +++ b/doc/doxygen/Doxyfile.in @@ -0,0 +1,533 @@ +# Doxyfile 1.8.15 -*- makefile -*- + +DOXYFILE_ENCODING = UTF-8 +PROJECT_NAME = "LAMMPS Programmer's Guide" +PROJECT_NUMBER = "24 August 2020" +PROJECT_BRIEF = "Documentation of the LAMMPS library interface and Python wrapper" +PROJECT_LOGO = lammps-logo.png +CREATE_SUBDIRS = NO +ALLOW_UNICODE_NAMES = NO +OUTPUT_LANGUAGE = English +OUTPUT_TEXT_DIRECTION = LTR + +BRIEF_MEMBER_DESC = YES +REPEAT_BRIEF = YES + +ALWAYS_DETAILED_SEC = NO +INLINE_INHERITED_MEMB = NO +FULL_PATH_NAMES = NO +INHERIT_DOCS = YES +TAB_SIZE = 2 + +# When enabled doxygen tries to link words that correspond to documented +# classes, or namespaces to their corresponding documentation. Such a link can +# be prevented in individual cases by putting a % sign in front of the word or +# globally by setting AUTOLINK_SUPPORT to NO. +# The default value is: YES. +AUTOLINK_SUPPORT = YES + +# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want +# to include (a tag file for) the STL sources as input, then you should set this +# tag to YES in order to let doxygen match functions declarations and +# definitions whose arguments contain STL classes (e.g. func(std::string); +# versus func(std::string) {}). This also make the inheritance and collaboration +# diagrams that involve STL classes more complete and accurate. +# The default value is: NO. + +BUILTIN_STL_SUPPORT = YES +IDL_PROPERTY_SUPPORT = NO + +# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This +# cache is used to resolve symbols given their name and scope. Since this can be +# an expensive process and often the same symbol appears multiple times in the +# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small +# doxygen will become slower. If the cache is too large, memory is wasted. The +# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range +# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 +# symbols. At the end of a run doxygen will report the cache usage and suggest +# the optimal cache size from a speed point of view. +# Minimum value: 0, maximum value: 9, default value: 0. + +LOOKUP_CACHE_SIZE = 2 + +#--------------------------------------------------------------------------- +# Build related configuration options +#--------------------------------------------------------------------------- + +# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in +# documentation are documented, even if no documentation was available. Private +# class members and static file members will be hidden unless the +# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. +# Note: This will also disable the warnings about undocumented members that are +# normally produced when WARNINGS is set to YES. +# The default value is: NO. + +EXTRACT_ALL = NO + +# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will +# be included in the documentation. +# The default value is: NO. + +EXTRACT_PRIVATE = YES + +# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal +# scope will be included in the documentation. +# The default value is: NO. + +EXTRACT_PACKAGE = YES + +# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be +# included in the documentation. +# The default value is: NO. + +EXTRACT_STATIC = YES + +# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined +# locally in source files will be included in the documentation. If set to NO, +# only classes defined in header files are included. Does not have any effect +# for Java sources. +# The default value is: YES. + +EXTRACT_LOCAL_CLASSES = YES + +# If this flag is set to YES, the members of anonymous namespaces will be +# extracted and appear in the documentation as a namespace called +# 'anonymous_namespace{file}', where file will be replaced with the base name of +# the file that contains the anonymous namespace. By default anonymous namespace +# are hidden. +# The default value is: NO. + +EXTRACT_ANON_NSPACES = YES + +# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all +# undocumented members inside documented classes or files. If set to NO these +# members will be included in the various overviews, but no documentation +# section is generated. This option has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_MEMBERS = YES + +# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all +# undocumented classes that are normally visible in the class hierarchy. If set +# to NO, these classes will be included in the various overviews. This option +# has no effect if EXTRACT_ALL is enabled. +# The default value is: NO. + +HIDE_UNDOC_CLASSES = YES + +# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend +# (class|struct|union) declarations. If set to NO, these declarations will be +# included in the documentation. +# The default value is: NO. + +HIDE_FRIEND_COMPOUNDS = NO + +# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any +# documentation blocks found inside the body of a function. If set to NO, these +# blocks will be appended to the function's detailed documentation block. +# The default value is: NO. + +HIDE_IN_BODY_DOCS = NO + +# The INTERNAL_DOCS tag determines if documentation that is typed after a +# \internal command is included. If the tag is set to NO then the documentation +# will be excluded. Set it to YES to include the internal documentation. +# The default value is: NO. + +INTERNAL_DOCS = NO + +# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file +# names in lower-case letters. If set to YES, upper-case letters are also +# allowed. This is useful if you have classes or files whose names only differ +# in case and if your file system supports case sensitive file names. Windows +# and Mac users are advised to set this option to NO. +# The default value is: system dependent. + +CASE_SENSE_NAMES = YES + +# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with +# their full class and namespace scopes in the documentation. If set to YES, the +# scope will be hidden. +# The default value is: NO. + +HIDE_SCOPE_NAMES = YES + +# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will +# append additional text to a page's title, such as Class Reference. If set to +# YES the compound reference will be hidden. +# The default value is: NO. + +HIDE_COMPOUND_REFERENCE= NO + +# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of +# the files that are included by a file in the documentation of that file. +# The default value is: YES. + +SHOW_INCLUDE_FILES = NO + +# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each +# grouped member an include statement to the documentation, telling the reader +# which file to include in order to use the member. +# The default value is: NO. + +SHOW_GROUPED_MEMB_INC = NO + +# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include +# files with double quotes in the documentation rather than with sharp brackets. +# The default value is: NO. + +FORCE_LOCAL_INCLUDES = NO + +# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the +# documentation for inline members. +# The default value is: YES. + +INLINE_INFO = YES + +# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the +# (detailed) documentation of file and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. +# The default value is: YES. + +SORT_MEMBER_DOCS = NO + +# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief +# descriptions of file, namespace and class members alphabetically by member +# name. If set to NO, the members will appear in declaration order. Note that +# this will also influence the order of the classes in the class list. +# The default value is: NO. + +SORT_BRIEF_DOCS = NO + +# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the +# (brief and detailed) documentation of class members so that constructors and +# destructors are listed first. If set to NO the constructors will appear in the +# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. +# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief +# member documentation. +# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting +# detailed member documentation. +# The default value is: NO. + +SORT_MEMBERS_CTORS_1ST = NO + +# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy +# of group names into alphabetical order. If set to NO the group names will +# appear in their defined order. +# The default value is: NO. + +SORT_GROUP_NAMES = NO + +# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by +# fully-qualified names, including namespaces. If set to NO, the class list will +# be sorted only by class name, not including the namespace part. +# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. +# Note: This option applies only to the class list, not to the alphabetical +# list. +# The default value is: NO. + +SORT_BY_SCOPE_NAME = NO + +# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper +# type resolution of all parameters of a function it will reject a match between +# the prototype and the implementation of a member function even if there is +# only one candidate or it is obvious which candidate to choose by doing a +# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still +# accept a match between prototype and implementation in such cases. +# The default value is: NO. + +STRICT_PROTO_MATCHING = NO + +# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo +# list. This list is created by putting \todo commands in the documentation. +# The default value is: YES. + +GENERATE_TODOLIST = YES + +# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test +# list. This list is created by putting \test commands in the documentation. +# The default value is: YES. + +GENERATE_TESTLIST = YES + +# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug +# list. This list is created by putting \bug commands in the documentation. +# The default value is: YES. + +GENERATE_BUGLIST = YES + +# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) +# the deprecated list. This list is created by putting \deprecated commands in +# the documentation. +# The default value is: YES. + +GENERATE_DEPRECATEDLIST= YES + +# The ENABLED_SECTIONS tag can be used to enable conditional documentation +# sections, marked by \if ... \endif and \cond +# ... \endcond blocks. + +ENABLED_SECTIONS = + +# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the +# initial value of a variable or macro / define can have for it to appear in the +# documentation. If the initializer consists of more lines than specified here +# it will be hidden. Use a value of 0 to hide initializers completely. The +# appearance of the value of individual variables and macros / defines can be +# controlled using \showinitializer or \hideinitializer command in the +# documentation regardless of this setting. +# Minimum value: 0, maximum value: 10000, default value: 30. + +MAX_INITIALIZER_LINES = 30 + +# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at +# the bottom of the documentation of classes and structs. If set to YES, the +# list will mention the files that were used to generate the documentation. +# The default value is: YES. + +SHOW_USED_FILES = YES + +# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This +# will remove the Files entry from the Quick Index and from the Folder Tree View +# (if specified). +# The default value is: YES. + +SHOW_FILES = NO + +# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces +# page. This will remove the Namespaces entry from the Quick Index and from the +# Folder Tree View (if specified). +# The default value is: YES. + +SHOW_NAMESPACES = YES + +# The FILE_VERSION_FILTER tag can be used to specify a program or script that +# doxygen should invoke to get the current version for each file (typically from +# the version control system). Doxygen will invoke the program by executing (via +# popen()) the command command input-file, where command is the value of the +# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided +# by doxygen. Whatever the program writes to standard output is used as the file +# version. For an example see the documentation. + +FILE_VERSION_FILTER = + +# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed +# by doxygen. The layout file controls the global structure of the generated +# output files in an output format independent way. To create the layout file +# that represents doxygen's defaults, run doxygen with the -l option. You can +# optionally specify a file name after the option, if omitted DoxygenLayout.xml +# will be used as the name of the layout file. +# +# Note that if you run doxygen from a directory containing a file called +# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE +# tag is left empty. + +LAYOUT_FILE = + +# The CITE_BIB_FILES tag can be used to specify one or more bib files containing +# the reference definitions. This must be a list of .bib files. The .bib +# extension is automatically appended if omitted. This requires the bibtex tool +# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. +# For LaTeX the style of the bibliography can be controlled using +# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the +# search path. See also \cite for info how to create references. + +CITE_BIB_FILES = + +#--------------------------------------------------------------------------- +# Configuration options related to warning and progress messages +#--------------------------------------------------------------------------- + +# The QUIET tag can be used to turn on/off the messages that are generated to +# standard output by doxygen. If QUIET is set to YES this implies that the +# messages are off. +# The default value is: NO. + +QUIET = NO + +# The WARNINGS tag can be used to turn on/off the warning messages that are +# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES +# this implies that the warnings are on. +# +# Tip: Turn warnings on while writing the documentation. +# The default value is: YES. + +WARNINGS = YES + +# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate +# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag +# will automatically be disabled. +# The default value is: YES. + +WARN_IF_UNDOCUMENTED = YES + +# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for +# potential errors in the documentation, such as not documenting some parameters +# in a documented function, or documenting parameters that don't exist or using +# markup commands wrongly. +# The default value is: YES. + +WARN_IF_DOC_ERROR = YES + +# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that +# are documented, but have no documentation for their parameters or return +# value. If set to NO, doxygen will only warn about wrong or incomplete +# parameter documentation, but not about the absence of documentation. If +# EXTRACT_ALL is set to YES then this flag will automatically be disabled. +# The default value is: NO. + +WARN_NO_PARAMDOC = YES + +# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when +# a warning is encountered. +# The default value is: NO. + +WARN_AS_ERROR = NO + +# The WARN_FORMAT tag determines the format of the warning messages that doxygen +# can produce. The string should contain the $file, $line, and $text tags, which +# will be replaced by the file and line number from which the warning originated +# and the warning text. Optionally the format may contain $version, which will +# be replaced by the version of the file (if it could be obtained via +# FILE_VERSION_FILTER) +# The default value is: $file:$line: $text. + +WARN_FORMAT = "$file:$line: $text" + +# The WARN_LOGFILE tag can be used to specify a file to which warning and error +# messages should be written. If left blank the output is written to standard +# error (stderr). + +WARN_LOGFILE = "../doxygen-warn.log" + +#--------------------------------------------------------------------------- +# Configuration options related to the input files +#--------------------------------------------------------------------------- + +# The INPUT tag is used to specify the files and/or directories that contain +# documented source files. You may enter file names like myfile.cpp or +# directories like /usr/src/myproject. Separate the files or directories with +# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING +# Note: If this tag is empty the current directory is searched. + +INPUT = @LAMMPS_SOURCE_DIR@/utils.cpp \ + @LAMMPS_SOURCE_DIR@/utils.h \ + @LAMMPS_SOURCE_DIR@/library.cpp \ + @LAMMPS_SOURCE_DIR@/library.h \ + @LAMMPS_SOURCE_DIR@/lammps.cpp \ + @LAMMPS_SOURCE_DIR@/lammps.h \ + @LAMMPS_SOURCE_DIR@/pointers.h \ + @LAMMPS_SOURCE_DIR@/lmptype.h \ + @LAMMPS_SOURCE_DIR@/atom.cpp \ + @LAMMPS_SOURCE_DIR@/atom.h \ + @LAMMPS_SOURCE_DIR@/input.cpp \ + @LAMMPS_SOURCE_DIR@/input.h \ + @LAMMPS_SOURCE_DIR@/tokenizer.cpp \ + @LAMMPS_SOURCE_DIR@/tokenizer.h \ + @LAMMPS_SOURCE_DIR@/text_file_reader.cpp \ + @LAMMPS_SOURCE_DIR@/text_file_reader.h \ + @LAMMPS_SOURCE_DIR@/potential_file_reader.cpp \ + @LAMMPS_SOURCE_DIR@/potential_file_reader.h \ + @LAMMPS_SOURCE_DIR@/my_page.cpp \ + @LAMMPS_SOURCE_DIR@/my_page.h \ + @LAMMPS_SOURCE_DIR@/my_pool_chunk.cpp \ + @LAMMPS_SOURCE_DIR@/my_pool_chunk.h \ + @LAMMPS_SOURCE_DIR@/math_eigen.h \ + +# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or +# directories that are symbolic links (a Unix file system feature) are excluded +# from the input. +# The default value is: NO. + +EXCLUDE_SYMLINKS = YES + +#--------------------------------------------------------------------------- +# Configuration options related to output +#--------------------------------------------------------------------------- + +GENERATE_HTML = NO +GENERATE_LATEX = NO +GENERATE_XML = YES +XML_OUTPUT = xml +XML_PROGRAMLISTING = YES +XML_NS_MEMB_FILE_SCOPE = NO + +#--------------------------------------------------------------------------- +# Configuration options related to the preprocessor +#--------------------------------------------------------------------------- + +# If the ENABLE_PREPROCESSING tag is set to YES, doxygen will evaluate all +# C-preprocessor directives found in the sources and include files. +# The default value is: YES. + +#ENABLE_PREPROCESSING = YES +ENABLE_PREPROCESSING = NO + +# If the MACRO_EXPANSION tag is set to YES, doxygen will expand all macro names +# in the source code. If set to NO, only conditional compilation will be +# performed. Macro expansion can be done in a controlled way by setting +# EXPAND_ONLY_PREDEF to YES. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +MACRO_EXPANSION = NO + +# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES then +# the macro expansion is limited to the macros specified with the PREDEFINED and +# EXPAND_AS_DEFINED tags. +# The default value is: NO. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_ONLY_PREDEF = NO + +# If the SEARCH_INCLUDES tag is set to YES, the include files in the +# INCLUDE_PATH will be searched if a #include is found. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SEARCH_INCLUDES = YES + +# The INCLUDE_PATH tag can be used to specify one or more directories that +# contain include files that are not input files but should be processed by the +# preprocessor. +# This tag requires that the tag SEARCH_INCLUDES is set to YES. + +INCLUDE_PATH = + +# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard +# patterns (like *.h and *.hpp) to filter out the header-files in the +# directories. If left blank, the patterns specified with FILE_PATTERNS will be +# used. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +INCLUDE_FILE_PATTERNS = + +# The PREDEFINED tag can be used to specify one or more macro names that are +# defined before the preprocessor is started (similar to the -D option of e.g. +# gcc). The argument of the tag is a list of macros of the form: name or +# name=definition (no spaces). If the definition and the "=" are omitted, "=1" +# is assumed. To prevent a macro definition from being undefined via #undef or +# recursively expanded use the := operator instead of the = operator. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +PREDEFINED = + +# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this +# tag can be used to specify a list of macro names that should be expanded. The +# macro definition that is found in the sources will be used. Use the PREDEFINED +# tag if you want to use a different macro definition that overrules the +# definition found in the source code. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +EXPAND_AS_DEFINED = + +# If the SKIP_FUNCTION_MACROS tag is set to YES then doxygen's preprocessor will +# remove all references to function-like macros that are alone on a line, have +# an all uppercase name, and do not end with a semicolon. Such function macros +# are typically used for boiler-plate code, and will confuse the parser if not +# removed. +# The default value is: YES. +# This tag requires that the tag ENABLE_PREPROCESSING is set to YES. + +SKIP_FUNCTION_MACROS = YES + diff --git a/doc/doxygen/lammps-logo.png b/doc/doxygen/lammps-logo.png new file mode 100644 index 0000000000..787d855a1c Binary files /dev/null and b/doc/doxygen/lammps-logo.png differ diff --git a/doc/github-development-workflow.md b/doc/github-development-workflow.md index fd38c983a2..a7d41dd32a 100644 --- a/doc/github-development-workflow.md +++ b/doc/github-development-workflow.md @@ -136,7 +136,8 @@ Here are some items to check: * string.h -> cstring * time.h -> ctime * Do NOT replace (as they are C++-11): `inttypes.h` and `stdint.h`. - * Code should follow the C++-98 standard. C++-11 is only accepted + * Code must follow the C++-11 standard. C++98-only is no longer accepted + * Code should use `nullptr` instead of `NULL` where applicable. in individual special purpose packages * indentation is 2 spaces per level * there should be NO tabs and no trailing whitespace (review the "checkstyle" test on pull requests) @@ -145,6 +146,8 @@ Here are some items to check: Forward declarations should be used instead when possible. * iostreams should be avoided. LAMMPS uses stdio from the C-library. * use of STL in headers and class definitions should be avoided. + exception is , but it won't need to be explicitly included + since pointers.h already includes it. so std::string can be used directly. * there MUST NOT be any "using namespace XXX;" statements in headers. * static class members should be avoided at all cost. * anything storing atom IDs should be using `tagint` and not `int`. @@ -152,6 +155,8 @@ Here are some items to check: compiling LAMMPS with `-DLAMMPS_BIGBIG`. * when including both `lmptype.h` (and using defines or macros from it) and `mpi.h`, `lmptype.h` must be included first. + * see https://github.com/lammps/lammps/blob/master/doc/include-file-conventions.md + for general include file conventions and best practices * when pair styles are added, check if settings for flags like `single_enable`, `writedata`, `reinitflag`, `manybody_flag` and others are correctly set and supported. diff --git a/doc/graphviz/.gitignore b/doc/graphviz/.gitignore new file mode 100644 index 0000000000..b134fdb6f1 --- /dev/null +++ b/doc/graphviz/.gitignore @@ -0,0 +1,3 @@ +/*.png +/*.svg +/*.pdf diff --git a/doc/graphviz/Makefile b/doc/graphviz/Makefile new file mode 100644 index 0000000000..a8c424c540 --- /dev/null +++ b/doc/graphviz/Makefile @@ -0,0 +1,29 @@ +# Makefile for generating images with graphviz +# +BUILDDIR = ${CURDIR}/.. +IMGDIR = $(BUILDDIR)/src/JPG +IMGSRC = $(wildcard *.dot) +IMGPNG = $(IMGSRC:%.dot=$(IMGDIR)/%.png) + +HAS_DOT = NO +ifeq ($(shell which dot >/dev/null 2>&1; echo $$?), 0) +HAS_DOT = YES +endif + +all: $(IMGPNG) + +clean: + rm -f $(IMGSVG) $(IMGPDF) $(IMGPNG) *~ + +ifeq ($(HAS_DOT),YES) +$(IMGDIR)/%.png: %.dot + dot -Tpng -o $@ $< +endif + +ifeq ($(HAS_DOT),NO) +$(IMGDIR)/%.png: %.dot + @echo '###################################################' + @echo '# Need to install "graphviz" to regenerate graphs #' + @echo '###################################################' +endif + diff --git a/doc/graphviz/lammps-classes.dot b/doc/graphviz/lammps-classes.dot new file mode 100644 index 0000000000..408ab36f65 --- /dev/null +++ b/doc/graphviz/lammps-classes.dot @@ -0,0 +1,90 @@ +// LAMMPS Class topology +digraph lammps { + rankdir="LR" + La [shape=circle label="LAMMPS"] + At [shape=box label="Atom" color=blue] + Ci [shape=box label="CiteMe"] + Co [shape=box label="Comm" color=blue] + Do [shape=box label="Domain" color=blue] + Er [shape=box label="Error" color=blue] + Fo [shape=box label="Force" color=blue] + Gr [shape=box label="Group" color=blue] + In [shape=box label="Input" color=blue] + Ko [shape=box label="KokkosLMP"] + Ak [shape=box label="AtomKK" color=blue] + Mk [shape=box label="MemoryKK" color=blue] + Me [shape=box label="Memory" color=blue] + Mo [shape=box label="Modify" color=blue] + Ne [shape=box label="Neighbor" color=blue] + Ou [shape=box label="Output" color=blue] + Py [shape=box label="Python" color=blue] + Up [shape=box label="Update" color=blue] + Un [shape=box label="Universe" color=blue] + Ti [shape=box label="Timer" color=blue] + Rg [label="Region" color=red] + Rb [shape=box label="RegionBlock"] + Rs [shape=box label="RegionSphere"] + Av [label="AtomVec" color=red] + It [label="Integrate" color=red] + Mi [label="Min" color=red] + Pa [label="Pair" color=red] + Bo [label="Bond" color=red] + An [label="Angle" color=red] + Di [label="Dihedral" color=red] + Im [label="Improper" color=red] + Ks [label="Kspace" color=red] + Du [label="Dump" color=red] + Fi [label="Fix" color=red] + Cp [label="Compute" color=red] + Th [label="Thermo"] + Va [label="Variable"] + Ew [shape=box label="Ewald"] + Pp [shape=box label="PPPM"] + Ff [label="FFT3d"] + Re [label="Remap"] + Gc [label="GridComm"] + Cb [shape=box label="CommBrick"] + Ct [shape=box label="CommTiled"] + Aa [shape=box label="AtomVecAtomic"] + Am [shape=box label="AtomVecMolecular"] + Lj [shape=box label="PairLJCut"] + Lo [shape=box label="PairLJCutOMP"] + Lg [shape=box label="PairLJCutGPU"] + Te [shape=box label="PairTersoff"] + Bh [shape=box label="BondHarmonic"] + Bf [shape=box label="BondFENE"] + Fa [shape=box label="FixAveTime"] + Fn [shape=box label="FixNVE"] + Fh [shape=box label="FixNH"] + Fp [shape=box label="FixNPT"] + Ft [shape=box label="FixNVT"] + Da [shape=box label="DumpAtom"] + Dc [shape=box label="DumpCustom"] + Dg [shape=box label="DumpCFG"] + Ve [shape=box label="Verlet"] + Rr [shape=box label="Respa"] + Po [shape=box label="PPPMOmp"] + La -> {At Ci Co Do Er Fo Gr In Ko Ak Mk Me Mo Ne Ou Py Ti Up Un} [penwidth=2] + Do -> {Rg} [penwidth=2] + Co -> {Cb Ct} [style=dashed penwidth=2] + Rg -> {Rb Rs} [style=dashed penwidth=2] + In -> Va [penwidth=2] + Mo -> {Fi Cp} [penwidth=2] + Fo -> {Pa Bo An Di Im Ks} [penwidth=2] + Ks -> {Ew Pp} [style=dashed penwidth=2] + Pp -> {Ff Re Gc} [penwidth=2] + Pp -> {Po} [style=dashed penwidth=2] + Up -> {It Mi} [penwidth=2] + It -> {Ve Rr} [style=dashed penwidth=2] + Ou -> {Du Th} [penwidth=2] + Du -> {Da Dc} [style=dashed penwidth=2] + Dc -> {Dg} [style=dashed penwidth=2] + At -> Av [penwidth=2] + Av -> {Aa Am} [style=dashed penwidth=2] + Pa -> {Lj Te} [style=dashed penwidth=2] + Lj -> {Lo Lg} [style=dashed penwidth=2] + Bo -> {Bh Bf} [style=dashed penwidth=2] + Fi -> {Fa Fn Fh} [style=dashed penwidth=2] + Fh -> {Fp Ft} [style=dashed penwidth=2] +} + diff --git a/doc/include-file-conventions.md b/doc/include-file-conventions.md index 51f67afbbb..87b9eba8df 100644 --- a/doc/include-file-conventions.md +++ b/doc/include-file-conventions.md @@ -3,7 +3,7 @@ This purpose of this document is to provide a point of reference for LAMMPS developers and contributors as to what include files and definitions to put where into LAMMPS source. -Last change 2019-07-05 +Last change 2020-08-31 ## Table of Contents @@ -91,29 +91,31 @@ statements should follow the "include what you use" principle. Include files should be included in this order: * the header matching the implementation (`some_class.h` for file `some_class.cpp`) -* mpi.h -* system and library headers (anything that is using angular brackets; C-library headers first, then C++) +* mpi.h (only if needed) * LAMMPS local headers (preferably in alphabetical order) +* system and library headers (anything that is using angular brackets; preferably in alphabetical order) +* conditional include statements (i.e. anything bracketed with ifdefs) ### Special Cases and Exceptions #### pointers.h -The `pointer.h` header file also includes `cstdio` and `lmptype.h` -(and through it `stdint.h`, `intttypes.h`, cstdlib, and `climits`). +The `pointer.h` header file also includes (in this order) `lmptype.h`, +`mpi.h`, `cstddef`, `cstdio`, `string`, `utils.h`, and `fmt/format.h` +and through `lmptype.h` indirectly also `climits`, `cstdlib`, `cinttypes`. This means any header including `pointers.h` can assume that `FILE`, -`NULL`, `INT_MAX` are defined. +`NULL`, `INT_MAX` are defined, and the may freely use the std::string +for arguments. Corresponding implementation files do not need to include +those headers. ## Tools The [Include What You Use tool](https://include-what-you-use.org/) can be used to provide supporting information about compliance with -the rules listed here. There are some limitations and the IWYU tool -may give incorrect advice. The tools is activated by setting the -CMake variable `CMAKE_CXX_INCLUDE_WHAT_YOU_USE` variable to the -path of the `include-what-you-use` command. When activated, the -tool will be run after each compilation and provide suggestions for -which include files should be added or removed. +the rules listed here. Through setting `-DENABLE_IWYU=on` when running +CMake, a custom build target is added that will enable recording +the compilation commands and then run the `iwyu_tool` using the +recorded compilation commands information when typing `make iwyu`. ## Legacy Code diff --git a/doc/lammps.1 b/doc/lammps.1 index 1e389ea3ce..71795325e8 100644 --- a/doc/lammps.1 +++ b/doc/lammps.1 @@ -1,4 +1,4 @@ -.TH LAMMPS "21 July 2020" "2020-07-21" +.TH LAMMPS "18 September 2020" "2020-09-18" .SH NAME .B LAMMPS \- Molecular Dynamics Simulator. diff --git a/doc/requirements.txt b/doc/requirements.txt deleted file mode 100644 index 045559d8c4..0000000000 --- a/doc/requirements.txt +++ /dev/null @@ -1,4 +0,0 @@ -Sphinx -sphinxcontrib-spelling -breathe -Pygments diff --git a/doc/src/Bibliography.rst b/doc/src/Bibliography.rst new file mode 100644 index 0000000000..7789ae6e7b --- /dev/null +++ b/doc/src/Bibliography.rst @@ -0,0 +1,1394 @@ +Bibliography +************ + +**(Ackland)** + Ackland, Jones, Phys Rev B, 73, 054104 (2006). + +**(Ackland1)** + Ackland, Condensed Matter (2005). + +**(Ackland2)** + Ackland, Mendelev, Srolovitz, Han and Barashev, Journal of Physics: Condensed Matter, 16, S2629 (2004). + +**(Addington)** + Addington, Long, Gubbins, J Chem Phys, 149, 084109 (2018). + +**(Adhikari et al.)** + Adhikari, R., Stratford, K., Cates, M. E., and Wagner, A. J., Fluctuating lattice Boltzmann, Europhys. Lett. 71 (2005) 473-479. + +**(Afshar)** + Afshar, F. Schmid, A. Pishevar, S. Worley, Comput Phys Comm, 184, 1119-1128 (2013). + +**(Agnolin and Roux 2007)** + Agnolin, I. & Roux, J-N. (2007). Internal states of model isotropic granular packings. I. Assembling process, geometry, and contact networks. Phys. Rev. E, 76, 061302. + +**(Aktulga)** + Aktulga, Fogarty, Pandit, Grama, Parallel Computing, 38, 245-259 (2012). + +**(Albe)** + J.\ Nord, K. Albe, P. Erhart, and K. Nordlund, J. Phys.: Condens. Matter, 15, 5649(2003). + +**(Albe)** + K.\ Albe, K. Nordlund, J. Nord, and A. Kuronen, Phys. Rev. B, 66, 035205 (2002). + +**(Allen)** + Allen and Germano, Mol Phys 104, 3225-3235 (2006). + +**(Allen)** + Allen and Tildesley, Computer Simulation of Liquids, Clarendon Press, Oxford, 1987. + +**(AllenTildesley)** + Allen and Tildesley, Computer Simulation of Liquids, Oxford University Press (1987) + +**(Allinger)** + Allinger, Yuh, Lii, JACS, 111(23), 8551-8566 (1989), + +**(Andersen)** + H.\ Andersen, J of Comp Phys, 52, 24-34 (1983). + +**(Anderson)** + Anderson, Mukherjee, Critchley, Ziegler, and Lipton "POEMS: Parallelizable Open-source Efficient Multibody Software ", Engineering With Computers (2006). + +**(Avendano)** + C.\ Avendano, T. Lafitte, A. Galindo, C. S. Adjiman, G. Jackson, E. Muller, J Phys Chem B, 115, 11154 (2011). + +**(Axilrod)** + Axilrod and Teller, J Chem Phys, 11, 299 (1943); Muto, Nippon Sugaku-Buturigakkwaishi 17, 629 (1943). + +**(Babadi)** + Babadi, Ejtehadi, Everaers, J Comp Phys, 219, 770-779 (2006). + +**(Babadi)** + Babadi and Ejtehadi, EPL, 77 (2007) 23002. + +**(Baczewski)** + A.D. Baczewski and S.D. Bond, J. Chem. Phys. 139, 044107 (2013). + +**(Bal)** + K.\ M Bal and E. C. Neyts, J. Chem. Phys. 141, 204104 (2014). + +**(Ball)** + Ball and Melrose, Physica A, 247, 444-472 (1997). + +**(Ballenegger)** + Ballenegger, Arnold, Cerda, J Chem Phys, 131, 094107 (2009). + +**(Banna)** + Volkov, Banna, Comp. Mater. Sci. 176, 109410 (2020). + +**(Barrat)** + Barrat and Rodney, J. Stat. Phys, 144, 679 (2011). + +**(Barrett)** + Barrett, Tschopp, El Kadiri, Scripta Mat. 66, p.666 (2012). + +**(Bartok)** + Bartok, Payne, Risi, Csanyi, Phys Rev Lett, 104, 136403 (2010). + +**(Bartok2010)** + Bartok, Payne, Risi, Csanyi, Phys Rev Lett, 104, 136403 (2010). + +**(Bartok_2010)** + AP Bartok, MC Payne, R Kondor, and G Csanyi, Physical Review Letters 104, 136403 (2010). + +**(Bartok_PhD)** + A Bartok-Partay, PhD Thesis, University of Cambridge, (2010). + +**(Baskes)** + Baskes, Phys Rev B, 46, 2727-2742 (1992). + +**(Beck)** + Beck, Molecular Physics, 14, 311 (1968). + +**(Bennet)** + Bennet, J Comput Phys, 22, 245 (1976) + +**(Berardi)** + Berardi, Fava, Zannoni, Chem Phys Lett, 297, 8-14 (1998). Berardi, Muccioli, Zannoni, J Chem Phys, 128, 024905 (2008). + +**(Berendsen)** + Berendsen, Grigera, Straatsma, J Phys Chem, 91, 6269-6271 (1987). + +**(Berendsen)** + Berendsen, Postma, van Gunsteren, DiNola, Haak, J Chem Phys, 81, 3684 (1984). + +**(Bessarab)** + Bessarab, Uzdin, Jonsson, Comp Phys Comm, 196, 335-347 (2015). + +**(Beutler)** + Beutler, Mark, van Schaik, Gerber, van Gunsteren, Chem Phys Lett, 222, 529 (1994). + +**(Bialke)** + J.\ Bialke, T. Speck, and H Loewen, Phys. Rev. Lett. 108, 168301, 2012. + +**(Bird)** + G.\ A. Bird, "Molecular Gas Dynamics and the Direct Simulation of Gas Flows" (1994). + +**(Bitzek)** + Bitzek, Koskinen, Gahler, Moseler, Gumbsch, Phys Rev Lett, 97, 170201 (2006). + +**(Bond)** + Bond and Leimkuhler, SIAM J Sci Comput, 30, p 134 (2007). + +**(Boone)** + Boone, Babaei, Wilmer, J Chem Theory Comput, 15, 5579--5587 (2019). + +**(BoreschKarplus)** + Boresch and Karplus, J Phys Chem A, 103, 103 (1999) + +**(Botu1)** + V.\ Botu and R. Ramprasad, Int. J. Quant. Chem., 115(16), 1074 (2015). + +**(Botu2)** + V.\ Botu and R. Ramprasad, Phys. Rev. B, 92(9), 094306 (2015). + +**(Botu3)** + V.\ Botu, R. Batra, J. Chapman and R. Ramprasad, https://arxiv.org/abs/1610.02098 (2016). + +**(Branicio2009)** + Branicio, Rino, Gan and Tsuzuki, J. Phys Condensed Matter 21 (2009) 095002 + +**(Brennan)** + Brennan, J Chem Phys Lett, 5, 2144-2149 (2014). + +**(Brenner)** + Brenner, Shenderova, Harrison, Stuart, Ni, Sinnott, J Physics: Condensed Matter, 14, 783-802 (2002). + +**(Brilliantov)** + Brilliantov, Spahn, Hertzsch, Poschel, Phys Rev E, 53, p 5382-5392 (1996). + +**(Brooks)** + Brooks, Brooks, MacKerell Jr., J Comput Chem, 30, 1545 (2009). + +**(Brooks)** + Brooks, et al, J Comput Chem, 30, 1545 (2009). + +**(Brown)** + Brown et al. International Tables for Crystallography Volume C: Mathematical and Chemical Tables, 554-95 (2004). + +**(Buck)** + Buck, Bouguet-Bonnet, Pastor, MacKerell Jr., Biophys J, 90, L36 (2006). + +**(Bussi)** + G.\ Bussi, M. Parrinello, Phs. Rev. E 75, 056707 (2007) + +**(Bussi1)** + Bussi, Donadio and Parrinello, J. Chem. Phys. 126, 014101(2007) + +**(Bussi2)** + Bussi and Parrinello, Phys. Rev. E 75, 056707 (2007) + +**(COMB)** + T.-R. Shan, B. D. Devine, T. W. Kemper, S. B. Sinnott, and S. R. Phillpot, Phys. Rev. B 81, 125328 (2010) + +**(COMB3)** + T.\ Liang, T.-R. Shan, Y.-T. Cheng, B. D. Devine, M. Noordhoek, Y. Li, Z. Lu, S. R. Phillpot, and S. B. Sinnott, Mat. Sci. & Eng: R 74, 255-279 (2013). + +**(COMB_1)** + J.\ Yu, S. B. Sinnott, S. R. Phillpot, Phys Rev B, 75, 085311 (2007), + +**(Calhoun)** + A.\ Calhoun, M. Pavese, G. Voth, Chem Phys Letters, 262, 415 (1996). + +**(Campana)** + C.\ Campana and M. H. Muser, *Practical Green's function approach to the simulation of elastic semi-infinite solids*\ , `Phys. Rev. B [74], 075420 (2006) `_ + +**(Cao1)** + J.\ Cao and B. Berne, J Chem Phys, 99, 2902 (1993). + +**(Cao2)** + J.\ Cao and G. Voth, J Chem Phys, 100, 5093 (1994). + +**(Caro)** + A Caro, DA Crowson, M Caro; Phys Rev Lett, 95, 075702 (2005) + +**(CasP)** + CasP webpage: https://www.helmholtz-berlin.de/people/gregor-schiwietz/casp_en.html + +**(Cawkwell2012)** + A.\ M. N. Niklasson, M. J. Cawkwell, Phys. Rev. B, 86 (17), 174308 (2012). + +**(Cercignani)** + C.\ Cercignani and M. Lampis. Trans. Theory Stat. Phys. 1, 2, 101 (1971). + +**(Cerda)** + Cerda, Ballenegger, Lenz, Holm, J Chem Phys 129, 234104 (2008) + +**(Ceriotti)** + Ceriotti, Bussi and Parrinello, J Chem Theory Comput 6, 1170-80 (2010) + +**(Ceriotti2)** + Ceriotti, Bussi and Parrinello, Phys Rev Lett 103, 030603 (2009) + +**(Cerutti)** + Cerutti, Duke, Darden, Lybrand, Journal of Chemical Theory and Computation 5, 2322 (2009) + +**(Chen)** + J Chen, D Tzou and J Beraun, Int. J. Heat Mass Transfer, 49, 307-316 (2006). + +**(Chenoweth_2008)** + Chenoweth, van Duin and Goddard, Journal of Physical Chemistry A, 112, 1040-1053 (2008). + +**(Clarke)** + Clarke and Smith, J Chem Phys, 84, 2290 (1986). + +**(Coleman)** + Coleman, Spearot, Capolungo, MSMSE, 21, 055020 (2013). + +**(Colliex)** + Colliex et al. International Tables for Crystallography Volume C: Mathematical and Chemical Tables, 249-429 (2004). + +**(Cooke)** + "Cooke, Kremer and Deserno, Phys. Rev. E, 72, 011506 (2005)" + +**(Cornell)** + Cornell, Cieplak, Bayly, Gould, Merz, Ferguson, Spellmeyer, Fox, Caldwell, Kollman, JACS 117, 5179-5197 (1995). + +**(Cusentino)** + Cusentino, Wood, and Thompson, J Phys Chem A, xxx, xxxxx, (2020) + +**(Daivis and Todd)** + Daivis and Todd, J Chem Phys, 124, 194103 (2006). + +**(Daivis and Todd)** + Daivis and Todd, Nonequilibrium Molecular Dynamics (book), Cambridge University Press, https://doi.org/10.1017/9781139017848, (2017). + +**(Dammak)** + Dammak, Chalopin, Laroche, Hayoun, and Greffet, Phys Rev Lett, 103, 190601 (2009). + +**(Darden)** + Darden, York, Pedersen, J Chem Phys, 98, 10089 (1993). + +**(Davidchack)** + R.L Davidchack, T.E. Ouldridge, and M.V. Tretyakov. J. Chem. Phys. 142, 144114 (2015). + +**(Daw1)** + Daw, Baskes, Phys Rev Lett, 50, 1285 (1983). Daw, Baskes, Phys Rev B, 29, 6443 (1984). + +**(Daw2)** + M.\ S. Daw, and M. I. Baskes, Phys. Rev. B, 29, 6443 (1984). + +**(DeVane)** + Shinoda, DeVane, Klein, Soft Matter, 4, 2453-2462 (2008). + +**(Deserno)** + Deserno and Holm, J Chem Phys, 109, 7694 (1998). + +**(Destree)** + M.\ Destree, F. Laupretre, A. Lyulin, and J.-P. Ryckaert, J Chem Phys, 112, 9632 (2000). + +**(Dobson)** + Dobson, J Chem Phys, 141, 184103 (2014). + +**(Duffy)** + D M Duffy and A M Rutherford, J. Phys.: Condens. Matter, 19, 016207-016218 (2007). + +**(Dullweber)** + Dullweber, Leimkuhler and McLachlan, J Chem Phys, 107, 5840 (1997). + +**(Dunn1)** + Dunn and Noid, J Chem Phys, 143, 243148 (2015). + +**(Dunn2)** + Dunn, Lebold, DeLyser, Rudzinski, and Noid, J. Phys. Chem. B, 122, 3363 (2018). + +**(Dunweg)** + Dunweg and Paul, Int J of Modern Physics C, 2, 817-27 (1991). + +**(EDIP)** + J F Justo et al, Phys Rev B 58, 2539 (1998). + +**(Eike)** + Eike and Maginn, Journal of Chemical Physics, 124, 164503 (2006). + +**(Elliott)** + Elliott, Tadmor and Bernstein, `https://openkim.org/kim-api `_ (2011) doi: `https://doi.org/10.25950/FF8F563A `_ + +**(Elstner)** + M.\ Elstner, D. Poresag, G. Jungnickel, J. Elsner, M. Haugk, T. Frauenheim, S. Suhai, and G. Seifert, Phys. Rev. B, 58, 7260 (1998). + +**(Erdmann)** + U.\ Erdmann , W. Ebeling, L. Schimansky-Geier, and F. Schweitzer, Eur. Phys. J. B 15, 105-113, 2000. + +**(Espanol and Revenga)** + Espanol, Revenga, Physical Review E, 67, 026705 (2003). + +**(Espanol1997)** + Espanol, Europhys Lett, 40(6): 631-636 (1997). DOI: 10.1209/epl/i1997-00515-8 + +**(Evans and Morriss)** + Evans and Morriss, Phys Rev A, 30, 1528 (1984). + +**(Evans)** + Evans and Morriss, Phys. Rev. Lett. 56, 2172 (1986). + +**(Everaers)** + Everaers and Ejtehadi, Phys Rev E, 67, 041710 (2003). + +**(Faken)** + Faken, Jonsson, Comput Mater Sci, 2, 279 (1994). + +**(Fath)** + Fath, Hochbruck, Singh, J Comp Phys, 333, 180-198 (2017). + +**(Fennell)** + C.\ J. Fennell, J. D. Gezelter, J Chem Phys, 124, 234104 (2006). + +**(Feynman)** + R.\ Feynman and A. Hibbs, Chapter 7, Quantum Mechanics and Path Integrals, McGraw-Hill, New York (1965). + +**(Fichthorn)** + Fichthorn, Balankura, Qi, CrystEngComm, 18(29), 5410-5417 (2016). + +**(Fily)** + Y.\ Fily and M.C. Marchetti, Phys. Rev. Lett. 108, 235702, 2012. Default + +**(Fincham)** + Fincham, Mackrodt and Mitchell, J Phys Condensed Matter, 6, 393-404 (1994). + +**(Finnis1)** + Finnis, Sinclair, Philosophical Magazine A, 50, 45 (1984). + +**(Finnis2)** + M.\ W. Finnis, A. T. Paxton, M. Methfessel, and M. van Schilfgarde, Phys. Rev. Lett., 81, 5149 (1998). + +**(Fiorin)** + Fiorin, Klein, Henin, Mol. Phys., DOI:10.1080/00268976.2013.813594 + +**(Fox)** + Fox, O'Keefe, Tabbernor, Acta Crystallogr. A, 45, 786-93 (1989). + +**(Fraige)** + F.\ Y. Fraige, P. A. Langston, A. J. Matchett, J. Dodds, Particuology, 6, 455 (2008). + +**(Freitas)** + Freitas, Asta, and de Koning, Computational Materials Science, 112, 333 (2016). + +**(Frenkel)** + Frenkel and Smit, Understanding Molecular Simulation, Academic Press, London, 2002. + +**(GLE4MD)** + `http://gle4md.org/ `_ + +**(Gao)** + Gao and Weber, Nuclear Instruments and Methods in Physics Research B 191 (2012) 504. + +**(Gissinger)** + Gissinger, Jensen and Wise, Polymer, 128, 211 (2017). + +**(Glosli)** + Glosli, unpublished, 2005. Streitz, Glosli, Patel, Chan, Yates, de Supinski, Sexton and Gunnels, Journal of Physics: Conference Series, 46, 254 (2006). + +**(Goldman1)** + Goldman, Reed and Fried, J. Chem. Phys. 131, 204103 (2009) + +**(Goldman2)** + Goldman, Srinivasan, Hamel, Fried, Gaus, and Elstner, J. Phys. Chem. C, 117, 7885 (2013). + +**(Grime)** + Grime and Voth, to appear in J Chem Theory & Computation (2014). + +**(Grimme)** + Grimme, J Comput Chem, 27(15), 1787-1799 (2006). + +**(Gronbech-Jensen1)** + Gronbech Jensen and Gronbech-Jensen, Mol Phys, 117, 2511 (2019) + +**(Gronbech-Jensen2)** + Gronbech-Jensen and Farago, Mol Phys, 111, 983 (2013) + +**(Gronbech-Jensen3)** + Hayre, and Farago, Comp Phys Comm, 185, 524 (2014) + +**(Groot)** + Groot and Warren, J Chem Phys, 107: 4423-4435 (1997). DOI: 10.1063/1.474784 + +**(Guenole)** + Guenole, Noehring, Vaid, Houlle, Xie, Prakash, Bitzek, Comput Mater Sci, 175, 109584 (2020). + +**(Gullet)** + Gullet, Wagner, Slepoy, SANDIA Report 2003-8782 (2003). + +**(Guo)** + Guo and Thirumalai, Journal of Molecular Biology, 263, 323-43 (1996). + +**(Hardy)** + David Hardy thesis: Multilevel Summation for the Fast Evaluation of Forces for the Simulation of Biomolecules, University of Illinois at Urbana-Champaign, (2006). + +**(Hardy2)** + Hardy, Stone, Schulten, Parallel Computing, 35, 164-177 (2009). + +**(Hecht)** + Hecht, Harting, Ihle, Herrmann, Phys Rev E, 72, 011408 (2005). + +**(Henkelman1)** + Henkelman and Jonsson, J Chem Phys, 113, 9978-9985 (2000). + +**(Henkelman2)** + Henkelman, Uberuaga, Jonsson, J Chem Phys, 113, 9901-9904 (2000). + +**(Henkes)** + Henkes, S, Fily, Y., and Marchetti, M. C. Phys. Rev. E, 84, 040301(R), 2011. + +**(Henrich)** + O.\ Henrich, Y. A. Gutierrez-Fosado, T. Curk, T. E. Ouldridge, Eur. Phys. J. E 41, 57 (2018). + +**(Hess)** + Hess, B. The Journal of Chemical Physics 2002, 116 (1), 209-217. + +**(Heyes)** + Heyes, Phys Rev B, 49, 755 (1994). + +**(Hijazi)** + M.\ Hijazi, D. M. Wilkins, M. Ceriotti, J. Chem. Phys. 148, 184109 (2018) + +**(Hockney)** + Hockney and Eastwood, Computer Simulation Using Particles, Adam Hilger, NY (1989). + +**(Holian)** + Holian and Ravelo, Phys Rev B, 51, 11275 (1995). + +**(Hone)** + T.\ Hone, P. Rossky, G. Voth, J Chem Phys, 124, 154103 (2006). + +**(Hoover)** + Hoover, Phys Rev A, 31, 1695 (1985). + +**(Hummer)** + Hummer, Gronbech-Jensen, Neumann, J Chem Phys, 109, 2791 (1998) + +**(Hunt)** + Hunt, Mol Simul, 42, 347 (2016). + +**(IPI)** + `http://epfl-cosmo.github.io/gle4md/index.html?page=ipi `_ + +**(IPI-CPC)** + Ceriotti, More and Manolopoulos, Comp Phys Comm, 185, 1019-1026 (2014). + +**(Ikeshoji)** + Ikeshoji and Hafskjold, Molecular Physics, 81, 251-261 (1994). + +**(In 't Veld)** + In 't Veld, Ismail, Grest, J Chem Phys (accepted) (2007). + +**(Isele-Holder)** + Isele-Holder, Mitchell, Ismail, J Chem Phys, 137, 174107 (2012). + +**(Isele-Holder2)** + Isele-Holder, Mitchell, Hammond, Kohlmeyer, Ismail, J Chem Theory Comput 9, 5412 (2013). + +**(Ismail)** + Ismail, Tsige, In 't Veld, Grest, Molecular Physics (accepted) (2007). + +**(Ivanov)** + Ivanov, Uzdin, Jonsson. arXiv preprint arXiv:1904.02669, (2019). + +**(Izrailev)** + Izrailev, Stepaniants, Isralewitz, Kosztin, Lu, Molnar, Wriggers, Schulten. Computational Molecular Dynamics: Challenges, Methods, Ideas, volume 4 of Lecture Notes in Computational Science and + +**(Izvekov)** + Izvekov, Voth, J Chem Phys 123, 134105 (2005). + +**(Janssens)** + Janssens, Olmsted, Holm, Foiles, Plimpton, Derlet, Nature Materials, 5, 124-127 (2006). + +**(Jaramillo-Botero)** + Jaramillo-Botero, Su, Qi, Goddard, Large-scale, Long-term Non-adiabatic Electron Molecular Dynamics for Describing Material Properties and Phenomena in Extreme Environments, J Comp + +**(Jarzynski)** + Jarzynski, Phys. Rev. Lett. 78, 2690 (1997) + +**(Jiang)** + Jiang, Hardy, Phillips, MacKerell, Schulten, and Roux, J Phys Chem Lett, 2, 87-92 (2011). + +**(Johnson et al, 1971)** + Johnson, K. L., Kendall, K., & Roberts, A. D. (1971). Surface energy and the contact of elastic solids. Proc. R. Soc. Lond. A, 324(1558), 301-313. + +**(Jones)** + Jones, RE; Templeton, JA; Wagner, GJ; Olmsted, D; Modine, JA, "Electron transport enhanced molecular dynamics for metals and semi-metals." International Journal for Numerical Methods in Engineering (2010), 83:940. + +**(Jonsson)** + Jonsson, Mills and Jacobsen, in Classical and Quantum Dynamics in Condensed Phase Simulations, edited by Berne, Ciccotti, and Coker World Scientific, Singapore, 1998, p 385. + +**(Jorgensen)** + Jorgensen, Chandrasekhar, Madura, Impey, Klein, J Chem Phys, 79, 926 (1983). + +**(Jusufi)** + Jusufi, Hynninen, and Panagiotopoulos, J Phys Chem B, 112, 13783 (2008). + +**(Kamberaj)** + Kamberaj, Low, Neal, J Chem Phys, 122, 224114 (2005). + +**(Katsura)** + H.\ Katsura, N. Nagaosa, A.V. Balatsky. Phys. Rev. Lett., 95(5), 057205. (2005) + +**(Kelchner)** + Kelchner, Plimpton, Hamilton, Phys Rev B, 58, 11085 (1998). + +**(Khrapak)** + Khrapak, Chaudhuri, and Morfill, J Chem Phys, 134, 054120 (2011). + +**(Kim)** + Kim, Keyes, Straub, J Chem. Phys, 132, 224107 (2010). + +**(Klapp)** + Klapp, Schoen, J Chem Phys, 117, 8050 (2002). + +**(Kolafa)** + Kolafa and Perram, Molecular Simulation, 9, 351 (1992). + +**(Kolmogorov)** + A.\ N. Kolmogorov, V. H. Crespi, Phys. Rev. B 71, 235415 (2005). + +**(Kong)** + L.T. Kong, G. Bartels, C. Campana, C. Denniston, and Martin H. Muser, `Computer Physics Communications [180](6):1004-1010 (2009). `_ + +**(Kong2011)** + L.T. Kong, `Computer Physics Communications [182](10):2201-2207, (2011). `_ + +**(Kremer)** + Kremer, Grest, J Chem Phys, 92, 5057 (1990). + +**(Kuhn and Bagi, 2005)** + Kuhn, M. R., & Bagi, K. (2004). Contact rolling and deformation in granular media. International journal of solids and structures, 41(21), 5793-5820. + +**(Kumagai)** + T.\ Kumagai, S. Izumi, S. Hara, S. Sakai, Comp. Mat. Science, 39, 457 (2007). + +**(Kumar)** + Kumar and Higdon, Phys Rev E, 82, 051401 (2010). + +**(Kumar)** + Kumar and Skinner, J. Phys. Chem. B, 112, 8311 (2008) + +**(Lamoureux and Roux)** + G.\ Lamoureux, B. Roux, J. Chem. Phys 119, 3025 (2003) + +**(Lamoureux)** + Lamoureux and Roux, J Chem Phys, 119, 3025-3039 (2003). + +**(Larentzos)** + J.P. Larentzos, J.K. Brennan, J.D. Moore, and W.D. Mattson, "LAMMPS Implementation of Constant Energy Dissipative Particle Dynamics (DPD-E)", ARL-TR-6863, U.S. Army Research + +**(Larentzos1)** + J.P. Larentzos, J.K. Brennan, J.D. Moore, M. Lisal and W.D. Mattson, "Parallel Implementation of Isothermal and Isoenergetic Dissipative Particle Dynamics Using Shardlow-Like Splitting + +**(Larentzos2)** + J.P. Larentzos, J.K. Brennan, J.D. Moore, and W.D. Mattson, "LAMMPS Implementation of Constant Energy Dissipative Particle Dynamics (DPD-E)", ARL-TR-6863, U.S. Army Research + +**(Larsen)** + Larsen, Schmidt, Schiotz, Modelling Simul Mater Sci Eng, 24, 055007 (2016). + +**(Lebedeva et al.)** + I.\ V. Lebedeva, A. A. Knizhnik, A. M. Popov, Y. E. Lozovik, B. V. Potapkin, Phys. Rev. B, 84, 245437 (2011) + +**(Lechman)** + Lechman, et al, in preparation (2010). + +**(Lee)** + Lee, Baskes, Phys. Rev. B, 62, 8564-8567 (2000). + +**(Lee2)** + Lee, Baskes, Kim, Cho. Phys. Rev. B, 64, 184102 (2001). + +**(Lenart)** + Lenart , Jusufi, and Panagiotopoulos, J Chem Phys, 126, 044509 (2007). + +**(Lenosky)** + Lenosky, Sadigh, Alonso, Bulatov, de la Rubia, Kim, Voter, Kress, Modelling Simulation Materials Science Engineering, 8, 825 (2000). + +**(Leven1)** + I.\ Leven, I. Azuri, L. Kronik and O. Hod, J. Chem. Phys. 140, 104106 (2014). + +**(Leven2)** + I.\ Leven et al, J. Chem.Theory Comput. 12, 2896-905 (2016). + +**(Li2013_POF)** + Li, Hu, Wang, Ma, Zhou, Phys Fluids, 25: 072103 (2013). DOI: 10.1063/1.4812366. + +**(Li2014_JCP)** + Li, Tang, Lei, Caswell, Karniadakis, J Comput Phys, 265: 113-127 (2014). DOI: 10.1016/j.jcp.2014.02.003. + +**(Li2015_CC)** + Li, Tang, Li, Karniadakis, Chem Commun, 51: 11038-11040 (2015). DOI: 10.1039/C5CC01684C. + +**(Li2015_JCP)** + Li, Yazdani, Tartakovsky, Karniadakis, J Chem Phys, 143: 014101 (2015). DOI: 10.1063/1.4923254. + +**(Lisal)** + M.\ Lisal, J.K. Brennan, J. Bonet Avalos, "Dissipative particle dynamics at isothermal, isobaric, isoenergetic, and isoenthalpic conditions using Shardlow-like splitting algorithms.", + +**(Liu1)** + L.\ Liu, Y. Liu, S. V. Zybin, H. Sun and W. A. Goddard, Journal of Physical Chemistry A, 115, 11016-11022 (2011). + +**(Liu2)** + Liu, Bryantsev, Diallo, Goddard III, J. Am. Chem. Soc 131 (8) 2798 (2009) + +**(Los and Fasolino)** + J.\ H. Los and A. Fasolino, Phys. Rev. B 68, 024107 (2003). + +**(Los2017)** + J.\ H. Los et al. "Extended Tersoff potential for boron nitride: Energetics and elastic properties of pristine and defective h-BN", Phys. Rev. B 96 (184108), 2017. + +**(Luding, 2008)** + Luding, S. (2008). Cohesive, frictional powders: contact models for tension. Granular matter, 10(4), 235. + +**(Maaravi)** + T.\ Maaravi et al, J. Phys. Chem. C 121, 22826-22835 (2017). + +**(MacKerell)** + MacKerell, Bashford, Bellott, Dunbrack, Evanseck, Field, Fischer, Gao, Guo, Ha, et al, J Phys Chem B, 102, 3586 (1998). + +**(Mackay and Denniston)** + Mackay, F. E., and Denniston, C., Coupling MD particles to a lattice-Boltzmann fluid through the use of conservative forces, J. Comput. Phys. 237 (2013) 289-298. + +**(Mackay et al.)** + Mackay, F. E., Ollila, S.T.T., and Denniston, C., Hydrodynamic Forces Implemented into LAMMPS through a lattice-Boltzmann fluid, Computer Physics Communications 184 (2013) 2021-2031. + +**(Magda)** + Magda, Tirrell, Davis, J Chem Phys, 83, 1888-1901 (1985); erratum in JCP 84, 2901 (1986). + +**(Maginn)** + Kelkar, Rafferty, Maginn, Siepmann, Fluid Phase Equilibria, 260, 218-231 (2007). + +**(Malolepsza)** + Malolepsza, Secor, Keyes, J Phys Chem B 119 (42), 13379-13384 (2015). + +**(Mandadapu)** + Mandadapu, KK; Templeton, JA; Lee, JW, "Polarization as a field variable from molecular dynamics simulations." Journal of Chemical Physics (2013), 139:054115. Please refer to the standard finite element (FE) texts, e.g. T.J.R Hughes " The finite element method ", Dover 2003, for the basics of FE simulation. + +**(Maras)** + Maras, Trushin, Stukowski, Ala-Nissila, Jonsson, Comp Phys Comm, 205, 13-21 (2016). + +**(Marrink)** + Marrink, de Vries, Mark, J Phys Chem B, 108, 750-760 (2004). + +**(Marshall, 2009)** + Marshall, J. S. (2009). Discrete-element modeling of particulate aerosol flows. Journal of Computational Physics, 228(5), 1541-1561. + +**(Martyna1992)** + Martyna, Klein, Tuckerman, J Chem Phys, 97, 2635 (1992); Martyna, Tuckerman, Tobias, Klein, Mol Phys, 87, 1117. + +**(Martyna1994)** + Martyna, Tobias and Klein, J Chem Phys, 101, 4177 (1994). + +**(Mason)** + J.\ K. Mason, Acta Cryst A65, 259 (2009). + +**(Mattice)** + Mattice, Suter, Conformational Theory of Large Molecules, Wiley, New York, 1994. + +**(Maxwell)** + J.C. Maxwell, Philos. Tans. Royal Soc. London, 157: 49-88 (1867). + +**(Mayergoyz)** + I.D. Mayergoyz, G. Bertotti, C. Serpico (2009). Elsevier (2009) + +**(Mayo)** + Mayo, Olfason, Goddard III, J Phys Chem, 94, 8897-8909 (1990). + +**(Mees)** + M.\ J. Mees, G. Pourtois, E. C. Neyts, B. J. Thijsse, and A. Stesmans, Phys. Rev. B 85, 134301 (2012). + +**(Mei)** + Mei, Davenport, Fernando, Phys Rev B, 43 4653 (1991) + +**(Melchor)** + Gonzalez-Melchor, Mayoral, Velazquez, and Alejandre, J Chem Phys, 125, 224107 (2006). + +**(Meloni)** + Meloni, Rosati and Colombo, J Chem Phys, 126, 121102 (2007). + +**(Meremianin)** + Meremianin, J. Phys. A, 39, 3099 (2006). + +**(Mezei)** + Mezei, J Chem Phys, 86, 7084 (1987) + +**(Mickel)** + W.\ Mickel, S. C. Kapfer, G. E. Schroeder-Turkand, K. Mecke, J. Chem. Phys. 138, 044501 (2013). + +**(Mie)** + G.\ Mie, Ann Phys, 316, 657 (1903). + +**(Miller1)** + T.\ F. Miller III, M. Eleftheriou, P. Pattnaik, A. Ndirango, G. J. Martyna, J. Chem. Phys., 116, 8649-8659 (2002). + +**(Miller2)** + Miller, Tadmor, Gibson, Bernstein and Pavia, J Chem Phys, 144, 184107 (2016). + +**(Minary)** + Minary, Martyna, and Tuckerman, J Chem Phys, 18, 2510 (2003). + +**(Mindlin and Deresiewicz, 1953)** + Mindlin, R.D., & Deresiewicz, H (1953). Elastic Spheres in Contact under Varying Oblique Force. J. Appl. Mech., ASME 20, 327-344. + +**(Mindlin, 1949)** + Mindlin, R. D. (1949). Compliance of elastic bodies in contact. J. Appl. Mech., ASME 16, 259-268. + +**(Miron)** + R.\ A. Miron and K. A. Fichthorn, J Chem Phys, 119, 6210 (2003). + +**(Mishin)** + Mishin, Mehl, and Papaconstantopoulos, Acta Mater, 53, 4029 (2005). + +**(Mitchell and Finchham)** + Mitchell, Finchham, J Phys Condensed Matter, 5, 1031-1038 (1993). + +**(Mitchell2011)** + Mitchell. A non-local, ordinary-state-based viscoelasticity model for peridynamics. Sandia National Lab Report, 8064:1-28 (2011). + +**(Mitchell2011a)** + Mitchell. A Nonlocal, Ordinary, State-Based Plasticity Model for Peridynamics. Sandia National Lab Report, 3166:1-34 (2011). + +**(Mniszewski)** + S.\ M. Mniszewski, M. J. Cawkwell, M. E. Wall, J. Mohd-Yusof, N. Bock, T. C. Germann, and A. M. N. Niklasson, J. Chem. Theory Comput., 11, 4644 (2015). + +**(Monaghan)** + Monaghan and Gingold, Journal of Computational Physics, 52, 374-389 (1983). + +**(Moore)** + Moore, J Chem Phys, 144, 104501 (2016). + +**(Mori)** + Y.\ Mori, Y. Okamoto, J. Phys. Soc. Jpn., 7, 074003 (2010). + +**(Moriarty1)** + Moriarty, Physical Review B, 38, 3199 (1988). + +**(Moriarty2)** + Moriarty, Physical Review B, 42, 1609 (1990). Moriarty, Physical Review B 49, 12431 (1994). + +**(Moriarty3)** + Moriarty, Benedict, Glosli, Hood, Orlikowski, Patel, Soderlind, Streitz, Tang, and Yang, Journal of Materials Research, 21, 563 (2006). + +**(Morris)** + Morris, Fox, Zhu, J Comp Physics, 136, 214-226 (1997). + +**(Moustafa)** + Sabry G. Moustafa, Andrew J. Schultz, and David A. Kofke, *Very fast averaging of thermal properties of crystals by molecular simulation*\ , `Phys. Rev. E [92], 043303 (2015) `_ + +**(Muller-Plathe1)** + Muller-Plathe, J Chem Phys, 106, 6082 (1997). + +**(Muller-Plathe2)** + Muller-Plathe, Phys Rev E, 59, 4894-4898 (1999). + +**(Murdick)** + D.A. Murdick, X.W. Zhou, H.N.G. Wadley, D. Nguyen-Manh, R. Drautz, and D.G. Pettifor, Phys. Rev. B, 73, 45206 (2006). + +**(Murty)** + M.V.R. Murty, H.A. Atwater, Phys Rev B, 51, 4889 (1995). + +**(Nakano)** + A.\ Nakano, Computer Physics Communications, 104, 59-69 (1997). + +**(Neelov)** + Neelov, Holm, J Chem Phys 132, 234103 (2010) + +**(Negre2016)** + C.\ F. A. Negre, S. M. Mniszewski, M. J. Cawkwell, N. Bock, M. E. Wall, and A. M. N. Niklasson, J. Chem. Theory Comp., 12, 3063 (2016). + +**(Nelson)** + Nelson, Halperin, Phys Rev B, 19, 2457 (1979). + +**(Nettleton)** + Nettleton and Green, J Chem Phys, 29, 6 (1958). + +**(Neyts)** + E.\ C. Neyts and A. Bogaerts, Theor. Chem. Acc. 132, 1320 (2013). + +**(Nicholson and Rutledge)** + Nicholson and Rutledge, J Chem Phys, 145, 244903 (2016). + +**(Nicklas)** + The spline-based MEAM+SW format was first devised and used to develop potentials for bcc transition metals by Jeremy Nicklas, Michael Fellinger, + +**(Niklasson2002)** + A.\ M. N. Niklasson, Phys. Rev. B, 66, 155115 (2002). + +**(Niklasson2008)** + A.\ M. N. Niklasson, Phys. Rev. Lett., 100, 123004 (2008). + +**(Niklasson2014)** + A.\ M. N. Niklasson and M. Cawkwell, J. Chem. Phys., 141, 164123, (2014). + +**(Niklasson2017)** + A.\ M. N. Niklasson, J. Chem. Phys., 147, 054103 (2017). + +**(Noid)** + Noid, Chu, Ayton, Krishna, Izvekov, Voth, Das, Andersen, J Chem Phys 128, 134105 (2008). + +**(Nordlund95)** + Nordlund, Kai. Computational materials science 3.4 (1995): 448-456. + +**(Nordlund98)** + Nordlund, Kai, et al. Physical Review B 57.13 (1998): 7556. + +**(Norman)** + G E Norman, S V Starikov, V V Stegailov et al., Contrib. Plasma Phys., 53, 129-139 (2013). + +**(Noskov)** + Noskov, Lamoureux and Roux, J Phys Chem B, 109, 6705 (2005). + +**(Nurdin)** + Nurdin and Schotte Phys Rev E, 61(4), 3579 (2000) + +**(O'Connor)** + O'Connor et al., J. Chem. Phys. 142, 024903 (2015). + +**(Okabe)** + T.\ Okabe, M. Kawata, Y. Okamoto, M. Masuhiro, Chem. Phys. Lett., 335, 435-439 (2001). + +**(Ollila et al.)** + Ollila, S.T.T., Denniston, C., Karttunen, M., and Ala-Nissila, T., Fluctuating lattice-Boltzmann model for complex fluids, J. Chem. Phys. 134 (2011) 064902. + +**(Omelyan)** + Omelyan, Mryglod, and Folk. Phys. Rev. Lett. 86(5), 898. (2001). + +**(Oppelstrup)** + Oppelstrup, unpublished, 2015. Oppelstrup and Moriarty, to be published. + +**(Orsi)** + Orsi & Essex, The ELBA force field for coarse-grain modeling of lipid membranes, PloS ONE 6(12): e28637, 2011. + +**(Otis R. Walton)** + Walton, O.R., Personal Communication + +**(Ouldridge)** + T.E. Ouldridge, A.A. Louis, J.P.K. Doye, J. Chem. Phys. 134, 085101 (2011). + +**(Ouldridge-DPhil)** + T.E. Ouldridge, Coarse-grained modelling of DNA and DNA self-assembly, DPhil. University of Oxford (2011). + +**(Ouyang1)** + W.\ Ouyang, D. Mandelli, M. Urbakh and O. Hod, Nano Lett. 18, 6009-6016 (2018). + +**(Ouyang2)** + W.\ Ouyang et al., J. Chem. Theory Comput. 16(1), 666-676 (2020). + +**(PASS)** + PASS webpage: https://www.sdu.dk/en/DPASS + +**(PLUMED)** + G.A. Tribello, M. Bonomi, D. Branduardi, C. Camilloni and G. Bussi, Comp. Phys. Comm 185, 604 (2014) + +**(Paquay)** + Paquay and Kusters, Biophys. J., 110, 6, (2016). preprint available at `arXiv:1411.3019 `_. + +**(Park)** + Park, Schulten, J. Chem. Phys. 120 (13), 5946 (2004) + +**(Parks)** + Parks, Lehoucq, Plimpton, Silling, Comp Phys Comm, 179(11), 777-783 (2008). + +**(Parrinello1981)** + Parrinello and Rahman, J Appl Phys, 52, 7182 (1981). + +**(Paula Leite2016)** + Paula Leite , Freitas, Azevedo, and de Koning, J Chem Phys, 126, 044509 (2016). + +**(Paula Leite2017)** + Paula Leite, Santos-Florez, and de Koning, Phys Rev E, 96, 32115 (2017). + +**(Pearlman)** + Pearlman, J Chem Phys, 98, 1487 (1994) + +**(Pedersen)** + Pedersen, J. Chem. Phys., 139, 104102 (2013). + +**(Peng)** + Peng, Ren, Dudarev, Whelan, Acta Crystallogr. A, 52, 257-76 (1996). + +**(Perram)** + Perram and Rasmussen, Phys Rev E, 54, 6565-6572 (1996). + +**(Petersen)** + Petersen, J Chem Phys, 103, 3668 (1995). + +**(Petersen)** + Petersen, Lechman, Plimpton, Grest, in' t Veld, Schunk, J Chem Phys, 132, 174106 (2010). + +**(Pettifor_1)** + D.G. Pettifor and I.I. Oleinik, Phys. Rev. B, 59, 8487 (1999). + +**(Pettifor_2)** + D.G. Pettifor and I.I. Oleinik, Phys. Rev. Lett., 84, 4124 (2000). + +**(Pettifor_3)** + D.G. Pettifor and I.I. Oleinik, Phys. Rev. B, 65, 172103 (2002). + +**(Phillips)** + C.\ L. Phillips, J. A. Anderson, S. C. Glotzer, Comput Phys Comm, 230, 7191-7201 (2011). + +**(Piaggi)** + Piaggi and Parrinello, J Chem Phys, 147, 114112 (2017). + +**(Pisarev)** + V V Pisarev and S V Starikov, J. Phys.: Condens. Matter, 26, 475401 (2014). + +**(Pollock)** + Pollock and Glosli, Comp Phys Comm, 95, 93 (1996). + +**(Price1)** + Price and Brooks, J Chem Phys, 121, 10096 (2004). + +**(Price2)** + Price, Stone and Alderton, Mol Phys, 52, 987 (1984). + +**(QEq/Fire)** + T.-R. Shan, A. P. Thompson, S. J. Plimpton, in preparation + +**(Qi)** + Qi and Reed, J. Phys. Chem. A 116, 10451 (2012). + +**(Ramirez)** + J.\ Ramirez, S.K. Sukumaran, B. Vorselaars and A.E. Likhtman, J. Chem. Phys. 133, 154103 (2010). + +**(Rappe)** + Rappe and Goddard III, Journal of Physical Chemistry, 95, 3358-3363 (1991). + +**(Ravelo)** + Ravelo, Holian, Germann and Lomdahl, Phys Rev B, 70, 014103 (2004). + +**(ReaxFF)** + A.\ C. T. van Duin, S. Dasgupta, F. Lorant, W. A. Goddard III, J Physical Chemistry, 105, 9396-9049 (2001) + +**(Rector)** + Rector, Van Swol, Henderson, Molecular Physics, 82, 1009 (1994). + +**(Ree)** + Ree, Journal of Chemical Physics, 73, 5401 (1980). + +**(Reed)** + Reed, Fried, and Joannopoulos, Phys. Rev. Lett., 90, 235503 (2003). + +**(Reed2)** + Reed, J. Phys. Chem. C, 116, 2205 (2012). + +**(Rick)** + S.\ W. Rick, S. J. Stuart, B. J. Berne, J Chem Phys 101, 16141 (1994). + +**(Rohart)** + Rohart and Thiaville, Physical Review B, 88(18), 184422. (2013). + +**(Rosenberger)** + Rosenberger, Sanyal, Shell and van der Vegt, Journal of Chemical Physics, 2019, 151 (4), 044111. + +**(Rubensson)** + E.\ H. Rubensson, A. M. N. Niklasson, SIAM J. Sci. Comput. 36 (2), 147-170, (2014). + +**(Rutherford)** + A M Rutherford and D M Duffy, J. Phys.: Condens. Matter, 19, 496201-496210 (2007). + +**(Ryckaert)** + J.-P. Ryckaert, G. Ciccotti and H. J. C. Berendsen, J of Comp Phys, 23, 327-341 (1977). + +**(SMTB-Q_1)** + N.\ Salles, O. Politano, E. Amzallag, R. Tetot, Comput. Mater. Sci. 111 (2016) 181-189 + +**(SMTB-Q_2)** + E.\ Maras, N. Salles, R. Tetot, T. Ala-Nissila, H. Jonsson, J. Phys. Chem. C 2015, 119, 10391-10399 + +**(SMTB-Q_3)** + R.\ Tetot, N. Salles, S. Landron, E. Amzallag, Surface Science 616, 19-8722 28 (2013) + +**(SRIM)** + SRIM webpage: http://www.srim.org/ + +**(SW)** + F.\ H. Stillinger, and T. A. Weber, Phys. Rev. B, 31, 5262 (1985). + +**(SWM4-NDP)** + Lamoureux, Harder, Vorobyov, Roux, MacKerell, Chem Phys Let, 418, 245-249 (2006) + +**(Sadigh)** + B Sadigh, P Erhart, A Stukowski, A Caro, E Martinez, and L Zepeda-Ruiz, Phys. Rev. B, 85, 184203 (2012). + +**(Safran)** + Safran, Statistical Thermodynamics of Surfaces, Interfaces, And Membranes, Westview Press, ISBN: 978-0813340791 (2003). + +**(Salerno)** + Salerno, Bernstein, J Chem Theory Comput, --, ---- (2018). + +**(Sanyal1)** + Sanyal and Shell, Journal of Chemical Physics, 2016, 145 (3), 034109. + +**(Sanyal2)** + Sanyal and Shell, Journal of Physical Chemistry B, 122 (21), 5678-5693. + +**(Schelling)** + Patrick K. Schelling, Comp. Mat. Science, 44, 274 (2008). + +**(Schlitter1)** + Schlitter, Swegat, Mulders, "Distance-type reaction coordinates for modelling activated processes", J Molecular Modeling, 7, 171-177 (2001). + +**(Schlitter2)** + Schlitter and Klahn, "The free energy of a reaction coordinate at multiple constraints: a concise formulation", Molecular Physics, 101, 3439-3443 (2003). + +**(Schmid)** + S.\ Bureekaew, S. Amirjalayer, M. Tafipolsky, C. Spickermann, T.K. Roy and R. Schmid, Phys. Status Solidi B, 6, 1128 (2013). + +**(Schneider)** + Schneider and Stoll, Phys Rev B, 17, 1302 (1978). + +**(Schratt & Mohles)** + Schratt, Mohles. Comp. Mat. Sci. 182 (2020) 109774 ---------- + +**(Schroeder)** + Schroeder and Steinhauser, J Chem Phys, 133, 154511 (2010). + +**(Semaev)** + Semaev, Cryptography and Lattices, 181 (2001). + +**(Sheppard)** + Sheppard, Terrell, Henkelman, J Chem Phys, 128, 134106 (2008). See ref 1 in this paper for original reference to Qmin in Jonsson, Mills, Jacobsen. + +**(Shinoda)** + Shinoda, DeVane, Klein, Mol Sim, 33, 27 (2007). + +**(Shinoda)** + Shinoda, Shiga, and Mikami, Phys Rev B, 69, 134103 (2004). + +**(Sides)** + Sides, Grest, Stevens, Plimpton, J Polymer Science B, 42, 199-208 (2004). + +**(Silbert)** + Silbert, Ertas, Grest, Halsey, Levine, Plimpton, Phys Rev E, 64, p 051302 (2001). + +**(Silbert, 2001)** + Silbert, L. E., Ertas, D., Grest, G. S., Halsey, T. C., Levine, D., & Plimpton, S. J. (2001). Granular flow down an inclined plane: Bagnold scaling and rheology. Physical Review E, + +**(Silling 2000)** + Silling, J Mech Phys Solids, 48, 175-209 (2000). + +**(Silling 2007)** + Silling, Epton, Weckner, Xu, Askari, J Elasticity, 88, 151-184 (2007). + +**(Singh)** + Singh and Warner, Acta Mater, 58, 5797-5805 (2010), + +**(Sirk1)** + Sirk TW, Sliozberg YR, Brennan JK, Lisal M, Andzelm JW, J Chem Phys, 136 (13) 134903, 2012. + +**(Sirk2)** + Sirk, Moore, Brown, J Chem Phys, 138, 064505 (2013). + +**(Skomski)** + Skomski, R. (2008). Simple models of magnetism. Oxford University Press. + +**(Snodin)** + B.E. Snodin, F. Randisi, M. Mosayebi, et al., J. Chem. Phys. 142, 234901 (2015). + +**(Srivastava)** + Zhigilei, Wei, Srivastava, Phys. Rev. B 71, 165417 (2005). + +**(Steinbach)** + Steinbach, Brooks, J Comput Chem, 15, 667 (1994). + +**(Steinhardt)** + P.\ Steinhardt, D. Nelson, and M. Ronchetti, Phys. Rev. B 28, 784 (1983). + +**(Stiles)** + Stiles , Hubbard, and Kayser, J Chem Phys, 77, 6189 (1982). + +**(Stillinger)** + Stillinger, Weber, Phys. Rev. B 31, 5262 (1985). + +**(Stoddard)** + Stoddard and Ford, Phys Rev A, 8, 1504 (1973). + +**(Streitz)** + F.\ H. Streitz, J. W. Mintmire, Phys Rev B, 50, 11996-12003 (1994). + +**(Strong)** + Strong and Eaves, J. Phys. Chem. B 121, 189 (2017). + +**(Stuart)** + Stuart, Tutein, Harrison, J Chem Phys, 112, 6472-6486 (2000). + +**(Stukowski)** + Stukowski, Sadigh, Erhart, Caro; Modeling Simulation Materials Science & Engineering, 7, 075005 (2009). + +**(Su)** + Su and Goddard, Excited Electron Dynamics Modeling of Warm Dense Matter, Phys Rev Lett, 99:185003 (2007). + +**(Sulc1)** + P.\ Sulc, F. Romano, T. E. Ouldridge, et al., J. Chem. Phys. 140, 235102 (2014). + +**(Sulc2)** + P.\ Sulc, F. Romano, T.E. Ouldridge, L. Rovigatti, J.P.K. Doye, A.A. Louis, J. Chem. Phys. 137, 135101 (2012). + +**(Sun)** + Sun, J. Phys. Chem. B, 102, 7338-7364 (1998). + +**(Surblys)** + Surblys, Matsubara, Kikugawa, Ohara, Phys Rev E, 99, 051301(R) (2019). + +**(Sutmann)** + Sutmann, Arnold, Fahrenberger, et. al., Physical review / E 88(6), 063308 (2013) + +**(Swinburne)** + Swinburne and Marinica, Physical Review Letters, 120, 1 (2018) + +**(Tadmor)** + Tadmor, Elliott, Sethna, Miller and Becker, JOM, 63, 17 (2011). doi: `https://doi.org/10.1007/s11837-011-0102-6 `_ + +**(Tainter 2011)** + Tainter, Pieniazek, Lin, and Skinner, J. Chem. Phys., 134, 184501 (2011) + +**(Tainter 2015)** + Tainter, Shi, and Skinner, 11, 2268 (2015) + +**(Templeton2010)** + Templeton, JA; Jones, RE; Wagner, GJ, "Application of a field-based method to spatially varying thermal transport problems in molecular dynamics." Modelling and Simulation in Materials Science and Engineering (2010), 18:085007. + +**(Templeton2011)** + Templeton, JA; Jones, RE; Lee, JW; Zimmerman, JA; Wong, BM, "A long-range electric field solver for molecular dynamics based on atomistic-to-continuum modeling." Journal of Chemical Theory and Computation (2011), 7:1736. + +**(Tersoff_1)** + J.\ Tersoff, Phys Rev B, 37, 6991 (1988). + +**(Tersoff_2)** + J.\ Tersoff, Phys Rev B, 38, 9902 (1988). + +**(Tersoff_3)** + J.\ Tersoff, Phys Rev B, 39, 5566 (1989); errata (PRB 41, 3248) + +**(Theodorou)** + Theodorou, Suter, Macromolecules, 18, 1206 (1985). + +**(Thole)** + Chem Phys, 59, 341 (1981). + +**(Thompson1)** + Thompson, Plimpton, Mattson, J Chem Phys, 131, 154107 (2009). + +**(Thompson2)** + Thompson, Swiler, Trott, Foiles, Tucker, J Comp Phys, 285, 316 (2015). + +**(Thornton et al, 2013)** + Thornton, C., Cummins, S. J., & Cleary, P. W. (2013). An investigation of the comparative behavior of alternative contact force models during inelastic collisions. Powder + +**(Thornton, 1991)** + Thornton, C. (1991). Interparticle sliding in the presence of adhesion. J. Phys. D: Appl. Phys. 24 1942 + +**(To)** + Q.D. To, V.H. Vu, G. Lauriat, and C. Leonard. J. Math. Phys. 56, 103101 (2015). + +**(Todd)** + B.\ D. Todd, Denis J. Evans, and Peter J. Daivis: "Pressure tensor for inhomogeneous fluids", Phys. Rev. E 52, 1627 (1995). + +**(Toukmaji)** + Toukmaji, Sagui, Board, and Darden, J Chem Phys, 113, 10913 (2000). + +**(Toxvaerd)** + Toxvaerd, Dyre, J Chem Phys, 134, 081102 (2011). + +**(Tranchida)** + Tranchida, Plimpton, Thibaudeau and Thompson, Journal of Computational Physics, 372, 406-425, (2018). + +**(Tsuji et al, 1992)** + Tsuji, Y., Tanaka, T., & Ishida, T. (1992). Lagrangian numerical simulation of plug flow of cohesionless particles in a horizontal pipe. Powder technology, 71(3), + +**(Tsuzuki)** + Tsuzuki, Branicio, Rino, Comput Phys Comm, 177, 518 (2007). + +**(Tuckerman1)** + M.\ Tuckerman and B. Berne, J Chem Phys, 99, 2796 (1993). + +**(Tuckerman2)** + Tuckerman, Alejandre, Lopez-Rendon, Jochim, and Martyna, J Phys A: Math Gen, 39, 5629 (2006). + +**(Tuckerman3)** + Tuckerman, Berne and Martyna, J Chem Phys, 97, p 1990 (1992). + +**(Tuckerman4)** + Tuckerman, Mundy, Balasubramanian, Klein, J Chem Phys, 106, 5615 (1997). + +**(Ulomek)** + Ulomek, Brien, Foiles, Mohles, Modelling Simul. Mater. Sci. Eng. 23 (2015) 025007 + +**(Vaiwala)** + Vaiwala, Jadhav, and Thaokar, J Chem Phys, 146, 124904 (2017). + +**(Valone)** + Valone, Baskes, Martin, Phys. Rev. B, 73, 214209 (2006). + +**(Varshalovich)** + Varshalovich, Moskalev, Khersonskii, Quantum Theory of Angular Momentum, World Scientific, Singapore (1987). + +**(Vashishta1990)** + P.\ Vashishta, R. K. Kalia, J. P. Rino, Phys. Rev. B 41, 12197 (1990). + +**(Vashishta2007)** + P.\ Vashishta, R. K. Kalia, A. Nakano, J. P. Rino. J. Appl. Phys. 101, 103515 (2007). + +**(Veld)** + In 't Veld, Ismail, Grest, J Chem Phys, 127, 144711 (2007). + +**(Volkov1)** + Volkov and Zhigilei, J Phys Chem C, 114, 5513 (2010). + +**(Volkov2)** + Volkov, Simov and Zhigilei, APS Meeting Abstracts, Q31.013 (2008). + +**(Voter1998)** + Voter, Phys Rev B, 57, 13985 (1998). + +**(Voter2000)** + Sorensen and Voter, J Chem Phys, 112, 9599 (2000) + +**(Voter2002)** + Voter, Montalenti, Germann, Annual Review of Materials Research 32, 321 (2002). + +**(Voter2013)** + S.\ Y. Kim, D. Perez, A. F. Voter, J Chem Phys, 139, 144110 (2013). + +**(Wagner)** + Wagner, GJ; Jones, RE; Templeton, JA; Parks, MA, "An atomistic-to-continuum coupling method for heat transfer in solids." Special Issue of Computer Methods and Applied Mechanics (2008) 197:3351. + +**(Wang et al, 2015)** + Wang, Y., Alonso-Marroquin, F., & Guo, W. W. (2015). Rolling and sliding in 3-D discrete element models. Particuology, 23, 49-55. + +**(Wang1)** + J.\ Wang, H. S. Yu, P. A. Langston, F. Y. Fraige, Granular Matter, 13, 1 (2011). + +**(Wang2)** + J.\ Wang, and A. Rockett, Phys. Rev. B, 43, 12571 (1991). + +**(Wang3)** + Wang and Holm, J Chem Phys, 115, 6277 (2001). + +**(Wang4)** + Wang, Van Hove, Ross, Baskes, J. Chem. Phys., 121, 5410 (2004). + +**(Ward)** + D.K. Ward, X.W. Zhou, B.M. Wong, F.P. Doty, and J.A. Zimmerman, Phys. Rev. B, 85,115206 (2012). + +**(Warren)** + Warren, Phys Rev E, 68, 066702 (2003). + +**(Watkins)** + Watkins and Jorgensen, J Phys Chem A, 105, 4118-4125 (2001). + +**(Weeks)** + Weeks, Chandler and Andersen, J. Chem. Phys., 54, 5237 (1971) + +**(WeinanE)** + E, Ren, Vanden-Eijnden, Phys Rev B, 66, 052301 (2002). + +**(Wen)** + M.\ Wen, S. Carr, S. Fang, E. Kaxiras, and E. B. Tadmor, Phys. Rev. B, 98, 235404 (2018) + +**(Wennberg)** + Wennberg, Murtola, Hess, Lindahl, J Chem Theory Comput, 9, 3527 (2013). + +**(Who)** + Who, Author2, Author3, J of Long Range Solvers, 35, 164-177 (2012). + +**(Wicaksono1)** + Wicaksono, Sinclair, Militzer, Computational Materials Science, 117, 397-405 (2016). + +**(Wicaksono2)** + Wicaksono, figshare, https://doi.org/10.6084/m9.figshare.1488628.v1 (2015). + +**(Wirnsberger)** + Wirnsberger, Frenkel, and Dellago, J Chem Phys, 143, 124104 (2015). + +**(Wolf)** + D.\ Wolf, P. Keblinski, S. R. Phillpot, J. Eggebrecht, J Chem Phys, 110, 8254 (1999). + +**(Wolff)** + Wolff and Rudd, Comp Phys Comm, 120, 200-32 (1999). + +**(Wood)** + Wood and Thompson, J Chem Phys, 148, 241721, (2018) + +**(Yeh)** + Yeh and Berkowitz, J Chem Phys, 111, 3155 (1999). + +**(ZBL)** + J.F. Ziegler, J.P. Biersack, U. Littmark, 'Stopping and Ranges of Ions in Matter' Vol 1, 1985, Pergamon Press. + +**(Zhang1)** + Zhang and Makse, Phys Rev E, 72, p 011301 (2005). + +**(Zhang2)** + Zhang and Trinkle, Computational Materials Science, 124, 204-210 (2016). + +**(Zhang3)** + Zhang, Glotzer, Nanoletters, 4, 1407-1413 (2004). + +**(Zhang4)** + Zhang, J Chem Phys, 106, 6102 (1997). + +**(Zhang5)** + Zhang, Lussetti, de Souza, Muller-Plathe, J Phys Chem B, 109, 15060-15067 (2005). + +**(Zhigilei1)** + Volkov and Zhigilei, ACS Nano 4, 6187 (2010). + +**(Zhigilei2)** + Volkov, Simov, Zhigilei, ASME paper IMECE2008, 68021 (2008). + +**(Zhigilei3)** + Volkov, Zhigilei, J. Phys. Chem. C 114, 5513 (2010). + +**(Zhigilei4)** + Wittmaack, Banna, Volkov, Zhigilei, Carbon 130, 69 (2018). + +**(Zhigilei5)** + Wittmaack, Volkov, Zhigilei, Compos. Sci. Technol. 166, 66 (2018). + +**(Zhigilei6)** + Wittmaack, Volkov, Zhigilei, Carbon 143, 587 (2019). + +**(Zhigilei7)** + Volkov, Zhigilei, Phys. Rev. Lett. 104, 215902 (2010). + +**(Zhigilei8)** + Volkov, Shiga, Nicholson, Shiomi, Zhigilei, J. Appl. Phys. 111, 053501 (2012). + +**(Zhigilei9)** + Volkov, Zhigilei, Appl. Phys. Lett. 101, 043113 (2012). + +**(Zhigilei10)** + Jacobs, Nicholson, Zemer, Volkov, Zhigilei, Phys. Rev. B 86, 165414 (2012). + +**(Zhou1)** + Zhou, Saidi, Fichthorn, J Phys Chem C, 118(6), 3366-3374 (2014). + +**(Zhou3)** + X.\ W. Zhou, M. E. Foster, R. E. Jones, P. Yang, H. Fan, and F. P. Doty, J. Mater. Sci. Res., 4, 15 (2015). + +**(Zhou4)** + X.\ W. Zhou, M. E. Foster, J. A. Ronevich, and C. W. San Marchi, J. Comp. Chem., 41, 1299 (2020). + +**(Zhu)** + Zhu, Tajkhorshid, and Schulten, Biophys. J. 83, 154 (2002). + +**(Ziegler)** + J.F. Ziegler, J. P. Biersack and U. Littmark, "The Stopping and Range of Ions in Matter," Volume 1, Pergamon, 1985. + +**(Zimmerman2004)** + Zimmerman, JA; Webb, EB; Hoyt, JJ;. Jones, RE; Klein, PA; Bammann, DJ, "Calculation of stress in atomistic simulation." Special Issue of Modelling and Simulation in Materials Science and Engineering (2004),12:S319. + +**(Zimmerman2010)** + Zimmerman, JA; Jones, RE; Templeton, JA, "A material frame approach for evaluating continuum variables in atomistic simulations." Journal of Computational Physics (2010), 229:2364. + +**(de Buyl)** + de Buyl, Colberg and Hofling, H5MD: A structured, efficient, and portable file format for molecular data, Comp. Phys. Comm. 185(6), 1546-1553 (2014) - + +**(de Koning)** + de Koning and Antonelli, Phys Rev E, 53, 465 (1996). + +**(electronic stopping)** + Wikipedia - Electronic Stopping Power: https://en.wikipedia.org/wiki/Stopping_power_%28particle_radiation%29 + +**(tenWolde)** + P.\ R. ten Wolde, M. J. Ruiz-Montero, D. Frenkel, J. Chem. Phys. 104, 9932 (1996). + +**(vanWijk)** + M.\ M. van Wijk, A. Schuring, M. I. Katsnelson, and A. Fasolino, Physical Review Letters, 113, 135504 (2014) diff --git a/doc/src/Build_basics.rst b/doc/src/Build_basics.rst index 0ddf65ab46..74b6023c3e 100644 --- a/doc/src/Build_basics.rst +++ b/doc/src/Build_basics.rst @@ -32,74 +32,80 @@ LAMMPS are also written with support for shared memory parallelization using the `OpenMP `_ threading standard. A more detailed discussion of that is below. -**CMake build**\ : +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D BUILD_MPI=value # yes or no, default is yes if CMake finds MPI, else no - -D BUILD_OMP=value # yes or no, default is yes if a compatible compiler is detected - -D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc - # no default value + .. code-block:: bash -The executable created by CMake (after running make) is named ``lmp`` unless -the ``LAMMPS_MACHINE`` option is set. When setting ``LAMMPS_MACHINE=name`` -the executable will be called ``lmp_name``. Using ``BUILD_MPI=no`` will -enforce building a serial executable using the MPI STUBS library. + -D BUILD_MPI=value # yes or no, default is yes if CMake finds MPI, else no + -D BUILD_OMP=value # yes or no, default is yes if a compatible compiler is detected + -D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc + # no default value -**Traditional make**\ : + The executable created by CMake (after running make) is named + ``lmp`` unless the ``LAMMPS_MACHINE`` option is set. When setting + ``LAMMPS_MACHINE=name`` the executable will be called + ``lmp_name``. Using ``BUILD_MPI=no`` will enforce building a + serial executable using the MPI STUBS library. -The build with traditional makefiles has to be done inside the source folder ``src``. + .. tab:: Traditional make -.. code-block:: bash + The build with traditional makefiles has to be done inside the source folder ``src``. - make mpi # parallel build, produces lmp_mpi using Makefile.mpi - make serial # serial build, produces lmp_serial using Makefile/serial - make mybox # uses Makefile.mybox to produce lmp_mybox + .. code-block:: bash -Any ``make machine`` command will look up the make settings from a file -``Makefile.machine`` in the folder ``src/MAKE`` or one of its -sub-directories ``MINE``, ``MACHINES``, or ``OPTIONS``, create a folder -``Obj_machine`` with all objects and generated files and an executable -called ``lmp_machine``\ . The standard parallel build with ``make mpi`` -assumes a standard MPI installation with MPI compiler wrappers where all -necessary compiler and linker flags to get access and link with the -suitable MPI headers and libraries are set by the wrapper programs. For -other cases or the serial build, you have to adjust the make file -variables ``MPI_INC``, ``MPI_PATH``, ``MPI_LIB`` as well as ``CC`` and -``LINK``\ . To enable OpenMP threading usually a compiler specific flag -needs to be added to the compile and link commands. For the GNU -compilers, this is ``-fopenmp``\ , which can be added to the ``CC`` and -``LINK`` makefile variables. + make mpi # parallel build, produces lmp_mpi using Makefile.mpi + make serial # serial build, produces lmp_serial using Makefile/serial + make mybox # uses Makefile.mybox to produce lmp_mybox -For the serial build the following make variables are set (see src/MAKE/Makefile.serial): + Any ``make machine`` command will look up the make settings from a + file ``Makefile.machine`` in the folder ``src/MAKE`` or one of its + sub-directories ``MINE``, ``MACHINES``, or ``OPTIONS``, create a + folder ``Obj_machine`` with all objects and generated files and an + executable called ``lmp_machine``\ . The standard parallel build + with ``make mpi`` assumes a standard MPI installation with MPI + compiler wrappers where all necessary compiler and linker flags to + get access and link with the suitable MPI headers and libraries + are set by the wrapper programs. For other cases or the serial + build, you have to adjust the make file variables ``MPI_INC``, + ``MPI_PATH``, ``MPI_LIB`` as well as ``CC`` and ``LINK``\ . To + enable OpenMP threading usually a compiler specific flag needs to + be added to the compile and link commands. For the GNU compilers, + this is ``-fopenmp``\ , which can be added to the ``CC`` and + ``LINK`` makefile variables. -.. code-block:: make + For the serial build the following make variables are set (see src/MAKE/Makefile.serial): - CC = g++ - LINK = g++ - MPI_INC = -I../STUBS - MPI_PATH = -L../STUBS - MPI_LIB = -lmpi_stubs + .. code-block:: make -You also need to build the STUBS library for your platform before making -LAMMPS itself. A ``make serial`` build does this for you automatically, -otherwise, type ``make mpi-stubs`` from the src directory, or ``make`` -from the ``src/STUBS`` dir. If the build fails, you may need to edit -the ``STUBS/Makefile`` for your platform. The stubs library does not -provide MPI/IO functions required by some LAMMPS packages, -e.g. ``MPIIO`` or ``USER-LB``, and thus is not compatible with those -packages. + CC = g++ + LINK = g++ + MPI_INC = -I../STUBS + MPI_PATH = -L../STUBS + MPI_LIB = -lmpi_stubs -.. note:: + You also need to build the STUBS library for your platform before + making LAMMPS itself. A ``make serial`` build does this for you + automatically, otherwise, type ``make mpi-stubs`` from the src + directory, or ``make`` from the ``src/STUBS`` dir. If the build + fails, you may need to edit the ``STUBS/Makefile`` for your + platform. The stubs library does not provide MPI/IO functions + required by some LAMMPS packages, e.g. ``MPIIO`` or ``USER-LB``, + and thus is not compatible with those packages. - The file ``src/STUBS/mpi.c`` provides a CPU timer function called - ``MPI_Wtime()`` that calls ``gettimeofday()``. If your operating system - does not support ``gettimeofday()``, you will need to insert code to - call another timer. Note that the ANSI-standard function ``clock()`` - rolls over after an hour or so, and is therefore insufficient for - timing long LAMMPS simulations. + .. note:: -**MPI and OpenMP support info**\ : + The file ``src/STUBS/mpi.c`` provides a CPU timer function + called ``MPI_Wtime()`` that calls ``gettimeofday()``. If your + operating system does not support ``gettimeofday()``, you will + need to insert code to call another timer. Note that the + ANSI-standard function ``clock()`` rolls over after an hour or + so, and is therefore insufficient for timing long LAMMPS + simulations. + +MPI and OpenMP support in LAMMPS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ If you are installing MPI yourself to build a parallel LAMMPS executable, we recommend either MPICH or OpenMPI which are regularly @@ -115,12 +121,12 @@ self-installed MPICH or OpenMPI, so you should study the provided documentation to find out how to build and link with it. The majority of OpenMP (threading) support in LAMMPS is provided by the -``USER-OMP`` package; see the :doc:`Speed omp ` doc page for -details. The ``USER-INTEL`` package also includes OpenMP threading (it -is compatible with ``USER-OMP`` and will usually fall back on styles -from that package, if a ``USER-INTEL`` does not exist) and adds -vectorization support when compiled with compatible compilers, in -particular the Intel compilers on top of OpenMP. Also, the ``KOKKOS`` +``USER-OMP`` package; see the :doc:`Speed_omp` +page for details. The ``USER-INTEL`` package also includes OpenMP +threading (it is compatible with ``USER-OMP`` and will usually fall +back on styles from that package, if a ``USER-INTEL`` does not exist) +and adds vectorization support when compiled with compatible compilers, +in particular the Intel compilers on top of OpenMP. Also, the ``KOKKOS`` package can be compiled to include OpenMP threading. In addition, there are a few commands in LAMMPS that have native OpenMP @@ -145,18 +151,19 @@ please refer to its documentation. .. _default-none-issues: -**OpenMP Compiler compatibility info**\ : +OpenMP Compiler compatibility +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Some compilers do not fully support the ``default(none)`` directive -and others (e.g. GCC version 9 and beyond, Clang version 10 and later) -may implement strict OpenMP 4.0 and later semantics, which are incompatible +Some compilers do not fully support the ``default(none)`` directive and +others (e.g. GCC version 9 and beyond, Clang version 10 and later) may +implement strict OpenMP 4.0 and later semantics, which are incompatible with the OpenMP 3.1 semantics used in LAMMPS for maximal compatibility with compiler versions in use. If compilation with OpenMP enabled fails -because of your compiler requiring strict OpenMP 4.0 semantic, you can -change the behavior by adding ``-D LAMMPS_OMP_COMPAT=4`` to the ``LMP_INC`` -variable in your makefile, or add it to the command line while configuring -with CMake. CMake will detect the suitable setting for the GNU, Clang, -and Intel compilers. +because of your compiler requiring strict OpenMP 4.0 semantics, you can +change the behavior by adding ``-D LAMMPS_OMP_COMPAT=4`` to the +``LMP_INC`` variable in your makefile, or add it to the command line +while configuring with CMake. LAMMPS will auto-detect a suitable setting +for most GNU, Clang, and Intel compilers. ---------- @@ -185,131 +192,139 @@ for their compile/link environments, you can often access different compilers by simply loading the appropriate module before building LAMMPS. -**CMake build**\ : +.. tabs:: -By default CMake will use a compiler it finds according to internal -preferences and it will add optimization flags appropriate to that -compiler and any :doc:`accelerator packages ` you have -included in the build. + .. tab:: CMake build -You can tell CMake to look for a specific compiler with setting CMake -variables (listed below) during configuration. For a few common -choices, there are also presets in the ``cmake/presets`` folder. For -convenience, there is a ``CMAKE_TUNE_FLAGS`` variable that can be set to -apply global compiler options (applied to compilation only), to be used -for adding compiler or host specific optimization flags in addition to -the "flags" variables listed below. You may also specify the -corresponding ``CMAKE_*_FLAGS`` variables individually, if you want to -experiment with alternate optimization flags. You should specify all 3 -compilers, so that the (few) LAMMPS source files written in C or Fortran -are built with a compiler consistent with the one used for the C++ -files: + By default CMake will use the compiler it finds according to + internal preferences and it will add optimization flags + appropriate to that compiler and any :doc:`accelerator packages + ` you have included in the build. CMake will + check if the detected or selected compiler is compatible with the + C++ support requirements of LAMMPS and stop with an error, if this + is not the case. -.. code-block:: bash + You can tell CMake to look for a specific compiler with setting + CMake variables (listed below) during configuration. For a few + common choices, there are also presets in the ``cmake/presets`` + folder. For convenience, there is a ``CMAKE_TUNE_FLAGS`` variable + that can be set to apply global compiler options (applied to + compilation only), to be used for adding compiler or host specific + optimization flags in addition to the "flags" variables listed + below. You may also specify the corresponding ``CMAKE_*_FLAGS`` + variables individually, if you want to experiment with alternate + optimization flags. You should specify all 3 compilers, so that + the (few) LAMMPS source files written in C or Fortran are built + with a compiler consistent with the one used for the C++ files: - -D CMAKE_CXX_COMPILER=name # name of C++ compiler - -D CMAKE_C_COMPILER=name # name of C compiler - -D CMAKE_Fortran_COMPILER=name # name of Fortran compiler + .. code-block:: bash - -D CMAKE_CXX_FLAGS=string # flags to use with C++ compiler - -D CMAKE_C_FLAGS=string # flags to use with C compiler - -D CMAKE_Fortran_FLAGS=string # flags to use with Fortran compiler + -D CMAKE_CXX_COMPILER=name # name of C++ compiler + -D CMAKE_C_COMPILER=name # name of C compiler + -D CMAKE_Fortran_COMPILER=name # name of Fortran compiler -A few example command lines are: + -D CMAKE_CXX_FLAGS=string # flags to use with C++ compiler + -D CMAKE_C_FLAGS=string # flags to use with C compiler + -D CMAKE_Fortran_FLAGS=string # flags to use with Fortran compiler -.. code-block:: bash + A few example command lines are: - # Building with GNU Compilers: - cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran - # Building with Intel Compilers: - cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort - # Building with LLVM/Clang Compilers: - cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang + .. code-block:: bash -For compiling with the Clang/LLVM compilers a CMake preset is provided that -can be loaded with `-C ../cmake/presets/clang.cmake`. Similarly, -`-C ../cmake/presets/intel.cmake` should switch the + # Building with GNU Compilers: + cmake ../cmake -DCMAKE_C_COMPILER=gcc -DCMAKE_CXX_COMPILER=g++ -DCMAKE_Fortran_COMPILER=gfortran + # Building with Intel Compilers: + cmake ../cmake -DCMAKE_C_COMPILER=icc -DCMAKE_CXX_COMPILER=icpc -DCMAKE_Fortran_COMPILER=ifort + # Building with LLVM/Clang Compilers: + cmake ../cmake -DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_Fortran_COMPILER=flang -In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add -compiler flags to tune for optimal performance on given hosts. By -default this variable is empty. + For compiling with the Clang/LLVM compilers a CMake preset is + provided that can be loaded with + `-C ../cmake/presets/clang.cmake`. Similarly, + `-C ../cmake/presets/intel.cmake` should switch the compiler + toolchain to the Intel compilers. -.. note:: + In addition you can set ``CMAKE_TUNE_FLAGS`` to specifically add + compiler flags to tune for optimal performance on given hosts. By + default this variable is empty. - When the cmake command completes, it prints a summary to the screen - which compilers it is using and what flags and settings will be used - for the compilation. Note that if the top-level compiler is mpicxx, - it is simply a wrapper on a real compiler. The underlying compiler - info is what CMake will try to determine and report. You should check - to confirm you are using the compiler and optimization flags you want. + .. note:: -**Makefile.machine settings for traditional make**\ : + When the cmake command completes, it prints a summary to the + screen which compilers it is using and what flags and settings + will be used for the compilation. Note that if the top-level + compiler is mpicxx, it is simply a wrapper on a real compiler. + The underlying compiler info is what CMake will try to + determine and report. You should check to confirm you are + using the compiler and optimization flags you want. -The "compiler/linker settings" section of a Makefile.machine lists -compiler and linker settings for your C++ compiler, including -optimization flags. For a parallel build it is recommended to use -``mpicxx`` or ``mpiCC``, since these compiler wrappers will include a -variety of settings appropriate for your MPI installation and thus -avoiding the guesswork of finding the right flags. + .. tab:: Makefile.machine settings for traditional make -Parallel build (see ``src/MAKE/Makefile.mpi``): + The "compiler/linker settings" section of a Makefile.machine lists + compiler and linker settings for your C++ compiler, including + optimization flags. For a parallel build it is recommended to use + ``mpicxx`` or ``mpiCC``, since these compiler wrappers will + include a variety of settings appropriate for your MPI + installation and thus avoiding the guesswork of finding the right + flags. -.. code-block:: bash + Parallel build (see ``src/MAKE/Makefile.mpi``): - CC = mpicxx - CCFLAGS = -g -O3 - LINK = mpicxx - LINKFLAGS = -g -O + .. code-block:: bash -Serial build with GNU gcc (see ``src/MAKE/Makefile.serial``): + CC = mpicxx + CCFLAGS = -g -O3 + LINK = mpicxx + LINKFLAGS = -g -O -.. code-block:: make + Serial build with GNU gcc (see ``src/MAKE/Makefile.serial``): - CC = g++ - CCFLAGS = -g -O3 - LINK = g++ - LINKFLAGS = -g -O + .. code-block:: make + CC = g++ + CCFLAGS = -g -O3 + LINK = g++ + LINKFLAGS = -g -O -.. note:: + .. note:: - If compilation stops with a message like the following: + If compilation stops with a message like the following: - .. code-block:: + .. code-block:: - g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp - In file included from ../pointers.h:24:0, - from ../input.h:17, - from ../main.cpp:16: - ../lmptype.h:34:2: error: #error LAMMPS requires a C++11 (or later) compliant compiler. Enable C++11 compatibility or upgrade the compiler. + g++ -g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I../STUBS -c ../main.cpp + In file included from ../pointers.h:24:0, + from ../input.h:17, + from ../main.cpp:16: + ../lmptype.h:34:2: error: #error LAMMPS requires a C++11 (or later) compliant compiler. Enable C++11 compatibility or upgrade the compiler. - then you have either an unsupported (old) compiler or you have to - turn on C++11 mode. The latter applies to GCC 4.8.x shipped with - RHEL 7.x and CentOS 7.x. For those compilers, you need to add the - ``-std=c++11`` flag. Otherwise, you would have to install a newer - compiler that supports C++11; either as a binary package or through - compiling from source. + then you have either an unsupported (old) compiler or you have + to turn on C++11 mode. The latter applies to GCC 4.8.x shipped + with RHEL 7.x and CentOS 7.x. For those compilers, you need to + add the ``-std=c++11`` flag. Otherwise, you would have to + install a newer compiler that supports C++11; either as a + binary package or through compiling from source. -If you build LAMMPS with any :doc:`accelerator packages -` included, there may be specific optimization flags -that are either required or recommended to enable required features and -to achieve optimal performance. You need to include these in the -CCFLAGS and LINKFLAGS settings above. For details, see the individual -package doc pages listed on the :doc:`Speed packages ` -doc page. Or examine these files in the src/MAKE/OPTIONS directory. -They correspond to each of the 5 accelerator packages and their hardware -variants: + If you build LAMMPS with any :doc:`Speed_packages` included, + there may be specific compiler or linker flags that are either + required or recommended to enable required features and to + achieve optimal performance. You need to include these in the + CCFLAGS and LINKFLAGS settings above. For details, see the + individual package doc pages listed on the + :doc:`Speed_packages` page. Or examine these files in the + src/MAKE/OPTIONS directory. They correspond to each of the 5 + accelerator packages and their hardware variants: -.. code-block:: bash + .. code-block:: bash - Makefile.opt # OPT package - Makefile.omp # USER-OMP package - Makefile.intel_cpu # USER-INTEL package for CPUs - Makefile.intel_coprocessor # USER-INTEL package for KNLs - Makefile.gpu # GPU package - Makefile.kokkos_cuda_mpi # KOKKOS package for GPUs - Makefile.kokkos_omp # KOKKOS package for CPUs (OpenMP) - Makefile.kokkos_phi # KOKKOS package for KNLs (OpenMP) + Makefile.opt # OPT package + Makefile.omp # USER-OMP package + Makefile.intel_cpu # USER-INTEL package for CPUs + Makefile.intel_coprocessor # USER-INTEL package for KNLs + Makefile.gpu # GPU package + Makefile.kokkos_cuda_mpi # KOKKOS package for GPUs + Makefile.kokkos_omp # KOKKOS package for CPUs (OpenMP) + Makefile.kokkos_phi # KOKKOS package for KNLs (OpenMP) ---------- @@ -328,51 +343,56 @@ page for more info on coupling LAMMPS to other codes. See the :doc:`Python ` doc page for more info on wrapping and running LAMMPS from Python via its library interface. -**CMake build**\ : +.. tabs:: -For CMake builds, you can select through setting CMake variables between -building a shared or a static LAMMPS library and what kind of suffix is -added to them (in case you want to concurrently install multiple variants -of binaries with different settings). If none are set, defaults are applied. + .. tab:: CMake build -.. code-block:: bash + For CMake builds, you can select through setting CMake variables + between building a shared or a static LAMMPS library and what kind + of suffix is added to them (in case you want to concurrently + install multiple variants of binaries with different settings). If + none are set, defaults are applied. - -D BUILD_SHARED_LIBS=value # yes or no (default) - -D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc - # no default value + .. code-block:: bash -The compilation will always produce a LAMMPS library and an executable -linked to it. By default this will be a static library named -``liblammps.a`` and an executable named ``lmp`` Setting -``BUILD_SHARED_LIBS=yes`` will instead produce a shared library called -``liblammps.so`` (or ``liblammps.dylib`` or ``liblammps.dll`` depending -on the platform) If ``LAMMPS_MACHINE=name`` is set in addition, the name -of the generated libraries will be changed to either -``liblammps_name.a`` or ``liblammps_name.so``\ , respectively and the -executable will be called ``lmp_name``. + -D BUILD_SHARED_LIBS=value # yes or no (default) + -D LAMMPS_MACHINE=name # name = mpi, serial, mybox, titan, laptop, etc + # no default value -**Traditional make**\ : + The compilation will always produce a LAMMPS library and an + executable linked to it. By default this will be a static library + named ``liblammps.a`` and an executable named ``lmp`` Setting + ``BUILD_SHARED_LIBS=yes`` will instead produce a shared library + called ``liblammps.so`` (or ``liblammps.dylib`` or + ``liblammps.dll`` depending on the platform) If + ``LAMMPS_MACHINE=name`` is set in addition, the name of the + generated libraries will be changed to either ``liblammps_name.a`` + or ``liblammps_name.so``\ , respectively and the executable will + be called ``lmp_name``. -With the traditional makefile based build process, the choice of -the generated executable or library depends on the "mode" setting. -Several options are available and ``mode=static`` is the default. + .. tab:: Traditional make -.. code-block:: bash + With the traditional makefile based build process, the choice of + the generated executable or library depends on the "mode" setting. + Several options are available and ``mode=static`` is the default. - make machine # build LAMMPS executable lmp_machine - make mode=static machine # same as "make machine" - make mode=shared machine # build LAMMPS shared lib liblammps_machine.so instead + .. code-block:: bash -The "static" build will generate a static library called -``liblammps_machine.a`` and an executable named ``lmp_machine``\ , while -the "shared" build will generate a shared library -``liblammps_machine.so`` instead and ``lmp_machine`` will be linked to -it. The build step will also create generic soft links, named -``liblammps.a`` and ``liblammps.so``\ , which point to the specific -``liblammps_machine.a/so`` files. + make machine # build LAMMPS executable lmp_machine + make mode=static machine # same as "make machine" + make mode=shared machine # build LAMMPS shared lib liblammps_machine.so instead -CMake and make info -^^^^^^^^^^^^^^^^^^^ + The "static" build will generate a static library called + ``liblammps_machine.a`` and an executable named ``lmp_machine``\ , + while the "shared" build will generate a shared library + ``liblammps_machine.so`` instead and ``lmp_machine`` will be + linked to it. The build step will also create generic soft links, + named ``liblammps.a`` and ``liblammps.so``\ , which point to the + specific ``liblammps_machine.a/so`` files. + + +Additional information +^^^^^^^^^^^^^^^^^^^^^^ Note that for creating a shared library, all the libraries it depends on must be compiled to be compatible with shared libraries. This should be @@ -418,7 +438,7 @@ recommended to ensure the integrity of the system software installation. .. _debug: -Excluding or removing debug support +Including or removing debug support ----------------------------------- By default the compilation settings will include the *-g* flag which @@ -460,10 +480,10 @@ python packages are installed into that virtual environment via the pip tool. The actual translation is then done via make commands. .. _rst: https://docutils.readthedocs.io/en/sphinx-docs/user/rst/quickstart.html -.. _sphinx: https://sphinx-doc.org +.. _sphinx: https://www.sphinx-doc.org -Documentation make option -^^^^^^^^^^^^^^^^^^^^^^^^^ +Documentation makefile options +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ The following make commands can be issued in the doc folder of the LAMMPS source distribution. @@ -471,7 +491,7 @@ LAMMPS source distribution. .. code-block:: bash make html # create HTML doc pages in html directory - make pdf # create Developer.pdf and Manual.pdf in this directory + make pdf # create Manual.pdf in this directory make fetch # fetch HTML and PDF files from LAMMPS web site make clean # remove all intermediate files make clean-all # reset the entire doc build environment @@ -490,15 +510,16 @@ your system. current LAMMPS version (HTML and PDF files), from the website `download page `_. -CMake build option -^^^^^^^^^^^^^^^^^^ +CMake build options +^^^^^^^^^^^^^^^^^^^ -It is also possible to create the HTML version of the manual within -the :doc:`CMake build directory `. The reason for this -option is to include the installation of the HTML manual pages into -the "install" step when installing LAMMPS after the CMake build via -``make install``. The documentation build is included in the default -build target, but can also be requested independently with ``make doc``. +It is also possible to create the HTML version (and only the HTML +version) of the manual within the :doc:`CMake build directory +`. The reason for this option is to include the +installation of the HTML manual pages into the "install" step when +installing LAMMPS after the CMake build via ``make install``. The +documentation build is included in the default build target, but can +also be requested independently with ``make doc``. .. code-block:: bash @@ -514,27 +535,31 @@ Build LAMMPS tools Some tools described in :doc:`Auxiliary tools ` can be built directly using CMake or Make. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D BUILD_TOOLS=value # yes or no (default) + .. code-block:: bash -The generated binaries will also become part of the LAMMPS installation -(see below). + -D BUILD_TOOLS=value # yes or no (default) + -D BUILD_LAMMPS_SHELL=value # yes or no (default) -Traditional make -^^^^^^^^^^^^^^^^ + The generated binaries will also become part of the LAMMPS installation + (see below). -.. code-block:: bash + .. tab:: Traditional make - cd lammps/tools - make all # build all binaries of tools - make binary2txt # build only binary2txt tool - make chain # build only chain tool - make micelle2d # build only micelle2d tool - make thermo_extract # build only thermo_extract tool + .. code-block:: bash + + cd lammps/tools + make all # build all binaries of tools + make binary2txt # build only binary2txt tool + make chain # build only chain tool + make micelle2d # build only micelle2d tool + make thermo_extract # build only thermo_extract tool + + cd lammps/tools/lammps-shell + make # build LAMMPS shell ---------- @@ -549,18 +574,19 @@ a globally visible place on your system, for others to access. Note that you may need super-user privileges (e.g. sudo) if the directory you want to copy files to is protected. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - cmake -D CMAKE_INSTALL_PREFIX=path [options ...] ../cmake - make # perform make after CMake command - make install # perform the installation into prefix + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + cmake -D CMAKE_INSTALL_PREFIX=path [options ...] ../cmake + make # perform make after CMake command + make install # perform the installation into prefix -There is no "install" option in the ``src/Makefile`` for LAMMPS. If -you wish to do this you will need to first build LAMMPS, then manually -copy the desired LAMMPS files to the appropriate system directories. + .. tab:: Traditional make + + There is no "install" option in the ``src/Makefile`` for LAMMPS. + If you wish to do this you will need to first build LAMMPS, then + manually copy the desired LAMMPS files to the appropriate system + directories. diff --git a/doc/src/Build_development.rst b/doc/src/Build_development.rst index 5af264f29d..cf3e2fb750 100644 --- a/doc/src/Build_development.rst +++ b/doc/src/Build_development.rst @@ -28,6 +28,40 @@ variable VERBOSE set to 1: ---------- +.. _iwyu_processing: + +Report missing and unneeded '#include' statements +------------------------------------------------- + +The conventions for how and when to use and order include statements in +LAMMPS are `documented in a separate file `_ +(also included in the source code distribution). To assist with following +these conventions one can use the `Include What You Use tool `_. +This is still under development and for large and complex projects like LAMMPS +there are some false positives, so suggested changes need to be verified manually. +It is recommended to use at least version 0.14, which has much fewer incorrect +reports than earlier versions. + +The necessary steps to generate the report can be enabled via a +CMake variable: + +.. code-block:: bash + + -D ENABLE_IWYU=value # value = no (default) or yes + +This will check if the required binary (include-what-you-use or iwyu) +and python script script (iwyu-tool or iwyu_tool or iwyu_tool.py) can +be found in the path. The analysis can then be started with: + +.. code-block:: bash + + make iwyu + +This may first run some compilation, as the analysis is dependent +on recording all commands required to do the compilation. + +---------- + .. _sanitizer: Address, Undefined Behavior, and Thread Sanitizer Support @@ -37,14 +71,14 @@ Compilers such as GCC and Clang support generating instrumented binaries which use different sanitizer libraries to detect problems in the code during run-time. They can detect issues like: - - `memory leaks `_ + - `memory leaks `_ - `undefined behavior `_ - `data races `_ Please note that this kind of instrumentation usually comes with a performance hit (but much less than using tools like `Valgrind -`_ with a more low level approach). The to enable -these features additional compiler flags need to be added to the +`_ with a more low level approach). To enable +these features, additional compiler flags need to be added to the compilation and linking stages. This is done through setting the ``ENABLE_SANITIZER`` variable during configuration. Examples: @@ -77,7 +111,7 @@ error margin). The status of this automated testing can be viewed on The unit testing facility is integrated into the CMake build process of the LAMMPS source code distribution itself. It can be enabled by setting ``-D ENABLE_TESTING=on`` during the CMake configuration step. -It requires the `YAML `_ library and development +It requires the `PyYAML `_ library and development headers to compile and will download and compile a recent version of the `Googletest `_ C++ test framework for implementing the tests. @@ -378,22 +412,22 @@ The images below illustrate how the data is presented. .. list-table:: * - .. figure:: JPG/coverage-overview-top.png - :target: JPG/coverage-overview-top.png + :scale: 25% Top of the overview page - .. figure:: JPG/coverage-overview-manybody.png - :target: JPG/coverage-overview-manybody.png + :scale: 25% Styles with good coverage - .. figure:: JPG/coverage-file-top.png - :target: JPG/coverage-file-top.png + :scale: 25% Top of individual source page - .. figure:: JPG/coverage-file-branches.png - :target: JPG/coverage-file-branches.png + :scale: 25% Source page with branches diff --git a/doc/src/Build_extras.rst b/doc/src/Build_extras.rst index bde06159f3..7d778ada3d 100644 --- a/doc/src/Build_extras.rst +++ b/doc/src/Build_extras.rst @@ -2,17 +2,21 @@ Packages with extra build options ================================= When building with some packages, additional steps may be required, -in addition to: +in addition to -.. code-block:: bash +.. list-table:: + :align: center + :header-rows: 1 - $ cmake -D PKG_NAME=yes + * - CMake build + - Traditional make + * - .. code-block:: bash -or + $ cmake -D PKG_NAME=yes -.. code-block:: bash + - .. code-block:: bash - $ make yes-name + $ make yes-name as described on the :doc:`Build_package ` doc page. @@ -62,25 +66,39 @@ This is the list of packages that may require additional steps. COMPRESS package ---------------- -To build with this package you must have the zlib compression library -available on your system. +To build with this package you must have the `zlib compression library +`_ available on your system to build dump styles with +a '/gz' suffix. There are also styles using the +`Zstandard `_ library which have a +'/zstd' suffix. -CMake build -^^^^^^^^^^^ +.. tabs:: -If CMake cannot find the library, you can set these variables: + .. tab:: CMake build -.. code-block:: bash + If CMake cannot find the zlib library or include files, you can set + these variables: - -D ZLIB_INCLUDE_DIR=path # path to zlib.h header file - -D ZLIB_LIBRARIES=path # path to libz.a (.so) file + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D ZLIB_INCLUDE_DIR=path # path to zlib.h header file + -D ZLIB_LIBRARY=path # path to libz.a (.so) file -If make cannot find the library, you can edit the file -``lib/compress/Makefile.lammps`` to specify the paths and library -name. + Support for Zstandard compression is auto-detected and for that + CMake depends on the `pkg-config + `_ tool to + identify the necessary flags to compile with this library, so the + corresponding ``libzstandard.pc`` file must be in a folder where + pkg-config can find it, which may require adding it to the + ``PKG_CONFIG_PATH`` environment variable. + + .. tab:: Traditional make + + To include support for Zstandard compression, ``-DLAMMPS_ZSTD`` + must be added to the compiler flags. If make cannot find the + libraries, you can edit the file ``lib/compress/Makefile.lammps`` + to specify the paths and library names. This must be done + **before** the package is installed. ---------- @@ -121,17 +139,19 @@ CMake build * sm_12 or sm_13 for GT200 (supported by CUDA 3.2 until CUDA 6.5) * sm_20 or sm_21 for Fermi (supported by CUDA 3.2 until CUDA 7.5) -* sm_30 or sm_35 or sm_37 for Kepler (supported since CUDA 5) +* sm_30 for Kepler (supported since CUDA 5 and until CUDA 10.x) +* sm_35 or sm_37 for Kepler (supported since CUDA 5 and until CUDA 11.x) * sm_50 or sm_52 for Maxwell (supported since CUDA 6) * sm_60 or sm_61 for Pascal (supported since CUDA 8) * sm_70 for Volta (supported since CUDA 9) * sm_75 for Turing (supported since CUDA 10) +* sm_80 for Ampere (supported since CUDA 11) A more detailed list can be found, for example, at `Wikipedia's CUDA article `_ -CMake can detect which version of the CUDA toolkit is used and thus can -include support for **all** major GPU architectures supported by this toolkit. +CMake can detect which version of the CUDA toolkit is used and thus will try +to include support for **all** major GPU architectures supported by this toolkit. Thus the GPU_ARCH setting is merely an optimization, to have code for the preferred GPU architecture directly included rather than having to wait for the JIT compiler of the CUDA driver to translate it. @@ -155,7 +175,7 @@ and the linker to work correctly. .. code:: bash - # CUDA target + # CUDA target (not recommended, use GPU_ARCH=cuda) # !!! DO NOT set CMAKE_CXX_COMPILER !!! export HIP_PLATFORM=nvcc export CUDA_PATH=/usr/local/cuda @@ -234,11 +254,10 @@ command, you also need to have libcurl installed with the matching development headers and the curl-config tool. If you would like to use the :doc:`kim_property ` -command, you need to build LAMMPS with the Python 3.6 or later package -installed. See the :doc:`Python ` doc page for more info on building -LAMMPS with the version of Python on your system. -After successfully building LAMMPS with Python, you need to -install the kim-property Python package, which can be easily done using +command, you need to build LAMMPS with the PYTHON package installed +and linked to Python 3.6 or later. See the :ref:`PYTHON package build info ` +for more details on this. After successfully building LAMMPS with Python, you +also need to install the kim-property Python package, which can be easily done using *pip* as ``pip install kim-property``, or from the *conda-forge* channel as ``conda install kim-property`` if LAMMPS is built in Conda. More detailed information is available at: @@ -254,64 +273,70 @@ See the list of all KIM models here: https://openkim.org/browse/models the KIM API library with all its models, may take a long time (tens of minutes to hours) to build. Of course you only need to do that once.) -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes - -D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on - -D LMP_NO_SSL_CHECK=value # tell libcurl to not verify the peer, value = no (default) or yes + .. code-block:: bash -If ``DOWNLOAD_KIM`` is set, the KIM library will be downloaded and built -inside the CMake build directory. If the KIM library is already on -your system (in a location CMake cannot find it), set the ``PKG_CONFIG_PATH`` -environment variable so that libkim-api can be found. + -D DOWNLOAD_KIM=value # download OpenKIM API v2 for build, value = no (default) or yes + -D LMP_DEBUG_CURL=value # set libcurl verbose mode on/off, value = off (default) or on + -D LMP_NO_SSL_CHECK=value # tell libcurl to not verify the peer, value = no (default) or yes -*For using OpenKIM web queries in LAMMPS*\ : + If ``DOWNLOAD_KIM`` is set to *yes* (or *on*), the KIM API library + will be downloaded and built inside the CMake build directory. If + the KIM library is already installed on your system (in a location + where CMake cannot find it), you may need to set the + ``PKG_CONFIG_PATH`` environment variable so that libkim-api can be + found, or run the command ``source kim-api-activate``. -If the ``LMP_DEBUG_CURL`` environment variable is set, the libcurl verbose -mode will be on, and any libcurl calls within the KIM web query display a -lot of information about libcurl operations. You hardly ever want this -set in production use, you will almost always want this when you debug or + .. tab:: Traditional make + + You can download and build the KIM library manually if you prefer; + follow the instructions in ``lib/kim/README``. You can also do + this in one step from the lammps/src dir, using a command like + these, which simply invoke the ``lib/kim/Install.py`` script with + the specified args. + + .. code-block:: bash + + $ make lib-kim # print help message + $ make lib-kim args="-b " # (re-)install KIM API lib with only example models + $ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model + $ make lib-kim args="-b -a everything" # install KIM API lib with all models + $ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver + $ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location + $ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver + + Settings for debugging OpenKIM web queries discussed below need to + be applied by adding them to the ``LMP_INC`` variable through + editing the ``Makefile.machine`` you are using. For example: + + .. code-block:: make + + LMP_INC = -DLMP_NO_SSL_CHECK + +Debugging OpenKIM web queries in LAMMPS +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +If ``LMP_DEBUG_CURL`` is set, the libcurl verbose mode will be turned +on, and any libcurl calls within the KIM web query display a lot of +information about libcurl operations. You hardly ever want this set in +production use, you will almost always want this when you debug or report problems. -The libcurl performs peer SSL certificate verification by default. This -verification is done using a CA certificate store that the SSL library can -use to make sure the peer's server certificate is valid. If SSL reports an -error ("certificate verify failed") during the handshake and thus refuses -further communication with that server, you can set ``LMP_NO_SSL_CHECK``\ . -If ``LMP_NO_SSL_CHECK`` is set, libcurl does not verify the peer and connection -succeeds regardless of the names in the certificate. This option is insecure. -As an alternative, you can specify your own CA cert path by setting the -environment variable ``CURL_CA_BUNDLE`` to the path of your choice. A call -to the KIM web query would get this value from the environmental variable. - -Traditional make -^^^^^^^^^^^^^^^^ - -You can download and build the KIM library manually if you prefer; -follow the instructions in ``lib/kim/README``\ . You can also do it in one -step from the lammps/src dir, using a command like these, which simply -invoke the ``lib/kim/Install.py`` script with the specified args. - -.. code-block:: bash - - $ make lib-kim # print help message - $ make lib-kim args="-b " # (re-)install KIM API lib with only example models - $ make lib-kim args="-b -a Glue_Ercolessi_Adams_Al__MO_324507536345_001" # ditto plus one model - $ make lib-kim args="-b -a everything" # install KIM API lib with all models - $ make lib-kim args="-n -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # add one model or model driver - $ make lib-kim args="-p /usr/local" # use an existing KIM API installation at the provided location - $ make lib-kim args="-p /usr/local -a EAM_Dynamo_Ackland_W__MO_141627196590_002" # ditto but add one model or driver - -Settings for OpenKIM web queries discussed above need to be applied by adding -them to the ``LMP_INC`` variable through editing the ``Makefile.machine`` you are -using. For example: - -.. code-block:: make - - LMP_INC = -DLMP_NO_SSL_CHECK +The libcurl library performs peer SSL certificate verification by +default. This verification is done using a CA certificate store that +the SSL library can use to make sure the peer's server certificate is +valid. If SSL reports an error ("certificate verify failed") during the +handshake and thus refuses further communicate with that server, you can +set ``LMP_NO_SSL_CHECK`` to override that behavior. When LAMMPS is +compiled with ``LMP_NO_SSL_CHECK`` set, libcurl does not verify the peer +and connection attempts will succeed regardless of the names in the +certificate. This option is insecure. As an alternative, you can +specify your own CA cert path by setting the environment variable +``CURL_CA_BUNDLE`` to the path of your choice. A call to the KIM web +query would get this value from the environment variable. ---------- @@ -348,8 +373,8 @@ More information on Kokkos can be found on the Available Architecture settings ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -These are the possible choices for the Kokkos architecture ID. They must -be specified in uppercase. +These are the possible choices for the Kokkos architecture ID. +They must be specified in uppercase. .. list-table:: :header-rows: 0 @@ -361,9 +386,12 @@ be specified in uppercase. * - AMDAVX - HOST - AMD 64-bit x86 CPU (AVX 1) - * - EPYC + * - ZEN - HOST - - AMD EPYC Zen class CPU (AVX 2) + - AMD Zen class CPU (AVX 2) + * - ZEN2 + - HOST + - AMD Zen2 class CPU (AVX 2) * - ARMV80 - HOST - ARMv8.0 Compatible CPU @@ -445,118 +473,130 @@ be specified in uppercase. * - TURING75 - GPU - NVIDIA Turing generation CC 7.5 GPU + * - AMPERE80 + - GPU + - NVIDIA Ampere generation CC 8.0 GPU * - VEGA900 - GPU - AMD GPU MI25 GFX900 * - VEGA906 - GPU - AMD GPU MI50/MI60 GFX906 + * - INTEL_GEN + - GPU + - Intel GPUs Gen9+ -Basic CMake build settings: -^^^^^^^^^^^^^^^^^^^^^^^^^^^ -For multicore CPUs using OpenMP, set these 2 variables. +This list was last updated for version 3.2 of the Kokkos library. -.. code-block:: bash +.. tabs:: - -D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above - -D Kokkos_ENABLE_OPENMP=yes - -D BUILD_OMP=yes + .. tab:: Basic CMake build settings: -Please note that enabling OpenMP for KOKKOS requires that OpenMP is -also :ref:`enabled for the rest of LAMMPS `. + For multicore CPUs using OpenMP, set these 2 variables. -For Intel KNLs using OpenMP, set these variables: + .. code-block:: bash -.. code-block:: bash + -D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above + -D Kokkos_ENABLE_OPENMP=yes + -D BUILD_OMP=yes - -D Kokkos_ARCH_KNL=yes - -D Kokkos_ENABLE_OPENMP=yes + Please note that enabling OpenMP for KOKKOS requires that OpenMP is + also :ref:`enabled for the rest of LAMMPS `. -For NVIDIA GPUs using CUDA, set these variables: + For Intel KNLs using OpenMP, set these variables: -.. code-block:: bash + .. code-block:: bash - -D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above - -D Kokkos_ARCH_GPUARCH=yes # GPUARCH = GPU from list above - -D Kokkos_ENABLE_CUDA=yes - -D Kokkos_ENABLE_OPENMP=yes - -D CMAKE_CXX_COMPILER=wrapper # wrapper = full path to Cuda nvcc wrapper + -D Kokkos_ARCH_KNL=yes + -D Kokkos_ENABLE_OPENMP=yes -This will also enable executing FFTs on the GPU, either via the internal -KISSFFT library, or - by preference - with the cuFFT library bundled -with the CUDA toolkit, depending on whether CMake can identify its -location. The *wrapper* value for ``CMAKE_CXX_COMPILER`` variable is -the path to the CUDA nvcc compiler wrapper provided in the Kokkos -library: ``lib/kokkos/bin/nvcc_wrapper``\ . The setting should include -the full path name to the wrapper, e.g. + For NVIDIA GPUs using CUDA, set these variables: -.. code-block:: bash + .. code-block:: bash - -D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper + -D Kokkos_ARCH_HOSTARCH=yes # HOSTARCH = HOST from list above + -D Kokkos_ARCH_GPUARCH=yes # GPUARCH = GPU from list above + -D Kokkos_ENABLE_CUDA=yes + -D Kokkos_ENABLE_OPENMP=yes + -D CMAKE_CXX_COMPILER=wrapper # wrapper = full path to Cuda nvcc wrapper -To simplify the compilation, three preset files are included in the -``cmake/presets`` folder, ``kokkos-serial.cmake``, ``kokkos-openmp.cmake``, -and ``kokkos-cuda.cmake``. They will enable the KOKKOS package and -enable some hardware choice. So to compile with OpenMP host parallelization, -CUDA device parallelization (for GPUs with CC 5.0 and up) with some -common packages enabled, you can do the following: + This will also enable executing FFTs on the GPU, either via the + internal KISSFFT library, or - by preference - with the cuFFT + library bundled with the CUDA toolkit, depending on whether CMake + can identify its location. The *wrapper* value for + ``CMAKE_CXX_COMPILER`` variable is the path to the CUDA nvcc + compiler wrapper provided in the Kokkos library: + ``lib/kokkos/bin/nvcc_wrapper``\ . The setting should include the + full path name to the wrapper, e.g. -.. code-block:: bash + .. code-block:: bash - mkdir build-kokkos-cuda - cd build-kokkos-cuda - cmake -C ../cmake/presets/minimal.cmake -C ../cmake/presets/kokkos-cuda.cmake ../cmake - cmake --build . + -D CMAKE_CXX_COMPILER=${HOME}/lammps/lib/kokkos/bin/nvcc_wrapper -Basic traditional make settings: -^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + To simplify compilation, three preset files are included in the + ``cmake/presets`` folder, ``kokkos-serial.cmake``, + ``kokkos-openmp.cmake``, and ``kokkos-cuda.cmake``. They will + enable the KOKKOS package and enable some hardware choice. So to + compile with OpenMP host parallelization, CUDA device + parallelization (for GPUs with CC 5.0 and up) with some common + packages enabled, you can do the following: -Choose which hardware to support in ``Makefile.machine`` via -``KOKKOS_DEVICES`` and ``KOKKOS_ARCH`` settings. See the -``src/MAKE/OPTIONS/Makefile.kokkos*`` files for examples. + .. code-block:: bash -For multicore CPUs using OpenMP: + mkdir build-kokkos-cuda + cd build-kokkos-cuda + cmake -C ../cmake/presets/minimal.cmake -C ../cmake/presets/kokkos-cuda.cmake ../cmake + cmake --build . -.. code-block:: make + .. tab:: Basic traditional make settings: - KOKKOS_DEVICES = OpenMP - KOKKOS_ARCH = HOSTARCH # HOSTARCH = HOST from list above + Choose which hardware to support in ``Makefile.machine`` via + ``KOKKOS_DEVICES`` and ``KOKKOS_ARCH`` settings. See the + ``src/MAKE/OPTIONS/Makefile.kokkos*`` files for examples. -For Intel KNLs using OpenMP: + For multicore CPUs using OpenMP: -.. code-block:: make + .. code-block:: make - KOKKOS_DEVICES = OpenMP - KOKKOS_ARCH = KNL + KOKKOS_DEVICES = OpenMP + KOKKOS_ARCH = HOSTARCH # HOSTARCH = HOST from list above -For NVIDIA GPUs using CUDA: + For Intel KNLs using OpenMP: -.. code-block:: make + .. code-block:: make - KOKKOS_DEVICES = Cuda - KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is hosting the GPU - KOKKOS_CUDA_OPTIONS = "enable_lambda" - # GPUARCH = GPU from list above - FFT_INC = -DFFT_CUFFT # enable use of cuFFT (optional) - FFT_LIB = -lcufft # link to cuFFT library + KOKKOS_DEVICES = OpenMP + KOKKOS_ARCH = KNL -For GPUs, you also need the following lines in your ``Makefile.machine`` -before the CC line is defined. They tell ``mpicxx`` to use an ``nvcc`` -compiler wrapper, which will use ``nvcc`` for compiling CUDA files and a -C++ compiler for non-Kokkos, non-CUDA files. + For NVIDIA GPUs using CUDA: -.. code-block:: make + .. code-block:: make - # For OpenMPI - KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd) - export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper - CC = mpicxx + KOKKOS_DEVICES = Cuda + KOKKOS_ARCH = HOSTARCH,GPUARCH # HOSTARCH = HOST from list above that is hosting the GPU + KOKKOS_CUDA_OPTIONS = "enable_lambda" + # GPUARCH = GPU from list above + FFT_INC = -DFFT_CUFFT # enable use of cuFFT (optional) + FFT_LIB = -lcufft # link to cuFFT library -.. code-block:: make + For GPUs, you also need the following lines in your + ``Makefile.machine`` before the CC line is defined. They tell + ``mpicxx`` to use an ``nvcc`` compiler wrapper, which will use + ``nvcc`` for compiling CUDA files and a C++ compiler for + non-Kokkos, non-CUDA files. - # For MPICH and derivatives - KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd) - CC = mpicxx -cxx=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper + .. code-block:: make + + # For OpenMPI + KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd) + export OMPI_CXX = $(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper + CC = mpicxx + + .. code-block:: make + + # For MPICH and derivatives + KOKKOS_ABSOLUTE_PATH = $(shell cd $(KOKKOS_PATH); pwd) + CC = mpicxx -cxx=$(KOKKOS_ABSOLUTE_PATH)/config/nvcc_wrapper Advanced KOKKOS compilation settings @@ -611,43 +651,43 @@ LATTE package To build with this package, you must download and build the LATTE library. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D DOWNLOAD_LATTE=value # download LATTE for build, value = no (default) or yes - -D LATTE_LIBRARY=path # LATTE library file (only needed if a custom location) + .. code-block:: bash -If ``DOWNLOAD_LATTE`` is set, the LATTE library will be downloaded and -built inside the CMake build directory. If the LATTE library is -already on your system (in a location CMake cannot find it), -``LATTE_LIBRARY`` is the filename (plus path) of the LATTE library file, -not the directory the library file is in. + -D DOWNLOAD_LATTE=value # download LATTE for build, value = no (default) or yes + -D LATTE_LIBRARY=path # LATTE library file (only needed if a custom location) -Traditional make -^^^^^^^^^^^^^^^^ + If ``DOWNLOAD_LATTE`` is set, the LATTE library will be downloaded + and built inside the CMake build directory. If the LATTE library + is already on your system (in a location CMake cannot find it), + ``LATTE_LIBRARY`` is the filename (plus path) of the LATTE library + file, not the directory the library file is in. -You can download and build the LATTE library manually if you prefer; -follow the instructions in ``lib/latte/README``\ . You can also do it in -one step from the ``lammps/src`` dir, using a command like these, which -simply invokes the ``lib/latte/Install.py`` script with the specified -args: + .. tab:: Traditional make -.. code-block:: bash + You can download and build the LATTE library manually if you + prefer; follow the instructions in ``lib/latte/README``\ . You + can also do it in one step from the ``lammps/src`` dir, using a + command like these, which simply invokes the + ``lib/latte/Install.py`` script with the specified args: - $ make lib-latte # print help message - $ make lib-latte args="-b" # download and build in lib/latte/LATTE-master - $ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte - $ make lib-latte args="-b -m gfortran" # download and build in lib/latte and - # copy Makefile.lammps.gfortran to Makefile.lammps + .. code-block:: bash -Note that 3 symbolic (soft) links, ``includelink`` and ``liblink`` and -``filelink.o``, are created in ``lib/latte`` to point to required -folders and files in the LATTE home directory. When LAMMPS itself is -built it will use these links. You should also check that the -``Makefile.lammps`` file you create is appropriate for the compiler you -use on your system to build LATTE. + $ make lib-latte # print help message + $ make lib-latte args="-b" # download and build in lib/latte/LATTE-master + $ make lib-latte args="-p $HOME/latte" # use existing LATTE installation in $HOME/latte + $ make lib-latte args="-b -m gfortran" # download and build in lib/latte and + # copy Makefile.lammps.gfortran to Makefile.lammps + + Note that 3 symbolic (soft) links, ``includelink`` and ``liblink`` + and ``filelink.o``, are created in ``lib/latte`` to point to + required folders and files in the LATTE home directory. When + LAMMPS itself is built it will use these links. You should also + check that the ``Makefile.lammps`` file you create is appropriate + for the compiler you use on your system to build LATTE. ---------- @@ -660,34 +700,35 @@ This package can optionally include support for messaging via sockets, using the open-source `ZeroMQ library `_, which must be installed on your system. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes - -D ZMQ_LIBRARY=path # ZMQ library file (only needed if a custom location) - -D ZMQ_INCLUDE_DIR=path # ZMQ include directory (only needed if a custom location) + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D MESSAGE_ZMQ=value # build with ZeroMQ support, value = no (default) or yes + -D ZMQ_LIBRARY=path # ZMQ library file (only needed if a custom location) + -D ZMQ_INCLUDE_DIR=path # ZMQ include directory (only needed if a custom location) -Before building LAMMPS, you must build the CSlib library in -``lib/message``\ . You can build the CSlib library manually if you prefer; -follow the instructions in ``lib/message/README``\ . You can also do it in -one step from the ``lammps/src`` dir, using a command like these, which -simply invoke the ``lib/message/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the CSlib library in + ``lib/message``\ . You can build the CSlib library manually if + you prefer; follow the instructions in ``lib/message/README``\ . + You can also do it in one step from the ``lammps/src`` dir, using + a command like these, which simply invoke the + ``lib/message/Install.py`` script with the specified args: - $ make lib-message # print help message - $ make lib-message args="-m -z" # build with MPI and socket (ZMQ) support - $ make lib-message args="-s" # build as serial lib with no ZMQ support + .. code-block:: bash -The build should produce two files: ``lib/message/cslib/src/libmessage.a`` -and ``lib/message/Makefile.lammps``. The latter is copied from an -existing ``Makefile.lammps.*`` and has settings to link with the ZeroMQ -library if requested in the build. + $ make lib-message # print help message + $ make lib-message args="-m -z" # build with MPI and socket (ZMQ) support + $ make lib-message args="-s" # build as serial lib with no ZMQ support + + The build should produce two files: ``lib/message/cslib/src/libmessage.a`` + and ``lib/message/Makefile.lammps``. The latter is copied from an + existing ``Makefile.lammps.*`` and has settings to link with the ZeroMQ + library if requested in the build. ---------- @@ -702,43 +743,45 @@ library. Building the MS-CG library requires that the GSL machine. See the ``lib/mscg/README`` and ``MSCG/Install`` files for more details. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D DOWNLOAD_MSCG=value # download MSCG for build, value = no (default) or yes - -D MSCG_LIBRARY=path # MSCG library file (only needed if a custom location) - -D MSCG_INCLUDE_DIR=path # MSCG include directory (only needed if a custom location) + .. code-block:: bash -If ``DOWNLOAD_MSCG`` is set, the MSCG library will be downloaded and built -inside the CMake build directory. If the MSCG library is already on -your system (in a location CMake cannot find it), ``MSCG_LIBRARY`` is the -filename (plus path) of the MSCG library file, not the directory the -library file is in. ``MSCG_INCLUDE_DIR`` is the directory the MSCG -include file is in. + -D DOWNLOAD_MSCG=value # download MSCG for build, value = no (default) or yes + -D MSCG_LIBRARY=path # MSCG library file (only needed if a custom location) + -D MSCG_INCLUDE_DIR=path # MSCG include directory (only needed if a custom location) -Traditional make -^^^^^^^^^^^^^^^^ + If ``DOWNLOAD_MSCG`` is set, the MSCG library will be downloaded + and built inside the CMake build directory. If the MSCG library + is already on your system (in a location CMake cannot find it), + ``MSCG_LIBRARY`` is the filename (plus path) of the MSCG library + file, not the directory the library file is in. + ``MSCG_INCLUDE_DIR`` is the directory the MSCG include file is in. -You can download and build the MS-CG library manually if you prefer; -follow the instructions in ``lib/mscg/README``\ . You can also do it in one -step from the ``lammps/src`` dir, using a command like these, which simply -invoke the ``lib/mscg/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + You can download and build the MS-CG library manually if you + prefer; follow the instructions in ``lib/mscg/README``\ . You can + also do it in one step from the ``lammps/src`` dir, using a + command like these, which simply invoke the + ``lib/mscg/Install.py`` script with the specified args: - $ make lib-mscg # print help message - $ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master - # with the settings compatible with "make serial" - $ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master - # with the settings compatible with "make mpi" - $ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release + .. code-block:: bash -Note that 2 symbolic (soft) links, "includelink" and "liblink", will -be created in ``lib/mscg`` to point to the MS-CG ``src/installation`` -dir. When LAMMPS is built in src it will use these links. You should -not need to edit the ``lib/mscg/Makefile.lammps`` file. + $ make lib-mscg # print help message + $ make lib-mscg args="-b -m serial" # download and build in lib/mscg/MSCG-release-master + # with the settings compatible with "make serial" + $ make lib-mscg args="-b -m mpi" # download and build in lib/mscg/MSCG-release-master + # with the settings compatible with "make mpi" + $ make lib-mscg args="-p /usr/local/mscg-release" # use the existing MS-CG installation in /usr/local/mscg-release + + Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``, + will be created in ``lib/mscg`` to point to the MS-CG + ``src/installation`` dir. When LAMMPS is built in src it will use + these links. You should not need to edit the + ``lib/mscg/Makefile.lammps`` file. ---------- @@ -747,18 +790,18 @@ not need to edit the ``lib/mscg/Makefile.lammps`` file. OPT package --------------------- -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides ``-D PKG_OPT=yes`` + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + No additional settings are needed besides ``-D PKG_OPT=yes`` -The compile flag ``-restrict`` must be used to build LAMMPS with the OPT -package when using Intel compilers. It should be added to the CCFLAGS -line of your ``Makefile.machine``. See -``src/MAKE/OPTIONS/Makefile.opt`` for an example. + .. tab:: Traditional make + + The compiler flag ``-restrict`` must be used to build LAMMPS with + the OPT package when using Intel compilers. It should be added to + the :code:`CCFLAGS` line of your ``Makefile.machine``. See + ``src/MAKE/OPTIONS/Makefile.opt`` for an example. ---------- @@ -767,34 +810,36 @@ line of your ``Makefile.machine``. See POEMS package ------------------------- -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides ``-D PKG_OPT=yes`` + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + No additional settings are needed besides ``-D PKG_OPT=yes`` -Before building LAMMPS, you must build the POEMS library in ``lib/poems``\ . -You can do this manually if you prefer; follow the instructions in -``lib/poems/README``\ . You can also do it in one step from the ``lammps/src`` -dir, using a command like these, which simply invoke the -``lib/poems/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the POEMS library in + ``lib/poems``\ . You can do this manually if you prefer; follow + the instructions in ``lib/poems/README``\ . You can also do it in + one step from the ``lammps/src`` dir, using a command like these, + which simply invoke the ``lib/poems/Install.py`` script with the + specified args: - $ make lib-poems # print help message - $ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial") - $ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi") - $ make lib-poems args="-m icc" # build with Intel icc compiler + .. code-block:: bash -The build should produce two files: ``lib/poems/libpoems.a`` and -``lib/poems/Makefile.lammps``. The latter is copied from an existing -``Makefile.lammps.*`` and has settings needed to build LAMMPS with the -POEMS library (though typically the settings are just blank). If -necessary, you can edit/create a new ``lib/poems/Makefile.machine`` file -for your system, which should define an ``EXTRAMAKE`` variable to specify -a corresponding ``Makefile.lammps.machine`` file. + $ make lib-poems # print help message + $ make lib-poems args="-m serial" # build with GNU g++ compiler (settings as with "make serial") + $ make lib-poems args="-m mpi" # build with default MPI C++ compiler (settings as with "make mpi") + $ make lib-poems args="-m icc" # build with Intel icc compiler + + The build should produce two files: ``lib/poems/libpoems.a`` and + ``lib/poems/Makefile.lammps``. The latter is copied from an + existing ``Makefile.lammps.*`` and has settings needed to build + LAMMPS with the POEMS library (though typically the settings are + just blank). If necessary, you can edit/create a new + ``lib/poems/Makefile.machine`` file for your system, which should + define an ``EXTRAMAKE`` variable to specify a corresponding + ``Makefile.lammps.machine`` file. ---------- @@ -803,32 +848,34 @@ a corresponding ``Makefile.lammps.machine`` file. PYTHON package --------------------------- -Building with the PYTHON package requires you have a Python shared -library available on your system, which needs to be a Python 2.7 -version or a Python 3.x version. See ``lib/python/README`` for more -details. +Building with the PYTHON package requires you have a the Python development +headers and library available on your system, which needs to be a Python 2.7 +version or a Python 3.x version. Since support for Python 2.x has ended, +using Python 3.x is strongly recommended. See ``lib/python/README`` for +additional details. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D PYTHON_EXECUTABLE=path # path to Python executable to use + .. code-block:: bash -Without this setting, CMake will guess the default Python on your -system. To use a different Python version, you can either create a -virtualenv, activate it and then run cmake. Or you can set the -PYTHON_EXECUTABLE variable to specify which Python interpreter should -be used. Note note that you will also need to have the development -headers installed for this version, e.g. python2-devel. + -D PYTHON_EXECUTABLE=path # path to Python executable to use -Traditional make -^^^^^^^^^^^^^^^^ + Without this setting, CMake will guess the default Python version + on your system. To use a different Python version, you can either + create a virtualenv, activate it and then run cmake. Or you can + set the PYTHON_EXECUTABLE variable to specify which Python + interpreter should be used. Note note that you will also need to + have the development headers installed for this version, + e.g. python2-devel. -The build uses the ``lib/python/Makefile.lammps`` file in the compile/link -process to find Python. You should only need to create a new -``Makefile.lammps.*`` file (and copy it to ``Makefile.lammps``) if -the LAMMPS build fails. + .. tab:: Traditional make + + The build uses the ``lib/python/Makefile.lammps`` file in the + compile/link process to find Python. You should only need to + create a new ``Makefile.lammps.*`` file (and copy it to + ``Makefile.lammps``) if the LAMMPS build fails. ---------- @@ -837,46 +884,48 @@ the LAMMPS build fails. VORONOI package ----------------------------- -To build with this package, you must download and build the `Voro++ library `_. +To build with this package, you must download and build the +`Voro++ library `_ or install a +binary package provided by your operating system. -.. _voro-home: http://math.lbl.gov/voro++ +.. tabs:: -CMake build -^^^^^^^^^^^ + .. tab:: CMake build -.. code-block:: bash + .. code-block:: bash - -D DOWNLOAD_VORO=value # download Voro++ for build, value = no (default) or yes - -D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location) - -D VORO_INCLUDE_DIR=path # Voro++ include directory (only needed if at custom location) + -D DOWNLOAD_VORO=value # download Voro++ for build, value = no (default) or yes + -D VORO_LIBRARY=path # Voro++ library file (only needed if at custom location) + -D VORO_INCLUDE_DIR=path # Voro++ include directory (only needed if at custom location) -If ``DOWNLOAD_VORO`` is set, the Voro++ library will be downloaded and -built inside the CMake build directory. If the Voro++ library is -already on your system (in a location CMake cannot find it), -``VORO_LIBRARY`` is the filename (plus path) of the Voro++ library file, -not the directory the library file is in. ``VORO_INCLUDE_DIR`` is the -directory the Voro++ include file is in. + If ``DOWNLOAD_VORO`` is set, the Voro++ library will be downloaded + and built inside the CMake build directory. If the Voro++ library + is already on your system (in a location CMake cannot find it), + ``VORO_LIBRARY`` is the filename (plus path) of the Voro++ library + file, not the directory the library file is in. + ``VORO_INCLUDE_DIR`` is the directory the Voro++ include file is + in. -Traditional make -^^^^^^^^^^^^^^^^ + .. tab:: Traditional make -You can download and build the Voro++ library manually if you prefer; -follow the instructions in ``lib/voronoi/README``. You can also do it in -one step from the ``lammps/src`` dir, using a command like these, which -simply invoke the ``lib/voronoi/Install.py`` script with the specified -args: + You can download and build the Voro++ library manually if you + prefer; follow the instructions in ``lib/voronoi/README``. You + can also do it in one step from the ``lammps/src`` dir, using a + command like these, which simply invoke the + ``lib/voronoi/Install.py`` script with the specified args: -.. code-block:: bash + .. code-block:: bash - $ make lib-voronoi # print help message - $ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++- - $ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++ - $ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6 + $ make lib-voronoi # print help message + $ make lib-voronoi args="-b" # download and build the default version in lib/voronoi/voro++- + $ make lib-voronoi args="-p $HOME/voro++" # use existing Voro++ installation in $HOME/voro++ + $ make lib-voronoi args="-b -v voro++0.4.6" # download and build the 0.4.6 version in lib/voronoi/voro++-0.4.6 -Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``, are -created in lib/voronoi to point to the Voro++ source dir. When LAMMPS -builds in ``src`` it will use these links. You should not need to edit -the ``lib/voronoi/Makefile.lammps`` file. + Note that 2 symbolic (soft) links, ``includelink`` and + ``liblink``, are created in lib/voronoi to point to the Voro++ + source dir. When LAMMPS builds in ``src`` it will use these + links. You should not need to edit the + ``lib/voronoi/Makefile.lammps`` file. ---------- @@ -894,29 +943,30 @@ environment variables have been updated for the local ADIOS installation and the instructions below are followed for the respective build systems. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D ADIOS2_DIR=path # path is where ADIOS 2.x is installed - -D PKG_USER-ADIOS=yes + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D ADIOS2_DIR=path # path is where ADIOS 2.x is installed + -D PKG_USER-ADIOS=yes -Turn on the USER-ADIOS package before building LAMMPS. If the ADIOS 2.x -software is installed in PATH, there is nothing else to do: + .. tab:: Traditional make -.. code-block:: bash + Turn on the USER-ADIOS package before building LAMMPS. If the + ADIOS 2.x software is installed in PATH, there is nothing else to + do: - $ make yes-user-adios + .. code-block:: bash -otherwise, set ADIOS2_DIR environment variable when turning on the package: + $ make yes-user-adios -.. code-block:: bash + otherwise, set ADIOS2_DIR environment variable when turning on the package: - $ ADIOS2_DIR=path make yes-user-adios # path is where ADIOS 2.x is installed + .. code-block:: bash + + $ ADIOS2_DIR=path make yes-user-adios # path is where ADIOS 2.x is installed ---------- @@ -927,48 +977,50 @@ USER-ATC package The USER-ATC package requires the MANYBODY package also be installed. -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides "-D PKG_USER-ATC=yes" -and "-D PKG_MANYBODY=yes". + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + No additional settings are needed besides ``-D PKG_USER-ATC=yes`` + and ``-D PKG_MANYBODY=yes``. -Before building LAMMPS, you must build the ATC library in ``lib/atc``. -You can do this manually if you prefer; follow the instructions in -``lib/atc/README``. You can also do it in one step from the -``lammps/src`` dir, using a command like these, which simply invoke the -``lib/atc/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the ATC library in + ``lib/atc``. You can do this manually if you prefer; follow the + instructions in ``lib/atc/README``. You can also do it in one + step from the ``lammps/src`` dir, using a command like these, + which simply invoke the ``lib/atc/Install.py`` script with the + specified args: - $ make lib-atc # print help message - $ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") - $ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi") - $ make lib-atc args="-m icc" # build with Intel icc compiler + .. code-block:: bash -The build should produce two files: ``lib/atc/libatc.a`` and -``lib/atc/Makefile.lammps``. The latter is copied from an existing -``Makefile.lammps.*`` and has settings needed to build LAMMPS with the -ATC library. If necessary, you can edit/create a new -``lib/atc/Makefile.machine`` file for your system, which should define -an ``EXTRAMAKE`` variable to specify a corresponding -``Makefile.lammps.`` file. + $ make lib-atc # print help message + $ make lib-atc args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") + $ make lib-atc args="-m mpi" # build with default MPI compiler (settings as with "make mpi") + $ make lib-atc args="-m icc" # build with Intel icc compiler -Note that the Makefile.lammps file has settings for the BLAS and -LAPACK linear algebra libraries. As explained in ``lib/atc/README`` these -can either exist on your system, or you can use the files provided in -``lib/linalg``. In the latter case you also need to build the library in -``lib/linalg`` with a command like these: + The build should produce two files: ``lib/atc/libatc.a`` and + ``lib/atc/Makefile.lammps``. The latter is copied from an + existing ``Makefile.lammps.*`` and has settings needed to build + LAMMPS with the ATC library. If necessary, you can edit/create a + new ``lib/atc/Makefile.machine`` file for your system, which + should define an ``EXTRAMAKE`` variable to specify a corresponding + ``Makefile.lammps.`` file. -.. code-block:: bash + Note that the Makefile.lammps file has settings for the BLAS and + LAPACK linear algebra libraries. As explained in + ``lib/atc/README`` these can either exist on your system, or you + can use the files provided in ``lib/linalg``. In the latter case + you also need to build the library in ``lib/linalg`` with a + command like these: - $ make lib-linalg # print help message - $ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") - $ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") - $ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler + .. code-block:: bash + + $ make lib-linalg # print help message + $ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") + $ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") + $ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler ---------- @@ -977,47 +1029,49 @@ can either exist on your system, or you can use the files provided in USER-AWPMD package ------------------ -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides ``-D PKG_USER-AQPMD=yes``. + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + No additional settings are needed besides ``-D PKG_USER-AQPMD=yes``. -Before building LAMMPS, you must build the AWPMD library in ``lib/awpmd``. -You can do this manually if you prefer; follow the instructions in -``lib/awpmd/README``. You can also do it in one step from the ``lammps/src`` -dir, using a command like these, which simply invoke the -``lib/awpmd/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the AWPMD library in + ``lib/awpmd``. You can do this manually if you prefer; follow the + instructions in ``lib/awpmd/README``. You can also do it in one + step from the ``lammps/src`` dir, using a command like these, + which simply invoke the ``lib/awpmd/Install.py`` script with the + specified args: - $ make lib-awpmd # print help message - $ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") - $ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi") - $ make lib-awpmd args="-m icc" # build with Intel icc compiler + .. code-block:: bash -The build should produce two files: ``lib/awpmd/libawpmd.a`` and -``lib/awpmd/Makefile.lammps``. The latter is copied from an existing -``Makefile.lammps.*`` and has settings needed to build LAMMPS with the -AWPMD library. If necessary, you can edit/create a new -``lib/awpmd/Makefile.machine`` file for your system, which should define -an ``EXTRAMAKE`` variable to specify a corresponding -``Makefile.lammps.`` file. + $ make lib-awpmd # print help message + $ make lib-awpmd args="-m serial" # build with GNU g++ compiler and MPI STUBS (settings as with "make serial") + $ make lib-awpmd args="-m mpi" # build with default MPI compiler (settings as with "make mpi") + $ make lib-awpmd args="-m icc" # build with Intel icc compiler -Note that the ``Makefile.lammps`` file has settings for the BLAS and -LAPACK linear algebra libraries. As explained in ``lib/awpmd/README`` -these can either exist on your system, or you can use the files -provided in ``lib/linalg``. In the latter case you also need to build the -library in ``lib/linalg`` with a command like these: + The build should produce two files: ``lib/awpmd/libawpmd.a`` and + ``lib/awpmd/Makefile.lammps``. The latter is copied from an + existing ``Makefile.lammps.*`` and has settings needed to build + LAMMPS with the AWPMD library. If necessary, you can edit/create + a new ``lib/awpmd/Makefile.machine`` file for your system, which + should define an ``EXTRAMAKE`` variable to specify a corresponding + ``Makefile.lammps.`` file. -.. code-block:: bash + Note that the ``Makefile.lammps`` file has settings for the BLAS + and LAPACK linear algebra libraries. As explained in + ``lib/awpmd/README`` these can either exist on your system, or you + can use the files provided in ``lib/linalg``. In the latter case + you also need to build the library in ``lib/linalg`` with a + command like these: - $ make lib-linalg # print help message - $ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") - $ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") - $ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler + .. code-block:: bash + + $ make lib-linalg # print help message + $ make lib-linalg args="-m serial" # build with GNU Fortran compiler (settings as with "make serial") + $ make lib-linalg args="-m mpi" # build with default MPI Fortran compiler (settings as with "make mpi") + $ make lib-linalg args="-m gfortran" # build with GNU Fortran compiler ---------- @@ -1026,54 +1080,57 @@ library in ``lib/linalg`` with a command like these: USER-COLVARS package --------------------------------------- -This package includes into the LAMMPS distribution the Colvars library, which -can be built for the most part with all major versions of the C++ language. +This package includes the `Colvars library +`_ into the LAMMPS distribution, which can +be built for the most part with all major versions of the C++ language. -CMake build -^^^^^^^^^^^ +.. tabs:: -This is the recommended build recipe: no additional settings are normally -needed besides ``-D PKG_USER-COLVARS=yes``. + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + This is the recommended build procedure for using Colvars in + LAMMPS. No additional settings are normally needed besides + ``-D PKG_USER-COLVARS=yes``. -Before building LAMMPS, one must build the Colvars library in lib/colvars. + .. tab:: Traditional make -This can be done manually in the same folder by using or adapting one of -the provided Makefiles: for example, ``Makefile.g++`` for the GNU C++ -compiler. C++11 compatibility may need to be enabled for some older -compilers (as is done in the example makefile). + Before building LAMMPS, one must build the Colvars library in lib/colvars. -In general, it is safer to use build setting consistent with the rest of -LAMMPS. This is best carried out from the LAMMPS src directory using a -command like these, which simply invoke the ``lib/colvars/Install.py`` script with -the specified args: + This can be done manually in the same folder by using or adapting + one of the provided Makefiles: for example, ``Makefile.g++`` for + the GNU C++ compiler. C++11 compatibility may need to be enabled + for some older compilers (as is done in the example makefile). -.. code-block:: bash + In general, it is safer to use build setting consistent with the + rest of LAMMPS. This is best carried out from the LAMMPS src + directory using a command like these, which simply invoke the + ``lib/colvars/Install.py`` script with the specified args: - $ make lib-colvars # print help message - $ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial") - $ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi") - $ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled + .. code-block:: bash -The "machine" argument of the "-m" flag is used to find a Makefile.machine to -use as build recipe. If it does not already exist in ``lib/colvars``, it will be -auto-generated by using compiler flags consistent with those parsed from the -core LAMMPS makefiles. + $ make lib-colvars # print help message + $ make lib-colvars args="-m serial" # build with GNU g++ compiler (settings as with "make serial") + $ make lib-colvars args="-m mpi" # build with default MPI compiler (settings as with "make mpi") + $ make lib-colvars args="-m g++-debug" # build with GNU g++ compiler and colvars debugging enabled -Optional flags may be specified as environment variables: + The "machine" argument of the "-m" flag is used to find a + Makefile.machine to use as build recipe. If it does not already + exist in ``lib/colvars``, it will be auto-generated by using + compiler flags consistent with those parsed from the core LAMMPS + makefiles. -.. code-block:: bash + Optional flags may be specified as environment variables: - $ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower) - $ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise) + .. code-block:: bash -The build should produce two files: the library ``lib/colvars/libcolvars.a`` -(which also includes Lepton objects if enabled) and the specification file -``lib/colvars/Makefile.lammps``. The latter is auto-generated, and normally does -not need to be edited. + $ COLVARS_DEBUG=yes make lib-colvars args="-m machine" # Build with debug code (much slower) + $ COLVARS_LEPTON=no make lib-colvars args="-m machine" # Build without Lepton (included otherwise) + + The build should produce two files: the library ``lib/colvars/libcolvars.a`` + (which also includes Lepton objects if enabled) and the specification file + ``lib/colvars/Makefile.lammps``. The latter is auto-generated, and normally does + not need to be edited. ---------- @@ -1086,7 +1143,7 @@ USER-PLUMED package Before building LAMMPS with this package, you must first build PLUMED. PLUMED can be built as part of the LAMMPS build or installed separately -from LAMMPS using the generic `plumed installation instructions `_. +from LAMMPS using the generic `PLUMED installation instructions `_. The USER-PLUMED package has been tested to work with Plumed versions 2.4.x, 2.5.x, and 2.6.x and will error out, when trying to run calculations with a different version of the Plumed kernel. @@ -1119,84 +1176,91 @@ try a different one, switch to a different build system, consider a global PLUMED installation or consider downloading PLUMED during the LAMMPS build. -CMake build -^^^^^^^^^^^ +.. tabs:: -When the ``-D PKG_USER-PLUMED=yes`` flag is included in the cmake -command you must ensure that GSL is installed in locations that are -specified in your environment. There are then two additional variables -that control the manner in which PLUMED is obtained and linked into -LAMMPS. + .. tab:: CMake build -.. code-block:: bash + When the ``-D PKG_USER-PLUMED=yes`` flag is included in the cmake + command you must ensure that GSL is installed in locations that + are specified in your environment. There are then two additional + variables that control the manner in which PLUMED is obtained and + linked into LAMMPS. - -D DOWNLOAD_PLUMED=value # download PLUMED for build, value = no (default) or yes - -D PLUMED_MODE=value # Linkage mode for PLUMED, value = static (default), shared, or runtime + .. code-block:: bash -If DOWNLOAD_PLUMED is set to "yes", the PLUMED library will be -downloaded (the version of PLUMED that will be downloaded is hard-coded -to a vetted version of PLUMED, usually a recent stable release version) -and built inside the CMake build directory. If ``DOWNLOAD_PLUMED`` is -set to "no" (the default), CMake will try to detect and link to an -installed version of PLUMED. For this to work, the PLUMED library has -to be installed into a location where the ``pkg-config`` tool can find -it or the PKG_CONFIG_PATH environment variable has to be set up -accordingly. PLUMED should be installed in such a location if you -compile it using the default make; make install commands. + -D DOWNLOAD_PLUMED=value # download PLUMED for build, value = no (default) or yes + -D PLUMED_MODE=value # Linkage mode for PLUMED, value = static (default), shared, or runtime -The ``PLUMED_MODE`` setting determines the linkage mode for the PLUMED -library. The allowed values for this flag are "static" (default), -"shared", or "runtime". For a discussion of PLUMED linkage modes, -please see above. When ``DOWNLOAD_PLUMED`` is enabled the static -linkage mode is recommended. + If DOWNLOAD_PLUMED is set to "yes", the PLUMED library will be + downloaded (the version of PLUMED that will be downloaded is + hard-coded to a vetted version of PLUMED, usually a recent stable + release version) and built inside the CMake build directory. If + ``DOWNLOAD_PLUMED`` is set to "no" (the default), CMake will try + to detect and link to an installed version of PLUMED. For this to + work, the PLUMED library has to be installed into a location where + the ``pkg-config`` tool can find it or the PKG_CONFIG_PATH + environment variable has to be set up accordingly. PLUMED should + be installed in such a location if you compile it using the + default make; make install commands. -Traditional make -^^^^^^^^^^^^^^^^ + The ``PLUMED_MODE`` setting determines the linkage mode for the + PLUMED library. The allowed values for this flag are "static" + (default), "shared", or "runtime". If you want to switch the + linkage mode, just re-run CMake with a different setting. For a + discussion of PLUMED linkage modes, please see above. When + ``DOWNLOAD_PLUMED`` is enabled the static linkage mode is + recommended. -PLUMED needs to be installed before the USER-PLUMED package is installed -so that LAMMPS can find the right settings when compiling and linking -the LAMMPS executable. You can either download and build PLUMED inside -the LAMMPS plumed library folder or use a previously installed PLUMED -library and point LAMMPS to its location. You also have to choose the -linkage mode: "static" (default), "shared" or "runtime". For a -discussion of PLUMED linkage modes, please see above. + .. tab:: Traditional make -Download/compilation/configuration of the plumed library can be done -from the src folder through the following make args: + PLUMED needs to be installed before the USER-PLUMED package is + installed so that LAMMPS can find the right settings when + compiling and linking the LAMMPS executable. You can either + download and build PLUMED inside the LAMMPS plumed library folder + or use a previously installed PLUMED library and point LAMMPS to + its location. You also have to choose the linkage mode: "static" + (default), "shared" or "runtime". For a discussion of PLUMED + linkage modes, please see above. -.. code-block:: bash + Download/compilation/configuration of the plumed library can be done + from the src folder through the following make args: - $ make lib-plumed # print help message - $ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2 - $ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local - $ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in - # /usr/local and use shared linkage mode + .. code-block:: bash -Note that 2 symbolic (soft) links, ``includelink`` and ``liblink`` are -created in lib/plumed that point to the location of the PLUMED build to -use. A new file ``lib/plumed/Makefile.lammps`` is also created with settings -suitable for LAMMPS to compile and link PLUMED using the desired linkage -mode. After this step is completed, you can install the USER-PLUMED -package and compile LAMMPS in the usual manner: + $ make lib-plumed # print help message + $ make lib-plumed args="-b" # download and build PLUMED in lib/plumed/plumed2 + $ make lib-plumed args="-p $HOME/.local" # use existing PLUMED installation in $HOME/.local + $ make lib-plumed args="-p /usr/local -m shared" # use existing PLUMED installation in + # /usr/local and use shared linkage mode -.. code-block:: bash + Note that 2 symbolic (soft) links, ``includelink`` and ``liblink`` + are created in lib/plumed that point to the location of the PLUMED + build to use. A new file ``lib/plumed/Makefile.lammps`` is also + created with settings suitable for LAMMPS to compile and link + PLUMED using the desired linkage mode. After this step is + completed, you can install the USER-PLUMED package and compile + LAMMPS in the usual manner: - $ make yes-user-plumed - $ make machine + .. code-block:: bash -Once this compilation completes you should be able to run LAMMPS in the -usual way. For shared linkage mode, libplumed.so must be found by the -LAMMPS executable, which on many operating systems means, you have to -set the LD_LIBRARY_PATH environment variable accordingly. + $ make yes-user-plumed + $ make machine -Support for the different linkage modes in LAMMPS varies for different -operating systems, using the static linkage is expected to be the most -portable, and thus set to be the default. + Once this compilation completes you should be able to run LAMMPS + in the usual way. For shared linkage mode, libplumed.so must be + found by the LAMMPS executable, which on many operating systems + means, you have to set the LD_LIBRARY_PATH environment variable + accordingly. -If you want to change the linkage mode, you have to re-run "make -lib-plumed" with the desired settings **and** do a re-install if the -USER-PLUMED package with "make yes-user-plumed" to update the required -makefile settings with the changes in the lib/plumed folder. + Support for the different linkage modes in LAMMPS varies for + different operating systems, using the static linkage is expected + to be the most portable, and thus set to be the default. + + If you want to change the linkage mode, you have to re-run "make + lib-plumed" with the desired settings **and** do a re-install if + the USER-PLUMED package with "make yes-user-plumed" to update the + required makefile settings with the changes in the lib/plumed + folder. ---------- @@ -1209,38 +1273,39 @@ To build with this package you must have the HDF5 software package installed on your system, which should include the h5cc compiler and the HDF5 library. -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides ``-D PKG_USER-H5MD=yes``. + .. tab:: CMake build -This should auto-detect the H5MD library on your system. Several -advanced CMake H5MD options exist if you need to specify where it is -installed. Use the ccmake (terminal window) or cmake-gui (graphical) -tools to see these options and set them interactively from their user -interfaces. + No additional settings are needed besides ``-D PKG_USER-H5MD=yes``. -Traditional make -^^^^^^^^^^^^^^^^ + This should auto-detect the H5MD library on your system. Several + advanced CMake H5MD options exist if you need to specify where it + is installed. Use the ccmake (terminal window) or cmake-gui + (graphical) tools to see these options and set them interactively + from their user interfaces. -Before building LAMMPS, you must build the CH5MD library in -``lib/h5md``. You can do this manually if you prefer; follow the -instructions in ``lib/h5md/README``. You can also do it in one step -from the ``lammps/src`` dir, using a command like these, which simply -invoke the ``lib/h5md/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the CH5MD library in + ``lib/h5md``. You can do this manually if you prefer; follow the + instructions in ``lib/h5md/README``. You can also do it in one + step from the ``lammps/src`` dir, using a command like these, + which simply invoke the ``lib/h5md/Install.py`` script with the + specified args: - $ make lib-h5md # print help message - $ make lib-h5md args="-m h5cc" # build with h5cc compiler + .. code-block:: bash -The build should produce two files: ``lib/h5md/libch5md.a`` and -``lib/h5md/Makefile.lammps``. The latter is copied from an existing -``Makefile.lammps.*`` and has settings needed to build LAMMPS with the -system HDF5 library. If necessary, you can edit/create a new -``lib/h5md/Makefile.machine`` file for your system, which should define -an EXTRAMAKE variable to specify a corresponding -``Makefile.lammps.`` file. + $ make lib-h5md # print help message + $ make lib-h5md args="-m h5cc" # build with h5cc compiler + + The build should produce two files: ``lib/h5md/libch5md.a`` and + ``lib/h5md/Makefile.lammps``. The latter is copied from an + existing ``Makefile.lammps.*`` and has settings needed to build + LAMMPS with the system HDF5 library. If necessary, you can + edit/create a new ``lib/h5md/Makefile.machine`` file for your + system, which should define an EXTRAMAKE variable to specify a + corresponding ``Makefile.lammps.`` file. ---------- @@ -1253,7 +1318,7 @@ To build with this package, you must choose which hardware you want to build for, either x86 CPUs or Intel KNLs in offload mode. You should also typically :ref:`install the USER-OMP package `, as it can be used in tandem with the USER-INTEL package to good effect, as explained -on the :doc:`Speed intel ` doc page. +on the :doc:`Speed_intel` page. When using Intel compilers version 16.0 or later is required. You can also use the GNU or Clang compilers and they will provide performance @@ -1264,51 +1329,53 @@ incorrectly and thus can cause segmentation faults in otherwise correct code when using features from the USER-INTEL package. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D INTEL_ARCH=value # value = cpu (default) or knl - -D INTEL_LRT_MODE=value # value = threads, none, or c++11 + .. code-block:: bash + + -D INTEL_ARCH=value # value = cpu (default) or knl + -D INTEL_LRT_MODE=value # value = threads, none, or c++11 + + .. tab:: Traditional make + + Choose which hardware to compile for in Makefile.machine via the + following settings. See ``src/MAKE/OPTIONS/Makefile.intel_cpu*`` + and ``Makefile.knl`` files for examples. and + ``src/USER-INTEL/README`` for additional information. + + For CPUs: + + .. code-block:: make + + OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high + CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS) + LINKFLAGS = -g -qopenmp $(OPTFLAGS) + LIB = -ltbbmalloc + + For KNLs: + + .. code-block:: make + + OPTFLAGS = -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits + CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS) + LINKFLAGS = -g -qopenmp $(OPTFLAGS) + LIB = -ltbbmalloc In Long-range thread mode (LRT) a modified verlet style is used, that operates the Kspace calculation in a separate thread concurrently to -other calculations. This has to be enabled in the :doc:`package intel ` -command at runtime. With the setting "threads" it used the pthreads -library, while c++11 will use the built-in thread support of C++11 -compilers. The option "none" skips compilation of this feature. The -default is to use "threads" if pthreads is available and otherwise "none". +other calculations. This has to be enabled in the :doc:`package intel +` command at runtime. With the setting "threads" it used the +pthreads library, while "c++11" will use the built-in thread support +of C++11 compilers. The option "none" skips compilation of this +feature. The default is to use "threads" if pthreads is available and +otherwise "none". -Best performance is achieved with Intel hardware, Intel compilers, as well as -the Intel TBB and MKL libraries. However, the code also compiles, links, and -runs with other compilers and without TBB and MKL. - -Traditional make -^^^^^^^^^^^^^^^^ - -Choose which hardware to compile for in Makefile.machine via the -following settings. See ``src/MAKE/OPTIONS/Makefile.intel_cpu*`` and -``Makefile.knl`` files for examples. and ``src/USER-INTEL/README`` for -additional information. - -For CPUs: - -.. code-block:: make - - OPTFLAGS = -xHost -O2 -fp-model fast=2 -no-prec-div -qoverride-limits -qopt-zmm-usage=high - CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS) - LINKFLAGS = -g -qopenmp $(OPTFLAGS) - LIB = -ltbbmalloc - -For KNLs: - -.. code-block:: make - - OPTFLAGS = -xMIC-AVX512 -O2 -fp-model fast=2 -no-prec-div -qoverride-limits - CCFLAGS = -g -qopenmp -DLAMMPS_MEMALIGN=64 -no-offload -fno-alias -ansi-alias -restrict $(OPTFLAGS) - LINKFLAGS = -g -qopenmp $(OPTFLAGS) - LIB = -ltbbmalloc +Best performance is achieved with Intel hardware, Intel compilers, as +well as the Intel TBB and MKL libraries. However, the code also +compiles, links, and runs with other compilers / hardware and without +TBB and MKL. ---------- @@ -1323,31 +1390,34 @@ compile it. Also, the files with the force field data for running the bundled examples are not included in the source distribution. Instead they will be downloaded the first time this package is installed. -**CMake build**\ : +.. tabs:: -No additional settings are needed besides ``-D PKG_USER-MESONT=yes`` + .. tab:: CMake build -**Traditional make**\ : + No additional settings are needed besides ``-D PKG_USER-MESONT=yes`` -Before building LAMMPS, you must build the *mesont* library in ``lib/mesont``\ . -You can also do it in one step from the ``lammps/src`` dir, using a command like -these, which simply invoke the ``lib/mesont/Install.py`` script with the specified -args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the *mesont* library in + ``lib/mesont``\ . You can also do it in one step from the + ``lammps/src`` dir, using a command like these, which simply + invoke the ``lib/mesont/Install.py`` script with the specified + args: - $ make lib-mesont # print help message - $ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial") - $ make lib-mesont args="-m ifort" # build with Intel icc compiler + .. code-block:: bash -The build should produce two files: ``lib/mesont/libmesont.a`` and -``lib/mesont/Makefile.lammps``\ . The latter is copied from an existing -``Makefile.lammps.\*`` and has settings needed to build LAMMPS with the -*mesont* library (though typically the settings contain only the Fortran -runtime library). If necessary, you can edit/create a new -``lib/mesont/Makefile.machine`` file for your system, which should -define an ``EXTRAMAKE`` variable to specify a corresponding -``Makefile.lammps.machine`` file. + $ make lib-mesont # print help message + $ make lib-mesont args="-m gfortran" # build with GNU g++ compiler (settings as with "make serial") + $ make lib-mesont args="-m ifort" # build with Intel icc compiler + + The build should produce two files: ``lib/mesont/libmesont.a`` and + ``lib/mesont/Makefile.lammps``\ . The latter is copied from an + existing ``Makefile.lammps.\*`` and has settings needed to build + LAMMPS with the *mesont* library (though typically the settings + contain only the Fortran runtime library). If necessary, you can + edit/create a new ``lib/mesont/Makefile.machine`` file for your + system, which should define an ``EXTRAMAKE`` variable to specify a + corresponding ``Makefile.lammps.machine`` file. ---------- @@ -1356,35 +1426,36 @@ define an ``EXTRAMAKE`` variable to specify a corresponding USER-MOLFILE package --------------------------------------- -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D MOLFILE_INCLUDE_DIRS=path # (optional) path where VMD molfile plugin headers are installed - -D PKG_USER-MOLFILE=yes + .. code-block:: bash -Using "-D PKG_USER-MOLFILE=yes" enables the package, and setting -"-D MOLFILE_INCLUDE DIRS" allows to provide a custom location for -the molfile plugin header files. These should match the ABI of the -plugin files used, and thus one typically sets them to include -folder of the local VMD installation in use. LAMMPS ships with a -couple of default header files that correspond to a popular VMD -version, usually the latest release. + -D MOLFILE_INCLUDE_DIR=path # (optional) path where VMD molfile plugin headers are installed + -D PKG_USER-MOLFILE=yes -Traditional make -^^^^^^^^^^^^^^^^ + Using ``-D PKG_USER-MOLFILE=yes`` enables the package, and setting + ``-D MOLFILE_INCLUDE_DIR`` allows to provide a custom location for + the molfile plugin header files. These should match the ABI of the + plugin files used, and thus one typically sets them to include + folder of the local VMD installation in use. LAMMPS ships with a + couple of default header files that correspond to a popular VMD + version, usually the latest release. -The ``lib/molfile/Makefile.lammps`` file has a setting for a dynamic -loading library libdl.a that is typically present on all systems. It -is required for LAMMPS to link with this package. If the setting is -not valid for your system, you will need to edit the Makefile.lammps -file. See ``lib/molfile/README`` and ``lib/molfile/Makefile.lammps`` for -details. It is also possible to configure a different folder with -the VMD molfile plugin header files. LAMMPS ships with a couple of -default headers, but these are not compatible with all VMD versions, -so it is often best to change this setting to the location of the -same include files of the local VMD installation in use. + .. tab:: Traditional make + + The ``lib/molfile/Makefile.lammps`` file has a setting for a + dynamic loading library libdl.a that is typically present on all + systems. It is required for LAMMPS to link with this package. If + the setting is not valid for your system, you will need to edit + the Makefile.lammps file. See ``lib/molfile/README`` and + ``lib/molfile/Makefile.lammps`` for details. It is also possible + to configure a different folder with the VMD molfile plugin header + files. LAMMPS ships with a couple of default headers, but these + are not compatible with all VMD versions, so it is often best to + change this setting to the location of the same include files of + the local VMD installation in use. ---------- @@ -1396,24 +1467,26 @@ USER-NETCDF package To build with this package you must have the NetCDF library installed on your system. -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides ``-D PKG_USER-NETCDF=yes``. + .. tab:: CMake build -This should auto-detect the NETCDF library if it is installed on your -system at standard locations. Several advanced CMake NETCDF options -exist if you need to specify where it was installed. Use the ``ccmake`` -(terminal window) or ``cmake-gui`` (graphical) tools to see these -options and set them interactively from their user interfaces. + No additional settings are needed besides ``-D PKG_USER-NETCDF=yes``. -Traditional make -^^^^^^^^^^^^^^^^ + This should auto-detect the NETCDF library if it is installed on + your system at standard locations. Several advanced CMake NETCDF + options exist if you need to specify where it was installed. Use + the ``ccmake`` (terminal window) or ``cmake-gui`` (graphical) + tools to see these options and set them interactively from their + user interfaces. -The ``lib/netcdf/Makefile.lammps`` file has settings for NetCDF include -and library files which LAMMPS needs to build with this package. If -the settings are not valid for your system, you will need to edit the -``Makefile.lammps`` file. See ``lib/netcdf/README`` for details. + .. tab:: Traditional make + + The ``lib/netcdf/Makefile.lammps`` file has settings for NetCDF + include and library files which LAMMPS needs to build with this + package. If the settings are not valid for your system, you will + need to edit the ``Makefile.lammps`` file. See + ``lib/netcdf/README`` for details. ---------- @@ -1422,30 +1495,31 @@ the settings are not valid for your system, you will need to edit the USER-OMP package ------------------------------- -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are required besides ``-D PKG_USER-OMP=yes``. If -CMake detects OpenMP support, the USER-OMP code will be compiled with -multi-threading support enabled, otherwise as optimized serial code. + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + No additional settings are required besides ``-D + PKG_USER-OMP=yes``. If CMake detects OpenMP compiler support, the + USER-OMP code will be compiled with multi-threading support + enabled, otherwise as optimized serial code. -To enable multi-threading support in the USER-OMP package (and other -styles supporting OpenMP) the following compile and link flags must be -added to your Makefile.machine file. See -``src/MAKE/OPTIONS/Makefile.omp`` for an example. + .. tab:: Traditional make -.. parsed-literal:: + To enable multi-threading support in the USER-OMP package (and + other styles supporting OpenMP) the following compile and link + flags must be added to your Makefile.machine file. See + ``src/MAKE/OPTIONS/Makefile.omp`` for an example. - CCFLAGS: -fopenmp # for GNU and Clang Compilers - CCFLAGS: -qopenmp -restrict # for Intel compilers on Linux - LINKFLAGS: -fopenmp # for GNU and Clang Compilers - LINKFLAGS: -qopenmp # for Intel compilers on Linux + .. parsed-literal:: -For other platforms and compilers, please consult the documentation -about OpenMP support for your compiler. + CCFLAGS: -fopenmp # for GNU and Clang Compilers + CCFLAGS: -qopenmp -restrict # for Intel compilers on Linux + LINKFLAGS: -fopenmp # for GNU and Clang Compilers + LINKFLAGS: -qopenmp # for Intel compilers on Linux + + For other platforms and compilers, please consult the + documentation about OpenMP support for your compiler. ---------- @@ -1467,58 +1541,60 @@ and LAMMPS versions. The current interface and makefiles have last been verified to work in February 2020 with Quantum Espresso versions 6.3 to 6.5. -CMake build -^^^^^^^^^^^ +.. tabs:: -When using CMake, building a LAMMPS library is required and it is -recommended to build a shared library, since any libraries built from -the sources in the *lib* folder (including the essential libqmmm.a) -are not included in the static LAMMPS library and (currently) not -installed, while their code is included in the shared LAMMPS library. -Thus a typical command line to configure building LAMMPS for USER-QMMM -would be: + .. tab:: CMake build -.. code-block:: bash + When using CMake, building a LAMMPS library is required and it is + recommended to build a shared library, since any libraries built + from the sources in the *lib* folder (including the essential + libqmmm.a) are not included in the static LAMMPS library and + (currently) not installed, while their code is included in the + shared LAMMPS library. Thus a typical command line to configure + building LAMMPS for USER-QMMM would be: - cmake -C ../cmake/presets/minimal.cmake -D PKG_USER-QMMM=yes \ - -D BUILD_LIB=yes -DBUILD_SHARED_LIBS=yes ../cmake + .. code-block:: bash -After completing the LAMMPS build and also configuring and compiling -Quantum ESPRESSO with external library support (via "make couple"), -go back to the ``lib/qmmm` folder and follow the instructions on the -README file to build the combined LAMMPS/QE QM/MM executable -(pwqmmm.x) in the ``lib/qmmm`` folder. You need to make certain, that + cmake -C ../cmake/presets/minimal.cmake -D PKG_USER-QMMM=yes \ + -D BUILD_LIB=yes -DBUILD_SHARED_LIBS=yes ../cmake -Traditional make -^^^^^^^^^^^^^^^^ + After completing the LAMMPS build and also configuring and + compiling Quantum ESPRESSO with external library support (via + "make couple"), go back to the ``lib/qmmm`` folder and follow the + instructions on the README file to build the combined LAMMPS/QE + QM/MM executable (pwqmmm.x) in the ``lib/qmmm`` folder. -Before building LAMMPS, you must build the QMMM library in ``lib/qmmm``. -You can do this manually if you prefer; follow the first two steps -explained in ``lib/qmmm/README``. You can also do it in one step from -the ``lammps/src`` dir, using a command like these, which simply invoke -the ``lib/qmmm/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + Before building LAMMPS, you must build the QMMM library in + ``lib/qmmm``. You can do this manually if you prefer; follow the + first two steps explained in ``lib/qmmm/README``. You can also do + it in one step from the ``lammps/src`` dir, using a command like + these, which simply invoke the ``lib/qmmm/Install.py`` script with + the specified args: - $ make lib-qmmm # print help message - $ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial") - $ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi") - $ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler + .. code-block:: bash -The build should produce two files: ``lib/qmmm/libqmmm.a`` and -``lib/qmmm/Makefile.lammps``. The latter is copied from an existing -``Makefile.lammps.*`` and has settings needed to build LAMMPS with the -QMMM library (though typically the settings are just blank). If -necessary, you can edit/create a new ``lib/qmmm/Makefile.`` file -for your system, which should define an ``EXTRAMAKE`` variable to -specify a corresponding ``Makefile.lammps.`` file. + $ make lib-qmmm # print help message + $ make lib-qmmm args="-m serial" # build with GNU Fortran compiler (settings as in "make serial") + $ make lib-qmmm args="-m mpi" # build with default MPI compiler (settings as in "make mpi") + $ make lib-qmmm args="-m gfortran" # build with GNU Fortran compiler -You can then install QMMM package and build LAMMPS in the usual -manner. After completing the LAMMPS build and compiling Quantum -ESPRESSO with external library support (via "make couple"), go back to -the ``lib/qmmm`` folder and follow the instructions in the README file to -build the combined LAMMPS/QE QM/MM executable (pwqmmm.x) in the -lib/qmmm folder. + The build should produce two files: ``lib/qmmm/libqmmm.a`` and + ``lib/qmmm/Makefile.lammps``. The latter is copied from an + existing ``Makefile.lammps.*`` and has settings needed to build + LAMMPS with the QMMM library (though typically the settings are + just blank). If necessary, you can edit/create a new + ``lib/qmmm/Makefile.`` file for your system, which should + define an ``EXTRAMAKE`` variable to specify a corresponding + ``Makefile.lammps.`` file. + + You can then install QMMM package and build LAMMPS in the usual + manner. After completing the LAMMPS build and compiling Quantum + ESPRESSO with external library support (via "make couple"), go + back to the ``lib/qmmm`` folder and follow the instructions in the + README file to build the combined LAMMPS/QE QM/MM executable + (pwqmmm.x) in the lib/qmmm folder. ---------- @@ -1533,27 +1609,27 @@ potentials, additional files with specific licensing conditions need to be downloaded and configured. See step 1 and step 1.1 in the ``lib/quip/README`` file for details on how to do this. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location) + .. code-block:: bash -CMake will not download and build the QUIP library. But once you have -done that, a CMake build of LAMMPS with ``-D PKG_USER-QUIP=yes`` should -work. Set QUIP_LIBRARY if CMake cannot find the QUIP library. + -D QUIP_LIBRARY=path # path to libquip.a (only needed if a custom location) -Traditional make -^^^^^^^^^^^^^^^^ + CMake will **not** download and build the QUIP library. But once you have + done that, a CMake build of LAMMPS with ``-D PKG_USER-QUIP=yes`` should + work. Set the ``QUIP_LIBRARY`` variable if CMake cannot find the QUIP library. -The download/build procedure for the QUIP library, described in -``lib/quip/README`` file requires setting two environment variables, -QUIP_ROOT and QUIP_ARCH. These are accessed by the -lib/quip/Makefile.lammps file which is used when you compile and link -LAMMPS with this package. You should only need to edit -``Makefile.lammps`` if the LAMMPS build can not use its settings to -successfully build on your system. + .. tab:: Traditional make + + The download/build procedure for the QUIP library, described in + ``lib/quip/README`` file requires setting two environment + variables, ``QUIP_ROOT`` and ``QUIP_ARCH``. These are accessed by + the ``lib/quip/Makefile.lammps`` file which is used when you + compile and link LAMMPS with this package. You should only need + to edit ``Makefile.lammps`` if the LAMMPS build can not use its + settings to successfully build on your system. ---------- @@ -1562,44 +1638,45 @@ successfully build on your system. USER-SCAFACOS package ----------------------------------------- -To build with this package, you must download and build the `ScaFaCoS -Coulomb solver library `_ +To build with this package, you must download and build the +`ScaFaCoS Coulomb solver library `_ -.. _scafacos-home: http://www.scafacos.de +.. tabs:: -CMake build -^^^^^^^^^^^ + .. tab:: CMake build -.. code-block:: bash + .. code-block:: bash - -D DOWNLOAD_SCAFACOS=value # download ScaFaCoS for build, value = no (default) or yes - -D SCAFACOS_LIBRARY=path # ScaFaCos library file (only needed if at custom location) - -D SCAFACOS_INCLUDE_DIR=path # ScaFaCoS include directory (only needed if at custom location) + -D DOWNLOAD_SCAFACOS=value # download ScaFaCoS for build, value = no (default) or yes + -D SCAFACOS_LIBRARY=path # ScaFaCos library file (only needed if at custom location) + -D SCAFACOS_INCLUDE_DIR=path # ScaFaCoS include directory (only needed if at custom location) -If DOWNLOAD_SCAFACOS is set, the ScaFaCoS library will be downloaded -and built inside the CMake build directory. If the ScaFaCoS library -is already on your system (in a location CMake cannot find it), -SCAFACOS_LIBRARY is the filename (plus path) of the ScaFaCoS library -file, not the directory the library file is in. SCAFACOS_INCLUDE_DIR -is the directory the ScaFaCoS include file is in. + If ``DOWNLOAD_SCAFACOS`` is set, the ScaFaCoS library will be + downloaded and built inside the CMake build directory. If the + ScaFaCoS library is already on your system (in a location CMake + cannot find it), ``SCAFACOS_LIBRARY`` is the filename (plus path) of + the ScaFaCoS library file, not the directory the library file is + in. ``SCAFACOS_INCLUDE_DIR`` is the directory the ScaFaCoS include + file is in. -Traditional make -^^^^^^^^^^^^^^^^ + .. tab:: Traditional make -You can download and build the ScaFaCoS library manually if you -prefer; follow the instructions in ``lib/scafacos/README``. You can also -do it in one step from the ``lammps/src`` dir, using a command like these, -which simply invoke the ``lib/scafacos/Install.py`` script with the -specified args: + You can download and build the ScaFaCoS library manually if you + prefer; follow the instructions in ``lib/scafacos/README``. You + can also do it in one step from the ``lammps/src`` dir, using a + command like these, which simply invoke the + ``lib/scafacos/Install.py`` script with the specified args: -make lib-scafacos # print help message -make lib-scafacos args="-b" # download and build in lib/scafacos/scafacos- -make lib-scafacos args="-p $HOME/scafacos # use existing ScaFaCoS installation in $HOME/scafacos + .. code-block:: bash -Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``, are -created in ``lib/scafacos`` to point to the ScaFaCoS src dir. When LAMMPS -builds in src it will use these links. You should not need to edit -the ``lib/scafacos/Makefile.lammps`` file. + make lib-scafacos # print help message + make lib-scafacos args="-b" # download and build in lib/scafacos/scafacos- + make lib-scafacos args="-p $HOME/scafacos # use existing ScaFaCoS installation in $HOME/scafacos + + Note that 2 symbolic (soft) links, ``includelink`` and ``liblink``, are + created in ``lib/scafacos`` to point to the ScaFaCoS src dir. When LAMMPS + builds in src it will use these links. You should not need to edit + the ``lib/scafacos/Makefile.lammps`` file. ---------- @@ -1611,37 +1688,39 @@ USER-SMD package To build with this package, you must download the Eigen3 library. Eigen3 is a template library, so you do not need to build it. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes - -D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location) + .. code-block:: bash -If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be downloaded and -inside the CMake build directory. If the Eigen3 library is already on -your system (in a location CMake cannot find it), ``EIGEN3_INCLUDE_DIR`` -is the directory the Eigen3++ include file is in. + -D DOWNLOAD_EIGEN3 # download Eigen3, value = no (default) or yes + -D EIGEN3_INCLUDE_DIR=path # path to Eigen library (only needed if a custom location) -Traditional make -^^^^^^^^^^^^^^^^ + If ``DOWNLOAD_EIGEN3`` is set, the Eigen3 library will be + downloaded and inside the CMake build directory. If the Eigen3 + library is already on your system (in a location where CMake + cannot find it), set ``EIGEN3_INCLUDE_DIR`` to the directory the + ``Eigen3`` include file is in. -You can download the Eigen3 library manually if you prefer; follow the -instructions in ``lib/smd/README``. You can also do it in one step from -the ``lammps/src`` dir, using a command like these, which simply invoke -the ``lib/smd/Install.py`` script with the specified args: + .. tab:: Traditional make -.. code-block:: bash + You can download the Eigen3 library manually if you prefer; follow + the instructions in ``lib/smd/README``. You can also do it in one + step from the ``lammps/src`` dir, using a command like these, + which simply invoke the ``lib/smd/Install.py`` script with the + specified args: - $ make lib-smd # print help message - $ make lib-smd args="-b" # download to lib/smd/eigen3 - $ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 + .. code-block:: bash -Note that a symbolic (soft) link named ``includelink`` is created in -``lib/smd`` to point to the Eigen dir. When LAMMPS builds it will use -this link. You should not need to edit the ``lib/smd/Makefile.lammps`` -file. + $ make lib-smd # print help message + $ make lib-smd args="-b" # download to lib/smd/eigen3 + $ make lib-smd args="-p /usr/include/eigen3" # use existing Eigen installation in /usr/include/eigen3 + + Note that a symbolic (soft) link named ``includelink`` is created + in ``lib/smd`` to point to the Eigen dir. When LAMMPS builds it + will use this link. You should not need to edit the + ``lib/smd/Makefile.lammps`` file. ---------- @@ -1653,23 +1732,24 @@ USER-VTK package To build with this package you must have the VTK library installed on your system. -CMake build -^^^^^^^^^^^ +.. tabs:: -No additional settings are needed besides ``-D PKG_USER-VTK=yes``. + .. tab:: CMake build -This should auto-detect the VTK library if it is installed on your -system at standard locations. Several advanced VTK options exist if -you need to specify where it was installed. Use the ``ccmake`` (terminal -window) or ``cmake-gui`` (graphical) tools to see these options and set -them interactively from their user interfaces. + No additional settings are needed besides ``-D PKG_USER-VTK=yes``. -Traditional make -^^^^^^^^^^^^^^^^ + This should auto-detect the VTK library if it is installed on your + system at standard locations. Several advanced VTK options exist + if you need to specify where it was installed. Use the ``ccmake`` + (terminal window) or ``cmake-gui`` (graphical) tools to see these + options and set them interactively from their user interfaces. -The ``lib/vtk/Makefile.lammps`` file has settings for accessing VTK files -and its library, which LAMMPS needs to build with this package. If -the settings are not valid for your system, check if one of the other -``lib/vtk/Makefile.lammps.*`` files is compatible and copy it to -Makefile.lammps. If none of the provided files work, you will need to -edit the ``Makefile.lammps`` file. See ``lib/vtk/README`` for details. + .. tab:: Traditional make + + The ``lib/vtk/Makefile.lammps`` file has settings for accessing + VTK files and its library, which LAMMPS needs to build with this + package. If the settings are not valid for your system, check if + one of the other ``lib/vtk/Makefile.lammps.*`` files is compatible + and copy it to Makefile.lammps. If none of the provided files + work, you will need to edit the ``Makefile.lammps`` file. See + ``lib/vtk/README`` for details. diff --git a/doc/src/Build_link.rst b/doc/src/Build_link.rst index 914142b3ce..3d66371304 100644 --- a/doc/src/Build_link.rst +++ b/doc/src/Build_link.rst @@ -4,11 +4,11 @@ Link LAMMPS as a library to another code LAMMPS is designed as a library of C++ objects that can be integrated into other applications including Python scripts. The files ``src/library.cpp`` and ``src/library.h`` define a -C-style API for using LAMMPS as a library. See the :doc:`Howto -library ` page for a description of the interface -and how to use it for your needs. +C-style API for using LAMMPS as a library. See the +:doc:`Howto_library` page +for a description of the interface and how to use it for your needs. -The :doc:`Build basics ` doc page explains how to build +The :doc:`Build_basics` page explains how to build LAMMPS as either a shared or static library. This results in a file in the compilation folder called ``liblammps.a`` or ``liblammps_.a`` in case of building a static library. In case of a shared library @@ -41,42 +41,45 @@ The benefit of linking to a static library is, that the resulting executable is independent of that library since all required executable code from the library is copied into the calling executable. -CMake build -^^^^^^^^^^^ +.. tabs:: -This assumes that LAMMPS has been configured without setting a -``LAMMPS_MACHINE`` name, installed with "make install", and the -``PKG_CONFIG_PATH`` environment variable has been updated to include the -``liblammps.pc`` file installed into the configured destination folder. -The commands to compile and link a coupled executable are then: + .. tab:: CMake build -.. code-block:: bash + This assumes that LAMMPS has been configured without setting a + ``LAMMPS_MACHINE`` name, installed with "make install", and the + ``PKG_CONFIG_PATH`` environment variable has been updated to + include the ``liblammps.pc`` file installed into the configured + destination folder. The commands to compile and link a coupled + executable are then: - mpicc -c -O $(pkgconf liblammps --cflags) caller.c - mpicxx -o caller caller.o -$(pkgconf liblammps --libs) + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + mpicc -c -O $(pkgconf liblammps --cflags) caller.c + mpicxx -o caller caller.o -$(pkgconf liblammps --libs) -This assumes that LAMMPS has been compiled in the folder -``${HOME}/lammps/src`` with "make mpi". The commands to compile and link -a coupled executable are then: + .. tab:: Traditional make -.. code-block:: bash + This assumes that LAMMPS has been compiled in the folder + ``${HOME}/lammps/src`` with "make mpi". The commands to compile + and link a coupled executable are then: - mpicc -c -O -I${HOME}/lammps/src caller.c - mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps_mpi + .. code-block:: bash -The *-I* argument is the path to the location of the ``library.h`` -header file containing the interface to the LAMMPS C-style library -interface. The *-L* argument is the path to where the ``liblammps_mpi.a`` -file is located. The *-llammps_mpi* argument is shorthand for telling the -compiler to link the file ``liblammps_mpi.a``. If LAMMPS has been -built as a shared library, then the linker will use ``liblammps_mpi.so`` -instead. If both files are available, the linker will usually prefer -the shared library. In case of a shared library, you may need to update -the ``LD_LIBRARY_PATH`` environment variable or running the ``caller`` -executable will fail since it cannot find the shared library at runtime. + mpicc -c -O -I${HOME}/lammps/src caller.c + mpicxx -o caller caller.o -L${HOME}/lammps/src -llammps_mpi + + The *-I* argument is the path to the location of the ``library.h`` + header file containing the interface to the LAMMPS C-style library + interface. The *-L* argument is the path to where the + ``liblammps_mpi.a`` file is located. The *-llammps_mpi* argument + is shorthand for telling the compiler to link the file + ``liblammps_mpi.a``. If LAMMPS has been built as a shared + library, then the linker will use ``liblammps_mpi.so`` instead. + If both files are available, the linker will usually prefer the + shared library. In case of a shared library, you may need to + update the ``LD_LIBRARY_PATH`` environment variable or running the + ``caller`` executable will fail since it cannot find the shared + library at runtime. However, it is only as simple as shown above for the case of a plain LAMMPS library without any optional packages that depend on libraries @@ -84,61 +87,62 @@ LAMMPS library without any optional packages that depend on libraries need to include all flags, libraries, and paths for the coupled executable, that are also required to link the LAMMPS executable. -CMake build -^^^^^^^^^^^ +.. tabs:: -When using CMake, additional libraries with sources in the lib folder -are built, but not included in ``liblammps.a`` and (currently) not -installed with ``make install`` and not included in the ``pkgconfig`` -configuration file. They can be found in the top level build folder, -but you have to determine the necessary link flags manually. It is -therefore recommended to either use the traditional make procedure to -build and link with a static library or build and link with a shared -library instead. + .. tab:: CMake build -Traditional make -^^^^^^^^^^^^^^^^ + When using CMake, additional libraries with sources in the lib + folder are built, but not included in ``liblammps.a`` and + (currently) not installed with ``make install`` and not included + in the ``pkgconfig`` configuration file. They can be found in the + top level build folder, but you have to determine the necessary + link flags manually. It is therefore recommended to either use + the traditional make procedure to build and link with a static + library or build and link with a shared library instead. -After you have compiled a static LAMMPS library using the conventional -build system for example with "make mode=static serial". And you also -have installed the ``POEMS`` package after building its bundled library -in ``lib/poems``. Then the commands to build and link the coupled executable -change to: + .. tab:: Traditional make -.. code-block:: bash + After you have compiled a static LAMMPS library using the + conventional build system for example with "make mode=static + serial". And you also have installed the ``POEMS`` package after + building its bundled library in ``lib/poems``. Then the commands + to build and link the coupled executable change to: - gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c - g++ -o caller caller.o -L${HOME}/lammps/lib/poems \ - -L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src -llammps_serial -lpoems -lmpi_stubs + .. code-block:: bash -Note, that you need to link with ``g++`` instead of ``gcc`` even if you have -written your code in C, since LAMMPS itself is C++ code. You can display the -currently applied settings for building LAMMPS for the "serial" machine target -by using the command: + gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c + g++ -o caller caller.o -L${HOME}/lammps/lib/poems \ + -L${HOME}/lammps/src/STUBS -L${HOME}/lammps/src \ + -llammps_serial -lpoems -lmpi_stubs -.. code-block:: bash + Note, that you need to link with ``g++`` instead of ``gcc`` even + if you have written your code in C, since LAMMPS itself is C++ + code. You can display the currently applied settings for building + LAMMPS for the "serial" machine target by using the command: - make mode=print serial + .. code-block:: bash -Which should output something like: + make mode=print serial -.. code-block:: bash + Which should output something like: - # Compiler: - CXX=g++ - # Linker: - LD=g++ - # Compilation: - CXXFLAGS=-g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I${HOME}/compile/lammps/lib/poems -I${HOME}/compile/lammps/src/STUBS - # Linking: - LDFLAGS=-g -O - # Libraries: - LDLIBS=-L${HOME}/compile/lammps/src -llammps_serial -L${HOME}/compile/lammps/lib/poems -L${HOME}/compile/lammps/src/STUBS -lpoems -lmpi_stubs + .. code-block:: bash -From this you can gather the necessary paths and flags. With -makefiles for other *machine* configurations you need to do the -equivalent and replace "serial" with the corresponding "machine" name -of the makefile. + # Compiler: + CXX=g++ + # Linker: + LD=g++ + # Compilation: + CXXFLAGS=-g -O3 -DLAMMPS_GZIP -DLAMMPS_MEMALIGN=64 -I${HOME}/compile/lammps/lib/poems -I${HOME}/compile/lammps/src/STUBS + # Linking: + LDFLAGS=-g -O + # Libraries: + LDLIBS=-L${HOME}/compile/lammps/src -llammps_serial -L${HOME}/compile/lammps/lib/poems -L${HOME}/compile/lammps/src/STUBS -lpoems -lmpi_stubs + + From this you can gather the necessary paths and flags. With + makefiles for other *machine* configurations you need to do the + equivalent and replace "serial" with the corresponding "machine" + name of the makefile. Link with LAMMPS as a shared library ------------------------------------ @@ -151,35 +155,36 @@ linking the calling executable. Only the *-I* flags are needed. So the example case from above of the serial version static LAMMPS library with the POEMS package installed becomes: -CMake build -^^^^^^^^^^^ +.. tabs:: -The commands with a shared LAMMPS library compiled with the CMake -build process are the same as for the static library. + .. tab:: CMake build -.. code-block:: bash + The commands with a shared LAMMPS library compiled with the CMake + build process are the same as for the static library. - mpicc -c -O $(pkgconf liblammps --cflags) caller.c - mpicxx -o caller caller.o -$(pkgconf --libs) + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + mpicc -c -O $(pkgconf liblammps --cflags) caller.c + mpicxx -o caller caller.o -$(pkgconf --libs) -The commands with a shared LAMMPS library compiled with the -traditional make build using ``make mode=shared serial`` becomes: + .. tab:: Traditional make -.. code-block:: bash + The commands with a shared LAMMPS library compiled with the + traditional make build using ``make mode=shared serial`` becomes: - gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c - g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial + .. code-block:: bash -*Locating liblammps.so at runtime*\ : + gcc -c -O -I${HOME}/lammps/src/STUBS -I${HOME}/lammps/src -caller.c + g++ -o caller caller.o -L${HOME}/lammps/src -llammps_serial -However, now the ``liblammps.so`` file is required at runtime and needs -to be in a folder, where the shared linker program of the operating -system can find it. This would be either a folder like ``/usr/local/lib64`` -or ``${HOME}/.local/lib64`` or a folder pointed to by the ``LD_LIBRARY_PATH`` -environment variable. You can type +Locating liblammps.so at runtime +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Unlike with a static link, now the ``liblammps.so`` file is required at +runtime and needs to be in a folder, where the shared linker program of +the operating system can find it. This would be either a folder like +``/usr/local/lib64`` or ``${HOME}/.local/lib64`` or a folder pointed to +by the ``LD_LIBRARY_PATH`` environment variable. You can type .. code-block:: bash @@ -187,9 +192,10 @@ environment variable. You can type to see what directories are in that list. -Or you can add the LAMMPS src directory (or the directory you performed -a CMake style build in) to your ``LD_LIBRARY_PATH``, so that the current -version of the shared library is always available to programs that use it. +Or you can add the LAMMPS src directory or the directory you performed a +CMake style build in to your ``LD_LIBRARY_PATH`` environment variable, +so that the current version of the shared library is always available to +programs that use it. For the Bourne or Korn shells (/bin/sh, /bin/ksh, /bin/bash etc.), you would add something like this to your ``${HOME}/.profile`` file: diff --git a/doc/src/Build_make.rst b/doc/src/Build_make.rst index af5e319121..cd71fd46e6 100644 --- a/doc/src/Build_make.rst +++ b/doc/src/Build_make.rst @@ -37,7 +37,7 @@ enable (or "install") them first, as discussed on the :doc:`Build package ` doc page. If a packages requires (provided or external) libraries, you must configure and build those libraries **before** building LAMMPS itself and especially **before** enabling -such a package with ``make yes-``. Building :doc:`LAMMPS with +such a package with ``make yes-``. :doc:`Building LAMMPS with CMake ` can automate much of this for many types of machines, especially workstations, desktops, and laptops, so we suggest you try it first when building LAMMPS in those cases. diff --git a/doc/src/Build_package.rst b/doc/src/Build_package.rst index ce29d39ba6..72f7ba74f3 100644 --- a/doc/src/Build_package.rst +++ b/doc/src/Build_package.rst @@ -45,97 +45,99 @@ packages: The mechanism for including packages is simple but different for CMake versus make. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: csh + .. tab:: CMake build - -D PKG_NAME=value # yes or no (default) + .. code-block:: csh -Examples: + -D PKG_NAME=value # yes or no (default) -.. code-block:: csh + Examples: - -D PKG_MANYBODY=yes - -D PKG_USER-INTEL=yes + .. code-block:: csh -All standard and user packages are included the same way. Note that -USER packages have a hyphen between USER and the rest of the package -name, not an underscore. + -D PKG_MANYBODY=yes + -D PKG_USER-INTEL=yes -See the shortcut section below for how to install many packages at -once with CMake. + All standard and user packages are included the same way. Note + that USER packages have a hyphen between USER and the rest of the + package name, not an underscore. + + See the shortcut section below for how to install many packages at + once with CMake. + + .. note:: + + If you switch between building with CMake and make builds, no + packages in the src directory can be installed when you invoke + ``cmake``. CMake will give an error if that is not the case, + indicating how you can un-install all packages in the src dir. + + .. tab:: Traditional make + + .. code-block:: bash + + cd lammps/src + make ps # check which packages are currently installed + make yes-name # install a package with name + make no-name # un-install a package with name + make mpi # build LAMMPS with whatever packages are now installed + + Examples: + + .. code-block:: bash + + make no-rigid + make yes-user-intel + + All standard and user packages are included the same way. + + See the shortcut section below for how to install many packages at + once with make. + + .. note:: + + You must always re-build LAMMPS (via make) after installing or + un-installing a package, for the action to take effect. The + included dependency tracking will make certain only files that + are required to be rebuilt are recompiled. + + .. note:: + + You cannot install or un-install packages and build LAMMPS in a + single make command with multiple targets, e.g. ``make + yes-colloid mpi``. This is because the make procedure creates + a list of source files that will be out-of-date for the build + if the package configuration changes within the same command. + You can include or exclude multiple packages in a single make + command, e.g. ``make yes-colloid no-manybody``. + + +Information for both build systems +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +Almost all packages can be included or excluded in a LAMMPS build, +independent of the other packages. However, some packages include files +derived from files in other packages. LAMMPS checks for this and does +the right thing. Individual files are only included if their +dependencies are already included. Likewise, if a package is excluded, +other files dependent on that package are also excluded. .. note:: - If you toggle back and forth between building with CMake vs - make, no packages in the src directory can be installed when you - invoke cmake. CMake will give an error if that is not the case, - indicating how you can un-install all packages in the src dir. - -Traditional make -^^^^^^^^^^^^^^^^ - -.. code-block:: bash - - cd lammps/src - make ps # check which packages are currently installed - make yes-name # install a package with name - make no-name # un-install a package with name - make mpi # build LAMMPS with whatever packages are now installed - -Examples: - -.. code-block:: bash - - make no-rigid - make yes-user-intel - -All standard and user packages are included the same way. - -See the shortcut section below for how to install many packages at -once with make. - -.. note:: - - You must always re-build LAMMPS (via make) after installing or - un-installing a package, for the action to take effect. - -.. note:: - - You cannot install or un-install packages and build LAMMPS in a - single make command with multiple targets, e.g. make yes-colloid mpi. - This is because the make procedure creates a list of source files that - will be out-of-date for the build if the package configuration changes - within the same command. You can include or exclude multiple packages - in a single make command, e.g. make yes-colloid no-manybody. - -CMake and make info -^^^^^^^^^^^^^^^^^^^ - -Any package can be included or excluded in a LAMMPS build, independent -of all other packages. However, some packages include files derived -from files in other packages. LAMMPS checks for this and does the -right thing. Individual files are only included if their dependencies -are already included. Likewise, if a package is excluded, other files -dependent on that package are also excluded. - -When you download a LAMMPS tarball or download LAMMPS source files -from the git repository, no packages are pre-installed in the -src directory. - -.. note:: - - Prior to Aug 2018, if you downloaded a tarball, 3 packages - (KSPACE, MANYBODY, MOLECULE) were pre-installed in the src directory. - That is no longer the case, so that CMake will build as-is without the - need to un-install those packages. + By default no package is installed. Prior to August 2018, however, + if you downloaded a tarball, 3 packages (KSPACE, MANYBODY, MOLECULE) + were pre-installed via the traditional make procedure in the ``src`` + directory. That is no longer the case, so that CMake will build + as-is without needing to un-install those packages. ---------- .. _cmake_presets: CMake presets for installing many packages +"""""""""""""""""""""""""""""""""""""""""" Instead of specifying all the CMake options via the command-line, CMake allows initializing its settings cache using script files. @@ -168,7 +170,8 @@ one of them as a starting point and customize it to your needs. in a single cmake run, or change settings incrementally by running cmake with new flags. -**Example:** +Example +""""""" .. code-block:: bash diff --git a/doc/src/Build_settings.rst b/doc/src/Build_settings.rst index 859bec9889..9618d7e5a4 100644 --- a/doc/src/Build_settings.rst +++ b/doc/src/Build_settings.rst @@ -6,7 +6,7 @@ explain how to do this for building both with CMake and make. * :ref:`C++11 standard compliance ` when building all of LAMMPS * :ref:`FFT library ` for use with the :doc:`kspace_style pppm ` command -* :ref:`Size of LAMMPS data types ` +* :ref:`Size of LAMMPS integer types ` * :ref:`Read or write compressed files ` * :ref:`Output of JPG and PNG files ` via the :doc:`dump image ` command * :ref:`Output of movie files ` via the :doc:`dump_movie ` command @@ -44,74 +44,71 @@ require use of an FFT library to compute 1d FFTs. The KISS FFT library is included with LAMMPS but other libraries can be faster. LAMMPS can use them if they are available on your system. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found, else KISS - -D FFT_SINGLE=value # yes or no (default), no = double precision - -D FFT_PACK=value # array (default) or pointer or memcpy + .. code-block:: bash -.. note:: + -D FFT=value # FFTW3 or MKL or KISS, default is FFTW3 if found, else KISS + -D FFT_SINGLE=value # yes or no (default), no = double precision + -D FFT_PACK=value # array (default) or pointer or memcpy - The values for the FFT variable must be in upper-case. This is - an exception to the rule that all CMake variables can be specified - with lower-case values. + .. note:: -Usually these settings are all that is needed. If FFTW3 is selected, -then CMake will try to detect, if threaded FFTW libraries are available -and enable them by default. This setting is independent of whether -OpenMP threads are enabled and a packages like KOKKOS or USER-OMP is -used. If CMake cannot detect the FFT library, you can set these variables -to assist: + The values for the FFT variable must be in upper-case. This is + an exception to the rule that all CMake variables can be specified + with lower-case values. -.. code-block:: bash + Usually these settings are all that is needed. If FFTW3 is + selected, then CMake will try to detect, if threaded FFTW + libraries are available and enable them by default. This setting + is independent of whether OpenMP threads are enabled and a + packages like KOKKOS or USER-OMP is used. If CMake cannot detect + the FFT library, you can set these variables to assist: - -D FFTW3_INCLUDE_DIRS=path # path to FFTW3 include files - -D FFTW3_LIBRARIES=path # path to FFTW3 libraries - -D FFT_FFTW_THREADS=on # enable using threaded FFTW3 libraries - -D MKL_INCLUDE_DIRS=path # ditto for Intel MKL library - -D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries - -D MKL_LIBRARIES=path + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D FFTW3_INCLUDE_DIR=path # path to FFTW3 include files + -D FFTW3_LIBRARY=path # path to FFTW3 libraries + -D FFT_FFTW_THREADS=on # enable using threaded FFTW3 libraries + -D MKL_INCLUDE_DIR=path # ditto for Intel MKL library + -D FFT_MKL_THREADS=on # enable using threaded FFTs with MKL libraries + -D MKL_LIBRARY=path # path to MKL libraries -To change the FFT library to be used and its options, you have to edit -your machine Makefile. Below are examples how the makefile variables -could be changed. + .. tab:: Traditional make -.. code-block:: make + To change the FFT library to be used and its options, you have to edit + your machine Makefile. Below are examples how the makefile variables + could be changed. - FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), -DFFT_MKL, or -DFFT_KISS - # default is KISS if not specified - FFT_INC = -DFFT_SINGLE # do not specify for double precision - FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries - FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries - FFT_INC = -DFFT_PACK_ARRAY # or -DFFT_PACK_POINTER or -DFFT_PACK_MEMCPY + .. code-block:: make -# default is FFT_PACK_ARRAY if not specified + FFT_INC = -DFFT_FFTW3 # -DFFT_FFTW3, -DFFT_FFTW (same as -DFFT_FFTW3), -DFFT_MKL, or -DFFT_KISS + # default is KISS if not specified + FFT_INC = -DFFT_SINGLE # do not specify for double precision + FFT_INC = -DFFT_FFTW_THREADS # enable using threaded FFTW3 libraries + FFT_INC = -DFFT_MKL_THREADS # enable using threaded FFTs with MKL libraries + FFT_INC = -DFFT_PACK_ARRAY # or -DFFT_PACK_POINTER or -DFFT_PACK_MEMCPY + # default is FFT_PACK_ARRAY if not specified -.. code-block:: make + .. code-block:: make - FFT_INC = -I/usr/local/include - FFT_PATH = -L/usr/local/lib - FFT_LIB = -lfftw3 # FFTW3 double precision - FFT_LIB = -lfftw3 -lfftw3_omp # FFTW3 double precision with threads (needs -DFFT_FFTW_THREADS) - FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision - FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler, serial interface - FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compiler, serial interface - FFT_LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core # MKL with Intel compiler, threaded interface - FFT_LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core # MKL with GNU compiler, threaded interface - FFT_LIB = -lmkl_rt # MKL with automatic runtime selection of interface libs + FFT_INC = -I/usr/local/include + FFT_PATH = -L/usr/local/lib + FFT_LIB = -lfftw3 # FFTW3 double precision + FFT_LIB = -lfftw3 -lfftw3_omp # FFTW3 double precision with threads (needs -DFFT_FFTW_THREADS) + FFT_LIB = -lfftw3 -lfftw3f # FFTW3 single precision + FFT_LIB = -lmkl_intel_lp64 -lmkl_sequential -lmkl_core # MKL with Intel compiler, serial interface + FFT_LIB = -lmkl_gf_lp64 -lmkl_sequential -lmkl_core # MKL with GNU compiler, serial interface + FFT_LIB = -lmkl_intel_lp64 -lmkl_intel_thread -lmkl_core # MKL with Intel compiler, threaded interface + FFT_LIB = -lmkl_gf_lp64 -lmkl_gnu_thread -lmkl_core # MKL with GNU compiler, threaded interface + FFT_LIB = -lmkl_rt # MKL with automatic runtime selection of interface libs -As with CMake, you do not need to set paths in ``FFT_INC`` or ``FFT_PATH``, if -the compiler can find the FFT header and library files in its default search path. -You must specify ``FFT_LIB`` with the appropriate FFT libraries to include in the link. - -CMake build -^^^^^^^^^^^ + As with CMake, you do not need to set paths in ``FFT_INC`` or + ``FFT_PATH``, if the compiler can find the FFT header and library + files in its default search path. You must specify ``FFT_LIB`` + with the appropriate FFT libraries to include in the link. The `KISS FFT library `_ is included in the LAMMPS distribution. It is portable across all platforms. Depending on the size @@ -123,7 +120,8 @@ per-timestep CPU cost, FFTs are only a portion of long-range Coulombics, and 1d FFTs are only a portion of the FFT cost (parallel communication can be costly). A breakdown of these timings is printed to the screen at the end of a run when using the -:doc:`kspace_style pppm ` command. The :doc:`Run output ` +:doc:`kspace_style pppm ` command. The +:doc:`Screen and logfile output ` doc page gives more details. A more detailed (and time consuming) report of the FFT performance is generated with the :doc:`kspace_modify fftbench yes ` command. @@ -176,76 +174,104 @@ ARRAY mode. .. _size: -Size of LAMMPS integer types ------------------------------------- +Size of LAMMPS integer types and size limits +-------------------------------------------- LAMMPS has a few integer data types which can be defined as either 4-byte (= 32-bit) or 8-byte (= 64-bit) integers at compile time. +This has an impact on the size of a system that can be simulated +or how large counters can become before "rolling over". The default setting of "smallbig" is almost always adequate. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall + With CMake the choice of integer types is made via setting a + variable during configuration. -Traditional build -^^^^^^^^^^^^^^^^^ + .. code-block:: bash -If you want a setting different from the default, you need to edit your -machine Makefile. + -D LAMMPS_SIZES=value # smallbig (default) or bigbig or smallsmall -.. code-block:: make + If the variable is not set explicitly, "smallbig" is used. - LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL + .. tab:: Traditional build -The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified + If you want a setting different from the default, you need to edit the + ``LMP_INC`` variable setting your machine Makefile. -CMake and make info -^^^^^^^^^^^^^^^^^^^ + .. code-block:: make -The default "smallbig" setting allows for simulations with: + LMP_INC = -DLAMMPS_SMALLBIG # or -DLAMMPS_BIGBIG or -DLAMMPS_SMALLSMALL -* total atom count = 2\^63 atoms (about 9e18) -* total timesteps = 2\^63 (about 9e18) -* atom IDs = 2\^31 (about 2 billion) -* image flags = roll over at 512 + The default setting is ``-DLAMMPS_SMALLBIG`` if nothing is specified -The "bigbig" setting increases the latter two limits. It allows for: +LAMMPS system size restrictions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -* total atom count = 2\^63 atoms (about 9e18) -* total timesteps = 2\^63 (about 9e18) -* atom IDs = 2\^63 (about 9e18) -* image flags = roll over at about 1 million (2\^20) +.. list-table:: + :header-rows: 1 + :widths: auto + :align: center -The "smallsmall" setting is only needed if your machine does not -support 8-byte integers. It allows for: + * - + - smallbig + - bigbig + - smallsmall + * - Total atom count + - :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`) + - :math:`2^{63}` atoms (= :math:`9.223 \cdot 10^{18}`) + - :math:`2^{31}` atoms (= :math:`2.147 \cdot 10^9`) + * - Total timesteps + - :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`) + - :math:`2^{63}` steps (= :math:`9.223 \cdot 10^{18}`) + - :math:`2^{31}` steps (= :math:`2.147 \cdot 10^9`) + * - Atom ID values + - :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)` + - :math:`1 \le i \le 2^{63} (= 9.223 \cdot 10^{18})` + - :math:`1 \le i \le 2^{31} (= 2.147 \cdot 10^9)` + * - Image flag values + - :math:`-512 \le i \le 511` + - :math:`- 1\,048\,576 \le i \le 1\,048\,575` + - :math:`-512 \le i \le 511` -* total atom count = 2\^31 atoms (about 2 billion) -* total timesteps = 2\^31 (about 2 billion) -* atom IDs = 2\^31 (about 2 billion) -* image flags = roll over at 512 (2\^9) +The "bigbig" setting increases the size of image flags and atom IDs over +"smallbig" and the "smallsmall" setting is only needed if your machine +does not support 64-bit integers or incurs performance penalties when +using them. + +These are limits for the core of the LAMMPS code, specific features or +some styles may impose additional limits. The :ref:`USER-ATC +` package cannot be compiled with the "bigbig" setting. +Also, there are limitations when using the library interface where some +functions with known issues have been replaced by dummy calls printing a +corresponding error message rather than crashing randomly or corrupting +data. Atom IDs are not required for atomic systems which do not store bond topology information, though IDs are enabled by default. The :doc:`atom_modify id no ` command will turn them off. Atom IDs are required for molecular systems with bond topology (bonds, -angles, dihedrals, etc). Thus if you model a molecular system with -more than 2 billion atoms, you need the "bigbig" setting. +angles, dihedrals, etc). Similarly, some force or compute or fix styles +require atom IDs. Thus if you model a molecular system or use one of +those styles with more than 2 billion atoms, you need the "bigbig" +setting. -Image flags store 3 values per atom which count the number of times an -atom has moved through the periodic box in each dimension. See the -:doc:`dump ` doc page for a discussion. If an atom moves through -the periodic box more than this limit, the value will "roll over", -e.g. from 511 to -512, which can cause diagnostics like the -mean-squared displacement, as calculated by the :doc:`compute msd ` command, to be faulty. +Regardless of the total system size limits, the maximum number of atoms +per MPI rank (local + ghost atoms) is limited to 2 billion for atomic +systems and 500 million for systems with bonds (the additional +restriction is due to using the 2 upper bits of the local atom index +in neighbor lists for storing special bonds info). + +Image flags store 3 values per atom in a single integer which count the +number of times an atom has moved through the periodic box in each +dimension. See the :doc:`dump ` doc page for a discussion. If an +atom moves through the periodic box more than this limit, the value will +"roll over", e.g. from 511 to -512, which can cause diagnostics like the +mean-squared displacement, as calculated by the :doc:`compute msd +` command, to be faulty. -Note that the USER-ATC package and the USER-INTEL package are currently -not compatible with the "bigbig" setting. Also, there are limitations -when using the library interface. Some functions with known issues -have been replaced by dummy calls printing a corresponding error rather -than crashing randomly or corrupting data. Also note that the GPU package requires its lib/gpu library to be compiled with the same size setting, or the link will fail. A CMake @@ -264,54 +290,51 @@ PNG image files. Likewise the :doc:`dump movie ` command outputs movie files in MPEG format. Using these options requires the following settings: -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D WITH_JPEG=value # yes or no - # default = yes if CMake finds JPEG files, else no - -D WITH_PNG=value # yes or no - # default = yes if CMake finds PNG and ZLIB files, else no - -D WITH_FFMPEG=value # yes or no - # default = yes if CMake can find ffmpeg, else no + .. code-block:: bash -Usually these settings are all that is needed. If CMake cannot find -the graphics header, library, executable files, you can set these -variables: + -D WITH_JPEG=value # yes or no + # default = yes if CMake finds JPEG files, else no + -D WITH_PNG=value # yes or no + # default = yes if CMake finds PNG and ZLIB files, else no + -D WITH_FFMPEG=value # yes or no + # default = yes if CMake can find ffmpeg, else no -.. code-block:: bash + Usually these settings are all that is needed. If CMake cannot + find the graphics header, library, executable files, you can set + these variables: - -D JPEG_INCLUDE_DIR=path # path to jpeglib.h header file - -D JPEG_LIBRARIES=path # path to libjpeg.a (.so) file - -D PNG_INCLUDE_DIR=path # path to png.h header file - -D PNG_LIBRARIES=path # path to libpng.a (.so) file - -D ZLIB_INCLUDE_DIR=path # path to zlib.h header file - -D ZLIB_LIBRARIES=path # path to libz.a (.so) file - -D FFMPEG_EXECUTABLE=path # path to ffmpeg executable + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D JPEG_INCLUDE_DIR=path # path to jpeglib.h header file + -D JPEG_LIBRARY=path # path to libjpeg.a (.so) file + -D PNG_INCLUDE_DIR=path # path to png.h header file + -D PNG_LIBRARY=path # path to libpng.a (.so) file + -D ZLIB_INCLUDE_DIR=path # path to zlib.h header file + -D ZLIB_LIBRARY=path # path to libz.a (.so) file + -D FFMPEG_EXECUTABLE=path # path to ffmpeg executable -.. code-block:: make + .. tab:: Traditional make - LMP_INC = -DLAMMPS_JPEG - LMP_INC = -DLAMMPS_PNG - LMP_INC = -DLAMMPS_FFMPEG + .. code-block:: make - JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h header files if make cannot find them - JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them - JPG_LIB = -ljpeg -lpng -lz # library names + LMP_INC = -DLAMMPS_JPEG + LMP_INC = -DLAMMPS_PNG + LMP_INC = -DLAMMPS_FFMPEG -As with CMake, you do not need to set ``JPG_INC`` or ``JPG_PATH``, -if make can find the graphics header and library files. You must -specify ``JPG_LIB`` -with a list of graphics libraries to include in the link. You must -insure ffmpeg is in a directory where LAMMPS can find it at runtime, -that is a directory in your PATH environment variable. + JPG_INC = -I/usr/local/include # path to jpeglib.h, png.h, zlib.h header files if make cannot find them + JPG_PATH = -L/usr/lib # paths to libjpeg.a, libpng.a, libz.a (.so) files if make cannot find them + JPG_LIB = -ljpeg -lpng -lz # library names -CMake and make info -^^^^^^^^^^^^^^^^^^^ + As with CMake, you do not need to set ``JPG_INC`` or ``JPG_PATH``, + if make can find the graphics header and library files. You must + specify ``JPG_LIB`` with a list of graphics libraries to include + in the link. You must insure ffmpeg is in a directory where + LAMMPS can find it at runtime, that is a directory in your PATH + environment variable. Using ``ffmpeg`` to output movie files requires that your machine supports the "popen" function in the standard runtime library. @@ -334,37 +357,34 @@ If this option is enabled, large files can be read or written with gzip compression by several LAMMPS commands, including :doc:`read_data `, :doc:`rerun `, and :doc:`dump `. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D WITH_GZIP=value # yes or no - # default is yes if CMake can find gzip, else no - -D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D WITH_GZIP=value # yes or no + # default is yes if CMake can find gzip, else no + -D GZIP_EXECUTABLE=path # path to gzip executable if CMake cannot find it -.. code-block:: make + .. tab:: Traditional make - LMP_INC = -DLAMMPS_GZIP + .. code-block:: make -CMake and make info -^^^^^^^^^^^^^^^^^^^ + LMP_INC = -DLAMMPS_GZIP -This option requires that your machine supports the "popen()" function -in the standard runtime library and that a gzip executable can be +This option requires that your operating system fully supports the "popen()" +function in the standard runtime library and that a ``gzip`` executable can be found by LAMMPS during a run. .. note:: - On some clusters with high-speed networks, using the fork() - library call (required by popen()) can interfere with the fast - communication library and lead to simulations using compressed output - or input to hang or crash. For selected operations, compressed file - I/O is also available using a compression library instead, which is - what the :ref:`COMPRESS package ` enables. + On some clusters with high-speed networks, using the "fork()" library + call (required by "popen()") can interfere with the fast communication + library and lead to simulations using compressed output or input to + hang or crash. For selected operations, compressed file I/O is also + available using a compression library instead, which is what the + :ref:`COMPRESS package ` enables. ---------- @@ -373,65 +393,66 @@ found by LAMMPS during a run. Memory allocation alignment --------------------------------------- -This setting enables the use of the posix_memalign() call instead of -malloc() when LAMMPS allocates large chunks or memory. This can make -vector instructions on CPUs more efficient, if dynamically allocated -memory is aligned on larger-than-default byte boundaries. -On most current systems, the malloc() implementation returns +This setting enables the use of the "posix_memalign()" call instead of +"malloc()" when LAMMPS allocates large chunks or memory. Vector +instructions on CPUs may become more efficient, if dynamically allocated +memory is aligned on larger-than-default byte boundaries. On most +current operating systems, the "malloc()" implementation returns pointers that are aligned to 16-byte boundaries. Using SSE vector -instructions efficiently, however, requires memory blocks being -aligned on 64-byte boundaries. +instructions efficiently, however, requires memory blocks being aligned +on 64-byte boundaries. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default) + .. code-block:: bash -Use a ``LAMMPS_MEMALIGN`` value of 0 to disable using posix_memalign() -and revert to using the malloc() C-library function instead. When -compiling LAMMPS for Windows systems, malloc() will always be used -and this setting ignored. + -D LAMMPS_MEMALIGN=value # 0, 8, 16, 32, 64 (default) -Traditional make -^^^^^^^^^^^^^^^^ + Use a ``LAMMPS_MEMALIGN`` value of 0 to disable using + "posix_memalign()" and revert to using the "malloc()" C-library + function instead. When compiling LAMMPS for Windows systems, + "malloc()" will always be used and this setting is ignored. -.. code-block:: make + .. tab:: Traditional make - LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64 + .. code-block:: make -Do not set ``-DLAMMPS_MEMALIGN``, if you want to have memory allocated -with the malloc() function call instead. ``-DLAMMPS_MEMALIGN`` **cannot** -be used on Windows, as it does use different function calls for -allocating aligned memory, that are not compatible with how LAMMPS -manages its dynamical memory. + LMP_INC = -DLAMMPS_MEMALIGN=value # 8, 16, 32, 64 + + Do not set ``-DLAMMPS_MEMALIGN``, if you want to have memory + allocated with the "malloc()" function call + instead. ``-DLAMMPS_MEMALIGN`` **cannot** be used on Windows, as + Windows different function calls with different semantics for + allocating aligned memory, that are not compatible with how LAMMPS + manages its dynamical memory. ---------- .. _longlong: Workaround for long long integers ------------------------------------------------- +--------------------------------- If your system or MPI version does not recognize "long long" data types, the following setting will be needed. It converts "long long" to a "long" data type, which should be the desired 8-byte integer on those systems: -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D LAMMPS_LONGLONG_TO_LONG=value # yes or no (default) + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D LAMMPS_LONGLONG_TO_LONG=value # yes or no (default) -.. code-block:: make + .. tab:: Traditional make - LMP_INC = -DLAMMPS_LONGLONG_TO_LONG + .. code-block:: make + + LMP_INC = -DLAMMPS_LONGLONG_TO_LONG ---------- @@ -446,19 +467,19 @@ Instead, the call stack is unwound and control returns to the caller, e.g. to Python. Of course, the calling code has to be set up to *catch* exceptions thrown from within LAMMPS. -CMake build -^^^^^^^^^^^ +.. tabs:: -.. code-block:: bash + .. tab:: CMake build - -D LAMMPS_EXCEPTIONS=value # yes or no (default) + .. code-block:: bash -Traditional make -^^^^^^^^^^^^^^^^ + -D LAMMPS_EXCEPTIONS=value # yes or no (default) -.. code-block:: make + .. tab:: Traditional make - LMP_INC = -DLAMMPS_EXCEPTIONS + .. code-block:: make + + LMP_INC = -DLAMMPS_EXCEPTIONS .. note:: @@ -466,3 +487,41 @@ Traditional make cleanly recover from an exception since not all parallel ranks may throw an exception and thus other MPI ranks may get stuck waiting for messages from the ones with errors. + +---------- + +.. _trap_fpe: + +Trigger selected floating-point exceptions +------------------------------------------ + +Many kinds of CPUs have the capability to detect when a calculation +results in an invalid math operation like a division by zero or calling +the square root with a negative argument. The default behavior on +most operating systems is to continue and have values for ``NaN`` (= not +a number) or ``Inf`` (= infinity). This allows software to detect and +recover from such conditions. This behavior can be changed, however, +often through use of compiler flags. On Linux systems (or more general +on systems using the GNU C library), these so-called floating-point traps +can also be selectively enabled through library calls. LAMMPS supports +that by setting the ``-DLAMMPS_TRAP_FPE`` pre-processor define. As it is +done in the ``main()`` function, this applies only to the standalone +executable, not the library. + +.. tabs:: + + .. tab:: CMake build + + .. code-block:: bash + + -D CMAKE_TUNE_FLAGS=-DLAMMPS_TRAP_FPE + + .. tab:: Traditional make + + .. code-block:: make + + LMP_INC = -DLAMMPS_TRAP_FPE + +After compilation with this flag set, the LAMMPS executable will stop +and produce a core dump when a division by zero, overflow, illegal math +function argument or other invalid floating point operation is encountered. diff --git a/doc/src/Build_windows.rst b/doc/src/Build_windows.rst index 4aacea9dfa..2df3fdd24e 100644 --- a/doc/src/Build_windows.rst +++ b/doc/src/Build_windows.rst @@ -38,7 +38,7 @@ optional Windows feature allows you to run the bash shell from Ubuntu from within Windows and from there on, you can pretty much use that shell like you are running on an Ubuntu Linux machine (e.g. installing software via apt-get and more). For more details on that, please -see :doc:`this tutorial ` +see :doc:`this tutorial `. .. _gnu: diff --git a/doc/src/Classes.rst b/doc/src/Classes.rst new file mode 100644 index 0000000000..4b50eef7b2 --- /dev/null +++ b/doc/src/Classes.rst @@ -0,0 +1,38 @@ +LAMMPS C++ base classes +======================= + +LAMMPS is designed to be used as a C++ class library where one can set +up and drive a simulation through creating a class instance and then +calling some abstract operations or commands on that class or its member +class instances. These are interfaced to the :doc:`C library API +`, which providing an additional level of abstraction +simplification for common operations. The C API is also the basis for +calling LAMMPS from Python or Fortran. + +When used from a C++ program, most of the symbols and functions in +LAMMPS are wrapped into the ``LAMMPS_NS`` namespace so they will not +collide with your own classes or other libraries. This, however, does +not extend to the additional libraries bundled with LAMMPS in the lib +folder and some of the low-level code of some packages. + +Behind the scenes this is implemented through inheritance and +polymorphism where base classes define the abstract interface and +derived classes provide the specialized implementation for specific +models or optimizations or ports to accelerator platforms. This +document will provide an outline of the fundamental class hierarchy and +some selected examples for derived classes of specific models. + +.. note:: + + Please see the :ref:`note about thread-safety ` + in the library Howto doc page. + +----------------------------------- + +.. toctree:: + :caption: Individual Base Classes + :name: lammpsbase + + Classes_lammps + Classes_atom + Classes_input diff --git a/doc/src/Classes_atom.rst b/doc/src/Classes_atom.rst new file mode 100644 index 0000000000..f9cbf63322 --- /dev/null +++ b/doc/src/Classes_atom.rst @@ -0,0 +1,9 @@ +LAMMPS Atom and AtomVec Base Classes +************************************ + +.. doxygenclass:: LAMMPS_NS::Atom + :project: progguide + :members: + + + diff --git a/doc/src/Classes_input.rst b/doc/src/Classes_input.rst new file mode 100644 index 0000000000..72fdd93578 --- /dev/null +++ b/doc/src/Classes_input.rst @@ -0,0 +1,7 @@ +LAMMPS Input Base Class +************************ + +.. doxygenclass:: LAMMPS_NS::Input + :project: progguide + :members: + diff --git a/doc/src/Classes_lammps.rst b/doc/src/Classes_lammps.rst new file mode 100644 index 0000000000..dd6798d9a1 --- /dev/null +++ b/doc/src/Classes_lammps.rst @@ -0,0 +1,33 @@ +LAMMPS Class +************ + +The LAMMPS class is encapsulating an MD simulation state and thus it is +the class that needs to be created when starting a new simulation system +state. The LAMMPS executable essentially creates one instance of this +class and passes the command line flags and tells it to process the +provided input (a file or ``stdin``). It shuts the class down when +control is returned to it and then exits. When using LAMMPS as a +library from another code it is required to create an instance of this +class, either directly from C++ with ``new LAMMPS()`` or through one +of the library interface functions like :cpp:func:`lammps_open` of the +C-library interface, or the :py:class:`lammps.lammps` class constructor +of the Python module, or the :f:func:`lammps` constructor of the Fortran +module. + +In order to avoid clashes of function names, all of the core code in +LAMMPS is placed into the ``LAMMPS_NS`` namespace. Functions or variables +outside of that namespace must be "static", i.e. visible only to the +scope of the file/object they are defined in. Code in packages or the +libraries in the ``lib`` folder may not adhere to this as some of them +are adapted from legacy code or consist of external libraries with their +own requirements and policies. + +-------------------- + +.. doxygenclass:: LAMMPS_NS::LAMMPS + :project: progguide + :members: + +.. doxygenclass:: LAMMPS_NS::Pointers + :project: progguide + diff --git a/doc/src/Commands_fix.rst b/doc/src/Commands_fix.rst index 863d09e4ac..9a3c5df9cd 100644 --- a/doc/src/Commands_fix.rst +++ b/doc/src/Commands_fix.rst @@ -98,6 +98,7 @@ OPT. * :doc:`manifoldforce ` * :doc:`meso/move ` * :doc:`momentum (k) ` + * :doc:`momentum/chunk ` * :doc:`move ` * :doc:`mscg ` * :doc:`msst ` @@ -149,6 +150,7 @@ OPT. * :doc:`orient/bcc ` * :doc:`orient/fcc ` * :doc:`orient/eco ` + * :doc:`pafi ` * :doc:`phonon ` * :doc:`pimd ` * :doc:`planeforce ` diff --git a/doc/src/Commands_removed.rst b/doc/src/Commands_removed.rst index e137e39a08..1f6da57945 100644 --- a/doc/src/Commands_removed.rst +++ b/doc/src/Commands_removed.rst @@ -17,6 +17,11 @@ ways through the :doc:`compute chunk/atom ` command and then averaging is done using :doc:`fix ave/chunk `. Please refer to the :doc:`chunk HOWTO ` section for an overview. +Reset_ids command +----------------- + +The reset_ids command has been renamed to :doc:`reset_atom_ids `. + MEAM package ------------ @@ -27,7 +32,7 @@ which removes several restrictions (e.g. there can be multiple instances in hybrid pair styles) and allows for some optimizations leading to better performance. The new pair style :doc:`meam/c ` has the exact same syntax as the old "meam" pair style and thus pair style -:doc:`meam ` is an alias to the new style and backward +meam is an alias to the new style and backward compatibility of old inputs is preserved. REAX package diff --git a/doc/src/Cplusplus.rst b/doc/src/Cplusplus.rst new file mode 100644 index 0000000000..e51f7fc7d2 --- /dev/null +++ b/doc/src/Cplusplus.rst @@ -0,0 +1,90 @@ +Using the C++ API directly +************************** + +Using the C++ classes of the LAMMPS library is lacking some of the +convenience of the C library API, but it allows a more direct access to +simulation data and thus more low-level manipulations and tighter +integration of LAMMPS into another code. While for the complete C +library API is provided in the ``library.h`` header file, for using +the C++ API it is required to include the individual header files +defining the individual classes in use. Typically the name of the +class and the name of the header follow some simple rule. Examples +are given below. + + +Creating or deleting a LAMMPS object +************************************* + +When using the LAMMPS library interfaces, the core task is to create an +instance of the :cpp:class:`LAMMPS_NS::LAMMPS` class. In C++ this can +be done directly through the ``new`` operator. All further operations +are then initiated through calling member functions of some of the +components of the LAMMPS class or accessing their data members. The +destruction of the LAMMPS instance is correspondingly initiated by using +the ``delete`` operator. Here is a simple example: + +.. code-block:: c++ + + #include "lammps.h" + + #include + #include + + int main(int argc, char **argv) + { + LAMMPS_NS::LAMMPS *lmp; + // custom argument vector for LAMMPS library + const char *lmpargv[] {"liblammps", "-log", "none"}; + int lmpargc = sizeof(lmpargv)/sizeof(const char *); + + // explicitly initialize MPI + MPI_Init(&argc, &argv); + + // create LAMMPS instance + lmp = new LAMMPS_NS::LAMMPS(lmpargc, (char **)lmpargv, MPI_COMM_WORLD); + // output numerical version string + std::cout << "LAMMPS version ID: " << lmp->num_ver << std::endl; + // delete LAMMPS instance + delete lmp; + + // stop MPI environment + MPI_Finalize(); + return 0; + } + +This minimal example only requires to include the ``lammps.h`` header +file since it only accesses a non-pointer member of the LAMMPS class. + + +Executing LAMMPS commands +************************* + +Once a LAMMPS instance is created by your C++ code, you need to set up a +simulation and that is most conveniently done by "driving" it through +issuing commands like you would do when running a LAMMPS simulation from +an input script. Processing of input in LAMMPS is handled by the +:cpp:class:`Input ` class an instance of which is a +member of the :cpp:class:`LAMMPS ` class. You have +two options: reading commands from a file, or executing a single +command from a string. See below for a small example: + +.. code-block:: c++ + + #include "lammps.h" + #include "input.h" + #include + + using namespace LAMMPS_NS; + + int main(int argc, char **argv) + { + const char *lmpargv[] {"liblammps", "-log", "none"}; + int lmpargc = sizeof(lmpargv)/sizeof(const char *); + + MPI_Init(&argc, &argv); + LAMMPS *lmp = new LAMMPS(lmpargc, (char **)lmpargv, MPI_COMM_WORLD); + lmp->input->file("in.melt"); + lmp->input->one("run 100 post no"); + delete lmp; + return 0; + } diff --git a/doc/src/Developer.rst b/doc/src/Developer.rst new file mode 100644 index 0000000000..cd031ad465 --- /dev/null +++ b/doc/src/Developer.rst @@ -0,0 +1,17 @@ +LAMMPS Developer Guide +********************** + +This section describes the internal structure and basic algorithms +of the LAMMPS code. This is a work in progress and additional +information will be added incrementally depending on availability +of time and requests from the LAMMPS user community. + + +.. toctree:: + :maxdepth: 1 + + Developer_org + Developer_flow + Developer_write + Developer_utils + Classes diff --git a/doc/src/Developer/.gitignore b/doc/src/Developer/.gitignore deleted file mode 100644 index 38f7323f7b..0000000000 --- a/doc/src/Developer/.gitignore +++ /dev/null @@ -1,3 +0,0 @@ -/developer.aux -/developer.log -/developer.toc diff --git a/doc/src/Developer/classes.fig b/doc/src/Developer/classes.fig deleted file mode 100644 index a2d9b6d6f1..0000000000 --- a/doc/src/Developer/classes.fig +++ /dev/null @@ -1,198 +0,0 @@ -#FIG 3.2 Produced by xfig version 3.2.5a -Portrait -Center -Inches -Letter -100.00 -Single --2 -1200 2 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2232 1170 3540 1170 3540 1505 2232 1505 2232 1170 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2220 1830 3015 1830 3015 2219 2220 2219 2220 1830 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2226 3285 3300 3285 3300 3665 2226 3665 2226 3285 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2223 5190 3225 5190 3225 5525 2223 5525 2223 5190 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2232 7125 3090 7125 3090 7478 2232 7478 2232 7125 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2226 10230 3300 10230 3300 10565 2226 10565 2226 10230 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4026 10305 4980 10305 4980 10592 4026 10592 4026 10305 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4029 9900 5205 9900 5205 10250 4029 10250 4029 9900 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4038 9315 5370 9315 5370 9659 4038 9659 4038 9315 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4023 8955 4530 8955 4530 9278 4023 9278 4023 8955 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4029 8475 5190 8475 5190 8762 4029 8762 4029 8475 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4008 8115 5430 8115 5430 8408 4008 8408 4008 8115 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4026 7425 4995 7425 4995 7712 4026 7712 4026 7425 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4035 6720 4650 6720 4650 7025 4035 7025 4035 6720 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4044 7080 4830 7080 4830 7358 4044 7358 4044 7080 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4032 6105 5205 6105 5205 6419 4032 6419 4032 6105 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4026 5715 5115 5715 5115 6062 4026 6062 4026 5715 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4023 3585 4605 3585 4605 3872 4023 3872 4023 3585 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3954 1680 5175 1680 5175 1997 3954 1997 3954 1680 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 1620 5235 2100 615 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 1605 5445 2070 10695 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3120 1935 3855 1800 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3150 2115 3765 2250 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3135 7230 3945 6840 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3150 7335 3945 8610 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5265 8610 6195 8400 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5280 8655 6180 8820 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3345 10290 3930 10020 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3360 10395 3930 10425 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3360 10455 3930 10755 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2193 360 3435 360 3435 647 2193 647 2193 360 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3398 3472 3923 3307 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3413 3601 3923 3721 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3285 2806 3870 2802 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3315 5372 3900 5368 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6354 2280 7470 2280 7470 2585 6354 2585 6354 2280 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6348 1875 7320 1875 7320 2222 6348 2222 6348 1875 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3954 2070 5505 2070 5505 2372 3954 2372 3954 2070 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5634 2137 6230 2045 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 5670 2310 6265 2418 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 3900 2640 5400 2640 5400 2975 3900 2975 3900 2640 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4038 3165 5385 3165 5385 3497 4038 3497 4038 3165 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4245 4110 5730 4110 5730 4499 4245 4499 4245 4110 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4233 4545 6390 4545 6390 4862 4233 4862 4233 4545 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4026 5190 5385 5190 5385 5525 4026 5525 4026 5190 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4038 7755 5310 7755 5310 8075 4038 8075 4038 7755 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6270 8250 7365 8250 7365 8610 6270 8610 6270 8250 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 6273 8655 7380 8655 7380 8978 6273 8978 6273 8655 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 4041 10620 5985 10620 5985 10943 4041 10943 4041 10620 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2217 10830 3135 10830 3135 11156 2217 11156 2217 10830 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2229 9780 3240 9780 3240 10118 2229 10118 2229 9780 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2214 9015 3285 9015 3285 9362 2214 9362 2214 9015 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2208 5850 3420 5850 3420 6209 2208 6209 2208 5850 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2217 4275 3615 4275 3615 4634 2217 4634 2217 4275 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2235 2655 3150 2655 3150 3000 2235 3000 2235 2655 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 60 5115 1500 5115 1500 5610 60 5610 60 5115 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3486 6018 4011 5853 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3486 6129 3996 6249 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3361 9291 3991 9531 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3345 9129 4005 9099 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3691 4412 4216 4277 -2 1 0 2 0 7 50 -1 -1 0.000 0 0 -1 1 0 2 - 1 1 2.00 120.00 240.00 - 3695 4561 4175 4711 -2 2 0 1 0 7 50 -1 -1 0.000 0 0 -1 0 0 5 - 2220 735 3129 735 3129 1043 2220 1043 2220 735 -4 0 1 50 -1 18 18 0.0000 4 225 1275 2265 1455 Universe\001 -4 0 1 50 -1 18 18 0.0000 4 285 735 2265 2175 Input\001 -4 0 1 50 -1 18 18 0.0000 4 225 780 2265 2925 Atom\001 -4 0 1 50 -1 18 18 0.0000 4 285 1020 2265 3600 Update\001 -4 0 1 50 -1 18 18 0.0000 4 285 1320 2265 4575 Neighbor\001 -4 0 1 50 -1 18 18 0.0000 4 225 945 2265 5475 Comm\001 -4 0 1 50 -1 18 18 0.0000 4 225 1110 2265 6150 Domain\001 -4 0 1 50 -1 18 18 0.0000 4 225 810 2265 7425 Force\001 -4 0 1 50 -1 18 18 0.0000 4 285 975 2265 9300 Modify\001 -4 0 1 50 -1 18 18 0.0000 4 285 900 2265 10050 Group\001 -4 0 1 50 -1 18 18 0.0000 4 285 990 2265 10500 Output\001 -4 0 1 50 -1 18 18 0.0000 4 225 825 2265 11100 Timer\001 -4 0 0 50 -1 18 18 0.0000 4 225 1170 3990 1950 Variable\001 -4 0 4 50 -1 18 18 0.0000 4 225 1470 3990 2325 Command\001 -4 0 4 50 -1 18 18 0.0000 4 285 1275 4065 3450 Integrate\001 -4 0 4 50 -1 18 18 0.0000 4 225 525 4065 3825 Min\001 -4 0 0 50 -1 18 18 0.0000 4 285 1230 4065 5475 Irregular\001 -4 0 4 50 -1 18 18 0.0000 4 285 1020 4065 6000 Region\001 -4 0 0 50 -1 18 18 0.0000 4 225 975 4065 6375 Lattice\001 -4 0 4 50 -1 18 18 0.0000 4 225 435 4065 9225 Fix\001 -4 0 4 50 -1 18 18 0.0000 4 285 1305 4065 9600 Compute\001 -4 0 4 50 -1 18 18 0.0000 4 225 570 4065 6975 Pair\001 -4 0 4 50 -1 18 18 0.0000 4 285 840 4065 7665 Angle\001 -4 0 4 50 -1 18 18 0.0000 4 225 1215 4065 8010 Dihedral\001 -4 0 4 50 -1 18 18 0.0000 4 285 1305 4065 8355 Improper\001 -4 0 4 50 -1 18 18 0.0000 4 285 1095 4065 8700 KSpace\001 -4 0 4 50 -1 18 18 0.0000 4 285 855 4065 10545 Dump\001 -4 0 0 50 -1 18 18 0.0000 4 225 1815 4065 10890 WriteRestart\001 -4 0 0 50 -1 18 18 0.0000 4 225 930 6315 8550 FFT3D\001 -4 0 0 50 -1 18 18 0.0000 4 285 1005 6315 8925 Remap\001 -4 0 0 50 -1 18 18 0.0000 4 225 885 6390 2175 Finish\001 -4 0 0 50 -1 18 18 0.0000 4 285 1050 6390 2550 Special\001 -4 0 4 50 -1 18 18 0.0000 4 225 1305 3990 2925 AtomVec\001 -4 0 4 50 -1 18 18 0.0000 4 225 765 4065 7320 Bond\001 -4 0 0 50 -1 18 18 0.0000 4 225 1095 4065 10200 Thermo\001 -4 0 0 50 -1 18 18 0.0000 4 285 1380 4305 4425 NeighList\001 -4 0 0 50 -1 18 18 0.0000 4 285 2025 4305 4800 NeighRequest\001 -4 0 1 50 -1 18 18 0.0000 4 285 1155 2250 600 Memory\001 -4 0 0 50 -1 18 18 0.0000 4 225 1305 120 5475 LAMMPS\001 -4 0 1 50 -1 18 18 0.0000 4 225 735 2265 1005 Error\001 diff --git a/doc/src/Developer/classes.pdf b/doc/src/Developer/classes.pdf deleted file mode 100644 index 566089ac9e..0000000000 Binary files a/doc/src/Developer/classes.pdf and /dev/null differ diff --git a/doc/src/Developer/developer.tex b/doc/src/Developer/developer.tex deleted file mode 100644 index c7f619c84f..0000000000 --- a/doc/src/Developer/developer.tex +++ /dev/null @@ -1,699 +0,0 @@ -\documentclass{article} -\usepackage{graphicx} - -\begin{document} - -\centerline{\Large \bf LAMMPS Developer Guide} -\centerline{\bf 23 Aug 2011} - -\vspace{0.5in} - -This document is a developer guide to the LAMMPS molecular dynamics -package, whose WWW site is at lammps.sandia.gov. It describes the -internal structure and algorithms of the code. Sections will be added -as we have time, and in response to requests from developers and -users. - -\tableofcontents - -\pagebreak -\section{LAMMPS source files} - -LAMMPS source files are in two directories of the distribution -tarball. The src directory has the majority of them, all of which are -C++ files (*.cpp and *.h). Many of these files are in the src -directory itself. There are also dozens of ``packages'', which can be -included or excluded when LAMMPS is built. See the -doc/Section\_build.html section of the manual for more information -about packages, or type ``make'' from within the src directory, which -lists package-related commands, such as ``make package-status''. The -source files for each package are in an all-uppercase sub-directory of -src, like src/MOLECULE or src/USER-CUDA. If the package is currently -installed, copies of the package source files will also exist in the -src directory itself. The src/STUBS sub-directory is not a package -but contains a dummy version of the MPI library, used when building a -serial version of the code. - -The lib directory also contains source code for external libraries, -used by a few of the packages. Each sub-directory, like meam or gpu, -contains the source files, some of which are in different languages -such as Fortran. The files are compiled into libraries from within -each sub-directory, e.g. performing a ``make'' in the lib/meam directory -creates a libmeam.a file. These libraries are linked to during a -LAMMPS build, if the corresponding package is installed. - -LAMMPS C++ source files almost always come in pairs, such as run.cpp -and run.h. The pair of files defines a C++ class, the Run class in -this case, which contains the code invoked by the ``run'' command in a -LAMMPS input script. As this example illustrates, source file and -class names often have a one-to-one correspondence with a command used -in a LAMMPS input script. Some source files and classes do not have a -corresponding input script command, e.g. ``force.cpp'' and the Force -class. They are discussed in the next section. - -\pagebreak -\section{Class hierarchy of LAMMPS} - -Though LAMMPS has a lot of source files and classes, its class -hierarchy is quite simple, as outlined in Fig \ref{fig:classes}. Each -boxed name refers to a class and has a pair of associated source files -in lammps/src, e.g. ``memory.cpp'' and ``memory.h''. More details on the -class and its methods and data structures can be found by examining -its *.h file. - -LAMMPS (lammps.cpp/h) is the top-level class for the entire code. It -holds an ``instance'' of LAMMPS and can be instantiated one or more -times by a calling code. For example, the file src/main.cpp simply -instantiates one instance of LAMMPS and passes it the input script. - -The file src/library.cpp contains a C-style library interface to the -LAMMPS class. See the lammps/couple and lammps/python directories for -examples of simple programs that use LAMMPS through its library -interface. A driver program can instantiate the LAMMPS class multiple -times, e.g. to embed several atomistic simulation regions within a -mesoscale or continuum simulation domain. - -There are a dozen or so top-level classes within the LAMMPS class that -are visible everywhere in the code. They are shaded blue in Fig -\ref{fig:classes}. Thus any class can refer to the y-coordinate of -local atom $I$ as atom$\rightarrow$x[i][1]. This visibility is -enabled by a bit of cleverness in the Pointers class (see -src/pointers.h) which every class inherits from. - -There are a handful of virtual parent classes in LAMMPS that define -what LAMMPS calls ``styles''. They are shaded red in Fig -\ref{fig:classes}. Each of these are parents of a number of child -classes that implement the interface defined by the parent class. For -example, the fix style has around 100 child classes. They are the -possible fixes that can be specified by the fix command in an input -script, e.g. fix nve, fix shake, fix ave/time, etc. The corresponding -classes are Fix (for the parent class), FixNVE, FixShake, FixAveTime, -etc. The source files for these classes are easy to identify in the -src directory, since they begin with the word ``fix'', e,g, -fix\_nve.cpp, fix\_shake,cpp, fix\_ave\_time.cpp, etc. - -The one exception is child class files for the ``command'' style. These -implement specific commands in the input script that can be invoked -before/after/between runs or which launch a simulation. Examples are -the create\_box, minimize, run, and velocity commands which encode the -CreateBox, Minimize, Run, and Velocity classes. The corresponding -files are create\_box,cpp, minimize.cpp, run.cpp, and velocity.cpp. -The list of command style files can be found by typing ``grep -COMMAND\_CLASS *.h'' from within the src directory, since that word in -the header file identifies the class as an input script command. -Similar words can be grepped to list files for the other LAMMPS -styles. E.g. ATOM\_CLASS, PAIR\_CLASS, BOND\_CLASS, REGION\_CLASS, -FIX\_CLASS, COMPUTE\_CLASS, DUMP\_CLASS, etc. - -\begin{figure}[htb] - \begin{center} - \includegraphics[height=4in]{classes.pdf} - \end{center} - \caption{Class hierarchy within LAMMPS source code.} -\label{fig:classes} -\end{figure} - -More details on individual classes in Fig \ref{fig:classes} are as -follows: - -\begin{itemize} - -\item The Memory class handles allocation of all large vectors and - arrays. - -\item The Error class prints all error and warning messages. - -\item The Universe class sets up partitions of processors so that - multiple simulations can be run, each on a subset of the processors - allocated for a run, e.g. by the mpirun command. - -\item The Input class reads an input script, stores variables, and - invokes stand-alone commands that are child classes of the Command - class. - -\item As discussed above, the Command class is a parent class for - certain input script commands that perform a one-time operation - before/after/between simulations or which invoke a simulation. They - are instantiated from within the Input class, invoked, then - immediately destructed. - -\item The Finish class is instantiated to print statistics to the - screen after a simulation is performed, by commands like run and - minimize. - -\item The Special class walks the bond topology of a molecular system - to find first, second, third neighbors of each atom. It is invoked by - several commands, like read\_data, read\_restart, and replicate. - -\item The Atom class stores all per-atom arrays. More precisely, they - are allocated and stored by the AtomVec class, and the Atom class - simply stores a pointer to them. The AtomVec class is a parent - class for atom styles, defined by the atom\_style command. - -\item The Update class holds an integrator and a minimizer. The - Integrate class is a parent style for the Verlet and rRESPA time - integrators, as defined by the run\_style input command. The Min - class is a parent style for various energy minimizers. - -\item The Neighbor class builds and stores neighbor lists. The - NeighList class stores a single list (for all atoms). The - NeighRequest class is called by pair, fix, or compute styles when - they need a particular kind of neighbor list. - -\item The Comm class performs interprocessor communication, typically - of ghost atom information. This usually involves MPI message - exchanges with 6 neighboring processors in the 3d logical grid of - processors mapped to the simulation box. Sometimes the Irregular - class is used, when atoms may migrate to arbitrary processors. - -\item The Domain class stores the simulation box geometry, as well as - geometric Regions and any user definition of a Lattice. The latter - are defined by region and lattice commands in an input script. - -\item The Force class computes various forces between atoms. The Pair - parent class is for non-bonded or pair-wise forces, which in LAMMPS - lingo includes many-body forces such as the Tersoff 3-body - potential. The Bond, Angle, Dihedral, Improper parent classes are - styles for bonded interactions within a static molecular topology. - The KSpace parent class is for computing long-range Coulombic - interactions. One of its child classes, PPPM, uses the FFT3D and - Remap classes to communicate grid-based information with neighboring - processors. - -\item The Modify class stores lists of Fix and Compute classes, both - of which are parent styles. - -\item The Group class manipulates groups that atoms are assigned to - via the group command. It also computes various attributes of - groups of atoms. - -\item The Output class is used to generate 3 kinds of output from a - LAMMPS simulation: thermodynamic information printed to the screen - and log file, dump file snapshots, and restart files. These - correspond to the Thermo, Dump, and WriteRestart classes - respectively. The Dump class is a parent style. - -\item The Timer class logs MPI timing information, output at the end - of a run. - -\end{itemize} - -%%\pagebreak -%%\section{Spatial decomposition and parallel operations} -%%distributed memory -%%Ref to JCP paper -%%diagram of 3d grid of procs and spatial decomp -%%6-way comm -%%ghost atoms, PBC added when comm (in atom class) - -%%\pagebreak -%%\section{Fixes, computes, variables} -%%fixes intercolate in timestep, store per-atom info -%%computes based on current snapshot -%%equal- and atom-style variables -%%output they produce - see write-up in HowTo - -\pagebreak -\section{How a timestep works} - -The first and most fundamental operation within LAMMPS to understand -is how a timestep is structured. Timestepping is performed by the -Integrate class within the Update class. Since Integrate is a parent -class, corresponding to the run\_style input script command, it has -child classes. In this section, the timestep implemented by the -Verlet child class is described. A similar timestep is implemented by -the Respa child class, for the rRESPA hierarchical timestepping -method. The Min parent class performs energy minimization, so does -not perform a literal timestep. But it has logic similar to what is -described here, to compute forces and invoke fixes at each iteration -of a minimization. Differences between time integration and -minimization are highlighted at the end of this section. - -The Verlet class is encoded in the src/verlet.cpp and verlet.h files. -It implements the velocity-Verlet timestepping algorithm. The -workhorse method is Verlet::run(), but first we highlight several -other methods in the class. - -\begin{itemize} - -\item The init() method is called at the beginning of each dynamics - run. It simply sets some internal flags, based on user settings in - other parts of the code. - -\item The setup() or setup\_minimal() methods are also called before - each run. The velocity-Verlet method requires current forces be - calculated before the first timestep, so these routines compute - forces due to all atomic interactions, using the same logic that - appears in the timestepping described next. A few fixes are also - invoked, using the mechanism described in the next section. Various - counters are also initialized before the run begins. The - setup\_minimal() method is a variant that has a flag for performing - less setup. This is used when runs are continued and information - from the previous run is still valid. For example, if repeated - short LAMMPS runs are being invoked, interleaved by other commands, - via the ``pre no'' and ``every'' options of the run command, the - setup\_minimal() method is used. - -\item The force\_clear() method initializes force and other arrays to - zero before each timestep, so that forces (torques, etc) can be - accumulated. - -\end{itemize} - -Now for the Verlet::run() method. Its structure in hi-level pseudo -code is shown in Fig \ref{fig:verlet}. In the actual code in -src/verlet.cpp some of these operations are conditionally invoked. - -\begin{figure}[htb] - \begin{center} - \begin{verbatim} -loop over N timesteps: - ev_set() - - fix->initial_integrate() - fix->post_integrate() - - nflag = neighbor->decide() - if nflag: - fix->pre_exchange() - domain->pbc() - domain->reset_box() - comm->setup() - neighbor->setup_bins() - comm->exchange() - comm->borders() - fix->pre_neighbor() - neighbor->build() - else - comm->forward_comm() - - force_clear() - fix->pre_force() - - pair->compute() - bond->compute() - angle->compute() - dihedral->compute() - improper->compute() - kspace->compute() - - comm->reverse_comm() - - fix->post_force() - fix->final_integrate() - fix->end_of_step() - - if any output on this step: output->write() - \end{verbatim} - \end{center} - \caption{Pseudo-code for the Verlet::run() method.} -\label{fig:verlet} -\end{figure} - -The ev\_set() method (in the parent Integrate class), sets two flags -({\em eflag} and {\em vflag}) for energy and virial computation. Each -flag encodes whether global and/or per-atom energy and virial should -be calculated on this timestep, because some fix or variable or output -will need it. These flags are passed to the various methods that -compute particle interactions, so that they can skip the extra -calculations if the energy and virial are not needed. See the -comments with the Integrate::ev\_set() method which document the flag -values. - -At various points of the timestep, fixes are invoked, -e.g. fix$\rightarrow$initial\_integrate(). In the code, this is -actually done via the Modify class which stores all the Fix objects -and lists of which should be invoked at what point in the timestep. -Fixes are the LAMMPS mechanism for tailoring the operations of a -timestep for a particular simulation. As described elsewhere -(unwritten section), each fix has one or more methods, each of which -is invoked at a specific stage of the timestep, as in Fig -\ref{fig:verlet}. All the fixes defined in an input script with an -initial\_integrate() method are invoked at the beginning of each -timestep. Fix nve, nvt, npt are examples, since they perform the -start-of-timestep velocity-Verlet integration to update velocities by -a half-step, and coordinates by a full step. The post\_integrate() -method is next. Only a few fixes use this, e.g. to reflect particles -off box boundaries in the FixWallReflect class. - -The decide() method in the Neighbor class determines whether neighbor -lists need to be rebuilt on the current timestep. If not, coordinates -of ghost atoms are acquired by each processor via the forward\_comm() -method of the Comm class. If neighbor lists need to be built, several -operations within the inner if clause of Fig \ref{fig:verlet} are -first invoked. The pre\_exchange() method of any defined fixes is -invoked first. Typically this inserts or deletes particles from the -system. - -Periodic boundary conditions are then applied by the Domain class via -its pbc() method to remap particles that have moved outside the -simulation box back into the box. Note that this is not done every -timestep. but only when neighbor lists are rebuilt. This is so that -each processor's sub-domain will have consistent (nearby) atom -coordinates for its owned and ghost atoms. It is also why dumped atom -coordinates can be slightly outside the simulation box. - -The box boundaries are then reset (if needed) via the reset\_box() -method of the Domain class, e.g. if box boundaries are shrink-wrapped -to current particle coordinates. A change in the box size or shape -requires internal information for communicating ghost atoms (Comm -class) and neighbor list bins (Neighbor class) be updated. The -setup() method of the Comm class and setup\_bins() method of the -Neighbor class perform the update. - -The code is now ready to migrate atoms that have left a processor's -geometric sub-domain to new processors. The exchange() method of the -Comm class performs this operation. The borders() method of the Comm -class then identifies ghost atoms surrounding each processor's -sub-domain and communicates ghost atom information to neighboring -processors. It does this by looping over all the atoms owned by a -processor to make lists of those to send to each neighbor processor. -On subsequent timesteps, the lists are used by the -Comm::forward\_comm() method. - -Fixes with a pre\_neighbor() method are then called. These typically -re-build some data structure stored by the fix that depends on the -current atoms owned by each processor. - -Now that each processor has a current list of its owned and ghost -atoms, LAMMPS is ready to rebuild neighbor lists via the build() -method of the Neighbor class. This is typically done by binning all -owned and ghost atoms, and scanning a stencil of bins around each -owned atom's bin to make a Verlet list of neighboring atoms within the -force cutoff plus neighbor skin distance. - -In the next portion of the timestep, all interaction forces between -particles are computed, after zeroing the per-atom force vector via -the force\_clear() method. If the newton flag is set to ``on'' by the -newton command, forces on both owned and ghost atoms are calculated. - -Pairwise forces are calculated first, which enables the global virial -(if requested) to be calculated cheaply (at the end of the -Pair::compute() method), by a dot product of atom coordinates and -forces. By including owned and ghost atoms in the dot product, the -effect of periodic boundary conditions is correctly accounted for. -Molecular topology interactions (bonds, angles, dihedrals, impropers) -are calculated next. The final contribution is from long-range -Coulombic interactions, invoked by the KSpace class. - -If the newton flag is on, forces on ghost atoms are communicated and -summed back to their corresponding owned atoms. The reverse\_comm() -method of the Comm class performs this operation, which is essentially -the inverse operation of sending copies of owned atom coordinates to -other processor's ghost atoms. - -At this point in the timestep, the total force on each atom is known. -Additional force constraints (external forces, SHAKE, etc) are applied -by Fixes that have a post\_force() method. The second half of the -velocity-Verlet integration is then performed (another half-step -update of the velocities) via fixes like nve, nvt, npt. - -At the end of the timestep, fixes that define an end\_of\_step() -method are invoked. These typically perform a diagnostic calculation, -e.g. the ave/time and ave/spatial fixes. The final operation of the -timestep is to perform any requested output, via the write() method of -the Output class. There are 3 kinds of LAMMPS output: thermodynamic -output to the screen and log file, snapshots of atom data to a dump -file, and restart files. See the thermo\_style, dump, and restart -commands for more details. - -The iteration performed by an energy minimization is similar to the -dynamics timestep of Fig \ref{fig:verlet}. Forces are computed, -neighbor lists are built as needed, atoms migrate to new processors, -and atom coordinates and forces are communicated to neighboring -processors. The only difference is what Fix class operations are -invoked when. Only a subset of LAMMPS fixes are useful during energy -minimization, as explained in their individual doc pages. The -relevant Fix class methods are min\_pre\_exchange(), -min\_pre\_force(), and min\_post\_force(). Each is invoked at the -appropriate place within the minimization iteration. For example, the -min\_post\_force() method is analogous to the post\_force() method for -dynamics; it is used to alter or constrain forces on each atom, which -affects the minimization procedure. - -\pagebreak -\section{Extending LAMMPS} - -The Section\_modify.html file in the doc directory of -the LAMMPS distribution gives an overview of how LAMMPS can -be extended by writing new classes that derive from existing -parent classes in LAMMPS. Here, some specific coding -details are provided for writing a new fix. - -\subsection{New fixes} - -(this section provided by Kirill Lykov) -\vspace{0.25cm} - -Writing fixes is a flexible way of extending LAMMPS. Users can -implement many things using fixes: - -\begin{itemize} -\item changing particles attributes (positions, velocities, forces, etc.). -Example: FixFreeze. -\item reading/writing data. Example: FixRestart. -\item implementing boundary conditions. Example: FixWall. -\item saving information about particles for future use (previous positions, -for instance). Example: FixStoreState. -\end{itemize} - -All fixes are derived from class Fix and must have constructor with the -signature: FixMine(class LAMMPS *, int, char **). - -Every fix must be registered in LAMMPS by writing the following lines -of code in the header before include guards: - - \begin{center} - \begin{verbatim} -#ifdef FIX_CLASS -FixStyle(your/fix/name,FixMine) -#else - \end{verbatim} - \end{center} - -Where ``your/fix/name'' is a name of your fix in the script and FixMine -is the name of the class. This code allows LAMMPS to find your fix -when it parses input script. In addition, your fix header must be -included in the file ``style\_fix.h''. In case if you use LAMMPS make, -this file is generated automatically - all files starting with prefix -fix\_ are included, so call your header the same way. Otherwise, don't -forget to add your include into ``style\_fix.h''. - -Let's write a simple fix which will print average velocity at the end -of each timestep. First of all, implement a constructor: - - \begin{center} - \begin{verbatim} -FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg) -: Fix(lmp, narg, arg) -{ - if (narg < 4) - error->all(FLERR,"Illegal fix print command"); - - nevery = atoi(arg[3]); - if (nevery <= 0) - error->all(FLERR,"Illegal fix print command"); -} - \end{verbatim} - \end{center} - -In the constructor you should parse your fix arguments which are -specified in the script. All fixes have pretty the same syntax: fix -[fix\_identifier] [group\_name] [fix\_name] [fix\_arguments]. The -first 3 parameters are parsed by Fix class constructor, while -[fix\_arguments] should be parsed by you. In our case, we need to -specify how often we want to print an average velocity. For instance, -once in 50 timesteps: fix 1 print/vel 50. There is a special variable -in Fix class called nevery which specifies how often method -end\_of\_step() is called. Thus all we need to do is just set it up. - -The next method we need to implement is setmask(): -\begin{center} -\begin{verbatim} -int FixPrintVel::setmask() -{ - int mask = 0; - mask |= FixConst::END_OF_STEP; - return mask; -} -\end{verbatim} -\end{center} - -Here user specifies which methods of your fix should be called during -the execution. For instance, END\_OF\_STEP corresponds to the -end\_of\_step() method. Overall, there are 8 most important methods, -methods are called in predefined order during the execution of the -verlet algorithm as was mentioned in the Section 3: - -\begin{itemize} -\item initial\_integrate() -\item post\_integrate() -\item pre\_exchange() -\item pre\_neighbor() -\item pre\_force() -\item post\_force() -\item final\_integrate() -\item end\_of\_step() -\end{itemize} - -Fix developer must understand when he wants to execute his code. In -case if we want to write FixPrintVel, we need only end\_of\_step(): - -\begin{center} -\begin{verbatim} -void FixPrintVel::end_of_step() -{ - // for add3, scale3 - using namespace MathExtra; - - double** v = atom->v; - int nlocal = atom->nlocal; - double localAvgVel[4]; // 4th element for particles count - memset(localAvgVel, 0, 4 * sizeof(double)); - for (int particleInd = 0; particleInd < nlocal; ++particleInd) { - add3(localAvgVel, v[particleInd], localAvgVel); - } - localAvgVel[3] = nlocal; - double globalAvgVel[4]; - memset(globalAvgVel, 0, 4 * sizeof(double)); - MPI_Allreduce(localAvgVel, globalAvgVel, 4, MPI_DOUBLE, MPI_SUM, world); - scale3(1.0 / globalAvgVel[3], globalAvgVel); - if (comm->me == 0) { - printf("\%e, \%e, \%e\n", - globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]); - } -} -\end{verbatim} -\end{center} - -In the code above, we use MathExtra routines defined in -``math\_extra.h''. There are bunch of math functions to work with -arrays of doubles as with math vectors. - -In this code we use an instance of Atom class. This object is stored -in the Pointers class (see ``pointers.h''). This object contains all -global information about the simulation system. Data from Pointers -class available to all classes inherited from it using protected -inheritance. Hence when you write you own class, which is going to use -LAMMPS data, don't forget to inherit from Pointers. When writing -fixes we inherit from class Fix which is inherited from Pointers so -there is no need to inherit from it directly. - -The code above computes average velocity for all particles in the -simulation. Yet you have one unused parameter in fix call from the -script - [group\_name]. This parameter specifies the group of atoms -used in the fix. So we should compute average for all particles in the -simulation if group\_name == all, but it can be any group. The group -information is specified by groupbit which is defined in class Fix: - -\begin{center} -\begin{verbatim} -for (int particleInd = 0; particleInd < nlocal; ++particleInd) { - if (atom->mask[particleInd] & groupbit) { - //Do all job here - } -} -\end{verbatim} -\end{center} - -Class Atom encapsulates atoms positions, velocities, forces, etc. User -can access them using particle index. Note, that particle indexes are -usually changed every timestep because of sorting. - -Lets consider another Fix example. We want to have a fix which stores -atoms position from previous time step in your fix. The local atoms -indexes will not be valid on the next iteration. In order to handle -this situation there are several methods which should be implemented: - -\begin{itemize} -\item \verb|double memory_usage| - return how much memory fix uses -\item \verb|void grow_arrays(int)| - do reallocation of the per particle arrays - in your fix -\item \verb|void copy_arrays(int i, int j, int delflag)| - copy i-th per-particle - information to j-th. Used when atoms sorting is performed. if delflag is set - and atom j owns a body, move the body information to atom i. -\item \verb|void set_arrays(int i)| - sets i-th particle related information to zero -\end{itemize} - -Note, that if your class implements these methods, it must call add calls of -add\_callback and delete\_callback to constructor and destructor: - -\begin{center} -\begin{verbatim} -FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg) { - //... - atom->add_callback(0); -} - -FixSavePos::~FixSavePos() { - atom->delete_callback(id, 0); -} -\end{verbatim} -\end{center} - -Since we want to store positions of atoms from previous timestep, we -need to add double** x to the header file. Than add allocation code to -constructor: - -\verb|memory->create(this->x, atom->nmax, 3, "FixSavePos:x");|. Free memory -at destructor: \verb|memory->destroy(x);| - -Finally, implement mentioned methods: - -\begin{center} -\begin{verbatim} -double FixSavePos::memory_usage() -{ - int nmax = atom->nmax; - double bytes = 0.0; - bytes += nmax * 3 * sizeof(double); - return bytes; -} - -void FixSavePos::grow_arrays(int nmax) -{ - memory->grow(this->x, nmax, 3, "FixSavePos:x"); -} - -void FixSavePos::copy_arrays(int i, int j, int delflag) -{ - memcpy(this->x[j], this->x[i], sizeof(double) * 3); -} - -void FixSavePos::set_arrays(int i) -{ - memset(this->x[i], 0, sizeof(double) * 3); -} - -int FixSavePos::pack_exchange(int i, double *buf) -{ - int m = 0; - buf[m++] = x[i][0]; - buf[m++] = x[i][1]; - buf[m++] = x[i][2]; - - return m; -} - -int FixSavePos::unpack_exchange(int nlocal, double *buf) -{ - int m = 0; - x[nlocal][0] = buf[m++]; - x[nlocal][1] = buf[m++]; - x[nlocal][2] = buf[m++]; - - return m; -} -\end{verbatim} -\end{center} - -Now, a little bit about memory allocation. We used Memory class which -is just a bunch of template functions for allocating 1D and 2D -arrays. So you need to add include ``memory.h'' to have access to them. - -Finally, if you need to write/read some global information used in -your fix to the restart file, you might do it by setting flag -restart\_global = 1 in the constructor and implementing methods void -write\_restart(FILE *fp) and void restart(char *buf). - -\end{document} diff --git a/doc/src/Developer_flow.rst b/doc/src/Developer_flow.rst new file mode 100644 index 0000000000..729044206e --- /dev/null +++ b/doc/src/Developer_flow.rst @@ -0,0 +1,236 @@ +How a timestep works +==================== + +The first and most fundamental operation within LAMMPS to understand is +how a timestep is structured. Timestepping is performed by calling +methods of the Integrate class instance within the Update class. Since +Integrate is a base class, it will point to an instance of a derived +class corresponding to what is selected by the :doc:`run_style +` input script command. + +In this section, the timestep implemented by the Verlet class is +described. A similar timestep protocol is implemented by the Respa +class, for the r-RESPA hierarchical timestepping method. + +The Min base class performs energy minimization, so does not perform a +literal timestep. But it has logic similar to what is described here, +to compute forces and invoke fixes at each iteration of a minimization. +Differences between time integration and minimization are highlighted at +the end of this section. + +The Verlet class is encoded in the ``src/verlet.cpp`` and ``verlet.h`` +files. It implements the velocity-Verlet timestepping algorithm. The +workhorse method is ``Verlet::run()``, but first we highlight several +other methods in the class. + +- The ``init()`` method is called at the beginning of each dynamics + run. It simply sets some internal flags, based on user settings in + other parts of the code. + +- The ``setup()`` or ``setup_minimal()`` methods are also called before + each run. The velocity-Verlet method requires current forces be + calculated before the first timestep, so these routines compute + forces due to all atomic interactions, using the same logic that + appears in the timestepping described next. A few fixes are also + invoked, using the mechanism described in the next section. Various + counters are also initialized before the run begins. The + ``setup_minimal()`` method is a variant that has a flag for performing + less setup. This is used when runs are continued and information + from the previous run is still valid. For example, if repeated + short LAMMPS runs are being invoked, interleaved by other commands, + via the *pre no* and *every* options of the run command, the + ``setup_minimal()`` method is used. + +- The ``force_clear()`` method initializes force and other arrays to + zero before each timestep, so that forces (torques, etc) can be + accumulated. + +Now for the ``Verlet::run()`` method. Its basic structure in hi-level pseudo +code is shown below. In the actual code in ``src/verlet.cpp`` some of +these operations are conditionally invoked. + +.. code-block:: python + + loop over N timesteps: + if timeout condition: break + ev_set() + + fix->initial_integrate() + fix->post_integrate() + + nflag = neighbor->decide() + if nflag: + fix->pre_exchange() + domain->pbc() + domain->reset_box() + comm->setup() + neighbor->setup_bins() + comm->exchange() + comm->borders() + fix->pre_neighbor() + neighbor->build() + fix->post_neighbor() + else: + comm->forward_comm() + + force_clear() + fix->pre_force() + + pair->compute() + bond->compute() + angle->compute() + dihedral->compute() + improper->compute() + kspace->compute() + + fix->pre_reverse() + comm->reverse_comm() + + fix->post_force() + fix->final_integrate() + fix->end_of_step() + + if any output on this step: + output->write() + + # after loop + fix->post_run() + + +The ``ev_set()`` method (in the parent Integrate class), sets two flags +(*eflag* and *vflag*) for energy and virial computation. Each flag +encodes whether global and/or per-atom energy and virial should be +calculated on this timestep, because some fix or variable or output will +need it. These flags are passed to the various methods that compute +particle interactions, so that they either compute and tally the +corresponding data or can skip the extra calculations if the energy and +virial are not needed. See the comments for the ``Integrate::ev_set()`` +method which document the flag values. + +At various points of the timestep, fixes are invoked, +e.g. ``fix->initial_integrate()``. In the code, this is actually done +via the Modify class which stores all the Fix objects and lists of which +should be invoked at what point in the timestep. Fixes are the LAMMPS +mechanism for tailoring the operations of a timestep for a particular +simulation. As described elsewhere, each fix has one or more methods, +each of which is invoked at a specific stage of the timestep, as show in +the timestep pseudo-code. All the active fixes defined in an input +script, that are flagged to have an ``initial_integrate()`` method are +invoked at the beginning of each timestep. Examples are :doc:`fix nve +` or :doc:`fix nvt or fix npt ` which perform the +start-of-timestep velocity-Verlet integration operations to update +velocities by a half-step, and coordinates by a full step. The +``post_integrate()`` method is next for operations that need to happen +immediately after those updates. Only a few fixes use this, e.g. to +reflect particles off box boundaries in the :doc:`FixWallReflect class +`. + +The ``decide()`` method in the Neighbor class determines whether +neighbor lists need to be rebuilt on the current timestep (conditions +can be changed using the :doc:`neigh_modify every/delay/check +` command. If not, coordinates of ghost atoms are +acquired by each processor via the ``forward_comm()`` method of the Comm +class. If neighbor lists need to be built, several operations within +the inner if clause of the pseudo-code are first invoked. The +``pre_exchange()`` method of any defined fixes is invoked first. +Typically this inserts or deletes particles from the system. + +Periodic boundary conditions are then applied by the Domain class via +its ``pbc()`` method to remap particles that have moved outside the +simulation box back into the box. Note that this is not done every +timestep, but only when neighbor lists are rebuilt. This is so that +each processor's sub-domain will have consistent (nearby) atom +coordinates for its owned and ghost atoms. It is also why dumped atom +coordinates may be slightly outside the simulation box if not dumped +on a step where the neighbor lists are rebuilt. + +The box boundaries are then reset (if needed) via the ``reset_box()`` +method of the Domain class, e.g. if box boundaries are shrink-wrapped to +current particle coordinates. A change in the box size or shape +requires internal information for communicating ghost atoms (Comm class) +and neighbor list bins (Neighbor class) be updated. The ``setup()`` +method of the Comm class and ``setup_bins()`` method of the Neighbor +class perform the update. + +The code is now ready to migrate atoms that have left a processor's +geometric sub-domain to new processors. The ``exchange()`` method of +the Comm class performs this operation. The ``borders()`` method of the +Comm class then identifies ghost atoms surrounding each processor's +sub-domain and communicates ghost atom information to neighboring +processors. It does this by looping over all the atoms owned by a +processor to make lists of those to send to each neighbor processor. On +subsequent timesteps, the lists are used by the ``Comm::forward_comm()`` +method. + +Fixes with a ``pre_neighbor()`` method are then called. These typically +re-build some data structure stored by the fix that depends on the +current atoms owned by each processor. + +Now that each processor has a current list of its owned and ghost +atoms, LAMMPS is ready to rebuild neighbor lists via the ``build()`` +method of the Neighbor class. This is typically done by binning all +owned and ghost atoms, and scanning a stencil of bins around each +owned atom's bin to make a Verlet list of neighboring atoms within the +force cutoff plus neighbor skin distance. + +In the next portion of the timestep, all interaction forces between +particles are computed, after zeroing the per-atom force vector via the +``force_clear()`` method. If the newton flag is set to *on* by the +newton command, forces are added to both owned and ghost atoms, otherwise +only to owned (aka local) atoms. + +Pairwise forces are calculated first, which enables the global virial +(if requested) to be calculated cheaply (at O(N) cost instead of O(N**2) +at the end of the ``Pair::compute()`` method), by a dot product of atom +coordinates and forces. By including owned and ghost atoms in the dot +product, the effect of periodic boundary conditions is correctly +accounted for. Molecular topology interactions (bonds, angles, +dihedrals, impropers) are calculated next (if supported by the current +atom style). The final contribution is from long-range Coulombic +interactions, invoked by the KSpace class. + +The ``pre_reverse()`` method in fixes is used for operations that have to +be done *before* the upcoming reverse communication (e.g. to perform +additional data transfers or reductions for data computed during the +force computation and stored with ghost atoms). + +If the newton flag is on, forces on ghost atoms are communicated and +summed back to their corresponding owned atoms. The ``reverse_comm()`` +method of the Comm class performs this operation, which is essentially +the inverse operation of sending copies of owned atom coordinates to +other processor's ghost atoms. + +At this point in the timestep, the total force on each (local) atom is +known. Additional force constraints (external forces, SHAKE, etc) are +applied by Fixes that have a ``post_force()`` method. The second half +of the velocity-Verlet integration, ``final_integrate()`` is then +performed (another half-step update of the velocities) via fixes like +nve, nvt, npt. + +At the end of the timestep, fixes that contain an ``end_of_step()`` +method are invoked. These typically perform a diagnostic calculation, +e.g. the ave/time and ave/spatial fixes. The final operation of the +timestep is to perform any requested output, via the ``write()`` method +of the Output class. There are 3 kinds of LAMMPS output: thermodynamic +output to the screen and log file, snapshots of atom data to a dump +file, and restart files. See the :doc:`thermo_style `, +:doc:`dump `, and :doc:`restart ` commands for more +details. + +The the flow of control during energy minimization iterations is +similar to that of a molecular dynamics timestep. Forces are computed, +neighbor lists are built as needed, atoms migrate to new processors, and +atom coordinates and forces are communicated to neighboring processors. +The only difference is what Fix class operations are invoked when. Only +a subset of LAMMPS fixes are useful during energy minimization, as +explained in their individual doc pages. The relevant Fix class methods +are ``min_pre_exchange()``, ``min_pre_force()``, and ``min_post_force()``. +Each fix is invoked at the appropriate place within the minimization +iteration. For example, the ``min_post_force()`` method is analogous to +the ``post_force()`` method for dynamics; it is used to alter or constrain +forces on each atom, which affects the minimization procedure. + +After all iterations are completed there is a ``cleanup`` step which +calls the ``post_run()`` method of fixes to perform operations only required +at the end of a calculations (like freeing temporary storage or creating +final outputs). diff --git a/doc/src/Developer_org.rst b/doc/src/Developer_org.rst new file mode 100644 index 0000000000..84432f52cd --- /dev/null +++ b/doc/src/Developer_org.rst @@ -0,0 +1,250 @@ +LAMMPS source files +=================== + +The source files of the LAMMPS code are found in two +directories of the distribution: ``src`` and ``lib``. +Most of the code is C++ but there are small numbers of files +in several other languages. + +The core of the code is located in the +``src`` folder and its sub-directories. +A sizable number of these files are in the ``src`` directory +itself, but there are plenty of :doc:`packages `, which can be +included or excluded when LAMMPS is built. See the :doc:`Include +packages in build ` section of the manual for more +information about that part of the build process. LAMMPS currently +supports building with :doc:`conventional makefiles ` and +through :doc:`CMake ` which differ in how packages are +enabled or disabled for a LAMMPS binary. The source files for each +package are in all-uppercase sub-directories of the ``src`` folder, for +example ``src/MOLECULE`` or ``src/USER-MISC``. The ``src/STUBS`` +sub-directory is not a package but contains a dummy MPI library, that is +used when building a serial version of the code. The ``src/MAKE`` +directory contains makefiles with settings and flags for a variety of +configuration and machines for the build process with traditional +makefiles. + +The ``lib`` directory contains the source code for several supporting +libraries or files with configuration settings to use globally installed +libraries, that are required by some of the optional packages. +Each sub-directory, like ``lib/poems`` or ``lib/gpu``, contains the +source files, some of which are in different languages such as Fortran +or CUDA. These libraries are linked to during a LAMMPS build, if the +corresponding package is installed. + +LAMMPS C++ source files almost always come in pairs, such as +``src/run.cpp`` (implementation file) and ``src/run.h`` (header file). +Each pair of files defines a C++ +class, for example the :cpp:class:`LAMMPS_NS::Run` class which contains +the code invoked by the :doc:`run ` command in a LAMMPS input script. +As this example illustrates, source file and class names often have a +one-to-one correspondence with a command used in a LAMMPS input script. +Some source files and classes do not have a corresponding input script +command, e.g. ``src/force.cpp`` and the :cpp:class:`LAMMPS_NS::Force` +class. They are discussed in the next section. + +A small number of C++ classes and utility functions are implemented with +only a ``.h`` file. Examples are the Pointer class or the MathVec functions. + +LAMMPS class topology +===================== + +Though LAMMPS has a lot of source files and classes, its class topology +is relative flat, as outlined in the :ref:`class-topology` figure. Each +name refers to a class and has a pair of associated source files in the +``src`` folder, for example the class :cpp:class:`LAMMPS_NS::Memory` +corresponds to the files ``memory.cpp`` and ``memory.h``, or the class +:cpp:class:`LAMMPS_NS::AtomVec` corresponds to the files +``atom_vec.cpp`` and ``atom_vec.h``. Full lines in the figure represent +compositing: that is the class to the left holds a pointer to an +instance of the class to the right. Dashed lines instead represent +inheritance: the class to the right is derived from the class on the +left. Classes with a red boundary are not instantiated directly, but +they represent the base classes for "styles". Those "styles" make up +the bulk of the LAMMPS code and only a few typical examples are included +in the figure for demonstration purposes. + +.. _class-topology: +.. figure:: JPG/lammps-classes.png + + LAMMPS class topology + + This figure shows some of the relations of the base classes of the + LAMMPS simulation package. Full lines indicate that a class holds an + instance of the class it is pointing to; dashed lines point to + derived classes that are given as examples of what classes may be + instantiated during a LAMMPS run based on the input commands and + accessed through the API define by their respective base classes. At + the core is the :cpp:class:`LAMMPS ` class, which + holds pointers to class instances with specific purposes. Those may + hold instances of other classes, sometimes directly, or only + temporarily, sometimes as derived classes or derived classes or + derived classes, which may also hold instances of other classes. + +The :cpp:class:`LAMMPS_NS::LAMMPS` class is the topmost class and +represents what is referred to an "instance" of LAMMPS. It is a +composite holding references to instances of other core classes +providing the core functionality of the MD engine in LAMMPS and through +them abstractions of the required operations. The constructor of the +LAMMPS class will instantiate those instances, process the command line +flags, initialize MPI (if not already done) and set up file pointers for +input and output. The destructor will shut everything down and free all +associated memory. Thus code for the standalone LAMMPS executable in +``main.cpp`` simply initializes MPI, instantiates a single instance of +LAMMPS, and passes it the command line flags and input script. It +deletes the LAMMPS instance after the method reading the input returns +and shuts down the MPI environment before it exits the executable. + +The :cpp:class:`LAMMPS_NS::Pointers` is not shown in the +:ref:`class-topology` figure, it holds references to members of the +`LAMMPS_NS::LAMMPS`, so that all classes derived from +:cpp:class:`LAMMPS_NS::Pointers` have direct access to those reference. +From the class topology all classes with blue boundary are referenced in +this class and all classes in the second and third columns, that are not +listed as derived classes are instead derived from +:cpp:class:`LAMMPS_NS::Pointers`. + +Since all storage is encapsulated, the LAMMPS class can also be +instantiated multiple times by a calling code, and that can be either +simultaneously or consecutively. When running in parallel with MPI, +care has to be taken, that suitable communicators are used to not +create conflicts between different instances. + +The LAMMPS class currently holds instances of 19 classes representing +different core functionalities There are a handful of virtual parent +classes in LAMMPS that define what LAMMPS calls ``styles``. They are +shaded red in the :ref:`class-topology` figure. Each of these are +parents of a number of child classes that implement the interface +defined by the parent class. There are two main categories of these +``styles``: some may only have one instance active at a time (e.g. atom, +pair, bond, angle, dihedral, improper, kspace, comm) and there is a +dedicated pointer variable in the composite class that manages them. +Setups that require a mix of different such styles have to use a +*hybrid* class that manages and forwards calls to the corresponding +sub-styles for the designated subset of atoms or data. or the composite +class may have lists of class instances, e.g. Modify handles lists of +compute and fix styles, while Output handles dumps class instances. + +The exception to this scheme are the ``command`` style classes. These +implement specific commands that can be invoked before, after, or between +runs or are commands which launch a simulation. For these an instance +of the class is created, its command() method called and then, after +completion, the class instance deleted. Examples for this are the +create_box, create_atoms, minimize, run, or velocity command styles. + +For all those ``styles`` certain naming conventions are employed: for +the fix nve command the class is called FixNVE and the files are +``fix_nve.h`` and ``fix_nve.cpp``. Similarly for fix ave/time we have +FixAveTime and ``fix_ave_time.h`` and ``fix_ave_time.cpp``. Style names +are lower case and without spaces or special characters. A suffix or +multiple appended with a forward slash '/' denotes a variant of the +corresponding class without the suffix. To connect the style name and +the class name, LAMMPS uses macros like the following ATOM\_CLASS, +PAIR\_CLASS, BOND\_CLASS, REGION\_CLASS, FIX\_CLASS, COMPUTE\_CLASS, +or DUMP\_CLASS in the corresponding header file. During compilation +files with the pattern ``style_name.h`` are created that contain include +statements including all headers of all styles of a given type that +are currently active (or "installed). + + +More details on individual classes in the :ref:`class-topology` are as +follows: + +- The Memory class handles allocation of all large vectors and arrays. + +- The Error class prints all error and warning messages. + +- The Universe class sets up partitions of processors so that multiple + simulations can be run, each on a subset of the processors allocated + for a run, e.g. by the mpirun command. + +- The Input class reads and processes input input strings and files, + stores variables, and invokes :doc:`commands `. + +- As discussed above, command style classes are directly derived from + the Pointers class. They provide input script commands that perform + one-time operations before/after/between simulations or which invoke a + simulation. They are instantiated from within the Input class, + invoked, then immediately destructed. + +- The Finish class is instantiated to print statistics to the screen + after a simulation is performed, by commands like run and minimize. + +- The Special class walks the bond topology of a molecular system to + find first, second, third neighbors of each atom. It is invoked by + several commands, like :doc:`read_data `, + :doc:`read_restart `, or :doc:`replicate `. + +- The Atom class stores per-atom properties associated with atom styles. + More precisely, they are allocated and managed by a class derived from + the AtomVec class, and the Atom class simply stores pointers to them. + The classes derived from AtomVec represent the different atom styles + and they are instantiated through the :doc:`atom_style ` + command. + +- The Update class holds instances of an integrator and a minimizer + class. The Integrate class is a parent style for the Verlet and + r-RESPA time integrators, as defined by the :doc:`run_style + ` command. The Min class is a parent style for various + energy minimizers. + +- The Neighbor class builds and stores neighbor lists. The NeighList + class stores a single list (for all atoms). A NeighRequest class + instance is created by pair, fix, or compute styles when they need a + particular kind of neighbor list and use the NeighRequest properties + to select the neighbor list settings for the given request. There can + be multiple instances of the NeighRequest class and the Neighbor class + will try to optimize how they are computed by creating copies or + sub-lists where possible. + +- The Comm class performs inter-processor communication, typically of + ghost atom information. This usually involves MPI message exchanges + with 6 neighboring processors in the 3d logical grid of processors + mapped to the simulation box. There are two :doc:`communication styles + ` enabling different ways to do the domain decomposition. + Sometimes the Irregular class is used, when atoms may migrate to + arbitrary processors. + +- The Domain class stores the simulation box geometry, as well as + geometric Regions and any user definition of a Lattice. The latter + are defined by the :doc:`region ` and :doc:`lattice ` + commands in an input script. + +- The Force class computes various forces between atoms. The Pair + parent class is for non-bonded or pair-wise forces, which in LAMMPS + also includes many-body forces such as the Tersoff 3-body potential if + those are computed by walking pairwise neighbor lists. The Bond, + Angle, Dihedral, Improper parent classes are styles for bonded + interactions within a static molecular topology. The KSpace parent + class is for computing long-range Coulombic interactions. One of its + child classes, PPPM, uses the FFT3D and Remap classes to redistribute + and communicate grid-based information across the parallel processors. + +- The Modify class stores lists of class instances derived from the + :doc:`Fix ` and :doc:`Compute ` base classes. + +- The Group class manipulates groups that atoms are assigned to via the + :doc:`group ` command. It also has functions to compute + various attributes of groups of atoms. + +- The Output class is used to generate 3 kinds of output from a LAMMPS + simulation: thermodynamic information printed to the screen and log + file, dump file snapshots, and restart files. These correspond to the + :doc:`Thermo `, :doc:`Dump `, and + :doc:`WriteRestart ` classes respectively. The Dump + class is a base class with several derived classes implementing + various dump style variants. + +- The Timer class logs timing information, output at the end + of a run. + +.. TODO section on "Spatial decomposition and parallel operations" +.. diagram of 3d processor grid, brick vs. tiled. local vs. ghost +.. atoms, 6-way communication with pack/unpack functions, +.. PBC as part of the communication + +.. TODO section on "Fixes, Computes, and Variables" +.. how and when data is computed and provided and how it is +.. referenced. flags in Fix/Compute/Variable classes tell +.. style and amount of available data. + diff --git a/doc/src/Developer_utils.rst b/doc/src/Developer_utils.rst new file mode 100644 index 0000000000..4e005fc134 --- /dev/null +++ b/doc/src/Developer_utils.rst @@ -0,0 +1,484 @@ + +LAMMPS utility functions +======================== + +The ``utils`` sub-namespace inside the ``LAMMPS_NS`` namespace provides +a collection of convenience functions and utilities that perform common +tasks that are required repeatedly throughout the LAMMPS code like +reading or writing to files with error checking or translation of +strings into specific types of numbers with checking for validity. This +reduces redundant implementations and encourages consistent behavior. + +I/O with status check +^^^^^^^^^^^^^^^^^^^^^ + +These are wrappers around the corresponding C library calls like +``fgets()`` or ``fread()``. They will check if there were errors +on reading or an unexpected end-of-file state was reached. In that +case, the functions will stop the calculation with an error message, +indicating the name of the problematic file, if possible. + +---------- + +.. doxygenfunction:: sfgets + :project: progguide + +.. doxygenfunction:: sfread + :project: progguide + +---------- + +String to number conversions with validity check +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +These functions should be used to convert strings to numbers. They are +are strongly preferred over C library calls like ``atoi()`` or +``atof()`` since they check if the **entire** provided string is a valid +(floating-point or integer) number, and will error out instead of +silently returning the result of a partial conversion or zero in cases +where the string is not a valid number. This behavior allows to more +easily detect typos or issues when processing input files. + +The *do_abort* flag should be set to ``true`` in case this function +is called only on a single MPI rank, as that will then trigger the +a call to ``Error::one()`` for errors instead of ``Error::all()`` +and avoids a "hanging" calculation when run in parallel. + +Please also see :cpp:func:`is_integer() ` +and :cpp:func:`is_double() ` for testing +strings for compliance without conversion. + +---------- + +.. doxygenfunction:: numeric + :project: progguide + +.. doxygenfunction:: inumeric + :project: progguide + +.. doxygenfunction:: bnumeric + :project: progguide + +.. doxygenfunction:: tnumeric + :project: progguide + + +String processing +^^^^^^^^^^^^^^^^^ + +The following are functions to help with processing strings +and parsing files or arguments. + +---------- + +.. doxygenfunction:: trim + :project: progguide + +.. doxygenfunction:: trim_comment + :project: progguide + +.. doxygenfunction:: count_words(const char *text) + :project: progguide + +.. doxygenfunction:: count_words(const std::string &text) + :project: progguide + +.. doxygenfunction:: count_words(const std::string &text, const std::string &separators) + :project: progguide + +.. doxygenfunction:: trim_and_count_words + :project: progguide + +.. doxygenfunction:: split_words + :project: progguide + +.. doxygenfunction:: strmatch + :project: progguide + +.. doxygenfunction:: is_integer + :project: progguide + +.. doxygenfunction:: is_double + :project: progguide + +File and path functions +^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. doxygenfunction:: guesspath + :project: progguide + +.. doxygenfunction:: path_basename + :project: progguide + +.. doxygenfunction:: path_join + :project: progguide + +.. doxygenfunction:: file_is_readable + :project: progguide + +Potential file functions +^^^^^^^^^^^^^^^^^^^^^^^^ + +.. doxygenfunction:: get_potential_file_path + :project: progguide + +.. doxygenfunction:: get_potential_date + :project: progguide + +.. doxygenfunction:: get_potential_units + :project: progguide + +.. doxygenfunction:: get_supported_conversions + :project: progguide + +.. doxygenfunction:: get_conversion_factor + :project: progguide + +.. doxygenfunction:: open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert) + :project: progguide + +Argument processing +^^^^^^^^^^^^^^^^^^^ + +.. doxygenfunction:: bounds + :project: progguide + +.. doxygenfunction:: expand_args + :project: progguide + +Convenience functions +^^^^^^^^^^^^^^^^^^^^^ + +.. doxygenfunction:: logmesg + :project: progguide + +.. doxygenfunction:: getsyserror + :project: progguide + +.. doxygenfunction:: check_packages_for_style + :project: progguide + +.. doxygenfunction:: timespec2seconds + :project: progguide + +.. doxygenfunction:: date2num + :project: progguide + +Customized standard functions +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +.. doxygenfunction:: merge_sort + :project: progguide + +--------------------------- + +Communication buffer coding with *ubuf* +========================================= + +LAMMPS uses communication buffers where it collects data from various +class instances and then exchanges the data with neighboring sub-domains. +For simplicity those buffers are defined as ``double`` buffers and +used for doubles and integer numbers. This presents a unique problem +when 64-bit integers are used. While the storage needed for a ``double`` +is also 64-bit, it cannot be used by a simple assignment. To get around +that limitation, LAMMPS uses the :cpp:union:`ubuf ` +union. It is used in the various "pack" and "unpack" functions in the +LAMMPS classes to store and retrieve integers that may be 64-bit from +the communication buffers. + +--------------------------- + +.. doxygenunion:: LAMMPS_NS::ubuf + :project: progguide + +--------------------------- + +Tokenizer classes +================= + +The purpose of the tokenizer classes is to simplify the recurring task +of breaking lines of text down into words and/or numbers. +Traditionally, LAMMPS code would be using the ``strtok()`` function from +the C library for that purpose, but that function has two significant +disadvantages: 1) it cannot be used concurrently from different LAMMPS +instances since it stores its status in a global variable and 2) it +modifies the string that it is processing. These classes were +implemented to avoid both of these issues and also to reduce the amount +of code that needs to be written. + +The basic procedure is to create an instance of the tokenizer class with +the string to be processed as an argument and then do a loop until all +available tokens are read. The constructor has a default set of +separator characters, but that can be overridden. The default separators +are all "whitespace" characters, i.e. the space character, the tabulator +character, the carriage return character, the linefeed character, and +the form feed character. + +.. code-block:: C++ + :caption: Tokenizer class example listing entries of the PATH environment variable + + #include "tokenizer.h" + #include + #include + #include + + using namespace LAMMPS_NS; + + int main(int, char **) + { + const char *path = getenv("PATH"); + + if (path != nullptr) { + Tokenizer p(path,":"); + while (p.has_next()) + std::cout << "Entry: " << p.next() << "\n"; + } + return 0; + } + +Most tokenizer operations cannot fail except for +:cpp:func:`LAMMPS_NS::Tokenizer::next` (when used without first +checking with :cpp:func:`LAMMPS_NS::Tokenizer::has_next`) and +:cpp:func:`LAMMPS_NS::Tokenizer::skip`. In case of failure, the class +will throw an exception, so you may need to wrap the code using the +tokenizer into a ``try`` / ``catch`` block to handle errors. The +:cpp:class:`LAMMPS_NS::ValueTokenizer` class may also throw an exception +when a (type of) number is requested as next token that is not +compatible with the string representing the next word. + +.. code-block:: C++ + :caption: ValueTokenizer class example with exception handling + + #include "tokenizer.h" + #include + #include + #include + + using namespace LAMMPS_NS; + + int main(int, char **) + { + const char *text = "1 2 3 4 5 20.0 21 twentytwo 2.3"; + double num1(0),num2(0),num3(0),num4(0); + + ValueTokenizer t(text); + // read 4 doubles after skipping over 5 numbers + try { + t.skip(5); + num1 = t.next_double(); + num2 = t.next_double(); + num3 = t.next_double(); + num4 = t.next_double(); + } catch (TokenizerException &e) { + std::cout << "Reading numbers failed: " << e.what() << "\n"; + } + std::cout << "Values: " << num1 << " " << num2 << " " << num3 << " " << num4 << "\n"; + return 0; + } + +This code example should produce the following output: + +.. code-block:: + + Reading numbers failed: Not a valid floating-point number: 'twentytwo' + Values: 20 21 0 0 + +---------- + +.. doxygenclass:: LAMMPS_NS::Tokenizer + :project: progguide + :members: + +.. doxygenclass:: LAMMPS_NS::TokenizerException + :project: progguide + :members: + +.. doxygenclass:: LAMMPS_NS::ValueTokenizer + :project: progguide + :members: + +.. doxygenclass:: LAMMPS_NS::InvalidIntegerException + :project: progguide + :members: what + +.. doxygenclass:: LAMMPS_NS::InvalidFloatException + :project: progguide + :members: what + +---------- + +File reader classes +==================== + +The purpose of the file reader classes is to simplify the recurring task +of reading and parsing files. They can use the +:cpp:class:`LAMMPS_NS::ValueTokenizer` class to process the read in +text. The :cpp:class:`LAMMPS_NS::TextFileReader` is a more general +version while :cpp:class:`LAMMPS_NS::PotentialFileReader` is specialized +to implement the behavior expected for looking up and reading/parsing +files with potential parameters in LAMMPS. The potential file reader +class requires a LAMMPS instance, requires to be run on MPI rank 0 only, +will use the :cpp:func:`LAMMPS_NS::utils::get_potential_file_path` +function to look up and open the file, and will call the +:cpp:class:`LAMMPS_NS::Error` class in case of failures to read or to +convert numbers, so that LAMMPS will be aborted. + +.. code-block:: C++ + :caption: Use of PotentialFileReader class in pair style coul/streitz + + PotentialFileReader reader(lmp, file, "coul/streitz"); + char * line; + + while((line = reader.next_line(NPARAMS_PER_LINE))) { + try { + ValueTokenizer values(line); + std::string iname = values.next_string(); + + int ielement; + for (ielement = 0; ielement < nelements; ielement++) + if (iname == elements[ielement]) break; + + if (nparams == maxparam) { + maxparam += DELTA; + params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), + "pair:params"); + } + + params[nparams].ielement = ielement; + params[nparams].chi = values.next_double(); + params[nparams].eta = values.next_double(); + params[nparams].gamma = values.next_double(); + params[nparams].zeta = values.next_double(); + params[nparams].zcore = values.next_double(); + + } catch (TokenizerException & e) { + error->one(FLERR, e.what()); + } + nparams++; + } + +A file that would be parsed by the reader code fragment looks like this: + +.. parsed-literal:: + + # DATE: 2015-02-19 UNITS: metal CONTRIBUTOR: Ray Shan CITATION: Streitz and Mintmire, Phys Rev B, 50, 11996-12003 (1994) + # + # X (eV) J (eV) gamma (1/\AA) zeta (1/\AA) Z (e) + + Al 0.000000 10.328655 0.000000 0.968438 0.763905 + O 5.484763 14.035715 0.000000 2.143957 0.000000 + + +---------- + +.. doxygenclass:: LAMMPS_NS::TextFileReader + :project: progguide + :members: + +.. doxygenclass:: LAMMPS_NS::PotentialFileReader + :project: progguide + :members: + +---------- + +Memory pool classes +=================== + +The memory pool classes are used for cases where otherwise many +small memory allocations would be needed and where the data would +be either all used or all freed. One example for that is the +storage of neighbor lists. The memory management strategy is +based on the assumption that allocations will be in chunks of similar +sizes. The allocation is then not done per individual call for a +reserved chunk of memory, but for a "page" that can hold multiple +chunks of data. A parameter for the maximum chunk size must be +provided, as that is used to determine whether a new page of memory +must be used. + +The :cpp:class:`MyPage ` class offers two ways to +reserve a chunk: 1) with :cpp:func:`get() ` the +chunk size needs to be known in advance, 2) with :cpp:func:`vget() +` a pointer to the next chunk is returned, but +its size is registered later with :cpp:func:`vgot() +`. + +.. code-block:: C++ + :caption: Example of using :cpp:class:`MyPage ` + + #include "my_page.h" + using namespace LAMMPS_NS; + + MyPage *dpage = new MyPage; + // max size of chunk: 256, size of page: 10240 doubles (=81920 bytes) + dpage->init(256,10240); + + double **build_some_lists(int num) + { + dpage->reset(); + double **dlist = new double*[num]; + for (int i=0; i < num; ++i) { + double *dptr = dpage.vget(); + int jnum = 0; + for (int j=0; j < jmax; ++j) { + // compute some dvalue for eligible loop index j + dptr[j] = dvalue; + ++jnum; + } + if (dpage.status() != 0) { + // handle out of memory or jnum too large errors + } + dpage.vgot(jnum); + dlist[i] = dptr; + } + return dlist; + } + +---------- + +.. doxygenclass:: LAMMPS_NS::MyPage + :project: progguide + :members: + +.. doxygenclass:: LAMMPS_NS::MyPoolChunk + :project: progguide + :members: + +---------- + +Eigensolver functions +===================== + +The ``MathEigen`` sub-namespace of the ``LAMMPS_NS`` namespace contains +functions and classes for eigensolvers. Currently only the +:cpp:func:`jacobi3 function ` is used in various +places in LAMMPS. That function is built on top of a group of more +generic eigensolvers that are maintained in the ``math_eigen_impl.h`` +header file. This header contains the implementation of three template +classes: + +#. "Jacobi" calculates all of the eigenvalues and eigenvectors + of a dense, symmetric, real matrix. + +#. The "PEigenDense" class only calculates the principal eigenvalue + (ie. the largest or smallest eigenvalue), and its corresponding + eigenvector. However it is much more efficient than "Jacobi" when + applied to large matrices (larger than 13x13). PEigenDense also can + understand complex-valued Hermitian matrices. + +#. The "LambdaLanczos" class is a generalization of "PEigenDense" which can be + applied to arbitrary sparse matrices. + +The "math_eigen_impl.h" code is an amalgamation of `jacobi_pd +`_ by Andrew Jewett at Scripps +Research (under CC0-1.0 license) and `Lambda Lanczos +`_ by Yuya Kurebayashi at +Tohoku University (under MIT license) + +---------- + +.. doxygenfunction:: MathEigen::jacobi3(double const *const *mat, double *eval, double **evec) + :project: progguide + +.. doxygenfunction:: MathEigen::jacobi3(double const mat[3][3], double *eval, double evec[3][3]) + :project: progguide + diff --git a/doc/src/Developer_write.rst b/doc/src/Developer_write.rst new file mode 100644 index 0000000000..7765ed1262 --- /dev/null +++ b/doc/src/Developer_write.rst @@ -0,0 +1,253 @@ +Writing LAMMPS styles +===================== + +The :doc:`Modify` section of the manual gives an overview of how LAMMPS can +be extended by writing new classes that derive from existing +parent classes in LAMMPS. Here, some specific coding +details are provided for writing code for LAMMPS. + +Writing a new fix style +^^^^^^^^^^^^^^^^^^^^^^^ + +Writing fixes is a flexible way of extending LAMMPS. Users can +implement many things using fixes: + +- changing particles attributes (positions, velocities, forces, etc.). Examples: FixNVE, FixFreeze. +- reading/writing data. Example: FixRestart. +- adding or modifying properties due to geometry. Example: FixWall. +- interacting with other subsystems or external code: Examples: FixTTM, FixExternal, FixLATTE +- saving information for analysis or future use (previous positions, + for instance). Examples: Fix AveTime, FixStoreState. + + +All fixes are derived from the Fix base class and must have a +constructor with the signature: ``FixPrintVel(class LAMMPS *, int, char **)``. + +Every fix must be registered in LAMMPS by writing the following lines +of code in the header before include guards: + +.. code-block:: c + + #ifdef FIX_CLASS + FixStyle(print/vel,FixPrintVel) + #else + /* the definition of the FixPrintVel class comes here */ + ... + #endif + +Where ``print/vel`` is the style name of your fix in the input script and +``FixPrintVel`` is the name of the class. The header file would be called +``fix_print_vel.h`` and the implementation file ``fix_print_vel.cpp``. +These conventions allow LAMMPS to automatically integrate it into the +executable when compiling and associate your new fix class with the designated +keyword when it parses the input script. + +Let's write a simple fix which will print the average velocity at the end +of each timestep. First of all, implement a constructor: + +.. code-block:: C++ + + FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg) + : Fix(lmp, narg, arg) + { + if (narg < 4) + error->all(FLERR,"Illegal fix print/vel command"); + + nevery = force->inumeric(FLERR,arg[3]); + if (nevery <= 0) + error->all(FLERR,"Illegal fix print/vel command"); + } + +In the constructor you should parse your fix arguments which are +specified in the script. All fixes have pretty the same syntax: +``fix ``. The +first 3 parameters are parsed by Fix base class constructor, while +```` should be parsed by you. In our case, we need to +specify how often we want to print an average velocity. For instance, +once in 50 timesteps: ``fix 1 print/vel 50``. There is a special variable +in the Fix class called ``nevery`` which specifies how often the method +``end_of_step()`` is called. Thus all we need to do is just set it up. + +The next method we need to implement is ``setmask()``: + +.. code-block:: C++ + + int FixPrintVel::setmask() + { + int mask = 0; + mask |= FixConst::END_OF_STEP; + return mask; + } + +Here the user specifies which methods of your fix should be called +during execution. The constant ``END_OF_STEP`` corresponds to the +``end_of_step()`` method. The most important available methods that +are called during a timestep and the order in which they are called +are shown in the previous section. + +.. code-block:: C++ + + void FixPrintVel::end_of_step() + { + // for add3, scale3 + using namespace MathExtra; + + double** v = atom->v; + int nlocal = atom->nlocal; + double localAvgVel[4]; // 4th element for particles count + memset(localAvgVel, 0, 4 * sizeof(double)); + for (int particleInd = 0; particleInd < nlocal; ++particleInd) { + add3(localAvgVel, v[particleInd], localAvgVel); + } + localAvgVel[3] = nlocal; + double globalAvgVel[4]; + memset(globalAvgVel, 0, 4 * sizeof(double)); + MPI_Allreduce(localAvgVel, globalAvgVel, 4, MPI_DOUBLE, MPI_SUM, world); + scale3(1.0 / globalAvgVel[3], globalAvgVel); + if ((comm->me == 0) && screen) { + fmt::print(screen,"{}, {}, {}\n", + globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]); + } + } + +In the code above, we use MathExtra routines defined in +``math_extra.h``. There are bunch of math functions to work with +arrays of doubles as with math vectors. It is also important to note +that LAMMPS code should always assume to be run in parallel and that +atom data is thus distributed across the MPI ranks. Thus you can +only process data from local atoms directly and need to use MPI library +calls to combine or exchange data. For serial execution, LAMMPS +comes bundled with the MPI STUBS library that contains the MPI library +function calls in dummy versions that only work for a single MPI rank. + +In this code we use an instance of Atom class. This object is stored +in the Pointers class (see ``pointers.h``) which is the base class of +the Fix base class. This object contains references to various class +instances (the original instances are created and held by the LAMMPS +class) with all global information about the simulation system. +Data from the Pointers class is available to all classes inherited from +it using protected inheritance. Hence when you write you own class, +which is going to use LAMMPS data, don't forget to inherit from Pointers +or pass an Pointer to it to all functions that need access. When writing +fixes we inherit from class Fix which is inherited from Pointers so +there is no need to inherit from it directly. + +The code above computes average velocity for all particles in the +simulation. Yet you have one unused parameter in fix call from the +script: ``group_name``. This parameter specifies the group of atoms +used in the fix. So we should compute average for all particles in the +simulation only if ``group_name == "all"``, but it can be any group. +The group membership information of an atom is contained in the *mask* +property of and atom and the bit corresponding to a given group is +stored in the groupbit variable which is defined in Fix base class: + +.. code-block:: C++ + + for (int i = 0; i < nlocal; ++i) { + if (atom->mask[i] & groupbit) { + // Do all job here + } + } + +Class Atom encapsulates atoms positions, velocities, forces, etc. User +can access them using particle index. Note, that particle indexes are +usually changed every few timesteps because of neighbor list rebuilds +and spatial sorting (to improve cache efficiency). + +Let us consider another Fix example: We want to have a fix which stores +atoms position from previous time step in your fix. The local atoms +indexes may not be valid on the next iteration. In order to handle +this situation there are several methods which should be implemented: + +- ``double memory_usage()``: return how much memory the fix uses (optional) +- ``void grow_arrays(int)``: do reallocation of the per particle arrays in your fix +- ``void copy_arrays(int i, int j, int delflag)``: copy i-th per-particle + information to j-th. Used when atom sorting is performed. if delflag is set + and atom j owns a body, move the body information to atom i. +- ``void set_arrays(int i)``: sets i-th particle related information to zero + +Note, that if your class implements these methods, it must call add calls of +add_callback and delete_callback to constructor and destructor. Since we want +to store positions of atoms from previous timestep, we need to add +``double** xold`` to the header file. Than add allocation code +to the constructor: + +.. code-block:: C++ + + FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg), xold(nullptr) + { + //... + memory->create(xold, atom->nmax, 3, "FixSavePos:x"); + atom->add_callback(0); + } + + FixSavePos::~FixSavePos() { + atom->delete_callback(id, 0); + memory->destroy(xold); + } + +Implement the aforementioned methods: + +.. code-block:: C++ + + double FixSavePos::memory_usage() + { + int nmax = atom->nmax; + double bytes = 0.0; + bytes += nmax * 3 * sizeof(double); + return bytes; + } + + void FixSavePos::grow_arrays(int nmax) + { + memory->grow(xold, nmax, 3, "FixSavePos:xold"); + } + + void FixSavePos::copy_arrays(int i, int j, int delflag) + { + memcpy(xold[j], xold[i], sizeof(double) * 3); + } + + void FixSavePos::set_arrays(int i) + { + memset(xold[i], 0, sizeof(double) * 3); + } + + int FixSavePos::pack_exchange(int i, double *buf) + { + int m = 0; + buf[m++] = xold[i][0]; + buf[m++] = xold[i][1]; + buf[m++] = xold[i][2]; + + return m; + } + + int FixSavePos::unpack_exchange(int nlocal, double *buf) + { + int m = 0; + xold[nlocal][0] = buf[m++]; + xold[nlocal][1] = buf[m++]; + xold[nlocal][2] = buf[m++]; + + return m; + } + +Now, a little bit about memory allocation. We use the Memory class which +is just a bunch of template functions for allocating 1D and 2D +arrays. So you need to add include ``memory.h`` to have access to them. + +Finally, if you need to write/read some global information used in +your fix to the restart file, you might do it by setting flag +``restart_global = 1`` in the constructor and implementing methods void +``write_restart(FILE *fp)`` and ``void restart(char *buf)``. +If, in addition, you want to write the per-atom property to restart +files additional settings and functions are needed: + +- a fix flag indicating this needs to be set ``restart_peratom = 1;`` +- ``atom->add_callback()`` and ``atom->delete_callback()`` must be called + a second time with the final argument set to 1 instead of 0 (indicating + restart processing instead of per-atom data memory management). +- the functions ``void pack_restart(int i, double *buf)`` and + ``void unpack_restart(int nlocal, int nth)`` need to be implemented + diff --git a/doc/src/Errors_bugs.rst b/doc/src/Errors_bugs.rst index ff0b155795..d2714c86b1 100644 --- a/doc/src/Errors_bugs.rst +++ b/doc/src/Errors_bugs.rst @@ -6,23 +6,25 @@ the steps outlined below: * Check the `New features and bug fixes `_ section of the `LAMMPS WWW site - `_ to see if the bug has already been addressed in a patch. + `_ or the + `GitHub Releases page `_ to + see if the bug has already been addressed in a patch release. * Check that your issue can be reproduced with the latest development version of LAMMPS. * Check the manual carefully to verify that the unexpected behavior you are observing is indeed in conflict with the documentation - * Check the `GitHub Issue page `_ + * Check the `GitHub Issue page `_ if your issue has already been reported and if it is still open. - * Check the `GitHub Pull Requests page `_ - if there is already a fix for your bug pending. + * Check the `GitHub Pull Requests page `_ + to see if there is already a fix for your bug pending. * Check the `mailing list archives `_ to see if the issue has been discussed before. If none of these steps yields any useful information, please file a new -bug report on the `GitHub Issue page `_. The website will offer -you to select a suitable template with explanations and then you should -replace those explanations with the information that you can provide to -reproduce your issue. +bug report on the `GitHub Issue page `_. +The website will offer you to select a suitable template with explanations +and then you should replace those explanations with the information that +you can provide to reproduce your issue. The most useful thing you can do to help us verify and fix a bug is to isolate the problem. Run it on the smallest number of atoms and fewest @@ -33,7 +35,7 @@ Please avoid using binary restart files unless the issue requires it. In the latter case you should also include an input deck to quickly generate this restart from a data file or a simple additional input. This input deck can be used with tools like a debugger or `valgrind -`_ to further :doc:`debug the crash `. +`_ to further :doc:`debug the crash `. You may also send an email to the LAMMPS mailing list at "lammps-users at lists.sourceforge.net" describing the problem with the @@ -44,6 +46,3 @@ is overlooked and then forgotten. Issues on GitHub have to be explicitly closed, so that will *guarantee* that at least one LAMMPS developer will have looked at it. -.. _lws: https://lammps.sandia.gov -.. _gip: https://github.com/lammps/issues -.. _valgrind: https://valgrind.org diff --git a/doc/src/Errors_common.rst b/doc/src/Errors_common.rst index 34567db385..4d4483efec 100644 --- a/doc/src/Errors_common.rst +++ b/doc/src/Errors_common.rst @@ -48,8 +48,10 @@ to see it on the screen. If you get an error like "Invalid ... style", with ... being fix, compute, pair, etc, it means that you mistyped the style name or that the command is part of an optional package which was not compiled into your executable. The list of -available styles in your executable can be listed by using :doc:`the -h command-line swith `. The installation and -compilation of optional packages is explained on the :doc:`Build packages ` doc page. +available styles in your executable can be listed by using +:doc:`the -h command-line switch `. The installation and +compilation of optional packages is explained on the +:doc:`Build packages ` doc page. For a given command, LAMMPS expects certain arguments in a specified order. If you mess this up, LAMMPS will often flag the error, but it diff --git a/doc/src/Errors_messages.rst b/doc/src/Errors_messages.rst index f3be94a239..aa38b3c0ba 100644 --- a/doc/src/Errors_messages.rst +++ b/doc/src/Errors_messages.rst @@ -502,10 +502,10 @@ Doc page with :doc:`WARNING messages ` *Bond/react: Unknown section in map file* Please ensure reaction map files are properly formatted. -*Bond/react: Atom affected by reaction too close to template edge* +*Bond/react: Atom/Bond type affected by reaction too close to template edge* This means an atom which changes type or connectivity during the reaction is too close to an 'edge' atom defined in the map - file. This could cause incorrect assignment of bonds, angle, etc. + file. This could cause incorrect assignment of bonds, angle, etc. Generally, this means you must include more atoms in your templates, such that there are at least two atoms between each atom involved in the reaction and an edge atom. @@ -1903,6 +1903,12 @@ Doc page with :doc:`WARNING messages ` *Compute %s does not allow use of dynamic group* Dynamic groups have not yet been enabled for this compute. +*Compute for fix pafi does not calculate a local array* + Self-explanatory. + +*Compute for fix pafi must have 9 fields per atom* + Self-explanatory. + *Compute ID for compute chunk /atom does not exist* Self-explanatory. @@ -2999,9 +3005,6 @@ Doc page with :doc:`WARNING messages ` *Dump image line requires atom style line* Self-explanatory. -*Dump image persp option is not yet supported* - Self-explanatory. - *Dump image requires one snapshot per file* Use a "\*" in the filename. @@ -5102,9 +5105,6 @@ Doc page with :doc:`WARNING messages ` The file produced by dump image cannot be binary and must be for a single processor. -*Invalid dump image persp value* - Persp value must be >= 0.0. - *Invalid dump image theta value* Theta must be between 0.0 and 180.0 inclusive. @@ -5702,6 +5702,9 @@ Doc page with :doc:`WARNING messages ` *Molecule file has dihedrals but no ndihedrals setting* Self-explanatory. +*Molecule file has fragments but no nfragments setting* + Self-explanatory. + *Molecule file has impropers but no nimpropers setting* Self-explanatory. @@ -5711,6 +5714,9 @@ Doc page with :doc:`WARNING messages ` *Molecule file has no Body Integers section* Self-explanatory. +*Molecule file has no Fragments section* + Self-explanatory. + *Molecule file has special flags but no bonds* Self-explanatory. @@ -8104,9 +8110,6 @@ keyword to allow for additional bonds to be formed *Variable for dump image center is invalid style* Must be an equal-style variable. -*Variable for dump image persp is invalid style* - Must be an equal-style variable. - *Variable for dump image phi is invalid style* Must be an equal-style variable. @@ -8247,9 +8250,6 @@ keyword to allow for additional bonds to be formed *Variable name for dump image center does not exist* Self-explanatory. -*Variable name for dump image persp does not exist* - Self-explanatory. - *Variable name for dump image phi does not exist* Self-explanatory. diff --git a/doc/src/Examples.rst b/doc/src/Examples.rst index dc122f2c78..8a76dca66e 100644 --- a/doc/src/Examples.rst +++ b/doc/src/Examples.rst @@ -27,7 +27,7 @@ be quickly post-processed into a movie using commands described on the :doc:`dump image ` doc page. Animations of many of the examples can be viewed on the Movies section -of the `LAMMPS web site `_. +of the `LAMMPS web site `_. There are two kinds of sub-directories in the examples folder. Lower case named directories contain one or a few simple, quick-to-run @@ -223,4 +223,3 @@ instructions. See the :doc:`Packages_details ` doc page for more info on specific USER packages. .. _openkim: https://openkim.org -.. _lws: https://lammps.sandia.gov diff --git a/doc/src/Fortran.rst b/doc/src/Fortran.rst new file mode 100644 index 0000000000..50738330d2 --- /dev/null +++ b/doc/src/Fortran.rst @@ -0,0 +1,202 @@ +The ``LIBLAMMPS`` Fortran Module +******************************** + +The ``LIBLAMMPS`` module provides an interface to call LAMMPS from a +Fortran code. It is based on the LAMMPS C-library interface and +requires a Fortran 2003 compatible compiler to be compiled. + +While C libraries have a defined binary interface (ABI) and can thus be +used from multiple compiler versions from different vendors for as long +as they are compatible with the hosting operating system, the same is +not true for Fortran codes. Thus the LAMMPS Fortran module needs to be +compiled alongside the code using it from the source code in +``fortran/lammps.f90``. When linking, you also need to +:doc:`link to the LAMMPS library `. A typical command line +for a simple program using the Fortran interface would be: + +.. code-block:: bash + + mpifort -o testlib.x lammps.f90 testlib.f90 -L. -llammps + +Please note, that the MPI compiler wrapper is only required when the +calling the library from an MPI parallel code. Please also note the order +of the source files: the lammps.f90 file needs to be compiled first, +since it provides the ``LIBLAMMPS`` module that is imported by the +Fortran code using the interface. + +.. versionadded:: 30Sep2020 + +.. admonition:: Work in Progress + + This Fortran module is work in progress and only the documented + functionality is currently available. The final implementation should + cover the entire range of functionality available in the C and + Python library interfaces. + +---------- + +Creating or deleting a LAMMPS object +************************************ + +With the Fortran interface the creation of a :cpp:class:`LAMMPS +` instance is included in the constructor for +creating the :f:func:`lammps` derived type. To import the definition of +that type and its type bound procedures you need to add a ``USE +LIBLAMMPS`` statement. Internally it will call either +:cpp:func:`lammps_open_fortran` or :cpp:func:`lammps_open_no_mpi` from +the C library API to create the class instance. All arguments are +optional and :cpp:func:`lammps_mpi_init` will be called automatically, +if it is needed. Similarly, a possible call to :cpp:func:`lammps_finalize` +is integrated into the :f:func:`close` function and triggered with +the optional logical argument set to ``.true.``. Here is a simple example: + +.. code-block:: fortran + + PROGRAM testlib + USE LIBLAMMPS ! include the LAMMPS library interface + TYPE(lammps) :: lmp ! derived type to hold LAMMPS instance + CHARACTER(len=*), DIMENSION(*), PARAMETER :: args = & + [ CHARACTER(len=12) :: 'liblammps', '-log', 'none' ] + + ! create a LAMMPS instance (and initialize MPI) + lmp = lammps(args) + ! get and print numerical version code + PRINT*, 'LAMMPS Version: ', lmp%version() + ! delete LAMMPS instance (and shuts down MPI) + CALL lmp%close(.true.) + + END PROGRAM testlib + +-------------------- + +Executing LAMMPS commands +========================= + +Once a LAMMPS instance is created, it is possible to "drive" the LAMMPS +simulation by telling LAMMPS to read commands from a file, or pass +individual or multiple commands from strings or lists of strings. This +is done similar to how it is implemented in the `C-library +` interface. Before handing off the calls to the +C-library interface, the corresponding Fortran versions of the calls +(:f:func:`file`, :f:func:`command`, :f:func:`commands_list`, and +:f:func:`commands_string`) have to make a copy of the strings passed as +arguments so that they can be modified to be compatible with the +requirements of strings in C without affecting the original strings. +Those copies are automatically deleted after the functions return. +Below is a small demonstration of the uses of the different functions: + +.. code-block:: fortran + + PROGRAM testcmd + USE LIBLAMMPS + TYPE(lammps) :: lmp + CHARACTER(len=512) :: cmds + CHARACTER(len=40),ALLOCATABLE :: cmdlist(:) + CHARACTER(len=10) :: trimmed + INTEGER :: i + + lmp = lammps() + CALL lmp%file('in.melt') + CALL lmp%command('variable zpos index 1.0') + ! define 10 groups of 10 atoms each + ALLOCATE(cmdlist(10)) + DO i=1,10 + WRITE(trimmed,'(I10)') 10*i + WRITE(cmdlist(i),'(A,I1,A,I10,A,A)') & + 'group g',i-1,' id ',10*(i-1)+1,':',ADJUSTL(trimmed) + END DO + CALL lmp%commands_list(cmdlist) + ! run multiple commands from multi-line string + cmds = 'clear' // NEW_LINE('A') // & + 'region box block 0 2 0 2 0 2' // NEW_LINE('A') // & + 'create_box 1 box' // NEW_LINE('A') // & + 'create_atoms 1 single 1.0 1.0 ${zpos}' + CALL lmp%commands_string(cmds) + CALL lmp%close() + + END PROGRAM testcmd + +--------------- + +The ``LIBLAMMPS`` module API +**************************** + +Below are the detailed descriptions of definitions and interfaces +of the contents of the ``LIBLAMMPS`` Fortran interface to LAMMPS. + +.. f:type:: lammps + + Derived type that is the general class of the Fortran interface. + It holds a reference to the :cpp:class:`LAMMPS ` class instance + that any of the included calls are forwarded to. + + :f c_ptr handle: reference to the LAMMPS class + :f close: :f:func:`close` + :f version: :f:func:`version` + :f file: :f:func:`file` + :f command: :f:func:`command` + :f commands_list: :f:func:`commands_list` + :f commands_string: :f:func:`commands_string` + +.. f:function:: lammps(args[,comm]) + + This is the constructor for the Fortran class and will forward + the arguments to a call to either :cpp:func:`lammps_open_fortran` + or :cpp:func:`lammps_open_no_mpi`. If the LAMMPS library has been + compiled with MPI support, it will also initialize MPI, if it has + not already been initialized before. + + The *args* argument with the list of command line parameters is + optional and so it the *comm* argument with the MPI communicator. + If *comm* is not provided, ``MPI_COMM_WORLD`` is assumed. For + more details please see the documentation of :cpp:func:`lammps_open`. + + :p character(len=*) args(*) [optional]: arguments as list of strings + :o integer comm [optional]: MPI communicator + :r lammps: an instance of the :f:type:`lammps` derived type + +.. f:subroutine:: close([finalize]) + + This method will close down the LAMMPS instance through calling + :cpp:func:`lammps_close`. If the *finalize* argument is present and + has a value of ``.true.``, then this subroutine also calls + :cpp:func:`lammps_mpi_finalize`. + + :o logical finalize [optional]: shut down the MPI environment of the LAMMPS library if true. + +.. f:function:: version() + + This method returns the numeric LAMMPS version like :cpp:func:`lammps_version` + + :r integer: LAMMPS version + +-------- + +.. f:subroutine:: file(filename) + + This method will call :cpp:func:`lammps_file` to have LAMMPS read + and process commands from a file. + + :p character(len=*) filename: name of file with LAMMPS commands + +.. f:subroutine:: command(cmd) + + This method will call :cpp:func:`lammps_command` to have LAMMPS + execute a single command. + + :p character(len=*) cmd: single LAMMPS command + +.. f:subroutine:: commands_list(cmds) + + This method will call :cpp:func:`lammps_commands_list` to have LAMMPS + execute a list of input lines. + + :p character(len=*) cmd(*): list of LAMMPS input lines + +.. f:subroutine:: commands_string(str) + + This method will call :cpp:func:`lammps_commands_string` to have LAMMPS + execute a block of commands from a string. + + :p character(len=*) str: LAMMPS input in string + diff --git a/doc/src/Howto.rst b/doc/src/Howto.rst index 89c0ce9ffe..ff75b751b1 100644 --- a/doc/src/Howto.rst +++ b/doc/src/Howto.rst @@ -3,24 +3,12 @@ Howto discussions These doc pages describe how to perform various tasks with LAMMPS, both for users and developers. The -`glossary `_ website page also lists MD +`glossary `_ website page also lists MD terminology with links to corresponding LAMMPS manual pages. The example input scripts included in the examples directory of the LAMMPS distribution and highlighted on the :doc:`Examples ` doc page also show how to setup and run various kinds of simulations. -Tutorials howto -=============== - -.. toctree:: - :name: tutorials - :maxdepth: 1 - - Howto_cmake - Howto_github - Howto_pylammps - Howto_wsl - General howto ============= @@ -94,3 +82,16 @@ Packages howto Howto_drude2 Howto_manifold Howto_spins + +Tutorials howto +=============== + +.. toctree:: + :name: tutorials + :maxdepth: 1 + + Howto_cmake + Howto_github + Howto_pylammps + Howto_wsl + diff --git a/doc/src/Howto_2d.rst b/doc/src/Howto_2d.rst index 1b4be32106..9cf76ac3b0 100644 --- a/doc/src/Howto_2d.rst +++ b/doc/src/Howto_2d.rst @@ -6,14 +6,14 @@ Use the :doc:`dimension ` command to specify a 2d simulation. Make the simulation box periodic in z via the :doc:`boundary ` command. This is the default. -If using the :doc:`create box ` command to define a +If using the :doc:`create_box ` command to define a simulation box, set the z dimensions narrow, but finite, so that the -create_atoms command will tile the 3d simulation box with a single z -plane of atoms - e.g. +:doc:`create_atoms ` command will fill the 3d simulation +box with a single z plane of atoms - e.g. .. code-block:: LAMMPS - :doc:`create box ` 1 -10 10 -10 10 -0.25 0.25 + create box 1 -10 10 -10 10 -0.25 0.25 If using the :doc:`read data ` command to read in a file of atom coordinates, set the "zlo zhi" values to be finite but narrow, diff --git a/doc/src/Howto_body.rst b/doc/src/Howto_body.rst index 36e40a88bd..0c0a930221 100644 --- a/doc/src/Howto_body.rst +++ b/doc/src/Howto_body.rst @@ -32,9 +32,9 @@ thus how they can be used to compute pairwise body/body or bond/non-body (point particle) interactions. More details of each style are described below. -More styles may be added in the future. See the :doc:`Modify body -` doc page for details on how to add a new body style to -the code. +More styles may be added in the future. See the +:doc:`page on creating new body styles ` for details on +how to add a new body style to the code. ---------- diff --git a/doc/src/Howto_chunk.rst b/doc/src/Howto_chunk.rst index 75fb30815b..c0a7792448 100644 --- a/doc/src/Howto_chunk.rst +++ b/doc/src/Howto_chunk.rst @@ -198,7 +198,8 @@ explained on the :doc:`compute chunk/spread/atom ` co (7) An example for using one set of per-chunk values for molecule chunks, to create a second set of micelle-scale chunks (clustered -molecules, due to hydrophobicity), is explained on the :doc:`compute chunk/reduce ` command doc page. +molecules, due to hydrophobicity), is explained on the +:doc:`compute reduce/chunk ` command doc page. (8) An example for using one set of per-chunk values (dipole moment vectors) for molecule chunks, spreading the values to each atom in diff --git a/doc/src/Howto_cmake.rst b/doc/src/Howto_cmake.rst index afea5fea1d..30d71edd87 100644 --- a/doc/src/Howto_cmake.rst +++ b/doc/src/Howto_cmake.rst @@ -191,19 +191,19 @@ You start the command ``ccmake ../cmake`` in the ``build`` folder. .. list-table:: * - .. figure:: JPG/ccmake-initial.png - :target: JPG/ccmake-initial.png + :scale: 33% :align: center Initial ``ccmake`` screen - .. figure:: JPG/ccmake-config.png - :target: JPG/ccmake-config.png + :scale: 33% :align: center Configure output of ``ccmake`` - .. figure:: JPG/ccmake-options.png - :target: JPG/ccmake-options.png + :scale: 33% :align: center Options screen of ``ccmake`` @@ -236,19 +236,19 @@ not required, it can also be entered from the GUI. .. list-table:: * - .. figure:: JPG/cmake-gui-initial.png - :target: JPG/cmake-gui-initial.png + :scale: 40% :align: center Initial ``cmake-gui`` screen - .. figure:: JPG/cmake-gui-popup.png - :target: JPG/cmake-gui-popup.png + :scale: 60% :align: center Generator selection in ``cmake-gui`` - .. figure:: JPG/cmake-gui-options.png - :target: JPG/cmake-gui-options.png + :scale: 40% :align: center Options screen of ``cmake-gui`` @@ -328,6 +328,8 @@ Some common LAMMPS specific variables - build LAMMPS with OpenMP support (default: ``on`` if compiler supports OpenMP fully, else ``off``) * - ``BUILD_TOOLS`` - compile some additional executables from the ``tools`` folder (default: ``off``) + * - ``BUILD_LAMMPS_SHELL`` + - compile the LAMMPS shell from the ``tools/lammps-shell`` folder (default: ``off``) * - ``BUILD_DOC`` - include building the HTML format documentation for packaging/installing (default: ``off``) * - ``CMAKE_TUNE_FLAGS`` diff --git a/doc/src/Howto_couple.rst b/doc/src/Howto_couple.rst index c652d4f599..36ba2a526e 100644 --- a/doc/src/Howto_couple.rst +++ b/doc/src/Howto_couple.rst @@ -12,96 +12,52 @@ LAMMPS can be coupled to other codes in at least 4 ways. Each has advantages and disadvantages, which you will have to think about in the context of your application. ----------- +1. Define a new :doc:`fix ` command that calls the other code. In + this scenario, LAMMPS is the driver code. During timestepping, + the fix is invoked, and can make library calls to the other code, + which has been linked to LAMMPS as a library. This is the way how the + :ref:`LATTE ` package, which performs density-functional + tight-binding calculations using the `LATTE software `_ + to compute forces, is hooked to LAMMPS. + See the :doc:`fix latte ` command for more details. + Also see the :doc:`Modify ` doc pages for info on how to + add a new fix to LAMMPS. -(1) Define a new :doc:`fix ` command that calls the other code. In -this scenario, LAMMPS is the driver code. During its timestepping, -the fix is invoked, and can make library calls to the other code, -which has been linked to LAMMPS as a library. This is the way the -`POEMS `_ package that performs constrained rigid-body motion on -groups of atoms is hooked to LAMMPS. See the :doc:`fix poems ` command for more details. See the -:doc:`Modify ` doc pages for info on how to add a new fix to -LAMMPS. +.. spacer -.. _poems: http://www.rpi.edu/~anderk5/lab +2. Define a new LAMMPS command that calls the other code. This is + conceptually similar to method (1), but in this case LAMMPS and the + other code are on a more equal footing. Note that now the other code + is not called during the timestepping of a LAMMPS run, but between + runs. The LAMMPS input script can be used to alternate LAMMPS runs + with calls to the other code, invoked via the new command. The + :doc:`run ` command facilitates this with its *every* option, + which makes it easy to run a few steps, invoke the command, run a few + steps, invoke the command, etc. ----------- + In this scenario, the other code can be called as a library, as in + 1., or it could be a stand-alone code, invoked by a system() call + made by the command (assuming your parallel machine allows one or + more processors to start up another program). In the latter case the + stand-alone code could communicate with LAMMPS through files that the + command writes and reads. -(2) Define a new LAMMPS command that calls the other code. This is -conceptually similar to method (1), but in this case LAMMPS and the -other code are on a more equal footing. Note that now the other code -is not called during the timestepping of a LAMMPS run, but between -runs. The LAMMPS input script can be used to alternate LAMMPS runs -with calls to the other code, invoked via the new command. The -:doc:`run ` command facilitates this with its *every* option, which -makes it easy to run a few steps, invoke the command, run a few steps, -invoke the command, etc. + See the :doc:`Modify command ` doc page for info on how + to add a new command to LAMMPS. -In this scenario, the other code can be called as a library, as in -(1), or it could be a stand-alone code, invoked by a system() call -made by the command (assuming your parallel machine allows one or more -processors to start up another program). In the latter case the -stand-alone code could communicate with LAMMPS through files that the -command writes and reads. +.. spacer -See the :doc:`Modify command ` doc page for info on how -to add a new command to LAMMPS. +3. Use LAMMPS as a library called by another code. In this case the + other code is the driver and calls LAMMPS as needed. Or a wrapper + code could link and call both LAMMPS and another code as libraries. + Again, the :doc:`run ` command has options that allow it to be + invoked with minimal overhead (no setup or clean-up) if you wish to + do multiple short runs, driven by another program. Details about + using the library interface are given in the :doc:`library API + ` documentation. ----------- +.. spacer -(3) Use LAMMPS as a library called by another code. In this case the -other code is the driver and calls LAMMPS as needed. Or a wrapper -code could link and call both LAMMPS and another code as libraries. -Again, the :doc:`run ` command has options that allow it to be -invoked with minimal overhead (no setup or clean-up) if you wish to do -multiple short runs, driven by another program. - -Examples of driver codes that call LAMMPS as a library are included in -the examples/COUPLE directory of the LAMMPS distribution; see -examples/COUPLE/README for more details: - -* simple: simple driver programs in C++ and C which invoke LAMMPS as a - library -* plugin: simple driver program in C which invokes LAMMPS as a plugin - from a shared library. -* lammps_quest: coupling of LAMMPS and `Quest `_, to run classical - MD with quantum forces calculated by a density functional code -* lammps_spparks: coupling of LAMMPS and `SPPARKS `_, to couple - a kinetic Monte Carlo model for grain growth using MD to calculate - strain induced across grain boundaries - -.. _quest: http://dft.sandia.gov/Quest - -.. _spparks: http://www.sandia.gov/~sjplimp/spparks.html - -The :doc:`Build basics ` doc page describes how to build -LAMMPS as a library. Once this is done, you can interface with LAMMPS -either via C++, C, Fortran, or Python (or any other language that -supports a vanilla C-like interface). For example, from C++ you could -create one (or more) "instances" of LAMMPS, pass it an input script to -process, or execute individual commands, all by invoking the correct -class methods in LAMMPS. From C or Fortran you can make function -calls to do the same things. See the :doc:`Python ` doc -pages for a description of the Python wrapper provided with LAMMPS -that operates through the LAMMPS library interface. - -The files src/library.cpp and library.h contain the C-style interface -to LAMMPS. See the :doc:`Howto library ` doc page for a -description of the interface and how to extend it for your needs. - -Note that the lammps_open() function that creates an instance of -LAMMPS takes an MPI communicator as an argument. This means that -instance of LAMMPS will run on the set of processors in the -communicator. Thus the calling code can run LAMMPS on all or a subset -of processors. For example, a wrapper script might decide to -alternate between LAMMPS and another code, allowing them both to run -on all the processors. Or it might allocate half the processors to -LAMMPS and half to the other code and run both codes simultaneously -before syncing them up periodically. Or it might instantiate multiple -instances of LAMMPS to perform different calculations. - ----------- - -(4) Couple LAMMPS with another code in a client/server mode. This is -described on the :doc:`Howto client/server ` doc -page. +4. Couple LAMMPS with another code in a client/server mode. This is + described on the :doc:`Howto client/server ` doc + page. diff --git a/doc/src/Howto_drude.rst b/doc/src/Howto_drude.rst index 62659711c4..c866340e77 100644 --- a/doc/src/Howto_drude.rst +++ b/doc/src/Howto_drude.rst @@ -29,7 +29,7 @@ molecular systems (:ref:`Lamoureux and Roux `): to the total charge of the core atom). A detailed tutorial covering the usage of Drude induced dipoles in -LAMMPS is on the :doc:`Howto drude2e ` doc page. +LAMMPS is on the :doc:`here `. As with the core-shell model, the cores and Drude particles should appear in the data file as standard atoms. The same holds for the diff --git a/doc/src/Howto_drude2.rst b/doc/src/Howto_drude2.rst index cbdbc2d250..3dacf99dec 100644 --- a/doc/src/Howto_drude2.rst +++ b/doc/src/Howto_drude2.rst @@ -377,7 +377,7 @@ For our phenol example, the groups would be defined as Note that with the fixes *drude/transform*\ , it is not required to specify *comm_modify vel yes* because the fixes do it anyway (several times and for the forces also). To avoid the flying ice cube artifact -:ref:`(Lamoureux) `, where the atoms progressively freeze and the +:ref:`(Lamoureux and Roux) `, where the atoms progressively freeze and the center of mass of the whole system drifts faster and faster, the *fix momentum* can be used. For instance: @@ -456,7 +456,7 @@ NPT ensemble using Nose-Hoover thermostat: .. _Lamoureux2: -**(Lamoureux)** Lamoureux and Roux, J Chem Phys, 119, 3025-3039 (2003) +**(Lamoureux and Roux)** Lamoureux and Roux, J Chem Phys, 119, 3025-3039 (2003) .. _Schroeder: diff --git a/doc/src/Howto_github.rst b/doc/src/Howto_github.rst index 795af96e0a..63cb8945e8 100644 --- a/doc/src/Howto_github.rst +++ b/doc/src/Howto_github.rst @@ -20,7 +20,7 @@ work required by the LAMMPS developers. Consequently, creating a pull request will increase your chances to have your contribution included and will reduce the time until the integration is complete. For more information on the requirements to have your code included into LAMMPS -please see the :doc:`Modify contribute ` doc page. +please see :doc:`this page `. ---------- diff --git a/doc/src/Howto_library.rst b/doc/src/Howto_library.rst index 774d9838c1..36d6626c59 100644 --- a/doc/src/Howto_library.rst +++ b/doc/src/Howto_library.rst @@ -2,241 +2,36 @@ Library interface to LAMMPS =========================== As described on the :doc:`Build basics ` doc page, LAMMPS -can be built as a library, so that it can be called by another code, -used in a :doc:`coupled manner ` with other codes, or -driven through a :doc:`Python interface `. +can be built as a static or shared library, so that it can be called by +another code, used in a :doc:`coupled manner ` with other +codes, or driven through a :doc:`Python interface `. -All of these methodologies use a C-style interface to LAMMPS that is -provided in the files src/library.cpp and src/library.h. The -functions therein have a C-style argument list, but contain C++ code -you could write yourself in a C++ application that was invoking LAMMPS -directly. The C++ code in the functions illustrates how to invoke -internal LAMMPS operations. Note that LAMMPS classes are defined -within a LAMMPS namespace (LAMMPS_NS) if you use them from another C++ -application. +At the core of LAMMPS is the ``LAMMPS`` class which encapsulates the +state of the simulation program through the state of the various class +instances that it is composed of. So a calculation using LAMMPS +requires to create an instance of the ``LAMMPS`` class and then send it +(text) commands, either individually or from a file, or perform other +operations that modify the state stored inside that instance or drive +simulations. This is essentially what the ``src/main.cpp`` file does +as well for the standalone LAMMPS executable with reading commands +either from an input file or stdin. -The examples/COUPLE and python/examples directories have example C++ -and C and Python codes which show how a driver code can link to LAMMPS -as a library, run LAMMPS on a subset of processors, grab data from -LAMMPS, change it, and put it back into LAMMPS. +Creating a LAMMPS instance can be done by using C++ code directly or +through a C-style interface library to LAMMPS that is provided in the +files ``src/library.cpp`` and ``library.h``. This +:ref:`C language API `, can be used from C and C++, +and is also the basis for the :doc:`Python ` and +:doc:`Fortran ` interfaces or wrappers included in the +LAMMPS source code. -Thread-safety -------------- +The ``examples/COUPLE`` and ``python/examples`` directories contain some +example programs written in C++, C, Fortran, and Python, which show how +a driver code can link to LAMMPS as a library, run LAMMPS on a subset of +processors (so the others are available to run some other code +concurrently), grab data from LAMMPS, change it, and send it back into +LAMMPS. -LAMMPS has not initially been conceived as a thread-safe program, but -over the years changes have been applied to replace operations that -collide with creating multiple LAMMPS instances from multiple-threads -of the same process with thread-safe alternatives. This primarily -applies to the core LAMMPS code and less so on add-on packages, especially -when those packages require additional code in the *lib* folder, -interface LAMMPS to Fortran libraries, or the code uses static variables -(like the USER-COLVARS package. +A detailed documentation of the available APIs and examples of how to +use them can be found in the :doc:`Programmer Documentation +` section of this manual. -Another major issue to deal with is to correctly handle MPI. Creating -a LAMMPS instance requires passing an MPI communicator, or it assumes -the MPI_COMM_WORLD communicator, which spans all MPI processor ranks. -When creating multiple LAMMPS object instances from different threads, -this communicator has to be different for each thread or else collisions -can happen, or it has to be guaranteed, that only one thread at a time -is active. MPI communicators, however, are not a problem, if LAMMPS is -compiled with the MPI STUBS library, which implies that there is no MPI -communication and only 1 MPI rank. - -Provided APIs -------------- - -The file src/library.cpp contains the following functions for creating -and destroying an instance of LAMMPS and sending it commands to -execute. See the documentation in the src/library.cpp file for -details. - -.. note:: - - You can write code for additional functions as needed to define - how your code talks to LAMMPS and add them to src/library.cpp and - src/library.h, as well as to the :doc:`Python interface `. - The added functions can access or change any internal LAMMPS data you - wish. - -.. code-block:: c - - void lammps_open(int, char **, MPI_Comm, void **) - void lammps_open_no_mpi(int, char **, void **) - void lammps_close(void *) - int lammps_version(void *) - void lammps_file(void *, char *) - char *lammps_command(void *, char *) - void lammps_commands_list(void *, int, char **) - void lammps_commands_string(void *, char *) - void lammps_free(void *) - -The lammps_open() function is used to initialize LAMMPS, passing in a -list of strings as if they were :doc:`command-line arguments ` when LAMMPS is run in stand-alone mode -from the command line, and a MPI communicator for LAMMPS to run under. -It returns a ptr to the LAMMPS object that is created, and which is -used in subsequent library calls. The lammps_open() function can be -called multiple times, to create multiple instances of LAMMPS. - -LAMMPS will run on the set of processors in the communicator. This -means the calling code can run LAMMPS on all or a subset of -processors. For example, a wrapper script might decide to alternate -between LAMMPS and another code, allowing them both to run on all the -processors. Or it might allocate half the processors to LAMMPS and -half to the other code and run both codes simultaneously before -syncing them up periodically. Or it might instantiate multiple -instances of LAMMPS to perform different calculations. - -The lammps_open_no_mpi() function is similar except that no MPI -communicator is passed from the caller. Instead, MPI_COMM_WORLD is -used to instantiate LAMMPS, and MPI is initialized if necessary. - -The lammps_close() function is used to shut down an instance of LAMMPS -and free all its memory. - -The lammps_version() function can be used to determined the specific -version of the underlying LAMMPS code. This is particularly useful -when loading LAMMPS as a shared library via dlopen(). The code using -the library interface can than use this information to adapt to -changes to the LAMMPS command syntax between versions. The returned -LAMMPS version code is an integer (e.g. 2 Sep 2015 results in -20150902) that grows with every new LAMMPS version. - -The lammps_file(), lammps_command(), lammps_commands_list(), and -lammps_commands_string() functions are used to pass one or more -commands to LAMMPS to execute, the same as if they were coming from an -input script. - -Via these functions, the calling code can read or generate a series of -LAMMPS commands one or multiple at a time and pass it through the library -interface to setup a problem and then run it in stages. The caller -can interleave the command function calls with operations it performs, -calls to extract information from or set information within LAMMPS, or -calls to another code's library. - -The lammps_file() function passes the filename of an input script. -The lammps_command() function passes a single command as a string. -The lammps_commands_list() function passes multiple commands in a -char\*\* list. In both lammps_command() and lammps_commands_list(), -individual commands may or may not have a trailing newline. The -lammps_commands_string() function passes multiple commands -concatenated into one long string, separated by newline characters. -In both lammps_commands_list() and lammps_commands_string(), a single -command can be spread across multiple lines, if the last printable -character of all but the last line is "&", the same as if the lines -appeared in an input script. - -The lammps_free() function is a clean-up function to free memory that -the library allocated previously via other function calls. See -comments in src/library.cpp file for which other functions need this -clean-up. - -The file src/library.cpp also contains these functions for extracting -information from LAMMPS and setting value within LAMMPS. Again, see -the documentation in the src/library.cpp file for details, including -which quantities can be queried by name: - -.. code-block:: c - - int lammps_extract_setting(void *, char *) - void *lammps_extract_global(void *, char *) - void lammps_extract_box(void *, double *, double *, - double *, double *, double *, int *, int *) - void *lammps_extract_atom(void *, char *) - void *lammps_extract_compute(void *, char *, int, int) - void *lammps_extract_fix(void *, char *, int, int, int, int) - void *lammps_extract_variable(void *, char *, char *) - -The extract_setting() function returns info on the size -of data types (e.g. 32-bit or 64-bit atom IDs) used -by the LAMMPS executable (a compile-time choice). - -The other extract functions return a pointer to various global or -per-atom quantities stored in LAMMPS or to values calculated by a -compute, fix, or variable. The pointer returned by the -extract_global() function can be used as a permanent reference to a -value which may change. For the extract_atom() method, see the -extract() method in the src/atom.cpp file for a list of valid per-atom -properties. New names could easily be added if the property you want -is not listed. For the other extract functions, the underlying -storage may be reallocated as LAMMPS runs, so you need to re-call the -function to assure a current pointer or returned value(s). - -.. code-block:: c - - double lammps_get_thermo(void *, char *) - int lammps_get_natoms(void *) - - int lammps_set_variable(void *, char *, char *) - void lammps_reset_box(void *, double *, double *, double, double, double) - -The lammps_get_thermo() function returns the current value of a thermo -keyword as a double precision value. - -The lammps_get_natoms() function returns the total number of atoms in -the system and can be used by the caller to allocate memory for the -lammps_gather_atoms() and lammps_scatter_atoms() functions. - -The lammps_set_variable() function can set an existing string-style -variable to a new string value, so that subsequent LAMMPS commands can -access the variable. - -The lammps_reset_box() function resets the size and shape of the -simulation box, e.g. as part of restoring a previously extracted and -saved state of a simulation. - -.. code-block:: c - - void lammps_gather_atoms(void *, char *, int, int, void *) - void lammps_gather_atoms_concat(void *, char *, int, int, void *) - void lammps_gather_atoms_subset(void *, char *, int, int, int, int *, void *) - void lammps_scatter_atoms(void *, char *, int, int, void *) - void lammps_scatter_atoms_subset(void *, char *, int, int, int, int *, void *) - -The gather functions collect peratom info of the requested type (atom -coords, atom types, forces, etc) from all processors, and returns the -same vector of values to each calling processor. The scatter -functions do the inverse. They distribute a vector of peratom values, -passed by all calling processors, to individual atoms, which may be -owned by different processors. - -.. warning:: - - These functions are not compatible with the - -DLAMMPS_BIGBIG setting when compiling LAMMPS. Dummy functions - that result in an error message and abort will be substituted - instead of resulting in random crashes and memory corruption. - -The lammps_gather_atoms() function does this for all N atoms in the -system, ordered by atom ID, from 1 to N. The -lammps_gather_atoms_concat() function does it for all N atoms, but -simply concatenates the subset of atoms owned by each processor. The -resulting vector is not ordered by atom ID. Atom IDs can be requested -by the same function if the caller needs to know the ordering. The -lammps_gather_subset() function allows the caller to request values -for only a subset of atoms (identified by ID). -For all 3 gather function, per-atom image flags can be retrieved in 2 ways. -If the count is specified as 1, they are returned -in a packed format with all three image flags stored in a single integer. -If the count is specified as 3, the values are unpacked into xyz flags -by the library before returning them. - -The lammps_scatter_atoms() function takes a list of values for all N -atoms in the system, ordered by atom ID, from 1 to N, and assigns -those values to each atom in the system. The -lammps_scatter_atoms_subset() function takes a subset of IDs as an -argument and only scatters those values to the owning atoms. - -.. code-block:: c - - void lammps_create_atoms(void *, int, tagint *, int *, double *, double *, - imageint *, int) - -The lammps_create_atoms() function takes a list of N atoms as input -with atom types and coords (required), an optionally atom IDs and -velocities and image flags. It uses the coords of each atom to assign -it as a new atom to the processor that owns it. This function is -useful to add atoms to a simulation or (in tandem with -lammps_reset_box()) to restore a previously extracted and saved state -of a simulation. Additional properties for the new atoms can then be -assigned via the lammps_scatter_atoms() or lammps_extract_atom() -functions. diff --git a/doc/src/Howto_spherical.rst b/doc/src/Howto_spherical.rst index 7ca8a1b060..aa17e6ce21 100644 --- a/doc/src/Howto_spherical.rst +++ b/doc/src/Howto_spherical.rst @@ -114,7 +114,7 @@ will only rotate and experience torque if the force field computes such interactions. These are the various :doc:`pair styles ` that generate torque: * :doc:`pair_style gran/history ` -* :doc:`pair_style gran/hertzian ` +* :doc:`pair_style gran/hertz ` * :doc:`pair_style gran/no_history ` * :doc:`pair_style dipole/cut ` * :doc:`pair_style gayberne ` diff --git a/doc/src/Howto_thermostat.rst b/doc/src/Howto_thermostat.rst index 77745efa57..7bddb1c89d 100644 --- a/doc/src/Howto_thermostat.rst +++ b/doc/src/Howto_thermostat.rst @@ -42,12 +42,12 @@ particles. DPD thermostatting alters pairwise interactions in a manner analogous to the per-particle thermostatting of :doc:`fix langevin `. -Any of the thermostatting fixes can use :doc:`temperature computes ` that remove bias which has two -effects. First, the current calculated temperature, which is compared -to the requested target temperature, is calculated with the velocity -bias removed. Second, the thermostat adjusts only the thermal -temperature component of the particle's velocities, which are the -velocities with the bias removed. The removed bias is then added back +Any of the thermostatting fixes can be instructed to use custom temperature +computes that remove bias which has two effects: first, the current +calculated temperature, which is compared to the requested target temperature, +is calculated with the velocity bias removed; second, the thermostat adjusts +only the thermal temperature component of the particle's velocities, which are +the velocities with the bias removed. The removed bias is then added back to the adjusted velocities. See the doc pages for the individual fixes and for the :doc:`fix_modify ` command for instructions on how to assign a temperature compute to a @@ -55,7 +55,24 @@ thermostatting fix. For example, you can apply a thermostat to only the x and z components of velocity by using it in conjunction with :doc:`compute temp/partial `. Of you could thermostat only the thermal temperature of a streaming flow of -particles without affecting the streaming velocity, by using :doc:`compute temp/profile `. +particles without affecting the streaming velocity, by using +:doc:`compute temp/profile `. + +Below is a list of some custom temperature computes that can be used like that: + +* :doc:`compute_temp_asphere` +* :doc:`compute_temp_body` +* :doc:`compute_temp_chunk` +* :doc:`compute_temp_com` +* :doc:`compute_temp_deform` +* :doc:`compute_temp_partial` +* :doc:`compute_temp_profile` +* :doc:`compute_temp_ramp` +* :doc:`compute_temp_region` +* :doc:`compute_temp_rotate` +* :doc:`compute_temp_sphere` + + .. note:: diff --git a/doc/src/Howto_viscosity.rst b/doc/src/Howto_viscosity.rst index 8c7eb91b12..cfe9497665 100644 --- a/doc/src/Howto_viscosity.rst +++ b/doc/src/Howto_viscosity.rst @@ -5,8 +5,8 @@ The shear viscosity eta of a fluid can be measured in at least 6 ways using various options in LAMMPS. See the examples/VISCOSITY directory for scripts that implement the 5 methods discussed here for a simple Lennard-Jones fluid model and 1 method for SPC/E water model. -Also, see the :doc:`Howto kappa ` doc page for an analogous discussion for -thermal conductivity. +Also, see the :doc:`page on calculating thermal conductivity ` +for an analogous discussion for thermal conductivity. Eta is a measure of the propensity of a fluid to transmit momentum in a direction perpendicular to the direction of velocity or momentum diff --git a/doc/src/Install.rst b/doc/src/Install.rst index 03a1551686..29e19767b2 100644 --- a/doc/src/Install.rst +++ b/doc/src/Install.rst @@ -23,7 +23,7 @@ need the source code. These are the files and sub-directories in the LAMMPS distribution: +------------+-------------------------------------------+ -| README | text file | +| README | Short description of the LAMMPS package | +------------+-------------------------------------------+ | LICENSE | GNU General Public License (GPL) | +------------+-------------------------------------------+ @@ -35,16 +35,20 @@ These are the files and sub-directories in the LAMMPS distribution: +------------+-------------------------------------------+ | examples | simple test problems | +------------+-------------------------------------------+ +| fortran | Fortran wrapper for LAMMPS | ++------------+-------------------------------------------+ | lib | additional provided or external libraries | +------------+-------------------------------------------+ | potentials | interatomic potential files | +------------+-------------------------------------------+ -| python | Python wrapper on LAMMPS | +| python | Python wrappers for LAMMPS | +------------+-------------------------------------------+ | src | source files | +------------+-------------------------------------------+ | tools | pre- and post-processing tools | +------------+-------------------------------------------+ +| unittest | sources and inputs for testing LAMMPS | ++------------+-------------------------------------------+ You will have all of these if you download source. You will only have some of them if you download executables, as explained on the pages diff --git a/doc/src/Install_git.rst b/doc/src/Install_git.rst index 2f6e8096dc..868f679dbc 100644 --- a/doc/src/Install_git.rst +++ b/doc/src/Install_git.rst @@ -46,20 +46,19 @@ between them at any time using "git checkout ".) Once the command completes, your directory will contain the same files as if you unpacked a current LAMMPS tarball, with the exception, that the HTML documentation files are not included. They can be fetched -from the LAMMPS website by typing "make fetch" in the doc directory. +from the LAMMPS website by typing ``make fetch`` in the doc directory. Or they can be generated from the content provided in doc/src by -typing "make html" from the doc directory. +typing ``make html`` from the doc directory. After initial cloning, as bug fixes and new features are added to -LAMMPS, as listed on :doc:`this page `, you can stay -up-to-date by typing the following git commands from within the -"mylammps" directory: +LAMMPS you can stay up-to-date by typing the following git commands +from within the "mylammps" directory: .. code-block:: bash $ git checkout unstable # not needed if you always stay in this branch - $ git checkout stable # use one of the 3 checkout commands - $ git checkout master + $ git checkout stable # use one of these 3 checkout commands + $ git checkout master # to choose the branch to follow $ git pull Doing a "pull" will not change any files you have added to the LAMMPS @@ -70,8 +69,8 @@ repository file with your version of the file and tell you if there are any conflicts. See the git documentation for details. If you want to access a particular previous release version of LAMMPS, -you can instead "checkout" any version with a published tag. See the -output of "git tag -l" for the list of tags. The git command to do +you can instead "check out" any version with a published tag. See the +output of ``git tag -l`` for the list of tags. The git command to do this is as follows. .. code-block:: bash @@ -79,14 +78,14 @@ this is as follows. $ git checkout tagID Stable versions and what tagID to use for a particular stable version -are discussed on :doc:`this page `. Note that this command -will print some warnings, because in order to get back to the latest -revision and to be able to update with "git pull" again, you first -will need to first type "git checkout unstable" (or check out any -other desired branch). +are discussed on `this page `_. +Note that this command will print some warnings, because in order to get +back to the latest revision and to be able to update with ``git pull`` +again, you will need to do ``git checkout unstable`` (or +check out any other desired branch) first. -Once you have updated your local files with a "git pull" (or "git -checkout"), you still need to re-build LAMMPS if any source files have +Once you have updated your local files with a ``git pull`` (or ``git +checkout``), you still need to re-build LAMMPS if any source files have changed. To do this, you should cd to the src directory and type: .. code-block:: bash @@ -95,7 +94,7 @@ changed. To do this, you should cd to the src directory and type: $ make package-update # sync package files with src files $ make foo # re-build for your machine (mpi, serial, etc) -just as described on the :doc:`Install patch ` doc page, +just as described on the :doc:`Apply patch ` doc page, after a patch has been installed. .. warning:: diff --git a/doc/src/Install_linux.rst b/doc/src/Install_linux.rst index bb67f1aa84..121869187a 100644 --- a/doc/src/Install_linux.rst +++ b/doc/src/Install_linux.rst @@ -79,13 +79,13 @@ To get a copy of the current potentials files: which will download the potentials files to ``/usr/share/lammps-stable/potentials``. The ``lmp_stable`` binary is hard-coded to look for potential files in this directory (it does not -use the `LAMMPS_POTENTIALS` environment variable, as described +use the ``LAMMPS_POTENTIALS`` environment variable, as described in :doc:`pair_coeff ` command). The ``lmp_stable`` binary is built with the :ref:`KIM package ` which -results in the above command also installing the `kim-api` binaries when LAMMPS +results in the above command also installing the ``kim-api`` binaries when LAMMPS is installed. In order to use potentials from `openkim.org `_, you -can install the `openkim-models` package +can install the ``openkim-models`` package .. code-block:: bash diff --git a/doc/src/Install_patch.rst b/doc/src/Install_patch.rst index 3acd72753f..0bbd7bbf00 100644 --- a/doc/src/Install_patch.rst +++ b/doc/src/Install_patch.rst @@ -6,9 +6,12 @@ if you use git to track the LAMMPS development. Instructions for how to stay current are on the :doc:`Download the LAMMPS source with git ` page. -If you prefer to download a tarball, as described on the :doc:`Install git ` doc page, you can stay current by +If you prefer to download a tarball, as described on the +:doc:`tarball download ` page, you can stay current by downloading "patch files" when new patch releases are made. A link to -a patch file is posted on the `bug and feature page `_ of the LAMMPS website, along +a patch file is posted on the +`bugf fixes and new feature page `_ +of the LAMMPS website, along with a list of changed files and details about what is in the new patch release. This page explains how to apply the patch file to your local LAMMPS directory. diff --git a/doc/src/Install_windows.rst b/doc/src/Install_windows.rst index 548f67e484..ac1e578241 100644 --- a/doc/src/Install_windows.rst +++ b/doc/src/Install_windows.rst @@ -12,14 +12,20 @@ Note that each installer package has a date in its name, which corresponds to the LAMMPS version of the same date. Installers for current and older versions of LAMMPS are available. 32-bit and 64-bit installers are available, and each installer contains both a serial -and parallel executable. The installer site also explains how to +and parallel executable. The installer web site also explains how to install the Windows MPI package (MPICH2 from Argonne National Labs), needed to run in parallel. -The LAMMPS binaries contain all optional packages included in the -source distribution except: KIM, KOKKOS, USER-INTEL, and USER-QMMM. +The LAMMPS binaries contain *all* :doc:`optional packages ` +included in the source distribution except: KIM, KOKKOS, MSCG, PYTHON, +USER-ADIOS, USER-H5MD, USER-NETCDF, USER-QMMM, USER-QUIP, and USER-VTK. The serial version also does not include the MPIIO and -USER-LB packages. GPU support is provided for OpenCL. +USER-LB packages. The GPU package is compiled for OpenCL with +mixed precision kernels. + +The LAMMPS library is compiled as a shared library and the +:doc:`LAMMPS Python module ` is installed, so that +it is possible to load LAMMPS into a Python interpreter. The installer site also has instructions on how to run LAMMPS under Windows, once it is installed, in both serial and parallel. @@ -42,5 +48,3 @@ install multiple versions of LAMMPS (in different directories), but only the executable for the last-installed package will be found automatically, so this should only be done for debugging purposes. -Thanks to Axel Kohlmeyer (Temple U, akohlmey at gmail.com) for setting -up this Windows capability. diff --git a/doc/src/Intro.rst b/doc/src/Intro.rst index 6d388aa87e..53111f71c3 100644 --- a/doc/src/Intro.rst +++ b/doc/src/Intro.rst @@ -12,4 +12,5 @@ These pages provide a brief introduction to LAMMPS. Intro_nonfeatures Intro_opensource Intro_authors + Intro_citing Intro_website diff --git a/doc/src/Intro_citing.rst b/doc/src/Intro_citing.rst new file mode 100644 index 0000000000..aa27080a75 --- /dev/null +++ b/doc/src/Intro_citing.rst @@ -0,0 +1,52 @@ +Citing LAMMPS +============= + +Core Algorithms +^^^^^^^^^^^^^^^ + +Since LAMMPS is a community project, there is not a single one +publication or reference that describes **all** of LAMMPS. +The canonical publication that describes the foundation, that is +the basic spatial decomposition approach, the neighbor finding, +and basic communications algorithms used in LAMMPS is: + + `S. Plimpton, Fast Parallel Algorithms for Short-Range Molecular Dynamics, J Comp Phys, 117, 1-19 (1995). `_ + +So any project using LAMMPS (or a derivative application using LAMMPS as +a simulation engine) should cite this paper. A new publication +describing the developments and improvements of LAMMPS in the 25 years +since then is currently in preparation. + + +DOI for the LAMMPS code +^^^^^^^^^^^^^^^^^^^^^^^ + +LAMMPS developers use the `Zenodo service at CERN +`_ to create digital object identifies (DOI) for +stable releases of the LAMMPS code. There are two types of DOIs for the +LAMMPS source code: 1) the canonical DOI for **all** versions of LAMMPS, +which will always point to the latest stable release version is: + + `DOI: 10.5281/zenodo.3726416 `_ + +In addition there are DOIs for individual stable releases starting with +the `3 March 2020 version, DOI:10.5281/zenodo.3726417 `_ + + +Home page +^^^^^^^^^ + +The LAMMPS website at `https://lammps.sandia.gov/ `_ is the canonical +location for information about LAMMPS and more detailed lists of publications +using LAMMPS and contributing features. + +Citing contributions +^^^^^^^^^^^^^^^^^^^^ + +LAMMPS has many features and uses previously published methods and +algorithms or novel features. It also includes potential parameter +filed for specific models. You can look up relevant publications either +in the LAMMPS output to the screen, the ``log.cite`` file (which is +populated with references to relevant papers through embedding them into +the source code) and in the documentation of the :doc:`corresponding commands +` or in the :doc:`Howto tutorials `. diff --git a/doc/src/Intro_features.rst b/doc/src/Intro_features.rst index cff198da70..acf27455cf 100644 --- a/doc/src/Intro_features.rst +++ b/doc/src/Intro_features.rst @@ -181,7 +181,7 @@ Pre- and post-processing * A handful of pre- and post-processing tools are packaged with LAMMPS, some of which can convert input and output files to/from formats used - by other codes; see the :doc:`Toos ` doc page. + by other codes; see the :doc:`Tools ` doc page. * Our group has also written and released a separate toolkit called `Pizza.py `_ which provides tools for doing setup, analysis, plotting, and visualization for LAMMPS simulations. Pizza.py is @@ -197,7 +197,7 @@ Specialized features ---------------------------------- LAMMPS can be built with optional packages which implement a variety -of additional capabilities. See the :doc:`Packages ` doc +of additional capabilities. See the :doc:`Optional Packages ` page for details. These are LAMMPS capabilities which you may not think of as typical @@ -214,7 +214,7 @@ classical MD options: * Monte Carlo via :doc:`GCMC ` and :doc:`tfMC ` and :doc:`atom swapping ` * :doc:`path-integral molecular dynamics (PIMD) ` and :doc:`this as well ` * :doc:`Direct Simulation Monte Carlo ` for low-density fluids -* :doc:`Peridynamics mesoscale modeling ` +* :doc:`Peridynamics modeling ` * :doc:`Lattice Boltzmann fluid ` * :doc:`targeted ` and :doc:`steered ` molecular dynamics * :doc:`two-temperature electron model ` diff --git a/doc/src/Intro_nonfeatures.rst b/doc/src/Intro_nonfeatures.rst index fb41b9a054..a22a726bdc 100644 --- a/doc/src/Intro_nonfeatures.rst +++ b/doc/src/Intro_nonfeatures.rst @@ -66,8 +66,10 @@ Here are suggestions on how to perform these tasks: on-the-fly via its :doc:`dump image ` command and pass them to an external program, `FFmpeg `_ to generate movies from them. For high-quality, interactive visualization there are - many excellent and free tools available. See the `Other Codes page `_ page of the LAMMPS website for - visualization packages that can use LAMMPS output data. + many excellent and free tools available. See the + `Visualization Tools `_ page of the + LAMMPS website for + visualization packages that can process LAMMPS output data. * **Plotting:** See the next bullet about Pizza.py as well as the :doc:`Python ` doc page for examples of plotting LAMMPS output. Scripts provided with the *python* tool in the tools diff --git a/doc/src/Intro_overview.rst b/doc/src/Intro_overview.rst index 776002354a..df6bfad33d 100644 --- a/doc/src/Intro_overview.rst +++ b/doc/src/Intro_overview.rst @@ -15,7 +15,7 @@ that supports the `MPI `_ message-passing library. This includes shared-memory boxes and distributed-memory clusters and supercomputers. -.. _mpi: http://www-unix.mcs.anl.gov/mpi +.. _mpi: https://en.wikipedia.org/wiki/Message_Passing_Interface .. _lws: https://lammps.sandia.gov LAMMPS is written in C++. Earlier versions were written in F77 and diff --git a/doc/src/Intro_website.rst b/doc/src/Intro_website.rst index 0999e90907..7abc78e7e4 100644 --- a/doc/src/Intro_website.rst +++ b/doc/src/Intro_website.rst @@ -2,28 +2,27 @@ Additional website links ======================== The `LAMMPS website `_ has a variety of additional info about -LAMMPS, beyond what is in this manual. Some of the other pages in -this Intr are included in this list. +LAMMPS, beyond what is in this manual. Some other useful resources +available online are listed below. .. _lws: https://lammps.sandia.gov * `Brief intro and recently added significant features `_ -* `List of features `_ -* `List of non-features `_ +* `List of features `_ +* `List of non-features `_ * `Recent bug fixes and new features `_ * `Download info `_ * `GitHub site `_ * `SourceForge site `_ -* `LAMMPS open-source license `_ +* `LAMMPS open-source license `_ -* `Glossary of MD terms relevant to LAMMPS `_ +* `Glossary of terms relevant to LAMMPS `_ * `LAMMPS highlights with images `_ * `LAMMPS highlights with movies `_ * `Mail list `_ * `Workshops `_ * `Tutorials `_ -* `Developer guide `_ * `Pre- and post-processing tools for LAMMPS `_ * `Other software usable with LAMMPS `_ diff --git a/doc/src/JPG/lammps-classes.png b/doc/src/JPG/lammps-classes.png new file mode 100644 index 0000000000..e673299e9d Binary files /dev/null and b/doc/src/JPG/lammps-classes.png differ diff --git a/doc/src/Library.rst b/doc/src/Library.rst new file mode 100644 index 0000000000..8096980a32 --- /dev/null +++ b/doc/src/Library.rst @@ -0,0 +1,156 @@ +LAMMPS Library Interfaces +************************* + +As described on the :doc:`library interface to LAMMPS ` +doc page, LAMMPS can be built as a library (static or shared), so that +it can be called by another code, used in a :doc:`coupled manner +` with other codes, or driven through a :doc:`Python +script `. Even the LAMMPS standalone executable is +essentially a thin wrapper on top of the LAMMPS library, creating a +LAMMPS instance, processing input and then existing. + +Most of the APIs described below are based on C language wrapper +functions in the files ``src/library.h`` and ``src/library.cpp``, but +it is also possible to use C++ directly. The basic procedure is +always the same: you create one or more instances of +:cpp:class:`LAMMPS `, pass commands as strings or +from files to that LAMMPS instance to execute calculations, and/or +call functions that read, manipulate, and update data from the active +class instances inside LAMMPS to do analysis or perform operations +that are not possible with existing input script commands. + +.. _thread-safety: + +.. admonition:: Thread-safety + :class: note + + LAMMPS was initially not conceived as a thread-safe program, but over + the years changes have been applied to replace operations that + collide with creating multiple LAMMPS instances from multiple-threads + of the same process with thread-safe alternatives. This primarily + applies to the core LAMMPS code and less so on add-on packages, + especially when those packages require additional code in the *lib* + folder, interface LAMMPS to Fortran libraries, or the code uses + static variables (like the USER-COLVARS package). + + Another major issue to deal with is to correctly handle MPI. + Creating a LAMMPS instance requires passing an MPI communicator, or + it assumes the ``MPI_COMM_WORLD`` communicator, which spans all MPI + processor ranks. When creating multiple LAMMPS object instances + from different threads, this communicator has to be different for + each thread or else collisions can happen. Or it has to be + guaranteed, that only one thread at a time is active. MPI + communicators, however, are not a problem, if LAMMPS is compiled + with the MPI STUBS library, which implies that there is no MPI + communication and only 1 MPI rank. + +---------- + +.. _lammps_c_api: + +LAMMPS C Library API +==================== + +The C library interface is the most commonly used path to manage LAMMPS +instances from a compiled code and it is the basis for the :doc:`Python +` and :doc:`Fortran ` modules. Almost all +functions of the C language API require an argument containing a +"handle" in the form of a ``void *`` type variable, which points to the +location of a LAMMPS class instance. + +The ``library.h`` header file by default includes the ``mpi.h`` header +for an MPI library, so it must be present when compiling code using the +library interface. This usually must be the header from the same MPI +library as the LAMMPS library was compiled with. The exception is when +LAMMPS was compiled in serial mode using the ``STUBS`` MPI library. In +that case the calling code may be compiled with a different MPI library +so long as :cpp:func:`lammps_open_no_mpi` is called to create a +LAMMPS instance. Then you may set the define ``-DLAMMPS_LIB_NO_MPI`` +when compiling your code and the inclusion of ``mpi.h`` will be skipped +and consequently the function :cpp:func:`lammps_open` may not be used. + +.. admonition:: Errors versus exceptions + :class: note + + If any of the function calls in the LAMMPS library API trigger + an error inside LAMMPS, this will result in an abort of the entire + program. This is not always desirable. Instead, LAMMPS can be + compiled to instead :ref:`throw a C++ exception `. + +.. warning:: + + No checks are made on the arguments of the function calls of the C + library interface. *All* function arguments must be non-NULL unless + *explicitly* allowed, and must point to consistent and valid data. Buffers + for storing returned data must be allocated to a suitable size. + Passing invalid or unsuitable information will likely cause crashes + or corrupt data. + +------------------------------ + +.. toctree:: + :maxdepth: 1 + + Library_create + Library_execute + Library_properties + Library_objects + Library_scatter + Library_neighbor + Library_config + Library_utility + Library_add + +-------------------- + +.. _lammps_python_api: + +LAMMPS Python APIs +================== + +The LAMMPS Python module enables calling the LAMMPS C library API from +Python by dynamically loading functions in the LAMMPS shared library through +the `Python ctypes module `_. +Because of the dynamic loading, it is **required** that LAMMPS is compiled +in :ref:`"shared" mode `. The Python interface is object oriented, but +otherwise tries to be very similar to the C library API. Three different +Python classes to run LAMMPS are available and they build on each other. +More information on this is in the :doc:`Python_head` +section of the manual. Use of the LAMMPS Python module is described in +:doc:`Python_module`. + +------------------- + +.. _lammps_fortran_api: + +LAMMPS Fortran API +================== + +The LAMMPS Fortran module is a wrapper around calling functions from the +LAMMPS C library API. This is done using the ISO_C_BINDING feature in +Fortran 2003. The interface is object oriented but otherwise tries to +be very similar to the C library API and the basic Python module. + +.. toctree:: + :maxdepth: 1 + + Fortran + +------------------- + +.. _lammps_cplusplus_api: + +LAMMPS C++ API +============== + +It is also possible to invoke the LAMMPS C++ API directly in your code. +It lacks some of the convenience of the C library API, but it allows +more direct access to simulation data and thus more low-level manipulations. +The following links provide some examples and references to the C++ API. + +.. toctree:: + :maxdepth: 1 + + Cplusplus + + diff --git a/doc/src/Library_add.rst b/doc/src/Library_add.rst new file mode 100644 index 0000000000..e58b6c2b73 --- /dev/null +++ b/doc/src/Library_add.rst @@ -0,0 +1,33 @@ +Adding code to the Library interface +==================================== + +The functionality of the LAMMPS library interface has historically +always been motivated by the needs of its users and functions were +added or expanded as they were needed and used. Contributions to +the interface are always welcome. However with a refactoring of +the library interface and its documentation that started in 2020, +there are now a few requirements for inclusion of changes. + + - New functions should be orthogonal to existing ones and not + implement functionality that can already be achieved with the + existing APIs. + - All changes and additions should be documented with + `Doxygen `_ style comments and references + to those functions added to the corresponding files in the + ``doc/src`` folder. + - If possible, new unit tests to test those new features should + be added. + - The new feature should also be implemented and documented for + the Python and Fortran modules. + - All additions should work and be compatible with ``-DLAMMPS_BIGBIG``, + ``-DLAMMPS_SMALLBIG``, ``-DLAMMPS_SMALLSMALL`` and compiling + with and without MPI support. + - The ``library.h`` file should be kept compatible to C code at + a level similar to C89. Its interfaces may not reference any + custom data types (e.g. ``bigint``, ``tagint``, and so on) only + known inside of LAMMPS. + - only C style comments, not C++ style + +Please note, that these are *not* *strict* requirements, but the +LAMMPS developers appreciate if they are followed closely and will +assist with implementing what is missing. diff --git a/doc/src/Library_config.rst b/doc/src/Library_config.rst new file mode 100644 index 0000000000..0c1e254537 --- /dev/null +++ b/doc/src/Library_config.rst @@ -0,0 +1,144 @@ +Retrieving LAMMPS configuration information +=========================================== + +This section documents the following functions: + +- :cpp:func:`lammps_config_has_mpi_support` +- :cpp:func:`lammps_config_has_gzip_support` +- :cpp:func:`lammps_config_has_png_support` +- :cpp:func:`lammps_config_has_jpeg_support` +- :cpp:func:`lammps_config_has_ffmpeg_support` +- :cpp:func:`lammps_config_has_exceptions` +- :cpp:func:`lammps_config_has_package` +- :cpp:func:`lammps_config_package_count` +- :cpp:func:`lammps_config_package_name` +- :cpp:func:`lammps_has_style` +- :cpp:func:`lammps_style_count` +- :cpp:func:`lammps_style_name` +- :cpp:func:`lammps_has_id` +- :cpp:func:`lammps_id_count` +- :cpp:func:`lammps_id_name` + +-------------------- + +The following library functions can be used to query the LAMMPS library +about compile time settings and included packages and styles. This +enables programs that use the library interface to run LAMMPS +simulations to determine, whether the linked LAMMPS library is compatible +with the requirements of the application without crashing during the +LAMMPS functions (e.g. due to missing pair styles from packages) or to +choose between different options (e.g. whether to use ``lj/cut``, +``lj/cut/opt``, ``lj/cut/omp`` or ``lj/cut/intel``). Most of the +functions can be called directly without first creating a LAMMPS +instance. While crashes within LAMMPS may be recovered from through +enabling :ref:`exceptions `, avoiding them proactively is +a safer approach. + +.. code-block:: C + :caption: Example for using configuration settings functions + + #include "library.h" + #include + + int main(int argc, char **argv) + { + void *handle; + + handle = lammps_open_no_mpi(0, NULL, NULL); + lammps_file(handle, "in.missing"); + if (lammps_has_error(handle)) { + char errmsg[256]; + int errtype; + errtype = lammps_get_last_error_message(handle, errmsg, 256); + fprintf(stderr, "LAMMPS failed with error: %s\n", errmsg); + return 1; + } + /* write compressed dump file depending on available of options */ + if (lammps_has_style(handle, "dump", "atom/zstd")) { + lammps_command(handle, "dump d1 all atom/zstd 100 dump.zst"); + } else if (lammps_has_style(handle, "dump", "atom/gz")) { + lammps_command(handle, "dump d1 all atom/gz 100 dump.gz"); + } else if (lammps_config_has_gzip_support()) { + lammps_command(handle, "dump d1 all atom 100 dump.gz"); + } else { + lammps_command(handle, "dump d1 all atom 100 dump"); + } + lammps_close(handle); + return 0; + } + +----------------------- + +.. doxygenfunction:: lammps_config_has_mpi_support + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_has_gzip_support + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_has_png_support + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_has_jpeg_support + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_has_ffmpeg_support + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_has_exceptions + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_has_package + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_package_count + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_config_package_name + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_has_style + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_style_count + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_style_name + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_has_id + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_id_count + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_id_name + :project: progguide + diff --git a/doc/src/Library_create.rst b/doc/src/Library_create.rst new file mode 100644 index 0000000000..7303c499d1 --- /dev/null +++ b/doc/src/Library_create.rst @@ -0,0 +1,116 @@ +Creating or deleting a LAMMPS object +==================================== + +This section documents the following functions: + +- :cpp:func:`lammps_open` +- :cpp:func:`lammps_open_no_mpi` +- :cpp:func:`lammps_open_fortran` +- :cpp:func:`lammps_close` +- :cpp:func:`lammps_mpi_init` +- :cpp:func:`lammps_mpi_finalize` +- :cpp:func:`lammps_free` + +-------------------- + +The :cpp:func:`lammps_open` and :cpp:func:`lammps_open_no_mpi` functions +are used to create and initialize a :cpp:func:`LAMMPS` instance. They +return a reference to this instance as a ``void *`` pointer to be used +as the "handle" argument in subsequent function calls until that +instance is destroyed by calling :cpp:func:`lammps_close`. Here is a +simple example demonstrating its use: + +.. code-block:: C + + #include "library.h" + #include + + int main(int argc, char **argv) + { + void *handle; + int version; + const char *lmpargv[] = { "liblammps", "-log", "none"}; + int lmpargc = sizeof(lmpargv)/sizeof(const char *); + + /* create LAMMPS instance */ + handle = lammps_open_no_mpi(lmpargc, lmpargv, NULL); + if (handle == NULL) { + printf("LAMMPS initialization failed"); + lammps_mpi_finalize(); + return 1; + } + + /* get and print numerical version code */ + version = lammps_version(handle); + printf("LAMMPS Version: %d\n",version); + + /* delete LAMMPS instance and shut down MPI */ + lammps_close(handle); + lammps_mpi_finalize(); + return 0; + } + +The LAMMPS library uses the MPI library it was compiled with and will +either run on all processors in the ``MPI_COMM_WORLD`` communicator or +on the set of processors in the communicator passed as the ``comm`` +argument of :cpp:func:`lammps_open`. This means the calling code can +run LAMMPS on all or a subset of processors. For example, a wrapper +code might decide to alternate between LAMMPS and another code, allowing +them both to run on all the processors. Or it might allocate part of +the processors to LAMMPS and the rest to the other code by creating a +custom communicator with ``MPI_Comm_split()`` and running both codes +concurrently before syncing them up periodically. Or it might +instantiate multiple instances of LAMMPS to perform different +calculations and either alternate between them, run them concurrently on +split communicators, or run them one after the other. The +:cpp:func:`lammps_open` function may be called multiple times for this +latter purpose. + +The :cpp:func:`lammps_close` function is used to shut down the +:cpp:class:`LAMMPS ` class pointed to by the handle +passed as an argument and free all its memory. This has to be called +for every instance created with one of the :cpp:func:`lammps_open` +functions. It will, however, **not** call ``MPI_Finalize()``, since +that may only be called once. See :cpp:func:`lammps_mpi_finalize` for +an alternative to invoking ``MPI_Finalize()`` explicitly from the +calling program. + +The :cpp:func:`lammps_free` function is a clean-up +function to free memory that the library allocated previously +via other function calls. See below for notes in the descriptions +of the individual commands where such memory buffers were allocated. + +----------------------- + +.. doxygenfunction:: lammps_open + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_open_no_mpi + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_open_fortran + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_close + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_mpi_init + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_mpi_finalize + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_free + :project: progguide diff --git a/doc/src/Library_execute.rst b/doc/src/Library_execute.rst new file mode 100644 index 0000000000..b6bcab2ead --- /dev/null +++ b/doc/src/Library_execute.rst @@ -0,0 +1,78 @@ +Executing LAMMPS commands +========================= + +This section documents the following functions: + +- :cpp:func:`lammps_file` +- :cpp:func:`lammps_command` +- :cpp:func:`lammps_commands_list` +- :cpp:func:`lammps_commands_string` + +-------------------- + +Once a LAMMPS instance is created, there are multiple ways to "drive" a +simulation. In most cases it is easiest to process single or multiple +LAMMPS commands like in an input file. This can be done through reading +a file or passing single commands or lists of commands or blocks of +commands with the following functions. + +Via these functions, the calling code can have LAMMPS act on a series +of :doc:`input file commands ` that are either read from +a file or passed as strings. For example, this allows setup of a +problem from an input script, and then running it in stages while +performing other operations in between or concurrently. The caller +can interleave the LAMMPS function calls with operations it performs, +such as calls to extract information from or set information within +LAMMPS, or calls to another code's library. + +Just as with :doc:`input script parsing ` comments can +be included in the file or strings, and expansion of variables with +``${name}`` or ``$(expression)`` syntax is performed. +Below is a short example using some of these functions. + +.. code-block:: C + + #include "library.h" + #include + #include + + int main(int argc, char **argv) + { + void *handle; + int i; + + MPI_Init(&argc, &argv); + handle = lammps_open(0, NULL, MPI_COMM_WORLD, NULL); + lammps_file(handle,"in.sysinit"); + lammps_command(handle,"run 1000 post no"); + + for (i=0; i < 100; ++i) { + lammps_commands_string(handle,"run 100 pre no post no\n" + "print 'PE = $(pe)'\n" + "print 'KE = $(ke)'\n"); + } + lammps_close(handle); + MPI_Finalize(); + return 0; + } + +----------------------- + +.. doxygenfunction:: lammps_file + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_command + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_commands_list + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_commands_string + :project: progguide + diff --git a/doc/src/Library_neighbor.rst b/doc/src/Library_neighbor.rst new file mode 100644 index 0000000000..3179b669f1 --- /dev/null +++ b/doc/src/Library_neighbor.rst @@ -0,0 +1,36 @@ +Accessing LAMMPS Neighbor lists +=============================== + +The following functions allow to access neighbor lists +generated by LAMMPS or query their properties: + +- :cpp:func:`lammps_find_compute_neighlist` +- :cpp:func:`lammps_find_fix_neighlist` +- :cpp:func:`lammps_find_pair_neighlist` +- :cpp:func:`lammps_neighlist_num_elements` +- :cpp:func:`lammps_neighlist_element_neighbors` + +----------------------- + +.. doxygenfunction:: lammps_find_compute_neighlist + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_find_fix_neighlist + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_find_pair_neighlist + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_neighlist_num_elements + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_neighlist_element_neighbors + :project: progguide diff --git a/doc/src/Library_objects.rst b/doc/src/Library_objects.rst new file mode 100644 index 0000000000..3b87842169 --- /dev/null +++ b/doc/src/Library_objects.rst @@ -0,0 +1,38 @@ +Retrieving or setting properties of LAMMPS objects +================================================== + +This section documents accessing or modifying data from objects like +computes, fixes, or variables in LAMMPS using following functions: + +- :cpp:func:`lammps_extract_compute` +- :cpp:func:`lammps_extract_fix` +- :cpp:func:`lammps_extract_variable` +- :cpp:func:`lammps_set_variable` + +----------------------- + +.. doxygenfunction:: lammps_extract_compute + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_extract_fix + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_extract_variable + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_set_variable + :project: progguide + +----------------------- + +.. doxygenenum:: _LMP_DATATYPE_CONST + +.. doxygenenum:: _LMP_STYLE_CONST + +.. doxygenenum:: _LMP_TYPE_CONST diff --git a/doc/src/Library_properties.rst b/doc/src/Library_properties.rst new file mode 100644 index 0000000000..e53a3caa0d --- /dev/null +++ b/doc/src/Library_properties.rst @@ -0,0 +1,142 @@ +Retrieving or setting LAMMPS system properties +============================================== + +This section documents the following functions: + +- :cpp:func:`lammps_version` +- :cpp:func:`lammps_memory_usage` +- :cpp:func:`lammps_get_mpi_comm` +- :cpp:func:`lammps_get_natoms` +- :cpp:func:`lammps_get_thermo` +- :cpp:func:`lammps_extract_box` +- :cpp:func:`lammps_reset_box` +- :cpp:func:`lammps_extract_setting` +- :cpp:func:`lammps_extract_global_datatype` +- :cpp:func:`lammps_extract_global` +- :cpp:func:`lammps_extract_atom_datatype` +- :cpp:func:`lammps_extract_atom` +- :cpp:func:`lammps_create_atoms` + +-------------------- + +The library interface allows extraction of different kinds of +information about the active simulation instance and also +modifications to it. This enables combining of a LAMMPS simulation +with other processing and simulation methods computed by the calling +code, or by another code that is coupled to LAMMPS via the library +interface. In some cases the data returned is direct reference to the +original data inside LAMMPS, cast to a void pointer. In that case the +data needs to be cast to a suitable pointer for the calling program to +access it, and you may need to know the correct dimensions and +lengths. This also means you can directly change those value(s) from +the calling program, e.g. to modify atom positions. Of course, this +should be done with care. When accessing per-atom data, please note +that this data is the per-processor **local** data and is indexed +accordingly. Per-atom data can change sizes and ordering at every +neighbor list rebuild or atom sort event as atoms migrate between +sub-domains and processors. + +.. code-block:: C + + #include "library.h" + #include + + int main(int argc, char **argv) + { + void *handle; + int i; + + handle = lammps_open_no_mpi(0, NULL, NULL); + lammps_file(handle,"in.sysinit"); + printf("Running a simulation with %g atoms.\n", + lammps_get_natoms(handle)); + + printf(" %d local and %d ghost atoms. %d atom types\n", + lammps_extract_setting(handle,"nlocal"), + lammps_extract_setting(handle,"nghost"), + lammps_extract_setting(handle,"ntypes")); + + double *dt = (double *)lammps_extract_global(handle,"dt"); + printf("Changing timestep from %g to 0.5\n", *dt); + *dt = 0.5; + + lammps_command(handle,"run 1000 post no"); + + for (i=0; i < 10; ++i) { + lammps_command(handle,"run 100 pre no post no"); + printf("PE = %g\nKE = %g\n", + lammps_get_thermo(handle,"pe"), + lammps_get_thermo(handle,"ke")); + } + lammps_close(handle); + return 0; + } + + +----------------------- + +.. doxygenfunction:: lammps_version + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_memory_usage + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_get_mpi_comm + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_get_natoms + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_get_thermo + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_extract_box + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_reset_box + :project: progguide + +------------------- + +.. doxygenfunction:: lammps_extract_setting + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_extract_global_datatype + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_extract_global + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_extract_atom_datatype + :project: progguide + + +----------------------- + +.. doxygenfunction:: lammps_extract_atom + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_create_atoms(void *handle, int n, int *id, int *type, double *x, double *v, int *image, int bexpand) + :project: progguide + + diff --git a/doc/src/Library_scatter.rst b/doc/src/Library_scatter.rst new file mode 100644 index 0000000000..e3ca34e999 --- /dev/null +++ b/doc/src/Library_scatter.rst @@ -0,0 +1,67 @@ +Library functions for scatter/gather operations +================================================ + +This section documents the following functions: + +- :cpp:func:`lammps_gather_atoms` +- :cpp:func:`lammps_gather_atoms_concat` +- :cpp:func:`lammps_gather_atoms_subset` +- :cpp:func:`lammps_scatter_atoms` +- :cpp:func:`lammps_scatter_atoms_subset` +- :cpp:func:`lammps_gather` +- :cpp:func:`lammps_gather_concat` +- :cpp:func:`lammps_gather_subset` +- :cpp:func:`lammps_scatter` +- :cpp:func:`lammps_scatter_subset` + +.. TODO add description + +----------------------- + +.. doxygenfunction:: lammps_gather_atoms + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_gather_atoms_concat + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_gather_atoms_subset + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_scatter_atoms + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_scatter_atoms_subset + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_gather + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_gather_concat + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_gather_subset + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_scatter + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_scatter_subset + :project: progguide diff --git a/doc/src/Library_utility.rst b/doc/src/Library_utility.rst new file mode 100644 index 0000000000..5fbb3efd89 --- /dev/null +++ b/doc/src/Library_utility.rst @@ -0,0 +1,60 @@ +Library interface utility functions +=================================== + +To simplify some of the tasks, the library interface contains +some utility functions that are not directly calling LAMMPS: + +- :cpp:func:`lammps_encode_image_flags` +- :cpp:func:`lammps_decode_image_flags` +- :cpp:func:`lammps_set_fix_external_callback` +- :cpp:func:`lammps_fix_external_set_energy_global` +- :cpp:func:`lammps_fix_external_set_virial_global` +- :cpp:func:`lammps_is_running` +- :cpp:func:`lammps_force_timeout` +- :cpp:func:`lammps_has_error` +- :cpp:func:`lammps_get_last_error_message` + +----------------------- + +.. doxygenfunction:: lammps_encode_image_flags + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_decode_image_flags(int image, int *flags) + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*) + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_fix_external_set_energy_global + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_fix_external_set_virial_global + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_is_running + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_force_timeout + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_has_error + :project: progguide + +----------------------- + +.. doxygenfunction:: lammps_get_last_error_message + :project: progguide diff --git a/doc/src/Manual.rst b/doc/src/Manual.rst index 773a5fbd75..ffd75ef974 100644 --- a/doc/src/Manual.rst +++ b/doc/src/Manual.rst @@ -1,13 +1,8 @@ -LAMMPS Documentation -#################### +LAMMPS version |version| Documentation +###################################### -|version| version -***************** - -:doc:`What is a LAMMPS version? ` - -LAMMPS stands for Large-scale Atomic/Molecular Massively Parallel -Simulator. +LAMMPS stands for **L**\ arge-scale **A**\ tomic/**M**\ olecular +**M**\ assively **P**\ arallel **S**\ imulator. LAMMPS is a classical molecular dynamics simulation code with a focus on materials modeling. It was designed to run efficiently on parallel @@ -27,15 +22,23 @@ all LAMMPS development is coordinated. The content for this manual is part of the LAMMPS distribution. You can build a local copy of the Manual as HTML pages or a PDF file, by following the steps on the :doc:`Manual build ` doc page. -There is also a `Developer.pdf `_ document which gives -a brief description of the basic code structure of LAMMPS. +The manual is organized in two parts: +1) the :ref:`User documentation ` for how to install +and use LAMMPS and 2) the :ref:`Programmer documentation ` +for how to write programs using the LAMMPS library from different +programming languages and how to modify and extend LAMMPS. + +.. only:: html + + Once you are familiar with LAMMPS, you may want to bookmark :doc:`this page ` since it gives quick access to a doc page for + every LAMMPS command. + +.. _lws: https://lammps.sandia.gov ---------- -Once you are familiar with LAMMPS, you may want to bookmark :doc:`this page ` since it gives quick access to a doc page for -every LAMMPS command. - -.. _lws: https://lammps.sandia.gov +User Documentation +****************** .. _user_documentation: .. toctree:: @@ -55,11 +58,25 @@ every LAMMPS command. Howto Examples Tools - Modify - Python_head Errors Manual_build +Programmer Documentation +************************ + +.. _programmer_documentation: +.. toctree:: + :maxdepth: 2 + :numbered: 3 + :caption: Programmer Documentation + :name: progdoc + :includehidden: + + Library + Python_head + Modify + Developer + .. toctree:: :caption: Index :name: index @@ -74,9 +91,12 @@ every LAMMPS command. dihedrals impropers fix_modify_atc_commands + Bibliography Indices and tables -================== +****************** -* :ref:`genindex` -* :ref:`search` +.. only:: html + + * :ref:`genindex` + * :ref:`search` diff --git a/doc/src/Manual_build.rst b/doc/src/Manual_build.rst index 972f38bf2e..d1aebe9b09 100644 --- a/doc/src/Manual_build.rst +++ b/doc/src/Manual_build.rst @@ -14,12 +14,10 @@ files. Here is a list with descriptions: lammps.1 # man page for the lammps command msi2lmp.1 # man page for the msi2lmp command Manual.pdf # large PDF version of entire manual - Developer.pdf # small PDF with info about how LAMMPS is structured LAMMPS.epub # Manual in ePUB e-book format LAMMPS.mobi # Manual in MOBI e-book format docenv # virtualenv folder for processing the manual sources doctrees # temporary data from processing the manual - mathjax # code and fonts for rendering math in html doxygen # doxygen configuration and output .gitignore # list of files and folders to be ignored by git doxygen-warn.log # logfile with warnings from running doxygen @@ -35,11 +33,10 @@ of two ways: a. You can "fetch" the current HTML and PDF files from the LAMMPS web site. Just type ``make fetch``. This should download a html_www - directory and Manual_www.pdf/Developer_www.pdf files. Note that if - new LAMMPS features have been added more recently than the date of - your LAMMPS version, the fetched documentation will include those - changes (but your source code will not, unless you update your local - repository). + directory and a Manual_www.pdf file. Note that if new LAMMPS features + have been added more recently than the date of your LAMMPS version, the + fetched documentation will include those changes (but your source code + will not, unless you update your local repository). b. You can build the HTML or PDF files yourself, by typing ``make html`` or ``make pdf``. This requires various tools and files. Some of them @@ -49,6 +46,11 @@ b. You can build the HTML or PDF files yourself, by typing ``make html`` only once, unless you type ``make clean-all``. After that, viewing and processing of the documentation can be done without internet access. +A current version of the manual (latest patch release, aka unstable branch) +is is available online at: `https://lammps.sandia.gov/doc/Manual.html `_ +A version of the manual corresponding to the ongoing development +(aka master branch) is available online at: `https://docs.lammps.org/ `_ + ---------- The generation of all documentation is managed by the Makefile in the @@ -58,10 +60,9 @@ available: .. code-block:: bash make html # generate HTML in html dir using Sphinx - make pdf # generate 2 PDF files (Manual.pdf,Developer.pdf) - # in doc dir via htmldoc and pdflatex - make fetch # fetch HTML doc pages and 2 PDF files from web site - # as a tarball and unpack into html dir and 2 PDFs + make pdf # generate PDF as Manual.pdf using Sphinx and pdflatex + make fetch # fetch HTML doc pages and PDF file from web site + # as a tarball and unpack into html dir and PDF make epub # generate LAMMPS.epub in ePUB format using Sphinx make mobi # generate LAMMPS.mobi in MOBI format using ebook-convert @@ -130,7 +131,8 @@ Installing prerequisites for PDF build In addition to the tools needed for building the HTML format manual, a working LaTeX installation with support for PDFLaTeX and a selection -of LaTeX styles/packages are required. +of LaTeX styles/packages are required. To run the PDFLaTeX translation +the ``latexmk`` script needs to be installed as well. Installing prerequisites for e-book reader builds ================================================= diff --git a/doc/src/Modify.rst b/doc/src/Modify.rst index 531fb6b1f3..2a727dfd0f 100644 --- a/doc/src/Modify.rst +++ b/doc/src/Modify.rst @@ -1,5 +1,5 @@ -Modify & extend LAMMPS -********************** +Modifying & extending LAMMPS +**************************** LAMMPS is designed in a modular fashion so as to be easy to modify and extend with new functionality. In fact, about 95% of its source code @@ -8,7 +8,8 @@ this. If you add a new feature to LAMMPS and think it will be of interest to general users, we encourage you to submit it for inclusion in LAMMPS -as a pull request on our `GitHub site `_, after reading the :doc:`Modify contribute ` doc page. +as a pull request on our `GitHub site `_, +after reading :doc:`this page `. .. toctree:: :maxdepth: 1 diff --git a/doc/src/Modify_atom.rst b/doc/src/Modify_atom.rst index 34a529020a..5c3a96789e 100644 --- a/doc/src/Modify_atom.rst +++ b/doc/src/Modify_atom.rst @@ -47,13 +47,13 @@ other strings. * - fields_comm - list of properties communicated to ghost atoms every step * - fields_comm_vel - - additional properties communicated if :doc:`comm_modify vel ` is used + - additional properties communicated if :doc:`comm_modify vel ` is used * - fields_reverse - list of properties summed from ghost atoms every step * - fields_border - list of properties communicated with ghost atoms every reneighboring step * - fields_border_vel - - additional properties communicated if :doc:`comm_modify vel ` is used + - additional properties communicated if :doc:`comm_modify vel ` is used * - fields_exchange - list of properties communicated when an atom migrates to another processor * - fields_restart diff --git a/doc/src/Modify_contribute.rst b/doc/src/Modify_contribute.rst index 8bc320a9b0..27de36f30c 100644 --- a/doc/src/Modify_contribute.rst +++ b/doc/src/Modify_contribute.rst @@ -31,14 +31,14 @@ send an e-mail to ``slack@lammps.org`` explaining what part of LAMMPS you are working on. Only discussions related to LAMMPS development are tolerated, so this is **NOT** for people that look for help with compiling, installing, or using LAMMPS. Please contact the `lammps-users mailing -list `_ for those purposes instead. +list `_ for those purposes instead. How quickly your contribution will be integrated depends largely on how much effort it will cause to integrate and test it, how much it requires changes to the core codebase, and of how much interest it is to the larger LAMMPS community. Please see below for a checklist of typical -requirements. Once you have prepared everything, see the :doc:`Using -GitHub with LAMMPS Howto ` doc page for instructions on +requirements. Once you have prepared everything, see the :doc:`LAMMPS GitHub +Tutorial ` page for instructions on how to submit your changes or new files through a GitHub pull request. If you prefer to submit patches or full files, you should first make certain, that your code works correctly with the latest patch-level @@ -58,8 +58,8 @@ are listed and described on the :doc:`Packages details ` doc p Note that by providing us files to release, you are agreeing to make them open-source, i.e. we can release them under the terms of the GPL, -used as a license for the rest of LAMMPS. See the `Open source `_ page on the LAMMPS -website for details. +used as a license for the rest of LAMMPS. See the :doc:`LAMMPS license +` doc page for details. With user packages and files, all we are really providing (aside from the fame and fortune that accompanies having your name in the source diff --git a/doc/src/Modify_thermo.rst b/doc/src/Modify_thermo.rst index 564df9ec7a..ea09e30c1d 100644 --- a/doc/src/Modify_thermo.rst +++ b/doc/src/Modify_thermo.rst @@ -20,7 +20,7 @@ for output. Search for the word "customize" with references to "keyword" in thermo.cpp to see the several locations where code will need to be added. -Note that the :doc:`thermo_style custom ` command already allows +Note that the :doc:`thermo_style custom ` command already allows for thermo output of quantities calculated by :doc:`fixes `, :doc:`computes `, and :doc:`variables `. Thus, it may be simpler to compute what you wish via one of those constructs, than diff --git a/doc/src/PDF/colvars-refman-lammps.pdf b/doc/src/PDF/colvars-refman-lammps.pdf index c9a67d6a1d..8fcc37c26e 100644 Binary files a/doc/src/PDF/colvars-refman-lammps.pdf and b/doc/src/PDF/colvars-refman-lammps.pdf differ diff --git a/doc/src/Packages_details.rst b/doc/src/Packages_details.rst index f2426d6ae3..1beeeff5b4 100644 --- a/doc/src/Packages_details.rst +++ b/doc/src/Packages_details.rst @@ -299,7 +299,8 @@ Dozens of pair styles and a version of the PPPM long-range Coulombic solver optimized for GPUs. All such styles have a "gpu" as a suffix in their style name. The GPU code can be compiled with either CUDA or OpenCL, however the OpenCL variants are no longer actively maintained -and only the CUDA versions are regularly tested. The :doc:`Speed gpu ` doc page gives details of what hardware and GPU +and only the CUDA versions are regularly tested. The +:doc:`Speed_gpu` page gives details of what hardware and GPU software is required on your system, and details on how to build and use this package. Its styles can be invoked at run time via the "-sf gpu" or "-suffix gpu" :doc:`command-line switches `. See @@ -318,8 +319,8 @@ This package has :ref:`specific installation instructions ` on the :doc:`Bu * src/GPU: filenames -> commands * src/GPU/README * lib/gpu/README -* :doc:`Speed packages ` -* :doc:`Speed gpu ` +* :doc:`Accelerator packages ` +* :doc:`GPU package ` * :doc:`Section 2.6 -sf gpu ` * :doc:`Section 2.6 -pk gpu ` * :doc:`package gpu ` @@ -433,7 +434,7 @@ Dozens of atom, pair, bond, angle, dihedral, improper, fix, compute styles adapted to compile using the Kokkos library which can convert them to OpenMP or CUDA code so that they run efficiently on multicore CPUs, KNLs, or GPUs. All the styles have a "kk" as a suffix in their -style name. The :doc:`Speed kokkos ` doc page gives +style name. The :doc:`KOKKOS package ` doc page gives details of what hardware and software is required on your system, and how to build and use this package. Its styles can be invoked at run time via the "-sf kk" or "-suffix kk" :doc:`command-line switches `. Also see the :ref:`GPU `, :ref:`OPT `, @@ -463,8 +464,8 @@ This package has :ref:`specific installation instructions ` on the :doc: * src/KOKKOS: filenames -> commands * src/KOKKOS/README * lib/kokkos/README -* :doc:`Speed packages ` -* :doc:`Speed kokkos ` +* :doc:`Accelerator packages ` +* :doc:`KOKKOS package ` * :doc:`Section 2.6 -k on ... ` * :doc:`Section 2.6 -sf kk ` * :doc:`Section 2.6 -pk kokkos ` @@ -665,7 +666,7 @@ A general interface for machine-learning interatomic potentials. **Install:** -To use this package, also the :ref:`SNAP package` needs to be installed. +To use this package, also the :ref:`SNAP package ` needs to be installed. **Author:** Aidan Thompson (Sandia). @@ -773,7 +774,7 @@ OPT package A handful of pair styles which are optimized for improved CPU performance on single or multiple cores. These include EAM, LJ, CHARMM, and Morse potentials. The styles have an "opt" suffix in -their style name. The :doc:`Speed opt ` doc page gives +their style name. The :doc:`OPT package ` doc page gives details of how to build and use this package. Its styles can be invoked at run time via the "-sf opt" or "-suffix opt" :doc:`command-line switches `. See also the :ref:`KOKKOS `, :ref:`USER-INTEL `, and :ref:`USER-OMP ` packages, which @@ -789,8 +790,8 @@ This package has :ref:`specific installation instructions ` on the :doc:`Bu **Supporting info:** * src/OPT: filenames -> commands -* :doc:`Speed packages ` -* :doc:`Speed opt ` +* :doc:`Accelerator packages ` +* :doc:`OPT package ` * :doc:`Section 2.6 -sf opt ` * Search the :doc:`pair style ` page for styles followed by (t) * `Benchmarks page `_ of web site @@ -1541,7 +1542,8 @@ USER-INTEL package Dozens of pair, fix, bond, angle, dihedral, improper, and kspace styles which are optimized for Intel CPUs and KNLs (Knights Landing). -All of them have an "intel" in their style name. The :doc:`Speed intel ` doc page gives details of what hardware and +All of them have an "intel" in their style name. The +:doc:`USER-INTEL package ` page gives details of what hardware and compilers are required on your system, and how to build and use this package. Its styles can be invoked at run time via the "-sf intel" or "-suffix intel" :doc:`command-line switches `. Also see @@ -1567,8 +1569,8 @@ This package has :ref:`specific installation instructions ` on the : * src/USER-INTEL: filenames -> commands * src/USER-INTEL/README -* :doc:`Speed packages ` -* :doc:`Speed intel ` +* :doc:`Accelerator packages ` +* :doc:`USER-INTEL package ` * :doc:`Section 2.6 -sf intel ` * :doc:`Section 2.6 -pk intel ` * :doc:`package intel ` @@ -1692,7 +1694,7 @@ USER-MEAMC package **Contents:** A pair style for the modified embedded atom (MEAM) potential -translated from the Fortran version in the (obsolete) "MEAM" package +translated from the Fortran version in the (obsolete) MEAM package to plain C++. The USER-MEAMC fully replaces the MEAM package, which has been removed from LAMMPS after the 12 December 2018 version. @@ -1915,7 +1917,7 @@ USER-OMP package Hundreds of pair, fix, compute, bond, angle, dihedral, improper, and kspace styles which are altered to enable threading on many-core CPUs via OpenMP directives. All of them have an "omp" in their style name. -The :doc:`Speed omp ` doc page gives details of what hardware +The :doc:`USER-OMP package ` page gives details of what hardware and compilers are required on your system, and how to build and use this package. Its styles can be invoked at run time via the "-sf omp" or "-suffix omp" :doc:`command-line switches `. Also see @@ -1947,8 +1949,8 @@ This package has :ref:`specific installation instructions ` on the :do * src/USER-OMP: filenames -> commands * src/USER-OMP/README -* :doc:`Speed packages ` -* :doc:`Speed omp ` +* :doc:`Accelerator packages ` +* :doc:`USER-OMP package ` * :doc:`Section 2.6 -sf omp ` * :doc:`Section 2.6 -pk omp ` * :doc:`package omp ` diff --git a/doc/src/Packages_standard.rst b/doc/src/Packages_standard.rst index ca22515590..ab9be69ab3 100644 --- a/doc/src/Packages_standard.rst +++ b/doc/src/Packages_standard.rst @@ -37,7 +37,7 @@ package: +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`CORESHELL ` | adiabatic core/shell model | :doc:`Howto coreshell ` | coreshell | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ -| :ref:`DIPOLE ` | point dipole particles | :doc:`pair_style dipole/cut ` | dipole | no | +| :ref:`DIPOLE ` | point dipole particles | :doc:`pair_style lj/.../dipole ` | dipole | no | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ | :ref:`GPU ` | GPU-enabled styles | :doc:`Section gpu ` | `Benchmarks `_ | int | +----------------------------------+--------------------------------------+----------------------------------------------------+------------------------------------------------------+---------+ diff --git a/doc/src/Packages_user.rst b/doc/src/Packages_user.rst index 1d07539022..a3efaf15c8 100644 --- a/doc/src/Packages_user.rst +++ b/doc/src/Packages_user.rst @@ -6,7 +6,7 @@ name gives more details. User packages have been contributed by users, and begin with the "user" prefix. If a contribution is a single command (single file), -it is typically in the user-misc package. User packages don't +it is typically in the USER-MISC package. User packages don't necessarily meet the requirements of the :doc:`standard packages `. This means the developers will try to keep things working and usually can answer technical questions about compiling the package. If you have problems using a specific diff --git a/doc/src/Python_head.rst b/doc/src/Python_head.rst index fc808489a5..611e6424fe 100644 --- a/doc/src/Python_head.rst +++ b/doc/src/Python_head.rst @@ -14,6 +14,7 @@ used together. Python_mpi Python_test Python_library + Python_module Python_pylammps Python_examples Python_call diff --git a/doc/src/Python_module.rst b/doc/src/Python_module.rst new file mode 100644 index 0000000000..e9a48dd797 --- /dev/null +++ b/doc/src/Python_module.rst @@ -0,0 +1,434 @@ +The ``lammps`` Python module +**************************** + +.. py:module:: lammps + +The LAMMPS Python interface is implemented as a module called +:py:mod:`lammps` in the ``lammps.py`` file in the ``python`` folder of +the LAMMPS source code distribution. After compilation of LAMMPS, the +module can be installed into a Python system folder or a user folder +with ``make install-python``. Components of the module can then loaded +into a Python session with the ``import`` command. + +There are multiple Python interface classes in the :py:mod:`lammps` module: + +- the :py:class:`lammps ` class. This is a wrapper around + the C-library interface and its member functions try to replicate the + :ref:`C-library API ` closely. This is the most + feature-complete Python API. +- the :py:class:`PyLammps ` class. This is a more high-level + and more Python style class implemented on top of the + :py:class:`lammps ` class. +- the :py:class:`IPyLammps ` class is derived from + :py:class:`PyLammps ` and adds embedded graphics + features to conveniently include LAMMPS into `Jupyter + `_ notebooks. + +.. _mpi4py_url: https://mpi4py.readthedocs.io + +---------- + +Setting up a Python virtual environment +*************************************** + +LAMMPS and its Python module can be installed together into a Python virtual +environment. This lets you isolate your customized Python environment from +your user or system installation. The following is a minimal working example: + +.. code-block:: bash + + # create and change into build directory + mkdir build + cd build + + # create virtual environment + virtualenv myenv + + # Add venv lib folder to LD_LIBRARY_PATH when activating it + echo 'export LD_LIBRARY_PATH=$VIRTUAL_ENV/lib:$LD_LIBRARY_PATH' >> myenv/bin/activate + + # Add LAMMPS_POTENTIALS path when activating venv + echo 'export LAMMPS_POTENTIALS=$VIRTUAL_ENV/share/lammps/potentials' >> myenv/bin/activate + + # activate environment + source myenv/bin/activate + + # configure LAMMPS compilation + # compiles as shared library with PYTHON package and C++ exceptions + # and installs into myvenv + (myenv)$ cmake -C ../cmake/presets/minimal.cmake \ + -D BUILD_SHARED_LIBS=on \ + -D PKG_PYTHON=on \ + -D LAMMPS_EXCEPTIONS=on \ + -D CMAKE_INSTALL_PREFIX=$VIRTUAL_ENV \ + ../cmake + + # compile LAMMPS + (myenv)$ cmake --build . --parallel + + # install LAMMPS into myvenv + (myenv)$ cmake --install . + +Creating or deleting a LAMMPS object +************************************ + +With the Python interface the creation of a :cpp:class:`LAMMPS +` instance is included in the constructors for the +:py:meth:`lammps `, :py:meth:`PyLammps `, +and :py:meth:`PyLammps ` classes. +Internally it will call either :cpp:func:`lammps_open` or :cpp:func:`lammps_open_no_mpi` from the C +library API to create the class instance. + +All arguments are optional. The *name* argument allows loading a +LAMMPS shared library that is named ``liblammps_machine.so`` instead of +the default name of ``liblammps.so``. In most cases the latter will be +installed or used. The *ptr* argument is for use of the +:py:mod:`lammps` module from inside a LAMMPS instance, e.g. with the +:doc:`python ` command, where a pointer to the already existing +:cpp:class:`LAMMPS ` class instance can be passed +to the Python class and used instead of creating a new instance. The +*comm* argument may be used in combination with the `mpi4py `_ +module to pass an MPI communicator to LAMMPS and thus it is possible +to run the Python module like the library interface on a subset of the +MPI ranks after splitting the communicator. + + +Here are simple examples using all three Python interfaces: + +.. tabs:: + + .. tab:: lammps API + + .. code-block:: python + + from lammps import lammps + + # NOTE: argv[0] is set by the lammps class constructor + args = ["-log", "none"] + # create LAMMPS instance + lmp = lammps(cmdargs=args) + # get and print numerical version code + print("LAMMPS Version: ", lmp.version()) + # explicitly close and delete LAMMPS instance (optional) + lmp.close() + + .. tab:: PyLammps API + + The :py:class:`PyLammps` class is a wrapper around the + :py:class:`lammps` class and all of its lower level functions. + By default, it will create a new instance of :py:class:`lammps` passing + along all arguments to the constructor of :py:class:`lammps`. + + .. code-block:: python + + from lammps import PyLammps + + # NOTE: argv[0] is set by the lammps class constructor + args = ["-log", "none"] + # create LAMMPS instance + L = PyLammps(cmdargs=args) + # get and print numerical version code + print("LAMMPS Version: ", L.version()) + # explicitly close and delete LAMMPS instance (optional) + L.close() + + :py:class:`PyLammps` objects can also be created on top of an existing :py:class:`lammps` object: + + .. code-block:: Python + + from lammps import lammps, PyLammps + ... + # create LAMMPS instance + lmp = lammps(cmdargs=args) + # create PyLammps instance using previously created LAMMPS instance + L = PyLammps(ptr=lmp) + + This is useful if you have to create the :py:class:`lammps ` + instance is a specific way, but want to take advantage of the + :py:class:`PyLammps ` interface. + + .. tab:: IPyLammps API + + The :py:class:`IPyLammps` class is an extension of the + :py:class:`PyLammps` class. It has the same construction behavior. By + default, it will create a new instance of :py:class:`lammps` passing + along all arguments to the constructor of :py:class:`lammps`. + + .. code-block:: python + + from lammps import IPyLammps + + # NOTE: argv[0] is set by the lammps class constructor + args = ["-log", "none"] + # create LAMMPS instance + L = IPyLammps(cmdargs=args) + # get and print numerical version code + print("LAMMPS Version: ", L.version()) + # explicitly close and delete LAMMPS instance (optional) + L.close() + + You can also initialize IPyLammps on top of an existing :py:class:`lammps` or :py:class:`PyLammps` object: + + .. code-block:: Python + + from lammps import lammps, IPyLammps + ... + # create LAMMPS instance + lmp = lammps(cmdargs=args) + # create PyLammps instance using previously created LAMMPS instance + L = PyLammps(ptr=lmp) + + This is useful if you have to create the :py:class:`lammps ` + instance is a specific way, but want to take advantage of the + :py:class:`IPyLammps ` interface. + +In all of the above cases, same as with the :ref:`C library API `, this will use the +``MPI_COMM_WORLD`` communicator for the MPI library that LAMMPS was +compiled with. The :py:func:`lmp.close() ` call is +optional since the LAMMPS class instance will also be deleted +automatically during the :py:class:`lammps ` class +destructor. + +Executing LAMMPS commands +************************* + +Once an instance of the :py:class:`lammps`, :py:class:`PyLammps`, or +:py:class:`IPyLammps` class is created, there are multiple ways to "feed" it +commands. In a way that is not very different from running a LAMMPS input +script, except that Python has many more facilities for structured +programming than the LAMMPS input script syntax. Furthermore it is possible +to "compute" what the next LAMMPS command should be. + +.. tabs:: + + .. tab:: lammps API + + Same as in the equivalent + :doc:`C library functions `, commands can be read from a file, a + single string, a list of strings and a block of commands in a single + multi-line string. They are processed under the same boundary conditions + as the C library counterparts. The example below demonstrates the use + of :py:func:`lammps.file`, :py:func:`lammps.command`, + :py:func:`lammps.commands_list`, and :py:func:`lammps.commands_string`: + + .. code-block:: python + + from lammps import lammps + lmp = lammps() + # read commands from file 'in.melt' + lmp.file('in.melt') + # issue a single command + lmp.command('variable zpos index 1.0') + # create 10 groups with 10 atoms each + cmds = ["group g{} id {}:{}".format(i,10*i+1,10*(i+1)) for i in range(10)] + lmp.commands_list(cmds) + # run commands from a multi-line string + block = """ + clear + region box block 0 2 0 2 0 2 + create_box 1 box + create_atoms 1 single 1.0 1.0 ${zpos} + """ + lmp.commands_string(block) + + .. tab:: PyLammps/IPyLammps API + + Unlike the lammps API, the PyLammps/IPyLammps APIs allow running LAMMPS + commands by calling equivalent member functions. + + For instance, the following LAMMPS command + + .. code-block:: LAMMPS + + region box block 0 10 0 5 -0.5 0.5 + + can be executed using the following Python code if *L* is a :py:class:`lammps` instance: + + .. code-block:: Python + + L.command("region box block 0 10 0 5 -0.5 0.5") + + With the PyLammps interface, any LAMMPS command can be split up into arbitrary parts. + These parts are then passed to a member function with the name of the command. + For the ``region`` command that means the :code:`region` method can be called. + The arguments of the command can be passed as one string, or + individually. + + .. code-block:: Python + + L.region("box block", 0, 10, 0, 5, -0.5, 0.5) + + In this example all parameters except the first are Python floating-point literals. The + PyLammps interface takes the entire parameter list and transparently + merges it to a single command string. + + The benefit of this approach is avoiding redundant command calls and easier + parameterization. In the original interface parameterization this needed to be done + manually by creating formatted strings. + + .. code-block:: Python + + L.command("region box block %f %f %f %f %f %f" % (xlo, xhi, ylo, yhi, zlo, zhi)) + + In contrast, methods of PyLammps accept parameters directly and will convert + them automatically to a final command string. + + .. code-block:: Python + + L.region("box block", xlo, xhi, ylo, yhi, zlo, zhi) + + Using these facilities, the example shown for the lammps API can be rewritten as follows: + + .. code-block:: python + + from lammps import PyLammps + L = PyLammps() + # read commands from file 'in.melt' + L.file('in.melt') + # issue a single command + L.variable('zpos', 'index', 1.0) + # create 10 groups with 10 atoms each + for i in range(10): + L.group(f"g{i}", "id", f"{10*i+1}:{10*(i+1)}") + + L.clear() + L.region("box block", 0, 2, 0, 2, 0, 2) + L.create_box(1, "box") + L.create_atoms(1, "single", 1.0, 1.0, "${zpos}") + +---------- + +The ``lammps`` class API +************************ + +The :py:class:`lammps ` class is the core of the LAMMPS +Python interfaces. It is a wrapper around the :ref:`LAMMPS C library +API ` using the `Python ctypes module +`_ and a shared library +compiled from the LAMMPS sources code. The individual methods in this +class try to closely follow the corresponding C functions. The handle +argument that needs to be passed to the C functions is stored internally +in the class and automatically added when calling the C library +functions. Below is a detailed documentation of the API. + +.. autoclass:: lammps.lammps + :members: + +---------- + +The ``PyLammps`` class API +************************** + +The :py:class:`PyLammps ` class is a wrapper that creates a +simpler, more "Pythonic" interface to common LAMMPS functionality. LAMMPS +data structures are exposed through objects and properties. This makes Python +scripts shorter and more concise. See the :doc:`PyLammps Tutorial +` for an introduction on how to use this interface. + +.. autoclass:: lammps.PyLammps + :members: + +.. autoclass:: lammps.AtomList + :members: + +.. autoclass:: lammps.Atom + :members: + +.. autoclass:: lammps.Atom2D + :members: + +---------- + +The ``IPyLammps`` class API +*************************** + +The :py:class:`IPyLammps ` class is an extension of +:py:class:`PyLammps `, adding additional functions to +quickly display visualizations such as images and videos inside of IPython. +See the :doc:`PyLammps Tutorial ` for examples. + +.. autoclass:: lammps.IPyLammps + :members: + +---------- + +Additional components of the ``lammps`` module +********************************************** + +The :py:mod:`lammps` module additionally contains several constants +and the :py:class:`NeighList ` class: + +.. _py_data_constants: + +Data Types +---------- + +.. py:data:: LAMMPS_INT, LAMMPS_INT_2D, LAMMPS_DOUBLE, LAMMPS_DOUBLE_2D, LAMMPS_INT64, LAMMPS_INT64_2D, LAMMPS_STRING + :type: int + + Constants in the :py:mod:`lammps` module to indicate how to + cast data when the C library function returns a void pointer. + Used in :py:func:`lammps.extract_global` and :py:func:`lammps.extract_atom`. + See :cpp:enum:`_LMP_DATATYPE_CONST` for the equivalent constants in the + C library interface. + +.. _py_style_constants: + +Style Constants +--------------- + +.. py:data:: LMP_STYLE_GLOBAL, LMP_STYLE_ATOM, LMP_STYLE_LOCAL + :type: int + + Constants in the :py:mod:`lammps` module to select what style of data + to request from computes or fixes. See :cpp:enum:`_LMP_STYLE_CONST` + for the equivalent constants in the C library interface. Used in + :py:func:`lammps.extract_compute` and :py:func:`lammps.extract_fix`. + +.. _py_type_constants: + +Type Constants +-------------- + +.. py:data:: LMP_TYPE_SCALAR, LMP_TYLE_VECTOR, LMP_TYPE_ARRAY, LMP_SIZE_VECTOR, LMP_SIZE_ROWS, LMP_SIZE_COLS + :type: int + + Constants in the :py:mod:`lammps` module to select what type of data + to request from computes or fixes. See :cpp:enum:`_LMP_TYPE_CONST` + for the equivalent constants in the C library interface. Used in + :py:func:`lammps.extract_compute` and :py:func:`lammps.extract_fix`. + +.. _py_var_constants: + +Variable Style Constants +------------------------ + +.. py:data:: LMP_VAR_EQUAL, LMP_VAR_ATOM + :type: int + + Constants in the :py:mod:`lammps` module to select what style of + variable to query when calling :py:func:`lammps.extract_variable`. + +Classes representing internal objects +------------------------------------- + +.. autoclass:: lammps.NeighList + :members: + :no-undoc-members: + + +LAMMPS error handling in Python +******************************* + +Compiling the shared library with :ref:`C++ exception support ` provides a better error +handling experience. Without exceptions the LAMMPS code will terminate the +current Python process with an error message. C++ exceptions allow capturing +them on the C++ side and rethrowing them on the Python side. This way +LAMMPS errors can be handled through the Python exception handling mechanism. + +.. warning:: + + Capturing a LAMMPS exception in Python can still mean that the + current LAMMPS process is in an illegal state and must be terminated. It is + advised to save your data and terminate the Python instance as quickly as + possible. diff --git a/doc/src/Run_basics.rst b/doc/src/Run_basics.rst index d02873a8be..35d5f829a0 100644 --- a/doc/src/Run_basics.rst +++ b/doc/src/Run_basics.rst @@ -27,11 +27,11 @@ executable itself can be placed elsewhere. As LAMMPS runs it prints info to the screen and a logfile named *log.lammps*\ . More info about output is given on the -:doc:`Run output ` doc page. +:doc:`screen and logfile output ` page. If LAMMPS encounters errors in the input script or while running a simulation it will print an ERROR message and stop or a WARNING -message and continue. See the :doc:`Errors ` doc page for a +message and continue. See the :doc:`Common Problems ` page for a discussion of the various kinds of errors LAMMPS can or can't detect, a list of all ERROR and WARNING messages, and what to do about them. diff --git a/doc/src/Run_options.rst b/doc/src/Run_options.rst index 054ed66d57..f5435ec3a9 100644 --- a/doc/src/Run_options.rst +++ b/doc/src/Run_options.rst @@ -80,7 +80,7 @@ stdin. Explicitly enable or disable KOKKOS support, as provided by the KOKKOS package. Even if LAMMPS is built with this package, as described -in :doc:`Speed kokkos `, this switch must be set to enable +in the :doc:`the KOKKOS package page `, this switch must be set to enable running with KOKKOS-enabled styles the package provides. If the switch is not set (the default), LAMMPS will operate as if the KOKKOS package were not installed; i.e. you can run standard LAMMPS or with @@ -98,7 +98,8 @@ Either the full word or an abbreviation can be used for the keywords. Note that the keywords do not use a leading minus sign. I.e. the keyword is "t", not "-t". Also note that each of the keywords has a default setting. Examples of when to use these options and what -settings to use on different platforms is given on the :doc:`Speed kokkos ` doc page. +settings to use on different platforms is given on the :doc:`KOKKOS package ` +doc page. * d or device * g or gpus @@ -268,7 +269,7 @@ machine (e.g. your desktop), you can run on more (virtual) processors than you have physical processors. To run multiple independent simulations from one input script, using -multiple partitions, see the :doc:`Howto multiple ` doc +multiple partitions, see the :doc:`Howto multiple ` page. World- and universe-style :doc:`variables ` are useful in this context. @@ -326,7 +327,7 @@ cores within each node are ranked in a desired order. Or when using the :doc:`run_style verlet/split ` command with 2 partitions to insure that a specific Kspace processor (in the second partition) is matched up with a specific set of processors in the first partition. -See the :doc:`Speed tips ` doc page for more details. +See the :doc:`General tips ` page for more details. If the keyword *nth* is used with a setting *N*\ , then it means every Nth processor will be moved to the end of the ranking. This is useful @@ -385,7 +386,7 @@ implementations, either by environment variables that specify how to order physical processors, or by config files that specify what physical processors to assign to each MPI rank. The -reorder switch simply gives you a portable way to do this without relying on MPI -itself. See the :doc:`processors out ` command for how +itself. See the :doc:`processors file ` command for how to output info on the final assignment of physical processors to the LAMMPS simulation domain. @@ -523,10 +524,10 @@ lj/cut/intel, lj/cut/kk, lj/cut/omp, and lj/cut/opt. A variant style can be specified explicitly in your input script, e.g. pair_style lj/cut/gpu. If the -suffix switch is used the specified suffix (gpu,intel,kk,omp,opt) is automatically appended whenever your input -script command creates a new :doc:`atom `, -:doc:`pair `, :doc:`fix `, :doc:`compute `, or -:doc:`run ` style. If the variant version does not exist, -the standard version is created. +script command creates a new :doc:`atom style `, +:doc:`pair style `, :doc:`fix `, +:doc:`compute `, or :doc:`run style `. If the +variant version does not exist, the standard version is created. For the GPU package, using this command-line switch also invokes the default GPU settings, as if the command "package gpu 1" were used at @@ -579,8 +580,8 @@ index variable in the input script, since index variables cannot be re-defined. See the :doc:`variable ` command for more info on defining -index and other kinds of variables and the :doc:`Commands parse ` page for more info on using variables in -input scripts. +index and other kinds of variables and the :doc:`Parsing rules ` +page for more info on using variables in input scripts. .. note:: diff --git a/doc/src/Speed_bench.rst b/doc/src/Speed_bench.rst index 45b5b21d8a..66db03e360 100644 --- a/doc/src/Speed_bench.rst +++ b/doc/src/Speed_bench.rst @@ -38,7 +38,7 @@ of these 5 problems on 1 or 4 cores of Linux desktop. The bench/FERMI and bench/KEPLER directories have input files and scripts and instructions for running the same (or similar) problems using OpenMP or GPU or Xeon Phi acceleration options. See the README files in those directories and the -:doc:`Speed packages ` doc pages for instructions on how +:doc:`Accelerator packages ` pages for instructions on how to build LAMMPS and run on that kind of hardware. The bench/POTENTIALS directory has input files which correspond to the diff --git a/doc/src/Speed_intel.rst b/doc/src/Speed_intel.rst index c7bded1345..0d0551c008 100644 --- a/doc/src/Speed_intel.rst +++ b/doc/src/Speed_intel.rst @@ -12,7 +12,8 @@ When offloading to a co-processor from a CPU, the same routine is run twice, once on the CPU and once with an offload flag. This allows LAMMPS to run on the CPU cores and co-processor cores simultaneously. -**Currently Available USER-INTEL Styles:** +Currently Available USER-INTEL Styles +""""""""""""""""""""""""""""""""""""" * Angle Styles: charmm, harmonic * Bond Styles: fene, fourier, harmonic @@ -31,9 +32,10 @@ LAMMPS to run on the CPU cores and co-processor cores simultaneously. support computing per-atom stress. If any compute or fix in your input requires it, LAMMPS will abort with an error message. -**Speed-ups to expect:** +Speed-up to expect +""""""""""""""""""" -The speedups will depend on your simulation, the hardware, which +The speedup will depend on your simulation, the hardware, which styles are used, the number of atoms, and the floating-point precision mode. Performance improvements are shown compared to LAMMPS *without using other acceleration packages* as these are @@ -59,7 +61,8 @@ instructions to reproduce. ---------- -**Accuracy and order of operations:** +Accuracy and order of operations +"""""""""""""""""""""""""""""""" In most molecular dynamics software, parallelization parameters (# of MPI, OpenMP, and vectorization) can change the results due @@ -96,7 +99,8 @@ mode should not be used without appropriate validation. ---------- -**Quick Start for Experienced Users:** +Quick Start for Experienced Users +""""""""""""""""""""""""""""""""" LAMMPS should be built with the USER-INTEL package installed. Simulations should be run with 1 MPI task per physical *core*\ , @@ -136,7 +140,8 @@ For Intel Xeon Phi co-processors (Offload): ---------- -**Required hardware/software:** +Required hardware/software +"""""""""""""""""""""""""" When using Intel compilers version 16.0 or later is required. @@ -159,7 +164,8 @@ For best performance, we recommend that the MCDRAM is configured in "Cache" mode can also be used, although the performance might be slightly lower. -**Notes about Simultaneous Multithreading:** +Notes about Simultaneous Multithreading +""""""""""""""""""""""""""""""""""""""" Modern CPUs often support Simultaneous Multithreading (SMT). On Intel processors, this is called Hyper-Threading (HT) technology. @@ -196,7 +202,8 @@ this information can normally be obtained with: cat /proc/cpuinfo -**Building LAMMPS with the USER-INTEL package:** +Building LAMMPS with the USER-INTEL package +""""""""""""""""""""""""""""""""""""""""""" See the :ref:`Build extras ` doc page for instructions. Some additional details are covered here. @@ -263,7 +270,8 @@ recommended CCFLAG options for best performance are "-O2 -fno-alias in most of the example Makefiles is to use "-xHost", however this should not be used when cross-compiling. -**Running LAMMPS with the USER-INTEL package:** +Running LAMMPS with the USER-INTEL package +"""""""""""""""""""""""""""""""""""""""""" Running LAMMPS with the USER-INTEL package is similar to normal use with the exceptions that one should 1) specify that LAMMPS should use @@ -304,7 +312,8 @@ almost all cases. recommended, especially when running on a machine with Intel Hyper-Threading technology disabled. -**Run with the USER-INTEL package from the command line:** +Run with the USER-INTEL package from the command line +""""""""""""""""""""""""""""""""""""""""""""""""""""" To enable USER-INTEL optimizations for all available styles used in the input script, the "-sf intel" :doc:`command-line switch ` can be used without any requirement for @@ -339,7 +348,8 @@ launching MPI applications): mpirun -np 72 -ppn 36 lmp_machine -sf intel -in in.script # 2 nodes, 36 MPI tasks/node, $OMP_NUM_THREADS OpenMP Threads mpirun -np 72 -ppn 36 lmp_machine -sf intel -in in.script -pk intel 0 omp 2 mode double # Don't use any co-processors that might be available, use 2 OpenMP threads for each task, use double precision -**Or run with the USER-INTEL package by editing an input script:** +Or run with the USER-INTEL package by editing an input script +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" As an alternative to adding command-line arguments, the input script can be edited to enable the USER-INTEL package. This requires adding @@ -361,7 +371,8 @@ Alternatively, the :doc:`suffix intel ` command can be added to the input script to enable USER-INTEL styles for the commands that follow in the input script. -**Tuning for Performance:** +Tuning for Performance +"""""""""""""""""""""" .. note:: @@ -431,7 +442,8 @@ series processors will always perform better using MCDRAM. Please consult your system documentation for the best approach to specify that MPI runs are performed in MCDRAM. -**Tuning for Offload Performance:** +Tuning for Offload Performance +"""""""""""""""""""""""""""""" The default settings for offload should give good performance. @@ -521,7 +533,8 @@ the pair styles in the USER-INTEL package currently support the :doc:`run_style respa ` command; only the "pair" option is supported. -**References:** +References +"""""""""" * Brown, W.M., Carrillo, J.-M.Y., Mishra, B., Gavhane, N., Thakkar, F.M., De Kraker, A.R., Yamada, M., Ang, J.A., Plimpton, S.J., "Optimizing Classical Molecular Dynamics in LAMMPS," in Intel Xeon Phi Processor High Performance Programming: Knights Landing Edition, J. Jeffers, J. Reinders, A. Sodani, Eds. Morgan Kaufmann. * Brown, W. M., Semin, A., Hebenstreit, M., Khvostov, S., Raman, K., Plimpton, S.J. `Increasing Molecular Dynamics Simulation Rates with an 8-Fold Increase in Electrical Power Efficiency. `_ 2016 High Performance Computing, Networking, Storage and Analysis, SC16: International Conference (pp. 82-95). diff --git a/doc/src/Speed_kokkos.rst b/doc/src/Speed_kokkos.rst index 3269564d21..5df53ec2cd 100644 --- a/doc/src/Speed_kokkos.rst +++ b/doc/src/Speed_kokkos.rst @@ -9,7 +9,7 @@ different back end languages such as CUDA, OpenMP, or Pthreads. The Kokkos library also provides data abstractions to adjust (at compile time) the memory layout of data structures like 2d and 3d arrays to optimize performance on different hardware. For more information on -Kokkos, see `GitHub `_. +Kokkos, see `the Kokkos GitHub page `_. The LAMMPS KOKKOS package contains versions of pair, fix, and atom styles that use data structures and macros provided by the Kokkos @@ -20,20 +20,20 @@ including Sikandar Mashayak (UIUC), Ray Shan (Sandia), and Dan Ibanez (Sandia). For more information on developing using Kokkos abstractions see the Kokkos `Wiki `_. -Kokkos currently provides support for 3 modes of execution (per MPI +Kokkos currently provides support for 4 modes of execution (per MPI task). These are Serial (MPI-only for CPUs and Intel Phi), OpenMP -(threading for many-core CPUs and Intel Phi), and CUDA (for NVIDIA -GPUs). You choose the mode at build time to produce an executable -compatible with specific hardware. +(threading for many-core CPUs and Intel Phi), CUDA (for NVIDIA +GPUs) and HIP (for AMD GPUs). You choose the mode at build time to +produce an executable compatible with a specific hardware. -.. note:: +.. admonition:: NVIDIA CUDA support To build with Kokkos support for NVIDIA GPUs, the NVIDIA CUDA toolkit software version 9.0 or later must be installed on your system. See the discussion for the :doc:`GPU package ` for details of how to check and do this. -.. note:: +.. admonition:: CUDA and MPI library compatibility Kokkos with CUDA currently implicitly assumes that the MPI library is CUDA-aware. This is not always the case, especially when using @@ -45,6 +45,13 @@ compatible with specific hardware. LAMMPS command line or by using the command :doc:`package kokkos cuda/aware off ` in the input file. +.. admonition:: AMD GPU support + + To build with Kokkos the HIPCC compiler from the AMD ROCm software + version 3.5 or later is required. Supporting this Kokkos mode in + LAMMPS is still work in progress. Please contact the LAMMPS developers + if you run into problems. + Building LAMMPS with the KOKKOS package """"""""""""""""""""""""""""""""""""""" diff --git a/doc/src/Speed_measure.rst b/doc/src/Speed_measure.rst index 686fdb6adc..1daf49f4c4 100644 --- a/doc/src/Speed_measure.rst +++ b/doc/src/Speed_measure.rst @@ -14,7 +14,7 @@ timings; you can simply extrapolate from short runs. For the set of runs, look at the timing data printed to the screen and log file at the end of each LAMMPS run. The -:doc:`Run_output ` doc page gives an overview. +:doc:`screen and logfile output ` page gives an overview. Running on one (or a few processors) should give a good estimate of the serial performance and what portions of the timestep are taking diff --git a/doc/src/Speed_omp.rst b/doc/src/Speed_omp.rst index 04e4366758..f29e3743b4 100644 --- a/doc/src/Speed_omp.rst +++ b/doc/src/Speed_omp.rst @@ -8,18 +8,21 @@ improper), several Kspace styles, and a few fix styles. It uses the OpenMP interface for multi-threading, but can also be compiled without OpenMP support, providing optimized serial styles in that case. -**Required hardware/software:** +Required hardware/software +"""""""""""""""""""""""""" To enable multi-threading, your compiler must support the OpenMP interface. You should have one or more multi-core CPUs, as multiple threads can only be launched by each MPI task on the local node (using shared memory). -**Building LAMMPS with the USER-OMP package:** +Building LAMMPS with the USER-OMP package +""""""""""""""""""""""""""""""""""""""""" See the :ref:`Build extras ` doc page for instructions. -**Run with the USER-OMP package from the command line:** +Run with the USER-OMP package from the command line +""""""""""""""""""""""""""""""""""""""""""""""""""" These examples assume one or more 16-core nodes. @@ -52,7 +55,8 @@ details, including the default values used if it is not specified. It also gives more details on how to set the number of threads via the OMP_NUM_THREADS environment variable. -**Or run with the USER-OMP package by editing an input script:** +Or run with the USER-OMP package by editing an input script +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The discussion above for the mpirun/mpiexec command, MPI tasks/node, and threads/MPI task is the same. @@ -70,7 +74,8 @@ per MPI task to use. The command doc page explains other options and how to set the number of threads via the OMP_NUM_THREADS environment variable. -**Speed-ups to expect:** +Speed-up to expect +"""""""""""""""""" Depending on which styles are accelerated, you should look for a reduction in the "Pair time", "Bond time", "KSpace time", and "Loop @@ -81,7 +86,8 @@ USER-OMP style (in serial or parallel) with a single thread per MPI task, versus running standard LAMMPS with its standard un-accelerated styles (in serial or all-MPI parallelization with 1 task/core). This is because many of the USER-OMP styles contain similar optimizations -to those used in the OPT package, described in :doc:`Section 5.3.5 `. +to those used in the OPT package, described in +:doc:`the OPT package ` doc page. With multiple threads/task, the optimal choice of number of MPI tasks/node and OpenMP threads/task can vary a lot and should always be @@ -90,9 +96,11 @@ specific machine, paying attention to guidelines discussed in the next sub-section. A description of the multi-threading strategy used in the USER-OMP -package and some performance examples are `presented here `_ +package and some performance examples are +`presented here `_. -**Guidelines for best performance:** +Guidelines for best performance +""""""""""""""""""""""""""""""" For many problems on current generation CPUs, running the USER-OMP package with a single thread/task is faster than running with multiple diff --git a/doc/src/Speed_opt.rst b/doc/src/Speed_opt.rst index 297177f8d4..338c4f2030 100644 --- a/doc/src/Speed_opt.rst +++ b/doc/src/Speed_opt.rst @@ -7,15 +7,18 @@ Technologies). It contains a handful of pair styles whose compute() methods were rewritten in C++ templated form to reduce the overhead due to if tests and other conditional code. -**Required hardware/software:** +Required hardware/software +"""""""""""""""""""""""""" -None. +Any hardware. Any compiler. -**Building LAMMPS with the OPT package:** +Building LAMMPS with the OPT package +"""""""""""""""""""""""""""""""""""" See the :ref:`Build extras ` doc page for instructions. -**Run with the OPT package from the command line:** +Run with the OPT package from the command line +"""""""""""""""""""""""""""""""""""""""""""""" .. code-block:: bash @@ -25,7 +28,8 @@ See the :ref:`Build extras ` doc page for instructions. Use the "-sf opt" :doc:`command-line switch `, which will automatically append "opt" to styles that support it. -**Or run with the OPT package by editing an input script:** +Or run with the OPT package by editing an input script +"""""""""""""""""""""""""""""""""""""""""""""""""""""" Use the :doc:`suffix opt ` command, or you can explicitly add an "opt" suffix to individual styles in your input script, e.g. @@ -34,13 +38,15 @@ Use the :doc:`suffix opt ` command, or you can explicitly add an pair_style lj/cut/opt 2.5 -**Speed-ups to expect:** +Speed-up to expect +"""""""""""""""""" You should see a reduction in the "Pair time" value printed at the end of a run. On most machines for reasonable problem sizes, it will be a 5 to 20% savings. -**Guidelines for best performance:** +Guidelines for best performance +""""""""""""""""""""""""""""""" Just try out an OPT pair style to see how it performs. diff --git a/doc/src/Tools.rst b/doc/src/Tools.rst index 8feb2afefa..483c77038e 100644 --- a/doc/src/Tools.rst +++ b/doc/src/Tools.rst @@ -89,10 +89,10 @@ Miscellaneous tools :columns: 6 * :ref:`CMake ` - * :ref:`doxygen ` * :ref:`emacs ` * :ref:`i-pi ` * :ref:`kate ` + * :ref:`LAMMPS shell ` * :ref:`singularity ` * :ref:`vim ` @@ -254,21 +254,6 @@ The tool is authored by Xiaowang Zhou (Sandia), xzhou at sandia.gov. ---------- -.. _doxygen: - -doxygen tool --------------------------- - -The tools/doxygen directory contains a shell script called -doxygen.sh which can generate a call graph and API lists using -the `Doxygen software `_. - -See the included README file for details. - -The tool is authored by Nandor Tamaskovics, numericalfreedom at googlemail.com. - ----------- - .. _drude: drude tool @@ -413,10 +398,131 @@ The file was provided by Alessandro Luigi Sellerio ---------- +.. _lammps_shell: + +LAMMPS shell +------------ + +Overview +======== + +The LAMMPS Shell, ``lammps-shell`` is a program that functions very +similar to the regular LAMMPS executable but has several modifications +and additions that make it more powerful for interactive sessions, +i.e. where you type LAMMPS commands from the prompt instead of reading +them from a file. + +- It uses the readline and history libraries to provide command line + editing and context aware TAB-expansion (details on that below). + +- When processing an input file with the '-in' or '-i' flag from the + command line, it does not exit at the end of that input file but + stops at a prompt, so that additional commands can be issued + +- Errors will not abort the shell but return to the prompt. + +- It has additional commands aimed at interactive use (details below). + +- Interrupting a calculation with CTRL-C will not terminate the + session but rather enforce a timeout to cleanly stop an ongoing + run (more info on timeouts is in the timer command documentation). + +These enhancements makes the LAMMPS shell an attractive choice for +interactive LAMMPS sessions in graphical user interfaces. + +TAB-expansion +============= + +When writing commands interactively at the shell prompt, you can hit +the TAB key at any time to try and complete the text. This completion +is context aware and will expand any first word only to commands +available in that executable. + +- For style commands it will expand to available styles of the + corresponding category (e.g. pair styles after a + :doc:`pair_style ` command). + +- For :doc:`compute `, :doc:`fix `, or :doc:`dump ` + it will also expand only to already defined groups for the group-ID + keyword. + +- For commands like :doc:`compute_modify `, + :doc:`fix_modify `, or :doc:`dump_modify ` + it will expand to known compute/fix/dump IDs only. + +- When typing references to computes, fixes, or variables with a + "c\_", "f\_", or "v\_" prefix, respectively, then the expansion will + to known compute/fix IDs and variable names. Variable name expansion + is also available for the ${name} variable syntax. + +- In all other cases, expansion will be performed on filenames. + + +Command line editing and history +================================ + +When typing commands, command line editing similar to what BASH +provides is available. Thus it is possible to move around the +currently line and perform various cut and insert and edit operations. +Previous commands can be retrieved by scrolling up (and down) +or searching (e.g. with CTRL-r). + +Also history expansion through using the exclamation mark '!' +can be performed. Examples: '!!' will be replaced with the previous +command, '!-2' will repeat the command before that, '!30' will be +replaced with event number 30 in the command history list, and +'!run' with the last command line that started with "run". Adding +a ":p" to such a history expansion will result that the expansion is +printed and added to the history list, but NOT executed. +On exit the LAMMPS shell will write the history list to a file +".lammps_history" in the current working directory. If such a +file exists when the LAMMPS shell is launched it will be read to +populate the history list. + +This is realized via the readline library and can thus be customized +with an ``.inputrc`` file in the home directory. For application +specific customization, the LAMMPS shell uses the name "lammps-shell". +For more information about using and customizing an application using +readline, please see the available documentation at: +`http://www.gnu.org/s/readline/#Documentation +`_ + +Additional commands +=================== + +The following commands are added to the LAMMPS shell on top of the +regular LAMMPS commands: + +.. parsed-literal:: + + help (or ?) print a brief help message + history display the current command history list + clear_history wipe out the current command history list + \| execute as a shell command and return to the command prompt + exit exit the LAMMPS shell cleanly (unlike the "quit" command) + +Compilation +=========== + +Compilation of the LAMMPS shell can be enabled by setting the CMake +variable ``BUILD_LAMMPS_SHELL`` to "on" or using the makefile in the +``tools/lammps-shell`` folder to compile after building LAMMPS using +the conventional make procedure. The makefile will likely need +customization depending on the features and settings used for +compiling LAMMPS. + +Limitations +=========== + +The LAMMPS shell was not designed for use with MPI parallelization +via ``mpirun`` or ``mpiexec`` or ``srun``. + +---------- + .. _arc: lmp2arc tool ----------------------- +------------ The lmp2arc sub-directory contains a tool for converting LAMMPS output files to the format for Accelrys' Insight MD code (formerly @@ -679,6 +785,7 @@ The singularity sub-directory contains container definitions files that can be used to build container images for building and testing LAMMPS on specific OS variants using the `Singularity `_ container software. Contributions for additional variants are welcome. +For more details please see the README.md file in that folder. ---------- diff --git a/doc/src/_ext/tab_or_note.py b/doc/src/_ext/tab_or_note.py new file mode 100644 index 0000000000..40a27deca5 --- /dev/null +++ b/doc/src/_ext/tab_or_note.py @@ -0,0 +1,15 @@ + +def replace_tabs_handler(app, docname, source): + """ When builder is not 'html', remove 'tabs' directive + and replace any 'tab' directive with 'admonition'""" + if app.builder.name != 'html': + for i in range(len(source)): + source[i] = source[i].replace('.. tabs::','').replace('.. tab::','.. admonition::') + +def setup(app): + app.connect('source-read', replace_tabs_handler) + return { + 'version': '0.1', + 'parallel_read_safe': True, + 'parallel_write_safe': True, + } diff --git a/doc/src/angle_charmm.rst b/doc/src/angle_charmm.rst index f0e9200fa0..e557648d9f 100644 --- a/doc/src/angle_charmm.rst +++ b/doc/src/angle_charmm.rst @@ -1,16 +1,12 @@ .. index:: angle_style charmm +.. index:: angle_style charmm/intel +.. index:: angle_style charmm/kk +.. index:: angle_style charmm/omp angle_style charmm command ========================== -angle_style charmm/intel command -================================ - -angle_style charmm/kk command -============================= - -angle_style charmm/omp command -============================== +Accelerator Variants: *charmm/intel*, *charmm/kk*, *charmm/omp* Syntax """""" @@ -92,7 +88,10 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/angle_class2.rst b/doc/src/angle_class2.rst index 9c89271f12..bf0305055a 100644 --- a/doc/src/angle_class2.rst +++ b/doc/src/angle_class2.rst @@ -1,13 +1,12 @@ .. index:: angle_style class2 +.. index:: angle_style class2/kk +.. index:: angle_style class2/omp +.. index:: angle_style class2/p6 angle_style class2 command ========================== -angle_style class2/kk command -============================= - -angle_style class2/omp command -============================== +Accelerator Variants: *class2/kk*, *class2/omp* angle_style class2/p6 command ============================= @@ -135,7 +134,10 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/angle_coeff.rst b/doc/src/angle_coeff.rst index 565d094d4d..07048c1432 100644 --- a/doc/src/angle_coeff.rst +++ b/doc/src/angle_coeff.rst @@ -92,4 +92,7 @@ Related commands :doc:`angle_style ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cosine.rst b/doc/src/angle_cosine.rst index 84ddabe61d..aea144f7be 100644 --- a/doc/src/angle_cosine.rst +++ b/doc/src/angle_cosine.rst @@ -1,13 +1,11 @@ .. index:: angle_style cosine +.. index:: angle_style cosine/omp +.. index:: angle_style cosine/kk angle_style cosine command ========================== -angle_style cosine/omp command -============================== - -angle_style cosine/kk command -============================= +Accelerator Variants: *cosine/omp*, *cosine/kk* Syntax """""" @@ -60,4 +58,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cosine_buck6d.rst b/doc/src/angle_cosine_buck6d.rst index 228b96abc8..4b8497d743 100644 --- a/doc/src/angle_cosine_buck6d.rst +++ b/doc/src/angle_cosine_buck6d.rst @@ -68,4 +68,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cosine_delta.rst b/doc/src/angle_cosine_delta.rst index f71d73459c..280e6ea2c4 100644 --- a/doc/src/angle_cosine_delta.rst +++ b/doc/src/angle_cosine_delta.rst @@ -1,10 +1,10 @@ .. index:: angle_style cosine/delta +.. index:: angle_style cosine/delta/omp angle_style cosine/delta command ================================ -angle_style cosine/delta/omp command -==================================== +Accelerator Variants: *cosine/delta/omp* Syntax """""" @@ -62,4 +62,7 @@ Related commands :doc:`angle_coeff `, :doc:`angle_style cosine/squared ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cosine_periodic.rst b/doc/src/angle_cosine_periodic.rst index db22bf2bce..71c2caa3f0 100644 --- a/doc/src/angle_cosine_periodic.rst +++ b/doc/src/angle_cosine_periodic.rst @@ -1,10 +1,10 @@ .. index:: angle_style cosine/periodic +.. index:: angle_style cosine/periodic/omp angle_style cosine/periodic command =================================== -angle_style cosine/periodic/omp command -======================================= +Accelerator Variants: *cosine/periodic/omp* Syntax """""" @@ -70,7 +70,10 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/angle_cosine_shift.rst b/doc/src/angle_cosine_shift.rst index 9aec7e4caf..71bda194c7 100644 --- a/doc/src/angle_cosine_shift.rst +++ b/doc/src/angle_cosine_shift.rst @@ -1,10 +1,10 @@ .. index:: angle_style cosine/shift +.. index:: angle_style cosine/shift/omp angle_style cosine/shift command -================================= +================================ -angle_style cosine/shift/omp command -==================================== +Accelerator Variants: *cosine/shift/omp* Syntax """""" @@ -61,4 +61,7 @@ Related commands :doc:`angle_coeff `, :doc:`angle_style cosine/shift/exp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cosine_shift_exp.rst b/doc/src/angle_cosine_shift_exp.rst index 48e82cfed8..4ae4928751 100644 --- a/doc/src/angle_cosine_shift_exp.rst +++ b/doc/src/angle_cosine_shift_exp.rst @@ -1,10 +1,10 @@ .. index:: angle_style cosine/shift/exp +.. index:: angle_style cosine/shift/exp/omp angle_style cosine/shift/exp command ==================================== -angle_style cosine/shift/exp/omp command -======================================== +Accelerator Variants: *cosine/shift/exp/omp* Syntax """""" @@ -74,4 +74,7 @@ Related commands :doc:`angle_style cosine/shift `, :doc:`dihedral_style cosine/shift/exp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cosine_squared.rst b/doc/src/angle_cosine_squared.rst index 0ea824f24f..4a6a1debe9 100644 --- a/doc/src/angle_cosine_squared.rst +++ b/doc/src/angle_cosine_squared.rst @@ -1,10 +1,10 @@ .. index:: angle_style cosine/squared +.. index:: angle_style cosine/squared/omp angle_style cosine/squared command ================================== -angle_style cosine/squared/omp command -====================================== +Accelerator Variants: *cosine/squared/omp* Syntax """""" @@ -62,4 +62,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_cross.rst b/doc/src/angle_cross.rst index 75fba2632b..3cd1884be0 100644 --- a/doc/src/angle_cross.rst +++ b/doc/src/angle_cross.rst @@ -1,7 +1,7 @@ .. index:: angle_style cross angle_style cross command -========================== +========================= Syntax """""" @@ -62,4 +62,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_dipole.rst b/doc/src/angle_dipole.rst index 9aba8e6a45..4dd8aadfb8 100644 --- a/doc/src/angle_dipole.rst +++ b/doc/src/angle_dipole.rst @@ -1,10 +1,10 @@ .. index:: angle_style dipole +.. index:: angle_style dipole/omp angle_style dipole command ========================== -angle_style dipole/omp command -============================== +Accelerator Variants: *dipole/omp* Syntax """""" @@ -113,7 +113,10 @@ Related commands :doc:`angle_coeff `, :doc:`angle_hybrid ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/angle_fourier.rst b/doc/src/angle_fourier.rst index 6fb1fe25f7..231f45e808 100644 --- a/doc/src/angle_fourier.rst +++ b/doc/src/angle_fourier.rst @@ -1,10 +1,10 @@ .. index:: angle_style fourier +.. index:: angle_style fourier/omp angle_style fourier command =========================== -angle_style fourier/omp command -=============================== +Accelerator Variants: *fourier/omp* Syntax """""" @@ -58,4 +58,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_fourier_simple.rst b/doc/src/angle_fourier_simple.rst index a1494997ec..14b4bbcfe9 100644 --- a/doc/src/angle_fourier_simple.rst +++ b/doc/src/angle_fourier_simple.rst @@ -1,10 +1,10 @@ .. index:: angle_style fourier/simple +.. index:: angle_style fourier/simple/omp angle_style fourier/simple command ================================== -angle_style fourier/simple/omp command -====================================== +Accelerator Variants: *fourier/simple/omp* Syntax """""" @@ -57,4 +57,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_harmonic.rst b/doc/src/angle_harmonic.rst index 4c957e1f75..06cf1d460b 100644 --- a/doc/src/angle_harmonic.rst +++ b/doc/src/angle_harmonic.rst @@ -1,16 +1,12 @@ .. index:: angle_style harmonic +.. index:: angle_style harmonic/intel +.. index:: angle_style harmonic/kk +.. index:: angle_style harmonic/omp angle_style harmonic command ============================ -angle_style harmonic/intel command -================================== - -angle_style harmonic/kk command -=============================== - -angle_style harmonic/omp command -================================ +Accelerator Variants: *harmonic/intel*, *harmonic/kk*, *harmonic/omp* Syntax """""" @@ -69,4 +65,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_hybrid.rst b/doc/src/angle_hybrid.rst index c84b351132..1a562b0118 100644 --- a/doc/src/angle_hybrid.rst +++ b/doc/src/angle_hybrid.rst @@ -95,4 +95,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_mm3.rst b/doc/src/angle_mm3.rst index 988deb8ddc..0905ff6e4c 100644 --- a/doc/src/angle_mm3.rst +++ b/doc/src/angle_mm3.rst @@ -57,4 +57,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_none.rst b/doc/src/angle_none.rst index eea4f2f951..28c194a26a 100644 --- a/doc/src/angle_none.rst +++ b/doc/src/angle_none.rst @@ -37,4 +37,7 @@ Related commands :doc:`angle_style zero ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_quartic.rst b/doc/src/angle_quartic.rst index 04758d7b7a..7dfb4b2896 100644 --- a/doc/src/angle_quartic.rst +++ b/doc/src/angle_quartic.rst @@ -1,10 +1,10 @@ .. index:: angle_style quartic +.. index:: angle_style quartic/omp angle_style quartic command =========================== -angle_style quartic/omp command -=============================== +Accelerator Variants: *quartic/omp* Syntax """""" @@ -65,4 +65,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_sdk.rst b/doc/src/angle_sdk.rst index 567b5a9a08..340a3e4de7 100644 --- a/doc/src/angle_sdk.rst +++ b/doc/src/angle_sdk.rst @@ -1,10 +1,10 @@ .. index:: angle_style sdk +.. index:: angle_style sdk/omp angle_style sdk command ======================= -angle_style sdk/omp command -=========================== +Accelerator Variants: *sdk/omp* Syntax """""" @@ -73,4 +73,7 @@ Related commands :doc:`angle_coeff `, :doc:`angle_style harmonic `, :doc:`pair_style lj/sdk `, :doc:`pair_style lj/sdk/coul/long ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_table.rst b/doc/src/angle_table.rst index b89ed53fd8..cad9f5a82f 100644 --- a/doc/src/angle_table.rst +++ b/doc/src/angle_table.rst @@ -1,10 +1,10 @@ .. index:: angle_style table +.. index:: angle_style table/omp angle_style table command ========================= -angle_style table/omp command -============================= +Accelerator Variants: *table/omp* Syntax """""" @@ -130,7 +130,8 @@ one that matches the specified keyword. ---------- -**Restart info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This angle style writes the settings for the "angle_style table" command to :doc:`binary restart files `, so a angle_style @@ -152,4 +153,7 @@ Related commands :doc:`angle_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/angle_zero.rst b/doc/src/angle_zero.rst index 22b2e95c04..a0d5a02e1e 100644 --- a/doc/src/angle_zero.rst +++ b/doc/src/angle_zero.rst @@ -51,4 +51,7 @@ Related commands :doc:`angle_style none ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/atom_modify.rst b/doc/src/atom_modify.rst index c94ca65c1c..a4e4ec1500 100644 --- a/doc/src/atom_modify.rst +++ b/doc/src/atom_modify.rst @@ -160,7 +160,11 @@ The *first* and *sort* options cannot be used together. Since sorting is on by default, it will be turned off if the *first* keyword is used with a group-ID that is not "all". -**Related commands:** none +Related commands +"""""""""""""""" + +none + Default """"""" diff --git a/doc/src/balance.rst b/doc/src/balance.rst index fbf8c8fb5f..e023b6f2f0 100644 --- a/doc/src/balance.rst +++ b/doc/src/balance.rst @@ -548,4 +548,7 @@ Related commands .. _pizza: https://pizza.sandia.gov -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_class2.rst b/doc/src/bond_class2.rst index ec4f5bfe0e..aea503738f 100644 --- a/doc/src/bond_class2.rst +++ b/doc/src/bond_class2.rst @@ -1,13 +1,11 @@ .. index:: bond_style class2 +.. index:: bond_style class2/omp +.. index:: bond_style class2/kk bond_style class2 command ========================= -bond_style class2/omp command -============================= - -bond_style class2/kk command -============================ +Accelerator Variants: *class2/omp*, *class2/kk* Syntax """""" @@ -65,7 +63,10 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/bond_coeff.rst b/doc/src/bond_coeff.rst index 39d1bbcd17..84a949a018 100644 --- a/doc/src/bond_coeff.rst +++ b/doc/src/bond_coeff.rst @@ -87,4 +87,7 @@ Related commands :doc:`bond_style ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_fene.rst b/doc/src/bond_fene.rst index 2f8be4eb28..0c6a37ca62 100644 --- a/doc/src/bond_fene.rst +++ b/doc/src/bond_fene.rst @@ -1,16 +1,12 @@ .. index:: bond_style fene +.. index:: bond_style fene/intel +.. index:: bond_style fene/kk +.. index:: bond_style fene/omp bond_style fene command ======================= -bond_style fene/intel command -============================= - -bond_style fene/kk command -========================== - -bond_style fene/omp command -=========================== +Accelerator Variants: *fene/intel*, *fene/kk*, *fene/omp* Syntax """""" @@ -74,7 +70,10 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/bond_fene_expand.rst b/doc/src/bond_fene_expand.rst index 9826aeaf18..1be06561e9 100644 --- a/doc/src/bond_fene_expand.rst +++ b/doc/src/bond_fene_expand.rst @@ -1,10 +1,10 @@ .. index:: bond_style fene/expand +.. index:: bond_style fene/expand/omp bond_style fene/expand command ============================== -bond_style fene/expand/omp command -================================== +Accelerator Variants: *fene/expand/omp* Syntax """""" @@ -72,7 +72,10 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/bond_gromos.rst b/doc/src/bond_gromos.rst index ce66307853..d4eb958ebe 100644 --- a/doc/src/bond_gromos.rst +++ b/doc/src/bond_gromos.rst @@ -1,10 +1,10 @@ .. index:: bond_style gromos +.. index:: bond_style gromos/omp bond_style gromos command ========================= -bond_style gromos/omp command -============================= +Accelerator Variants: *gromos/omp* Syntax """""" @@ -59,4 +59,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_harmonic.rst b/doc/src/bond_harmonic.rst index dcbe24649b..e3320f2e19 100644 --- a/doc/src/bond_harmonic.rst +++ b/doc/src/bond_harmonic.rst @@ -1,16 +1,12 @@ .. index:: bond_style harmonic +.. index:: bond_style harmonic/intel +.. index:: bond_style harmonic/kk +.. index:: bond_style harmonic/omp bond_style harmonic command =========================== -bond_style harmonic/intel command -================================= - -bond_style harmonic/kk command -============================== - -bond_style harmonic/omp command -=============================== +Accelerator Variants: *harmonic/intel*, *harmonic/kk*, *harmonic/omp* Syntax """""" @@ -65,4 +61,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_harmonic_shift.rst b/doc/src/bond_harmonic_shift.rst index 933f119a9b..469c370969 100644 --- a/doc/src/bond_harmonic_shift.rst +++ b/doc/src/bond_harmonic_shift.rst @@ -1,10 +1,10 @@ .. index:: bond_style harmonic/shift +.. index:: bond_style harmonic/shift/omp bond_style harmonic/shift command ================================= -bond_style harmonic/shift/omp command -===================================== +Accelerator Variants: *harmonic/shift/omp* Syntax """""" @@ -65,4 +65,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds `, :doc:`bond_harmonic ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_harmonic_shift_cut.rst b/doc/src/bond_harmonic_shift_cut.rst index 10f961f761..d0f44740b3 100644 --- a/doc/src/bond_harmonic_shift_cut.rst +++ b/doc/src/bond_harmonic_shift_cut.rst @@ -1,10 +1,10 @@ .. index:: bond_style harmonic/shift/cut +.. index:: bond_style harmonic/shift/cut/omp bond_style harmonic/shift/cut command ===================================== -bond_style harmonic/shift/cut/omp command -========================================= +Accelerator Variants: *harmonic/shift/cut/omp* Syntax """""" @@ -64,4 +64,7 @@ Related commands :doc:`bond_harmonic `, :doc:`bond_style harmonic/shift ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_hybrid.rst b/doc/src/bond_hybrid.rst index 74bd39988b..0da93ccade 100644 --- a/doc/src/bond_hybrid.rst +++ b/doc/src/bond_hybrid.rst @@ -76,4 +76,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_mm3.rst b/doc/src/bond_mm3.rst index 8ea79d9139..2a255e7590 100644 --- a/doc/src/bond_mm3.rst +++ b/doc/src/bond_mm3.rst @@ -55,7 +55,10 @@ Related commands :doc:`bond_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/bond_morse.rst b/doc/src/bond_morse.rst index 5cd61adf3c..f096624ba0 100644 --- a/doc/src/bond_morse.rst +++ b/doc/src/bond_morse.rst @@ -1,10 +1,10 @@ .. index:: bond_style morse +.. index:: bond_style morse/omp bond_style morse command ======================== -bond_style morse/omp command -============================ +Accelerator Variants: *morse/omp* Syntax """""" @@ -60,4 +60,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_none.rst b/doc/src/bond_none.rst index 3712ef08d5..b418f5c503 100644 --- a/doc/src/bond_none.rst +++ b/doc/src/bond_none.rst @@ -13,7 +13,7 @@ Syntax Examples """""""" -.. code-blocK:: LAMMPS +.. code-block:: LAMMPS bond_style none @@ -31,8 +31,15 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" + +none + :doc:`bond_style zero ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_nonlinear.rst b/doc/src/bond_nonlinear.rst index a965c63ea9..77271502ea 100644 --- a/doc/src/bond_nonlinear.rst +++ b/doc/src/bond_nonlinear.rst @@ -1,10 +1,10 @@ .. index:: bond_style nonlinear +.. index:: bond_style nonlinear/omp bond_style nonlinear command ============================ -bond_style nonlinear/omp command -================================ +Accelerator Variants: *nonlinear/omp* Syntax """""" @@ -60,7 +60,10 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/bond_oxdna.rst b/doc/src/bond_oxdna.rst index 71e5105436..3f52424d49 100644 --- a/doc/src/bond_oxdna.rst +++ b/doc/src/bond_oxdna.rst @@ -1,4 +1,6 @@ .. index:: bond_style oxdna/fene +.. index:: bond_style oxdna2/fene +.. index:: bond_style oxrna2/fene bond_style oxdna/fene command ============================= @@ -108,7 +110,9 @@ Related commands :doc:`pair_style oxdna/excv `, :doc:`pair_style oxdna2/excv `, :doc:`pair_style oxrna2/excv `, :doc:`bond_coeff `, :doc:`fix nve/dotc/langevin ` -**Default:** +Default +""""""" + none diff --git a/doc/src/bond_quartic.rst b/doc/src/bond_quartic.rst index 831d8c18ef..8c5b363e54 100644 --- a/doc/src/bond_quartic.rst +++ b/doc/src/bond_quartic.rst @@ -1,10 +1,10 @@ .. index:: bond_style quartic +.. index:: bond_style quartic/omp bond_style quartic command ========================== -bond_style quartic/omp command -============================== +Accelerator Variants: *quartic/omp* Syntax """""" @@ -108,4 +108,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_special.rst b/doc/src/bond_special.rst index f7dc43a1b2..d2423c9e23 100644 --- a/doc/src/bond_special.rst +++ b/doc/src/bond_special.rst @@ -1,7 +1,7 @@ .. index:: bond_style special bond_style special command -================================= +========================== Syntax """""" @@ -73,7 +73,7 @@ ensure that the new bonds created by this style do not create spurious Specifically 1-2 interactions must have weights of zero, 1-3 interactions must either have weights of unity or :doc:`special_bonds angle yes ` must be used, and 1-4 interactions must -have weights of unity or :doc:`special_bonds dihedral yes ` +have weights of unity or :doc:`special_bonds dihedral yes ` must be used. If this command is used to create bonded interactions between @@ -95,7 +95,7 @@ compute interactions for individual pairs of atoms. Manybody potentials are not compatible in general, but also some other pair styles are missing the required functionality and thus will cause an error. -This command is not compatible with long-range Coulombic interactions. If a +This command is not compatible with long-range Coulombic interactions. If a `kspace_style ` is declared, an error will be issued. Related commands @@ -103,4 +103,7 @@ Related commands :doc:`bond_coeff `, :doc:`special_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_style.rst b/doc/src/bond_style.rst index 52cc761da1..64fdeb95c9 100644 --- a/doc/src/bond_style.rst +++ b/doc/src/bond_style.rst @@ -98,6 +98,7 @@ accelerated styles exist. * :doc:`oxdna2/fene ` - same as oxdna but used with different pair styles * :doc:`oxrna2/fene ` - modified FENE bond suitable for RNA modeling * :doc:`quartic ` - breakable quartic bond +* :doc:`special ` - enable special bond exclusions for 1-5 pairs and beyond * :doc:`table ` - tabulated by bond length ---------- diff --git a/doc/src/bond_table.rst b/doc/src/bond_table.rst index ec22eda83b..fedb50355d 100644 --- a/doc/src/bond_table.rst +++ b/doc/src/bond_table.rst @@ -1,10 +1,10 @@ .. index:: bond_style table +.. index:: bond_style table/omp bond_style table command ======================== -bond_style table/omp command -============================ +Accelerator Variants: *table/omp* Syntax """""" @@ -128,7 +128,8 @@ one that matches the specified keyword. ---------- -**Restart info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This bond style writes the settings for the "bond_style table" command to :doc:`binary restart files `, so a bond_style @@ -150,4 +151,7 @@ Related commands :doc:`bond_coeff `, :doc:`delete_bonds ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_write.rst b/doc/src/bond_write.rst index a062d0a82b..4170029239 100644 --- a/doc/src/bond_write.rst +++ b/doc/src/bond_write.rst @@ -70,4 +70,7 @@ Related commands :doc:`bond_style table `, :doc:`bond_style `, :doc:`bond_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/bond_zero.rst b/doc/src/bond_zero.rst index 42df0472a1..bcbbe8a014 100644 --- a/doc/src/bond_zero.rst +++ b/doc/src/bond_zero.rst @@ -50,4 +50,7 @@ Related commands :doc:`bond_style none ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/box.rst b/doc/src/box.rst index f677b8bb5f..c5937df75c 100644 --- a/doc/src/box.rst +++ b/doc/src/box.rst @@ -58,7 +58,11 @@ This command cannot be used after the simulation box is defined by a :doc:`read_data ` or :doc:`create_box ` command or :doc:`read_restart ` command. -**Related commands:** none +Related commands +"""""""""""""""" + +none + Default """"""" diff --git a/doc/src/clear.rst b/doc/src/clear.rst index 6c4ef9a22c..e9664a6112 100644 --- a/doc/src/clear.rst +++ b/doc/src/clear.rst @@ -37,6 +37,13 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/compute.rst b/doc/src/compute.rst index e31f4fde96..4da3e4ebe6 100644 --- a/doc/src/compute.rst +++ b/doc/src/compute.rst @@ -323,4 +323,7 @@ Related commands :doc:`uncompute `, :doc:`compute_modify `, :doc:`fix ave/atom `, :doc:`fix ave/time `, :doc:`fix ave/histo ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_ackland_atom.rst b/doc/src/compute_ackland_atom.rst index 33e0b6cf15..74922ba17b 100644 --- a/doc/src/compute_ackland_atom.rst +++ b/doc/src/compute_ackland_atom.rst @@ -58,7 +58,8 @@ is dumped). Thus it can be inefficient to compute/dump this quantity too frequently or to have multiple compute/dump commands, each of which computes this quantity.- -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See diff --git a/doc/src/compute_adf.rst b/doc/src/compute_adf.rst index 08e7dcfd35..6ec5c5bc10 100644 --- a/doc/src/compute_adf.rst +++ b/doc/src/compute_adf.rst @@ -173,7 +173,8 @@ example: compute myADF all adf 32 2 2 2 0.5 3.5 0.5 3.5 fix 1 all ave/time 100 1 100 c_myADF[*] file tmp.adf mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array with the number of rows = *Nbins*\ , and the number of columns = 1 + 2\*Ntriples, where Ntriples is the diff --git a/doc/src/compute_angle.rst b/doc/src/compute_angle.rst index 60f929197c..d028cdec99 100644 --- a/doc/src/compute_angle.rst +++ b/doc/src/compute_angle.rst @@ -32,7 +32,8 @@ specified for this command is ignored. This compute is useful when using :doc:`angle_style hybrid ` if you want to know the portion of the total energy contributed by one or more of the hybrid sub-styles. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length N where N is the number of sub_styles defined by the :doc:`angle_style hybrid ` command, which can be accessed by indices @@ -52,4 +53,7 @@ Related commands :doc:`compute pe `, :doc:`compute pair ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_angle_local.rst b/doc/src/compute_angle_local.rst index fe0af199e2..169ef4f238 100644 --- a/doc/src/compute_angle_local.rst +++ b/doc/src/compute_angle_local.rst @@ -119,7 +119,8 @@ Here is an example of how to do this: compute 2 all angle/local theta eng dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_1[4] c_2[1] c_2[2] -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of values. The length of the vector or number of rows in the @@ -142,4 +143,7 @@ Related commands :doc:`dump local `, :doc:`compute property/local ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_angmom_chunk.rst b/doc/src/compute_angmom_chunk.rst index eb5e8fd013..da27cb3d19 100644 --- a/doc/src/compute_angmom_chunk.rst +++ b/doc/src/compute_angmom_chunk.rst @@ -68,7 +68,8 @@ command, for example: compute myChunk all angmom/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -89,4 +90,7 @@ Related commands :doc:`variable angmom() function ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_basal_atom.rst b/doc/src/compute_basal_atom.rst index ac628d2b6d..a5558e6232 100644 --- a/doc/src/compute_basal_atom.rst +++ b/doc/src/compute_basal_atom.rst @@ -44,7 +44,8 @@ which computes this quantity. An example input script that uses this compute is provided in examples/USER/misc/basal. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom array with 3 columns, which can be accessed by indices 1-3 by any command that uses per-atom values from @@ -69,7 +70,10 @@ Related commands :doc:`compute centro/atom `, :doc:`compute ackland/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_body_local.rst b/doc/src/compute_body_local.rst index 395a8ebf91..e0369049cb 100644 --- a/doc/src/compute_body_local.rst +++ b/doc/src/compute_body_local.rst @@ -74,7 +74,8 @@ command. compute 1 all body/local type 1 2 3 dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_1[4] -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of keywords. The length of the vector or number of rows in the @@ -97,4 +98,7 @@ Related commands :doc:`dump local ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_bond.rst b/doc/src/compute_bond.rst index 59ac05630a..00b99d1f9f 100644 --- a/doc/src/compute_bond.rst +++ b/doc/src/compute_bond.rst @@ -32,7 +32,8 @@ This compute is useful when using :doc:`bond_style hybrid ` if you want to know the portion of the total energy contributed by one or more of the hybrid sub-styles. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length N where N is the number of sub_styles defined by the :doc:`bond_style hybrid ` command, which can be accessed by indices 1-N. @@ -52,4 +53,7 @@ Related commands :doc:`compute pe `, :doc:`compute pair ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_bond_local.rst b/doc/src/compute_bond_local.rst index 32d756d52a..5264a86634 100644 --- a/doc/src/compute_bond_local.rst +++ b/doc/src/compute_bond_local.rst @@ -169,7 +169,8 @@ Here is an example of how to do this: compute 2 all bond/local dist engpot dump 1 all local 1000 tmp.dump index c_1[*] c_2[*] -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of values. The length of the vector or number of rows in the @@ -196,4 +197,7 @@ Related commands :doc:`dump local `, :doc:`compute property/local ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_centro_atom.rst b/doc/src/compute_centro_atom.rst index 312582eb90..b250634b5c 100644 --- a/doc/src/compute_centro_atom.rst +++ b/doc/src/compute_centro_atom.rst @@ -101,7 +101,8 @@ is dumped). Thus it can be inefficient to compute/dump this quantity too frequently or to have multiple compute/dump commands, each with a *centro/atom* style. -**Output info:** +Output info +""""""""""" By default, this compute calculates the centrosymmetry value for each atom as a per-atom vector, which can be accessed by any command that @@ -132,7 +133,7 @@ simulation into gold (FCC). These were provided by Jon Zimmerman Stacking faults ~ 5.0 (4.0 to 6.0) Free surface ~ 23.0 -These values are \*not\* normalized by the square of the lattice +These values are **not** normalized by the square of the lattice parameter. If they were, normalized values would be: .. parsed-literal:: diff --git a/doc/src/compute_chunk_atom.rst b/doc/src/compute_chunk_atom.rst index a3d915b8a4..a650c8fb0a 100644 --- a/doc/src/compute_chunk_atom.rst +++ b/doc/src/compute_chunk_atom.rst @@ -620,7 +620,8 @@ cylinder, x for a y-axis cylinder, and x for a z-axis cylinder. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector (the chunk ID), which can be accessed by any command that uses per-atom values from a compute diff --git a/doc/src/compute_chunk_spread_atom.rst b/doc/src/compute_chunk_spread_atom.rst index d486da4e3e..9e6489f828 100644 --- a/doc/src/compute_chunk_spread_atom.rst +++ b/doc/src/compute_chunk_spread_atom.rst @@ -188,7 +188,8 @@ it is in. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector or array, which can be accessed by any command that uses per-atom values from a compute as @@ -212,4 +213,7 @@ Related commands :doc:`compute chunk/atom `, :doc:`fix ave/chunk `, :doc:`compute reduce/chunk ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_cluster_atom.rst b/doc/src/compute_cluster_atom.rst index 3772b0dd0b..ab47aed9b3 100644 --- a/doc/src/compute_cluster_atom.rst +++ b/doc/src/compute_cluster_atom.rst @@ -1,4 +1,6 @@ .. index:: compute cluster/atom +.. index:: compute fragment/atom +.. index:: compute aggregate/atom compute cluster/atom command ============================ @@ -104,7 +106,8 @@ style computes. because it does not perform a full update of the bond topology data structures within LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -122,7 +125,9 @@ Related commands :doc:`compute coord/atom ` -**Default:** +Default +""""""" + The default for fragment/atom is single no. diff --git a/doc/src/compute_cna_atom.rst b/doc/src/compute_cna_atom.rst index 27bff636a2..41d7113b60 100644 --- a/doc/src/compute_cna_atom.rst +++ b/doc/src/compute_cna_atom.rst @@ -79,7 +79,8 @@ is dumped). Thus it can be inefficient to compute/dump this quantity too frequently or to have multiple compute/dump commands, each with a *cna/atom* style. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -98,7 +99,10 @@ Related commands :doc:`compute centro/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_cnp_atom.rst b/doc/src/compute_cnp_atom.rst index c87082dc07..1a1b509162 100644 --- a/doc/src/compute_cnp_atom.rst +++ b/doc/src/compute_cnp_atom.rst @@ -86,7 +86,8 @@ is dumped). Thus it can be inefficient to compute/dump this quantity too frequently or to have multiple compute/dump commands, each with a *cnp/atom* style. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -118,7 +119,10 @@ Related commands :doc:`compute cna/atom ` :doc:`compute centro/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_com.rst b/doc/src/compute_com.rst index af36b34b2b..203eaaf687 100644 --- a/doc/src/compute_com.rst +++ b/doc/src/compute_com.rst @@ -40,7 +40,8 @@ are the x,y,z coordinates of the center of mass. how they are set for each atom. You can reset the image flags (e.g. to 0) before invoking this compute by using the :doc:`set image ` command. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 3, which can be accessed by indices 1-3 by any command that uses global vector values @@ -59,4 +60,7 @@ Related commands :doc:`compute com/chunk ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_com_chunk.rst b/doc/src/compute_com_chunk.rst index dd27702652..3165acfbcc 100644 --- a/doc/src/compute_com_chunk.rst +++ b/doc/src/compute_com_chunk.rst @@ -66,7 +66,8 @@ command, for example: compute myChunk all com/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -87,4 +88,7 @@ Related commands :doc:`compute com ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_contact_atom.rst b/doc/src/compute_contact_atom.rst index b8b3c695d6..f22a78c63c 100644 --- a/doc/src/compute_contact_atom.rst +++ b/doc/src/compute_contact_atom.rst @@ -34,7 +34,8 @@ sum of the radii of the two particles. The value of the contact number will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, whose values can be accessed by any command that uses per-atom values from a compute as @@ -55,4 +56,7 @@ Related commands :doc:`compute coord/atom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_coord_atom.rst b/doc/src/compute_coord_atom.rst index becbf95b6b..f3c6f818af 100644 --- a/doc/src/compute_coord_atom.rst +++ b/doc/src/compute_coord_atom.rst @@ -1,10 +1,10 @@ .. index:: compute coord/atom +.. index:: compute coord/atom/kk compute coord/atom command ========================== -compute coord/atom/kk command -=================================== +Accelerator Variants: *coord/atom/kk* Syntax """""" @@ -120,7 +120,8 @@ too frequently. ---------- -**Output info:** +Output info +""""""""""" For *cstyle* cutoff, this compute can calculate a per-atom vector or array. If single *type1* keyword is specified (or if none are diff --git a/doc/src/compute_damage_atom.rst b/doc/src/compute_damage_atom.rst index ab17584ccd..2439bd5a1b 100644 --- a/doc/src/compute_damage_atom.rst +++ b/doc/src/compute_damage_atom.rst @@ -40,7 +40,8 @@ This command can be used with all the Peridynamic pair styles. The damage value will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -61,4 +62,7 @@ Related commands :doc:`compute dilatation/atom `, :doc:`compute plasticity/atom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_dihedral.rst b/doc/src/compute_dihedral.rst index ed87b727ec..0bbcb370b5 100644 --- a/doc/src/compute_dihedral.rst +++ b/doc/src/compute_dihedral.rst @@ -31,7 +31,8 @@ group specified for this command is ignored. This compute is useful when using :doc:`dihedral_style hybrid ` if you want to know the portion of the total energy contributed by one or more of the hybrid sub-styles. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length N where N is the number of sub_styles defined by the :doc:`dihedral_style hybrid ` command. which can be accessed by indices @@ -51,4 +52,7 @@ Related commands :doc:`compute pe `, :doc:`compute pair ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_dihedral_local.rst b/doc/src/compute_dihedral_local.rst index 6fd1401292..75c0e69790 100644 --- a/doc/src/compute_dihedral_local.rst +++ b/doc/src/compute_dihedral_local.rst @@ -113,7 +113,8 @@ Here is an example of how to do this: compute 2 all dihedral/local phi dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_1[4] c_1[5] c_2[1] -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of values. The length of the vector or number of rows in the @@ -135,4 +136,7 @@ Related commands :doc:`dump local `, :doc:`compute property/local ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_dilatation_atom.rst b/doc/src/compute_dilatation_atom.rst index 46ebef8220..85b5770c64 100644 --- a/doc/src/compute_dilatation_atom.rst +++ b/doc/src/compute_dilatation_atom.rst @@ -43,7 +43,8 @@ This command can only be used with a subset of the Peridynamic :doc:`pair styles The dilatation value will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -64,4 +65,7 @@ Related commands :doc:`compute damage/atom `, :doc:`compute plasticity/atom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_dipole_chunk.rst b/doc/src/compute_dipole_chunk.rst index f08b1d67d9..d1bc5de4c9 100644 --- a/doc/src/compute_dipole_chunk.rst +++ b/doc/src/compute_dipole_chunk.rst @@ -71,7 +71,8 @@ command, for example: compute myChunk all dipole/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -92,4 +93,7 @@ Related commands :doc:`compute com/chunk ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_displace_atom.rst b/doc/src/compute_displace_atom.rst index cb44d153ac..9079538fd8 100644 --- a/doc/src/compute_displace_atom.rst +++ b/doc/src/compute_displace_atom.rst @@ -121,7 +121,8 @@ would be empty. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a per-atom array with 4 columns, which can be accessed by indices 1-4 by any command that uses per-atom values from @@ -143,4 +144,7 @@ Related commands :doc:`compute msd `, :doc:`dump custom `, :doc:`fix store/state ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_dpd.rst b/doc/src/compute_dpd.rst index c106522b57..a3b68451db 100644 --- a/doc/src/compute_dpd.rst +++ b/doc/src/compute_dpd.rst @@ -46,7 +46,8 @@ where :math:`N` is the number of particles in the system ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 5 (:math:`U^{cond}`, :math:`U^{mech}`, :math:`U^{chem}`, :math:`\theta_{avg}`, :math:`N`), @@ -71,7 +72,10 @@ Related commands :doc:`compute dpd/atom `, :doc:`thermo_style ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_dpd_atom.rst b/doc/src/compute_dpd_atom.rst index d1a683db87..85dc977c52 100644 --- a/doc/src/compute_dpd_atom.rst +++ b/doc/src/compute_dpd_atom.rst @@ -33,7 +33,8 @@ total chemical energy and average internal temperature of the entire system or group of dpd particles. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle array with 4 columns (:math:`u^{cond}`, :math:`u^{mech}`, :math:`u^{chem}`, :math:`\theta`), which can be accessed @@ -60,7 +61,10 @@ Related commands :doc:`dump custom `, :doc:`compute dpd ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_edpd_temp_atom.rst b/doc/src/compute_edpd_temp_atom.rst index 8670e70b48..e31974f98a 100644 --- a/doc/src/compute_edpd_temp_atom.rst +++ b/doc/src/compute_edpd_temp_atom.rst @@ -31,7 +31,8 @@ of each eDPD particle based on the local equilibrium hypothesis. For more details please see :ref:`(Espanol1997) ` and :ref:`(Li2014) `. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See the @@ -51,7 +52,10 @@ Related commands :doc:`pair_style edpd ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_entropy_atom.rst b/doc/src/compute_entropy_atom.rst index 85a180df74..59b0059376 100644 --- a/doc/src/compute_entropy_atom.rst +++ b/doc/src/compute_entropy_atom.rst @@ -109,7 +109,8 @@ and for bcc sodium (lattice constant 4.23 Angstroms), compute 1 all entropy/atom 0.25 7.3 avg yes 5.1 -**Output info:** +Output info +""""""""""" By default, this compute calculates the pair entropy value for each atom as a per-atom vector, which can be accessed by any command that diff --git a/doc/src/compute_erotate_asphere.rst b/doc/src/compute_erotate_asphere.rst index ab0c1fe59b..0210279560 100644 --- a/doc/src/compute_erotate_asphere.rst +++ b/doc/src/compute_erotate_asphere.rst @@ -40,7 +40,8 @@ from its angular momentum if needed. treated as ellipsoids, not ellipses, meaning their moments of inertia will be the same as in 3d. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the KE). This value can be used by any command that uses a global scalar value from a compute as @@ -67,8 +68,15 @@ the :doc:`atom_style tri ` command. All particles in the group must be finite-size. They cannot be point particles. -**Related commands:** none +Related commands +"""""""""""""""" + +none + :doc:`compute erotate/sphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_erotate_rigid.rst b/doc/src/compute_erotate_rigid.rst index f07751eff5..b5b594f781 100644 --- a/doc/src/compute_erotate_rigid.rst +++ b/doc/src/compute_erotate_rigid.rst @@ -38,7 +38,8 @@ compute command is ignored. The rotational energy of all the rigid bodies defined by the fix rigid command in included in the calculation. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the summed rotational energy of all the rigid bodies). This value can be used by any command that @@ -59,4 +60,7 @@ Related commands :doc:`compute ke/rigid ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_erotate_sphere.rst b/doc/src/compute_erotate_sphere.rst index 17656ef0be..c10d13c318 100644 --- a/doc/src/compute_erotate_sphere.rst +++ b/doc/src/compute_erotate_sphere.rst @@ -35,7 +35,8 @@ of inertia for a sphere and w is the particle's angular velocity. spheres, not disks, meaning their moment of inertia will be the same as in 3d. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the KE). This value can be used by any command that uses a global scalar value from a compute as @@ -60,4 +61,7 @@ Related commands :doc:`compute erotate/asphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_erotate_sphere_atom.rst b/doc/src/compute_erotate_sphere_atom.rst index f7450be9c2..b12669ed0c 100644 --- a/doc/src/compute_erotate_sphere_atom.rst +++ b/doc/src/compute_erotate_sphere_atom.rst @@ -39,7 +39,8 @@ The value of the rotational kinetic energy will be 0.0 for atoms not in the specified compute group or for point particles with a radius = 0.0. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -57,4 +58,7 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_event_displace.rst b/doc/src/compute_event_displace.rst index 679e455465..a147ca0d7d 100644 --- a/doc/src/compute_event_displace.rst +++ b/doc/src/compute_event_displace.rst @@ -43,7 +43,8 @@ further than the threshold distance. then this compute will not be able to distinguish that motion from local atom displacements and may generate "false positives." -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the flag). This value can be used by any command that uses a global scalar value from a compute as @@ -65,4 +66,7 @@ Related commands :doc:`prd `, :doc:`tad ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_fep.rst b/doc/src/compute_fep.rst index 50ad50561b..0832d6191a 100644 --- a/doc/src/compute_fep.rst +++ b/doc/src/compute_fep.rst @@ -279,7 +279,8 @@ trajectories during which the volume fluctuates or changes :ref:`(Allen and Tild ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 3 which contains the energy difference ( :math:`U_1-U_0` ) as c_ID[1], the diff --git a/doc/src/compute_global_atom.rst b/doc/src/compute_global_atom.rst index e9adb0317b..1c8ff6c85e 100644 --- a/doc/src/compute_global_atom.rst +++ b/doc/src/compute_global_atom.rst @@ -205,7 +205,8 @@ assignment of global values to atoms. ---------- -**Output info:** +Output info +""""""""""" If a single input is specified this compute produces a per-atom vector. If multiple inputs are specified, this compute produces a @@ -228,4 +229,7 @@ Related commands :doc:`compute `, :doc:`fix `, :doc:`variable `, :doc:`compute chunk/atom `, :doc:`compute reduce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_group_group.rst b/doc/src/compute_group_group.rst index 03ae693b56..b22689d4b3 100644 --- a/doc/src/compute_group_group.rst +++ b/doc/src/compute_group_group.rst @@ -128,7 +128,8 @@ group-group calculations are performed. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the energy) and a global vector of length 3 (force), which can be accessed by indices 1-3. @@ -154,7 +155,11 @@ system and not valid if particles have been moved since. Not all :doc:`Kspace styles ` support the calculation of group/group interactions. The regular *ewald* and *pppm* styles do. -**Related commands:** none +Related commands +"""""""""""""""" + +none + Default """"""" diff --git a/doc/src/compute_gyration.rst b/doc/src/compute_gyration.rst index 42ca1e53e5..da0b14abe8 100644 --- a/doc/src/compute_gyration.rst +++ b/doc/src/compute_gyration.rst @@ -56,7 +56,8 @@ and taking a sqrt() would be invalid. reset the image flags (e.g. to 0) before invoking this compute by using the :doc:`set image ` command. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (:math:`R_g`) and a global vector of length 6 (:math:`{R_g}^2` tensor), which can be accessed by indices 1-6. These @@ -78,4 +79,7 @@ Related commands :doc:`compute gyration/chunk `, :doc:`compute gyration/shape ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_gyration_chunk.rst b/doc/src/compute_gyration_chunk.rst index 2ba632ded1..eaa048c111 100644 --- a/doc/src/compute_gyration_chunk.rst +++ b/doc/src/compute_gyration_chunk.rst @@ -92,7 +92,8 @@ command, for example: compute myChunk all gyration/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global vector if the *tensor* keyword is not specified and a global array if it is. The length of the vector or @@ -112,8 +113,15 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" + +none + :doc:`compute gyration ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_gyration_shape.rst b/doc/src/compute_gyration_shape.rst index 81fc628a21..fced528015 100644 --- a/doc/src/compute_gyration_shape.rst +++ b/doc/src/compute_gyration_shape.rst @@ -63,7 +63,8 @@ is bounded between zero (if all points are spherically symmetric) and one atom. You can reset the image flags (e.g. to 0) before invoking this compute by using the :doc:`set image ` command. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 6, which can be accessed by indices 1-6. The first three values are the @@ -87,7 +88,10 @@ Related commands :doc:`compute gyration ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_gyration_shape_chunk.rst b/doc/src/compute_gyration_shape_chunk.rst index 94904f757d..375dc85134 100644 --- a/doc/src/compute_gyration_shape_chunk.rst +++ b/doc/src/compute_gyration_shape_chunk.rst @@ -64,7 +64,8 @@ The tensor keyword must be specified in the compute gyration/chunk command. atom. You can reset the image flags (e.g. to 0) before invoking this compute by using the :doc:`set image ` command. -**Output info:** +Output info +""""""""""" This compute calculates a global array with six columns, which can be accessed by indices 1-6. The first three columns are the @@ -89,7 +90,10 @@ Related commands :doc:`compute gyration/chunk ` :doc:`compute gyration/shape ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_heat_flux.rst b/doc/src/compute_heat_flux.rst index 1b28c08ae5..3e8469617f 100644 --- a/doc/src/compute_heat_flux.rst +++ b/doc/src/compute_heat_flux.rst @@ -119,7 +119,8 @@ result should be: average conductivity ~0.29 in W/mK. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 6. The first 3 components are the :math:`x`, :math:`y`, :math:`z` @@ -157,7 +158,10 @@ Related commands :doc:`fix ave/correlate `, :doc:`variable ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_hexorder_atom.rst b/doc/src/compute_hexorder_atom.rst index 31f7dbe662..a8e70245df 100644 --- a/doc/src/compute_hexorder_atom.rst +++ b/doc/src/compute_hexorder_atom.rst @@ -97,7 +97,8 @@ too frequently. :doc:`special_bonds ` command that includes all pairs in the neighbor list. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom array with 2 columns, giving the real and imaginary parts :math:`q_n`, a complex number restricted to the diff --git a/doc/src/compute_hma.rst b/doc/src/compute_hma.rst index e00fdde841..5efb133bea 100644 --- a/doc/src/compute_hma.rst +++ b/doc/src/compute_hma.rst @@ -155,7 +155,8 @@ An example input script that uses this compute is included in examples/USER/hma/ along with corresponding LAMMPS output showing that the HMA properties fluctuate less than the corresponding conventional properties. -**Output info:** +Output info +""""""""""" This compute calculates a global vector that includes the n properties requested as arguments to the command (the potential energy, pressure and/or heat @@ -182,7 +183,10 @@ Related commands formulation of the hessian provided by Pair's single_hessian, which is used by this compute. -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_improper.rst b/doc/src/compute_improper.rst index 0a264a74e7..3eb008c3b2 100644 --- a/doc/src/compute_improper.rst +++ b/doc/src/compute_improper.rst @@ -31,7 +31,8 @@ group specified for this command is ignored. This compute is useful when using :doc:`improper_style hybrid ` if you want to know the portion of the total energy contributed by one or more of the hybrid sub-styles. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length N where N is the number of sub_styles defined by the :doc:`improper_style hybrid ` command. which can be accessed by indices @@ -51,4 +52,7 @@ Related commands :doc:`compute pe `, :doc:`compute pair ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_improper_local.rst b/doc/src/compute_improper_local.rst index 7a14daf161..4c4af36149 100644 --- a/doc/src/compute_improper_local.rst +++ b/doc/src/compute_improper_local.rst @@ -60,7 +60,8 @@ Here is an example of how to do this: compute 2 all improper/local chi dump 1 all local 1000 tmp.dump index c_1[1] c_1[2] c_1[3] c_1[4] c_1[5] c_2[1] -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of keywords. The length of the vector or number of rows in the @@ -82,4 +83,7 @@ Related commands :doc:`dump local `, :doc:`compute property/local ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_inertia_chunk.rst b/doc/src/compute_inertia_chunk.rst index f667929807..638a0baec8 100644 --- a/doc/src/compute_inertia_chunk.rst +++ b/doc/src/compute_inertia_chunk.rst @@ -67,7 +67,8 @@ command, for example: compute myChunk all inertia/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -88,4 +89,7 @@ Related commands :doc:`variable inertia() function ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_ke.rst b/doc/src/compute_ke.rst index d98d39247c..786f17b1d8 100644 --- a/doc/src/compute_ke.rst +++ b/doc/src/compute_ke.rst @@ -43,7 +43,8 @@ that calculate temperature can subtract out different non-thermal components of velocity and/or include different degrees of freedom (translational, rotational, etc). -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the summed KE). This value can be used by any command that uses a global scalar value from a @@ -62,4 +63,7 @@ Related commands :doc:`compute erotate/sphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_ke_atom.rst b/doc/src/compute_ke_atom.rst index 42294dbca1..8828ee4e3f 100644 --- a/doc/src/compute_ke_atom.rst +++ b/doc/src/compute_ke_atom.rst @@ -32,7 +32,8 @@ the velocity of each atom. The value of the kinetic energy will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -50,4 +51,7 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_ke_atom_eff.rst b/doc/src/compute_ke_atom_eff.rst index 7aa89d0dfc..3ff9ce0c1f 100644 --- a/doc/src/compute_ke_atom_eff.rst +++ b/doc/src/compute_ke_atom_eff.rst @@ -60,7 +60,8 @@ of freedom in eFF. The value of the kinetic energy will be 0.0 for atoms (nuclei or electrons) not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a scalar quantity for each atom, which can be accessed by any command that uses per-atom computes as input. See the @@ -80,4 +81,7 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_ke_eff.rst b/doc/src/compute_ke_eff.rst index f1cffebc56..874ae8d629 100644 --- a/doc/src/compute_ke_eff.rst +++ b/doc/src/compute_ke_eff.rst @@ -64,7 +64,8 @@ freedom. See :doc:`compute temp/eff `. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the KE). This value can be used by any command that uses a global scalar value from a compute as @@ -80,6 +81,13 @@ Restrictions This compute is part of the USER-EFF package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/compute_ke_rigid.rst b/doc/src/compute_ke_rigid.rst index fd4706de19..c8bd663da7 100644 --- a/doc/src/compute_ke_rigid.rst +++ b/doc/src/compute_ke_rigid.rst @@ -37,7 +37,8 @@ compute command is ignored. The kinetic energy of all the rigid bodies defined by the fix rigid command in included in the calculation. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the summed KE of all the rigid bodies). This value can be used by any command that uses a @@ -58,4 +59,7 @@ Related commands :doc:`compute erotate/rigid ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_mesont.rst b/doc/src/compute_mesont.rst index 654b06c4a3..44d6054e22 100644 --- a/doc/src/compute_mesont.rst +++ b/doc/src/compute_mesont.rst @@ -1,7 +1,7 @@ .. index:: compute mesont compute mesont command -========================== +====================== Syntax """""" @@ -31,7 +31,8 @@ These computes define computations for the stretching (estretch), bending evaluated value is selected by a parameter passed to the compute: estretch, ebend, etube. -**Output info:** +Output info +""""""""""" These computes calculate per-node (per-atom) vectors, which can be accessed by any command that uses per-atom values from a compute as input, and global @@ -52,5 +53,8 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_mliap.rst b/doc/src/compute_mliap.rst index 4ef41f1e47..fcc336e682 100644 --- a/doc/src/compute_mliap.rst +++ b/doc/src/compute_mliap.rst @@ -138,7 +138,8 @@ too frequently. ---------- -**Output info:** +Output info +""""""""""" Compute *mliap* evaluates a global array. The columns are arranged into diff --git a/doc/src/compute_momentum.rst b/doc/src/compute_momentum.rst index af968efb59..bcc5f3d421 100644 --- a/doc/src/compute_momentum.rst +++ b/doc/src/compute_momentum.rst @@ -29,7 +29,8 @@ of a group of particles. The momentum of each particles is computed as m v, where m and v are the mass and velocity of the particle. -**Output info:** +Output info +""""""""""" This compute calculates a global vector (the summed momentum) of length 3. This value can be used by any command that uses a global @@ -48,4 +49,7 @@ LAMMPS was built with that package. See the :doc:`Build package Related commands """""""""""""""" -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_msd.rst b/doc/src/compute_msd.rst index f88e960802..02b5550093 100644 --- a/doc/src/compute_msd.rst +++ b/doc/src/compute_msd.rst @@ -95,7 +95,8 @@ solids undergoing thermal motion. with subsequent positions as if they were from a single sample, instead of many, which will change the values of msd somewhat. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 4, which can be accessed by indices 1-4 by any command that uses global vector values diff --git a/doc/src/compute_msd_chunk.rst b/doc/src/compute_msd_chunk.rst index d9cd83c3e0..ee2c4612d7 100644 --- a/doc/src/compute_msd_chunk.rst +++ b/doc/src/compute_msd_chunk.rst @@ -105,7 +105,8 @@ command, for example: compute myChunk all msd/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -126,4 +127,7 @@ Related commands :doc:`compute msd ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_msd_nongauss.rst b/doc/src/compute_msd_nongauss.rst index 267269ec4b..63d8deb2cd 100644 --- a/doc/src/compute_msd_nongauss.rst +++ b/doc/src/compute_msd_nongauss.rst @@ -59,7 +59,8 @@ displacement of each atom is calculated. See the :doc:`compute msd ` doc page for further important NOTEs, which also apply to this compute. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 3, which can be accessed by indices 1-3 by any command that uses global vector values diff --git a/doc/src/compute_omega_chunk.rst b/doc/src/compute_omega_chunk.rst index 73895b585c..d0af88b1a4 100644 --- a/doc/src/compute_omega_chunk.rst +++ b/doc/src/compute_omega_chunk.rst @@ -68,7 +68,8 @@ command, for example: compute myChunk all omega/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -89,4 +90,7 @@ Related commands :doc:`variable omega() function ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_orientorder_atom.rst b/doc/src/compute_orientorder_atom.rst index f176fdd30c..2a36fb4cc0 100644 --- a/doc/src/compute_orientorder_atom.rst +++ b/doc/src/compute_orientorder_atom.rst @@ -1,10 +1,10 @@ .. index:: compute orientorder/atom +.. index:: compute orientorder/atom/kk compute orientorder/atom command ================================ -compute orientorder/atom/kk command -=================================== +Accelerator Variants: *orientorder/atom/kk* Syntax """""" @@ -151,7 +151,8 @@ too frequently. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a per-atom array with *nlvalues* columns, giving the :math:`Q_l` values for each atom, which are real numbers on the diff --git a/doc/src/compute_pair.rst b/doc/src/compute_pair.rst index 40c758ebf0..1b074203aa 100644 --- a/doc/src/compute_pair.rst +++ b/doc/src/compute_pair.rst @@ -68,7 +68,8 @@ potential energy into 14 components is tallied by the :doc:`pair_style reax/c

` for info on these values. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar which is *epair* or *evdwl* or *ecoul*\ . If the pair style supports it, it also calculates a global diff --git a/doc/src/compute_pair_local.rst b/doc/src/compute_pair_local.rst index 31030cd97e..e269aaadfe 100644 --- a/doc/src/compute_pair_local.rst +++ b/doc/src/compute_pair_local.rst @@ -138,7 +138,8 @@ Here is an example of how to do this: computed in the pair style. Hence in that case, those atom pairs will be part of the local data created by this command. -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of keywords. The length of the vector or number of rows in the diff --git a/doc/src/compute_pe.rst b/doc/src/compute_pe.rst index 813b577490..4597ea7533 100644 --- a/doc/src/compute_pe.rst +++ b/doc/src/compute_pe.rst @@ -65,7 +65,8 @@ See the "thermo_style" command for more details. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the potential energy). This value can be used by any command that uses a global scalar value from @@ -84,4 +85,7 @@ Related commands :doc:`compute pe/atom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_pe_atom.rst b/doc/src/compute_pe_atom.rst index b616cecd89..91aaaf867c 100644 --- a/doc/src/compute_pe_atom.rst +++ b/doc/src/compute_pe_atom.rst @@ -84,7 +84,8 @@ in the last 2 columns of thermo output: corrections to the energy added by the :doc:`pair_modify tail yes ` command, since those are contributions to the global system energy. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -101,7 +102,10 @@ Related commands :doc:`compute pe `, :doc:`compute stress/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_plasticity_atom.rst b/doc/src/compute_plasticity_atom.rst index 939017f5e9..b78f706afd 100644 --- a/doc/src/compute_plasticity_atom.rst +++ b/doc/src/compute_plasticity_atom.rst @@ -38,7 +38,8 @@ This command can be invoked for one of the Peridynamic :doc:`pair styles `, :doc:`compute dilatation/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_pressure.rst b/doc/src/compute_pressure.rst index 57e5bc26ef..b89d17bc5a 100644 --- a/doc/src/compute_pressure.rst +++ b/doc/src/compute_pressure.rst @@ -116,7 +116,8 @@ where "thermo_temp" is the ID of a similarly defined compute of style ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the pressure) and a global vector of length 6 (pressure tensor), which can be accessed by indices @@ -138,7 +139,10 @@ Related commands :doc:`compute temp `, :doc:`compute stress/atom `, :doc:`thermo_style `, -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_pressure_cylinder.rst b/doc/src/compute_pressure_cylinder.rst index 104e68d533..d1102cd9bc 100644 --- a/doc/src/compute_pressure_cylinder.rst +++ b/doc/src/compute_pressure_cylinder.rst @@ -41,7 +41,8 @@ number density, P_rhorho, P_phiphi, and P_zz. The number of rows is governed by the values of Rmax and bin_width. Pressure tensor values are output in pressure units. -**Output info:** +Output info +""""""""""" This compute calculates a global array with 5 columns and Rmax/bin_width rows. The output columns are: R (distance units), number density (inverse @@ -75,7 +76,10 @@ Related commands :doc:`compute temp `, :doc:`compute stress/atom `, :doc:`thermo_style `, -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_pressure_uef.rst b/doc/src/compute_pressure_uef.rst index 07302ba46d..bdd212cf5c 100644 --- a/doc/src/compute_pressure_uef.rst +++ b/doc/src/compute_pressure_uef.rst @@ -59,4 +59,7 @@ Related commands :doc:`fix nvt/uef `, :doc:`compute temp/uef ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_property_atom.rst b/doc/src/compute_property_atom.rst index 021518713d..ec9322bb7b 100644 --- a/doc/src/compute_property_atom.rst +++ b/doc/src/compute_property_atom.rst @@ -160,7 +160,8 @@ floating-point properties that have been added to each atom via the command is used specific names are given to each attribute which are what is specified as the "name" portion of *i_name* or *d_name*. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector or per-atom array depending on the number of input values. If a single input is specified, a @@ -189,4 +190,7 @@ Related commands :doc::doc:`fix ave/atom `, :doc:`fix ave/chunk :doc:`, `fix property/atom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_property_chunk.rst b/doc/src/compute_property_chunk.rst index e567c96a80..246ab09120 100644 --- a/doc/src/compute_property_chunk.rst +++ b/doc/src/compute_property_chunk.rst @@ -88,7 +88,8 @@ command, for example: compute myChunk2 all com/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk1 c_myChunk2[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global vector or global array depending on the number of input values. The length of the vector or number of @@ -116,4 +117,7 @@ Related commands :doc:`fix ave/chunk ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_property_local.rst b/doc/src/compute_property_local.rst index 4e29bb7fc0..dd92334266 100644 --- a/doc/src/compute_property_local.rst +++ b/doc/src/compute_property_local.rst @@ -140,7 +140,8 @@ The attributes that start with "a", "d", "i", refer to similar values for :doc:`angles `, :doc:`dihedrals `, and :doc:`impropers `. -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of input values. The length of the vector or number of rows in diff --git a/doc/src/compute_ptm_atom.rst b/doc/src/compute_ptm_atom.rst index 112ed1ea6a..fb590f6e4c 100644 --- a/doc/src/compute_ptm_atom.rst +++ b/doc/src/compute_ptm_atom.rst @@ -84,7 +84,8 @@ too frequently or to have multiple compute/dump commands, each with a unless the optional *group2-ID* argument is given, then only members of that group are considered as neighbors. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom array, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -120,7 +121,10 @@ Related commands :doc:`compute centro/atom ` :doc:`compute cna/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_rdf.rst b/doc/src/compute_rdf.rst index 9f292accd1..a9e6674816 100644 --- a/doc/src/compute_rdf.rst +++ b/doc/src/compute_rdf.rst @@ -152,7 +152,8 @@ example: compute myRDF all rdf 50 fix 1 all ave/time 100 1 100 c_myRDF[*] file tmp.rdf mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array with the number of rows = *Nbins*\ , and the number of columns = 1 + 2\*Npairs, where Npairs is the diff --git a/doc/src/compute_reduce.rst b/doc/src/compute_reduce.rst index 7599343d2e..660ef87042 100644 --- a/doc/src/compute_reduce.rst +++ b/doc/src/compute_reduce.rst @@ -1,4 +1,5 @@ .. index:: compute reduce +.. index:: compute reduce/region compute reduce command ====================== @@ -52,7 +53,7 @@ Examples compute 1 all reduce sum c_force compute 1 all reduce/region subbox sum c_force compute 2 all reduce min c_press[2] f_ave v_myKE - compute 2 all reduce min c_press[\*] f_ave v_myKE + compute 2 all reduce min c_press[*] f_ave v_myKE compute 3 fluid reduce max c_index[1] c_index[2] c_dist replace 1 3 replace 2 3 Description @@ -196,7 +197,8 @@ values are desired, this compute can be accessed by the :doc:`thermo_style custo ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar if a single input value is specified or a global vector of length N where N is the number of @@ -222,4 +224,7 @@ Related commands :doc:`compute `, :doc:`fix `, :doc:`variable ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_reduce_chunk.rst b/doc/src/compute_reduce_chunk.rst index 34619efd06..07edda4569 100644 --- a/doc/src/compute_reduce_chunk.rst +++ b/doc/src/compute_reduce_chunk.rst @@ -160,7 +160,8 @@ handful of large micelles. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global vector if a single input value is specified, otherwise a global array is output. The number of columns @@ -184,4 +185,7 @@ Related commands :doc:`compute chunk/atom `, :doc:`compute reduce `, :doc:`compute chunk/spread/atom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_rigid_local.rst b/doc/src/compute_rigid_local.rst index 4fc0f3c2dd..f7bb6d6166 100644 --- a/doc/src/compute_rigid_local.rst +++ b/doc/src/compute_rigid_local.rst @@ -150,7 +150,8 @@ LAMMPS. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a local vector or local array depending on the number of keywords. The length of the vector or number of rows in the @@ -187,4 +188,7 @@ Related commands :doc:`dump local `, :doc:`compute reduce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_saed.rst b/doc/src/compute_saed.rst index 7ee5b91dab..1057208900 100644 --- a/doc/src/compute_saed.rst +++ b/doc/src/compute_saed.rst @@ -57,8 +57,8 @@ is computed from the structure factor F using the equations: .. math:: - I = & \frac{F^{*}F}{N} \\ - F(\mathbf{k}) = & \sum_{j=1}^{N}f_j(\theta)exp(2\pi i \mathbf{k} \cdot \mathbf{r}_j) + I = & \frac{F^{*}F}{N} \\ + F(\mathbf{k}) = & \sum_{j=1}^{N}f_j(\theta)exp(2\pi i \mathbf{k} \cdot \mathbf{r}_j) Here, K is the location of the reciprocal lattice node, :math:`r_j` is the position of each atom, :math:`f_j` are atomic scattering factors. @@ -116,8 +116,8 @@ The analytic approximation is computed using the formula .. math:: - f_j\left ( \frac{sin(\theta)}{\lambda} \right )=\sum_{i}^{5} - a_i exp\left ( -b_i \frac{sin^{2}(\theta)}{\lambda^{2}} \right ) + f_j\left ( \frac{sin(\theta)}{\lambda} \right )=\sum_{i}^{5} + a_i exp\left ( -b_i \frac{sin^{2}(\theta)}{\lambda^{2}} \right ) Coefficients parameterized by :ref:`(Fox) ` are assigned for each atom type designating the chemical symbol and charge of each atom @@ -228,7 +228,8 @@ type. Valid chemical symbols for compute saed are: If the *echo* keyword is specified, compute saed will provide extra reporting information to the screen. -**Output info:** +Output info +""""""""""" This compute calculates a global vector. The length of the vector is the number of reciprocal lattice nodes that are explored by the mesh. diff --git a/doc/src/compute_slice.rst b/doc/src/compute_slice.rst index c8211269bc..2d558b871f 100644 --- a/doc/src/compute_slice.rst +++ b/doc/src/compute_slice.rst @@ -89,7 +89,8 @@ of columns equal to the number of inputs specified. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global vector if a single input value is specified or a global array with N columns where N is the number of @@ -123,4 +124,7 @@ Related commands :doc:`compute `, :doc:`fix `, :doc:`compute reduce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_contact_radius.rst b/doc/src/compute_smd_contact_radius.rst index 01c543af38..71630b827d 100644 --- a/doc/src/compute_smd_contact_radius.rst +++ b/doc/src/compute_smd_contact_radius.rst @@ -35,7 +35,8 @@ Mach Dynamics in LAMMPS. The value of the contact radius will be 0.0 for particles not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -55,4 +56,7 @@ Related commands :doc:`dump custom ` smd/hertz smd/tri_surface -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_damage.rst b/doc/src/compute_smd_damage.rst index 3f02ac5c74..ee3671e20c 100644 --- a/doc/src/compute_smd_damage.rst +++ b/doc/src/compute_smd_damage.rst @@ -48,4 +48,7 @@ Related commands :doc:`smd/plastic_strain `, :doc:`smd/tlsph_stress ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_hourglass_error.rst b/doc/src/compute_smd_hourglass_error.rst index 56b8a81c01..980d31454e 100644 --- a/doc/src/compute_smd_hourglass_error.rst +++ b/doc/src/compute_smd_hourglass_error.rst @@ -56,7 +56,8 @@ LAMMPS was built with that package. See the :doc:`Build package This quantity will be computed only for particles which interact with tlsph pair style. -**Related Commands:** +Related commands +"""""""""""""""" :doc:`smd/tlsph_defgrad ` diff --git a/doc/src/compute_smd_internal_energy.rst b/doc/src/compute_smd_internal_energy.rst index 7613d5bb3e..c4df459d5f 100644 --- a/doc/src/compute_smd_internal_energy.rst +++ b/doc/src/compute_smd_internal_energy.rst @@ -29,7 +29,8 @@ the sum of potential energy and heat. See `this PDF guide `_ to use Smooth Mach Dynamics in LAMMPS. -**Output Info:** +Output Info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -46,7 +47,10 @@ LAMMPS was built with that package. See the :doc:`Build package only be used for particles which interact via the updated Lagrangian or total Lagrangian SPH pair styles. -**Related Commands:** +Related commands +"""""""""""""""" + +none Default """"""" diff --git a/doc/src/compute_smd_plastic_strain.rst b/doc/src/compute_smd_plastic_strain.rst index 772169310f..81bacdc4bb 100644 --- a/doc/src/compute_smd_plastic_strain.rst +++ b/doc/src/compute_smd_plastic_strain.rst @@ -54,4 +54,7 @@ Related commands :doc:`smd/tlsph/strain/rate `, :doc:`smd/tlsph/strain ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_plastic_strain_rate.rst b/doc/src/compute_smd_plastic_strain_rate.rst index 7b0480a211..cdcd377b41 100644 --- a/doc/src/compute_smd_plastic_strain_rate.rst +++ b/doc/src/compute_smd_plastic_strain_rate.rst @@ -54,4 +54,7 @@ Related commands :doc:`smd/tlsph/strain/rate `, :doc:`smd/tlsph/strain ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_rho.rst b/doc/src/compute_smd_rho.rst index 50c74b8c26..e7cdb8a9d3 100644 --- a/doc/src/compute_smd_rho.rst +++ b/doc/src/compute_smd_rho.rst @@ -31,7 +31,8 @@ due to mechanical deformation. See `this PDF guide `_ to use Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -51,4 +52,7 @@ Related commands :doc:`compute smd/vol ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_defgrad.rst b/doc/src/compute_smd_tlsph_defgrad.rst index c599b82709..d74b684c5d 100644 --- a/doc/src/compute_smd_tlsph_defgrad.rst +++ b/doc/src/compute_smd_tlsph_defgrad.rst @@ -30,7 +30,8 @@ Total-Lagrangian SPH pair style. See `this PDF guide `_ to use Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute outputs a per-particle vector of vectors (tensors), which can be accessed by any command that uses per-particle values @@ -56,4 +57,7 @@ Related commands :doc:`smd/hourglass/error ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_dt.rst b/doc/src/compute_smd_tlsph_dt.rst index 7835f0642d..888140c534 100644 --- a/doc/src/compute_smd_tlsph_dt.rst +++ b/doc/src/compute_smd_tlsph_dt.rst @@ -35,7 +35,8 @@ stable time increment accessible for output purposes. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -58,4 +59,7 @@ Related commands :doc:`smd/adjust/dt ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_num_neighs.rst b/doc/src/compute_smd_tlsph_num_neighs.rst index 202f1640d6..5d34f1acef 100644 --- a/doc/src/compute_smd_tlsph_num_neighs.rst +++ b/doc/src/compute_smd_tlsph_num_neighs.rst @@ -30,7 +30,8 @@ Total-Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -53,4 +54,7 @@ Related commands :doc:`smd/ulsph/num/neighs ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_shape.rst b/doc/src/compute_smd_tlsph_shape.rst index f4ed10a232..d9ce1e3d9a 100644 --- a/doc/src/compute_smd_tlsph_shape.rst +++ b/doc/src/compute_smd_tlsph_shape.rst @@ -31,7 +31,8 @@ Total-Lagrangian SPH pair style. See `this PDF guide `_ to use Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector of vectors, which can be accessed by any command that uses per-particle values from a compute @@ -60,4 +61,7 @@ Related commands :doc:`smd/contact/radius ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_strain.rst b/doc/src/compute_smd_tlsph_strain.rst index 24c5937462..b89311eb4b 100644 --- a/doc/src/compute_smd_tlsph_strain.rst +++ b/doc/src/compute_smd_tlsph_strain.rst @@ -29,7 +29,8 @@ for particles interacting via the Total-Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector of vectors (tensors), which can be accessed by any command that uses per-particle values @@ -57,4 +58,7 @@ Related commands :doc:`smd/tlsph/strain/rate `, :doc:`smd/tlsph/stress ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_strain_rate.rst b/doc/src/compute_smd_tlsph_strain_rate.rst index 0eb68432c1..d1fc399b42 100644 --- a/doc/src/compute_smd_tlsph_strain_rate.rst +++ b/doc/src/compute_smd_tlsph_strain_rate.rst @@ -29,7 +29,8 @@ particles interacting via the Total-Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector of vectors (tensors), which can be accessed by any command that uses per-particle values @@ -55,4 +56,7 @@ Related commands :doc:`compute smd/tlsph/strain `, :doc:`compute smd/tlsph/stress ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_tlsph_stress.rst b/doc/src/compute_smd_tlsph_stress.rst index 10d01ea9c0..d3711954c5 100644 --- a/doc/src/compute_smd_tlsph_stress.rst +++ b/doc/src/compute_smd_tlsph_stress.rst @@ -29,7 +29,8 @@ particles interacting via the Total-Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector of vectors (tensors), which can be accessed by any command that uses per-particle values @@ -57,4 +58,7 @@ Related commands :doc:`compute smd/tlsph/strain `, :doc:`cmopute smd/tlsph/strain/rate ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_triangle_vertices.rst b/doc/src/compute_smd_triangle_vertices.rst index ad33df3ef8..d797891618 100644 --- a/doc/src/compute_smd_triangle_vertices.rst +++ b/doc/src/compute_smd_triangle_vertices.rst @@ -29,7 +29,8 @@ corresponding to the triangle-elements of a mesh created by the :doc:`fix smd/wa See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute returns a per-particle vector of vectors, which can be accessed by any command that uses per-particle values from a compute @@ -61,4 +62,7 @@ Related commands :doc:`fix smd/move/tri/surf `, :doc:`fix smd/wall_surface ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_ulsph_effm.rst b/doc/src/compute_smd_ulsph_effm.rst index 94b1a6b6fe..ff12f9cdac 100644 --- a/doc/src/compute_smd_ulsph_effm.rst +++ b/doc/src/compute_smd_ulsph_effm.rst @@ -1,7 +1,7 @@ .. index:: compute smd/ulsph/effm compute smd/ulsph/effm command -================================ +============================== Syntax """""" @@ -29,7 +29,8 @@ particles interacting via the updated Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -53,4 +54,7 @@ Related commands :doc:`pair smd/ulsph ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_ulsph_num_neighs.rst b/doc/src/compute_smd_ulsph_num_neighs.rst index 70824fc517..3579a88079 100644 --- a/doc/src/compute_smd_ulsph_num_neighs.rst +++ b/doc/src/compute_smd_ulsph_num_neighs.rst @@ -30,7 +30,8 @@ the updated Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute returns a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -52,4 +53,7 @@ Related commands :doc:`compute smd/tlsph/num/neighs ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_ulsph_strain.rst b/doc/src/compute_smd_ulsph_strain.rst index dbf6751bf7..09f06b084b 100644 --- a/doc/src/compute_smd_ulsph_strain.rst +++ b/doc/src/compute_smd_ulsph_strain.rst @@ -29,7 +29,8 @@ particles interacting via the updated Lagrangian SPH pair style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle tensor, which can be accessed by any command that uses per-particle values from a compute as input. @@ -55,4 +56,7 @@ Related commands :doc:`compute smd/tlsph/strain ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_ulsph_strain_rate.rst b/doc/src/compute_smd_ulsph_strain_rate.rst index 7f911e9332..391367321a 100644 --- a/doc/src/compute_smd_ulsph_strain_rate.rst +++ b/doc/src/compute_smd_ulsph_strain_rate.rst @@ -30,7 +30,8 @@ style. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector of vectors (tensors), which can be accessed by any command that uses per-particle values @@ -56,4 +57,7 @@ Related commands :doc:`compute smd/tlsph/strain/rate ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_ulsph_stress.rst b/doc/src/compute_smd_ulsph_stress.rst index c74b37508a..e1db7640a6 100644 --- a/doc/src/compute_smd_ulsph_stress.rst +++ b/doc/src/compute_smd_ulsph_stress.rst @@ -28,7 +28,8 @@ Define a computation that outputs the Cauchy stress tensor. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector of vectors (tensors), which can be accessed by any command that uses per-particle values @@ -55,4 +56,7 @@ Related commands :doc:`compute smd/ulsph/strain `, :doc:`compute smd/ulsph/strain/rate ` :doc:`compute smd/tlsph/stress ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_smd_vol.rst b/doc/src/compute_smd_vol.rst index abcc6fca22..4f9314ac32 100644 --- a/doc/src/compute_smd_vol.rst +++ b/doc/src/compute_smd_vol.rst @@ -29,7 +29,8 @@ of the per-particle volumes of the group for which the fix is defined. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Output info:** +Output info +""""""""""" This compute calculates a per-particle vector, which can be accessed by any command that uses per-particle values from a compute as input. @@ -53,4 +54,7 @@ Related commands :doc:`compute smd/rho ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_sna_atom.rst b/doc/src/compute_sna_atom.rst index 4c8c7e1383..08b06a32ec 100644 --- a/doc/src/compute_sna_atom.rst +++ b/doc/src/compute_sna_atom.rst @@ -1,4 +1,7 @@ .. index:: compute sna/atom +.. index:: compute snad/atom +.. index:: compute snav/atom +.. index:: compute snap compute sna/atom command ======================== @@ -310,7 +313,8 @@ are not both set or not both unset. ---------- -**Output info:** +Output info +""""""""""" Compute *sna/atom* calculates a per-atom array, each column corresponding to a particular bispectrum component. The total number diff --git a/doc/src/compute_sph_e_atom.rst b/doc/src/compute_sph_e_atom.rst index f35976ed10..17591257f2 100644 --- a/doc/src/compute_sph_e_atom.rst +++ b/doc/src/compute_sph_e_atom.rst @@ -1,7 +1,7 @@ .. index:: compute sph/e/atom compute sph/e/atom command -=========================== +========================== Syntax """""" @@ -36,7 +36,8 @@ LAMMPS. The value of the internal energy will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -56,4 +57,7 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_sph_rho_atom.rst b/doc/src/compute_sph_rho_atom.rst index 4237bf0bf5..c422a5ecbb 100644 --- a/doc/src/compute_sph_rho_atom.rst +++ b/doc/src/compute_sph_rho_atom.rst @@ -1,7 +1,7 @@ .. index:: compute sph/rho/atom compute sph/rho/atom command -============================= +============================ Syntax """""" @@ -35,7 +35,8 @@ LAMMPS. The value of the SPH density will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -55,4 +56,7 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_sph_t_atom.rst b/doc/src/compute_sph_t_atom.rst index 1766e1d712..922adfff58 100644 --- a/doc/src/compute_sph_t_atom.rst +++ b/doc/src/compute_sph_t_atom.rst @@ -1,7 +1,7 @@ .. index:: compute sph/t/atom compute sph/t/atom command -=========================== +========================== Syntax """""" @@ -40,7 +40,8 @@ LAMMPS. The value of the internal energy will be 0.0 for atoms not in the specified compute group. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See @@ -60,4 +61,7 @@ Related commands :doc:`dump custom ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_spin.rst b/doc/src/compute_spin.rst index 49243e9650..aaf9d8cc74 100644 --- a/doc/src/compute_spin.rst +++ b/doc/src/compute_spin.rst @@ -55,7 +55,8 @@ the total magnetization, and the magnetic temperature. Three variables are assigned to those quantities. The thermo and thermo_style commands print them every 10 timesteps. -**Output info:** +Output info +""""""""""" The array values are "intensive". The array values will be in metal units (:doc:`units `). @@ -71,7 +72,9 @@ has to be "spin" for this compute to be valid. none -**Default:** +Default +""""""" + none diff --git a/doc/src/compute_stress_atom.rst b/doc/src/compute_stress_atom.rst index b8b3cb0ea1..16afd49548 100644 --- a/doc/src/compute_stress_atom.rst +++ b/doc/src/compute_stress_atom.rst @@ -1,4 +1,5 @@ .. index:: compute stress/atom +.. index:: compute centroid/stress/atom compute stress/atom command =========================== @@ -209,7 +210,8 @@ result. I.e. the last 2 columns of thermo output will be the same: corrections to the pressure added by the :doc:`pair_modify tail yes ` command, since those are contributions to the global system pressure. -**Output info:** +Output info +""""""""""" This compute *stress/atom* calculates a per-atom array with 6 columns, which can be accessed by indices 1-6 by any command that uses per-atom values from @@ -238,7 +240,10 @@ Related commands :doc:`compute pe `, :doc:`compute pressure ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_stress_mop.rst b/doc/src/compute_stress_mop.rst index 83a8374702..d68bafa48b 100644 --- a/doc/src/compute_stress_mop.rst +++ b/doc/src/compute_stress_mop.rst @@ -1,4 +1,5 @@ .. index:: compute stress/mop +.. index:: compute stress/mop/profile compute stress/mop command ========================== @@ -27,14 +28,16 @@ Syntax origin = *lower* or *center* or *upper* or coordinate value (distance units) is the position of the first plane delta = value (distance units) is the distance between planes +.. code-block:: LAMMPS + compute 1 all stress/mop x lower total compute 1 liquid stress/mop z 0.0 kin conf - fix 1 all ave/time 10 1000 10000 c_1[\*] file mop.time + fix 1 all ave/time 10 1000 10000 c_1[*] file mop.time fix 1 all ave/time 10 1000 10000 c_1[2] file mop.time compute 1 all stress/mop/profile x lower 0.1 total compute 1 liquid stress/mop/profile z 0.0 0.25 kin conf - fix 1 all ave/time 500 20 10000 c_1[\*] ave running overwrite file mopp.time mode vector + fix 1 all ave/time 500 20 10000 c_1[*] ave running overwrite file mopp.time mode vector Description """"""""""" @@ -67,7 +70,8 @@ NOTE 1: The configurational stress is computed considering all pairs of atoms wh NOTE 2: The local stress does not include any Lennard-Jones tail corrections to the pressure added by the :doc:`pair_modify tail yes ` command, since those are contributions to the global system pressure. -**Output info:** +Output info +""""""""""" Compute *stress/mop* calculates a global vector (indices starting at 1), with 3 values for each declared keyword (in the order the keywords have been @@ -105,7 +109,10 @@ Related commands :doc:`compute stress/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_tally.rst b/doc/src/compute_tally.rst index f49c872306..6487618516 100644 --- a/doc/src/compute_tally.rst +++ b/doc/src/compute_tally.rst @@ -1,4 +1,8 @@ .. index:: compute force/tally +.. index:: compute heat/flux/tally +.. index:: compute pe/tally +.. index:: compute pe/mol/tally +.. index:: compute stress/tally compute force/tally command =========================== @@ -63,7 +67,8 @@ pairwise property computations. ---------- -**Output info:** +Output info +""""""""""" Compute *pe/tally* calculates a global scalar (the energy) and a per atom scalar (the contributions of the single atom to the global @@ -105,4 +110,7 @@ Related commands *compute group/group*\ _compute_group_group.html, *compute heat/flux*\ _compute_heat_flux.html -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_tdpd_cc_atom.rst b/doc/src/compute_tdpd_cc_atom.rst index 00eee60f62..dc18145e72 100644 --- a/doc/src/compute_tdpd_cc_atom.rst +++ b/doc/src/compute_tdpd_cc_atom.rst @@ -32,7 +32,8 @@ The chemical concentration of each species is defined as the number of molecules carried by a tDPD particle for dilute solution. For more details see :ref:`(Li2015) `. -**Output info:** +Output info +""""""""""" This compute calculates a per-atom vector, which can be accessed by any command that uses per-atom values from a compute as input. See the @@ -53,7 +54,10 @@ Related commands :doc:`pair_style tdpd ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_temp.rst b/doc/src/compute_temp.rst index 81186c8cbc..a82046367e 100644 --- a/doc/src/compute_temp.rst +++ b/doc/src/compute_temp.rst @@ -1,10 +1,10 @@ .. index:: compute temp +.. index:: compute temp/kk compute temp command ==================== -compute temp/kk command -======================= +Accelerator Variants: *temp/kk* Syntax """""" @@ -73,7 +73,8 @@ thermostatting. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -96,4 +97,7 @@ Related commands :doc:`compute temp/partial `, :doc:`compute temp/region `, :doc:`compute pressure ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_asphere.rst b/doc/src/compute_temp_asphere.rst index 46fadc2ff5..ef04cad327 100644 --- a/doc/src/compute_temp_asphere.rst +++ b/doc/src/compute_temp_asphere.rst @@ -123,7 +123,8 @@ rotational degrees of freedom. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -156,4 +157,7 @@ Related commands :doc:`compute temp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_body.rst b/doc/src/compute_temp_body.rst index 75477eff36..f334c1e11b 100644 --- a/doc/src/compute_temp_body.rst +++ b/doc/src/compute_temp_body.rst @@ -103,7 +103,8 @@ rotational degrees of freedom. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -132,4 +133,7 @@ Related commands :doc:`compute temp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_chunk.rst b/doc/src/compute_temp_chunk.rst index 89bef3a327..77e2568fce 100644 --- a/doc/src/compute_temp_chunk.rst +++ b/doc/src/compute_temp_chunk.rst @@ -201,7 +201,8 @@ molecule. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. diff --git a/doc/src/compute_temp_com.rst b/doc/src/compute_temp_com.rst index b21db2ac27..07ae9ad648 100644 --- a/doc/src/compute_temp_com.rst +++ b/doc/src/compute_temp_com.rst @@ -67,7 +67,8 @@ See the :doc:`Howto thermostat ` doc page for a discussion of different ways to compute temperature and perform thermostatting. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -90,4 +91,7 @@ Related commands :doc:`compute temp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_cs.rst b/doc/src/compute_temp_cs.rst index edd1d0b139..6b9f0a7e83 100644 --- a/doc/src/compute_temp_cs.rst +++ b/doc/src/compute_temp_cs.rst @@ -84,7 +84,8 @@ The internal energy of core/shell pairs can be calculated by the defined as core/shell pairs. See the :doc:`Howto coreshell ` doc page doc page for more discussion on how to do this. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -109,7 +110,10 @@ Related commands :doc:`compute temp `, :doc:`compute temp/chunk ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_temp_deform.rst b/doc/src/compute_temp_deform.rst index d73670485b..026064000c 100644 --- a/doc/src/compute_temp_deform.rst +++ b/doc/src/compute_temp_deform.rst @@ -108,7 +108,8 @@ See the :doc:`Howto thermostat ` doc page for a discussion of different ways to compute temperature and perform thermostatting. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -132,4 +133,7 @@ Related commands :doc:`compute temp/ramp `, :doc:`compute temp/profile `, :doc:`fix deform `, :doc:`fix nvt/sllod ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_deform_eff.rst b/doc/src/compute_temp_deform_eff.rst index b5d6659573..03be4a89fd 100644 --- a/doc/src/compute_temp_deform_eff.rst +++ b/doc/src/compute_temp_deform_eff.rst @@ -43,7 +43,8 @@ translational degrees of freedom for each nuclei or electron are affected by the streaming velocity adjustment. The radial velocity component of the electrons is not affected. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -69,4 +70,7 @@ Related commands :doc:`compute temp/ramp `, :doc:`fix deform `, :doc:`fix nvt/sllod/eff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_drude.rst b/doc/src/compute_temp_drude.rst index 8cb9849a24..418f2e1e5d 100644 --- a/doc/src/compute_temp_drude.rst +++ b/doc/src/compute_temp_drude.rst @@ -43,7 +43,8 @@ velocities of the Drude particles with respect to their cores. Non-polarizable atoms are considered as cores. Their velocities contribute to the temperature of the cores. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6, which can be accessed by indices 1-6, whose components @@ -76,4 +77,7 @@ Related commands :doc:`fix drude `, :doc:`fix langevin/drude `, :doc:`fix drude/transform `, :doc:`pair_style thole `, :doc:`compute temp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_eff.rst b/doc/src/compute_temp_eff.rst index 84a2028920..6bbad345e2 100644 --- a/doc/src/compute_temp_eff.rst +++ b/doc/src/compute_temp_eff.rst @@ -78,7 +78,8 @@ See the :doc:`Howto thermostat ` doc page for a discussion of different ways to compute temperature and perform thermostatting. -**Output info:** +Output info +""""""""""" The scalar value calculated by this compute is "intensive", meaning it is independent of the number of atoms in the simulation. The vector @@ -96,4 +97,7 @@ Related commands :doc:`compute temp/partial `, :doc:`compute temp/region `, :doc:`compute pressure ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_partial.rst b/doc/src/compute_temp_partial.rst index bcc7a92f84..fc3bfc5c88 100644 --- a/doc/src/compute_temp_partial.rst +++ b/doc/src/compute_temp_partial.rst @@ -73,7 +73,8 @@ thermostatting. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -96,4 +97,7 @@ Related commands :doc:`compute temp `, :doc:`compute temp/region `, :doc:`compute pressure ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_profile.rst b/doc/src/compute_temp_profile.rst index 53870fa300..0fa8ce5807 100644 --- a/doc/src/compute_temp_profile.rst +++ b/doc/src/compute_temp_profile.rst @@ -134,7 +134,8 @@ thermostatting. Using this compute in conjunction with a thermostatting fix, as explained there, will effectively implement a profile-unbiased thermostat (PUT), as described in :ref:`(Evans) `. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature). Depending on the setting of the *out* keyword, it also calculates a global diff --git a/doc/src/compute_temp_ramp.rst b/doc/src/compute_temp_ramp.rst index 4ac22bdfef..078ac66002 100644 --- a/doc/src/compute_temp_ramp.rst +++ b/doc/src/compute_temp_ramp.rst @@ -88,7 +88,8 @@ See the :doc:`Howto thermostat ` doc page for a discussion of different ways to compute temperature and perform thermostatting. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. diff --git a/doc/src/compute_temp_region.rst b/doc/src/compute_temp_region.rst index e207d75d9f..5bf80c8f09 100644 --- a/doc/src/compute_temp_region.rst +++ b/doc/src/compute_temp_region.rst @@ -81,7 +81,8 @@ See the :doc:`Howto thermostat ` doc page for a discussion of different ways to compute temperature and perform thermostatting. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -104,4 +105,7 @@ Related commands :doc:`compute temp `, :doc:`compute pressure ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_region_eff.rst b/doc/src/compute_temp_region_eff.rst index a05cc5597c..622b3eb203 100644 --- a/doc/src/compute_temp_region_eff.rst +++ b/doc/src/compute_temp_region_eff.rst @@ -35,7 +35,8 @@ The operation of this compute is exactly like that described by the the formula for the temperature itself includes the radial electron velocity contributions, as discussed by the :doc:`compute temp/eff ` command. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -60,4 +61,7 @@ Related commands :doc:`compute temp/region `, :doc:`compute temp/eff `, :doc:`compute pressure ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_rotate.rst b/doc/src/compute_temp_rotate.rst index 7d3ed4d63d..e489136d2b 100644 --- a/doc/src/compute_temp_rotate.rst +++ b/doc/src/compute_temp_rotate.rst @@ -66,7 +66,8 @@ See the :doc:`Howto thermostat ` doc page for a discussion of different ways to compute temperature and perform thermostatting. -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. @@ -91,4 +92,7 @@ Related commands :doc:`compute temp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_temp_sphere.rst b/doc/src/compute_temp_sphere.rst index f0cd4c3ba0..b39bad80c0 100644 --- a/doc/src/compute_temp_sphere.rst +++ b/doc/src/compute_temp_sphere.rst @@ -110,7 +110,8 @@ rotational degrees of freedom. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 6 (KE tensor), which can be accessed by indices 1-6. diff --git a/doc/src/compute_temp_uef.rst b/doc/src/compute_temp_uef.rst index 2ce288a66f..11bfca48e9 100644 --- a/doc/src/compute_temp_uef.rst +++ b/doc/src/compute_temp_uef.rst @@ -51,4 +51,7 @@ Related commands :doc:`fix nvt/uef `, :doc:`compute pressure/uef ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_ti.rst b/doc/src/compute_ti.rst index 30ea9f7057..4a2f9cca21 100644 --- a/doc/src/compute_ti.rst +++ b/doc/src/compute_ti.rst @@ -113,7 +113,8 @@ du/dl can be found in the paper by :ref:`Eike `. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar, namely dUs/dlambda. This value can be used by any command that uses a global scalar value from @@ -135,7 +136,10 @@ Related commands :doc:`fix adapt ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/compute_torque_chunk.rst b/doc/src/compute_torque_chunk.rst index 258ce03aa0..61ecdf0e6e 100644 --- a/doc/src/compute_torque_chunk.rst +++ b/doc/src/compute_torque_chunk.rst @@ -67,7 +67,8 @@ command, for example: compute myChunk all torque/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -88,4 +89,7 @@ Related commands :doc:`variable torque() function ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_vacf.rst b/doc/src/compute_vacf.rst index 1ca69e104a..7b5ea78a3a 100644 --- a/doc/src/compute_vacf.rst +++ b/doc/src/compute_vacf.rst @@ -57,7 +57,8 @@ following manner, using the :doc:`variable trap() ` function: quantities will also have the same ID, and thus be initialized correctly with time=0 atom velocities from the restart file. -**Output info:** +Output info +""""""""""" This compute calculates a global vector of length 4, which can be accessed by indices 1-4 by any command that uses global vector values @@ -76,4 +77,7 @@ Related commands :doc:`compute msd ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/compute_vcm_chunk.rst b/doc/src/compute_vcm_chunk.rst index 415038d7c2..fd874998ab 100644 --- a/doc/src/compute_vcm_chunk.rst +++ b/doc/src/compute_vcm_chunk.rst @@ -57,7 +57,8 @@ command, for example: compute myChunk all vcm/chunk cc1 fix 1 all ave/time 100 1 100 c_myChunk[*] file tmp.out mode vector -**Output info:** +Output info +""""""""""" This compute calculates a global array where the number of rows = the number of chunks *Nchunk* as calculated by the specified :doc:`compute chunk/atom ` command. The number of columns = @@ -73,6 +74,13 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/compute_viscosity_cos.rst b/doc/src/compute_viscosity_cos.rst index 6f783b481e..862f65a482 100644 --- a/doc/src/compute_viscosity_cos.rst +++ b/doc/src/compute_viscosity_cos.rst @@ -114,7 +114,8 @@ thermostatting. ---------- -**Output info:** +Output info +""""""""""" This compute calculates a global scalar (the temperature) and a global vector of length 7, which can be accessed by indices 1-7. diff --git a/doc/src/compute_voronoi_atom.rst b/doc/src/compute_voronoi_atom.rst index a5d99d5de9..8998115841 100644 --- a/doc/src/compute_voronoi_atom.rst +++ b/doc/src/compute_voronoi_atom.rst @@ -188,7 +188,8 @@ Voro++ software in the src/VORONOI/README file. simulation box for 2d simulations when using the :doc:`create_box ` or :doc:`read_data ` commands. -**Output info:** +Output info +""""""""""" By default, this compute calculates a per-atom array with 2 columns. In regular dynamic tessellation mode the first column is the @@ -235,4 +236,8 @@ Related commands :doc:`dump custom `, :doc:`dump local ` -**Default:** *neighbors* no, *peratom* yes +Default +""""""" + +*neighbors* no, *peratom* yes + diff --git a/doc/src/compute_xrd.rst b/doc/src/compute_xrd.rst index 29bb2d2d3b..d927b6599f 100644 --- a/doc/src/compute_xrd.rst +++ b/doc/src/compute_xrd.rst @@ -203,7 +203,8 @@ type. Valid chemical symbols for compute xrd are: If the *echo* keyword is specified, compute xrd will provide extra reporting information to the screen. -**Output info:** +Output info +""""""""""" This compute calculates a global array. The number of rows in the array is the number of reciprocal lattice nodes that are explored diff --git a/doc/src/create_box.rst b/doc/src/create_box.rst index 917a4b3b0a..d179e3f673 100644 --- a/doc/src/create_box.rst +++ b/doc/src/create_box.rst @@ -153,4 +153,7 @@ Related commands :doc:`read_data `, :doc:`create_atoms `, :doc:`region ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/delete_bonds.rst b/doc/src/delete_bonds.rst index 9c42b5a2a0..ffb06e55b2 100644 --- a/doc/src/delete_bonds.rst +++ b/doc/src/delete_bonds.rst @@ -155,4 +155,7 @@ Related commands :doc:`neigh_modify ` exclude, :doc:`special_bonds `, :doc:`fix shake ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_charmm.rst b/doc/src/dihedral_charmm.rst index feee4a6b95..9588cf8272 100644 --- a/doc/src/dihedral_charmm.rst +++ b/doc/src/dihedral_charmm.rst @@ -1,16 +1,13 @@ .. index:: dihedral_style charmm +.. index:: dihedral_style charmm/intel +.. index:: dihedral_style charmm/kk +.. index:: dihedral_style charmm/omp +.. index:: dihedral_style charmmfsw dihedral_style charmm command ============================= -dihedral_style charmm/intel command -=================================== - -dihedral_style charmm/kk command -================================ - -dihedral_style charmm/omp command -================================= +Accelerator Variants: *charmm/intel*, *charmm/kk*, *charmm/omp* dihedral_style charmmfsw command ================================ @@ -149,7 +146,10 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/dihedral_class2.rst b/doc/src/dihedral_class2.rst index 2b8cfa21b3..a98cf6b041 100644 --- a/doc/src/dihedral_class2.rst +++ b/doc/src/dihedral_class2.rst @@ -1,13 +1,11 @@ .. index:: dihedral_style class2 +.. index:: dihedral_style class2/omp +.. index:: dihedral_style class2/kk dihedral_style class2 command ============================= -dihedral_style class2/omp command -================================= - -dihedral_style class2/kk command -================================ +Accelerator Variants: *class2/omp*, *class2/kk* Syntax """""" @@ -170,7 +168,10 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/dihedral_coeff.rst b/doc/src/dihedral_coeff.rst index 71bd931c5f..b60c3c3d6c 100644 --- a/doc/src/dihedral_coeff.rst +++ b/doc/src/dihedral_coeff.rst @@ -102,4 +102,7 @@ Related commands :doc:`dihedral_style ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_cosine_shift_exp.rst b/doc/src/dihedral_cosine_shift_exp.rst index 1ad0b07f72..1f0195df83 100644 --- a/doc/src/dihedral_cosine_shift_exp.rst +++ b/doc/src/dihedral_cosine_shift_exp.rst @@ -1,10 +1,10 @@ .. index:: dihedral_style cosine/shift/exp +.. index:: dihedral_style cosine/shift/exp/omp dihedral_style cosine/shift/exp command ======================================= -dihedral_style cosine/shift/exp/omp command -=========================================== +Accelerator Variants: *cosine/shift/exp/omp* Syntax """""" @@ -73,4 +73,7 @@ Related commands :doc:`dihedral_coeff `, :doc:`angle_style cosine/shift/exp ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_fourier.rst b/doc/src/dihedral_fourier.rst index 1e3a77212f..f55011c902 100644 --- a/doc/src/dihedral_fourier.rst +++ b/doc/src/dihedral_fourier.rst @@ -1,13 +1,11 @@ .. index:: dihedral_style fourier +.. index:: dihedral_style fourier/intel +.. index:: dihedral_style fourier/omp dihedral_style fourier command ============================== -dihedral_style fourier/intel command -==================================== - -dihedral_style fourier/omp command -================================== +Accelerator Variants: *fourier/intel*, *fourier/omp* Syntax """""" @@ -65,4 +63,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_harmonic.rst b/doc/src/dihedral_harmonic.rst index a0769062e4..0ee6339ea0 100644 --- a/doc/src/dihedral_harmonic.rst +++ b/doc/src/dihedral_harmonic.rst @@ -1,16 +1,12 @@ .. index:: dihedral_style harmonic +.. index:: dihedral_style harmonic/intel +.. index:: dihedral_style harmonic/kk +.. index:: dihedral_style harmonic/omp dihedral_style harmonic command =============================== -dihedral_style harmonic/intel command -===================================== - -dihedral_style harmonic/kk command -================================== - -dihedral_style harmonic/omp command -=================================== +Accelerator Variants: *harmonic/intel*, *harmonic/kk*, *harmonic/omp* Syntax """""" @@ -76,4 +72,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_helix.rst b/doc/src/dihedral_helix.rst index 737006626e..89258cff35 100644 --- a/doc/src/dihedral_helix.rst +++ b/doc/src/dihedral_helix.rst @@ -1,10 +1,10 @@ .. index:: dihedral_style helix +.. index:: dihedral_style helix/omp dihedral_style helix command ============================ -dihedral_style helix/omp command -================================ +Accelerator Variants: *helix/omp* Syntax """""" @@ -67,7 +67,10 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/dihedral_hybrid.rst b/doc/src/dihedral_hybrid.rst index 9fe4478f67..c0a803755d 100644 --- a/doc/src/dihedral_hybrid.rst +++ b/doc/src/dihedral_hybrid.rst @@ -96,4 +96,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_multi_harmonic.rst b/doc/src/dihedral_multi_harmonic.rst index ba1b0279da..176d3815dc 100644 --- a/doc/src/dihedral_multi_harmonic.rst +++ b/doc/src/dihedral_multi_harmonic.rst @@ -1,10 +1,10 @@ .. index:: dihedral_style multi/harmonic +.. index:: dihedral_style multi/harmonic/omp dihedral_style multi/harmonic command ===================================== -dihedral_style multi/harmonic/omp command -========================================= +Accelerator Variants: *multi/harmonic/omp* Syntax """""" @@ -59,4 +59,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_nharmonic.rst b/doc/src/dihedral_nharmonic.rst index c2b8a54ac3..2411903126 100644 --- a/doc/src/dihedral_nharmonic.rst +++ b/doc/src/dihedral_nharmonic.rst @@ -1,10 +1,10 @@ .. index:: dihedral_style nharmonic +.. index:: dihedral_style nharmonic/omp dihedral_style nharmonic command -================================= +================================ -dihedral_style nharmonic/omp command -===================================== +Accelerator Variants: *nharmonic/omp* Syntax """""" @@ -59,4 +59,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_none.rst b/doc/src/dihedral_none.rst index eda8d1c39e..9aba2fac13 100644 --- a/doc/src/dihedral_none.rst +++ b/doc/src/dihedral_none.rst @@ -36,4 +36,7 @@ Related commands :doc:`dihedral_style zero ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_opls.rst b/doc/src/dihedral_opls.rst index c95ef2d9eb..36b1897fce 100644 --- a/doc/src/dihedral_opls.rst +++ b/doc/src/dihedral_opls.rst @@ -1,16 +1,12 @@ .. index:: dihedral_style opls +.. index:: dihedral_style opls/intel +.. index:: dihedral_style opls/kk +.. index:: dihedral_style opls/omp dihedral_style opls command =========================== -dihedral_style opls/intel command -================================= - -dihedral_style opls/kk command -============================== - -dihedral_style opls/omp command -=============================== +Accelerator Variants: *opls/intel*, *opls/kk*, *opls/omp* Syntax """""" @@ -72,7 +68,10 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/dihedral_quadratic.rst b/doc/src/dihedral_quadratic.rst index 7d309a1b13..dbe680fc82 100644 --- a/doc/src/dihedral_quadratic.rst +++ b/doc/src/dihedral_quadratic.rst @@ -1,10 +1,10 @@ .. index:: dihedral_style quadratic +.. index:: dihedral_style quadratic/omp dihedral_style quadratic command ================================ -dihedral_style quadratic/omp command -==================================== +Accelerator Variants: *quadratic/omp* Syntax """""" @@ -64,4 +64,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_spherical.rst b/doc/src/dihedral_spherical.rst index 67919aa77f..be672a3699 100644 --- a/doc/src/dihedral_spherical.rst +++ b/doc/src/dihedral_spherical.rst @@ -97,4 +97,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_table.rst b/doc/src/dihedral_table.rst index 089ee1109f..ff3e61baee 100644 --- a/doc/src/dihedral_table.rst +++ b/doc/src/dihedral_table.rst @@ -1,10 +1,10 @@ .. index:: dihedral_style table +.. index:: dihedral_style table/omp dihedral_style table command ============================ -dihedral_style table/omp command -================================ +Accelerator Variants: *table/omp* Syntax """""" @@ -179,7 +179,8 @@ that matches the specified keyword. .. include:: accel_styles.rst -**Restart info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This dihedral style writes the settings for the "dihedral_style table" command to :doc:`binary restart files `, so a dihedral_style @@ -201,4 +202,7 @@ Related commands :doc:`dihedral_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dihedral_table_cut.rst b/doc/src/dihedral_table_cut.rst index 34e604088b..a29844da19 100644 --- a/doc/src/dihedral_table_cut.rst +++ b/doc/src/dihedral_table_cut.rst @@ -196,7 +196,8 @@ Note that one file can contain many sections, each with a tabulated potential. LAMMPS reads the file section by section until it finds one that matches the specified keyword. -**Restart info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This dihedral style writes the settings for the "dihedral_style table/cut" command to :doc:`binary restart files `, so a dihedral_style @@ -218,7 +219,10 @@ Related commands :doc:`dihedral_coeff `, :doc:`dihedral_style table ` -**Default:** none +Default +""""""" + +none .. _dihedralcut-Salerno: diff --git a/doc/src/dihedral_zero.rst b/doc/src/dihedral_zero.rst index 7d8dcd496a..0f481f917d 100644 --- a/doc/src/dihedral_zero.rst +++ b/doc/src/dihedral_zero.rst @@ -1,7 +1,7 @@ .. index:: dihedral_style zero dihedral_style zero command -============================ +=========================== Syntax """""" @@ -44,8 +44,15 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" + +none + :doc:`dihedral_style none ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dump.rst b/doc/src/dump.rst index 36a20defb6..c94d9a8007 100644 --- a/doc/src/dump.rst +++ b/doc/src/dump.rst @@ -36,8 +36,7 @@ Syntax * ID = user-assigned name for the dump * group-ID = ID of the group of atoms to be dumped -* style = *atom* or *atom/gz* or *atom/mpiio* or *cfg* or *cfg/gz* or - *cfg/mpiio* or *custom* or *custom/gz* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/mpiio* +* style = *atom* or *atom/gz* or *atom/zstd or *atom/mpiio* or *cfg* or *cfg/gz* or *cfg/zstd* or *cfg/mpiio* or *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *dcd* or *h5md* or *image* or *local* or *local/gz* or *local/zstd* or *molfile* or *movie* or *netcdf* or *netcdf/mpiio* or *vtk* or *xtc* or *xyz* or *xyz/gz* or *xyz/zstd* or *xyz/mpiio* * N = dump every this many timesteps * file = name of file to write dump info to * args = list of arguments for a particular style @@ -46,17 +45,19 @@ Syntax *atom* args = none *atom/gz* args = none + *atom/zstd* args = none *atom/mpiio* args = none *atom/adios* args = none, discussed on :doc:`dump atom/adios ` doc page *cfg* args = same as *custom* args, see below *cfg/gz* args = same as *custom* args, see below + *cfg/zstd* args = same as *custom* args, see below *cfg/mpiio* args = same as *custom* args, see below - *custom*\ , *custom/gz*\ , *custom/mpiio* args = see below + *custom*\ , *custom/gz*\ , *custom/zstd* , *custom/mpiio* args = see below *custom/adios* args = same as *custom* args, discussed on :doc:`dump custom/adios ` doc page *dcd* args = none *h5md* args = discussed on :doc:`dump h5md ` doc page *image* args = discussed on :doc:`dump image ` doc page - *local* args = see below + *local*, *local/gz*, *local/zstd* args = see below *molfile* args = discussed on :doc:`dump molfile ` doc page *movie* args = discussed on :doc:`dump image ` doc page *netcdf* args = discussed on :doc:`dump netcdf ` doc page @@ -65,9 +66,10 @@ Syntax *xtc* args = none *xyz* args = none *xyz/gz* args = none + *xyz/zstd* args = none *xyz/mpiio* args = none -* *custom* or *custom/gz* or *custom/mpiio* or *netcdf* or *netcdf/mpiio* args = list of atom attributes +* *custom* or *custom/gz* or *custom/zstd* or *custom/mpiio* or *netcdf* or *netcdf/mpiio* args = list of atom attributes .. parsed-literal:: @@ -111,7 +113,7 @@ Syntax d_name = per-atom floating point vector with name, managed by fix property/atom i_name = per-atom integer vector with name, managed by fix property/atom -* *local* args = list of local attributes +* *local* or *local/gz* or *local/zstd* args = list of local attributes .. parsed-literal:: @@ -130,11 +132,12 @@ Examples dump myDump all atom 100 dump.atom dump myDump all atom/mpiio 100 dump.atom.mpiio dump myDump all atom/gz 100 dump.atom.gz + dump myDump all atom/zstd 100 dump.atom.zst dump 2 subgroup atom 50 dump.run.bin dump 2 subgroup atom 50 dump.run.mpiio.bin dump 4a all custom 100 dump.myforce.* id type x y vx fx dump 4b flow custom 100 dump.%.myforce id type c_myF[3] v_ke - dump 4b flow custom 100 dump.%.myforce id type c_myF[\*] v_ke + dump 4b flow custom 100 dump.%.myforce id type c_myF[*] v_ke dump 2 inner cfg 10 dump.snap.*.cfg mass type xs ys zs vx vy vz dump snap all cfg 100 dump.config.*.cfg mass type xs ys zs id type c_Stress[2] dump 1 all xtc 1000 file.xtc @@ -187,7 +190,7 @@ default. For the *dcd*\ , *xtc*\ , *xyz*\ , and *molfile* styles, sorting by atom ID is on by default. See the :doc:`dump_modify ` doc page for details. -The *atom/gz*\ , *cfg/gz*\ , *custom/gz*\ , and *xyz/gz* styles are identical +The *atom/gz*\ , *cfg/gz*\ , *custom/gz*\ , *local/gz*, and *xyz/gz* styles are identical in command syntax to the corresponding styles without "gz", however, they generate compressed files using the zlib library. Thus the filename suffix ".gz" is mandatory. This is an alternative approach to writing @@ -198,6 +201,12 @@ For the remainder of this doc page, you should thus consider the *atom* and *atom/gz* styles (etc) to be inter-changeable, with the exception of the required filename suffix. +Similarly, the *atom/zstd*\ , *cfg/zstd*\ , *custom/zstd*\ , *local/zstd*, +and *xyz/zstd* styles are identical to the gz styles, but use the Zstd +compression library instead and require the ".zst" suffix. See the +:doc:`dump_modify ` doc page for details on how to control +the compression level in both variants. + As explained below, the *atom/mpiio*\ , *cfg/mpiio*\ , *custom/mpiio*\ , and *xyz/mpiio* styles are identical in command syntax and in the format of the dump files they create, to the corresponding styles without diff --git a/doc/src/dump_cfg_uef.rst b/doc/src/dump_cfg_uef.rst index fdefad62ff..ee027e9347 100644 --- a/doc/src/dump_cfg_uef.rst +++ b/doc/src/dump_cfg_uef.rst @@ -24,8 +24,8 @@ Examples .. code-block:: LAMMPS - dump 1 all cfg/uef 10 dump.\*.cfg mass type xs ys zs - dump 2 all cfg/uef 100 dump.\*.cfg mass type xs ys zs id c_stress + dump 1 all cfg/uef 10 dump.*.cfg mass type xs ys zs + dump 2 all cfg/uef 100 dump.*.cfg mass type xs ys zs id c_stress Description """"""""""" @@ -54,4 +54,7 @@ Related commands :doc:`dump `, :doc:`fix nvt/uef ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/dump_image.rst b/doc/src/dump_image.rst index 396f1eeb2d..3923d5c2dc 100644 --- a/doc/src/dump_image.rst +++ b/doc/src/dump_image.rst @@ -21,7 +21,7 @@ Syntax * color = atom attribute that determines color of each atom * diameter = atom attribute that determines size of each atom * zero or more keyword/value pairs may be appended -* keyword = *atom* or *adiam* or *bond* or *line* or *tri* or *body* or *fix* or *size* or *view* or *center* or *up* or *zoom* or *persp* or *box* or *axes* or *subbox* or *shiny* or *ssao* +* keyword = *atom* or *adiam* or *bond* or *line* or *tri* or *body* or *fix* or *size* or *view* or *center* or *up* or *zoom* or *box* or *axes* or *subbox* or *shiny* or *ssao* .. parsed-literal:: @@ -62,9 +62,6 @@ Syntax *zoom* value = zfactor = size that simulation box appears in image zfactor = scale image size by factor > 1 to enlarge, factor < 1 to shrink zfactor can be a variable (see below) - *persp* value = pfactor = amount of "perspective" in image - pfactor = amount of perspective (0 = none, < 1 = some, > 1 = highly skewed) - pfactor can be a variable (see below) *box* values = yes/no diam = draw outline of simulation box yes/no = do or do not draw simulation box lines diam = diameter of box lines as fraction of shortest box length @@ -87,9 +84,9 @@ Examples .. code-block:: LAMMPS - dump d0 all image 100 dump.\*.jpg type type - dump d1 mobile image 500 snap.\*.png element element ssao yes 4539 0.6 - dump d2 all image 200 img-\*.ppm type type zoom 2.5 adiam 1.5 size 1280 720 + dump d0 all image 100 dump.*.jpg type type + dump d1 mobile image 500 snap.*.png element element ssao yes 4539 0.6 + dump d2 all image 200 img-*.ppm type type zoom 2.5 adiam 1.5 size 1280 720 dump m0 all movie 1000 movie.mpg type type size 640 480 dump m1 all movie 1000 movie.avi type type size 640 480 dump m2 all movie 100 movie.m4v type type zoom 1.8 adiam v_value size 1280 720 @@ -426,13 +423,14 @@ i.e. the number of pixels in each direction. ---------- -The *view*\ , *center*\ , *up*\ , *zoom*\ , and *persp* values determine how +The *view*\ , *center*\ , *up*\ , and *zoom* values determine how 3d simulation space is mapped to the 2d plane of the image. Basically they control how the simulation box appears in the image. -All of the *view*\ , *center*\ , *up*\ , *zoom*\ , and *persp* values can be +All of the *view*\ , *center*\ , *up*\ , and *zoom* values can be specified as numeric quantities, whose meaning is explained below. -Any of them can also be specified as an :doc:`equal-style variable `, by using v_name as the value, where "name" is +Any of them can also be specified as an :doc:`equal-style variable `, +by using v_name as the value, where "name" is the variable name. In this case the variable will be evaluated on the timestep each image is created to create a new value. If the equal-style variable is time-dependent, this is a means of changing @@ -483,19 +481,6 @@ image mostly filled by the atoms in the simulation box. A *zfactor* > 1 will make the simulation box larger; a *zfactor* < 1 will make it smaller. *Zfactor* must be a value > 0.0. -The *persp* keyword determines how much depth perspective is present -in the image. Depth perspective makes lines that are parallel in -simulation space appear non-parallel in the image. A *pfactor* value -of 0.0 means that parallel lines will meet at infinity (1.0/pfactor), -which is an orthographic rendering with no perspective. A *pfactor* -value between 0.0 and 1.0 will introduce more perspective. A *pfactor* -value > 1 will create a highly skewed image with a large amount of -perspective. - -.. note:: - - The *persp* keyword is not yet supported as an option. - ---------- The *box* keyword determines if and how the simulation box boundaries @@ -692,7 +677,6 @@ The defaults for the keywords are as follows: * up = 0 0 1 (for 3d) * up = 0 1 0 (for 2d) * zoom = 1.0 -* persp = 0.0 * box = yes 0.02 * axes = no 0.0 0.0 * subbox no 0.0 diff --git a/doc/src/dump_modify.rst b/doc/src/dump_modify.rst index 6c7d4eb0f5..753cce703c 100644 --- a/doc/src/dump_modify.rst +++ b/doc/src/dump_modify.rst @@ -114,6 +114,21 @@ Syntax *framerate* arg = fps fps = frames per second for movie +* these keywords apply only to the */gz* and */zstd* dump styles +* keyword = *compression_level* + + .. parsed-literal:: + + *compression_level* args = level + level = integer specifying the compression level that should be used (see below for supported levels) + +* these keywords apply only to the */zstd* dump styles +* keyword = *compression_level* + + .. parsed-literal:: + + *checksum* args = *yes* or *no* (add checksum at end of zst file) + Examples """""""" @@ -962,6 +977,28 @@ images less frequently. ---------- +The COMPRESS package offers both GZ and Zstd compression variants of styles +atom, custom, local, cfg, and xyz. When using these styles the compression +level can be controlled by the :code:`compression_level` parameter. File names +with these styles have to end in either :code:`.gz` or :code:`.zst`. + +GZ supports compression levels from -1 (default), 0 (no compression), and 1 to +9. 9 being the best compression. The COMPRESS :code:`/gz` styles use 9 as +default compression level. + +Zstd offers a wider range of compression levels, including negative +levels that sacrifice compression for performance. 0 is the +default, positive levels are 1 to 22, with 22 being the most expensive +compression. Zstd promises higher compression/decompression speeds for +similar compression ratios. For more details see +`http://facebook.github.io/zstd/`. + +In addition, Zstd compressed files can have a checksum of the entire +contents. The Zstd enabled dump styles enable this feature by default and it +can be disabled with the :code:`checksum` parameter. + +---------- + Restrictions """""""""""" none @@ -1010,6 +1047,10 @@ The option defaults are * color = 140 color names are pre-defined as listed below * framerate = 24 +* compression_level = 9 (gz variants) +* compression_level = 0 (zstd variants) +* checksum = yes (zstd variants) + ---------- These are the standard 109 element names that LAMMPS pre-defines for diff --git a/doc/src/echo.rst b/doc/src/echo.rst index 6fc00aa1e6..94951e5e79 100644 --- a/doc/src/echo.rst +++ b/doc/src/echo.rst @@ -35,7 +35,11 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" + +none + Default """"""" diff --git a/doc/src/fix.rst b/doc/src/fix.rst index d0fe0574da..4d026f462f 100644 --- a/doc/src/fix.rst +++ b/doc/src/fix.rst @@ -241,6 +241,7 @@ accelerated styles exist. * :doc:`manifoldforce ` - restrain atoms to a manifold during minimization * :doc:`meso/move ` - move mesoscopic SPH/SDPD particles in a prescribed fashion * :doc:`momentum ` - zero the linear and/or angular momentum of a group of atoms +* :doc:`momentum/chunk ` - zero the linear and/or angular momentum of a chunk of atoms * :doc:`move ` - move atoms in a prescribed fashion * :doc:`mscg ` - apply MSCG method for force-matching to generate coarse grain models * :doc:`msst ` - multi-scale shock technique (MSST) integration @@ -292,6 +293,7 @@ accelerated styles exist. * :doc:`orient/bcc ` - add grain boundary migration force for BCC * :doc:`orient/fcc ` - add grain boundary migration force for FCC * :doc:`orient/eco ` - add generalized grain boundary migration force +* :doc:`pafi ` - constrained force averages on hyper-planes to compute free energies (PAFI) * :doc:`phonon ` - calculate dynamical matrix from MD simulations * :doc:`pimd ` - Feynman path integral molecular dynamics * :doc:`planeforce ` - constrain atoms to move in a plane @@ -401,4 +403,7 @@ Related commands :doc:`unfix `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_accelerate_cos.rst b/doc/src/fix_accelerate_cos.rst index b8d1cca59c..7fad6be913 100644 --- a/doc/src/fix_accelerate_cos.rst +++ b/doc/src/fix_accelerate_cos.rst @@ -74,7 +74,8 @@ In order to get meaningful result, the group ID of this fix should be all. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to binary restart files. None of the fix_modify options are relevant to this fix. diff --git a/doc/src/fix_adapt.rst b/doc/src/fix_adapt.rst index 4a9bc99e9b..638895ecc9 100644 --- a/doc/src/fix_adapt.rst +++ b/doc/src/fix_adapt.rst @@ -401,7 +401,8 @@ restored when the restarted run finally completes. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" If the *atom* keyword is used and the *scale* or *reset* keyword is set to *yes*, then this fix writes information to a restart file so diff --git a/doc/src/fix_adapt_fep.rst b/doc/src/fix_adapt_fep.rst index d587690473..0666d3965d 100644 --- a/doc/src/fix_adapt_fep.rst +++ b/doc/src/fix_adapt_fep.rst @@ -289,7 +289,8 @@ parameters on the outermost rRESPA level. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_addforce.rst b/doc/src/fix_addforce.rst index 32867a3252..f2f7a69f6c 100644 --- a/doc/src/fix_addforce.rst +++ b/doc/src/fix_addforce.rst @@ -115,7 +115,8 @@ converge properly. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_addtorque.rst b/doc/src/fix_addtorque.rst index 2b5a7ce8ce..b716f94dc8 100644 --- a/doc/src/fix_addtorque.rst +++ b/doc/src/fix_addtorque.rst @@ -50,7 +50,8 @@ time. Thus it is easy to specify a time-dependent torque. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -93,4 +94,7 @@ Related commands :doc:`fix addforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_append_atoms.rst b/doc/src/fix_append_atoms.rst index 6246787075..754183b55b 100644 --- a/doc/src/fix_append_atoms.rst +++ b/doc/src/fix_append_atoms.rst @@ -86,7 +86,8 @@ define the lattice spacings. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_atc.rst b/doc/src/fix_atc.rst index 81a16b907a..8e9ab0ceb2 100644 --- a/doc/src/fix_atc.rst +++ b/doc/src/fix_atc.rst @@ -118,7 +118,8 @@ Note coupling and post-processing can be combined in the same simulations using ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. The :doc:`fix_modify ` options relevant to this diff --git a/doc/src/fix_atom_swap.rst b/doc/src/fix_atom_swap.rst index 2ad289e91e..a2d365dbe2 100644 --- a/doc/src/fix_atom_swap.rst +++ b/doc/src/fix_atom_swap.rst @@ -141,7 +141,8 @@ you MUST enable the :doc:`fix_modify ` *energy* option for that fix. The doc pages for individual :doc:`fix ` commands specify if this should be done. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the fix to :doc:`binary restart files `. This includes information about the random number generator seed, the next timestep for MC exchanges, the number diff --git a/doc/src/fix_ave_atom.rst b/doc/src/fix_ave_atom.rst index 93ff48ce0f..e506b62cfa 100644 --- a/doc/src/fix_ave_atom.rst +++ b/doc/src/fix_ave_atom.rst @@ -149,7 +149,8 @@ per-atom quantities to time average. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global scalar or vector quantities are @@ -175,4 +176,7 @@ Related commands :doc:`compute `, :doc:`fix ave/histo `, :doc:`fix ave/chunk `, :doc:`fix ave/time `, :doc:`variable `, -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_ave_chunk.rst b/doc/src/fix_ave_chunk.rst index 91331502c3..d2dbaa320a 100644 --- a/doc/src/fix_ave_chunk.rst +++ b/doc/src/fix_ave_chunk.rst @@ -456,7 +456,8 @@ dimensions. Those values are always in distance :doc:`units `. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_ave_correlate.rst b/doc/src/fix_ave_correlate.rst index d6a74e8a32..386b16ff9a 100644 --- a/doc/src/fix_ave_correlate.rst +++ b/doc/src/fix_ave_correlate.rst @@ -310,7 +310,8 @@ included in the variable formula or via the *prefactor* keyword. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -361,7 +362,10 @@ Related commands :doc:`compute `, :doc:`fix ave/time `, :doc:`fix ave/atom `, :doc:`fix ave/chunk `, :doc:`fix ave/histo `, :doc:`variable ` -**Default:** none +Default +""""""" + +none The option defaults are ave = one, type = auto, start = 0, no file output, title 1,2,3 = strings as described above, and prefactor = 1.0. diff --git a/doc/src/fix_ave_correlate_long.rst b/doc/src/fix_ave_correlate_long.rst index 24ba504f1b..c740099aae 100644 --- a/doc/src/fix_ave_correlate_long.rst +++ b/doc/src/fix_ave_correlate_long.rst @@ -110,7 +110,8 @@ corresponds to about 10 KB. For the meaning of the additional optional keywords, see the :doc:`fix ave/correlate ` doc page. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Contrary to :doc:`fix ave/correlate ` this fix does **not** provide access to its internal data to various output @@ -134,7 +135,10 @@ Related commands :doc:`fix ave/correlate ` -**Default:** none +Default +""""""" + +none The option defaults for keywords that are also keywords for the :doc:`fix ave/correlate ` command are as follows: type = auto, start = 0, no file output, title 1,2 = strings as described on diff --git a/doc/src/fix_ave_histo.rst b/doc/src/fix_ave_histo.rst index 353077d667..d50112ac48 100644 --- a/doc/src/fix_ave_histo.rst +++ b/doc/src/fix_ave_histo.rst @@ -1,4 +1,5 @@ .. index:: fix ave/histo +.. index:: fix ave/histo/weight fix ave/histo command ===================== @@ -329,7 +330,8 @@ the histogram. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -369,7 +371,10 @@ Related commands :doc:`compute `, :doc:`fix ave/atom `, :doc:`fix ave/chunk `, :doc:`fix ave/time `, :doc:`variable `, :doc:`fix ave/correlate `, -**Default:** none +Default +""""""" + +none The option defaults are mode = scalar, kind = figured out from input arguments, ave = one, start = 0, no file output, beyond = ignore, and diff --git a/doc/src/fix_ave_time.rst b/doc/src/fix_ave_time.rst index efa8095d69..ad1aca233c 100644 --- a/doc/src/fix_ave_time.rst +++ b/doc/src/fix_ave_time.rst @@ -304,7 +304,8 @@ appropriate fields from the fix ave/time command. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_aveforce.rst b/doc/src/fix_aveforce.rst index 69be0ba9df..36e1e28ea6 100644 --- a/doc/src/fix_aveforce.rst +++ b/doc/src/fix_aveforce.rst @@ -75,7 +75,8 @@ to it. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -107,4 +108,7 @@ Related commands :doc:`fix setforce `, :doc:`fix addforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_balance.rst b/doc/src/fix_balance.rst index 0753794aa7..1875ab744f 100644 --- a/doc/src/fix_balance.rst +++ b/doc/src/fix_balance.rst @@ -361,7 +361,8 @@ each processor, instead of 4, and "SQUARES" replaced by "CUBES". ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -404,4 +405,7 @@ Related commands .. _pizza: https://pizza.sandia.gov -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_bocs.rst b/doc/src/fix_bocs.rst index 5315aa81a1..b5a00b2687 100644 --- a/doc/src/fix_bocs.rst +++ b/doc/src/fix_bocs.rst @@ -94,7 +94,8 @@ example, the ID of the fix bocs command is 1 ). This fix is part of the USER-BOCS package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -**Related:** +Further information +""""""""""""""""""" For more details about the pressure correction and the entire BOCS software package, visit the `BOCS package on GitHub `_ and read the release diff --git a/doc/src/fix_bond_break.rst b/doc/src/fix_bond_break.rst index 3994b58b12..4f2e2840ab 100644 --- a/doc/src/fix_bond_break.rst +++ b/doc/src/fix_bond_break.rst @@ -115,7 +115,8 @@ You can dump out snapshots of the current bond topology via the :doc:`dump local ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_bond_create.rst b/doc/src/fix_bond_create.rst index c69cf773ce..34f0d19f8d 100644 --- a/doc/src/fix_bond_create.rst +++ b/doc/src/fix_bond_create.rst @@ -1,4 +1,5 @@ .. index:: fix bond/create +.. index:: fix bond/create/angle fix bond/create command ======================= @@ -232,7 +233,8 @@ You can dump out snapshots of the current bond topology via the :doc:`dump local ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are diff --git a/doc/src/fix_bond_react.rst b/doc/src/fix_bond_react.rst index d5f917bfdb..159e39d075 100644 --- a/doc/src/fix_bond_react.rst +++ b/doc/src/fix_bond_react.rst @@ -14,19 +14,22 @@ Syntax react react-ID react-group-ID Nevery Rmin Rmax template-ID(pre-reacted) template-ID(post-reacted) map_file individual_keyword values ... ... -* ID, group-ID are documented in :doc:`fix ` command. Group-ID is ignored. +* ID, group-ID are documented in :doc:`fix ` command. * bond/react = style name of this fix command * the common keyword/values may be appended directly after 'bond/react' * this applies to all reaction specifications (below) -* common_keyword = *stabilization* +* common_keyword = *stabilization* or *reset_mol_ids* .. parsed-literal:: *stabilization* values = *no* or *yes* *group-ID* *xmax* - *no* = no reaction site stabilization + *no* = no reaction site stabilization (default) *yes* = perform reaction site stabilization *group-ID* = user-assigned prefix for the dynamic group of atoms not currently involved in a reaction *xmax* = xmax value that is used by an internally-created :doc:`nve/limit ` integrator + *reset_mol_ids* values = *yes* or *no* + *yes* = update molecule IDs based on new global topology (default) + *no* = do not update molecule IDs * react = mandatory argument indicating new reaction specification * react-ID = user-assigned name for the reaction @@ -38,7 +41,7 @@ Syntax * template-ID(post-reacted) = ID of a molecule template containing post-reaction topology * map_file = name of file specifying corresponding atom-IDs in the pre- and post-reacted templates * zero or more individual keyword/value pairs may be appended to each react argument -* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *update_edges* +* individual_keyword = *prob* or *max_rxn* or *stabilize_steps* or *custom_charges* .. parsed-literal:: @@ -49,10 +52,9 @@ Syntax N = maximum number of reactions allowed to occur *stabilize_steps* value = timesteps timesteps = number of timesteps to apply the internally-created :doc:`nve/limit ` fix to reacting atoms - *update_edges* value = *none* or *charges* or *custom* - none = do not update topology near the edges of reaction templates - charges = update atomic charges of all atoms in reaction templates - custom = force the update of user-specified atomic charges + *custom_charges* value = *no* or *fragmentID* + no = update all atomic charges (default) + fragmentID = ID of molecule fragment whose charges are updated Examples """""""" @@ -154,6 +156,13 @@ due to the internal dynamic grouping performed by fix bond/react. If the group-ID is an existing static group, react-group-IDs should also be specified as this static group, or a subset. +The *reset_mol_ids* keyword invokes the :doc:`reset_mol_ids ` +command after a reaction occurs, to ensure that molecule IDs are +consistent with the new bond topology. The group-ID used for +:doc:`reset_mol_ids ` is the group-ID for this fix. +Resetting molecule IDs is necessarily a global operation, and so can +be slow for very large systems. + The following comments pertain to each *react* argument (in other words, can be customized for each reaction, or reaction step): @@ -203,9 +212,10 @@ surrounding topology. As described below, the bonding atom pairs of the pre-reacted template are specified by atom ID in the map file. The pre-reacted molecule template should contain as few atoms as possible while still completely describing the topology of all atoms affected -by the reaction. For example, if the force field contains dihedrals, -the pre-reacted template should contain any atom within three bonds of -reacting atoms. +by the reaction (which includes all atoms that change atom type or +connectivity, and all bonds that change bond type). For example, if +the force field contains dihedrals, the pre-reacted template should +contain any atom within three bonds of reacting atoms. Some atoms in the pre-reacted template that are not reacting may have missing topology with respect to the simulation. For example, the @@ -260,14 +270,14 @@ A discussion of correctly handling this is also provided on the The map file is a text document with the following format: A map file has a header and a body. The header of map file the -contains one mandatory keyword and five optional keywords. The +contains one mandatory keyword and four optional keywords. The mandatory keyword is 'equivalences': .. parsed-literal:: N *equivalences* = # of atoms N in the reaction molecule templates -The optional keywords are 'edgeIDs', 'deleteIDs', 'customIDs' and +The optional keywords are 'edgeIDs', 'deleteIDs', 'chiralIDs' and 'constraints': .. parsed-literal:: @@ -275,10 +285,9 @@ The optional keywords are 'edgeIDs', 'deleteIDs', 'customIDs' and N *edgeIDs* = # of edge atoms N in the pre-reacted molecule template N *deleteIDs* = # of atoms N that are specified for deletion N *chiralIDs* = # of specified chiral centers N - N *customIDs* = # of atoms N that are specified for a custom update N *constraints* = # of specified reaction constraints N -The body of the map file contains two mandatory sections and five +The body of the map file contains two mandatory sections and four optional sections. The first mandatory section begins with the keyword 'BondingIDs' and lists the atom IDs of the bonding atom pair in the pre-reacted molecule template. The second mandatory section begins @@ -292,16 +301,11 @@ molecule template. The second optional section begins with the keyword 'DeleteIDs' and lists the atom IDs of pre-reaction template atoms to delete. The third optional section begins with the keyword 'ChiralIDs' lists the atom IDs of chiral atoms whose handedness should be -enforced. The fourth optional section begins with the keyword 'Custom -Edges' and allows for forcing the update of a specific atom's atomic -charge. The first column is the ID of an atom near the edge of the -pre-reacted molecule template, and the value of the second column is -either 'none' or 'charges.' Further details are provided in the -discussion of the 'update_edges' keyword. The fifth optional section -begins with the keyword 'Constraints' and lists additional criteria -that must be satisfied in order for the reaction to occur. Currently, -there are four types of constraints available, as discussed below: -'distance', 'angle', 'dihedral', and 'arrhenius'. +enforced. The fourth optional section begins with the keyword +'Constraints' and lists additional criteria that must be satisfied in +order for the reaction to occur. Currently, there are five types of +constraints available, as discussed below: 'distance', 'angle', +'dihedral', 'arrhenius', and 'rmsd'. A sample map file is given below: @@ -421,6 +425,25 @@ temperature calculations. A uniform random number between 0 and 1 is generated using *seed*\ ; if this number is less than the result of the Arrhenius equation above, the reaction is permitted to occur. +The constraint of type 'rmsd' has the following syntax: + +.. parsed-literal:: + + rmsd *RMSDmax* *molfragment* + +where 'rmsd' is the required keyword, and *RMSDmax* is the maximum +root-mean-square deviation between atom positions of the pre-reaction +template and the local reaction site (distance units), after optimal +translation and rotation of the pre-reaction template. Optionally, the +name of a molecule fragment (of the pre-reaction template) can be +specified by *molfragment*\ . If a molecule fragment is specified, +only atoms that are part of this molecule fragment are used to +determine the RMSD. A molecule fragment must have been defined in the +:doc:`molecule ` command for the pre-reaction template. For +example, the molecule fragment could consist of only the backbone +atoms of a polymer chain. This constraint can be used to enforce a +specific relative position and orientation between reacting molecules. + Once a reaction site has been successfully identified, data structures within LAMMPS that store bond topology are updated to reflect the post-reacted molecule template. All force fields with fixed bonds, @@ -458,17 +481,12 @@ individually tuned for each fix reaction step. Note that in some situations, decreasing rather than increasing this parameter will result in an increase in stability. -The *update_edges* keyword can increase the number of atoms whose -atomic charges are updated, when the pre-reaction template contains -edge atoms. When the value is set to 'charges,' all atoms' atomic -charges are updated to those specified by the post-reaction template, -including atoms near the edge of reaction templates. When the value is -set to 'custom,' an additional section must be included in the map -file that specifies whether or not to update charges, on a per-atom -basis. The format of this section is detailed above. Listing a -pre-reaction atom ID with a value of 'charges' will force the update -of the atom's charge, even if it is near a template edge. Atoms not -near a template edge are unaffected by this setting. +The *custom_charges* keyword can be used to specify which atoms' +atomic charges are updated. When the value is set to 'no,' all atomic +charges are updated to those specified by the post-reaction template +(default). Otherwise, the value should be the name of a molecule +fragment defined in the pre-reaction molecule template. In this case, +only the atomic charges of atoms in the molecule fragment are updated. A few other considerations: @@ -510,7 +528,8 @@ local command. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Cumulative reaction counts for each reaction are written to :doc:`binary restart files `. These values are associated with the reaction name (react-ID). @@ -553,7 +572,7 @@ Default """"""" The option defaults are stabilization = no, prob = 1.0, stabilize_steps = 60, -update_edges = none +reset_mol_ids = yes, custom_charges = no ---------- diff --git a/doc/src/fix_bond_swap.rst b/doc/src/fix_bond_swap.rst index 9427b0e780..248c4cc8e9 100644 --- a/doc/src/fix_bond_swap.rst +++ b/doc/src/fix_bond_swap.rst @@ -139,7 +139,8 @@ effect on this fix. ---------- -**Restart, fix_modify, thermo output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. Because the state of the random number generator is not saved in restart files, this means you cannot do "exact" @@ -189,7 +190,10 @@ Related commands :doc:`fix atom/swap ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_box_relax.rst b/doc/src/fix_box_relax.rst index 71708165dd..7a9abdfe26 100644 --- a/doc/src/fix_box_relax.rst +++ b/doc/src/fix_box_relax.rst @@ -308,7 +308,8 @@ It also means that changing attributes of *thermo_temp* or ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_client_md.rst b/doc/src/fix_client_md.rst index 2e0cf84cc5..0200966a34 100644 --- a/doc/src/fix_client_md.rst +++ b/doc/src/fix_client_md.rst @@ -66,7 +66,8 @@ LAMMPS and another code in tandem to perform a coupled simulation. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -102,4 +103,7 @@ Related commands :doc:`message `, :doc:`server ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_cmap.rst b/doc/src/fix_cmap.rst index a968eb910e..14e83f49e6 100644 --- a/doc/src/fix_cmap.rst +++ b/doc/src/fix_cmap.rst @@ -90,7 +90,8 @@ the note below about how to include the CMAP energy when performing an ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the list of CMAP cross-terms to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that reads a @@ -140,7 +141,10 @@ Related commands :doc:`fix_modify `, :doc:`read_data ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_colvars.rst b/doc/src/fix_colvars.rst index 20315624d6..fbc39f3f2f 100644 --- a/doc/src/fix_colvars.rst +++ b/doc/src/fix_colvars.rst @@ -90,7 +90,8 @@ fix that thermostats all atoms in the fix colvars group. This will be used to provide the colvars module with the current thermostat target temperature. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the current status of the colvars module into :doc:`binary restart files `. This is in addition to the text diff --git a/doc/src/fix_controller.rst b/doc/src/fix_controller.rst index 2fd5f17c95..0b7332cdd7 100644 --- a/doc/src/fix_controller.rst +++ b/doc/src/fix_controller.rst @@ -190,7 +190,8 @@ equal-style versus internal-style variable interchangeably. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -221,4 +222,7 @@ Related commands :doc:`fix adapt ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_deform.rst b/doc/src/fix_deform.rst index 2c3824231c..999a88c4e7 100644 --- a/doc/src/fix_deform.rst +++ b/doc/src/fix_deform.rst @@ -1,10 +1,10 @@ .. index:: fix deform +.. index:: fix deform/kk fix deform command ================== -fix deform/kk command -===================== +Accelerator Variants: *deform/kk* Syntax """""" @@ -565,7 +565,8 @@ command if you want to include lattice spacings in a variable formula. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix will restore the initial box settings from :doc:`binary restart files `, which allows the fix to be properly continue deformation, when using the start/stop options of the :doc:`run ` diff --git a/doc/src/fix_deposit.rst b/doc/src/fix_deposit.rst index 31df74ce9b..42975eb0b2 100644 --- a/doc/src/fix_deposit.rst +++ b/doc/src/fix_deposit.rst @@ -271,7 +271,8 @@ units of distance or velocity. the :doc:`compute_modify dynamic yes ` command for the temperature compute you are using. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the deposition to :doc:`binary restart files `. This includes information about how many particles have been deposited, the random number generator seed, the diff --git a/doc/src/fix_dpd_energy.rst b/doc/src/fix_dpd_energy.rst index cb30c286d2..732f99b516 100644 --- a/doc/src/fix_dpd_energy.rst +++ b/doc/src/fix_dpd_energy.rst @@ -1,10 +1,10 @@ .. index:: fix dpd/energy +.. index:: fix dpd/energy/kk fix dpd/energy command ====================== -fix dpd/energy/kk command -========================= +Accelerator Variants: *dpd/energy/kk* Syntax """""" @@ -74,7 +74,10 @@ Related commands :doc:`fix nve ` :doc:`fix eos/cv ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_dpd_source.rst b/doc/src/fix_dpd_source.rst index 5ea1c85fb4..29bbc92f78 100644 --- a/doc/src/fix_dpd_source.rst +++ b/doc/src/fix_dpd_source.rst @@ -1,4 +1,5 @@ .. index:: fix edpd/source +.. index:: fix tdpd/source fix edpd/source command ======================= @@ -64,7 +65,8 @@ cuboid domain to apply the source flux to. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -87,7 +89,10 @@ Related commands :doc:`pair_style edpd `, :doc:`pair_style tdpd `, :doc:`compute edpd/temp/atom `, :doc:`compute tdpd/cc/atom ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_drag.rst b/doc/src/fix_drag.rst index 792d4725cc..6bf9b909c6 100644 --- a/doc/src/fix_drag.rst +++ b/doc/src/fix_drag.rst @@ -38,7 +38,8 @@ application. This command can be used to steer one or more atoms to a new location in the simulation. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -64,4 +65,7 @@ Related commands :doc:`fix spring `, :doc:`fix spring/self `, :doc:`fix spring/rg `, :doc:`fix smd ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_drude.rst b/doc/src/fix_drude.rst index db13d8d052..b3b04832d2 100644 --- a/doc/src/fix_drude.rst +++ b/doc/src/fix_drude.rst @@ -48,4 +48,7 @@ Related commands :doc:`fix langevin/drude `, :doc:`fix drude/transform `, :doc:`compute temp/drude `, :doc:`pair_style thole ` -**Default:** None +Default +""""""" + +none diff --git a/doc/src/fix_drude_transform.rst b/doc/src/fix_drude_transform.rst index 607c161572..792b041576 100644 --- a/doc/src/fix_drude_transform.rst +++ b/doc/src/fix_drude_transform.rst @@ -1,4 +1,5 @@ .. index:: fix drude/transform/direct +.. index:: fix drude/transform/inverse fix drude/transform/direct command ================================== @@ -182,7 +183,8 @@ to add a *fix momentum* command: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -198,7 +200,10 @@ Related commands :doc:`compute temp/drude `, :doc:`pair_style thole ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_dt_reset.rst b/doc/src/fix_dt_reset.rst index 861134f745..a413f8f60d 100644 --- a/doc/src/fix_dt_reset.rst +++ b/doc/src/fix_dt_reset.rst @@ -80,7 +80,8 @@ Note that the cumulative simulation time (in time units), which accounts for changes in the timestep size as a simulation proceeds, can be accessed by the :doc:`thermo_style time ` keyword. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_efield.rst b/doc/src/fix_efield.rst index 0410803c13..227e048c8c 100644 --- a/doc/src/fix_efield.rst +++ b/doc/src/fix_efield.rst @@ -114,7 +114,8 @@ minimization will not converge properly. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -169,4 +170,7 @@ Related commands :doc:`fix addforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_ehex.rst b/doc/src/fix_ehex.rst index 10622c8b3e..2065ec5033 100644 --- a/doc/src/fix_ehex.rst +++ b/doc/src/fix_ehex.rst @@ -163,7 +163,8 @@ constraints will be satisfied. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -182,7 +183,10 @@ Related commands :doc:`fix heat `, :doc:`fix thermal/conductivity `, :doc:`compute temp `, :doc:`compute temp/region ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_electron_stopping.rst b/doc/src/fix_electron_stopping.rst index cead9f7a12..76455e88df 100644 --- a/doc/src/fix_electron_stopping.rst +++ b/doc/src/fix_electron_stopping.rst @@ -129,7 +129,8 @@ scientific publications, experimental databases or by using of the impact parameter of the ion; these results can be used to derive the stopping power. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_enforce2d.rst b/doc/src/fix_enforce2d.rst index b0c890af3a..7c6ef75089 100644 --- a/doc/src/fix_enforce2d.rst +++ b/doc/src/fix_enforce2d.rst @@ -1,10 +1,10 @@ .. index:: fix enforce2d +.. index:: fix enforce2d/kk fix enforce2d command ===================== -fix enforce2d/kk command -======================== +Accelerator Variants: *enforce2d/kk* Syntax """""" @@ -36,7 +36,8 @@ not move from their initial z coordinate. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -51,6 +52,13 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_eos_cv.rst b/doc/src/fix_eos_cv.rst index 50281b6e71..5cbe0053ff 100644 --- a/doc/src/fix_eos_cv.rst +++ b/doc/src/fix_eos_cv.rst @@ -54,7 +54,10 @@ Related commands :doc:`fix shardlow `, :doc:`pair dpd/fdt ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_eos_table.rst b/doc/src/fix_eos_table.rst index 57cacc0da5..ad734c391a 100644 --- a/doc/src/fix_eos_table.rst +++ b/doc/src/fix_eos_table.rst @@ -118,4 +118,7 @@ Related commands :doc:`fix shardlow `, :doc:`pair dpd/fdt ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_eos_table_rx.rst b/doc/src/fix_eos_table_rx.rst index 1335f8f845..56bde44d98 100644 --- a/doc/src/fix_eos_table_rx.rst +++ b/doc/src/fix_eos_table_rx.rst @@ -1,10 +1,10 @@ .. index:: fix eos/table/rx +.. index:: fix eos/table/rx/kk fix eos/table/rx command ======================== -fix eos/table/rx/kk command -=========================== +Accelerator Variants: *eos/table/rx/kk* Syntax """""" @@ -194,4 +194,7 @@ Related commands :doc:`fix rx `, :doc:`pair dpd/fdt ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_evaporate.rst b/doc/src/fix_evaporate.rst index d6b9c6ae34..5eae16b196 100644 --- a/doc/src/fix_evaporate.rst +++ b/doc/src/fix_evaporate.rst @@ -72,7 +72,8 @@ incur overhead due to the cost of building neighbor lists. :doc:`compute_modify dynamic yes ` command for the temperature compute you are using. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_external.rst b/doc/src/fix_external.rst index 58f40406da..fb71888025 100644 --- a/doc/src/fix_external.rst +++ b/doc/src/fix_external.rst @@ -147,7 +147,8 @@ of properties that the caller code may want to communicate to LAMMPS ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -184,6 +185,13 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_ffl.rst b/doc/src/fix_ffl.rst index ac23175875..3888c439c5 100644 --- a/doc/src/fix_ffl.rst +++ b/doc/src/fix_ffl.rst @@ -72,7 +72,8 @@ step and it flips the momenta of the atoms. If no_flip is chosen, no flip will be executed and the integration will be the same as a standard Langevin thermostat :ref:`(Bussi) `. The other flipping types are : rescale - hard - soft. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The instantaneous values of the extended variables are written to :doc:`binary restart files `. Because the state of the random diff --git a/doc/src/fix_filter_corotate.rst b/doc/src/fix_filter_corotate.rst index 1731ef94a2..ee608e5361 100644 --- a/doc/src/fix_filter_corotate.rst +++ b/doc/src/fix_filter_corotate.rst @@ -60,7 +60,8 @@ If the clusters are chosen suitably, the :doc:`run_style respa ` is s ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about these fixes is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to these fixes. No global or per-atom quantities are @@ -79,7 +80,10 @@ Currently, it does not support :doc:`molecule templates `. Related commands """""""""""""""" -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_flow_gauss.rst b/doc/src/fix_flow_gauss.rst index 7b9e001bd3..b40fefff0e 100644 --- a/doc/src/fix_flow_gauss.rst +++ b/doc/src/fix_flow_gauss.rst @@ -116,7 +116,8 @@ flow/gauss fixes, one that specifies *fix_modify respa 3* and one with ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix is part of the USER-MISC package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. diff --git a/doc/src/fix_freeze.rst b/doc/src/fix_freeze.rst index cca0b6eb7d..a7370c7f44 100644 --- a/doc/src/fix_freeze.rst +++ b/doc/src/fix_freeze.rst @@ -1,10 +1,10 @@ .. index:: fix freeze +.. index:: fix freeze/kk fix freeze command ================== -fix freeze/kk command -===================== +Accelerator Variants: *freeze/kk* Syntax """""" @@ -40,7 +40,8 @@ using :doc:`fix setforce `. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -70,4 +71,7 @@ Related commands :doc:`atom_style sphere `, :doc:`fix setforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_gcmc.rst b/doc/src/fix_gcmc.rst index 9a51bea97c..8ea84303bc 100644 --- a/doc/src/fix_gcmc.rst +++ b/doc/src/fix_gcmc.rst @@ -395,7 +395,8 @@ The *group* keyword adds all inserted atoms to the adds all inserted atoms of the specified type to the :doc:`group ` of the group-ID value. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the fix to :doc:`binary restart files `. This includes information about the random number generator seed, the next timestep for MC exchanges, the number diff --git a/doc/src/fix_gld.rst b/doc/src/fix_gld.rst index cb93804b1a..c47e30a880 100644 --- a/doc/src/fix_gld.rst +++ b/doc/src/fix_gld.rst @@ -123,7 +123,8 @@ momentum will not drift over time. ---------- -**Restart, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The instantaneous values of the extended variables are written to :doc:`binary restart files `. Because the state of the random diff --git a/doc/src/fix_gle.rst b/doc/src/fix_gle.rst index fb6006d514..1f14c7245d 100644 --- a/doc/src/fix_gle.rst +++ b/doc/src/fix_gle.rst @@ -99,7 +99,8 @@ input matrix for :doc:`fix gle `. While the GLE scheme is more general, the form used by :doc:`fix gld ` can be more directly related to the representation of an implicit solvent environment. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The instantaneous values of the extended variables are written to :doc:`binary restart files `. Because the state of the random diff --git a/doc/src/fix_gravity.rst b/doc/src/fix_gravity.rst index 3f9a2d5ae7..a163eb4ab2 100644 --- a/doc/src/fix_gravity.rst +++ b/doc/src/fix_gravity.rst @@ -1,13 +1,11 @@ .. index:: fix gravity +.. index:: fix gravity/omp +.. index:: fix gravity/kk fix gravity command =================== -fix gravity/omp command -======================= - -fix gravity/kk command -====================== +Accelerator Variants: *gravity/omp*, *gravity/kk* Syntax """""" @@ -100,7 +98,8 @@ field. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -131,4 +130,7 @@ Related commands :doc:`atom_style sphere `, :doc:`fix addforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_grem.rst b/doc/src/fix_grem.rst index eef39c1ffc..e57f1889e1 100644 --- a/doc/src/fix_grem.rst +++ b/doc/src/fix_grem.rst @@ -83,7 +83,8 @@ to large temperature changes. Replicas are easily added where needed. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -102,7 +103,10 @@ Related commands :doc:`temper/grem `, :doc:`fix nvt `, :doc:`fix npt `, :doc:`thermo_modify ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_halt.rst b/doc/src/fix_halt.rst index 0bc3154cdb..964132518d 100644 --- a/doc/src/fix_halt.rst +++ b/doc/src/fix_halt.rst @@ -150,7 +150,8 @@ is printed; the run simply exits. The latter may be desirable for post-processing tools that extract thermodynamic information from log files. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_heat.rst b/doc/src/fix_heat.rst index 03596febd8..19bc3d84ca 100644 --- a/doc/src/fix_heat.rst +++ b/doc/src/fix_heat.rst @@ -108,7 +108,8 @@ their velocities. Thus you must still use an integration fix not normally be used on atoms that have their temperature controlled by another fix - e.g. :doc:`fix nvt ` or :doc:`fix langevin ` fix. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -132,4 +133,7 @@ Related commands :doc:`fix ehex `, :doc:`compute temp `, :doc:`compute temp/region ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_hyper_global.rst b/doc/src/fix_hyper_global.rst index c24d405b55..52f542f647 100644 --- a/doc/src/fix_hyper_global.rst +++ b/doc/src/fix_hyper_global.rst @@ -197,7 +197,8 @@ algorithm. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -266,7 +267,10 @@ Related commands :doc:`hyper `, :doc:`fix hyper/local ` -**Default:** None +Default +""""""" + +none ---------- diff --git a/doc/src/fix_hyper_local.rst b/doc/src/fix_hyper_local.rst index a8e7483dac..da197cad20 100644 --- a/doc/src/fix_hyper_local.rst +++ b/doc/src/fix_hyper_local.rst @@ -365,7 +365,8 @@ enabled by these keywords. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_imd.rst b/doc/src/fix_imd.rst index fe54e5bf50..3b84ec6f72 100644 --- a/doc/src/fix_imd.rst +++ b/doc/src/fix_imd.rst @@ -137,7 +137,8 @@ screen output is active. .. _vrpnicms: http://sites.google.com/site/akohlmey/software/vrpn-icms -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global scalar or vector or per-atom @@ -160,6 +161,13 @@ be assigned 0-based consecutive index numbers. When using multiple active IMD connections at the same time, each needs to use a different port number. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_indent.rst b/doc/src/fix_indent.rst index ef62506591..2a77e27268 100644 --- a/doc/src/fix_indent.rst +++ b/doc/src/fix_indent.rst @@ -176,7 +176,8 @@ contains *xlat*\ , *ylat*\ , *zlat* keywords of the variable k equal 100.0/xlat/xlat fix 1 all indent $k sphere ... -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -212,7 +213,11 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" + +none + Default """"""" diff --git a/doc/src/fix_ipi.rst b/doc/src/fix_ipi.rst index d60b25248d..1d1ed795cd 100644 --- a/doc/src/fix_ipi.rst +++ b/doc/src/fix_ipi.rst @@ -69,7 +69,8 @@ If the cell varies too wildly, it may be advisable to re-initialize these interactions at each call. This behavior can be requested by setting the *reset* switch. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" There is no restart information associated with this fix, since all the dynamical parameters are dealt with by i-PI. diff --git a/doc/src/fix_langevin.rst b/doc/src/fix_langevin.rst index 4445dc240a..e31434247f 100644 --- a/doc/src/fix_langevin.rst +++ b/doc/src/fix_langevin.rst @@ -1,10 +1,10 @@ .. index:: fix langevin +.. index:: fix langevin/kk fix langevin command ==================== -fix langevin/kk command -======================= +Accelerator Variants: *langevin/kk* Syntax """""" @@ -272,7 +272,8 @@ target temperature. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. Because the state of the random number generator is not saved in restart files, this means you cannot do "exact" diff --git a/doc/src/fix_langevin_drude.rst b/doc/src/fix_langevin_drude.rst index 249c297c98..ad5a876712 100644 --- a/doc/src/fix_langevin_drude.rst +++ b/doc/src/fix_langevin_drude.rst @@ -256,7 +256,8 @@ Comments: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. Because the state of the random number generator is not saved in restart files, this means you cannot do "exact" diff --git a/doc/src/fix_langevin_eff.rst b/doc/src/fix_langevin_eff.rst index 36768d25b2..29df472d83 100644 --- a/doc/src/fix_langevin_eff.rst +++ b/doc/src/fix_langevin_eff.rst @@ -65,7 +65,8 @@ The operation of this fix is exactly like that described by the thermostatting is also applied to the radial electron velocity for electron particles. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. Because the state of the random number generator is not diff --git a/doc/src/fix_langevin_spin.rst b/doc/src/fix_langevin_spin.rst index 9a70cc1cd1..c73968df48 100644 --- a/doc/src/fix_langevin_spin.rst +++ b/doc/src/fix_langevin_spin.rst @@ -70,7 +70,8 @@ different numbers of processors. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. Because the state of the random number generator is not saved in restart files, this means you cannot do "exact" @@ -97,7 +98,10 @@ Related commands :doc:`fix nve/spin `, :doc:`fix precession/spin ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_latte.rst b/doc/src/fix_latte.rst index f1469153a7..0d6488af26 100644 --- a/doc/src/fix_latte.rst +++ b/doc/src/fix_latte.rst @@ -104,7 +104,8 @@ larger system sizes and longer time scales ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -159,9 +160,16 @@ doing 99% or more of the work to compute quantum-accurate forces. be run on a single MPI task. For details, see the :doc:`neb ` command doc page and the :doc:`-partition command-line switch ` -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none ---------- diff --git a/doc/src/fix_lb_fluid.rst b/doc/src/fix_lb_fluid.rst index f450fdb8f0..b2b85b8f5f 100644 --- a/doc/src/fix_lb_fluid.rst +++ b/doc/src/fix_lb_fluid.rst @@ -324,7 +324,8 @@ published research. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Due to the large size of the fluid data, this fix writes it's own binary restart files, if requested, independent of the main LAMMPS diff --git a/doc/src/fix_lb_momentum.rst b/doc/src/fix_lb_momentum.rst index a595ba2ce5..479f480e50 100644 --- a/doc/src/fix_lb_momentum.rst +++ b/doc/src/fix_lb_momentum.rst @@ -50,7 +50,8 @@ be changed by specifying the keyword *linear*\ , along with a set of three flags set to 0/1 in order to exclude/ include the corresponding dimension. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_lb_pc.rst b/doc/src/fix_lb_pc.rst index 874ff21893..c6f5048126 100644 --- a/doc/src/fix_lb_pc.rst +++ b/doc/src/fix_lb_pc.rst @@ -29,7 +29,8 @@ forces, using the integration algorithm described in :ref:`Mackay et al. ` has been set; do not use this integration algorithm if the force coupling constant has been set by default. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -52,7 +53,10 @@ Related commands :doc:`fix lb/fluid ` :doc:`fix lb/rigid/pc/sphere ` -**Default:** None. +Default +""""""" + +none. ---------- diff --git a/doc/src/fix_lb_rigid_pc_sphere.rst b/doc/src/fix_lb_rigid_pc_sphere.rst index 42fb21ca69..66b5f5f8d5 100644 --- a/doc/src/fix_lb_rigid_pc_sphere.rst +++ b/doc/src/fix_lb_rigid_pc_sphere.rst @@ -82,7 +82,8 @@ the rigid fix (although it includes fewer optional arguments, and assumes the constituent atoms are point particles); see :doc:`fix rigid ` for a complete documentation. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about the *rigid* and *rigid/nve* fixes are written to :doc:`binary restart files `. diff --git a/doc/src/fix_lb_viscous.rst b/doc/src/fix_lb_viscous.rst index 6d7431c780..da8922c92f 100644 --- a/doc/src/fix_lb_viscous.rst +++ b/doc/src/fix_lb_viscous.rst @@ -51,7 +51,8 @@ research. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" As described in the :doc:`fix viscous ` documentation: @@ -86,7 +87,10 @@ Related commands :doc:`fix lb/fluid `, :doc:`fix lb/pc `, :doc:`fix lb/rigid/pc/sphere ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_lineforce.rst b/doc/src/fix_lineforce.rst index b02acfa9f4..e82f6ed556 100644 --- a/doc/src/fix_lineforce.rst +++ b/doc/src/fix_lineforce.rst @@ -32,7 +32,8 @@ plane perpendicular to the line. If the initial velocity of the atom is 0.0 (or along the line), then it should continue to move along the line thereafter. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -52,4 +53,7 @@ Related commands :doc:`fix planeforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_manifoldforce.rst b/doc/src/fix_manifoldforce.rst index 8cb9723277..6d13fab7b8 100644 --- a/doc/src/fix_manifoldforce.rst +++ b/doc/src/fix_manifoldforce.rst @@ -34,7 +34,8 @@ adequately though. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_meso_move.rst b/doc/src/fix_meso_move.rst index b1ea27e872..06b0d16686 100644 --- a/doc/src/fix_meso_move.rst +++ b/doc/src/fix_meso_move.rst @@ -206,7 +206,8 @@ spacings can be different in x,y,z. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the original coordinates of moving particles to :doc:`binary restart files `, as well as the initial timestep, so that the motion can be continuous in a restarted simulation. See the diff --git a/doc/src/fix_momentum.rst b/doc/src/fix_momentum.rst index 4e11859446..393a6a16cd 100644 --- a/doc/src/fix_momentum.rst +++ b/doc/src/fix_momentum.rst @@ -1,10 +1,14 @@ .. index:: fix momentum +.. index:: fix momentum/kk +.. index:: fix momentum/chunk fix momentum command ==================== -fix momentum/kk command -======================= +Accelerator Variants: *momentum/kk* + +fix momentum/chunk command +========================== Syntax """""" @@ -16,6 +20,16 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * momentum = style name of this fix command * N = adjust the momentum every this many timesteps + one or more keyword/value pairs may be appended +* keyword = *linear* or *angular* or *rescale* + + fix ID group-ID momentum/chunk N chunkID keyword values ... + +* ID, group-ID are documented in :doc:`fix ` command +* momentum/chunk = style name of this fix command +* N = adjust the momentum per chunk every this many timesteps +* chunkID = ID of :doc:`compute chunk/atom ` command + one or more keyword/value pairs may be appended * keyword = *linear* or *angular* or *rescale* @@ -24,9 +38,6 @@ Syntax *linear* values = xflag yflag zflag xflag,yflag,zflag = 0/1 to exclude/include each dimension *angular* values = none - - .. parsed-literal:: - *rescale* values = none Examples @@ -37,19 +48,22 @@ Examples fix 1 all momentum 1 linear 1 1 0 fix 1 all momentum 1 linear 1 1 1 rescale fix 1 all momentum 100 linear 1 1 1 angular + fix 1 all momentum/chunk 100 molchunk linear 1 1 1 angular Description """"""""""" -Zero the linear and/or angular momentum of the group of atoms every N -timesteps by adjusting the velocities of the atoms. One (or both) of -the *linear* or *angular* keywords must be specified. +Fix momentum zeroes the linear and/or angular momentum of the group of +atoms every N timesteps by adjusting the velocities of the atoms. +Fix momentum/chunk works equivalently, but operates on a per-chunk basis. + +One (or both) of the *linear* or *angular* keywords **must** be specified. If the *linear* keyword is used, the linear momentum is zeroed by -subtracting the center-of-mass velocity of the group from each atom. -This does not change the relative velocity of any pair of atoms. One -or more dimensions can be excluded from this operation by setting the -corresponding flag to 0. +subtracting the center-of-mass velocity of the group or chunk from each +atom. This does not change the relative velocity of any pair of atoms. +One or more dimensions can be excluded from this operation by setting +the corresponding flag to 0. If the *angular* keyword is used, the angular momentum is zeroed by subtracting a rotational component from each atom. @@ -60,7 +74,7 @@ to random perturbations (e.g. :doc:`fix langevin ` thermostatting). The *rescale* keyword enables conserving the kinetic energy of the group -of atoms by rescaling the velocities after the momentum was removed. +or chunk of atoms by rescaling the velocities after the momentum was removed. Note that the :doc:`velocity ` command can be used to create initial velocities with zero aggregate linear and/or angular momentum. @@ -69,21 +83,31 @@ initial velocities with zero aggregate linear and/or angular momentum. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options -are relevant to this fix. No global or per-atom quantities are stored -by this fix for access by various :doc:`output commands `. +No information about this fix is written to :doc:`binary restart files +`. None of the :doc:`fix_modify ` options are +relevant to this fix. No global or per-atom quantities are stored by +this fix for access by various :doc:`output commands `. No parameter of this fix can be used with the *start/stop* keywords of -the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. +the :doc:`run ` command. This fix is not invoked during +:doc:`energy minimization `. Restrictions """""""""""" - none + +Fix momentum/chunk is part of the USER-MISC package. It is only enabled +if LAMMPS was built with that package. See the :doc:`Build package +` doc page for more info. + Related commands """""""""""""""" :doc:`fix recenter `, :doc:`velocity ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_move.rst b/doc/src/fix_move.rst index 84f7dbe965..7ede1f3050 100644 --- a/doc/src/fix_move.rst +++ b/doc/src/fix_move.rst @@ -203,7 +203,8 @@ spacings can be different in x,y,z. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the original coordinates of moving atoms to :doc:`binary restart files `, as well as the initial timestep, so that the motion can be continuous in a restarted simulation. See the @@ -241,6 +242,9 @@ Related commands :doc:`fix nve `, :doc:`displace_atoms ` -**Default:** none +Default +""""""" + +none The option default is units = lattice. diff --git a/doc/src/fix_mscg.rst b/doc/src/fix_mscg.rst index 81a59ad7ee..fe32acdbd5 100644 --- a/doc/src/fix_mscg.rst +++ b/doc/src/fix_mscg.rst @@ -118,7 +118,11 @@ Currently, the MS-CG library is not setup to run in parallel with MPI, so this fix can only be used in a serial LAMMPS build and run on a single processor. -**Related commands:** none +Related commands +"""""""""""""""" + +none + Default """"""" diff --git a/doc/src/fix_msst.rst b/doc/src/fix_msst.rst index b76af36bb8..14158227d0 100644 --- a/doc/src/fix_msst.rst +++ b/doc/src/fix_msst.rst @@ -122,7 +122,8 @@ timestepping. DFTB+ will communicate its info to LAMMPS via that fix. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of all internal variables to :doc:`binary restart files `. See the :doc:`read_restart ` diff --git a/doc/src/fix_mvv_dpd.rst b/doc/src/fix_mvv_dpd.rst index 77ca08e0c5..d0df1bd0f9 100644 --- a/doc/src/fix_mvv_dpd.rst +++ b/doc/src/fix_mvv_dpd.rst @@ -1,4 +1,6 @@ .. index:: fix mvv/dpd +.. index:: fix mvv/edpd +.. index:: fix mvv/tdpd fix mvv/dpd command =================== @@ -76,7 +78,8 @@ addition to position and velocity, and must be used with the ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_neb.rst b/doc/src/fix_neb.rst index 3612192d5b..848369d3ea 100644 --- a/doc/src/fix_neb.rst +++ b/doc/src/fix_neb.rst @@ -203,7 +203,8 @@ Finally, note that the last replica may never reach the target energy if it is stuck in a local minima which has a larger energy than the target energy. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_neb_spin.rst b/doc/src/fix_neb_spin.rst index 93729ac96f..16baba44c0 100644 --- a/doc/src/fix_neb_spin.rst +++ b/doc/src/fix_neb_spin.rst @@ -47,7 +47,8 @@ The nudging forces are calculated as explained in :ref:`(BessarabB) `). See this reference for more explanation about their expression. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_nh.rst b/doc/src/fix_nh.rst index 3668523ad9..988a147abe 100644 --- a/doc/src/fix_nh.rst +++ b/doc/src/fix_nh.rst @@ -1,37 +1,29 @@ .. index:: fix nvt +.. index:: fix nvt/intel +.. index:: fix nvt/kk +.. index:: fix nvt/omp +.. index:: fix npt +.. index:: fix npt/intel +.. index:: fix npt/kk +.. index:: fix npt/omp +.. index:: fix nph +.. index:: fix nph/kk +.. index:: fix nph/omp fix nvt command =============== -fix nvt/intel command -===================== - -fix nvt/kk command -================== - -fix nvt/omp command -=================== +Accelerator Variants: *nvt/intel*, *nvt/kk*, *nvt/omp* fix npt command =============== -fix npt/intel command -===================== - -fix npt/kk command -================== - -fix npt/omp command -=================== +Accelerator Variants: *npt/intel*, *npt/kk*, *npt/omp* fix nph command =============== -fix nph/kk command -================== - -fix nph/omp command -=================== +Accelerator Variants: *nph/kk*, *nph/omp* Syntax """""" @@ -59,7 +51,7 @@ Syntax *couple* = *none* or *xyz* or *xy* or *yz* or *xz* *tchain* value = N N = length of thermostat chain (1 = single thermostat) - *pchain* values = N + *pchain* value = N N length of thermostat chain on barostat (0 = no thermostat) *mtk* value = *yes* or *no* = add in MTK adjustment term or not *tloop* value = M @@ -572,7 +564,8 @@ the various ways to do this. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" These fixes writes the state of all the thermostat and barostat variables to :doc:`binary restart files `. See the diff --git a/doc/src/fix_nh_eff.rst b/doc/src/fix_nh_eff.rst index b5fecf279f..3e54ed9765 100644 --- a/doc/src/fix_nh_eff.rst +++ b/doc/src/fix_nh_eff.rst @@ -1,4 +1,6 @@ .. index:: fix nvt/eff +.. index:: fix npt/eff +.. index:: fix nph/eff fix nvt/eff command =================== @@ -105,7 +107,8 @@ to the temperature or kinetic energy from the electron radial velocity. the user must allow for these degrees of freedom to equilibrate (i.e. equi-partitioning of energy) through time integration. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" See the doc page for the :doc:`fix nvt, npt, and nph ` commands for details. diff --git a/doc/src/fix_nh_uef.rst b/doc/src/fix_nh_uef.rst index 27851d89a1..1c1e7a11d2 100644 --- a/doc/src/fix_nh_uef.rst +++ b/doc/src/fix_nh_uef.rst @@ -1,4 +1,5 @@ .. index:: fix nvt/uef +.. index:: fix npt/uef fix nvt/uef command =================== @@ -171,7 +172,8 @@ See the :doc:`compute temp/uef ` and :doc:`compute pressure/ue that the IDs of the new computes are the fix-ID + underscore + "temp" or fix_ID + underscore + "press". -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The fix writes the state of all the thermostat and barostat variables, as well as the cumulative strain applied, to :doc:`binary restart files `. See the :doc:`read_restart ` command diff --git a/doc/src/fix_nph_asphere.rst b/doc/src/fix_nph_asphere.rst index 4c6f94b865..da0510492e 100644 --- a/doc/src/fix_nph_asphere.rst +++ b/doc/src/fix_nph_asphere.rst @@ -1,10 +1,10 @@ .. index:: fix nph/asphere +.. index:: fix nph/asphere/omp fix nph/asphere command ======================= -fix nph/asphere/omp command -=========================== +Accelerator Variants: *nph/asphere/omp* Syntax """""" @@ -84,7 +84,8 @@ It also means that changing attributes of *thermo_temp* or .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover barostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that @@ -132,4 +133,7 @@ Related commands :doc:`fix nph `, :doc:`fix nve_asphere `, :doc:`fix nvt_asphere `, :doc:`fix npt_asphere `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nph_body.rst b/doc/src/fix_nph_body.rst index 8ded05b04e..fd517b5243 100644 --- a/doc/src/fix_nph_body.rst +++ b/doc/src/fix_nph_body.rst @@ -81,7 +81,8 @@ It also means that changing attributes of *thermo_temp* or .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover barostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that @@ -125,4 +126,7 @@ Related commands :doc:`fix nph `, :doc:`fix nve_body `, :doc:`fix nvt_body `, :doc:`fix npt_body `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nph_sphere.rst b/doc/src/fix_nph_sphere.rst index 3e5e382048..4b76f7252f 100644 --- a/doc/src/fix_nph_sphere.rst +++ b/doc/src/fix_nph_sphere.rst @@ -1,10 +1,10 @@ .. index:: fix nph/sphere +.. index:: fix nph/sphere/omp fix nph/sphere command ====================== -fix nph/sphere/omp command -========================== +Accelerator Variants: *nph/sphere/omp* Syntax """""" @@ -97,7 +97,8 @@ It also means that changing attributes of *thermo_temp* or .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover barostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that @@ -145,4 +146,7 @@ Related commands :doc:`fix nph `, :doc:`fix nve_sphere `, :doc:`fix nvt_sphere `, :doc:`fix npt_sphere `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nphug.rst b/doc/src/fix_nphug.rst index 4fa9287e08..d55f435d43 100644 --- a/doc/src/fix_nphug.rst +++ b/doc/src/fix_nphug.rst @@ -1,10 +1,10 @@ .. index:: fix nphug +.. index:: fix nphug/omp fix nphug command ================= -fix nphug/omp command -===================== +Accelerator Variants: *nphug/omp* Syntax """""" @@ -149,7 +149,8 @@ It also means that changing attributes of *thermo_temp* or ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the values of :math:`E_0`, :math:`V_0`, and :math:`P_0`, as well as the state of all the thermostat and barostat variables to diff --git a/doc/src/fix_npt_asphere.rst b/doc/src/fix_npt_asphere.rst index edf82261af..de2289a068 100644 --- a/doc/src/fix_npt_asphere.rst +++ b/doc/src/fix_npt_asphere.rst @@ -1,10 +1,10 @@ .. index:: fix npt/asphere +.. index:: fix npt/asphere/omp fix npt/asphere command ======================= -fix npt/asphere/omp command -=========================== +Accelerator Variants: *npt/asphere/omp* Syntax """""" @@ -106,7 +106,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat and barostat to :doc:`binary restart files `. See the @@ -157,4 +158,7 @@ Related commands :doc:`fix npt `, :doc:`fix nve_asphere `, :doc:`fix nvt_asphere `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_npt_body.rst b/doc/src/fix_npt_body.rst index 9c3e99890e..412d522a45 100644 --- a/doc/src/fix_npt_body.rst +++ b/doc/src/fix_npt_body.rst @@ -103,7 +103,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat and barostat to :doc:`binary restart files `. See the @@ -150,4 +151,7 @@ Related commands :doc:`fix npt `, :doc:`fix nve_body `, :doc:`fix nvt_body `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_npt_cauchy.rst b/doc/src/fix_npt_cauchy.rst index 480e2e5314..034a2c9c8d 100644 --- a/doc/src/fix_npt_cauchy.rst +++ b/doc/src/fix_npt_cauchy.rst @@ -13,7 +13,7 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * style_name = *npt/cauchy* * one or more keyword/value pairs may be appended -* keyword = *temp* or *iso* or *aniso* or *tri* or *x* or *y* or *z* or *xy* or *yz* or *xz* or *couple* or *tchain* or *pchain* or *mtk* or *tloop* or *ploop* or *nreset* or *drag* or *dilate* or *scalexy* or *scaleyz* or *scalexz* or *flip* or *fixedpoint* or *update* +* keyword = *temp* or *iso* or *aniso* or *tri* or *x* or *y* or *z* or *xy* or *yz* or *xz* or *couple* or *tchain* or *pchain* or *mtk* or *tloop* or *ploop* or *nreset* or *drag* or *dilate* or *scalexy* or *scaleyz* or *scalexz* or *flip* or *fixedpoint* .. parsed-literal:: @@ -45,9 +45,8 @@ Syntax *scaleyz* value = *yes* or *no* = scale yz with lz *scalexz* value = *yes* or *no* = scale xz with lz *flip* value = *yes* or *no* = allow or disallow box flips when it becomes highly skewed - *cauchystat* cauchystat values = alpha continue - alpha = strength of Cauchy stress control parameter - continue = *yes* or *no* = whether of not to continue from a previous run + *alpha* value = strength of Cauchy stress control parameter + *continue* value = *yes* or *no* = whether of not to continue from a previous run *fixedpoint* values = x y z x,y,z = perform barostat dilation/contraction around this point (distance units) @@ -56,7 +55,7 @@ Examples .. code-block:: LAMMPS - fix 1 water npt/cauchy temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0 + fix 1 water npt/cauchy temp 300.0 300.0 100.0 iso 0.0 0.0 1000.0 alpha 0.001 Description """"""""""" @@ -467,7 +466,8 @@ of the underlying non-Hamiltonian equations of motion. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of all the thermostat and barostat variables to :doc:`binary restart files `. See the @@ -573,14 +573,7 @@ can only be used if the second dimension in the keyword is periodic, and if the tilt factor is not coupled to the barostat via keywords *tri*\ , *yz*\ , *xz*\ , and *xy*\ . -Without the *cauchystat* keyword, the barostat algorithm -controls the Second-Piola Kirchhoff stress, which is a stress measure -referred to the unmodified (initial) simulation box. If the box -deforms substantially during the equilibration, the difference between -the set values and the final true (Cauchy) stresses can be -considerable. - -The *cauchystat* keyword modifies the barostat as per Miller et +The *alpha* keyword modifies the barostat as per Miller et al. (Miller)_"#nc-Miller" so that the Cauchy stress is controlled. *alpha* is the non-dimensional parameter, typically set to 0.001 or 0.01 that determines how aggressively the algorithm drives the system @@ -598,13 +591,12 @@ sequence over several fixes. Setting *alpha* to zero is not permitted. To "turn off" the cauchystat control and thus restore the equilibrium stress -fluctuations, two subsequent fixes should be used. In the first, the -cauchystat flag is used and the simulation box equilibrates to the -correct shape for the desired stresses. In the second, the *fix* -statement is identical except that the *cauchystat* keyword is removed -(along with related *alpha* and *continue* values). This restores the -original Parrinello-Rahman algorithm, but now with the correct simulation -box shape from the first fix. +fluctuations, two subsequent fixes should be used. In the first, fix +npt/cauchy is used and the simulation box equilibrates to the +correct shape for the desired stresses. In the second, +:doc:`fix npt ` is used instead which uses the +original Parrinello-Rahman algorithm, but now with the corrected +simulation box shape from using fix npt/cauchy. This fix can be used with dynamic groups as defined by the :doc:`group ` command. Likewise it can be used with groups to diff --git a/doc/src/fix_npt_sphere.rst b/doc/src/fix_npt_sphere.rst index ad6af88446..7363375ff3 100644 --- a/doc/src/fix_npt_sphere.rst +++ b/doc/src/fix_npt_sphere.rst @@ -1,10 +1,10 @@ .. index:: fix npt/sphere +.. index:: fix npt/sphere/omp fix npt/sphere command ====================== -fix npt/sphere/omp command -========================== +Accelerator Variants: *npt/sphere/omp* Syntax """""" @@ -119,7 +119,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat and barostat to :doc:`binary restart files `. See the @@ -169,4 +170,7 @@ Related commands :doc:`fix npt `, :doc:`fix nve_sphere `, :doc:`fix nvt_sphere `, :doc:`fix npt_asphere `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_numdiff.rst b/doc/src/fix_numdiff.rst index 974826d1f2..22c1c59748 100644 --- a/doc/src/fix_numdiff.rst +++ b/doc/src/fix_numdiff.rst @@ -1,7 +1,7 @@ .. index:: fix numdiff fix numdiff command -==================== +=================== Syntax """""" @@ -81,7 +81,8 @@ atom will undergo. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are @@ -107,4 +108,7 @@ Related commands :doc:`dynamical_matrix `, -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve.rst b/doc/src/fix_nve.rst index 6679ab1ea7..71f8ec300f 100644 --- a/doc/src/fix_nve.rst +++ b/doc/src/fix_nve.rst @@ -1,16 +1,12 @@ .. index:: fix nve +.. index:: fix nve/intel +.. index:: fix nve/kk +.. index:: fix nve/omp fix nve command =============== -fix nve/intel command -===================== - -fix nve/kk command -================== - -fix nve/omp command -=================== +Accelerator Variants: *nve/intel*, *nve/kk*, *nve/omp* Syntax """""" @@ -43,7 +39,8 @@ ensemble. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -60,4 +57,7 @@ Related commands :doc:`fix nvt `, :doc:`fix npt ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_asphere.rst b/doc/src/fix_nve_asphere.rst index 3161fd1fb5..af80460b32 100644 --- a/doc/src/fix_nve_asphere.rst +++ b/doc/src/fix_nve_asphere.rst @@ -1,10 +1,10 @@ .. index:: fix nve/asphere +.. index:: fix nve/asphere/intel fix nve/asphere command ======================= -fix nve/asphere/intel command -============================= +Accelerator Variants: *nve/asphere/intel* Syntax """""" @@ -34,7 +34,8 @@ trajectory consistent with the microcanonical ensemble. This fix differs from the :doc:`fix nve ` command, which assumes point particles and only updates their position and velocity. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -67,4 +68,7 @@ Related commands :doc:`fix nve `, :doc:`fix nve/sphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_asphere_noforce.rst b/doc/src/fix_nve_asphere_noforce.rst index b518781d6c..6bc4b98c7f 100644 --- a/doc/src/fix_nve_asphere_noforce.rst +++ b/doc/src/fix_nve_asphere_noforce.rst @@ -35,7 +35,8 @@ Dynamics, since the velocity and angular momentum are updated by the ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -62,4 +63,7 @@ Related commands :doc:`fix nve/noforce `, :doc:`fix nve/asphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_awpmd.rst b/doc/src/fix_nve_awpmd.rst index 45bb002617..b112aacd60 100644 --- a/doc/src/fix_nve_awpmd.rst +++ b/doc/src/fix_nve_awpmd.rst @@ -33,7 +33,8 @@ the electron wave functions are also updated. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -52,4 +53,7 @@ Related commands :doc:`fix nve ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_body.rst b/doc/src/fix_nve_body.rst index ad68abb0d4..7a763e7d42 100644 --- a/doc/src/fix_nve_body.rst +++ b/doc/src/fix_nve_body.rst @@ -32,7 +32,8 @@ particles. This fix differs from the :doc:`fix nve ` command, which assumes point particles and only updates their position and velocity. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -58,4 +59,7 @@ Related commands :doc:`fix nve `, :doc:`fix nve/sphere `, :doc:`fix nve/asphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_dot.rst b/doc/src/fix_nve_dot.rst index a7018a337e..ac60b40f47 100644 --- a/doc/src/fix_nve_dot.rst +++ b/doc/src/fix_nve_dot.rst @@ -54,7 +54,10 @@ Related commands :doc:`fix nve/dotc/langevin `, :doc:`fix nve ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_nve_dotc_langevin.rst b/doc/src/fix_nve_dotc_langevin.rst index 5322d5bbb3..4ffead3f25 100644 --- a/doc/src/fix_nve_dotc_langevin.rst +++ b/doc/src/fix_nve_dotc_langevin.rst @@ -138,7 +138,10 @@ Related commands :doc:`fix nve `, :doc:`fix langevin `, :doc:`fix nve/dot `, :doc:`bond_style oxdna/fene `, :doc:`bond_style oxdna2/fene `, :doc:`pair_style oxdna/excv `, :doc:`pair_style oxdna2/excv ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_nve_eff.rst b/doc/src/fix_nve_eff.rst index 78e6352b6e..2c14bb07a9 100644 --- a/doc/src/fix_nve_eff.rst +++ b/doc/src/fix_nve_eff.rst @@ -30,7 +30,8 @@ system trajectory consistent with the microcanonical ensemble. The operation of this fix is exactly like that described by the :doc:`fix nve ` command, except that the radius and radial velocity of electrons are also updated. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -49,4 +50,7 @@ Related commands :doc:`fix nve `, :doc:`fix nvt/eff `, :doc:`fix npt/eff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_limit.rst b/doc/src/fix_nve_limit.rst index 98d691d6b9..0c572c6c6a 100644 --- a/doc/src/fix_nve_limit.rst +++ b/doc/src/fix_nve_limit.rst @@ -60,7 +60,8 @@ very large for overlapped configurations. that need this fix, then turn fix shake on when doing normal dynamics with a fixed-size timestep. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -88,4 +89,7 @@ Related commands :doc:`fix nve `, :doc:`fix nve/noforce `, :doc:`pair_style soft ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_line.rst b/doc/src/fix_nve_line.rst index d47bf34f61..b65c543529 100644 --- a/doc/src/fix_nve_line.rst +++ b/doc/src/fix_nve_line.rst @@ -32,7 +32,8 @@ segment particles. This fix differs from the :doc:`fix nve ` command, which assumes point particles and only updates their position and velocity. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -54,4 +55,7 @@ Related commands :doc:`fix nve `, :doc:`fix nve/asphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_manifold_rattle.rst b/doc/src/fix_nve_manifold_rattle.rst index 1caedf88e1..b24277a8c7 100644 --- a/doc/src/fix_nve_manifold_rattle.rst +++ b/doc/src/fix_nve_manifold_rattle.rst @@ -69,7 +69,8 @@ conserved. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -92,7 +93,11 @@ Related commands :doc:`fix nvt/manifold/rattle `, :doc:`fix manifoldforce ` -**Default:** every = 0, tchain = 3 +Default +""""""" + +every = 0, tchain = 3 + ---------- diff --git a/doc/src/fix_nve_noforce.rst b/doc/src/fix_nve_noforce.rst index d45648694a..167da24475 100644 --- a/doc/src/fix_nve_noforce.rst +++ b/doc/src/fix_nve_noforce.rst @@ -37,7 +37,8 @@ unchanged, and can thus be printed by the :doc:`dump ` command or queried with an equal-style :doc:`variable ` that uses the fcm() group function to compute the total force on the group of atoms. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -54,4 +55,7 @@ Related commands :doc:`fix nve ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nve_sphere.rst b/doc/src/fix_nve_sphere.rst index 70bafc95a8..0230255b42 100644 --- a/doc/src/fix_nve_sphere.rst +++ b/doc/src/fix_nve_sphere.rst @@ -1,13 +1,11 @@ .. index:: fix nve/sphere +.. index:: fix nve/sphere/omp +.. index:: fix nve/sphere/kk fix nve/sphere command ====================== -fix nve/sphere/omp command -========================== - -fix nve/sphere/kk command -========================= +Accelerator Variants: *nve/sphere/omp*, *nve/sphere/kk* Syntax """""" @@ -74,7 +72,8 @@ moment of inertia, as used in the time integration. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -102,7 +101,10 @@ Related commands :doc:`fix nve `, :doc:`fix nve/asphere ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_nve_tri.rst b/doc/src/fix_nve_tri.rst index f5fdb7cc7d..ad4376e8ec 100644 --- a/doc/src/fix_nve_tri.rst +++ b/doc/src/fix_nve_tri.rst @@ -33,7 +33,8 @@ using triangular particles. This fix differs from the :doc:`fix nve ` command, which assumes point particles and only updates their position and velocity. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -55,4 +56,7 @@ Related commands :doc:`fix nve `, :doc:`fix nve/asphere ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nvk.rst b/doc/src/fix_nvk.rst index 415e3256b4..6226635010 100644 --- a/doc/src/fix_nvk.rst +++ b/doc/src/fix_nvk.rst @@ -39,7 +39,8 @@ energy prior to this fix. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -58,9 +59,16 @@ This fix has not yet been implemented to work with the RESPA integrator. This fix is part of the USER-MISC package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none ---------- diff --git a/doc/src/fix_nvt_asphere.rst b/doc/src/fix_nvt_asphere.rst index 02640222f1..bb4139d95f 100644 --- a/doc/src/fix_nvt_asphere.rst +++ b/doc/src/fix_nvt_asphere.rst @@ -1,10 +1,10 @@ .. index:: fix nvt/asphere +.. index:: fix nvt/asphere/omp fix nvt/asphere command ======================= -fix nvt/asphere/omp command -=========================== +Accelerator Variants: *nvt/asphere/omp* Syntax """""" @@ -89,7 +89,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that @@ -133,4 +134,7 @@ Related commands :doc:`fix nvt `, :doc:`fix nve_asphere `, :doc:`fix npt_asphere `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nvt_body.rst b/doc/src/fix_nvt_body.rst index 28dccdfff5..b608c93f27 100644 --- a/doc/src/fix_nvt_body.rst +++ b/doc/src/fix_nvt_body.rst @@ -86,7 +86,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that @@ -126,4 +127,7 @@ Related commands :doc:`fix nvt `, :doc:`fix nve_body `, :doc:`fix npt_body `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_nvt_manifold_rattle.rst b/doc/src/fix_nvt_manifold_rattle.rst index 198208ca0d..f822df5b8d 100644 --- a/doc/src/fix_nvt_manifold_rattle.rst +++ b/doc/src/fix_nvt_manifold_rattle.rst @@ -49,7 +49,8 @@ parameters, see the :doc:`Howto manifold ` doc page. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_nvt_sllod.rst b/doc/src/fix_nvt_sllod.rst index 624111813a..ff9a4f0d12 100644 --- a/doc/src/fix_nvt_sllod.rst +++ b/doc/src/fix_nvt_sllod.rst @@ -1,13 +1,11 @@ .. index:: fix nvt/sllod +.. index:: fix nvt/sllod/intel +.. index:: fix nvt/sllod/omp fix nvt/sllod command ===================== -fix nvt/sllod/intel command -=========================== - -fix nvt/sllod/omp command -========================= +Accelerator Variants: *nvt/sllod/intel*, *nvt/sllod/omp* Syntax """""" @@ -121,7 +119,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that diff --git a/doc/src/fix_nvt_sllod_eff.rst b/doc/src/fix_nvt_sllod_eff.rst index 49ad9f608c..09fc1ecff6 100644 --- a/doc/src/fix_nvt_sllod_eff.rst +++ b/doc/src/fix_nvt_sllod_eff.rst @@ -38,7 +38,8 @@ page), is performed with a :doc:`compute temp/deform/eff `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that diff --git a/doc/src/fix_nvt_sphere.rst b/doc/src/fix_nvt_sphere.rst index 8adb8160db..8226328cea 100644 --- a/doc/src/fix_nvt_sphere.rst +++ b/doc/src/fix_nvt_sphere.rst @@ -1,10 +1,10 @@ .. index:: fix nvt/sphere +.. index:: fix nvt/sphere/omp fix nvt/sphere command ====================== -fix nvt/sphere/omp command -========================== +Accelerator Variants: *nvt/sphere/omp* Syntax """""" @@ -103,7 +103,8 @@ thermal degrees of freedom, and the bias is added back in. .. include:: accel_styles.rst -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the Nose/Hoover thermostat to :doc:`binary restart files `. See the :doc:`read_restart ` command for info on how to re-specify a fix in an input script that @@ -146,4 +147,7 @@ Related commands :doc:`fix nvt `, :doc:`fix nve_sphere `, :doc:`fix nvt_asphere `, :doc:`fix npt_sphere `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_oneway.rst b/doc/src/fix_oneway.rst index 04186404e6..180a394ba0 100644 --- a/doc/src/fix_oneway.rst +++ b/doc/src/fix_oneway.rst @@ -39,7 +39,8 @@ membrane, or as an implementation of Maxwell's demon. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -56,4 +57,7 @@ Related commands :doc:`fix wall/reflect ` command -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_orient.rst b/doc/src/fix_orient.rst index ca5ba83108..31aa6074d1 100644 --- a/doc/src/fix_orient.rst +++ b/doc/src/fix_orient.rst @@ -1,4 +1,5 @@ .. index:: fix orient/fcc +.. index:: fix orient/bcc fix orient/fcc command ====================== @@ -140,7 +141,8 @@ equal-and-opposite neighbors. A pair of orientation files for a Sigma=5 tilt boundary are shown below. A tutorial that can help for writing the orientation files is given in :ref:`(Wicaksono2) ` -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -179,7 +181,10 @@ Related commands :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_orient_eco.rst b/doc/src/fix_orient_eco.rst index ac324adf78..58ff38268f 100644 --- a/doc/src/fix_orient_eco.rst +++ b/doc/src/fix_orient_eco.rst @@ -1,4 +1,4 @@ -.. index:: fix orient/eco +.. index:: fix orient/eco fix orient/eco command ====================== @@ -90,7 +90,8 @@ simulation. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc: `binary restart files `. @@ -122,7 +123,10 @@ Related commands :doc:`fix_orient ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_pafi.rst b/doc/src/fix_pafi.rst new file mode 100644 index 0000000000..8f1d02ac49 --- /dev/null +++ b/doc/src/fix_pafi.rst @@ -0,0 +1,99 @@ +.. index:: fix pafi + +fix pafi command +================ + +Syntax +"""""" + +.. parsed-literal:: + + fix ID group-ID pafi compute-ID Temp Tdamp seed keyword values... + +* ID, group-ID are documented in :doc:`fix ` command +* pafi = style name of this fix command +* compute-ID = ID of a :doc:`compute property/atom ` that holds data used by this fix +* Temp = desired temperature (temperature units) +* Tdamp = damping parameter (time units) +* seed = random number seed to use for white noise (positive integer) +* keyword = *overdamped* or *com* + + .. parsed-literal:: + *overdamped* value = *yes* or *no* or 1 or 0 + *yes* or 1 = Brownian (overdamped) integration in hyperplane + *no* or 0 = Langevin integration in hyperplane + *com* value = *yes* or *no* or 1 or 0 + *yes* or 1 = zero linear momentum, fixing center or mass (recommended) + *no* or 0 = do not zero linear momentum, allowing center of mass drift + +Examples +"""""""" + +.. code-block:: LAMMPS + + compute pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz + run 0 post no + fix hp all pafi pa 500.0 0.01 434 overdamped yes + +Description +""""""""""" + +Perform Brownian or Langevin integration whilst constraining the system to lie +in some hyperplane, which is expected to be the tangent plane to some reference +pathway in a solid state system. The instantaneous value of a modified force +projection is also calculated, whose time integral can be shown to be equal to +the true free energy gradient along the minimum free energy path local to the reference pathway. +A detailed discussion of the projection technique can be found in :ref:`(Swinburne) `. + +This fix can be used with LAMMPS as demonstrated in examples/USER/misc/pafi, +though it is primarily intended to be coupled with the PAFI C++ code, developed +at `https://github.com/tomswinburne/pafi `_, +which distributes multiple LAMMPS workers in parallel to compute and collate +hyperplane-constrained averages, allowing the calculation of free energy barriers and pathways. + +A :doc:`compute property/atom ` must be provided with 9 fields per atom coordinate, +which in order are the x,y,z coordinates of a configuration on the reference path, +the x,y,z coordinates of the path tangent (derivative of path position with path coordinate) +and the x,y,z coordinates of the change in tangent (derivative of path tangent with path coordinate). + +A 4-element vector is also calculated by this fix. The 4 components are the +modified projected force, its square, the expected projection of the minimum +free energy path tangent on the reference path tangent and the minimum image +distance between the current configuration and the reference configuration, +projected along the path tangent. This latter value should be essentially zero. + +.. note:: + When com=yes/1, which is recommended, the provided tangent vector must also + have zero center of mass. This can be achieved by subtracting from each + coordinate of the path tangent the average x,y,z value. The PAFI C++ code + (see above) can generate these paths for use in LAMMPS. + +.. note:: + When overdamped=yes/1, the Tdamp parameter should be around 5-10 times smaller + than that used in typical Langevin integration. + See :doc:`fix langevin ` for typical values. + + +Restart, fix_modify, output, run start/stop, minimize info +"""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +No information about this fix is written to :doc:`binary restart files `. +None of the :doc:`fix_modify ` options are relevant to this fix. + +This fix produces a global vector each timestep which can be accessed by various :doc:`output commands `. + +Restrictions +"""""""""""" + +This fix is part of the USER-MISC package. It is only enabled if +LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. + + +Default +""""""" +The option defaults are com = *yes*, overdamped = *no* + +---------- + +.. _Swinburne: + +**(Swinburne)** Swinburne and Marinica, Physical Review Letters, 120, 1 (2018) diff --git a/doc/src/fix_phonon.rst b/doc/src/fix_phonon.rst index 4eed4efc5b..65106c34d5 100644 --- a/doc/src/fix_phonon.rst +++ b/doc/src/fix_phonon.rst @@ -150,7 +150,8 @@ The calculated dynamical matrix elements are written out in points in the log file is in the units of the basis vectors of the corresponding reciprocal lattice. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_planeforce.rst b/doc/src/fix_planeforce.rst index c90a3b6bbe..d0f1b8102e 100644 --- a/doc/src/fix_planeforce.rst +++ b/doc/src/fix_planeforce.rst @@ -32,7 +32,8 @@ force perpendicular to the plane. If the initial velocity of the atom is 0.0 (or in the plane), then it should continue to move in the plane thereafter. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -52,4 +53,7 @@ Related commands :doc:`fix lineforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_plumed.rst b/doc/src/fix_plumed.rst index aeef6cff50..e2eadfe6bd 100644 --- a/doc/src/fix_plumed.rst +++ b/doc/src/fix_plumed.rst @@ -75,7 +75,8 @@ correctly read and parsed. The names of the files in which the results are stored from the various analysis options performed by PLUMED will be specified by the user in the PLUMED input file. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" When performing a restart of a calculation that involves PLUMED you must include a RESTART command in the PLUMED input file as detailed in the diff --git a/doc/src/fix_poems.rst b/doc/src/fix_poems.rst index 5e84188154..0f173fcc4e 100644 --- a/doc/src/fix_poems.rst +++ b/doc/src/fix_poems.rst @@ -104,7 +104,8 @@ body contribution to the pressure virial is also accounted for. The latter is only correct if forces within the bodies have been turned off, and there is only a single fix poems defined. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -131,7 +132,10 @@ Related commands :doc:`fix rigid `, :doc:`delete_bonds `, :doc:`neigh_modify ` exclude -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_pour.rst b/doc/src/fix_pour.rst index 26f1cd0eae..7757191482 100644 --- a/doc/src/fix_pour.rst +++ b/doc/src/fix_pour.rst @@ -225,7 +225,8 @@ line or triangle particles with the insertion region. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. This means you must be careful when restarting a pouring simulation, when the restart file was written in the middle of diff --git a/doc/src/fix_precession_spin.rst b/doc/src/fix_precession_spin.rst index 99dffc61dd..92819684cc 100644 --- a/doc/src/fix_precession_spin.rst +++ b/doc/src/fix_precession_spin.rst @@ -131,7 +131,8 @@ Those styles can be combined within one single command line. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" By default, the energy associated to this fix is not added to the potential energy of the system. @@ -165,7 +166,9 @@ Related commands :doc:`atom_style spin ` -**Default:** +Default +""""""" + none diff --git a/doc/src/fix_press_berendsen.rst b/doc/src/fix_press_berendsen.rst index f1366e0449..eb7adafc57 100644 --- a/doc/src/fix_press_berendsen.rst +++ b/doc/src/fix_press_berendsen.rst @@ -190,7 +190,8 @@ or pressure during thermodynamic output via the :doc:`thermo_style custom `. diff --git a/doc/src/fix_print.rst b/doc/src/fix_print.rst index 82b26d4ef3..c59cc4161d 100644 --- a/doc/src/fix_print.rst +++ b/doc/src/fix_print.rst @@ -89,7 +89,8 @@ keyword was used. By default, the title line is as follows: where ID is replaced with the fix-ID. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_propel_self.rst b/doc/src/fix_propel_self.rst index b6b5a6051f..3a1bfb3166 100644 --- a/doc/src/fix_propel_self.rst +++ b/doc/src/fix_propel_self.rst @@ -57,7 +57,8 @@ on through the *types* keyword. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -93,4 +94,8 @@ Eur. Phys. J. B 15, 105-113, 2000. **(Fily)** Y. Fily and M.C. Marchetti, Phys. Rev. Lett. 108, 235702, 2012. -**Default:** types +Default +""""""" + +types + diff --git a/doc/src/fix_property_atom.rst b/doc/src/fix_property_atom.rst index 2a1a863f42..dbea88c5a9 100644 --- a/doc/src/fix_property_atom.rst +++ b/doc/src/fix_property_atom.rst @@ -1,10 +1,10 @@ .. index:: fix property/atom +.. index:: fix property/atom/kk fix property/atom command ========================= -fix property/atom/kk command -============================ +Accelerator Variants: *property/atom/kk* Syntax """""" @@ -105,7 +105,7 @@ keyword with a value of *yes*\ . This will invoke extra communication when ghost atoms are created (at every re-neighboring) to insure the new properties are also defined for the ghost atoms. -.. note:: +.. admonition:: Properties on ghost atoms If you use this command with the *mol*\ , *q* or *rmass* vectors, then you most likely want to set *ghost* yes, since these properties @@ -115,7 +115,7 @@ new properties are also defined for the ghost atoms. atoms to have these values. LAMMPS will issue a warning it you define those vectors but do not set *ghost* yes. -.. note:: +.. admonition:: Limitations on ghost atom properties The properties for ghost atoms are not updated every timestep, but only once every few steps when neighbor lists are re-built. Thus @@ -126,12 +126,6 @@ new properties are also defined for the ghost atoms. that can be invoked from within a :doc:`pair style ` or :doc:`fix ` or :doc:`compute ` that you write. -.. note:: - - If this fix is defined **after** the simulation box is created, - a 'run 0' command should be issued to properly initialize the storage - created by this fix. - ---------- This fix is one of a small number that can be defined in an input @@ -139,6 +133,12 @@ script before the simulation box is created or atoms are defined. This is so it can be used with the :doc:`read_data ` command as described below. +.. note:: + + If this fix is defined **after** the simulation box is created, + a 'run 0' command may be needed to properly initialize the storage + created by this fix. + Per-atom properties that are defined by the :doc:`atom style ` are initialized when atoms are created, e.g. by the :doc:`read_data ` or :doc:`create_atoms ` commands. The per-atom properties defined by this fix are not. So @@ -268,13 +268,24 @@ example to heavy water: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -This fix writes the per-atom values it stores to :doc:`binary restart files `, so that the values can be restored when a -simulation is restarted. See the :doc:`read_restart ` -command for info on how to re-specify a fix in an input script that -reads a restart file, so that the operation of the fix continues in an -uninterrupted fashion. +This fix writes the per-atom values it stores to :doc:`binary restart +files `, so that the values can be restored when a simulation +is restarted. See the :doc:`read_restart ` command for +info on how to re-specify a fix in an input script that reads a restart +file, so that the operation of the fix continues in an uninterrupted +fashion. + +.. warning:: + + When reading data from a restart, the fix command has to be specified + **exactly** the same way as before. LAMMPS will only check whether a + fix is of the same style and has the same fix ID and in case of a match + will then try to initialize the fix with the data stored in the binary + restart file. If the fix property/atom command does not match exactly, + data can be corrupted or LAMMPS may crash. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored by this fix for diff --git a/doc/src/fix_python_move.rst b/doc/src/fix_python_move.rst index 07f61c2b85..15014ef4fe 100644 --- a/doc/src/fix_python_move.rst +++ b/doc/src/fix_python_move.rst @@ -82,7 +82,8 @@ Examples for how to do this are in the *examples/python* folder. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -101,4 +102,7 @@ Related commands :doc:`fix nve `, :doc:`fix python/invoke ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_qbmsst.rst b/doc/src/fix_qbmsst.rst index 112c5f1842..8444312681 100644 --- a/doc/src/fix_qbmsst.rst +++ b/doc/src/fix_qbmsst.rst @@ -144,7 +144,8 @@ supported by LAMMPS, but are not implemented for QBMSST. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Because the state of the random number generator is not written to :doc:`binary restart files `, this fix cannot be restarted diff --git a/doc/src/fix_qeq.rst b/doc/src/fix_qeq.rst index ea53fc2b2e..56fde059e8 100644 --- a/doc/src/fix_qeq.rst +++ b/doc/src/fix_qeq.rst @@ -1,4 +1,8 @@ .. index:: fix qeq/point +.. index:: fix qeq/shielded +.. index:: fix qeq/slater +.. index:: fix qeq/dynamic +.. index:: fix qeq/fire fix qeq/point command ===================== @@ -193,7 +197,8 @@ better on larger sizes, and *qeq/fire* is faster than *qeq/dynamic*\ . arbitrary choices of these parameters. We do not develop these QEq parameters. See the examples/qeq directory for some examples. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about these fixes is written to :doc:`binary restart files `. No global scalar or vector or per-atom quantities are stored by these fixes for access by various :doc:`output commands `. No parameter of these fixes can be used @@ -212,7 +217,10 @@ Related commands :doc:`fix qeq/reax `, :doc:`fix qeq/comb ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_qeq_comb.rst b/doc/src/fix_qeq_comb.rst index 20e2139de1..74a97720dc 100644 --- a/doc/src/fix_qeq_comb.rst +++ b/doc/src/fix_qeq_comb.rst @@ -1,10 +1,10 @@ .. index:: fix qeq/comb +.. index:: fix qeq/comb/omp fix qeq/comb command ==================== -fix qeq/comb/omp command -======================== +Accelerator Variants: *qeq/comb/omp* Syntax """""" @@ -69,7 +69,8 @@ equilibration calculation is written to the specified file. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_qeq_reax.rst b/doc/src/fix_qeq_reax.rst index f729779267..8752888c4c 100644 --- a/doc/src/fix_qeq_reax.rst +++ b/doc/src/fix_qeq_reax.rst @@ -1,13 +1,11 @@ .. index:: fix qeq/reax +.. index:: fix qeq/reax/kk +.. index:: fix qeq/reax/omp fix qeq/reax command ==================== -fix qeq/reax/kk command -======================= - -fix qeq/reax/omp command -======================== +Accelerator Variants: *qeq/reax/kk*, *qeq/reax/omp* Syntax """""" @@ -22,7 +20,14 @@ Syntax * cutlo,cuthi = lo and hi cutoff for Taper radius * tolerance = precision to which charges will be equilibrated * params = reax/c or a filename -* args = *dual* (optional) +* one or more keywords or keyword/value pairs may be appended + + .. parsed-literal:: + + keyword = *dual* or *maxiter* + *dual* = process S and T matrix in parallel (only for qeq/reax/omp) + *maxiter* N = limit the number of iterations to *N* + Examples """""""" @@ -30,7 +35,7 @@ Examples .. code-block:: LAMMPS fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 reax/c - fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 param.qeq + fix 1 all qeq/reax 1 0.0 10.0 1.0e-6 param.qeq maxiter 500 Description """"""""""" @@ -71,7 +76,11 @@ The optional *dual* keyword allows to perform the optimization of the S and T matrices in parallel. This is only supported for the *qeq/reax/omp* style. Otherwise they are processed separately. -**Restart, fix_modify, output, run start/stop, minimize info:** +The optional *maxiter* keyword allows changing the max number +of iterations in the linear solver. The default value is 200. + +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. No global scalar or vector or per-atom quantities are stored by this fix for access by various :doc:`output commands `. No parameter of this fix can be used @@ -100,7 +109,10 @@ Related commands :doc:`pair_style reax/c ` -**Default:** none +Default +""""""" + +maxiter 200 ---------- diff --git a/doc/src/fix_qmmm.rst b/doc/src/fix_qmmm.rst index 4eb45e490f..81bb315e23 100644 --- a/doc/src/fix_qmmm.rst +++ b/doc/src/fix_qmmm.rst @@ -42,7 +42,8 @@ to be adapted if necessary before being finalized. Details about how to use this fix are currently documented in the description of the QM/MM interface code itself in lib/qmmm/README. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global scalar or vector or per-atom @@ -61,6 +62,13 @@ The fix is only functional when LAMMPS is built as a library and linked with a compatible QM program and a QM/MM front end into a QM/MM executable. See the lib/qmmm/README file for details. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_qtb.rst b/doc/src/fix_qtb.rst index 6dfabcbaa7..594b8b78a7 100644 --- a/doc/src/fix_qtb.rst +++ b/doc/src/fix_qtb.rst @@ -145,7 +145,8 @@ Mbytes. ---------- -**Restart, fix_modify, output, run start/stop, minimizie info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. Because the state of the random number generator is not diff --git a/doc/src/fix_reaxc_bonds.rst b/doc/src/fix_reaxc_bonds.rst index 820a925eb8..2d0d2d18db 100644 --- a/doc/src/fix_reaxc_bonds.rst +++ b/doc/src/fix_reaxc_bonds.rst @@ -1,10 +1,10 @@ .. index:: fix reax/c/bonds +.. index:: fix reax/c/bonds/kk fix reax/c/bonds command ======================== -fix reax/c/bonds/kk command -=========================== +Accelerator Variants: *reax/c/bonds/kk* Syntax """""" @@ -58,7 +58,8 @@ version, but will also take longer to write. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -88,4 +89,7 @@ Related commands :doc:`pair_style reax/c `, :doc:`fix reax/c/species ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_reaxc_species.rst b/doc/src/fix_reaxc_species.rst index cd0266b2f2..9935ecaa3a 100644 --- a/doc/src/fix_reaxc_species.rst +++ b/doc/src/fix_reaxc_species.rst @@ -1,10 +1,10 @@ .. index:: fix reax/c/species +.. index:: fix reax/c/species/kk fix reax/c/species command ========================== -fix reax/c/species/kk command -============================= +Accelerator Variants: *reax/c/species/kk* Syntax """""" @@ -112,7 +112,8 @@ average bond-order for the species analysis output on timestep 100. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_recenter.rst b/doc/src/fix_recenter.rst index a1c215e9a7..583b4d46c5 100644 --- a/doc/src/fix_recenter.rst +++ b/doc/src/fix_recenter.rst @@ -93,7 +93,8 @@ velocities with zero aggregate linear and/or angular momentum. simulation scenario is to use the :doc:`fix spring ` command to tether the molecule in place. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_restrain.rst b/doc/src/fix_restrain.rst index fdc5be06bc..1f127bce2f 100644 --- a/doc/src/fix_restrain.rst +++ b/doc/src/fix_restrain.rst @@ -13,7 +13,7 @@ Syntax * ID, group-ID are documented in :doc:`fix ` command * restrain = style name of this fix command * one or more keyword/arg pairs may be appended -* keyword = *bond* or *angle* or *dihedral* +* keyword = *bond* or *lbound* or *angle* or *dihedral* .. parsed-literal:: @@ -23,7 +23,7 @@ Syntax r0start = equilibrium bond distance at start of run (distance units) r0stop = equilibrium bond distance at end of run (optional) (distance units). If not specified it is assumed to be equal to r0start - *lbond* args = atom1 atom2 Kstart Kstop r0start (r0stop) + *lbound* args = atom1 atom2 Kstart Kstop r0start (r0stop) atom1,atom2 = IDs of 2 atoms in bond Kstart,Kstop = restraint coefficients at start/end of run (energy units) r0start = equilibrium bond distance at start of run (distance units) @@ -46,7 +46,7 @@ Examples .. code-block:: LAMMPS fix holdem all restrain bond 45 48 2000.0 2000.0 2.75 - fix holdem all restrain lbond 45 48 2000.0 2000.0 2.75 + fix holdem all restrain lbound 45 48 2000.0 2000.0 2.75 fix holdem all restrain dihedral 1 2 3 4 2000.0 2000.0 120.0 fix holdem all restrain bond 45 48 2000.0 2000.0 2.75 dihedral 1 2 3 4 2000.0 2000.0 120.0 fix texas_holdem all restrain dihedral 1 2 3 4 0.0 2000.0 120.0 dihedral 1 2 3 5 0.0 2000.0 -120.0 dihedral 1 2 3 6 0.0 2000.0 0.0 @@ -150,7 +150,7 @@ is included in :math:`K`. ---------- -The *lbond* keyword applies a lower bound bond restraint to the specified atoms +The *lbound* keyword applies a lower bound bond restraint to the specified atoms using the same functional form used by the :doc:`bond_style harmonic ` command if the distance between the atoms is smaller than the equilibrium bond distance and 0 otherwise. The potential associated with the restraint is @@ -216,7 +216,8 @@ current dihedral angle :math:`\phi` is equal to :math:`\phi_0`. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -254,6 +255,13 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_rhok.rst b/doc/src/fix_rhok.rst index be4780c7d8..38bde220ef 100644 --- a/doc/src/fix_rhok.rst +++ b/doc/src/fix_rhok.rst @@ -56,7 +56,10 @@ Related commands :doc:`thermo_style ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_rigid.rst b/doc/src/fix_rigid.rst index 318975d91b..efadc5dd13 100644 --- a/doc/src/fix_rigid.rst +++ b/doc/src/fix_rigid.rst @@ -1,40 +1,49 @@ .. index:: fix rigid +.. index:: fix rigid/omp +.. index:: fix rigid/nve +.. index:: fix rigid/nve/omp +.. index:: fix rigid/nvt +.. index:: fix rigid/nvt/omp +.. index:: fix rigid/npt +.. index:: fix rigid/npt/omp +.. index:: fix rigid/nph +.. index:: fix rigid/nph/omp +.. index:: fix rigid/small +.. index:: fix rigid/small/omp +.. index:: fix rigid/nve/small +.. index:: fix rigid/nvt/small +.. index:: fix rigid/npt/small +.. index:: fix rigid/nph/small fix rigid command ================= -fix rigid/omp command -===================== +Accelerator Variants: *rigid/omp* fix rigid/nve command ===================== -fix rigid/nve/omp command -========================= +Accelerator Variants: *rigid/nve/omp* fix rigid/nvt command ===================== -fix rigid/nvt/omp command -========================= +Accelerator Variants: *rigid/nvt/omp* fix rigid/npt command ===================== -fix rigid/npt/omp command -========================= +Accelerator Variants: *rigid/npt/omp* fix rigid/nph command ===================== -fix rigid/nph/omp command -========================= +Accelerator Variants: *rigid/nph/omp* fix rigid/small command ======================= -fix rigid/small/omp command -=========================== +Accelerator Variants: *rigid/small/omp* fix rigid/nve/small command =========================== @@ -740,7 +749,8 @@ rigid/nvt. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about the 4 NVE rigid styles is written to :doc:`binary restart files `. The exception is if the *infile* or *mol* keyword is used, in which case an auxiliary file is written out diff --git a/doc/src/fix_rigid_meso.rst b/doc/src/fix_rigid_meso.rst index ec05fd170a..2acd81a268 100644 --- a/doc/src/fix_rigid_meso.rst +++ b/doc/src/fix_rigid_meso.rst @@ -288,7 +288,8 @@ cross periodic boundaries during the simulation. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information is written to :doc:`binary restart files `. If the *infile* keyword is used, an auxiliary file is written out diff --git a/doc/src/fix_rx.rst b/doc/src/fix_rx.rst index 82c8f66374..c1a1d0950c 100644 --- a/doc/src/fix_rx.rst +++ b/doc/src/fix_rx.rst @@ -1,10 +1,10 @@ .. index:: fix rx +.. index:: fix rx/kk fix rx command ============== -fix rx/kk command -================= +Accelerator Variants: *rx/kk* Syntax """""" @@ -222,4 +222,7 @@ Related commands :doc:`fix shardlow `, :doc:`pair dpd/fdt/energy ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_saed_vtk.rst b/doc/src/fix_saed_vtk.rst index 145a10c93a..9dd8fb8641 100644 --- a/doc/src/fix_saed_vtk.rst +++ b/doc/src/fix_saed_vtk.rst @@ -165,7 +165,8 @@ The *overwrite* keyword will continuously overwrite the output file with the latest output, so that it only contains one timestep worth of output. This option can only be used with the *ave running* setting. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_setforce.rst b/doc/src/fix_setforce.rst index 59de49fbe0..406826e5b9 100644 --- a/doc/src/fix_setforce.rst +++ b/doc/src/fix_setforce.rst @@ -1,10 +1,11 @@ .. index:: fix setforce +.. index:: fix setforce/kk +.. index:: fix setforce/spin fix setforce command ==================== -fix setforce/kk command -======================= +Accelerator Variants: *setforce/kk* fix setforce/spin command ========================= @@ -111,7 +112,8 @@ instructions on how to use the accelerated styles effectively. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -148,4 +150,7 @@ Related commands :doc:`fix addforce `, :doc:`fix aveforce ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_shake.rst b/doc/src/fix_shake.rst index 9983d30519..eb7add7035 100644 --- a/doc/src/fix_shake.rst +++ b/doc/src/fix_shake.rst @@ -1,4 +1,5 @@ .. index:: fix shake +.. index:: fix rattle fix shake command ================= @@ -184,7 +185,8 @@ LAMMPS closely follows (:ref:`Andersen (1983) `). ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The :doc:`fix_modify ` *virial* option is supported by this fix to add the contribution due to keeping the constraints to the @@ -217,9 +219,16 @@ degrees (e.g. linear CO2 molecule). This causes numeric difficulties. You can use :doc:`fix rigid or fix rigid/small ` instead to make a linear molecule rigid. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none ---------- diff --git a/doc/src/fix_shardlow.rst b/doc/src/fix_shardlow.rst index 0e1c36516e..f928044db7 100644 --- a/doc/src/fix_shardlow.rst +++ b/doc/src/fix_shardlow.rst @@ -1,10 +1,10 @@ .. index:: fix shardlow +.. index:: fix shardlow/kk fix shardlow command ==================== -fix shardlow/kk command -======================= +Accelerator Variants: *shardlow/kk* Syntax """""" @@ -79,7 +79,10 @@ Related commands :doc:`pair_style dpd/fdt `, :doc:`fix eos/cv ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_smd.rst b/doc/src/fix_smd.rst index 1a24154b49..8cbae29adf 100644 --- a/doc/src/fix_smd.rst +++ b/doc/src/fix_smd.rst @@ -99,7 +99,8 @@ can then later be used to compute the potential of mean force (PMF) by averaging over multiple independent trajectories along the same pulling path. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" The fix stores the direction of the spring, current pulling target distance and the running PMF to :doc:`binary restart files `. @@ -146,7 +147,10 @@ Related commands :doc:`fix spring/rg `, :doc:`fix colvars `, :doc:`fix plumed ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_smd_adjust_dt.rst b/doc/src/fix_smd_adjust_dt.rst index d91ad1392d..fb19c07b15 100644 --- a/doc/src/fix_smd_adjust_dt.rst +++ b/doc/src/fix_smd_adjust_dt.rst @@ -46,7 +46,8 @@ additional safety factor *s_fact* is applied to the time increment. See `this PDF guide `_ to use Smooth Mach Dynamics in LAMMPS. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no part of USER-SMD supports restarting nor minimization. @@ -61,4 +62,7 @@ Related commands :doc:`smd/tlsph_dt ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_smd_integrate_tlsph.rst b/doc/src/fix_smd_integrate_tlsph.rst index ef91414788..867141bd6f 100644 --- a/doc/src/fix_smd_integrate_tlsph.rst +++ b/doc/src/fix_smd_integrate_tlsph.rst @@ -41,7 +41,8 @@ The *limit_velocity* keyword will control the velocity, scaling the norm of the velocity vector to max_vel in case it exceeds this velocity limit. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no part of USER-SMD supports restarting nor minimization. This fix has no outputs. @@ -57,4 +58,7 @@ Related commands :doc:`smd/integrate_ulsph ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_smd_integrate_ulsph.rst b/doc/src/fix_smd_integrate_ulsph.rst index c355abf17b..5b4c117452 100644 --- a/doc/src/fix_smd_integrate_ulsph.rst +++ b/doc/src/fix_smd_integrate_ulsph.rst @@ -1,7 +1,7 @@ .. index:: fix smd/integrate_ulsph fix smd/integrate_ulsph command -================================ +=============================== Syntax """""" @@ -49,7 +49,8 @@ of adjustment per timestep. Typical values are *adjust_radius_factor* The *limit_velocity* keyword will control the velocity, scaling the norm of the velocity vector to max_vel in case it exceeds this velocity limit. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no part of USER-SMD supports restarting nor minimization. This fix has no outputs. @@ -60,6 +61,13 @@ Restrictions This fix is part of the USER-SMD package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_smd_move_triangulated_surface.rst b/doc/src/fix_smd_move_triangulated_surface.rst index 3aa40a75c2..293f5401a2 100644 --- a/doc/src/fix_smd_move_triangulated_surface.rst +++ b/doc/src/fix_smd_move_triangulated_surface.rst @@ -63,7 +63,8 @@ rotation axis to the particle. See `this PDF guide `_ to using Smooth Mach Dynamics in LAMMPS. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no part of USER-SMD supports restarting nor minimization. This fix has no outputs. @@ -80,4 +81,7 @@ Related commands :doc:`smd/triangle_mesh_vertices `, :doc:`smd/wall_surface ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_smd_setvel.rst b/doc/src/fix_smd_setvel.rst index eb92f435e1..53aa5f649c 100644 --- a/doc/src/fix_smd_setvel.rst +++ b/doc/src/fix_smd_setvel.rst @@ -63,7 +63,8 @@ specified geometric :doc:`region ` in order to have its velocity set by ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no part of USER-SMD supports restarting nor minimization None of the :doc:`fix_modify ` options @@ -83,6 +84,13 @@ Restrictions This fix is part of the USER-SMD package. It is only enabled if LAMMPS was built with that package. See the :doc:`Build package ` doc page for more info. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none diff --git a/doc/src/fix_smd_wall_surface.rst b/doc/src/fix_smd_wall_surface.rst index 6bebcdf6c2..38efee0977 100644 --- a/doc/src/fix_smd_wall_surface.rst +++ b/doc/src/fix_smd_wall_surface.rst @@ -50,7 +50,8 @@ directory. See `this PDF guide `_ to use Smooth Mach Dynamics in LAMMPS. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Currently, no part of USER-SMD supports restarting nor minimization. This fix has no outputs. @@ -75,4 +76,7 @@ Related commands :doc:`smd/move_tri_surf `, :doc:`smd/tri_surface ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_sph.rst b/doc/src/fix_sph.rst index 7e9159cac4..5ba752debb 100644 --- a/doc/src/fix_sph.rst +++ b/doc/src/fix_sph.rst @@ -1,7 +1,7 @@ .. index:: fix sph fix sph command -================ +=============== Syntax """""" @@ -32,7 +32,8 @@ Hydrodynamics. See `this PDF guide `_ to using SPH in LAMMPS. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -51,4 +52,7 @@ Related commands :doc:`fix sph/stationary ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_sph_stationary.rst b/doc/src/fix_sph_stationary.rst index cd0d3e4d73..c86a30b542 100644 --- a/doc/src/fix_sph_stationary.rst +++ b/doc/src/fix_sph_stationary.rst @@ -1,7 +1,7 @@ .. index:: fix sph/stationary fix sph/stationary command -=========================== +========================== Syntax """""" @@ -32,7 +32,8 @@ space. SPH stands for Smoothed Particle Hydrodynamics. See `this PDF guide `_ to using SPH in LAMMPS. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -51,4 +52,7 @@ Related commands :doc:`fix sph ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_spring.rst b/doc/src/fix_spring.rst index 527e6325f4..06b9279c4d 100644 --- a/doc/src/fix_spring.rst +++ b/doc/src/fix_spring.rst @@ -97,7 +97,8 @@ last example holds the ion a distance 5 away from the pore axis spring connecting two groups or a group and the tether point can cross a periodic boundary and its length be calculated correctly. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -149,4 +150,7 @@ Related commands :doc:`fix drag `, :doc:`fix spring/self `, :doc:`fix spring/rg `, :doc:`fix smd ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_spring_chunk.rst b/doc/src/fix_spring_chunk.rst index d839d9158c..a2d9945a0b 100644 --- a/doc/src/fix_spring_chunk.rst +++ b/doc/src/fix_spring_chunk.rst @@ -48,9 +48,19 @@ chunk. Note that *K* thus represents the spring constant for the total force on each chunk of atoms, not for a spring applied to each atom. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +This fix writes the locations of the initial per-chunk center of mass +coordinates to :doc:`binary restart files `. See the +:doc:`read_restart ` command for info on how to +re-specify a fix in an input script that reads a restart file, so that +the fix continues in an uninterrupted fashion. Since this fix depends +on an instance of :doc:`compute chunk/atom ` +it will check when reading the restart if the chunk still exists and +will define the same number of chunks. The restart data is only applied +when the number of chunks matches. Otherwise the center of mass +coordinates are recomputed. The :doc:`fix_modify ` *energy* option is supported by this fix to add the energy stored in all the springs to the system's potential @@ -89,4 +99,7 @@ Related commands :doc:`fix spring `, :doc:`fix spring/self `, :doc:`fix spring/rg ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_spring_rg.rst b/doc/src/fix_spring_rg.rst index 962e780f7f..21035f9def 100644 --- a/doc/src/fix_spring_rg.rst +++ b/doc/src/fix_spring_rg.rst @@ -57,11 +57,23 @@ for the aggregate force on the group of atoms, not a per-atom force. If :math:`R_{G0}` is specified as NULL, then the RG of the group is computed at the time the fix is specified, and that value is used as the target. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" + +This fix writes the currently used reference RG (:math:`R_{G0}`) to +:doc:`binary restart files `. See the :doc:`read_restart +` command for info on how to re-specify a fix in an input +script that reads a restart file, so that the fix continues in an +uninterrupted fashion. + +None of the :doc:`fix_modify ` options +are relevant to this fix. + +This fix computes a global scalar which can be accessed by various +:doc:`output commands `. The scalar is the reference +radius of gyration :math:`R_{G0}` used by the fix. energy change due to +this fix. The scalar value calculated by this fix is "intensive". -No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options -are relevant to this fix. No global or per-atom quantities are stored -by this fix for access by various :doc:`output commands `. No parameter of this fix can be used with the *start/stop* keywords of the :doc:`run ` command. This fix is not invoked during :doc:`energy minimization `. @@ -79,4 +91,7 @@ Related commands :doc:`fix spring `, :doc:`fix spring/self ` :doc:`fix drag `, :doc:`fix smd ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_spring_self.rst b/doc/src/fix_spring_self.rst index 38da0013b1..8c5442943f 100644 --- a/doc/src/fix_spring_self.rst +++ b/doc/src/fix_spring_self.rst @@ -41,7 +41,8 @@ directions, but it can be limited to the xy-, xz-, yz-plane and the x-, y-, or z-direction, thus restraining the atoms to a line or a plane, respectively. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the original coordinates of tethered atoms to :doc:`binary restart files `, so that the spring effect will be the same in a restarted simulation. See the @@ -86,4 +87,7 @@ Related commands :doc:`fix drag `, :doc:`fix spring `, :doc:`fix smd `, :doc:`fix spring/rg ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_srd.rst b/doc/src/fix_srd.rst index 70f07cc0bf..f3a10df321 100644 --- a/doc/src/fix_srd.rst +++ b/doc/src/fix_srd.rst @@ -340,7 +340,8 @@ particles. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_store_force.rst b/doc/src/fix_store_force.rst index d9ccd162fd..f6bed4d4af 100644 --- a/doc/src/fix_store_force.rst +++ b/doc/src/fix_store_force.rst @@ -49,7 +49,8 @@ potentially modify the force on each atom. Examples of such fixes are to include certain constraints (e.g. fix shake) in the stored force, then it could be specified after some fixes and before others. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -71,4 +72,7 @@ Related commands :doc:`fix store_state ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_store_state.rst b/doc/src/fix_store_state.rst index b8fee6b5ea..3841ef6359 100644 --- a/doc/src/fix_store_state.rst +++ b/doc/src/fix_store_state.rst @@ -102,7 +102,8 @@ The requested values are stored in a per-atom vector or array as discussed below. Zeroes are stored for atoms not in the specified group. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the per-atom values it stores to :doc:`binary restart files `, so that the values can be restored when a simulation is restarted. See the :doc:`read_restart ` @@ -110,6 +111,15 @@ command for info on how to re-specify a fix in an input script that reads a restart file, so that the operation of the fix continues in an uninterrupted fashion. +.. warning:: + + When reading data from a restart, the fix command has to be specified + **exactly** the same way as before. LAMMPS will only check whether a + fix is of the same style and has the same fix ID and in case of a match + will then try to initialize the fix with the data stored in the binary + restart file. If the fix store/state command does not match exactly, + data can be corrupted or LAMMPS may crash. + None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_temp_berendsen.rst b/doc/src/fix_temp_berendsen.rst index e837a21847..ae9f8a933a 100644 --- a/doc/src/fix_temp_berendsen.rst +++ b/doc/src/fix_temp_berendsen.rst @@ -117,7 +117,8 @@ thermal degrees of freedom, and the bias is added back in. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the cumulative global energy change to :doc:`binary restart files `. See the @@ -164,7 +165,10 @@ Related commands :doc:`fix_modify `, :doc:`compute temp `, :doc:`fix press/berendsen ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_temp_csvr.rst b/doc/src/fix_temp_csvr.rst index 9c3a722be1..8faa6035cf 100644 --- a/doc/src/fix_temp_csvr.rst +++ b/doc/src/fix_temp_csvr.rst @@ -1,4 +1,5 @@ .. index:: fix temp/csvr +.. index:: fix temp/csld fix temp/csvr command ===================== @@ -125,7 +126,8 @@ thermal degrees of freedom, and the bias is added back in. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" These fixes write the cumulative global energy change and the random number generator states to :doc:`binary restart files `. @@ -174,7 +176,10 @@ Related commands :doc:`fix_modify `, :doc:`compute temp `, :doc:`fix temp/berendsen ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_temp_rescale.rst b/doc/src/fix_temp_rescale.rst index d23006c52b..b00d8e446a 100644 --- a/doc/src/fix_temp_rescale.rst +++ b/doc/src/fix_temp_rescale.rst @@ -124,9 +124,14 @@ thermal degrees of freedom, and the bias is added back in. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" -No information about this fix is written to :doc:`binary restart files `. +This fix writes the cumulative global energy change to :doc:`binary +restart files `. See the :doc:`read_restart ` +command for info on how to re-specify a fix in an input script that +reads a restart file, so that the fix continues in an uninterrupted +fashion. The :doc:`fix_modify ` *temp* option is supported by this fix. You can use it to assign a temperature :doc:`compute ` @@ -136,7 +141,8 @@ this fix and by the compute should be the same. The :doc:`fix_modify ` *energy* option is supported by this fix to add the energy change implied by a velocity rescaling to the -system's potential energy as part of :doc:`thermodynamic output `. +system's potential energy as part of :doc:`thermodynamic output +`. This fix computes a global scalar which can be accessed by various :doc:`output commands `. The scalar is the cumulative @@ -159,4 +165,7 @@ Related commands :doc:`fix langevin `, :doc:`fix nvt `, :doc:`fix_modify ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_temp_rescale_eff.rst b/doc/src/fix_temp_rescale_eff.rst index 5173e6addc..4ad175b62f 100644 --- a/doc/src/fix_temp_rescale_eff.rst +++ b/doc/src/fix_temp_rescale_eff.rst @@ -35,7 +35,8 @@ The operation of this fix is exactly like that described by the :doc:`fix temp/r is also applied to the radial electron velocity for electron particles. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -72,4 +73,7 @@ Related commands :doc:`fix langevin/eff `, :doc:`fix nvt/eff `, :doc:`fix_modify `, :doc:`fix temp rescale `, -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_tfmc.rst b/doc/src/fix_tfmc.rst index fe290dfc0c..ae8420089a 100644 --- a/doc/src/fix_tfmc.rst +++ b/doc/src/fix_tfmc.rst @@ -116,7 +116,8 @@ rotational component of the tfMC displacements after every iteration. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_thermal_conductivity.rst b/doc/src/fix_thermal_conductivity.rst index 6b8b670694..96dbc43540 100644 --- a/doc/src/fix_thermal_conductivity.rst +++ b/doc/src/fix_thermal_conductivity.rst @@ -108,7 +108,8 @@ fluid, in appropriate units. See the :ref:`Muller-Plathe paper accurately infer a thermal conductivity and should try increasing the Nevery parameter. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_ti_spring.rst b/doc/src/fix_ti_spring.rst index 258e380842..08bd6ff2a8 100644 --- a/doc/src/fix_ti_spring.rst +++ b/doc/src/fix_ti_spring.rst @@ -23,7 +23,8 @@ Syntax *function* value = function-ID function-ID = ID of the switching function (1 or 2) -**Example:** +Example +""""""" .. code-block:: LAMMPS @@ -116,7 +117,8 @@ increase in computational resources cost. option will *NOT* solve this problem). The Langevin thermostat (:doc:`fix langevin `) correctly thermostats the system and we advise its usage with ti/spring command. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the original coordinates of tethered atoms to :doc:`binary restart files `, so that the spring effect will be the same in a restarted simulation. See the :doc:`read restart ` command for info on how to re-specify a fix diff --git a/doc/src/fix_tmd.rst b/doc/src/fix_tmd.rst index 521da5ecb2..9c9d77820d 100644 --- a/doc/src/fix_tmd.rst +++ b/doc/src/fix_tmd.rst @@ -89,7 +89,8 @@ to prevent it being overwritten. For more information about TMD, see :ref:`(Schlitter1) ` and :ref:`(Schlitter2) `. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored @@ -117,9 +118,16 @@ To read gzipped target files, you must compile LAMMPS with the -DLAMMPS_GZIP option. See the :doc:`Build settings ` doc page for details. -**Related commands:** none +Related commands +"""""""""""""""" -**Default:** none +none + + +Default +""""""" + +none ---------- diff --git a/doc/src/fix_ttm.rst b/doc/src/fix_ttm.rst index ae759c1b13..24bc6f297f 100644 --- a/doc/src/fix_ttm.rst +++ b/doc/src/fix_ttm.rst @@ -1,4 +1,5 @@ .. index:: fix ttm +.. index:: fix ttm/mod fix ttm command =============== @@ -281,7 +282,8 @@ ignored. The lines with the even numbers are treated as follows: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" These fixes write the state of the electronic subsystem and the energy exchange between the subsystems to :doc:`binary restart files `. See the :doc:`read_restart ` command @@ -334,7 +336,10 @@ Related commands :doc:`fix langevin `, :doc:`fix dt/reset ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/fix_vector.rst b/doc/src/fix_vector.rst index 81922dea8a..b2c05b1af7 100644 --- a/doc/src/fix_vector.rst +++ b/doc/src/fix_vector.rst @@ -123,7 +123,8 @@ quantities to be stored by fix vector. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -164,4 +165,7 @@ Related commands :doc:`compute `, :doc:`variable ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_viscosity.rst b/doc/src/fix_viscosity.rst index e31cbf2e45..d238c099b5 100644 --- a/doc/src/fix_viscosity.rst +++ b/doc/src/fix_viscosity.rst @@ -113,7 +113,8 @@ system using a :doc:`PPPM solver ` since PPPM does not currently support non-orthogonal boxes. Using fix viscosity keeps the box orthogonal; thus it does not suffer from this limitation. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. diff --git a/doc/src/fix_viscous.rst b/doc/src/fix_viscous.rst index 88d619e56c..ab2f867f33 100644 --- a/doc/src/fix_viscous.rst +++ b/doc/src/fix_viscous.rst @@ -84,7 +84,8 @@ more easily be used as a thermostat. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are @@ -112,4 +113,7 @@ Related commands :doc:`fix langevin ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_wall.rst b/doc/src/fix_wall.rst index 1a922227f2..39ff879138 100644 --- a/doc/src/fix_wall.rst +++ b/doc/src/fix_wall.rst @@ -1,10 +1,15 @@ .. index:: fix wall/lj93 +.. index:: fix wall/lj93/kk +.. index:: fix wall/lj126 +.. index:: fix wall/lj1043 +.. index:: fix wall/colloid +.. index:: fix wall/harmonic +.. index:: fix wall/morse fix wall/lj93 command ===================== -fix wall/lj93/kk command -======================== +Accelerator Variants: *wall/lj93/kk* fix wall/lj126 command ====================== @@ -323,7 +328,8 @@ perturbation on the particles: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. diff --git a/doc/src/fix_wall_body_polygon.rst b/doc/src/fix_wall_body_polygon.rst index a93d71369f..6430317d43 100644 --- a/doc/src/fix_wall_body_polygon.rst +++ b/doc/src/fix_wall_body_polygon.rst @@ -87,7 +87,8 @@ the *amplitude*\ , *omega* is 2 PI / *period*\ , and *delta* is the time elapsed since the fix was specified. The velocity of the wall is set to the derivative of this expression. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored by this fix for @@ -108,4 +109,7 @@ Related commands :doc:`atom_style body `, :doc:`pair_style body/rounded/polygon ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_wall_body_polyhedron.rst b/doc/src/fix_wall_body_polyhedron.rst index 35be8e9259..ad6540de1d 100644 --- a/doc/src/fix_wall_body_polyhedron.rst +++ b/doc/src/fix_wall_body_polyhedron.rst @@ -83,7 +83,8 @@ the *amplitude*\ , *omega* is 2 PI / *period*\ , and *delta* is the time elapsed since the fix was specified. The velocity of the wall is set to the derivative of this expression. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored by this fix for @@ -104,4 +105,7 @@ Related commands :doc:`atom_style body `, :doc:`pair_style body/rounded/polyhedron ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_wall_ees.rst b/doc/src/fix_wall_ees.rst index 79f96765f8..2bab8c6056 100644 --- a/doc/src/fix_wall_ees.rst +++ b/doc/src/fix_wall_ees.rst @@ -1,4 +1,5 @@ .. index:: fix wall/ees +.. index:: fix wall/region/ees fix wall/ees command ==================== diff --git a/doc/src/fix_wall_gran.rst b/doc/src/fix_wall_gran.rst index fb986fb73e..4ebbf35ba1 100644 --- a/doc/src/fix_wall_gran.rst +++ b/doc/src/fix_wall_gran.rst @@ -176,7 +176,8 @@ the clockwise direction for *vshear* > 0 or counter-clockwise for the wall at whatever *radius* has been defined. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the shear friction state of atoms interacting with the wall to :doc:`binary restart files `, so that a simulation can @@ -234,4 +235,7 @@ Related commands :doc:`pair_style gran/\* ` :doc:`pair_style granular ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_wall_gran_region.rst b/doc/src/fix_wall_gran_region.rst index 5d40bdd639..7d62d71a1d 100644 --- a/doc/src/fix_wall_gran_region.rst +++ b/doc/src/fix_wall_gran_region.rst @@ -199,7 +199,8 @@ values for the 6 wall/particle coefficients than for particle/particle interactions. E.g. if you wish to model the wall as a different material. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" Similar to :doc:`fix wall/gran ` command, this fix writes the shear friction state of atoms interacting with the wall to :doc:`binary restart files `, so that a simulation can continue @@ -274,4 +275,7 @@ Related commands :doc:`pair_style granular `, :doc:`region ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_wall_piston.rst b/doc/src/fix_wall_piston.rst index 626634ec83..00cad094eb 100644 --- a/doc/src/fix_wall_piston.rst +++ b/doc/src/fix_wall_piston.rst @@ -90,7 +90,8 @@ define the lattice spacings. ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. No global or per-atom quantities are stored diff --git a/doc/src/fix_wall_reflect.rst b/doc/src/fix_wall_reflect.rst index ffdb32422a..4f014cc628 100644 --- a/doc/src/fix_wall_reflect.rst +++ b/doc/src/fix_wall_reflect.rst @@ -1,10 +1,10 @@ .. index:: fix wall/reflect +.. index:: fix wall/reflect/kk fix wall/reflect command ======================== -fix wall/reflect/kk command -=========================== +Accelerator Variants: *wall/reflect/kk* Syntax """""" @@ -143,7 +143,8 @@ perturbation on the particles: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are @@ -170,7 +171,9 @@ Related commands :doc:`fix wall/lj93 `, :doc:`fix oneway ` -**Default:** +Default +""""""" + The default for the units keyword is lattice. diff --git a/doc/src/fix_wall_region.rst b/doc/src/fix_wall_region.rst index b3f4733c56..2359e27255 100644 --- a/doc/src/fix_wall_region.rst +++ b/doc/src/fix_wall_region.rst @@ -189,7 +189,8 @@ interaction energy is 0.0 at the cutoff distance. For a full description of these wall styles, see fix_style :doc:`wall ` -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. @@ -239,4 +240,7 @@ Related commands :doc:`fix wall/harmonic `, :doc:`fix wall/gran ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_wall_srd.rst b/doc/src/fix_wall_srd.rst index 5df7345a4d..72e7c771b7 100644 --- a/doc/src/fix_wall_srd.rst +++ b/doc/src/fix_wall_srd.rst @@ -177,7 +177,8 @@ perturbation on the particles: ---------- -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" No information about this fix is written to :doc:`binary restart files `. None of the :doc:`fix_modify ` options are relevant to this fix. @@ -205,4 +206,7 @@ Related commands :doc:`fix srd ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/fix_widom.rst b/doc/src/fix_widom.rst index 0d191740af..7b9380edcf 100644 --- a/doc/src/fix_widom.rst +++ b/doc/src/fix_widom.rst @@ -156,7 +156,8 @@ with non-neutral systems. See the :doc:`compute group/group ` documentation for more details about simulating non-neutral systems with kspace on. -**Restart, fix_modify, output, run start/stop, minimize info:** +Restart, fix_modify, output, run start/stop, minimize info +""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" This fix writes the state of the fix to :doc:`binary restart files `. This includes information about the random number generator diff --git a/doc/src/group2ndx.rst b/doc/src/group2ndx.rst index 84e7b6df32..8c265db197 100644 --- a/doc/src/group2ndx.rst +++ b/doc/src/group2ndx.rst @@ -65,4 +65,7 @@ Related commands :doc:`group `, :doc:`dump `, :doc:`fix colvars ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/if.rst b/doc/src/if.rst index 96a0eca42e..3f39edceb3 100644 --- a/doc/src/if.rst +++ b/doc/src/if.rst @@ -204,4 +204,7 @@ Related commands :doc:`variable `, :doc:`print ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_class2.rst b/doc/src/improper_class2.rst index 4c49da2aeb..a84e92b090 100644 --- a/doc/src/improper_class2.rst +++ b/doc/src/improper_class2.rst @@ -1,13 +1,11 @@ .. index:: improper_style class2 +.. index:: improper_style class2/omp +.. index:: improper_style class2/kk improper_style class2 command ============================= -improper_style class2/omp command -================================= - -improper_style class2/kk command -================================ +Accelerator Variants: *class2/omp*, *class2/kk* Syntax """""" @@ -118,7 +116,10 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/improper_coeff.rst b/doc/src/improper_coeff.rst index 8fd8269fd5..c7a79571a4 100644 --- a/doc/src/improper_coeff.rst +++ b/doc/src/improper_coeff.rst @@ -93,4 +93,7 @@ Related commands :doc:`improper_style ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_cossq.rst b/doc/src/improper_cossq.rst index e5073dd600..a6281bc260 100644 --- a/doc/src/improper_cossq.rst +++ b/doc/src/improper_cossq.rst @@ -1,10 +1,10 @@ .. index:: improper_style cossq +.. index:: improper_style cossq/omp improper_style cossq command ============================ -improper_style cossq/omp command -================================ +Accelerator Variants: *cossq/omp* Syntax """""" @@ -72,4 +72,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_cvff.rst b/doc/src/improper_cvff.rst index 4bee3c2acf..5bd7fdf911 100644 --- a/doc/src/improper_cvff.rst +++ b/doc/src/improper_cvff.rst @@ -1,13 +1,11 @@ .. index:: improper_style cvff +.. index:: improper_style cvff/intel +.. index:: improper_style cvff/omp improper_style cvff command =========================== -improper_style cvff/intel command -================================= - -improper_style cvff/omp command -=============================== +Accelerator Variants: *cvff/intel*, *cvff/omp* Syntax """""" @@ -75,4 +73,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_distance.rst b/doc/src/improper_distance.rst index d5f07f9971..1486550c9f 100644 --- a/doc/src/improper_distance.rst +++ b/doc/src/improper_distance.rst @@ -62,4 +62,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_distharm.rst b/doc/src/improper_distharm.rst index 113941bee4..e29ae95ac5 100644 --- a/doc/src/improper_distharm.rst +++ b/doc/src/improper_distharm.rst @@ -56,4 +56,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_fourier.rst b/doc/src/improper_fourier.rst index 4a721854f1..84ea97509d 100644 --- a/doc/src/improper_fourier.rst +++ b/doc/src/improper_fourier.rst @@ -1,10 +1,10 @@ .. index:: improper_style fourier +.. index:: improper_style fourier/omp improper_style fourier command ============================== -improper_style fourier/omp command -================================== +Accelerator Variants: *fourier/omp* Syntax """""" @@ -68,4 +68,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_harmonic.rst b/doc/src/improper_harmonic.rst index 204d7e95c4..4f21e48fa9 100644 --- a/doc/src/improper_harmonic.rst +++ b/doc/src/improper_harmonic.rst @@ -1,16 +1,12 @@ .. index:: improper_style harmonic +.. index:: improper_style harmonic/intel +.. index:: improper_style harmonic/kk +.. index:: improper_style harmonic/omp improper_style harmonic command =============================== -improper_style harmonic/intel command -===================================== - -improper_style harmonic/kk command -================================== - -improper_style harmonic/omp command -=================================== +Accelerator Variants: *harmonic/intel*, *harmonic/kk*, *harmonic/omp* Syntax """""" @@ -102,4 +98,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_hybrid.rst b/doc/src/improper_hybrid.rst index a36d05e719..cc26e14ce5 100644 --- a/doc/src/improper_hybrid.rst +++ b/doc/src/improper_hybrid.rst @@ -71,4 +71,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_inversion_harmonic.rst b/doc/src/improper_inversion_harmonic.rst index 4a4ad9e863..1c57b5daf1 100644 --- a/doc/src/improper_inversion_harmonic.rst +++ b/doc/src/improper_inversion_harmonic.rst @@ -66,4 +66,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_none.rst b/doc/src/improper_none.rst index c1c194041a..bb50eaa121 100644 --- a/doc/src/improper_none.rst +++ b/doc/src/improper_none.rst @@ -36,4 +36,7 @@ Related commands :doc:`improper_style zero ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_ring.rst b/doc/src/improper_ring.rst index df319396e2..d67c999714 100644 --- a/doc/src/improper_ring.rst +++ b/doc/src/improper_ring.rst @@ -1,10 +1,10 @@ .. index:: improper_style ring +.. index:: improper_style ring/omp improper_style ring command =========================== -improper_style ring/omp command -=============================== +Accelerator Variants: *ring/omp* Syntax """""" diff --git a/doc/src/improper_sqdistharm.rst b/doc/src/improper_sqdistharm.rst index 2f8723a68c..09a661700f 100644 --- a/doc/src/improper_sqdistharm.rst +++ b/doc/src/improper_sqdistharm.rst @@ -57,4 +57,7 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/improper_umbrella.rst b/doc/src/improper_umbrella.rst index 7ed7fe4dd0..5d4aa571e1 100644 --- a/doc/src/improper_umbrella.rst +++ b/doc/src/improper_umbrella.rst @@ -1,10 +1,10 @@ .. index:: improper_style umbrella +.. index:: improper_style umbrella/omp improper_style umbrella command =============================== -improper_style umbrella/omp command -=================================== +Accelerator Variants: *umbrella/omp* Syntax """""" @@ -72,7 +72,10 @@ Related commands :doc:`improper_coeff ` -**Default:** none +Default +""""""" + +none ---------- diff --git a/doc/src/improper_zero.rst b/doc/src/improper_zero.rst index 354c0d486e..193c527b2a 100644 --- a/doc/src/improper_zero.rst +++ b/doc/src/improper_zero.rst @@ -44,8 +44,15 @@ Restrictions """""""""""" none -**Related commands:** none +Related commands +"""""""""""""""" + +none + :doc:`improper_style none ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/include.rst b/doc/src/include.rst index e98ffa05e4..6d146061db 100644 --- a/doc/src/include.rst +++ b/doc/src/include.rst @@ -42,4 +42,7 @@ Related commands :doc:`variable `, :doc:`jump ` -**Default:** none +Default +""""""" + +none diff --git a/doc/src/jump.rst b/doc/src/jump.rst index bad13630ab..27ecb53c79 100644 --- a/doc/src/jump.rst +++ b/doc/src/jump.rst @@ -145,4 +145,7 @@ Related commands :doc:`variable `, :doc:`include `, :doc:`label

- {{ nav_version }} -
+
Version: {{ nav_version }}
+
git info: {{ release }}
{% endif %} {% endif %} diff --git a/doc/utils/sphinx-config/_themes/lammps_theme/static/css/lammps.css b/doc/utils/sphinx-config/_themes/lammps_theme/static/css/lammps.css deleted file mode 100644 index b5637b389c..0000000000 --- a/doc/utils/sphinx-config/_themes/lammps_theme/static/css/lammps.css +++ /dev/null @@ -1,5 +0,0 @@ -.lammps_version { - text-align: center; - display: block; - margin-bottom: 0.809em; -} diff --git a/doc/utils/sphinx-config/_themes/lammps_theme/theme.conf b/doc/utils/sphinx-config/_themes/lammps_theme/theme.conf index 699f1bd5f3..37dc1185b7 100644 --- a/doc/utils/sphinx-config/_themes/lammps_theme/theme.conf +++ b/doc/utils/sphinx-config/_themes/lammps_theme/theme.conf @@ -13,6 +13,6 @@ includehidden = True titles_only = logo_only = display_version = True -prev_next_buttons_location = bottom -style_external_links = False +prev_next_buttons_location = both +style_external_links = True style_nav_header_background = diff --git a/doc/utils/sphinx-config/conf.py b/doc/utils/sphinx-config/conf.py.in similarity index 87% rename from doc/utils/sphinx-config/conf.py rename to doc/utils/sphinx-config/conf.py.in index 446eaeedac..23168bf080 100644 --- a/doc/utils/sphinx-config/conf.py +++ b/doc/utils/sphinx-config/conf.py.in @@ -23,11 +23,16 @@ try: except: pass +LAMMPS_DOC_DIR = '@LAMMPS_DOC_DIR@' +LAMMPS_SOURCE_DIR = '@LAMMPS_SOURCE_DIR@' +LAMMPS_PYTHON_DIR = '@LAMMPS_PYTHON_DIR@' +LAMMPS_DOXYGEN_XML_DIR = '@DOXYGEN_XML_DIR@' + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) -sys.path.append(os.path.join(os.path.dirname(__file__), '../../src/_ext')) +sys.path.append(os.path.join(LAMMPS_DOC_DIR, 'src', '_ext')) # -- General configuration ------------------------------------------------ @@ -41,7 +46,11 @@ extensions = [ 'sphinx.ext.mathjax', 'sphinx.ext.imgmath', 'sphinx.ext.autodoc', + 'sphinxfortran.fortran_domain', + 'sphinx_tabs.tabs', 'table_from_list', + 'tab_or_note', + 'breathe', ] # 2017-12-07: commented out, since this package is broken with Sphinx 16.x # yet we can no longer use Sphinx 15.x, since that breaks with @@ -72,12 +81,24 @@ copyright = '2003-2020 Sandia Corporation' def get_lammps_version(): import os script_dir = os.path.dirname(os.path.realpath(__file__)) - with open(os.path.join(script_dir, '../../../src/version.h'), 'r') as f: + with open(os.path.join(LAMMPS_SOURCE_DIR, 'version.h'), 'r') as f: line = f.readline() start_pos = line.find('"')+1 end_pos = line.find('"', start_pos) return line[start_pos:end_pos] +def get_git_info(): + import subprocess,time + + git_n_date = '' + try: + gitinfo = subprocess.run(['git','describe'],stdout=subprocess.PIPE,stderr=subprocess.PIPE) + if gitinfo.returncode == 0: + git_n_date = gitinfo.stdout.decode().replace('_',' ') + except: + pass + return git_n_date + # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. @@ -85,7 +106,7 @@ def get_lammps_version(): # The short X.Y version. version = get_lammps_version() # The full version, including alpha/beta/rc tags. -release = '' +release = get_git_info() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -136,7 +157,9 @@ html_theme = 'lammps_theme' # further. For a list of options available for each theme, see the # documentation. html_theme_options = { - 'logo_only' : True + 'logo_only' : True, + 'navigation_depth': 3, + 'collapse_navigation': True } # Add any paths that contain custom themes here, relative to this directory. @@ -151,7 +174,7 @@ html_title = "LAMMPS documentation" # The name of an image file (relative to this directory) to place at the top # of the sidebar. -html_logo = 'lammps-logo.png' +html_logo = '_static/lammps-logo.png' # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 @@ -312,7 +335,7 @@ texinfo_documents = [ epub_title = 'LAMMPS Documentation - ' + get_lammps_version() -epub_cover = ('lammps-logo.png', '') +epub_cover = ('_static/lammps-logo.png', '') epub_description = """ This is the Manual for the LAMMPS software package. @@ -340,13 +363,29 @@ if spelling_spec and has_enchant: spelling_lang='en_US' spelling_word_list_filename='false_positives.txt' -sys.path.append(os.path.join(os.path.dirname(__file__), '.')) +conf_script_dir = os.path.dirname(os.path.realpath(__file__)) +sys.path.append(os.path.join(conf_script_dir, '.')) import LAMMPSLexer from sphinx.highlighting import lexers lexers['LAMMPS'] = LAMMPSLexer.LAMMPSLexer(startinline=True) -sys.path.append(os.path.join(os.path.dirname(__file__), '../../../python')) +sys.path.append(LAMMPS_PYTHON_DIR) # avoid syntax highlighting in blocks that don't specify language highlight_language = 'none' + +# autodoc configuration + +autodoc_member_order = 'bysource' +#autoclass_content = 'both' + +# breathe configuration + +breathe_projects = { 'progguide' : LAMMPS_DOXYGEN_XML_DIR } +breathe_default_project = 'progguide' +breathe_show_define_initializer = True +breathe_domain_by_extension = { 'h' : 'cpp', + 'cpp' : 'cpp', + 'c' : 'c', + } diff --git a/doc/utils/sphinx-config/false_positives.txt b/doc/utils/sphinx-config/false_positives.txt index 2bf3e917cf..b276933a88 100644 --- a/doc/utils/sphinx-config/false_positives.txt +++ b/doc/utils/sphinx-config/false_positives.txt @@ -43,6 +43,7 @@ Afshar agilio Agilio agni +Agnolin Ai Aidan aij @@ -109,11 +110,14 @@ api Apoorva Appl Apu +arallel arccos +arge Archlinux arcsin arg args +argv arrhenius Arun arXiv @@ -126,6 +130,7 @@ aspherical asphericity Asq assignee +assively Asta Astart Astop @@ -137,6 +142,8 @@ atc AtC ATC athermal +atime +atimestep athomps atm atomeye @@ -206,7 +213,6 @@ bcolor bdiam bdw Beckman -behaviour Belak Bellott benchmarking @@ -247,6 +253,7 @@ bispectrum Bispectrum bitbucket bitmapped +bitmask bitrate bitrates Bitzek @@ -265,6 +272,7 @@ bodystyle Bogaerts Bogusz Bohrs +boltz Boltzman BondAngle BondBond @@ -283,6 +291,14 @@ Botu Bouguet Bourne boxcolor +boxlo +boxhi +boxxlo +boxxhi +boxylo +boxyhi +boxzlo +boxzhi bp bpclermont bpls @@ -301,6 +317,7 @@ Bryantsev Btarget btype buckPlusAttr +buf builtin Bulatov Bureekaew @@ -311,6 +328,7 @@ Buyl Bybee bz cadetblue +calc calibre caltech Caltech @@ -369,6 +387,7 @@ charmm CHARMM charmmfsh charmmfsw +charptr Chaudhuri checkbox checkmark @@ -382,6 +401,7 @@ ChiralIDs chiralIDs chirality Cho +ChooseOffset chris Christoph Chu @@ -407,6 +427,7 @@ cmap Cmax cmd cmdlist +cmds Cmin cmm CMM @@ -436,6 +457,7 @@ Colvars COLVARS comID Commun +compositing compressibility compressive Comput @@ -452,6 +474,7 @@ config configfile configurational conformational +ConstMatrix Contrib cooperativity coord @@ -584,6 +607,7 @@ del delaystep DeleteIDs deleteIDs +delflag Dellago delocalization delocalized @@ -599,6 +623,7 @@ Dequidt der dereference derekt +Deresiewicz Derjagin Derjaguin Derlet @@ -620,7 +645,10 @@ dhex dia diag diagonalization +diagonalize diagonalized +diagonalizers +diagonalizing Diallo diel differentiable @@ -668,6 +696,8 @@ Donadio dotc Doty doxygen +doxygenclass +doxygenfunction downarrow Doye dpd @@ -721,6 +751,7 @@ Eaat Eacn eam eangle +earg eatom Eb Eba @@ -756,8 +787,15 @@ Eggebrecht ehex eHEX Ei -Eigen -Eigensolve +eigen +eigensolve +eigensolver +eigensolvers +eigendecomposition +eigenvalue +eigenvalues +eigenvector +eigenvectors eij Eij Eijnden @@ -841,6 +879,7 @@ Erhart erorate erose erotate +errno Ertas ervel Espanol @@ -870,6 +909,11 @@ eV evalue Evanseck evdwl +evector +evec +evecs +eval +evals Everaers Evgeny evirials @@ -899,6 +943,7 @@ Fc fcc fcm Fd +fd fdotr fdt Fehlberg @@ -923,6 +968,7 @@ ffplay fft fftbench fftw +fgets fhg Fi Fichthorn @@ -958,6 +1004,7 @@ fmackay fmag fmass fmm +fmt fmx fmy fmz @@ -971,11 +1018,13 @@ Fock Fogarty Foiles fopenmp +forceclear forestgreen formatarg formulae Forschungszentrum Fortran +fortran Fosado fourier fp @@ -987,6 +1036,7 @@ Fraige framerate Frauenheim Fraunhofer +fread Freitas Frenkel Friedrichs @@ -994,6 +1044,7 @@ fs fsh fstyle fsw +ftm ftol fugacity Fumi @@ -1039,6 +1090,7 @@ Germann Germano gerolf Gerolf +Gershgorin gettimeofday gewald Gezelter @@ -1101,6 +1153,7 @@ gromos Gronbech Groot groupbig +groupbit grp Grueneisen gsmooth @@ -1153,6 +1206,7 @@ Henkelman Henkes henrich Henrich +Hermitian Herrmann Hertizian hertzian @@ -1163,6 +1217,7 @@ hexorder Heyes HfO hgrid +hhmrr Hibbs Higdon Hijazi @@ -1172,6 +1227,7 @@ histogrammed histogramming hma hmaktulga +hplanck hoc Hochbruck Hofling @@ -1209,11 +1265,13 @@ hydrostatically Hynninen Hyoungki hyperdynamics +hyperplane hyperradius hyperspherical hysteretic hz Ibanez +iatom ibar ibm icc @@ -1222,6 +1280,7 @@ icosahedral idealgas IDR idx +ie ielement ieni ifdefs @@ -1244,8 +1303,10 @@ Imageint Imagemagick imd Impey +impl impropers Impropers +imulator includelink incompressible incrementing @@ -1256,6 +1317,7 @@ indices inertiax inertiay inertiaz +infile infty inhomogeneities inhomogeneous @@ -1265,6 +1327,7 @@ initializations initio InP inregion +instantiation Institut integrators Integrators @@ -1296,6 +1359,7 @@ ipp Ippolito IPv IPython +ipython Isele isenthalpic ish @@ -1310,6 +1374,8 @@ isothermal isotropically isovolume Isralewitz +iter +iters iteratively Ith Itsets @@ -1319,6 +1385,7 @@ iva Ivanov Ivector Iw +iwyu ixcm ixx Ixx @@ -1444,6 +1511,7 @@ Kloza kmax Kmax KMP +kmu Knizhnik knl Kofke @@ -1484,6 +1552,7 @@ Kub Kubo Kumagai Kumar +Kurebayashi Kuronen Kusters Kutta @@ -1494,12 +1563,14 @@ Ladd lagrangian lambdai lamda +LambdaLanczos lammps Lammps LAMMPS lammpsplot Lampis Lamoureux +Lanczos Lande Landron langevin @@ -1688,6 +1759,7 @@ Maras Marchetti Marchi Mariella +Marinica Marrink Marroquin Marsaglia @@ -1713,6 +1785,7 @@ Mattox Mattson maxangle maxbond +maxchunk maxelt maxeval maxfiles @@ -1805,6 +1878,7 @@ Microscale midnightblue mie Mie +Mij Mikami Militzer Minary @@ -1903,6 +1977,7 @@ Muccioli mui Mukherjee Mulders +mult multi multibody Multibody @@ -1930,11 +2005,13 @@ muz mv mV Mvapich +mvh mvv MxN myCompute myIndex mylammps +MyPool mysocket myTemp myVec @@ -1942,11 +2019,14 @@ na nabla Nagaosa Nakano +nall namespace namespaces +namedtuple nan NaN Nandor +nangles Nangletype nangletypes Nangletypes @@ -1975,6 +2055,7 @@ Nbin Nbins nbody Nbody +nbonds nbondtype Nbondtype nbondtypes @@ -1987,9 +2068,11 @@ Nc nchunk Nchunk ncoeff +ncol ncorr ncount nd +ndihedrals Ndihedraltype Ndirango ndof @@ -2031,10 +2114,12 @@ Ngyuen nh nharmonic nhc +nhi NiAlH Nicklas Niklasson Nikolskiy +nimpropers Nimpropertype Ninteger Nissila @@ -2043,9 +2128,11 @@ nitride nitrides niu Nk +nktv nl nlen Nlines +nlo nlocal Nlocal Nlog @@ -2053,7 +2140,9 @@ nlp nm Nm Nmax +nmax Nmin +nmin Nmols nn Nocedal @@ -2106,6 +2195,7 @@ Nrepeat nreset Nrho Nroff +nrow nrun Ns Nsample @@ -2124,6 +2214,7 @@ Nt Ntable ntheta nthreads +ntimestep Ntptask Ntriples Ntype @@ -2168,6 +2259,7 @@ Okamoto O'Keefe OKeefe oldlace +olecular Oleinik Olfason olivedrab @@ -2219,8 +2311,10 @@ oxdna oxrna oxDNA oxRNA +packings padua Padua +pafi palegoldenrod palegreen paleturquoise @@ -2250,6 +2344,8 @@ Particuology pastewka Pastewka pathangle +pathname +pathnames Patomtrans Pattnaik Pavese @@ -2270,6 +2366,7 @@ peachpuff Pearlman Pedersen peID +PEigenDense Peng peptide peratom @@ -2350,6 +2447,7 @@ polydisperse polydispersity polyelectrolyte polyhedra +polymorphism popen Popov popstore @@ -2383,6 +2481,7 @@ proc Proc procs Prony +progguide ps Ps pscreen @@ -2429,7 +2528,9 @@ qbmsst qcore qdist qE +qe qeff +qelectron qeq QeQ QEq @@ -2447,6 +2548,8 @@ qmol qoffload qopenmp qoverride +qqr +qqrd qtb quadratically quadrupolar @@ -2492,6 +2595,8 @@ rdf RDideal rdx reacter +realTypeMap +real_t README realtime reamin @@ -2502,6 +2607,7 @@ rebo recursing Ree refactored +refactoring reflectionstyle regoin Reinders @@ -2587,6 +2693,7 @@ Rkouter RkouterN rmask Rmask +rmass rmax Rmax rmdir @@ -2672,6 +2779,7 @@ Schuring Schwen screenshot screenshots +Scripps Scripta sdk sdpd @@ -2721,6 +2829,7 @@ shlib SHM shm shockvel +shrinkexceed Shugaev si SiC @@ -2849,11 +2958,16 @@ strcmp streitz Streitz Streiz +strerror strided strietz +strmatch +strncmp +strstr Stukowski Su subbox +Subclassed subcutoff subcycle subcycling @@ -2880,6 +2994,7 @@ sw Swegat swiggle Swiler +Swinburne Swol Swope Sx @@ -2993,8 +3108,11 @@ Tmin tmp tN Tobias +Tohoku +tokenizer tokyo tol +tomic toolchain topologies Toporov @@ -3055,6 +3173,8 @@ tu Tuckerman tue tunable +tuple +tuples Turkand Tutein tweakable @@ -3223,6 +3343,7 @@ vv vx Vx vxcm +vxmu vy Vy vycm @@ -3255,8 +3376,9 @@ Widom widom Wijk Wikipedia -wildcard Wildcard +wildcard +wildcards Wirnsberger wirtes witin @@ -3298,6 +3420,7 @@ Xmax xmgrace xMIC xmin +xml xmovie Xmovie xmu @@ -3312,6 +3435,7 @@ xsu xtc xu Xu +xxt xxxxx xy xyz @@ -3344,6 +3468,7 @@ Yuh yukawa Yukawa Yusof +Yuya yx yy yz @@ -3374,6 +3499,7 @@ zmin zmq zN zs +zst zsu zu zx @@ -3383,3 +3509,7 @@ zz Zm PowerShell filesystems +Zstandard +Zstd +zstd +checksum diff --git a/doc/utils/sphinx-config/lammps-logo.png b/doc/utils/sphinx-config/lammps-logo.png deleted file mode 120000 index 37d35bece1..0000000000 --- a/doc/utils/sphinx-config/lammps-logo.png +++ /dev/null @@ -1 +0,0 @@ -../../src/JPG/lammps-logo.png \ No newline at end of file diff --git a/examples/COUPLE/.gitignore b/examples/COUPLE/.gitignore index 6ffb58df7d..a3927e0c93 100644 --- a/examples/COUPLE/.gitignore +++ b/examples/COUPLE/.gitignore @@ -2,3 +2,7 @@ *.d *.a *~ +liblammps.mod +simpleC +simpleCC +simpleF diff --git a/examples/COUPLE/simple/README b/examples/COUPLE/simple/README index 8a97137bf7..bcd0d635b8 100644 --- a/examples/COUPLE/simple/README +++ b/examples/COUPLE/simple/README @@ -8,16 +8,14 @@ code to perform a coupled calculation. simple.cpp is the C++ driver simple.c is the C driver simple.f90 is the Fortran driver -libfwrapper.c is the Fortran-to-C wrapper The 3 codes do the same thing, so you can compare them to see how to -drive LAMMPS from each language. See lammps/python/example/simple.py -to do something similar from Python. The Fortran driver requires an -additional wrapper library that interfaces the C interface of the -LAMMPS library to Fortran and also translates the MPI communicator -from Fortran to C. +drive LAMMPS from each language. See python/example/simple.py +to do something similar from Python. The Fortran driver requires a +Fortran module that uses the Fortran 03 ISO_C_BINDING module to +interface the LAMMPS C library functions to Fortran. -First build LAMMPS as a library (see examples/COUPLE/README), e.g. +First build LAMMPS as a library (see examples/COUPLE/README), e.g. make mode=shlib mpi @@ -26,27 +24,23 @@ these, which include paths to the LAMMPS library interface, and linking with FFTW (only needed if you built LAMMPS as a library with its PPPM solver). -This builds the C++ driver with the LAMMPS library using the mpiCC +This builds the C++ driver with the LAMMPS library using the mpicxx (C++) compiler: -mpiCC -I/home/sjplimp/lammps/src -c simple.cpp -mpiCC -L/home/sjplimp/lammps/src simple.o -llammps -lfftw -o simpleCC +mpicxx -I/home/sjplimp/lammps/src -c simple.cpp +mpicxx -L/home/sjplimp/lammps/src simple.o -llammps -o simpleCC This builds the C driver with the LAMMPS library using the mpicc (C) compiler: mpicc -I/home/sjplimp/lammps/src -c simple.c -mpicc -L/home/sjplimp/lammps/src simple.o -llammps -lfftw -o simpleC +mpicc -L/home/sjplimp/lammps/src simple.o -llammps -o simpleC -This builds the Fortran wrapper and driver with the LAMMPS library -using the mpicc (C) and mpifort (Fortran) compilers, using the wrapper -in the fortran directory: +This builds the Fortran module and driver with the LAMMPS library +using the mpifort (Fortran) compilers, using the Fortran module from +the fortran directory: -cp ../fortran/libfwrapper.c . -mpicc -I/home/sjplimp/lammps/src -c libfwrapper.c -mpifort -c simple.f90 -mpifort -L/home/sjplimp/lammps/src simple.o libfwrapper.o \ - -llammps -lfftw -o simpleF +mpifort -L/home/sjplimp/lammps/src ../../../fortran/lammps.f90 simple.f90 -llammps -o simpleF You then run simpleCC, simpleC, or simpleF on a parallel machine on some number of processors Q with 2 arguments: @@ -69,10 +63,9 @@ The C driver is calling C-style routines in the src/library.cpp file of LAMMPS. You could add any functions you wish to this file to manipulate LAMMPS data however you wish. -The Fortran driver is using the same C-style routines, but requires an -additional wrapper to make them Fortran callable. Only a subset of the -library functions are currently wrapped, but it should be clear how to -extend the wrapper if desired. +The Fortran driver is using the Fortran 03 module which uses a derived +type with type bound subroutines. Only a small subset of the C library +functions are currently accessible through the Fortran module. The C++ driver does the same thing, except that it instantiates LAMMPS as an object first. Some of the functions in src/library.cpp can be diff --git a/examples/COUPLE/simple/simple.c b/examples/COUPLE/simple/simple.c index f4623470b7..a5ce281b1d 100644 --- a/examples/COUPLE/simple/simple.c +++ b/examples/COUPLE/simple/simple.c @@ -19,11 +19,11 @@ in.lammps = LAMMPS input script See README for compilation instructions */ -#include "stdio.h" -#include "stdlib.h" -#include "string.h" -#include "mpi.h" -#include "lammps/library.h" /* this is a LAMMPS include file */ +#include +#include +#include +#include +#include "library.h" /* this is a LAMMPS include file */ int main(int narg, char **arg) { @@ -72,7 +72,7 @@ int main(int narg, char **arg) all LAMMPS procs call lammps_command() on the line */ void *lmp = NULL; - if (lammps == 1) lammps_open(0,NULL,comm_lammps,&lmp); + if (lammps == 1) lmp = lammps_open(0,NULL,comm_lammps,NULL); int n; char line[1024]; @@ -124,10 +124,10 @@ int main(int narg, char **arg) /* use commands_string() and commands_list() to invoke more commands */ - char *strtwo = "run 10\nrun 20"; + const char *strtwo = "run 10\nrun 20"; if (lammps == 1) lammps_commands_string(lmp,strtwo); - char *cmds[2]; + const char *cmds[2]; cmds[0] = "run 10"; cmds[1] = "run 20"; if (lammps == 1) lammps_commands_list(lmp,2,cmds); diff --git a/examples/COUPLE/simple/simple.cpp b/examples/COUPLE/simple/simple.cpp index a76ed8a6e9..8660dfa656 100644 --- a/examples/COUPLE/simple/simple.cpp +++ b/examples/COUPLE/simple/simple.cpp @@ -25,10 +25,10 @@ #include // these are LAMMPS include files -#include -#include -#include -#include +#include "lammps.h" +#include "input.h" +#include "atom.h" +#include "library.h" using namespace LAMMPS_NS; @@ -135,10 +135,10 @@ int main(int narg, char **arg) // use commands_string() and commands_list() to invoke more commands - char *strtwo = (char *) "run 10\nrun 20"; + const char *strtwo = (char *) "run 10\nrun 20"; if (lammps == 1) lammps_commands_string(lmp,strtwo); - char *cmds[2]; + const char *cmds[2]; cmds[0] = (char *) "run 10"; cmds[1] = (char *) "run 20"; if (lammps == 1) lammps_commands_list(lmp,2,cmds); diff --git a/examples/COUPLE/simple/simple.f90 b/examples/COUPLE/simple/simple.f90 index 0ac3e4fd5c..aacbbfcb79 100644 --- a/examples/COUPLE/simple/simple.f90 +++ b/examples/COUPLE/simple/simple.f90 @@ -18,13 +18,14 @@ ! See README for compilation instructions PROGRAM f_driver + USE mpi + USE liblammps IMPLICIT NONE - INCLUDE 'mpif.h' INTEGER, PARAMETER :: fp=20 INTEGER :: n, narg, ierr, me, nprocs, natoms - INTEGER :: lammps, nprocs_lammps, comm_lammps - INTEGER (kind=8) :: ptr + INTEGER :: color, nprocs_lammps, comm_lammps + TYPE(LAMMPS) :: lmp REAL (kind=8), ALLOCATABLE :: x(:) REAL (kind=8), PARAMETER :: epsilon=0.1 @@ -58,14 +59,14 @@ PROGRAM f_driver END IF END IF - lammps = 0 + color = 0 IF (me < nprocs_lammps) THEN - lammps = 1 + color = 1 ELSE - lammps = MPI_UNDEFINED + color = MPI_UNDEFINED END IF - CALL mpi_comm_split(MPI_COMM_WORLD,lammps,0,comm_lammps,ierr) + CALL mpi_comm_split(MPI_COMM_WORLD,color,0,comm_lammps,ierr) ! open LAMMPS input script on rank zero @@ -81,7 +82,7 @@ PROGRAM f_driver ! (could just send it to proc 0 of comm_lammps and let it Bcast) ! all LAMMPS procs call lammps_command() on the line */ - IF (lammps == 1) CALL lammps_open(comm_lammps,ptr) + IF (color == 1) lmp=lammps(comm=comm_lammps) n = 0 DO @@ -99,7 +100,7 @@ PROGRAM f_driver CALL mpi_bcast(n,1,MPI_INTEGER,0,MPI_COMM_WORLD,ierr) IF (n == 0) EXIT CALL mpi_bcast(line,n,MPI_CHARACTER,0,MPI_COMM_WORLD,ierr) - IF (lammps == 1) CALL lammps_command(ptr,line,n) + IF (color == 1) CALL lmp%command(line(1:n)) END DO CLOSE(UNIT=fp) @@ -109,27 +110,27 @@ PROGRAM f_driver ! put coords back into LAMMPS ! run a single step with changed coords */ - IF (lammps == 1) THEN - CALL lammps_command(ptr,'run 10',6) + IF (color == 1) THEN + CALL lmp%command('run 10') - CALL lammps_get_natoms(ptr,natoms) + natoms = NINT(lmp%get_natoms()) ALLOCATE(x(3*natoms)) ! these calls are commented out, b/c libfwrapper.c ! needs to be updated to use gather_atoms and scatter_atoms - !CALL lammps_gather_atoms(ptr,'x',1,3,x); + !CALL lammps_gather_atoms(ptr,'x',1,3,x) !x(1) = x(1) + epsilon - !CALL lammps_scatter_atoms(ptr,'x',1,3,x); + !CALL lammps_scatter_atoms(ptr,'x',1,3,x) DEALLOCATE(x) - CALL lammps_command(ptr,'run 1',5); + CALL lmp%command('run 1') END IF ! free LAMMPS object - IF (lammps == 1) CALL lammps_close(ptr); + IF (color == 1) CALL lmp%close() ! close down MPI diff --git a/examples/USER/colvars/out.colvars.state b/examples/USER/colvars/out.colvars.state index e5c6e98ef5..e1c98c5096 100644 --- a/examples/USER/colvars/out.colvars.state +++ b/examples/USER/colvars/out.colvars.state @@ -1,7 +1,7 @@ configuration { step 200 dt 2.000000e+00 - version 2018-11-16 + version 2020-07-07 } colvar { diff --git a/examples/USER/colvars/out.colvars.state.old b/examples/USER/colvars/out.colvars.state.old index ea33a8b1b1..458485ca83 100644 --- a/examples/USER/colvars/out.colvars.state.old +++ b/examples/USER/colvars/out.colvars.state.old @@ -1,7 +1,7 @@ configuration { step 100 dt 2.000000e+00 - version 2018-11-16 + version 2020-07-07 } colvar { diff --git a/examples/USER/colvars/out2.colvars.state b/examples/USER/colvars/out2.colvars.state index e923862831..95bb3dafbb 100644 --- a/examples/USER/colvars/out2.colvars.state +++ b/examples/USER/colvars/out2.colvars.state @@ -1,7 +1,7 @@ configuration { step 300 dt 2.000000e+00 - version 2018-11-16 + version 2020-07-07 } colvar { diff --git a/examples/USER/colvars/peptide2.colvars.state b/examples/USER/colvars/peptide2.colvars.state index 5272bb7c4a..6e23e3a6c5 100644 --- a/examples/USER/colvars/peptide2.colvars.state +++ b/examples/USER/colvars/peptide2.colvars.state @@ -1,7 +1,7 @@ configuration { step 100 dt 2.000000e+00 - version 2018-11-16 + version 2020-07-07 } colvar { diff --git a/examples/USER/misc/pafi/.gitignore b/examples/USER/misc/pafi/.gitignore new file mode 100644 index 0000000000..65a28d0cec --- /dev/null +++ b/examples/USER/misc/pafi/.gitignore @@ -0,0 +1,2 @@ +*.dat +lmp* diff --git a/examples/USER/misc/pafi/README b/examples/USER/misc/pafi/README new file mode 100644 index 0000000000..c35dff313c --- /dev/null +++ b/examples/USER/misc/pafi/README @@ -0,0 +1,40 @@ +Run an example constrained sample for USER-PAFI calculation + +Author: +Thomas Swinburne, CNRS / CINaM, Marseille +swinburne@cinam.univ-mrs.fr +tomswinburne.github.io + + +PAFI performs constrained force averages on hyperplanes to a reference pathway in order to compute unbiased free energy barriers + + +Paper: +T. D. Swinburne and M. C. Marinica +Unsupervised calculation of free energy barriers in large crystalline systems +Physical Review Letters 276, 1 2018 + + +Also see https://github.com/tomswinburne/pafi/ for the PAFI code which distributes +multiple LAMMPS workers in parallel to compute and collate fix pafi averages, +allowing the calculation of free energy barriers and minimum free energy paths. + +To compile: + +make yes-user-misc # for PAFI +make yes-manybody # for EAM potential +make machine # for binary (machine= e.g. mpi) + +To run the example from this folder: +``` +mpirun -np NPROCS /path/to/lammps/src/lmp_machine -in in.pafi +``` + +This example executes a hyperplane constrained overdamped Langevin simulation +whilst recording the projected free energy gradient, then minimizes in-plane, +then removes the hyperplane constraint and minimizes the whole system. +If the temperature is too high the system will leave the local minima of +the constrained system; PAFI checks for this also. + + +To generate your own path, please see the LAMMPS documentation for more details diff --git a/examples/USER/misc/pafi/in.pafi b/examples/USER/misc/pafi/in.pafi new file mode 100644 index 0000000000..9e9efb156b --- /dev/null +++ b/examples/USER/misc/pafi/in.pafi @@ -0,0 +1,86 @@ +units metal +atom_style atomic +atom_modify map array sort 0 0.0 +neigh_modify every 2 delay 10 check yes page 1000000 one 100000 + +## read in path data using fix property/atom- here 4th image of a NEB +fix pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz +read_data pafipath.4.data fix pa NULL PafiPath + +## EAM potential +pair_style eam/fs +pair_coeff * * ../../../../potentials/Fe_mm.eam.fs Fe + +mass * 55.85 +thermo 100 +min_style fire + + +compute pe all pe +variable pe equal pe +run 0 +print "energy=${pe}" + +## compute property/atom to access relevant fields +compute pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz +run 0 + +## fix name group-id pafi compute-id temperature tdamp seed overdamped 0/1 com 0/1 +fix hp all pafi pa 500.0 0.01 434 overdamped no com yes + +run 0 +minimize 0 0 1000 1000 # best if using NEB path +compute dx all displace/atom +compute dmag all reduce max c_dx[4] +variable maxjump equal sqrt(c_dmag) + +thermo_style custom step pe temp v_maxjump + + +variable dn equal f_hp[4]*f_hp[4] # should be zero to float precision + + +fix af all ave/time 1 1000 1000 f_hp[1] f_hp[2] f_hp[3] v_dn + +variable adn equal sqrt(f_af[4]) # should be very small (approx. 1e-6 A) +variable apf equal f_af[1] + + +run 1000 +minimize 0 0 1000 1000 + +variable s_pe equal ${pe} +variable s_apf equal ${apf} +variable s_adn equal ${adn} +variable s_maxjump equal ${maxjump} + +unfix hp +unfix pa +unfix af +minimize 0 0 1000 1000 + + +print """ +---------- PAFI RESULTS -------- + +During run: + Average Distance From Hyperplane = ${s_adn}A (Should be very small, around 1e-5A), + Average Force Projection Along MFEP = ${s_apf} eV/A +""" +print """ +In-plane minimization post-run: +energy = ${s_pe} eV + +""" +if "${s_maxjump} > 0.1" then & +"print 'Max Atomic Displacement = ${s_maxjump}A > 0.1A'" & +"print ' => Possible shallow in-plane metastability: Reduce time in basin and/or decrease tdamp'" & +else & +"print 'Max Atomic Displacement = ${s_maxjump}A < 0.1A => No in-plane jumps'" +print """ + +Full minimization after removal of PAFI fixes: +energy = ${pe} eV + +----- END PAFI ---- +""" diff --git a/examples/USER/misc/pafi/log.15Apr20.pafi.g++.1 b/examples/USER/misc/pafi/log.15Apr20.pafi.g++.1 new file mode 100644 index 0000000000..513cbed512 --- /dev/null +++ b/examples/USER/misc/pafi/log.15Apr20.pafi.g++.1 @@ -0,0 +1,401 @@ +LAMMPS (24 Aug 2020) +units metal +atom_style atomic +atom_modify map array sort 0 0.0 +neigh_modify every 2 delay 10 check yes page 1000000 one 100000 + +## read in path data using fix property/atom- here 4th image of a NEB +fix pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz +read_data pafipath.4.data fix pa NULL PafiPath +Reading data file ... + orthogonal box = (0.0000000 0.0000000 0.0000000) to (19.987184 19.987184 19.987184) + 1 by 1 by 1 MPI processor grid + reading atoms ... + 687 atoms + read_data CPU = 0.007 seconds + +## EAM potential +pair_style eam/fs +pair_coeff * * ../../../../potentials/Fe_mm.eam.fs Fe +Reading eam/fs potential file ../../../../potentials/Fe_mm.eam.fs with DATE: 2007-06-11 + +mass * 55.85 +thermo 100 +min_style fire + + +compute pe all pe +variable pe equal pe +run 0 +Neighbor list info ... + update every 2 steps, delay 10 steps, check yes + max neighbors/atom: 100000, page size: 1000000 + master list distance cutoff = 7.3 + ghost atom cutoff = 7.3 + binsize = 3.65, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair eam/fs, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.903 | 6.903 | 6.903 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 +Loop time of 6.88e-07 on 1 procs for 0 steps with 687 atoms + +290.7% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 6.88e-07 | | |100.00 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3239.00 ave 3239 max 3239 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 46843.0 ave 46843 max 46843 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 +print "energy=${pe}" +energy=-2828.24917967199 + +## compute property/atom to access relevant fields +compute pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz +run 0 +Per MPI rank memory allocation (min/avg/max) = 6.903 | 6.903 | 6.903 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 +Loop time of 9.41e-07 on 1 procs for 0 steps with 687 atoms + +106.3% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 9.41e-07 | | |100.00 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3239.00 ave 3239 max 3239 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 46843.0 ave 46843 max 46843 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 + +## fix name group-id pafi compute-id temperature tdamp seed overdamped 0/1 com 0/1 +fix hp all pafi pa 500.0 0.01 434 overdamped no com yes +fix pafi compute name,style: pa,property/atom + +run 0 +Per MPI rank memory allocation (min/avg/max) = 8.403 | 8.403 | 8.403 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 +Loop time of 5.53002e-07 on 1 procs for 0 steps with 687 atoms + +361.7% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 5.53e-07 | | |100.00 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3239.00 ave 3239 max 3239 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 46843.0 ave 46843 max 46843 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 +minimize 0 0 1000 1000 # best if using NEB path +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:186) + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 8.403 | 8.403 | 8.403 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 + 100 9.5973821e-06 -2828.3565 0 -2828.3565 3092.936 + 200 1.5010519e-13 -2828.3565 0 -2828.3565 3092.8883 + 300 5.4507205e-14 -2828.3565 0 -2828.3565 3092.8883 + 400 5.0283348e-14 -2828.3565 0 -2828.3565 3092.8883 + 500 4.9056964e-14 -2828.3565 0 -2828.3565 3092.8883 + 600 4.8645525e-14 -2828.3565 0 -2828.3565 3092.8883 + 700 4.8498912e-14 -2828.3565 0 -2828.3565 3092.8882 + 800 4.8444552e-14 -2828.3565 0 -2828.3565 3092.8882 + 900 4.8424643e-14 -2828.3565 0 -2828.3565 3092.8882 + 1000 4.84169e-14 -2828.3565 0 -2828.3565 3092.8882 +Loop time of 1.23105 on 1 procs for 1000 steps with 687 atoms + +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -2828.24917967199 -2828.35645843665 -2828.35645844395 + Force two-norm initial, final = 1.2831004431533395 7.468917431980592e-07 + Force max component initial, final = 0.3331705829071986 2.93217567864934e-07 + Final line search alpha, max atom move = 0.0 0.0 + Iterations, force evaluations = 1000 1007 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.1849 | 1.1849 | 1.1849 | 0.0 | 96.25 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.010743 | 0.010743 | 0.010743 | 0.0 | 0.87 +Output | 0.00013686 | 0.00013686 | 0.00013686 | 0.0 | 0.01 +Modify | 0.02476 | 0.02476 | 0.02476 | 0.0 | 2.01 +Other | | 0.01055 | | | 0.86 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3239.00 ave 3239 max 3239 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 46843.0 ave 46843 max 46843 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 +compute dx all displace/atom +compute dmag all reduce max c_dx[4] +variable maxjump equal sqrt(c_dmag) + +thermo_style custom step pe temp v_maxjump + + +variable dn equal f_hp[4]*f_hp[4] # should be zero to float precision + + +fix af all ave/time 1 1000 1000 f_hp[1] f_hp[2] f_hp[3] v_dn + +variable adn equal sqrt(f_af[4]) # should be very small (approx. 1e-6 A) +variable apf equal f_af[1] + + +run 1000 +Per MPI rank memory allocation (min/avg/max) = 8.778 | 8.778 | 8.778 Mbytes +Step PotEng Temp v_maxjump + 1000 -2828.3565 4.84169e-14 3.9400009e-08 + 1100 -2788.9297 505.16169 0.53846275 + 1200 -2784.1274 471.52773 0.5820714 + 1300 -2782.7071 503.23183 0.57990998 + 1400 -2780.7259 531.16141 0.61955057 + 1500 -2781.512 490.9404 0.58663715 + 1600 -2783.4961 513.37777 0.65062082 + 1700 -2780.0312 492.76259 0.5785296 + 1800 -2781.6555 512.32986 0.58277945 + 1900 -2782.1648 486.16736 0.58913114 + 2000 -2781.1942 493.15046 0.56962281 +Loop time of 1.3463 on 1 procs for 1000 steps with 687 atoms + +Performance: 64.176 ns/day, 0.374 hours/ns, 742.778 timesteps/s +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2429 | 1.2429 | 1.2429 | 0.0 | 92.32 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.011341 | 0.011341 | 0.011341 | 0.0 | 0.84 +Output | 0.0001418 | 0.0001418 | 0.0001418 | 0.0 | 0.01 +Modify | 0.089655 | 0.089655 | 0.089655 | 0.0 | 6.66 +Other | | 0.002248 | | | 0.17 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3239.00 ave 3239 max 3239 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 46844.0 ave 46844 max 46844 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 46844 +Ave neighs/atom = 68.186317 +Neighbor list builds = 0 +Dangerous builds = 0 +minimize 0 0 1000 1000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:186) + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 9.278 | 9.278 | 9.278 Mbytes +Step PotEng Temp v_maxjump + 2000 -2781.1942 0 0.56962281 + 2100 -2828.3564 2.3533517e-06 0.028829312 + 2200 -2828.3565 2.3166114e-09 0.0015098779 + 2300 -2828.3565 5.7159208e-14 0.0017926087 + 2400 -2828.3565 5.0928429e-14 0.0020264648 + 2500 -2828.3565 4.9253427e-14 0.0022344754 + 2600 -2828.3565 4.8706717e-14 0.0024243813 + 2700 -2828.3565 4.8513392e-14 0.0026003645 + 2800 -2828.3565 4.8442915e-14 0.0027651416 + 2900 -2828.3565 4.8417422e-14 0.0029206277 + 3000 -2828.3565 4.840734e-14 0.0030682417 +Loop time of 1.24896 on 1 procs for 1000 steps with 687 atoms + +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -2781.19422468903 -2828.35646618005 -2828.35646618733 + Force two-norm initial, final = 29.0662462838641 7.469228601686482e-07 + Force max component initial, final = 2.2910705425983147 2.932332034966123e-07 + Final line search alpha, max atom move = 0.0 0.0 + Iterations, force evaluations = 1000 1008 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.2027 | 1.2027 | 1.2027 | 0.0 | 96.30 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.010706 | 0.010706 | 0.010706 | 0.0 | 0.86 +Output | 0.00016364 | 0.00016364 | 0.00016364 | 0.0 | 0.01 +Modify | 0.024873 | 0.024873 | 0.024873 | 0.0 | 1.99 +Other | | 0.01053 | | | 0.84 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3209.00 ave 3209 max 3209 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 48576.0 ave 48576 max 48576 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 48576 +Ave neighs/atom = 70.707424 +Neighbor list builds = 0 +Dangerous builds = 0 + +variable s_pe equal ${pe} +variable s_pe equal -2828.35646618733 +variable s_apf equal ${apf} +variable s_apf equal -0.117797263023891 +variable s_adn equal ${adn} +variable s_adn equal 1.36645874805011e-05 +variable s_maxjump equal ${maxjump} +variable s_maxjump equal 0.00306824174470598 + +unfix hp +unfix pa +unfix af +minimize 0 0 1000 1000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:186) + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 8.778 | 8.778 | 8.778 Mbytes +Step PotEng Temp v_maxjump + 3000 -2828.3565 0 0.0030682417 + 3100 -2828.5793 0.00016081731 0.54349309 + 3200 -2828.5793 1.1620454e-14 0.54386121 + 3300 -2828.5793 4.4699993e-19 0.54386124 + 3400 -2828.5793 1.0681196e-23 0.54386124 + 3500 -2828.5793 2.046642e-25 0.54386124 + 3600 -2828.5793 1.4539039e-25 0.54386124 + 3700 -2828.5793 2.0152508e-25 0.54386124 + 3800 -2828.5793 1.3593174e-25 0.54386124 + 3900 -2828.5793 1.8155665e-25 0.54386124 + 4000 -2828.5793 1.2308872e-25 0.54386124 +Loop time of 1.20543 on 1 procs for 1000 steps with 687 atoms + +100.0% CPU use with 1 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -2828.35646618733 -2828.57925588226 -2828.57925588226 + Force two-norm initial, final = 0.5639141583763609 2.3523921777846766e-13 + Force max component initial, final = 0.22089321768110187 2.037953139577553e-14 + Final line search alpha, max atom move = 0.0 0.0 + Iterations, force evaluations = 1000 1017 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 1.1843 | 1.1843 | 1.1843 | 0.0 | 98.25 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.010469 | 0.010469 | 0.010469 | 0.0 | 0.87 +Output | 0.00012213 | 0.00012213 | 0.00012213 | 0.0 | 0.01 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.01051 | | | 0.87 + +Nlocal: 687.000 ave 687 max 687 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Nghost: 3239.00 ave 3239 max 3239 min +Histogram: 1 0 0 0 0 0 0 0 0 0 +Neighs: 46844.0 ave 46844 max 46844 min +Histogram: 1 0 0 0 0 0 0 0 0 0 + +Total # of neighbors = 46844 +Ave neighs/atom = 68.186317 +Neighbor list builds = 0 +Dangerous builds = 0 + + +print """ +---------- PAFI RESULTS -------- +During run: + Average Distance From Hyperplane = ${s_adn}A (Should be very small, around 1e-5A), + Average Force Projection Along MFEP = ${s_apf} eV/A +""" + +---------- PAFI RESULTS -------- +During run: + Average Distance From Hyperplane = 1.36645874805011e-05A (Should be very small, around 1e-5A), + Average Force Projection Along MFEP = -0.117797263023891 eV/A + +print """ +In-plane minimization post-run: +energy = ${s_pe} eV +""" + +In-plane minimization post-run: +energy = -2828.35646618733 eV + +if "${s_maxjump} > 0.1" then "print 'Max Atomic Displacement = ${s_maxjump}A > 0.1A'" "print ' => Possible shallow in-plane metastability: Reduce time in basin and/or decrease tdamp'" else "print 'Max Atomic Displacement = ${s_maxjump}A < 0.1A => No in-plane jumps'" +print 'Max Atomic Displacement = ${s_maxjump}A < 0.1A => No in-plane jumps' +Max Atomic Displacement = 0.00306824174470598A < 0.1A => No in-plane jumps +print """ +Full minimization after removal of PAFI fixes: +energy = ${pe} eV +----- END PAFI ---- +""" + +Full minimization after removal of PAFI fixes: +energy = -2828.57925588226 eV +----- END PAFI ---- + + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:00:05 diff --git a/examples/USER/misc/pafi/log.15Apr20.pafi.g++.4 b/examples/USER/misc/pafi/log.15Apr20.pafi.g++.4 new file mode 100644 index 0000000000..8cda2f91c3 --- /dev/null +++ b/examples/USER/misc/pafi/log.15Apr20.pafi.g++.4 @@ -0,0 +1,401 @@ +LAMMPS (24 Aug 2020) +units metal +atom_style atomic +atom_modify map array sort 0 0.0 +neigh_modify every 2 delay 10 check yes page 1000000 one 100000 + +## read in path data using fix property/atom- here 4th image of a NEB +fix pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz +read_data pafipath.4.data fix pa NULL PafiPath +Reading data file ... + orthogonal box = (0.0000000 0.0000000 0.0000000) to (19.987184 19.987184 19.987184) + 2 by 1 by 2 MPI processor grid + reading atoms ... + 687 atoms + read_data CPU = 0.007 seconds + +## EAM potential +pair_style eam/fs +pair_coeff * * ../../../../potentials/Fe_mm.eam.fs Fe +Reading eam/fs potential file ../../../../potentials/Fe_mm.eam.fs with DATE: 2007-06-11 + +mass * 55.85 +thermo 100 +min_style fire + + +compute pe all pe +variable pe equal pe +run 0 +Neighbor list info ... + update every 2 steps, delay 10 steps, check yes + max neighbors/atom: 100000, page size: 1000000 + master list distance cutoff = 7.3 + ghost atom cutoff = 7.3 + binsize = 3.65, bins = 6 6 6 + 1 neighbor lists, perpetual/occasional/extra = 1 0 0 + (1) pair eam/fs, perpetual + attributes: half, newton on + pair build: half/bin/atomonly/newton + stencil: half/bin/3d/newton + bin: standard +Per MPI rank memory allocation (min/avg/max) = 6.844 | 6.844 | 6.844 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 +Loop time of 2.82e-06 on 4 procs for 0 steps with 687 atoms + +97.5% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 2.82e-06 | | |100.00 + +Nlocal: 171.750 ave 187 max 163 min +Histogram: 1 1 1 0 0 0 0 0 0 1 +Nghost: 1854.25 ave 1863 max 1839 min +Histogram: 1 0 0 0 0 0 0 1 1 1 +Neighs: 11710.8 ave 12319 max 10647 min +Histogram: 1 0 0 0 0 0 0 1 1 1 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 +print "energy=${pe}" +energy=-2828.24917967201 + +## compute property/atom to access relevant fields +compute pa all property/atom d_nx d_ny d_nz d_dnx d_dny d_dnz d_ddnx d_ddny d_ddnz +run 0 +Per MPI rank memory allocation (min/avg/max) = 6.844 | 6.844 | 6.844 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 +Loop time of 2.667e-06 on 4 procs for 0 steps with 687 atoms + +37.5% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 2.667e-06 | | |100.00 + +Nlocal: 171.750 ave 187 max 163 min +Histogram: 1 1 1 0 0 0 0 0 0 1 +Nghost: 1854.25 ave 1863 max 1839 min +Histogram: 1 0 0 0 0 0 0 1 1 1 +Neighs: 11710.8 ave 12319 max 10647 min +Histogram: 1 0 0 0 0 0 0 1 1 1 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 + +## fix name group-id pafi compute-id temperature tdamp seed overdamped 0/1 com 0/1 +fix hp all pafi pa 500.0 0.01 434 overdamped no com yes +fix pafi compute name,style: pa,property/atom + +run 0 +Per MPI rank memory allocation (min/avg/max) = 8.344 | 8.344 | 8.344 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 +Loop time of 2.52725e-06 on 4 procs for 0 steps with 687 atoms + +108.8% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0 | 0 | 0 | 0.0 | 0.00 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0 | 0 | 0 | 0.0 | 0.00 +Output | 0 | 0 | 0 | 0.0 | 0.00 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 2.527e-06 | | |100.00 + +Nlocal: 171.750 ave 187 max 163 min +Histogram: 1 1 1 0 0 0 0 0 0 1 +Nghost: 1854.25 ave 1863 max 1839 min +Histogram: 1 0 0 0 0 0 0 1 1 1 +Neighs: 11710.8 ave 12319 max 10647 min +Histogram: 1 0 0 0 0 0 0 1 1 1 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 +minimize 0 0 1000 1000 # best if using NEB path +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:186) + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 8.344 | 8.344 | 8.344 Mbytes +Step Temp E_pair E_mol TotEng Press + 0 0 -2828.2492 0 -2828.2492 3015.2014 + 100 9.5973821e-06 -2828.3565 0 -2828.3565 3092.936 + 200 1.501052e-13 -2828.3565 0 -2828.3565 3092.8883 + 300 5.4507205e-14 -2828.3565 0 -2828.3565 3092.8883 + 400 5.0283344e-14 -2828.3565 0 -2828.3565 3092.8883 + 500 4.9056968e-14 -2828.3565 0 -2828.3565 3092.8883 + 600 4.8645528e-14 -2828.3565 0 -2828.3565 3092.8883 + 700 4.8498892e-14 -2828.3565 0 -2828.3565 3092.8882 + 800 4.8444568e-14 -2828.3565 0 -2828.3565 3092.8882 + 900 4.8424653e-14 -2828.3565 0 -2828.3565 3092.8882 + 1000 4.8416878e-14 -2828.3565 0 -2828.3565 3092.8882 +Loop time of 0.43333 on 4 procs for 1000 steps with 687 atoms + +95.4% CPU use with 4 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -2828.24917967201 -2828.35645843663 -2828.3564584439 + Force two-norm initial, final = 1.2831004431533406 7.468917439994878e-07 + Force max component initial, final = 0.33317058290719853 2.9321733663323357e-07 + Final line search alpha, max atom move = 0.0 0.0 + Iterations, force evaluations = 1000 1007 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.3303 | 0.34246 | 0.35813 | 1.7 | 79.03 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.046971 | 0.062117 | 0.073961 | 3.9 | 14.33 +Output | 0.00013746 | 0.00014874 | 0.00016997 | 0.0 | 0.03 +Modify | 0.0099064 | 0.01077 | 0.011612 | 0.6 | 2.49 +Other | | 0.01784 | | | 4.12 + +Nlocal: 171.750 ave 187 max 163 min +Histogram: 1 1 1 0 0 0 0 0 0 1 +Nghost: 1854.25 ave 1863 max 1839 min +Histogram: 1 0 0 0 0 0 0 1 1 1 +Neighs: 11710.8 ave 12319 max 10647 min +Histogram: 1 0 0 0 0 0 0 1 1 1 + +Total # of neighbors = 46843 +Ave neighs/atom = 68.184862 +Neighbor list builds = 0 +Dangerous builds = 0 +compute dx all displace/atom +compute dmag all reduce max c_dx[4] +variable maxjump equal sqrt(c_dmag) + +thermo_style custom step pe temp v_maxjump + + +variable dn equal f_hp[4]*f_hp[4] # should be zero to float precision + + +fix af all ave/time 1 1000 1000 f_hp[1] f_hp[2] f_hp[3] v_dn + +variable adn equal sqrt(f_af[4]) # should be very small (approx. 1e-6 A) +variable apf equal f_af[1] + + +run 1000 +Per MPI rank memory allocation (min/avg/max) = 8.719 | 8.719 | 8.719 Mbytes +Step PotEng Temp v_maxjump + 1000 -2828.3565 4.8416878e-14 3.9625012e-08 + 1100 -2787.3877 503.1749 0.53858794 + 1200 -2783.8463 508.91879 0.57609619 + 1300 -2782.5288 533.03961 0.64090828 + 1400 -2782.4551 508.05688 0.61706248 + 1500 -2784.0499 538.34202 0.56379358 + 1600 -2786.4068 487.9633 0.57600511 + 1700 -2780.7727 489.2309 0.61048418 + 1800 -2780.4909 519.01911 0.60204913 + 1900 -2782.0825 512.3441 0.6071772 + 2000 -2779.5449 526.21838 0.58247597 +Loop time of 0.446418 on 4 procs for 1000 steps with 687 atoms + +Performance: 193.541 ns/day, 0.124 hours/ns, 2240.053 timesteps/s +95.8% CPU use with 4 MPI tasks x no OpenMP threads + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.34383 | 0.35018 | 0.35655 | 0.9 | 78.44 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.049244 | 0.055398 | 0.061404 | 2.2 | 12.41 +Output | 0.00015376 | 0.00016326 | 0.00018954 | 0.0 | 0.04 +Modify | 0.034111 | 0.034443 | 0.03473 | 0.1 | 7.72 +Other | | 0.006229 | | | 1.40 + +Nlocal: 171.750 ave 183 max 165 min +Histogram: 1 1 0 1 0 0 0 0 0 1 +Nghost: 1854.25 ave 1861 max 1843 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Neighs: 11711.0 ave 12115 max 10983 min +Histogram: 1 0 0 0 0 0 1 0 1 1 + +Total # of neighbors = 46844 +Ave neighs/atom = 68.186317 +Neighbor list builds = 0 +Dangerous builds = 0 +minimize 0 0 1000 1000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:186) + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 9.219 | 9.219 | 9.219 Mbytes +Step PotEng Temp v_maxjump + 2000 -2779.5449 0 0.58247597 + 2100 -2828.3564 5.5901288e-06 0.022258122 + 2200 -2828.3565 2.5724945e-11 0.0014462408 + 2300 -2828.3565 5.8980018e-14 0.0018217607 + 2400 -2828.3565 5.1597335e-14 0.0020531463 + 2500 -2828.3565 4.9451623e-14 0.0022588465 + 2600 -2828.3565 4.8775183e-14 0.0024468988 + 2700 -2828.3565 4.8538707e-14 0.0026213819 + 2800 -2828.3565 4.8450209e-14 0.0027849194 + 2900 -2828.3565 4.8421002e-14 0.0029393609 + 3000 -2828.3565 4.8409037e-14 0.0030860795 +Loop time of 0.432206 on 4 procs for 1000 steps with 687 atoms + +91.9% CPU use with 4 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -2779.54493572831 -2828.35646627033 -2828.3564662776 + Force two-norm initial, final = 29.30132707276523 7.469232246845132e-07 + Force max component initial, final = 2.0790292865239595 2.9323707292916446e-07 + Final line search alpha, max atom move = 0.0 0.0 + Iterations, force evaluations = 1000 1008 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.33828 | 0.34752 | 0.35566 | 1.1 | 80.41 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.04768 | 0.056242 | 0.065447 | 2.8 | 13.01 +Output | 0.00016892 | 0.00018009 | 0.00020427 | 0.0 | 0.04 +Modify | 0.010016 | 0.010698 | 0.011316 | 0.4 | 2.48 +Other | | 0.01756 | | | 4.06 + +Nlocal: 171.750 ave 184 max 165 min +Histogram: 1 0 2 0 0 0 0 0 0 1 +Nghost: 1828.25 ave 1835 max 1815 min +Histogram: 1 0 0 0 0 0 0 1 0 2 +Neighs: 12157.5 ave 12578 max 11155 min +Histogram: 1 0 0 0 0 0 0 0 0 3 + +Total # of neighbors = 48630 +Ave neighs/atom = 70.786026 +Neighbor list builds = 0 +Dangerous builds = 0 + +variable s_pe equal ${pe} +variable s_pe equal -2828.3564662776 +variable s_apf equal ${apf} +variable s_apf equal -0.44222069537824 +variable s_adn equal ${adn} +variable s_adn equal 1.36645875188617e-05 +variable s_maxjump equal ${maxjump} +variable s_maxjump equal 0.00308607949485962 + +unfix hp +unfix pa +unfix af +minimize 0 0 1000 1000 +WARNING: Using 'neigh_modify every 1 delay 0 check yes' setting during minimization (../min.cpp:186) + Parameters for fire: + dmax delaystep dtgrow dtshrink alpha0 alphashrink tmax tmin integrator halfstepback + 0.1 20 1.1 0.5 0.25 0.99 10 0.02 eulerimplicit yes +Per MPI rank memory allocation (min/avg/max) = 8.719 | 8.719 | 8.719 Mbytes +Step PotEng Temp v_maxjump + 3000 -2828.3565 0 0.0030860795 + 3100 -2828.5793 0.00016081696 0.5434931 + 3200 -2828.5793 1.1620338e-14 0.54386121 + 3300 -2828.5793 4.4708247e-19 0.54386124 + 3400 -2828.5793 1.0642423e-23 0.54386124 + 3500 -2828.5793 1.9858026e-25 0.54386124 + 3600 -2828.5793 1.395464e-25 0.54386124 + 3700 -2828.5793 2.0687121e-25 0.54386124 + 3800 -2828.5793 1.3586688e-25 0.54386124 + 3900 -2828.5793 2.0485828e-25 0.54386124 + 4000 -2828.5793 1.3803592e-25 0.54386124 +Loop time of 0.427843 on 4 procs for 1000 steps with 687 atoms + +96.5% CPU use with 4 MPI tasks x no OpenMP threads + +Minimization stats: + Stopping criterion = max iterations + Energy initial, next-to-last, final = + -2828.3564662776 -2828.57925588218 -2828.57925588218 + Force two-norm initial, final = 0.5639144322930092 2.34573110665124e-13 + Force max component initial, final = 0.22089332498188619 2.0969337377607644e-14 + Final line search alpha, max atom move = 0.0 0.0 + Iterations, force evaluations = 1000 1017 + +MPI task timing breakdown: +Section | min time | avg time | max time |%varavg| %total +--------------------------------------------------------------- +Pair | 0.34748 | 0.35476 | 0.3611 | 0.9 | 82.92 +Neigh | 0 | 0 | 0 | 0.0 | 0.00 +Comm | 0.049149 | 0.054906 | 0.062132 | 2.2 | 12.83 +Output | 0.00015435 | 0.00016534 | 0.00018687 | 0.0 | 0.04 +Modify | 0 | 0 | 0 | 0.0 | 0.00 +Other | | 0.01801 | | | 4.21 + +Nlocal: 171.750 ave 183 max 165 min +Histogram: 1 1 0 1 0 0 0 0 0 1 +Nghost: 1854.25 ave 1861 max 1843 min +Histogram: 1 0 0 0 0 0 1 0 1 1 +Neighs: 11711.0 ave 12115 max 10983 min +Histogram: 1 0 0 0 0 0 1 0 1 1 + +Total # of neighbors = 46844 +Ave neighs/atom = 68.186317 +Neighbor list builds = 0 +Dangerous builds = 0 + + +print """ +---------- PAFI RESULTS -------- +During run: + Average Distance From Hyperplane = ${s_adn}A (Should be very small, around 1e-5A), + Average Force Projection Along MFEP = ${s_apf} eV/A +""" + +---------- PAFI RESULTS -------- +During run: + Average Distance From Hyperplane = 1.36645875188617e-05A (Should be very small, around 1e-5A), + Average Force Projection Along MFEP = -0.44222069537824 eV/A + +print """ +In-plane minimization post-run: +energy = ${s_pe} eV +""" + +In-plane minimization post-run: +energy = -2828.3564662776 eV + +if "${s_maxjump} > 0.1" then "print 'Max Atomic Displacement = ${s_maxjump}A > 0.1A'" "print ' => Possible shallow in-plane metastability: Reduce time in basin and/or decrease tdamp'" else "print 'Max Atomic Displacement = ${s_maxjump}A < 0.1A => No in-plane jumps'" +print 'Max Atomic Displacement = ${s_maxjump}A < 0.1A => No in-plane jumps' +Max Atomic Displacement = 0.00308607949485962A < 0.1A => No in-plane jumps +print """ +Full minimization after removal of PAFI fixes: +energy = ${pe} eV +----- END PAFI ---- +""" + +Full minimization after removal of PAFI fixes: +energy = -2828.57925588218 eV +----- END PAFI ---- + + +Please see the log.cite file for references relevant to this simulation + +Total wall time: 0:00:01 diff --git a/examples/USER/misc/pafi/pafipath.4.data b/examples/USER/misc/pafi/pafipath.4.data new file mode 100644 index 0000000000..58f2c5a660 --- /dev/null +++ b/examples/USER/misc/pafi/pafipath.4.data @@ -0,0 +1,1391 @@ +LAMMPS dump file + +687 atoms +1 atom types + +0. 19.987184 xlo xhi +0. 19.987184 ylo yhi +0. 19.987184 zlo zhi + +Masses + + 1 55.85 + Atoms + +1 1 0.00448604 0.00299371 1.25552e-05 +2 1 1.42757 1.42374 1.42237 +3 1 2.85768 -0.000111595 -0.00117603 +4 1 4.28206 1.42351 1.42428 +5 1 5.71045 0.000184061 0.000357624 +6 1 7.1368 1.42501 1.42562 +7 1 8.56373 0.00179453 0.00172992 +8 1 9.99168 1.42642 1.42598 +9 1 11.4187 0.00327202 0.00227737 +10 1 12.8474 1.42747 1.42572 +11 1 14.2756 0.0045707 0.00236301 +12 1 15.705 1.42755 1.42471 +13 1 17.1345 0.00506352 0.00188451 +14 1 18.5638 1.42578 1.4228 +15 1 0.000182033 2.85273 19.9829 +16 1 1.42429 4.27664 1.42129 +17 1 2.85404 2.85113 19.984 +18 1 4.27845 4.27627 1.42291 +19 1 5.70979 2.85265 19.9858 +20 1 7.13648 4.2798 1.42573 +21 1 8.56475 2.85452 19.9865 +22 1 9.99207 4.28151 1.426 +23 1 11.4195 2.85554 19.9864 +24 1 12.8476 4.28148 1.42552 +25 1 14.2753 2.8555 19.9858 +26 1 15.7066 4.27861 1.4226 +27 1 17.133 2.85398 19.9842 +28 1 18.5621 4.27835 1.42129 +29 1 -0.000538145 5.70632 19.9841 +30 1 1.42454 7.13442 1.42295 +31 1 2.85195 5.70592 19.9856 +32 1 4.27826 7.13446 1.42492 +33 1 5.7078 5.70701 19.9874 +34 1 7.13443 7.13513 1.42756 +35 1 8.56461 5.70993 19.9881 +36 1 9.99203 7.13802 1.42927 +37 1 11.4196 5.71081 19.9877 +38 1 12.8496 7.13615 1.42706 +39 1 14.2762 5.70905 19.9864 +40 1 15.7063 7.13567 1.42404 +41 1 17.1323 5.70823 19.9845 +42 1 18.5624 7.13482 1.4227 +43 1 0.000696865 8.56319 19.9865 +44 1 1.426 9.99355 1.42486 +45 1 2.85222 8.5637 19.9875 +46 1 4.27978 9.99352 1.4268 +47 1 5.70775 8.56419 19.989 +48 1 7.13672 9.99198 1.43004 +49 1 8.56417 8.56538 19.9886 +50 1 9.99289 9.99123 1.43118 +51 1 11.4205 8.56619 19.9884 +52 1 12.849 9.99338 1.42926 +53 1 14.2761 8.56576 19.9882 +54 1 15.7069 9.99395 1.42585 +55 1 17.1337 8.56386 19.9875 +56 1 18.5635 9.99327 1.42454 +57 1 0.00227377 11.4219 0.00147796 +58 1 1.42804 12.8521 1.42671 +59 1 2.85342 11.4223 0.00180127 +60 1 4.28227 12.8506 1.42863 +61 1 5.70881 11.4211 0.0031342 +62 1 7.13884 12.8475 1.43098 +63 1 8.56508 11.4205 0.00269639 +64 1 9.9936 12.8465 1.43168 +65 1 11.4213 11.4218 0.00260934 +66 1 12.849 12.8502 1.43019 +67 1 14.2779 11.4226 0.00247567 +68 1 15.7072 12.8522 1.42747 +69 1 17.1356 11.4219 0.0026081 +70 1 18.5645 12.8524 1.4262 +71 1 0.003965 14.281 0.00320774 +72 1 1.43042 15.7085 1.42837 +73 1 2.85515 14.2801 0.00315607 +74 1 4.28467 15.7055 1.4304 +75 1 5.71011 14.278 0.00441222 +76 1 7.13933 15.7032 1.43146 +77 1 8.56579 14.276 0.00441963 +78 1 9.99251 15.7041 1.43141 +79 1 11.4205 14.2783 0.00416102 +80 1 12.8478 15.7065 1.43075 +81 1 14.2794 14.2819 0.00500693 +82 1 15.707 15.7097 1.42924 +83 1 17.1371 14.2816 0.00478647 +84 1 18.565 15.7101 1.42787 +85 1 0.00533603 17.1383 0.0037217 +86 1 1.43181 18.5614 1.42781 +87 1 2.85722 17.1354 0.003011 +88 1 4.28514 18.5591 1.42893 +89 1 5.71156 17.1331 0.00356601 +90 1 7.13782 18.5594 1.43003 +91 1 8.56433 17.1339 0.00497866 +92 1 9.99142 18.5608 1.43029 +93 1 11.419 17.1359 0.00556187 +94 1 12.8471 18.5624 1.42976 +95 1 14.2772 17.1383 0.00595758 +96 1 15.7052 18.5641 1.42883 +97 1 17.1374 17.1402 0.00598099 +98 1 18.5641 18.564 1.42768 +99 1 0.00409482 19.9874 2.8511 +100 1 1.42553 1.42159 4.27937 +101 1 2.85637 19.9845 2.85345 +102 1 4.27927 1.42089 4.2793 +103 1 5.7104 19.9852 2.85508 +104 1 7.13674 1.42404 4.28191 +105 1 8.56417 19.9868 2.85544 +106 1 9.9921 1.42561 4.28228 +107 1 11.4191 19.9882 2.85485 +108 1 12.848 1.42652 4.28113 +109 1 14.2758 19.9893 2.8534 +110 1 15.7078 1.4249 4.27787 +111 1 17.1354 19.9892 2.85118 +112 1 18.5642 1.4239 4.27842 +113 1 0.000556869 2.85006 2.84979 +114 1 1.422 4.27452 4.2767 +115 1 2.84624 2.84313 2.84486 +116 1 4.25891 4.25785 4.26023 +117 1 5.70698 2.84634 2.84826 +118 1 7.13448 4.26762 4.26953 +119 1 8.56424 2.8485 2.84953 +120 1 9.99236 4.26985 4.2707 +121 1 11.4202 2.84976 2.84967 +122 1 12.8489 4.27123 4.2713 +123 1 14.2776 2.84977 2.84875 +124 1 15.724 4.2622 4.26211 +125 1 17.1403 2.84643 2.8452 +126 1 18.5635 4.27636 4.277 +127 1 0.000168547 5.70509 2.84936 +128 1 1.42307 7.13372 4.27749 +129 1 2.84455 5.70222 2.84457 +130 1 4.26008 7.1291 4.2629 +131 1 5.70156 5.70098 2.84905 +132 1 7.12123 7.12358 4.27232 +133 1 8.56382 5.70744 2.85401 +134 1 9.99114 7.13622 4.28612 +135 1 11.4197 5.70843 2.854 +136 1 12.8614 7.12515 4.2724 +137 1 14.2822 5.70267 2.84851 +138 1 15.723 7.12977 4.26312 +139 1 17.1403 5.70379 2.84469 +140 1 18.5648 7.1328 4.27583 +141 1 0.00127881 8.56337 2.85048 +142 1 1.42492 9.99366 4.27913 +143 1 2.84679 8.56494 2.84743 +144 1 4.26715 9.99868 4.26941 +145 1 5.70372 8.56357 2.8521 +146 1 7.13212 9.99082 4.28405 +147 1 8.56086 8.56115 2.85841 +148 1 9.99282 9.9837 4.28446 +149 1 11.4236 8.56168 2.85777 +150 1 12.8548 9.99207 4.28039 +151 1 14.2813 8.56402 2.85062 +152 1 15.7206 9.99759 4.26601 +153 1 17.1401 8.56434 2.84615 +154 1 18.5661 9.99212 4.27588 +155 1 0.00263103 11.4225 2.85174 +156 1 1.42712 12.8513 4.28122 +157 1 2.84991 11.425 2.85026 +158 1 4.27477 12.8561 4.27641 +159 1 5.70849 11.4219 2.85479 +160 1 7.13934 12.8475 4.28593 +161 1 8.56568 11.4173 2.86077 +162 1 9.99452 12.8438 4.28907 +163 1 11.4216 11.4186 2.86023 +164 1 12.8518 12.8526 4.281 +165 1 14.2798 11.4234 2.85279 +166 1 15.717 12.8583 4.27082 +167 1 17.1402 11.4249 2.84777 +168 1 18.567 12.8516 4.27683 +169 1 0.00416979 14.2803 2.85317 +170 1 1.43022 15.706 4.28307 +171 1 2.85403 14.2807 2.85369 +172 1 4.28508 15.7028 4.28565 +173 1 5.71207 14.2761 2.85758 +174 1 7.14016 15.7002 4.28729 +175 1 8.56721 14.2735 2.85944 +176 1 9.9925 15.7021 4.28568 +177 1 11.4199 14.2758 2.85856 +178 1 12.8481 15.7054 4.28299 +179 1 14.2787 14.2808 2.8543 +180 1 15.7102 15.7106 4.27758 +181 1 17.1392 14.283 2.85015 +182 1 18.5674 15.7094 4.27757 +183 1 0.00530324 17.1355 2.85385 +184 1 1.4302 18.5604 4.28139 +185 1 2.85834 17.1324 2.85671 +186 1 4.28438 18.558 4.28368 +187 1 5.71249 17.1302 2.85828 +188 1 7.13774 18.5592 4.28398 +189 1 8.56519 17.1308 2.85818 +190 1 9.99094 18.5614 4.28261 +191 1 11.4193 17.1328 2.85709 +192 1 12.8471 18.5634 4.28037 +193 1 14.2764 17.1353 2.85507 +194 1 15.7078 18.5659 4.27676 +195 1 17.1365 17.1373 2.85278 +196 1 18.567 18.5656 4.27646 +197 1 0.00243376 19.9863 5.70907 +198 1 1.42501 1.42238 7.13866 +199 1 2.85516 19.9839 5.71062 +200 1 4.27966 1.42202 7.13836 +201 1 5.70991 19.9844 5.71128 +202 1 7.13519 1.42474 7.13764 +203 1 8.56506 19.9865 5.71219 +204 1 9.99273 1.42779 7.13909 +205 1 11.4199 19.9879 5.71089 +206 1 12.8504 1.42703 7.13644 +207 1 14.2779 19.9886 5.70773 +208 1 15.7075 1.42546 7.13629 +209 1 17.1363 19.9887 5.70688 +210 1 18.5624 1.42428 7.13821 +211 1 -0.000551931 2.84997 5.70876 +212 1 1.42191 4.27626 7.13705 +213 1 2.8445 2.8424 5.70534 +214 1 4.25887 4.2595 7.13052 +215 1 5.70109 2.84577 5.70271 +216 1 7.11883 4.26758 7.12298 +217 1 8.56402 2.85194 5.70851 +218 1 9.99136 4.28423 7.13521 +219 1 11.4203 2.85333 5.70875 +220 1 12.8617 4.27314 7.12503 +221 1 14.2828 2.84917 5.70308 +222 1 15.7228 4.26472 7.13063 +223 1 17.1408 2.84589 5.70505 +224 1 18.5613 4.2784 7.13748 +225 1 -0.00104851 5.70514 5.70725 +226 1 1.42303 7.13324 7.13526 +227 1 2.8434 5.6983 5.7006 +228 1 4.25921 7.11924 7.12135 +229 1 5.65843 5.66088 5.66279 +230 1 7.02006 7.02903 7.03201 +231 1 8.57021 5.69111 5.69246 +232 1 9.98839 7.16674 7.16381 +233 1 11.4119 5.69495 5.69493 +234 1 12.9515 7.04195 7.03968 +235 1 14.3206 5.66722 5.66665 +236 1 15.7187 7.12691 7.12492 +237 1 17.1395 5.70196 5.70217 +238 1 18.561 7.13418 7.13552 +239 1 0.000217072 8.56346 5.70766 +240 1 1.42565 9.99273 7.13711 +241 1 2.84613 8.56345 5.70407 +242 1 4.27553 9.99386 7.12984 +243 1 5.6675 8.56382 5.67559 +244 1 7.09459 10.0252 7.09178 +245 1 8.5354 8.54154 5.70435 +246 1 9.99561 9.96856 7.06132 +247 1 11.4469 8.54336 5.70169 +248 1 12.8974 10.0223 7.08287 +249 1 14.3157 8.56335 5.67387 +250 1 15.7212 9.98736 7.11722 +251 1 17.1433 8.56006 5.69924 +252 1 18.5616 9.99246 7.13525 +253 1 0.0014156 11.4215 5.70849 +254 1 1.42693 12.8486 7.13934 +255 1 2.84964 11.4234 5.70789 +256 1 4.28037 12.847 7.14064 +257 1 5.68761 11.4352 5.69133 +258 1 7.14648 12.8334 7.15265 +259 1 8.56323 11.419 5.71594 +260 1 9.99608 12.8219 7.1582 +261 1 11.4282 11.4217 5.713 +262 1 12.8593 12.8497 7.12552 +263 1 14.3034 11.4362 5.68706 +264 1 15.7271 12.8522 7.11767 +265 1 17.145 11.4214 5.69882 +266 1 18.5632 12.8507 7.13557 +267 1 0.00306628 14.2786 5.70933 +268 1 1.4277 15.706 7.13795 +269 1 2.85459 14.2767 5.71193 +270 1 4.27814 15.7088 7.13409 +271 1 5.71344 14.2709 5.71597 +272 1 7.13953 15.7026 7.13829 +273 1 8.5693 14.2682 5.71799 +274 1 9.98891 15.709 7.13327 +275 1 11.419 14.2729 5.71687 +276 1 12.854 15.7234 7.11684 +277 1 14.2854 14.283 5.70535 +278 1 15.7343 15.7337 7.10897 +279 1 17.1453 14.2829 5.69922 +280 1 18.5656 15.7106 7.13384 +281 1 0.00406177 17.1354 5.70824 +282 1 1.42837 18.5598 7.1384 +283 1 2.85511 17.1337 5.70952 +284 1 4.28405 18.5579 7.13978 +285 1 5.71203 17.1306 5.71193 +286 1 7.1392 18.5577 7.14081 +287 1 8.56409 17.1329 5.71022 +288 1 9.99307 18.5592 7.14017 +289 1 11.4175 17.1372 5.70597 +290 1 12.8498 18.5617 7.13592 +291 1 14.2816 17.1433 5.69913 +292 1 15.7101 18.5652 7.13291 +293 1 17.1464 17.1464 5.69676 +294 1 18.5648 18.5638 7.13648 +295 1 0.00151496 19.9867 8.56686 +296 1 1.42508 1.42384 9.99627 +297 1 2.85497 19.9847 8.56753 +298 1 4.28088 1.42361 9.99603 +299 1 5.71114 19.9847 8.56813 +300 1 7.13827 1.42706 9.9941 +301 1 8.56629 19.9859 8.56778 +302 1 9.99375 1.4292 9.99167 +303 1 11.422 19.9867 8.5663 +304 1 12.8487 1.4287 9.99278 +305 1 14.2781 19.9879 8.5646 +306 1 15.7049 1.42646 9.995 +307 1 17.1341 19.9881 8.5661 +308 1 18.561 1.42562 9.9959 +309 1 -0.00154693 2.85178 8.56743 +310 1 1.42217 4.2785 9.99597 +311 1 2.84605 2.84521 8.56794 +312 1 4.26501 4.26584 10.0006 +313 1 5.70359 2.84893 8.56603 +314 1 7.13045 4.28031 9.99272 +315 1 8.56053 2.85598 8.56163 +316 1 9.99012 4.28274 9.9819 +317 1 11.4234 2.85756 8.56164 +318 1 12.8518 4.28351 9.99085 +319 1 14.2806 2.85211 8.56471 +320 1 15.7148 4.27206 10 +321 1 17.1373 2.84887 8.56767 +322 1 18.5592 4.28096 9.99591 +323 1 -0.00250389 5.70808 8.56673 +324 1 1.42384 7.13643 9.99442 +325 1 2.84473 5.70181 8.56541 +326 1 4.27238 7.12626 9.99578 +327 1 5.66379 5.67013 8.56343 +328 1 7.0835 7.07985 10.0252 +329 1 8.52987 5.69661 8.53691 +330 1 9.98155 7.05425 9.94841 +331 1 11.4459 5.7031 8.54093 +332 1 12.8977 7.0888 10.0145 +333 1 14.3154 5.67732 8.56157 +334 1 15.7037 7.13645 9.99678 +335 1 17.1352 5.70697 8.56632 +336 1 18.557 7.13856 9.99474 +337 1 -0.00212376 8.56479 8.5656 +338 1 1.4258 9.99322 9.99389 +339 1 2.84757 8.56127 8.56306 +340 1 4.28735 9.98746 9.99151 +341 1 5.65677 8.54528 8.54855 +342 1 7.16728 9.96312 9.97425 +343 1 8.21067 8.38648 8.39718 +344 1 9.96626 9.32695 9.30023 +345 1 11.7487 8.40368 8.40163 +346 1 12.7895 10.001 9.98895 +347 1 14.3143 8.56199 8.55455 +348 1 15.6978 9.99473 9.98831 +349 1 17.1348 8.56359 8.56309 +350 1 18.5556 9.99576 9.99342 +351 1 -0.00132574 11.4213 8.56631 +352 1 1.42629 12.8493 9.99431 +353 1 2.85404 11.4186 8.56775 +354 1 4.28053 12.8528 9.99302 +355 1 5.70507 11.4136 8.57147 +356 1 7.10701 12.8905 9.96761 +357 1 8.60294 11.3881 8.64515 +358 1 10.0138 12.9425 10.015 +359 1 11.4245 11.404 8.61006 +360 1 12.9666 12.9702 9.8333 +361 1 14.3105 11.4083 8.54241 +362 1 15.7128 12.8678 9.98055 +363 1 17.1335 11.4221 8.56269 +364 1 18.5577 12.8528 9.99246 +365 1 0.000285193 14.2785 8.56552 +366 1 1.42622 15.7054 9.99448 +367 1 2.85224 14.2779 8.56563 +368 1 4.27536 15.7111 9.9908 +369 1 5.69621 14.2898 8.55387 +370 1 7.14106 15.6996 9.99891 +371 1 8.56755 14.2758 8.56294 +372 1 9.99932 15.7052 10.0028 +373 1 11.4225 14.301 8.54252 +374 1 12.8699 15.7186 9.98128 +375 1 14.3381 14.336 8.50604 +376 1 15.7206 15.7211 9.9958 +377 1 17.139 14.2868 8.55783 +378 1 18.5618 15.7073 9.99448 +379 1 0.0016734 17.1338 8.56639 +380 1 1.42762 18.5602 9.99474 +381 1 2.85325 17.134 8.56538 +382 1 4.28357 18.5585 9.99498 +383 1 5.71258 17.13 8.5679 +384 1 7.14072 18.5564 9.99637 +385 1 8.56751 17.1279 8.56978 +386 1 9.99648 18.5561 9.99613 +387 1 11.4236 17.1302 8.56544 +388 1 12.8527 18.5593 9.99264 +389 1 14.2873 17.139 8.55677 +390 1 15.707 18.5632 9.99368 +391 1 17.1415 17.1418 8.56387 +392 1 18.5642 18.5644 9.99401 +393 1 0.00124759 0.000815388 11.4233 +394 1 1.42574 1.42555 12.8519 +395 1 2.85511 -0.00151506 11.4232 +396 1 4.28253 1.42523 12.8507 +397 1 5.71193 -0.00142742 11.4222 +398 1 7.14021 1.42786 12.8478 +399 1 8.56814 -0.00112058 11.4211 +400 1 9.9939 1.42956 12.8462 +401 1 11.4229 -0.000454533 11.4212 +402 1 12.847 1.42936 12.8487 +403 1 14.2764 0.000818757 11.4223 +404 1 15.7033 1.4281 12.8507 +405 1 17.1331 0.00193834 11.4229 +406 1 18.5603 1.42727 12.8517 +407 1 -0.00206847 2.85337 11.4239 +408 1 1.4227 4.28055 12.8513 +409 1 2.84791 2.84776 11.4263 +410 1 4.27116 4.27215 12.8575 +411 1 5.70805 2.85171 11.4237 +412 1 7.13742 4.28255 12.8501 +413 1 8.56567 2.85942 11.4182 +414 1 9.99111 4.28951 12.8447 +415 1 11.4195 2.8603 11.4178 +416 1 12.8463 4.28471 12.849 +417 1 14.2758 2.8548 11.4225 +418 1 15.7087 4.27812 12.855 +419 1 17.1347 2.85126 11.4255 +420 1 18.558 4.28306 12.8507 +421 1 -0.00326044 5.71039 11.4225 +422 1 1.42333 7.13894 12.8491 +423 1 2.84655 5.70541 11.4248 +424 1 4.27388 7.13547 12.8511 +425 1 5.68317 5.68606 11.4384 +426 1 7.13242 7.1412 12.8434 +427 1 8.56176 5.71643 11.4214 +428 1 9.98583 7.17053 12.8308 +429 1 11.4188 5.7151 11.4189 +430 1 12.851 7.14406 12.8449 +431 1 14.2924 5.69646 11.4352 +432 1 15.7003 7.14601 12.8478 +433 1 17.1318 5.71102 11.4241 +434 1 18.5564 7.14119 12.8481 +435 1 -0.00344302 8.56813 11.4212 +436 1 1.42473 9.99434 12.8504 +437 1 2.85196 8.56581 11.421 +438 1 4.27641 9.98921 12.8593 +439 1 5.69994 8.56447 11.4203 +440 1 7.0918 9.95812 12.9145 +441 1 8.5818 8.61273 11.4024 +442 1 9.98221 9.99539 13.0479 +443 1 11.4155 8.55204 11.3898 +444 1 12.8122 10.0024 12.8537 +445 1 14.2692 8.58987 11.4189 +446 1 15.7024 9.99643 12.8565 +447 1 17.1272 8.57126 11.4202 +448 1 18.5556 9.99699 12.8501 +449 1 -0.00297007 11.4235 11.4223 +450 1 1.42534 12.8505 12.8516 +451 1 2.85213 11.4204 11.4227 +452 1 4.27372 12.8556 12.8585 +453 1 5.6706 11.418 11.4264 +454 1 7.06123 12.9195 12.9257 +455 1 8.22958 11.5201 11.5302 +456 1 10.0104 12.8005 12.8223 +457 1 11.9793 11.8351 11.521 +458 1 13.0121 13.0222 13.0857 +459 1 14.3453 11.4428 11.4239 +460 1 15.7111 12.8695 12.871 +461 1 17.132 11.4285 11.4228 +462 1 18.5572 12.8538 12.8538 +463 1 -0.00147547 14.2777 11.4229 +464 1 1.42548 15.7067 12.851 +465 1 2.85097 14.2785 11.4229 +466 1 4.27137 15.7149 12.8542 +467 1 5.68303 14.2983 11.4231 +468 1 7.13303 15.7052 12.8575 +469 1 8.55795 14.268 11.4449 +470 1 9.9991 15.6977 12.8526 +471 1 11.4789 14.3259 11.4464 +472 1 12.8778 15.7268 12.8791 +473 1 14.2868 14.2833 11.4264 +474 1 15.7269 15.7286 12.852 +475 1 17.1318 14.2814 11.4247 +476 1 18.5621 15.7088 12.8521 +477 1 0.00112373 17.1342 11.4227 +478 1 1.42739 18.5615 12.8506 +479 1 2.85213 17.1349 11.422 +480 1 4.28318 18.5599 12.8502 +481 1 5.71036 17.1313 11.4231 +482 1 7.13958 18.5584 12.8494 +483 1 8.56845 17.1259 11.4261 +484 1 9.99636 18.557 12.8495 +485 1 11.4315 17.1315 11.4268 +486 1 12.8533 18.5613 12.8543 +487 1 14.2835 17.1351 11.4244 +488 1 15.7077 18.5651 12.8521 +489 1 17.1427 17.1439 11.4219 +490 1 18.5646 18.566 12.851 +491 1 0.00165724 0.00256297 14.279 +492 1 1.4273 1.4275 15.7056 +493 1 2.85576 0.000182233 14.2779 +494 1 4.28401 1.42715 15.7038 +495 1 5.71224 5.23408e-05 14.2762 +496 1 7.13964 1.42841 15.7026 +497 1 8.56732 0.00038323 14.2749 +498 1 9.99275 1.42959 15.7029 +499 1 11.4206 0.00128643 14.2768 +500 1 12.8463 1.43053 15.704 +501 1 14.2771 0.00335754 14.28 +502 1 15.7034 1.43046 15.7058 +503 1 17.1335 0.00395395 14.2793 +504 1 18.5602 1.42931 15.7058 +505 1 -0.00187122 2.85497 14.278 +506 1 1.42449 4.28183 15.704 +507 1 2.85086 2.8509 14.2801 +508 1 4.28002 4.28021 15.7045 +509 1 5.71087 2.85387 14.2768 +510 1 7.13755 4.28345 15.7032 +511 1 8.56686 2.8576 14.2746 +512 1 9.99226 4.28575 15.7025 +513 1 11.4183 2.85879 14.2742 +514 1 12.8456 4.28649 15.7014 +515 1 14.2742 2.85657 14.2769 +516 1 15.7028 4.28421 15.7034 +517 1 17.1324 2.85428 14.2792 +518 1 18.5572 4.28424 15.7032 +519 1 -0.0033298 5.71153 14.2761 +520 1 1.4229 7.13632 15.7058 +521 1 2.84911 5.70827 14.278 +522 1 4.2698 7.12716 15.7152 +523 1 5.70534 5.70803 14.2763 +524 1 7.12354 7.12356 15.7193 +525 1 8.56521 5.71626 14.2734 +526 1 9.99156 7.1327 15.7135 +527 1 11.4153 5.71868 14.2697 +528 1 12.8564 7.13141 15.7124 +529 1 14.2759 5.71267 14.2752 +530 1 15.7025 7.14049 15.7045 +531 1 17.1292 5.71389 14.2758 +532 1 18.5582 7.1383 15.7041 +533 1 -0.00294776 8.56709 14.2769 +534 1 1.42359 9.99346 15.7075 +535 1 2.84785 8.56315 14.2813 +536 1 4.2679 9.98856 15.7191 +537 1 5.68425 8.54536 14.3022 +538 1 7.12192 9.99337 15.7214 +539 1 8.53647 8.54005 14.3079 +540 1 9.99482 10.0051 15.7225 +541 1 11.4358 8.54309 14.2995 +542 1 12.8534 9.99823 15.7149 +543 1 14.2733 8.57289 14.2783 +544 1 15.7197 9.98391 15.7232 +545 1 17.1318 8.567 14.2779 +546 1 18.5602 9.99361 15.7072 +547 1 -0.00231752 11.4231 14.2789 +548 1 1.42453 12.8514 15.7088 +549 1 2.84871 11.4222 14.2821 +550 1 4.26705 12.8564 15.7207 +551 1 5.67453 11.4232 14.3092 +552 1 7.118 12.8661 15.7236 +553 1 8.52098 11.4529 14.3062 +554 1 9.99433 12.8562 15.7153 +555 1 11.4745 11.475 14.3054 +556 1 12.8769 12.8785 15.749 +557 1 14.3195 11.4086 14.3178 +558 1 15.7357 12.8547 15.7413 +559 1 17.133 11.4254 14.2834 +560 1 18.5628 12.8522 15.7114 +561 1 -0.000461417 14.2803 14.2809 +562 1 1.42576 15.7094 15.709 +563 1 2.84934 14.282 14.2826 +564 1 4.26941 15.7193 15.7192 +565 1 5.67794 14.3082 14.3098 +566 1 7.13934 15.7108 15.7131 +567 1 8.57731 14.2805 14.2871 +568 1 9.98396 15.7259 15.7285 +569 1 11.4045 14.3202 14.3195 +570 1 12.8528 15.7391 15.7427 +571 1 14.3593 14.3624 14.3694 +572 1 15.7444 15.7466 15.7483 +573 1 17.1398 14.2896 14.2912 +574 1 18.5655 15.7134 15.7131 +575 1 0.00150262 17.1362 14.2795 +576 1 1.42796 18.5636 15.7068 +577 1 2.85095 17.1377 14.2802 +578 1 4.28319 18.5621 15.7061 +579 1 5.70875 17.1346 14.2809 +580 1 7.13911 18.5613 15.7044 +581 1 8.56686 17.1315 14.2774 +582 1 9.99185 18.5635 15.7069 +583 1 11.4225 17.1348 14.2842 +584 1 12.8489 18.5662 15.7109 +585 1 14.2913 17.1461 14.2949 +586 1 15.7114 18.5698 15.7139 +587 1 17.1451 17.1474 14.283 +588 1 18.5659 18.5685 15.7091 +589 1 0.00288833 0.00420169 17.134 +590 1 1.42919 1.42791 18.5577 +591 1 2.85699 0.00158441 17.1321 +592 1 4.28406 1.42694 18.5578 +593 1 5.71197 0.00109634 17.1313 +594 1 7.13792 1.42825 18.5588 +595 1 8.56484 0.00268426 17.1325 +596 1 9.99179 1.42968 18.5594 +597 1 11.4189 0.00413895 17.134 +598 1 12.8468 1.43052 18.5597 +599 1 14.2759 0.00565493 17.1354 +600 1 15.7034 1.43088 18.5597 +601 1 17.1349 0.00660603 17.1362 +602 1 18.561 1.42995 18.5589 +603 1 -0.00091623 2.85567 17.1305 +604 1 1.42526 4.27929 18.5581 +605 1 2.85467 2.8538 17.1308 +606 1 4.27983 4.278 18.5606 +607 1 5.71077 2.85457 17.1307 +608 1 7.13708 4.28064 18.5609 +609 1 8.56543 2.85643 17.1307 +610 1 9.99257 4.28276 18.5603 +611 1 11.4194 2.85749 17.1307 +612 1 12.8475 4.28303 18.5597 +613 1 14.2741 2.85764 17.1307 +614 1 15.7042 4.28172 18.5591 +615 1 17.131 2.85673 17.1311 +616 1 18.5585 4.28185 18.557 +617 1 -0.00243093 5.70895 17.1311 +618 1 1.4245 7.13459 18.5603 +619 1 2.84914 5.70466 17.1353 +620 1 4.27797 7.13389 18.5632 +621 1 5.7036 5.70263 17.1387 +622 1 7.1357 7.1362 18.5621 +623 1 8.56392 5.70733 17.1359 +624 1 9.99202 7.13919 18.5608 +625 1 11.4209 5.70947 17.134 +626 1 12.8478 7.13809 18.5611 +627 1 14.2783 5.7081 17.1347 +628 1 15.7037 7.13715 18.5609 +629 1 17.1302 5.71087 17.131 +630 1 18.5607 7.13454 18.5606 +631 1 -0.00128372 8.56432 17.1334 +632 1 1.42538 9.9925 18.5623 +633 1 2.84785 8.5618 17.138 +634 1 4.27795 9.99245 18.5647 +635 1 5.70176 8.56119 17.1407 +636 1 7.1354 9.99316 18.5629 +637 1 8.56253 8.5661 17.1316 +638 1 9.99268 9.99559 18.5609 +639 1 11.4208 8.56677 17.1316 +640 1 12.8487 9.9958 18.5618 +641 1 14.277 8.56564 17.1369 +642 1 15.7071 9.99224 18.565 +643 1 17.1373 8.56038 17.1391 +644 1 18.5637 9.99074 18.5645 +645 1 0.000285278 11.4218 17.1358 +646 1 1.42657 12.8514 18.5638 +647 1 2.84833 11.422 17.1394 +648 1 4.27862 12.852 18.566 +649 1 5.70055 11.4239 17.1424 +650 1 7.13496 12.8509 18.5651 +651 1 8.55978 11.4258 17.1342 +652 1 9.99367 12.8501 18.5632 +653 1 11.426 11.4292 17.134 +654 1 12.853 12.8549 18.5672 +655 1 14.2857 11.4237 17.1408 +656 1 15.7109 12.8525 18.5689 +657 1 17.1435 11.418 17.146 +658 1 18.5662 12.8507 18.5674 +659 1 0.00198115 14.281 17.1376 +660 1 1.4282 15.7098 18.5645 +661 1 2.849 14.2826 17.1404 +662 1 4.28043 15.71 18.5661 +663 1 5.70173 14.2865 17.1435 +664 1 7.13745 15.7068 18.5657 +665 1 8.56376 14.2803 17.14 +666 1 9.99108 15.7088 18.5677 +667 1 11.4215 14.2873 17.1413 +668 1 12.8496 15.7127 18.5698 +669 1 14.2942 14.2965 17.1533 +670 1 15.7138 15.7167 18.5722 +671 1 17.1491 14.2862 17.1522 +672 1 18.5686 15.7126 18.5697 +673 1 0.00365743 17.139 17.1374 +674 1 1.42998 18.5645 18.5623 +675 1 2.85177 17.1397 17.1385 +676 1 4.2845 18.5618 18.5612 +677 1 5.71062 17.1364 17.1368 +678 1 7.13623 18.5637 18.5639 +679 1 8.56039 17.1418 17.1428 +680 1 9.98964 18.5663 18.5664 +681 1 11.4165 17.1471 17.148 +682 1 12.8472 18.5686 18.5679 +683 1 14.2835 17.1521 17.1526 +684 1 15.7084 18.571 18.5693 +685 1 17.1509 17.1539 17.153 +686 1 18.568 18.5704 18.568 +687 1 10.1985 10.7319 10.9228 + +PafiPath + +1 0.00448604 0.00299371 1.25552e-05 0.0012307 0.00125596 7.47824e-05 0.00648731 0.00449787 0.00203625 +2 1.42757 1.42374 1.42237 -0.000166277 0.00111511 0.000767572 0.00439707 0.0049179 0.00377177 +3 2.85768 -0.000111595 -0.00117603 -0.000775401 -0.000447735 -0.000700154 0.00166735 0.00394693 0.00232555 +4 4.28206 1.42351 1.42428 -0.00177722 -0.000147865 0.000411773 -0.000474597 0.00405872 0.00372894 +5 5.71045 0.000184061 0.000357624 -0.00176419 -8.35707e-05 -1.29782e-05 -0.00266437 0.00246441 0.00222151 +6 7.1368 1.42501 1.42562 -0.0013246 0.00020341 0.000422164 -0.00413402 0.00258638 0.00330152 +7 8.56373 0.00179453 0.00172992 -0.00136152 0.000624455 0.000455767 -0.00290836 0.00269823 0.00298117 +8 9.99168 1.42642 1.42598 -0.00021463 0.0008327 0.000622463 -0.00279898 0.00241782 0.00263082 +9 11.4187 0.00327202 0.00227737 -0.000401319 0.00105507 0.000634173 0.00150958 0.00434837 0.00384073 +10 12.8474 1.42747 1.42572 0.000624325 0.00126496 0.000670467 0.00268248 0.00346313 0.00243791 +11 14.2756 0.0045707 0.00236301 0.000663113 0.00141375 0.000662 0.00686146 0.00532528 0.00346045 +12 15.705 1.42755 1.42471 0.000632106 0.00195131 0.000927378 0.00788061 0.00421518 0.00220502 +13 17.1345 0.00506352 0.00188451 0.00143247 0.00185472 0.000664049 0.00878858 0.00472913 0.00203976 +14 18.5638 1.42578 1.4228 -0.000325513 0.00244529 0.00111507 0.00866897 0.00466572 0.00254539 +15 0.000182033 2.85273 19.9829 -0.00101812 0.00115432 -0.000231119 0.00659476 0.00481436 0.00232392 +16 1.42429 4.27664 1.42129 -0.000784591 -0.000106523 0.00100148 0.00328885 0.00553945 0.00382558 +17 2.85404 2.85113 19.984 -0.00204755 -0.000821179 0.000808953 0.00165412 0.00511082 0.000907537 +18 4.27845 4.27627 1.42291 -0.00108591 -0.000249517 0.00145626 -0.000771385 0.00343083 0.00281981 +19 5.70979 2.85265 19.9858 -0.00207858 -0.00158357 0.000956862 -0.00220026 0.00390417 0.00149033 +20 7.13648 4.2798 1.42573 -0.00138223 -0.00122812 0.000465257 -0.00215578 0.00243962 0.00339662 +21 8.56475 2.85452 19.9865 -0.000601073 -0.00113568 0.000865558 -0.00371209 0.00214036 0.00302214 +22 9.99207 4.28151 1.426 0.000107332 -0.00080203 0.000588424 -0.00239423 0.00125735 0.00324475 +23 11.4195 2.85554 19.9864 0.000620357 -0.000673936 0.000656707 -0.000698861 0.00211416 0.00402876 +24 12.8476 4.28148 1.42552 0.000677438 -7.50279e-05 0.000573318 0.00105521 0.00111736 0.00294505 +25 14.2753 2.8555 19.9858 0.00113643 5.60001e-06 0.000496055 0.00402497 0.00345359 0.00369947 +26 15.7066 4.27861 1.4226 -0.000852918 0.00168186 0.00131145 0.00616814 0.00180897 0.00221228 +27 17.133 2.85398 19.9842 9.13448e-05 0.00113615 0.000182325 0.00690665 0.00466631 0.00235392 +28 18.5621 4.27835 1.42129 -0.0020503 0.00157995 0.00118831 0.0067892 0.00436562 0.0031562 +29 -0.000538145 5.70632 19.9841 -0.000744433 0.000107246 4.52542e-05 0.00381664 0.00450259 0.00200331 +30 1.42454 7.13442 1.42295 -0.000314331 -0.000712245 0.000788048 0.00291295 0.00340428 0.00394074 +31 2.85195 5.70592 19.9856 -0.00212191 -0.000954414 0.0011276 0.00163962 0.00379831 0.00118817 +32 4.27826 7.13446 1.42492 -0.00109605 -0.000615356 0.00117838 0.000983896 0.00205517 0.00294814 +33 5.7078 5.70701 19.9874 -0.00227542 -0.00174772 0.00198003 -0.000207727 0.00245295 0.0015202 +34 7.13443 7.13513 1.42756 -0.000549259 -0.000492957 0.000830903 0.000223061 0.00134345 0.00337824 +35 8.56461 5.70993 19.9881 -0.000754587 -0.00179056 0.00111954 -0.000819791 0.0017794 0.00309445 +36 9.99203 7.13802 1.42927 -0.000349872 -0.000692776 -0.000116632 0.000604886 0.000870734 0.00375676 +37 11.4196 5.71081 19.9877 0.000675562 -0.00112408 0.000645118 0.000177049 0.000530353 0.0046633 +38 12.8496 7.13615 1.42706 -0.00102722 0.000668857 0.000580707 0.00230506 0.000458623 0.00306945 +39 14.2762 5.70905 19.9864 0.000111896 0.00039818 0.000256499 0.00261559 0.00115374 0.00402773 +40 15.7063 7.13567 1.42404 -0.00166096 0.000883715 0.00064806 0.00370327 0.00220464 0.00264978 +41 17.1323 5.70823 19.9845 -0.00139813 0.00130424 -0.000532118 0.00450993 0.0029182 0.00331034 +42 18.5624 7.13482 1.4227 -0.00152388 -0.00028583 0.000935633 0.00433463 0.00343899 0.00316994 +43 0.000696865 8.56319 19.9865 0.000133222 -0.000727777 0.000174859 0.00277403 0.0024152 0.00224224 +44 1.426 9.99355 1.42486 0.000170191 -0.000808215 0.000652723 0.00366083 0.000474426 0.00375362 +45 2.85222 8.5637 19.9875 -0.00149468 -0.000366268 0.000802317 0.00254151 0.00131667 0.00187083 +46 4.27978 9.99352 1.4268 -0.000816836 -0.000585707 0.000976855 0.00279516 0.000507979 0.00315451 +47 5.70775 8.56419 19.989 -0.00207207 -0.000984391 0.00161503 0.00216243 0.00101362 0.00237994 +48 7.13672 9.99198 1.43004 -0.000663405 -0.000536687 0.000343426 0.00198356 0.00189018 0.00300234 +49 8.56417 8.56538 19.9886 -0.00104148 -0.00136216 0.000630345 0.00246839 0.00247213 0.00450724 +50 9.99289 9.99123 1.43118 -0.000558816 0.000120021 -0.000506758 0.00288066 0.00274146 0.00346631 +51 11.4205 8.56619 19.9884 -0.000223897 -0.000583039 -0.000184375 0.00213751 0.00221894 0.0050539 +52 12.849 9.99338 1.42926 -0.000970805 0.000163618 -9.5726e-05 0.00301006 0.00360955 0.00307244 +53 14.2761 8.56576 19.9882 -0.00127923 0.000553607 -0.000582713 0.00226183 0.00290747 0.00395972 +54 15.7069 9.99395 1.42585 -0.00113967 -0.000943542 0.000598503 0.00408653 0.00326173 0.00274972 +55 17.1337 8.56386 19.9875 -0.000711377 -0.000474878 8.05055e-06 0.00304944 0.00293947 0.00320203 +56 18.5635 9.99327 1.42454 -0.000785684 -0.00141961 0.000718736 0.00454228 0.00215983 0.00270698 +57 0.00227377 11.4219 0.00147796 0.000695552 -0.00104732 0.000174834 0.0039761 0.000646927 0.00270091 +58 1.42804 12.8521 1.42671 0.00044846 -0.000700938 0.000439557 0.00456664 -0.000877265 0.00355036 +59 2.85342 11.4223 0.00180127 -0.0010199 -7.56669e-05 0.000539148 0.00339422 -0.000731584 0.00222488 +60 4.28227 12.8506 1.42863 -0.000624799 -0.000490247 0.000859955 0.00259559 -6.38987e-05 0.0029353 +61 5.70881 11.4211 0.0031342 -0.00158252 -0.000150429 0.00129701 0.00238686 0.00107857 0.00268797 +62 7.13884 12.8475 1.43098 -0.00103026 -8.82166e-05 8.97037e-05 0.0022583 0.00264978 0.00307743 +63 8.56508 11.4205 0.00269639 -0.000895119 -0.000208814 0.000273049 0.00298717 0.00335407 0.00484394 +64 9.9936 12.8465 1.43168 -0.000124834 0.000131001 -0.000249861 0.00280537 0.00530493 0.00290562 +65 11.4213 11.4218 0.00260934 -0.000614669 -0.000172955 -0.000722907 0.00389182 0.00556453 0.00428 +66 12.849 12.8502 1.43019 0.000246137 -0.000111971 -0.000114605 0.00410257 0.00674223 0.00254068 +67 14.2779 11.4226 0.00247567 -0.000461923 -0.000823769 -0.000703099 0.00439249 0.00571891 0.00586108 +68 15.7072 12.8522 1.42747 -0.000279099 -0.00135511 0.0002439 0.00714675 0.00597533 0.00210244 +69 17.1356 11.4219 0.0026081 4.09023e-05 -0.00143693 0.000243844 0.00407622 0.00391006 0.00317833 +70 18.5645 12.8524 1.4262 -0.000159845 -0.00138747 0.000299754 0.00655279 0.00211556 0.00286506 +71 0.003965 14.281 0.00320774 0.00119628 -0.000908847 -0.000127474 0.00577805 0.000796793 0.00303436 +72 1.43042 15.7085 1.42837 0.000661296 -0.00038427 9.12732e-05 0.00512547 0.000392853 0.00339026 +73 2.85515 14.2801 0.00315607 -0.000608345 -8.88896e-05 4.73856e-05 0.00319292 -0.00111074 0.00246578 +74 4.28467 15.7055 1.4304 -0.000763199 -0.000236336 0.000305858 0.000968364 0.000959543 0.00293613 +75 5.71011 14.278 0.00441222 -0.0013048 0.000195966 0.00078492 0.000979351 0.00158512 0.0027004 +76 7.13933 15.7032 1.43146 -0.000896832 -0.000171725 -1.39606e-05 0.000473446 0.00271404 0.00329304 +77 8.56579 14.276 0.00441963 -0.000515712 -0.000138941 0.000451055 0.0027467 0.00439133 0.00337149 +78 9.99251 15.7041 1.43141 -0.000488499 0.000172883 -5.80497e-05 0.00135205 0.007143 0.00259963 +79 11.4205 14.2783 0.00416102 -0.000297167 0.000332049 -9.80807e-05 0.00416355 0.0074962 0.00558544 +80 12.8478 15.7065 1.43075 0.000279173 0.000186471 -0.000215034 0.00513954 0.0091176 0.00224821 +81 14.2794 14.2819 0.00500693 0.000611836 -4.49756e-05 8.1196e-05 0.0055641 0.00700242 0.00483931 +82 15.707 15.7097 1.42924 0.000842695 -7.90111e-05 -0.000307597 0.00902665 0.00782206 0.00180669 +83 17.1371 14.2816 0.00478647 0.000513337 -0.000936302 3.88038e-05 0.00703339 0.0050268 0.00311217 +84 18.565 15.7101 1.42787 0.00079818 -0.000600997 -0.000250899 0.00878686 0.00391173 0.00272622 +85 0.00533603 17.1383 0.0037217 0.0017389 -0.000183469 -0.000357723 0.00665447 0.00260847 0.00264663 +86 1.43181 18.5614 1.42781 0.00042672 0.000632719 -0.000128541 0.00483557 0.0028788 0.00344931 +87 2.85722 17.1354 0.003011 -0.000472121 -0.00025979 -0.000680646 0.00224126 0.000987364 0.00254336 +88 4.28514 18.5591 1.42893 -0.00110541 -9.26333e-05 -0.000253388 0.000190094 0.00177613 0.00388249 +89 5.71156 17.1331 0.00356601 -0.00119363 -0.000203657 -0.000229598 -0.000521504 0.00121225 0.00270281 +90 7.13782 18.5594 1.43003 -0.00148383 0.000423857 -0.000306828 -0.00280324 0.00293167 0.00330838 +91 8.56433 17.1339 0.00497866 -0.00137551 0.000506059 0.000418744 -0.000384076 0.00412252 0.00322808 +92 9.99142 18.5608 1.43029 -0.000826713 0.000879709 -0.000347474 -0.000619307 0.00525292 0.002741 +93 11.419 17.1359 0.00556187 -0.000605466 0.000886169 0.000476445 0.00388613 0.00679325 0.00389171 +94 12.8471 18.5624 1.42976 0.000302608 0.00100254 -0.000413067 0.00488914 0.00706896 0.00283921 +95 14.2772 17.1383 0.00595758 0.000912171 0.000818862 0.000395919 0.00730507 0.00683073 0.00328764 +96 15.7052 18.5641 1.42883 0.00118537 0.00129445 -0.000412125 0.00905008 0.00661584 0.00279563 +97 17.1374 17.1402 0.00598099 0.00160462 0.000563882 0.000228178 0.00814453 0.00456451 0.00170835 +98 18.5641 18.564 1.42768 0.00140229 0.00118737 -0.000410916 0.00906024 0.00474027 0.00278757 +99 0.00409482 19.9874 2.8511 0.000975811 0.00202908 0.000143879 0.00644345 0.00418106 0.00490872 +100 1.42553 1.42159 4.27937 -0.000151595 0.000863472 0.00139875 0.00490958 0.00557103 0.00632357 +101 2.85637 19.9845 2.85345 -0.00055766 0.000300828 0.000746952 0.00238983 0.00364335 0.00481773 +102 4.27927 1.42089 4.2793 -0.000630141 0.00013578 0.00114796 0.000465505 0.00383246 0.00619505 +103 5.7104 19.9852 2.85508 -0.00191339 0.000341975 -0.000390171 -0.00121508 0.00245813 0.00516564 +104 7.13674 1.42404 4.28191 -0.00146502 -0.000423205 -0.000357024 -0.000951541 0.00294163 0.00525402 +105 8.56417 19.9868 2.85544 -0.00140703 0.00101777 -0.000848117 -0.00225223 0.00294117 0.00344603 +106 9.9921 1.42561 4.28228 -0.000221368 0.000293525 -0.000440146 -0.00136733 0.00304712 0.00248768 +107 11.4191 19.9882 2.85485 -0.000224913 0.00141684 -0.000974401 0.000965538 0.00455761 0.00210928 +108 12.848 1.42652 4.28113 0.00057005 0.000714925 3.99514e-05 0.00199758 0.00379691 0.000814991 +109 14.2758 19.9893 2.8534 0.000803839 0.00188201 -0.000835756 0.00608554 0.0054541 0.00231458 +110 15.7078 1.4249 4.27787 -0.000522588 0.00209584 0.00155617 0.00720031 0.00398046 0.00101809 +111 17.1354 19.9892 2.85118 0.00112838 0.00252931 -0.000419916 0.00891713 0.00489614 0.00339523 +112 18.5642 1.4239 4.27842 -0.00117465 0.00227583 0.00166566 0.00735283 0.00478112 0.00471074 +113 0.000556869 2.85006 2.84979 -0.00117217 0.00105131 0.00111209 0.0061502 0.00572698 0.00538897 +114 1.422 4.27452 4.2767 -0.0010058 -0.000210649 0.000731258 0.00423657 0.00651338 0.00810759 +115 2.84624 2.84313 2.84486 0.000169766 0.0010239 0.00198459 0.00214844 0.00563487 0.00600572 +116 4.25891 4.25785 4.26023 0.00223538 0.00242263 0.00319802 0.00276044 0.00595537 0.00908754 +117 5.70698 2.84634 2.84826 -0.00174333 -0.000314385 0.000494499 -0.00123043 0.00415362 0.00579263 +118 7.13448 4.26762 4.26953 -0.00337995 -0.0010162 -0.000479391 0.000924751 0.00487636 0.00772252 +119 8.56424 2.8485 2.84953 -0.000368659 0.00048266 0.000892641 -0.00343367 0.00215335 0.00346258 +120 9.99236 4.26985 4.2707 0.00103539 0.00161616 0.00185981 -0.0013387 0.0017389 0.00313418 +121 11.4202 2.84976 2.84967 0.000997561 0.00139206 0.00151628 -0.00158643 0.00121935 0.00122589 +122 12.8489 4.27123 4.2713 0.00174369 0.00403599 0.00422153 0.000874245 -0.00119521 -0.0014398 +123 14.2776 2.84977 2.84875 0.000286165 0.00252168 0.00237197 0.00437983 0.00148333 0.000361421 +124 15.724 4.2622 4.26211 -0.00881199 0.00883645 0.00895703 0.00720195 2.67714e-05 -0.000704746 +125 17.1403 2.84643 2.8452 -0.003226 0.00414135 0.00376561 0.0089863 0.00283909 0.00161475 +126 18.5635 4.27636 4.277 -0.00230552 0.0015694 0.0019087 0.00481142 0.00502796 0.00524463 +127 0.000168547 5.70509 2.84936 -0.000745174 -0.000460924 0.000420631 0.00359146 0.00513704 0.00593305 +128 1.42307 7.13372 4.27749 -0.000461934 -0.000485385 0.000351807 0.00323476 0.00336935 0.00705137 +129 2.84455 5.70222 2.84457 0.000304791 -8.59996e-05 0.00177454 0.0022834 0.00409423 0.00596565 +130 4.26008 7.1291 4.2629 0.00232923 -0.000178781 0.00282726 0.00355683 0.00138681 0.00718615 +131 5.70156 5.70098 2.84905 0.000789134 0.00126315 0.00132492 -0.00132635 0.000837337 0.00298379 +132 7.12123 7.12358 4.27232 0.00450871 0.00367897 0.00481495 -0.00138675 -0.00109498 0.00280236 +133 8.56382 5.70744 2.85401 -0.00119827 -0.00132826 -0.00157388 -0.000430537 0.00172544 0.00470662 +134 9.99114 7.13622 4.28612 -0.00194659 -0.0016235 -0.00112986 0.00291173 0.00118356 0.000328091 +135 11.4197 5.70843 2.854 0.000307615 -0.000181758 -0.00104043 0.000161854 0.00022862 0.00345201 +136 12.8614 7.12515 4.2724 -0.00925307 0.00631498 0.00894948 0.00920997 -0.00321997 -0.00558362 +137 14.2822 5.70267 2.84851 -0.00316479 0.0032007 0.00144363 0.00612528 -0.00175926 -0.000552665 +138 15.723 7.12977 4.26312 -0.00999378 0.00182741 0.00833272 0.00268872 0.00534784 0.00134229 +139 17.1403 5.70379 2.84469 -0.00443823 0.00204589 0.00371066 0.00565502 0.00346898 0.00246106 +140 18.5648 7.1328 4.27583 -0.000201722 -0.0014142 -0.000304373 0.00102146 0.00514196 0.00618946 +141 0.00127881 8.56337 2.85048 0.000120316 -0.00117999 -0.000212513 0.00308948 0.00249643 0.00535241 +142 1.42492 9.99366 4.27913 0.000145137 -0.000608333 0.000337839 0.003985 0.000126572 0.00574943 +143 2.84679 8.56494 2.84743 0.000542401 -0.000800337 0.00147126 0.00361055 0.00161256 0.00565675 +144 4.26715 9.99868 4.26941 0.00183156 -0.00148145 0.0022123 0.00512648 0.000893687 0.00616314 +145 5.70372 8.56357 2.8521 0.000348944 -0.000656639 0.000539007 0.000760799 0.000574558 0.00323825 +146 7.13212 9.99082 4.28405 0.00175953 -0.0019759 0.0020598 -0.000612318 0.00242175 -0.00707241 +147 8.56086 8.56115 2.85841 0.00043914 0.000287502 -0.000438222 0.00171152 0.00118292 0.00349797 +148 9.99282 9.9837 4.28446 -0.00145332 0.00440673 0.000463551 0.00692734 0.000525821 -0.00237852 +149 11.4236 8.56168 2.85777 -0.00217077 0.000862789 -0.000186004 0.00383409 0.00136598 0.00285671 +150 12.8548 9.99207 4.28039 -0.00485719 2.49853e-05 0.00362658 0.00721091 0.00831265 -0.00362137 +151 14.2813 8.56402 2.85062 -0.00345965 3.88409e-05 0.00136394 0.00404063 0.0029268 0.00236705 +152 15.7206 9.99759 4.26601 -0.00612034 -0.00424248 0.00471084 0.00140665 0.00335504 0.00290793 +153 17.1401 8.56434 2.84615 -0.00336187 -0.0015059 0.00251179 0.00406262 0.00363588 0.00244376 +154 18.5661 9.99212 4.27588 0.00123073 -0.00282529 -0.00153565 0.00153893 0.00254327 0.00498069 +155 0.00263103 11.4225 2.85174 0.000601799 -0.00114151 -0.000379486 0.00435515 0.000263279 0.00443302 +156 1.42712 12.8513 4.28122 0.000766508 -0.000733552 0.00068499 0.00434904 -0.000559544 0.00372151 +157 2.84991 11.425 2.85026 0.000636994 -0.000948551 0.00137146 0.00411146 -0.00068005 0.00452263 +158 4.27477 12.8561 4.27641 0.00208135 -0.00267351 0.00246955 0.00372795 0.000858611 0.00376287 +159 5.70849 11.4219 2.85479 4.63414e-05 -0.00136898 0.000717247 0.00190444 0.00216713 0.00318444 +160 7.13934 12.8475 4.28593 -0.00029142 -0.00255585 0.000787355 0.000337277 0.00924678 -0.00514569 +161 8.56568 11.4173 2.86077 -0.00100025 0.000475225 -0.00141244 0.00417549 0.00322394 0.00345583 +162 9.99452 12.8438 4.28907 7.80752e-05 -0.00096103 0.000529806 0.00545424 0.00582949 0.000592604 +163 11.4216 11.4186 2.86023 -0.000332118 0.000550075 -0.00097496 0.00323141 0.00528887 0.00214219 +164 12.8518 12.8526 4.281 -0.000467022 -0.00207802 0.000361714 0.00565194 0.00967713 -0.00540242 +165 14.2798 11.4234 2.85279 -0.00116012 -0.00175108 0.00134537 0.00581706 0.00667643 -0.000149502 +166 15.717 12.8583 4.27082 -0.00250954 -0.00461797 0.00150064 0.00873343 0.00733259 -0.00418437 +167 17.1402 11.4249 2.84777 -0.0017171 -0.00275526 0.00136122 0.00560796 0.00276851 0.00156855 +168 18.567 12.8516 4.27683 0.00188597 -0.0017023 -0.00215851 0.00517087 0.00327173 0.00234375 +169 0.00416979 14.2803 2.85317 0.00114902 -0.000648364 -0.000565706 0.00622094 0.00113297 0.00357857 +170 1.43022 15.706 4.28307 0.000775642 7.27373e-05 0.000297501 0.00462388 0.000710185 0.00346742 +171 2.85403 14.2807 2.85369 0.000678046 -0.00103429 0.00118871 0.00370061 -0.000562911 0.00374918 +172 4.28508 15.7028 4.28565 2.26517e-05 -0.000495813 0.000563803 0.001393 0.0024217 0.00266721 +173 5.71207 14.2761 2.85758 -0.000524226 -0.000935391 0.000511102 0.000816009 0.00361686 0.00160848 +174 7.14016 15.7002 4.28729 -0.00157931 0.000308264 -0.00142787 0.00716776 -0.000301293 0.00686285 +175 8.56721 14.2735 2.85944 -0.000755292 -0.000606053 -0.000326821 0.00382102 0.00489377 0.00290534 +176 9.9925 15.7021 4.28568 -0.00154731 0.00120667 -0.0024042 0.00272428 0.00598309 0.00166572 +177 11.4199 14.2758 2.85856 3.53058e-05 -5.12071e-05 2.44964e-05 0.0031184 0.00808299 0.000380604 +178 12.8481 15.7054 4.28299 0.000218592 0.00206443 -0.00313555 0.00181459 0.0077854 -0.000593638 +179 14.2787 14.2808 2.8543 0.000547911 -0.00053913 0.00018766 0.00688428 0.00938825 -0.0026112 +180 15.7102 15.7106 4.27758 0.00255316 0.00228139 -0.00269758 0.00843678 0.00877785 -0.00118047 +181 17.1392 14.283 2.85015 -0.000237489 -0.0015587 6.69101e-05 0.0086373 0.00595971 0.000885391 +182 18.5674 15.7094 4.27757 0.0035913 0.00178767 -0.00347051 0.00646713 0.00346384 0.00354002 +183 0.00530324 17.1355 2.85385 0.00166057 0.00097607 -0.00102235 0.0069204 0.00279248 0.00415587 +184 1.4302 18.5604 4.28139 0.00072677 -4.73457e-05 0.00126671 0.00491983 0.00377393 0.00415537 +185 2.85834 17.1324 2.85671 -8.7982e-05 -2.91489e-06 0.000391452 0.00279215 0.00144116 0.00401606 +186 4.28438 18.558 4.28368 -0.000732553 -0.000305299 0.000705559 0.00164138 0.00226356 0.00495635 +187 5.71249 17.1302 2.85828 -0.00120549 5.46819e-05 -0.000379786 0.001359 0.000926663 0.00509551 +188 7.13774 18.5592 4.28398 -0.00272511 0.00148694 -0.00164799 0.00181643 0.00136474 0.00522407 +189 8.56519 17.1308 2.85818 -0.0013889 0.000740579 -0.00115041 -0.000183908 0.0046179 0.00281771 +190 9.99094 18.5614 4.28261 -0.00217174 0.00262229 -0.0028331 0.00216769 0.00348083 0.00293404 +191 11.4193 17.1328 2.85709 -0.000486641 0.0012256 -0.00143661 0.00237557 0.00749925 0.0013436 +192 12.8471 18.5634 4.28037 9.04984e-06 0.00314738 -0.0032097 0.00408966 0.00506778 0.0018373 +193 14.2764 17.1353 2.85507 0.000971154 0.00133161 -0.001551 0.00666864 0.00769744 0.00168826 +194 15.7078 18.5659 4.27676 0.00238443 0.00399156 -0.00325557 0.00638438 0.00460769 0.00320468 +195 17.1365 17.1373 2.85278 0.00174285 0.00139054 -0.00154274 0.00962719 0.00637547 0.00218585 +196 18.567 18.5656 4.27646 0.00347389 0.00356844 -0.00228829 0.00575505 0.00278527 0.00558921 +197 0.00243376 19.9863 5.70907 0.000329792 0.000846248 0.00154352 0.00660247 0.00514458 0.00401604 +198 1.42501 1.42238 7.13866 -5.62877e-05 0.000454751 0.000956334 0.00446512 0.0049753 0.00658801 +199 2.85516 19.9839 5.71062 -5.11587e-05 -0.000501326 0.00146028 0.00319747 0.00385957 0.00600415 +200 4.27966 1.42202 7.13836 -0.000183891 -0.000274073 0.000879178 0.00269965 0.00354136 0.0069584 +201 5.70991 19.9844 5.71128 -0.000978989 -0.000325665 0.00063262 0.00132578 0.00242345 0.0052385 +202 7.13519 1.42474 7.13764 -0.000400973 -0.000719163 0.000377296 0.00197001 0.0027372 0.00506811 +203 8.56506 19.9865 5.71219 -0.00108848 2.14769e-05 -0.000444092 0.00182749 0.00200529 0.00391524 +204 9.99273 1.42779 7.13909 -0.000314919 -0.00107979 -0.000336095 0.00185594 0.00271235 0.00255378 +205 11.4199 19.9879 5.71089 -6.61001e-05 0.000512815 -0.000804843 0.00191257 0.00409249 0.000793611 +206 12.8504 1.42703 7.13644 -0.000891454 0.000256944 0.000939551 0.00273419 0.00341755 -0.000131328 +207 14.2779 19.9886 5.70773 0.000418176 0.000948278 6.17775e-05 0.00441497 0.00486356 0.000412319 +208 15.7075 1.42546 7.13629 -0.00112488 0.00115858 0.00127129 0.00385773 0.00381417 0.00153907 +209 17.1363 19.9887 5.70688 0.000414499 0.00138899 0.000721242 0.00524724 0.00429874 0.00322432 +210 18.5624 1.42428 7.13821 -0.00185503 0.00152796 0.00146219 0.00582601 0.00468037 0.00352947 +211 -0.000551931 2.84997 5.70876 -0.00141855 0.000946716 0.00147819 0.00529496 0.00579379 0.00623025 +212 1.42191 4.27626 7.13705 -0.000920523 0.000105053 0.000821114 0.00384544 0.00636768 0.00768047 +213 2.8445 2.8424 5.70534 0.000421995 0.000930463 0.00112776 0.0038771 0.00614574 0.00878223 +214 4.25887 4.2595 7.13052 0.00201196 0.00189075 3.36173e-05 0.00703611 0.00781061 0.0103955 +215 5.70109 2.84577 5.70271 0.000340693 -0.000194547 0.00148004 0.000596562 0.00283599 0.00658866 +216 7.11883 4.26758 7.12298 0.00264989 0.00238361 0.00197895 0.00267223 0.00476996 0.00739112 +217 8.56402 2.85194 5.70851 -0.00125284 -0.0025506 -0.0011804 0.000286701 0.00402724 0.00534507 +218 9.99136 4.28423 7.13521 -0.00185381 -0.00177623 -0.00299109 0.00260241 0.00188744 0.00534346 +219 11.4203 2.85333 5.70875 0.000515037 -0.00148761 -3.37986e-05 0.000233607 0.0036179 0.00143002 +220 12.8617 4.27314 7.12503 -0.00910155 0.00925556 0.00652497 0.00808479 -0.0037384 -0.00302292 +221 14.2828 2.84917 5.70308 -0.00294066 0.00159051 0.00364011 0.00609594 0.000659288 -0.00205613 +222 15.7228 4.26472 7.13063 -0.00981695 0.00914588 0.00265659 0.000413858 0.00359984 0.00572062 +223 17.1408 2.84589 5.70505 -0.00416292 0.00423022 0.00274364 0.00535589 0.00380311 0.00391891 +224 18.5613 4.2784 7.13748 -0.00285028 0.00196556 0.00190773 0.00318906 0.00429079 0.00376394 +225 -0.00104851 5.70514 5.70725 -0.0011246 -0.000179681 0.000801489 0.00264147 0.00608356 0.00724684 +226 1.42303 7.13324 7.13526 -0.00129845 -0.000749722 -8.64073e-05 0.00429239 0.0057404 0.00837426 +227 2.8434 5.6983 5.7006 -0.00162364 -0.000986522 -0.000318789 0.00512375 0.00664181 0.0107585 +228 4.25921 7.11924 7.12135 -0.00158003 -0.00314827 -0.00293018 0.0154117 0.00832654 0.0133908 +229 5.65843 5.66088 5.66279 0.00633137 0.00570138 0.00593316 0.00813089 0.00750962 0.0125599 +230 7.02006 7.02903 7.03201 0.0167901 0.0181654 0.0185088 0.0287216 0.022858 0.0254062 +231 8.57021 5.69111 5.69246 -0.00886135 -0.00807864 -0.00798729 0.00404082 0.00789799 0.0104644 +232 9.98839 7.16674 7.16381 -0.00645048 -0.0348745 -0.0402246 0.0235759 -0.00868561 -0.0077103 +233 11.4119 5.69495 5.69493 0.00664066 -0.000590943 -0.000561003 0.00505897 0.0048144 0.00514222 +234 12.9515 7.04195 7.03968 -0.055698 0.0515425 0.0504959 -0.0184694 0.0144645 0.0113567 +235 14.3206 5.66722 5.66665 -0.0205688 0.0186868 0.0186616 0.00401846 0.000200128 -0.000787848 +236 15.7187 7.12691 7.12492 -0.0132997 0.00686913 0.0064366 -0.0128542 0.00615724 0.00361005 +237 17.1395 5.70196 5.70217 -0.00305015 0.00327001 0.00359328 0.000927458 0.00387978 0.0034384 +238 18.561 7.13418 7.13552 -0.00122714 -5.25831e-05 0.00121301 -0.00198961 0.00547024 0.0039647 +239 0.000217072 8.56346 5.70766 -0.000303315 -0.000839847 0.000245497 0.00168856 0.0028319 0.00583879 +240 1.42565 9.99273 7.13711 -0.000486214 -0.000561279 0.000125103 0.00294183 0.00125638 0.00552879 +241 2.84613 8.56345 5.70407 -0.00030018 -0.000422489 -1.95726e-06 0.0040597 2.86589e-05 0.00695319 +242 4.27553 9.99386 7.12984 0.00318086 -0.00397353 0.00174378 -0.00647352 0.00173177 -0.000161503 +243 5.6675 8.56382 5.67559 0.00556806 -0.00129427 0.00205508 0.00408505 -0.00537023 0.00707928 +244 7.09459 10.0252 7.09178 0.0144396 -0.0172848 0.0168669 -0.0235853 -0.0176226 -0.0323251 +245 8.5354 8.54154 5.70435 0.0166555 0.00784359 0.00697515 -0.00691408 -0.00153326 -0.00555498 +246 9.99561 9.96856 7.06132 -0.00131089 0.0105194 0.0326958 0.0107312 -0.00874402 -0.0527475 +247 11.4469 8.54336 5.70169 -0.0251483 0.0101391 0.0075637 0.0228577 -0.00467938 -0.00503128 +248 12.8974 10.0223 7.08287 -0.0275056 -0.020961 0.0239938 0.00637568 0.0183183 0.000720603 +249 14.3157 8.56335 5.67387 -0.0192771 -0.0012969 0.0117611 -0.0116046 0.0044324 0.018087 +250 15.7212 9.98736 7.11722 0.00505532 -0.0150564 -0.00741972 0.00370221 0.0226134 0.00525911 +251 17.1433 8.56006 5.69924 0.00122331 -0.00488374 -0.00206741 -0.00494048 0.00613051 0.00647934 +252 18.5616 9.99246 7.13525 -0.000343311 -0.00121276 0.000463586 0.000635226 0.00391128 0.00166213 +253 0.0014156 11.4215 5.70849 0.000292242 -0.000872581 -0.000110635 0.00380882 0.000604779 0.00315787 +254 1.42693 12.8486 7.13934 0.000206059 4.35522e-05 -4.59091e-05 0.00352099 -0.000413879 0.0035957 +255 2.84964 11.4234 5.70789 0.0012432 -0.00134375 0.00136535 0.00327831 0.000421859 0.00311218 +256 4.28037 12.847 7.14064 0.00194037 -2.1285e-05 -0.00036756 -0.00684748 0.00643228 -0.00252806 +257 5.68761 11.4352 5.69133 0.00546558 -0.00680433 0.00510715 0.00835855 0.00655669 0.00688853 +258 7.14648 12.8334 7.15265 0.00235524 -0.00347585 -0.000670638 -0.0243346 0.0314943 -0.0206838 +259 8.56323 11.419 5.71594 -0.00141734 -0.0046737 0.00152466 -0.00147032 0.0140721 -0.00865765 +260 9.99608 12.8219 7.1582 -0.00265189 0.000813312 -0.014177 0.0148758 -0.0353675 0.066387 +261 11.4282 11.4217 5.713 -0.00278249 -0.00359776 0.0062043 0.00930136 0.0178369 0.000979344 +262 12.8593 12.8497 7.12552 0.00115268 0.00290809 -0.0264569 0.00688917 0.00926674 -0.00178123 +263 14.3034 11.4362 5.68706 -0.00858977 -0.00942018 0.0114753 0.00663794 0.0148827 -0.00177059 +264 15.7271 12.8522 7.11767 0.0188528 -0.00113905 -0.0242895 0.00463499 0.0114644 0.00110415 +265 17.145 11.4214 5.69882 0.00429823 -0.00625834 -0.0051376 0.00224912 0.0078601 0.000133193 +266 18.5632 12.8507 7.13557 0.000486384 8.14409e-05 -0.00160274 0.00571553 0.00142712 -0.000847753 +267 0.00306628 14.2786 5.70933 0.000763734 0.000375669 -0.00045407 0.00547017 0.00043761 0.00248471 +268 1.4277 15.706 7.13795 0.00142855 -0.00133129 0.00167504 0.0043951 0.00109321 0.00211408 +269 2.85459 14.2767 5.71193 0.001022 -0.000263244 0.000727594 0.00135816 0.00127745 0.00167853 +270 4.27814 15.7088 7.13409 0.00527575 -0.00562947 0.00537185 -0.00123609 0.00642308 -0.00168056 +271 5.71344 14.2709 5.71597 0.000769607 -0.000915813 2.71344e-05 -0.00170906 0.00993213 -0.00252007 +272 7.13953 15.7026 7.13829 -0.000926671 -0.00130405 0.000736457 0.00873922 0.00626496 0.00131232 +273 8.5693 14.2682 5.71799 -0.00284736 0.00095097 -0.00410802 0.0169682 -0.00830747 0.0155794 +274 9.98891 15.709 7.13327 -0.011034 0.0119612 -0.013644 0.0126961 -0.00435768 0.0112137 +275 11.419 14.2729 5.71687 -0.000329444 0.00404031 -0.00150054 -0.00213053 0.000706709 0.000431755 +276 12.854 15.7234 7.11684 -9.60462e-05 0.0195294 -0.022737 0.00184826 -0.00428166 0.00774908 +277 14.2854 14.283 5.70535 0.00423008 0.00473106 -0.00593716 0.00888887 0.0123921 -0.0222524 +278 15.7343 15.7337 7.10897 0.0188303 0.0185381 -0.0191992 -0.0108443 -0.00700575 0.0127214 +279 17.1453 14.2829 5.69922 0.00777179 0.00269832 -0.00901222 0.00373286 0.0062868 0.00186393 +280 18.5656 15.7106 7.13384 -2.51162e-06 0.000549913 8.34881e-05 0.00888233 0.00615417 -0.00346925 +281 0.00406177 17.1354 5.70824 0.00116733 0.000229995 0.000763543 0.00716025 0.00347941 0.00193804 +282 1.42837 18.5598 7.1384 0.00109064 -0.00154342 0.00212352 0.00453921 0.00364583 0.00349336 +283 2.85511 17.1337 5.70952 0.00175638 -0.00208636 0.00259274 0.00209711 0.00311239 0.00265305 +284 4.28405 18.5579 7.13978 0.000564665 -0.00184676 0.00192981 0.00258787 0.00250409 0.00370164 +285 5.71203 17.1306 5.71193 -0.000798408 -0.00078336 0.00077256 0.0036742 0.00263919 0.00297173 +286 7.1392 18.5577 7.14081 -0.00115096 -7.58402e-05 0.000445397 0.0043359 0.00187941 0.0031406 +287 8.56409 17.1329 5.71022 -0.00539905 0.0043759 -0.00464991 0.0085252 -0.000106944 0.00555443 +288 9.99307 18.5592 7.14017 -0.000365155 0.000553775 -0.00085965 0.00751465 0.00034577 0.00415648 +289 11.4175 17.1372 5.70597 -0.00347169 0.00696095 -0.00734873 0.0052957 0.00100514 0.00432038 +290 12.8498 18.5617 7.13592 0.000371504 0.000603594 -0.00119617 0.00288433 0.00402986 0.000357505 +291 14.2816 17.1433 5.69913 0.00357811 0.00837323 -0.008688 0.00293562 0.00232328 0.00378754 +292 15.7101 18.5652 7.13291 0.00127685 0.000141644 1.60884e-05 0.00016509 0.00204609 0.00282469 +293 17.1464 17.1464 5.69676 0.00823059 0.0080179 -0.00745967 0.000614861 0.000157205 0.00628972 +294 18.5648 18.5638 7.13648 0.00106585 0.000796796 0.00173381 0.0075984 0.00613661 -0.00104016 +295 0.00151496 19.9867 8.56686 0.000273626 0.000272868 0.00102374 0.00469268 0.00407909 0.00315584 +296 1.42508 1.42384 9.99627 -1.65638e-05 0.000298516 -7.52155e-06 0.00366937 0.00396842 0.00386419 +297 2.85497 19.9847 8.56753 0.000289798 -0.000965174 0.000951267 0.00367931 0.00255054 0.0050966 +298 4.28088 1.42361 9.99603 -1.85446e-05 -0.000355332 -6.91247e-05 0.00389319 0.00248694 0.00502951 +299 5.71114 19.9847 8.56813 -5.98489e-05 -0.00097786 0.000805218 0.00317078 0.00200058 0.00407961 +300 7.13827 1.42706 9.9941 1.01668e-05 -0.000910996 3.28783e-05 0.00356984 0.00188351 0.00489834 +301 8.56629 19.9859 8.56778 6.89853e-05 -0.000898314 0.000307983 0.0039382 0.00206645 0.00295343 +302 9.99375 1.4292 9.99167 -0.000192253 -0.00145595 0.000254012 0.00347297 0.00264324 0.00338512 +303 11.422 19.9867 8.5663 9.77871e-05 -0.00128148 0.000187383 0.00402715 0.00312167 0.00177867 +304 12.8487 1.4287 9.99278 -0.000966338 -0.00047933 -0.000108842 0.00303062 0.00229043 0.00274571 +305 14.2781 19.9879 8.5646 -0.000221771 -0.000703949 0.000171199 0.0024792 0.00491452 0.00113067 +306 15.7049 1.42646 9.995 -0.00198756 0.000641175 -0.000100228 0.00318304 0.00328412 0.00185496 +307 17.1341 19.9881 8.5661 -0.00118317 -0.000245848 0.00144377 0.00494254 0.00519934 2.71302e-05 +308 18.561 1.42562 9.9959 -0.00191422 0.00128271 -0.000104477 0.00367108 0.00365484 0.00260043 +309 -0.00154693 2.85178 8.56743 -0.00133784 0.000759441 0.000647238 0.00347103 0.00526525 0.0049604 +310 1.42217 4.2785 9.99597 -0.000789874 0.000329864 3.2615e-05 0.00299947 0.00628685 0.00443078 +311 2.84605 2.84521 8.56794 0.00038274 0.000659006 -0.00011424 0.00439037 0.00554022 0.00680772 +312 4.26501 4.26584 10.0006 0.00104077 0.000964405 -0.00179607 0.0066187 0.00642182 0.00542361 +313 5.70359 2.84893 8.56603 0.000584695 -0.000481049 4.00548e-05 0.00393846 0.00384007 0.00708141 +314 7.13045 4.28031 9.99272 0.0015817 0.00164266 -0.00173595 0.00563004 0.00305609 0.00854156 +315 8.56053 2.85598 8.56163 -7.54446e-06 -0.00209021 -0.000242789 0.00326393 0.0023853 0.00583947 +316 9.99012 4.28274 9.9819 -0.00389984 0.00133485 0.00148735 0.00818659 0.010009 0.00388801 +317 11.4234 2.85756 8.56164 -0.00254569 -0.000932368 0.000644489 0.0036097 0.0016139 0.00274319 +318 12.8518 4.28351 9.99085 -0.00708019 0.00549538 -0.001547 0.00642971 -0.00143423 0.00691256 +319 14.2806 2.85211 8.56471 -0.00359182 0.00191386 0.000512088 0.00275801 0.0030065 0.00195252 +320 15.7148 4.27206 10 -0.00877283 0.0079981 -0.0026265 0.00127181 0.00156489 -0.0010879 +321 17.1373 2.84887 8.56767 -0.00465385 0.00391196 0.000345773 0.00376631 0.00264653 0.00252995 +322 18.5592 4.28096 9.99591 -0.00279659 0.0019302 -0.000204822 0.00142902 0.00403303 0.00198944 +323 -0.00250389 5.70808 8.56673 -0.00157057 0.000557128 0.000867224 0.00125024 0.00583332 0.00442629 +324 1.42384 7.13643 9.99442 -0.000921574 0.000107118 -0.000107663 0.0023018 0.00524253 0.0047695 +325 2.84473 5.70181 8.56541 -0.000590472 -0.000352429 3.32148e-06 0.00564505 0.00672242 0.00710915 +326 4.27238 7.12626 9.99578 0.00243072 0.00142232 -0.00409258 0.00381393 0.00356307 0.0101449 +327 5.66379 5.67013 8.56343 0.00427398 0.000609389 -0.00212772 0.014975 0.0146593 0.0103343 +328 7.0835 7.07985 10.0252 0.0080691 0.0126475 -0.0167897 0.0161547 0.0106873 0.010852 +329 8.52987 5.69661 8.53691 0.0122722 0.000808532 0.00163692 0.00468351 0.000594188 0.00982411 +330 9.98155 7.05425 9.94841 -0.0189574 0.0444942 -0.0192556 0.0224789 0.0433221 0.00819601 +331 11.4459 5.7031 8.54093 -0.0273668 0.00762551 0.00906892 0.0200177 -0.00814391 -0.00185016 +332 12.8977 7.0888 10.0145 -0.0286028 0.0315026 -0.0282536 -0.0221706 0.0213147 0.0147435 +333 14.3154 5.67732 8.56157 -0.0187766 0.0135338 -0.0016061 -0.0169321 0.0229894 0.00646994 +334 15.7037 7.13645 9.99678 -0.0159685 0.0126112 -0.000125191 0.0166415 -0.00755156 0.00289601 +335 17.1352 5.70697 8.56632 -0.00603624 0.00488478 0.00210074 0.000613755 0.0021252 -0.0017517 +336 18.557 7.13856 9.99474 -0.0027408 0.00154999 0.000810557 -0.000220234 0.0037477 0.00174239 +337 -0.00212376 8.56479 8.5656 -0.00119637 -0.000187028 0.000421942 0.000848837 0.00419885 0.00420508 +338 1.4258 9.99322 9.99389 -0.000995609 -0.00058127 -0.000586461 0.00218967 0.00299511 0.00461539 +339 2.84757 8.56127 8.56306 -0.00111346 -0.00228603 -0.00216221 0.00818044 0.00506738 0.00937614 +340 4.28735 9.98746 9.99151 -0.00391015 -0.00594361 -0.00531667 -0.00216559 0.0120191 0.0126999 +341 5.65677 8.54528 8.54855 0.00916494 -0.0152824 -0.0155617 0.0119895 0.0116217 0.0118469 +342 7.16728 9.96312 9.97425 -0.0584925 -0.0495249 -0.0469838 -0.0492115 0.0300285 -0.00316273 +343 8.21067 8.38648 8.39718 0.123151 -0.0234659 -0.0136653 0.0674872 0.034394 0.0261682 +344 9.96626 9.32695 9.30023 -0.0892576 0.233838 0.143721 -0.0448785 0.245445 0.0491522 +345 11.7487 8.40368 8.40163 -0.201495 0.0245422 0.0272602 -0.0266792 0.0856877 0.0792402 +346 12.7895 10.001 9.98895 0.00129475 0.00820171 -0.00799408 0.0899892 0.0242569 0.00661116 +347 14.3143 8.56199 8.55455 -0.038955 0.00537333 0.000942862 0.0220394 0.00497995 0.00486552 +348 15.6978 9.99473 9.98831 5.895e-05 -0.00310296 -0.0035273 0.0120138 0.0175516 0.0160484 +349 17.1348 8.56359 8.56309 -0.00349064 -0.00161499 0.000262268 0.00108143 0.00675155 0.00173162 +350 18.5556 9.99576 9.99342 -0.00252126 0.000483238 -0.00022885 0.000686989 0.00455185 0.00215187 +351 -0.00132574 11.4213 8.56631 -0.000983572 -4.49747e-05 -0.000274864 0.00265699 0.00137552 0.00249317 +352 1.42629 12.8493 9.99431 0.000522513 -0.00157227 -0.000193923 0.00297646 0.00125986 0.00341882 +353 2.85404 11.4186 8.56775 -0.000257934 -0.000475716 -0.00144593 0.00247938 0.00215228 0.00506588 +354 4.28053 12.8528 9.99302 0.00925433 -0.00885366 0.000775605 -0.00678958 0.00874612 0.00410413 +355 5.70507 11.4136 8.57147 3.3866e-05 -0.000832131 -0.00835909 -0.0178692 0.0130043 -0.0092421 +356 7.10701 12.8905 9.96761 0.0409743 -0.0461276 0.01467 -0.0467913 0.0351348 -0.00413059 +357 8.60294 11.3881 8.64515 0.00571518 0.0097701 0.0174942 -0.12959 0.0209366 -0.17412 +358 10.0138 12.9425 10.015 0.0178469 -0.0640483 -0.0273004 -8.68168e-05 -0.184054 0.0142559 +359 11.4245 11.404 8.61006 0.00967999 0.0193984 0.0177716 0.00720077 -0.0185064 0.0299563 +360 12.9666 12.9702 9.8333 0.0841395 0.0739857 -0.224623 -0.0228073 -0.0351395 0.0493747 +361 14.3105 11.4083 8.54241 0.029317 -0.0226003 -0.0395936 -0.00288976 0.025456 0.0310882 +362 15.7128 12.8678 9.98055 -0.0151323 -0.00283499 -0.00714669 0.0469253 0.0214158 -0.00410787 +363 17.1335 11.4221 8.56269 -0.00251234 0.000943429 -0.00202031 0.00578277 0.00720505 -0.000524806 +364 18.5577 12.8528 9.99246 -0.00303367 -0.000442547 -0.00122512 0.00937188 0.00460488 0.00110861 +365 0.000285193 14.2785 8.56552 -0.000273516 -0.000667919 0.000230511 0.00604876 0.00203069 0.000623738 +366 1.42622 15.7054 9.99448 0.00163542 -0.00295488 0.00108284 0.00406791 0.000760476 0.00205394 +367 2.85224 14.2779 8.56563 0.00346116 -0.00323232 0.00242948 0.00247237 0.00259267 0.00221882 +368 4.27536 15.7111 9.9908 0.0101435 -0.0105358 0.00419533 -0.00164567 0.00663313 0.00307873 +369 5.69621 14.2898 8.55387 0.0151268 -0.0146956 0.0101349 -0.00819417 0.0166997 -0.00622918 +370 7.14106 15.6996 9.99891 0.00907435 -0.00827711 0.00238464 -0.00262213 0.0170903 -0.0018804 +371 8.56755 14.2758 8.56294 0.000944155 0.00163289 -0.00521624 0.00566545 0.0043441 0.011105 +372 9.99932 15.7052 10.0028 0.0013816 -0.0135979 -0.00368624 0.00374536 -0.0146077 0.00632618 +373 11.4225 14.301 8.54252 -0.0259035 0.031157 -0.0346275 -0.00732484 -0.0183863 0.0171478 +374 12.8699 15.7186 9.98128 0.00350726 -0.0151838 -0.0103013 -0.0180528 -0.0878994 0.0466637 +375 14.3381 14.336 8.50604 0.0443031 0.0430587 -0.0528386 -0.00308849 -0.0054873 0.0202043 +376 15.7206 15.7211 9.9958 -0.00344597 -0.00432228 0.0124922 0.0278351 0.0272464 -0.023389 +377 17.139 14.2868 8.55783 -0.00258596 -8.02687e-05 -0.00151239 0.0264936 0.0134701 -0.00999275 +378 18.5618 15.7073 9.99448 -0.00241748 -0.00300429 0.00136448 0.0100247 0.010328 -0.00241767 +379 0.0016734 17.1338 8.56639 0.000313136 -0.00164006 0.00168169 0.00661101 0.00378211 0.000143403 +380 1.42762 18.5602 9.99474 0.00142777 -0.00217636 0.000940593 0.00295861 0.00255243 0.0019616 +381 2.85325 17.134 8.56538 0.00357835 -0.00445773 0.00318297 0.0018326 0.00279316 0.00202008 +382 4.28357 18.5585 9.99498 0.00127246 -0.00232097 0.000849569 0.00342527 0.00100571 0.00283868 +383 5.71258 17.13 8.5679 0.00251368 -0.003482 0.00290416 0.00206194 0.00336897 -0.000186831 +384 7.14072 18.5564 9.99637 0.000796274 -0.00139034 0.000651283 0.00314808 0.00290735 0.00196827 +385 8.56751 17.1279 8.56978 -0.000307092 0.00177976 -0.000201079 0.00849308 0.00381289 0.0025712 +386 9.99648 18.5561 9.99613 0.0013868 -0.00292496 -0.000544731 0.00596592 0.0015459 0.00242138 +387 11.4236 17.1302 8.56544 0.00109886 -0.00185753 -0.000764565 0.0152679 -0.00458579 0.0115556 +388 12.8527 18.5593 9.99264 0.000781456 -0.00391874 -0.00112273 0.00301917 -0.000193671 0.00372558 +389 14.2873 17.139 8.55677 0.00165819 -0.00170091 -0.00203229 -0.0101645 0.00412463 0.0112499 +390 15.707 18.5632 9.99368 -0.00262134 -0.00329182 0.00185178 0.00625619 0.00612527 -0.00170559 +391 17.1415 17.1418 8.56387 0.00088757 0.000436728 0.00411845 0.011174 0.0120692 -0.010337 +392 18.5642 18.5644 9.99401 0.000743604 0.000226483 0.000921698 0.0054673 0.00475863 -7.88139e-07 +393 0.00124759 0.000815388 11.4233 0.000332227 8.02598e-05 -0.000350697 0.00356029 0.00305391 0.00134018 +394 1.42574 1.42555 12.8519 -0.000100762 9.40954e-05 -0.00108245 0.00294758 0.00344981 9.62385e-05 +395 2.85511 -0.00151506 11.4232 0.000435677 -0.00115725 -0.000283779 0.00337568 0.00141897 0.00223301 +396 4.28253 1.42523 12.8507 -2.83992e-05 -0.000471108 -0.00115229 0.00282159 0.00190506 0.0019797 +397 5.71193 -0.00142742 11.4222 0.000308112 -0.00100176 -0.000363235 0.00352525 0.000673896 0.00360506 +398 7.14021 1.42786 12.8478 -0.00016303 -0.000951605 -0.000678747 0.00353003 0.00183536 0.00377689 +399 8.56814 -0.00112058 11.4211 0.0010137 -0.00152652 -0.000337473 0.00372142 0.00226978 0.00345942 +400 9.9939 1.42956 12.8462 -0.000206099 -0.00110026 0.000191779 0.00315083 0.00163073 0.00519141 +401 11.4229 -0.000454533 11.4212 0.000513782 -0.00190989 -0.000103737 0.00399607 0.00306864 0.0032915 +402 12.847 1.42936 12.8487 -0.000329665 -0.000547926 -0.000580365 0.00259709 0.00239324 0.00524038 +403 14.2764 0.000818757 11.4223 -0.00156068 -0.00172998 -0.000295038 0.00432198 0.00464569 0.00237783 +404 15.7033 1.4281 12.8507 -0.00169434 0.000547123 -0.00184719 0.00370631 0.00257582 0.00409522 +405 17.1331 0.00193834 11.4229 -0.00141025 -0.000249861 -0.000421036 0.00418574 0.00421726 0.00173903 +406 18.5603 1.42727 12.8517 -0.00170501 0.000964848 -0.00156671 0.00357391 0.00343495 0.00124162 +407 -0.00206847 2.85337 11.4239 -0.0014198 0.000836658 -0.000529309 0.00234146 0.00471122 0.00170101 +408 1.4227 4.28055 12.8513 -0.000627154 0.000607547 -0.00120513 0.00204755 0.0050601 0.0011141 +409 2.84791 2.84776 11.4263 8.59973e-05 0.000422696 -0.00112416 0.00387171 0.00473802 0.00286298 +410 4.27116 4.27215 12.8575 0.000584855 0.000563692 -0.00345156 0.00444895 0.00450597 0.00349648 +411 5.70805 2.85171 11.4237 0.000376865 -0.00016989 -0.00130842 0.00440819 0.00297902 0.00568892 +412 7.13742 4.28255 12.8501 0.000823972 0.00143908 -0.00347509 0.00743946 0.00534421 0.00616445 +413 8.56567 2.85942 11.4182 -0.000728806 -0.00193903 3.5161e-05 0.00574171 0.00312331 0.00456024 +414 9.99111 4.28951 12.8447 -0.00326903 0.000197166 0.000442623 0.00636924 0.00180663 0.00756148 +415 11.4195 2.8603 11.4178 -0.00154383 -0.0013468 9.47356e-05 0.0029204 0.00165586 0.00439909 +416 12.8463 4.28471 12.849 -0.00316446 0.00328968 -0.00416799 0.00315557 0.000681783 0.00957138 +417 14.2758 2.8548 11.4225 -0.00301064 0.0019393 -0.00218986 0.00317987 0.000776882 0.00536089 +418 15.7087 4.27812 12.855 -0.0070104 0.0064288 -0.00638091 0.00333271 -0.00135025 0.00698416 +419 17.1347 2.85126 11.4255 -0.0040734 0.00327317 -0.00213422 0.00211353 0.00250301 0.00230112 +420 18.558 4.28306 12.8507 -0.00306152 0.00211201 -0.0018424 0.00240462 0.00243866 0.00199401 +421 -0.00326044 5.71039 11.4225 -0.00158353 0.000875521 -0.00033965 0.000642728 0.00517286 0.00221587 +422 1.42333 7.13894 12.8491 -0.000723538 3.69874e-05 -0.000372602 0.00167805 0.00506488 0.00130542 +423 2.84655 5.70541 11.4248 0.000356042 0.000791275 -0.00161526 0.00384567 0.00512191 0.00541445 +424 4.27388 7.13547 12.8511 1.52185e-05 -0.00191349 -0.000147469 0.0089517 0.00699653 0.00443401 +425 5.68317 5.68606 11.4384 0.00281777 0.00219074 -0.00750786 0.00755254 0.00493886 0.00634306 +426 7.13242 7.1412 12.8434 -0.00544051 -0.0074354 -0.00390422 0.0158535 0.0114603 -0.00559265 +427 8.56176 5.71643 11.4214 0.00206795 0.0053365 -0.00849781 0.0103721 0.00246458 0.00444479 +428 9.98583 7.17053 12.8308 -0.0188601 -0.0199855 0.0264158 0.0130308 -0.0149367 0.010893 +429 11.4188 5.7151 11.4189 -0.0127803 0.00200144 -0.00802172 0.0105845 -0.00620223 0.0105931 +430 12.851 7.14406 12.8449 0.00359525 -0.0103824 0.0046727 0.0183972 -0.0143502 0.0142005 +431 14.2924 5.69646 11.4352 -0.0163815 0.0139544 -0.0124032 0.00843796 -0.00492148 0.00202475 +432 15.7003 7.14601 12.8478 -0.0101437 0.00527728 -0.00582501 0.0186312 -0.0118035 0.00794291 +433 17.1318 5.71102 11.4241 -0.00575257 0.00418899 -0.00290004 0.00503829 -0.00267834 0.00324773 +434 18.5564 7.14119 12.8481 -0.00330788 0.00130594 -0.00131594 0.00102307 0.00349446 0.00296251 +435 -0.00344302 8.56813 11.4212 -0.00166206 0.000416179 -0.000217177 0.000237383 0.00394061 0.00210172 +436 1.42473 9.99434 12.8504 0.000134776 -8.78533e-05 -0.00144457 0.00177008 0.00236983 0.0027572 +437 2.85196 8.56581 11.421 -0.00053764 -0.00159586 -0.000283656 0.00412608 0.00444764 0.00518733 +438 4.27641 9.98921 12.8593 0.00707188 -0.000783227 -0.0059639 0.00333952 0.00350347 0.00576136 +439 5.69994 8.56447 11.4203 -0.000856534 -0.00955069 0.000187173 0.00434085 0.00770599 0.00748263 +440 7.0918 9.95812 12.9145 0.0200555 0.00499029 -0.0198722 0.0183235 0.00565955 -0.030547 +441 8.5818 8.61273 11.4024 0.00233986 0.00175679 0.0175683 0.0569648 0.0231599 -0.0298735 +442 9.98221 9.99539 13.0479 -0.0898391 -0.0976471 0.174071 -0.134608 -0.051649 0.0156257 +443 11.4155 8.55204 11.3898 -0.00704511 -0.100852 0.0109473 -0.00660651 0.0407909 0.0239107 +444 12.8122 10.0024 12.8537 -0.123743 0.061535 -0.09985 0.27976 -0.0736522 0.150786 +445 14.2692 8.58987 11.4189 -0.0372033 0.0212214 0.000294632 0.0283183 -0.0281746 0.00133495 +446 15.7024 9.99643 12.8565 -0.0131993 0.00256411 -0.0111224 0.0299135 0.00643729 0.0125926 +447 17.1272 8.57126 11.4202 -0.00650762 0.00141157 -0.000320237 0.00539407 0.00228544 0.00410404 +448 18.5556 9.99699 12.8501 -0.00350403 0.000852669 -0.00204753 0.00339582 0.00336331 0.00414562 +449 -0.00297007 11.4235 11.4223 -0.00148403 -0.000154001 -0.000868659 0.00235166 0.00213289 0.00274789 +450 1.42534 12.8505 12.8516 0.00141456 -0.002146 -0.00196427 0.00329164 0.00139432 0.00331222 +451 2.85213 11.4204 11.4227 0.00307181 -0.00252114 -0.00190772 0.00308733 0.00424019 0.00703877 +452 4.27372 12.8556 12.8585 0.0170089 -0.0104615 -0.00999947 0.00722173 0.00302617 0.00717312 +453 5.6706 11.418 11.4264 0.0218696 -0.0142414 -0.0106107 0.0105404 0.019058 0.0121794 +454 7.06123 12.9195 12.9257 0.0686133 -0.0700624 -0.0689988 -0.051952 0.0770171 0.0649432 +455 8.22958 11.5201 11.5302 0.158043 -0.145552 -0.136533 0.0705563 -0.0190742 -0.0403605 +456 10.0104 12.8005 12.8223 -0.00371821 -0.00688657 0.0238967 -0.0420465 0.0464171 -0.0113306 +457 11.9793 11.8351 11.521 0.206369 0.391714 -0.0973199 -0.166884 -0.262884 0.155892 +458 13.0121 13.0222 13.0857 0.0338485 0.0470795 0.174766 -0.0620389 -0.0949959 -0.121806 +459 14.3453 11.4428 11.4239 -0.00630605 0.000295587 -0.0133082 -0.0351906 0.00514225 0.00948196 +460 15.7111 12.8695 12.871 -0.0126062 3.15156e-06 0.00512865 0.0610617 0.0197977 0.015413 +461 17.132 11.4285 11.4228 -0.00618994 0.00217916 -0.00171905 0.00765107 0.00840437 0.00479248 +462 18.5572 12.8538 12.8538 -0.00290221 -0.00102435 -0.000365585 0.00953353 0.00513485 0.00394928 +463 -0.00147547 14.2777 11.4229 -0.000865872 -0.0023052 -0.000402837 0.00559846 0.00374866 0.0018712 +464 1.42548 15.7067 12.851 0.00198372 -0.00342312 -0.00193984 0.00336247 0.000517137 0.00293893 +465 2.85097 14.2785 11.4229 0.00529541 -0.00572844 -0.00097475 0.00478939 0.00182929 0.00539088 +466 4.27137 15.7149 12.8542 0.013506 -0.0136733 -0.00636482 -0.00623279 0.0110868 0.00387031 +467 5.68303 14.2983 11.4231 0.0295592 -0.0271282 -0.00390364 0.00721951 0.00476884 0.00758346 +468 7.13303 15.7052 12.8575 0.0137116 -0.0148088 -0.0130809 -0.00232368 0.0280404 0.0158127 +469 8.55795 14.268 11.4449 0.039076 -0.03837 -0.0180368 -0.0138542 0.0126945 -0.0104813 +470 9.9991 15.6977 12.8526 -0.00295188 -0.00706929 -0.00193027 -0.00566974 0.0265938 0.00750147 +471 11.4789 14.3259 11.4464 -0.00351251 0.0362861 -0.0141346 -0.0423803 -0.0471389 0.0045108 +472 12.8778 15.7268 12.8791 -0.00250931 -0.0253285 0.00293431 -0.00565292 -0.0243254 -0.0128009 +473 14.2868 14.2833 11.4264 -0.0563512 -0.058539 0.00263706 0.120301 0.0973938 0.00461791 +474 15.7269 15.7286 12.852 -0.00540328 -0.00640837 -0.0114294 0.0209031 0.023536 0.0246546 +475 17.1318 14.2814 11.4247 -0.00962278 -0.00755391 -0.0011926 0.0305735 0.0238345 0.00080558 +476 18.5621 15.7088 12.8521 -0.00261771 -0.00341148 -0.00222107 0.00857554 0.00942248 0.00594391 +477 0.00112373 17.1342 11.4227 0.000468947 -0.00211135 -0.000154857 0.00496945 0.00294621 0.00166371 +478 1.42739 18.5615 12.8506 0.00162362 -0.00259068 -0.00109273 0.0021929 0.00249621 0.000819594 +479 2.85213 17.1349 11.422 0.0046082 -0.00560593 0.000142559 -0.000578139 0.00369273 0.00131503 +480 4.28318 18.5599 12.8502 0.00174376 -0.00279252 -0.00168024 0.00248753 0.000572658 0.00275572 +481 5.71036 17.1313 11.4231 0.0042304 -0.00443416 -0.00100691 0.000915444 0.00245622 0.00339509 +482 7.13958 18.5584 12.8494 0.0016 -0.00236938 -0.00259976 0.00292475 0.00253273 0.00562229 +483 8.56845 17.1259 11.4261 0.00440054 -0.00324524 -0.00278946 0.00254175 0.0100241 0.00141545 +484 9.99636 18.557 12.8495 0.000791152 -0.00308665 -0.000501058 0.00485827 0.00565929 0.00454526 +485 11.4315 17.1315 11.4268 0.00263315 -0.00132003 -0.00125984 0.00776343 0.00101825 0.00139036 +486 12.8533 18.5613 12.8543 -0.000136291 -0.00491699 -5.51855e-05 0.004796 0.00494836 0.00403075 +487 14.2835 17.1351 11.4244 -0.00757968 -0.0109835 0.000355858 0.00571708 0.0126076 -0.00329959 +488 15.7077 18.5651 12.8521 -0.00277919 -0.00363478 -0.00222256 0.00559088 0.00542719 0.00416819 +489 17.1427 17.1439 11.4219 0.000982284 0.000331555 0.000380918 0.00964239 0.0111374 0.00172818 +490 18.5646 18.566 12.851 0.000688304 -5.54076e-05 -0.00106108 0.00557764 0.00479304 0.00256129 +491 0.00165724 0.00256297 14.279 0.000396184 -0.000289931 -0.00175543 0.00407675 0.00361814 0.000432025 +492 1.4273 1.4275 15.7056 -0.000244595 -0.000194266 -0.0019074 0.00302279 0.00388245 -0.00119338 +493 2.85576 0.000182233 14.2779 0.000551668 -0.00147942 -0.0017375 0.00196191 0.00189219 -0.000123148 +494 4.28401 1.42715 15.7038 -0.000474304 -0.000916097 -0.00167147 0.000822531 0.00277298 -0.00025638 +495 5.71224 5.23408e-05 14.2762 0.000276677 -0.00142549 -0.00180973 0.00145222 0.000995634 0.00258592 +496 7.13964 1.42841 15.7026 -0.00117954 -0.00122541 -0.000337178 0.000388891 0.00225945 0.00258997 +497 8.56732 0.00038323 14.2749 -0.000266595 -0.00120486 -0.000837497 0.0025488 0.0022859 0.00555257 +498 9.99275 1.42959 15.7029 -0.000168717 -0.000830952 -0.000454169 0.000732191 0.00222942 0.00630337 +499 11.4206 0.00128643 14.2768 0.000223049 -0.00141545 -0.000677136 0.00368945 0.00409619 0.00696187 +500 12.8463 1.43053 15.704 0.000262668 -0.000375268 -0.000801342 0.002855 0.00282428 0.00715495 +501 14.2771 0.00335754 14.28 -0.000219072 -0.000851645 -0.000903129 0.00458906 0.00487954 0.00562753 +502 15.7034 1.43046 15.7058 -0.000226953 0.000198474 -0.00168838 0.00511613 0.00353448 0.00509502 +503 17.1335 0.00395395 14.2793 -0.00126716 -0.000677973 -0.00214476 0.00560717 0.00445673 0.00378553 +504 18.5602 1.42931 15.7058 -0.00107565 0.000534798 -0.00243327 0.00563245 0.00398857 0.00156311 +505 -0.00187122 2.85497 14.278 -0.00133248 0.000810497 -0.00169312 0.00305944 0.0039622 -0.000278615 +506 1.42449 4.28183 15.704 -0.00118023 3.02691e-05 -0.00121764 0.00265181 0.00526106 -0.00173965 +507 2.85086 2.8509 14.2801 -0.000262752 9.45881e-05 -0.00192875 0.00232273 0.00398297 -0.000317875 +508 4.28002 4.28021 15.7045 -0.00253461 -0.00229238 -0.00035404 0.00358807 0.00565755 -0.00170964 +509 5.71087 2.85387 14.2768 -0.000294985 -0.000303714 -0.00183744 0.00299686 0.0030661 0.00215972 +510 7.13755 4.28345 15.7032 -0.00435494 -0.00441281 0.00350348 0.00576153 0.00717228 -0.000766317 +511 8.56686 2.8576 14.2746 -0.00160323 -0.00137413 0.000419479 0.00309514 0.00248759 0.0043399 +512 9.99226 4.28575 15.7025 -0.000480425 -0.00234736 0.00168173 0.00152308 0.003895 0.00376982 +513 11.4183 2.85879 14.2742 -0.000150176 -0.000245562 -0.000791741 0.00197524 0.00138131 0.00706311 +514 12.8456 4.28649 15.7014 0.000821481 -0.00128721 -7.63716e-05 2.4777e-05 0.00194977 0.00616368 +515 14.2742 2.85657 14.2769 -0.00095819 0.0013475 -0.00251066 0.0025899 0.000820913 0.00692925 +516 15.7028 4.28421 15.7034 -0.000608667 0.000833613 -0.00141231 0.00301494 0.000588729 0.00644793 +517 17.1324 2.85428 14.2792 -0.00302357 0.00245828 -0.00338386 0.00410562 0.00169954 0.00370913 +518 18.5572 4.28424 15.7032 -0.00213159 0.00139399 -0.00196999 0.00444122 0.0024886 0.00159078 +519 -0.0033298 5.71153 14.2761 -0.00168351 0.000708018 -0.00125094 0.00159189 0.00454383 0.000155559 +520 1.4229 7.13632 15.7058 -0.000198163 0.000902795 -0.00184771 0.00167611 0.00351056 -0.000125444 +521 2.84911 5.70827 14.278 -0.000696317 -0.000515701 -0.000838595 0.0038761 0.00606048 -0.00012165 +522 4.2698 7.12716 15.7152 0.00017895 0.000676944 -0.00191642 0.00842064 0.0063223 -0.00239996 +523 5.70534 5.70803 14.2763 -0.00425667 -0.00493144 -0.000634212 0.00865408 0.00776374 -0.000350709 +524 7.12354 7.12356 15.7193 -0.0221058 -0.0198442 0.0200263 0.0103443 0.00559002 0.00225017 +525 8.56521 5.71626 14.2734 -0.00887462 -0.00801137 0.00933377 0.011219 0.0150076 0.00154186 +526 9.99156 7.1327 15.7135 0.00283656 -0.0133616 0.014661 0.0212787 0.0174924 -0.00143625 +527 11.4153 5.71868 14.2697 -0.000545975 -0.00310698 0.00234401 0.0037299 0.0119605 0.00768432 +528 12.8564 7.13141 15.7124 0.00267815 -0.00288236 0.00189108 -0.0190312 0.0165616 -0.00341241 +529 14.2759 5.71267 14.2752 -6.55512e-05 0.000206646 6.89523e-05 0.00411818 0.000968891 0.0113406 +530 15.7025 7.14049 15.7045 -0.0108045 0.0104303 -0.0103689 0.0244053 -0.0207524 0.0309962 +531 17.1292 5.71389 14.2758 -0.00471 0.00306105 -0.00302256 0.00640288 -0.00217908 0.00597542 +532 18.5582 7.1383 15.7041 -0.00318405 0.00196883 -0.00350526 0.00347816 0.00166544 0.00487157 +533 -0.00294776 8.56709 14.2769 -0.00140854 0.000644072 -0.00197303 0.000644631 0.00310502 0.00206432 +534 1.42359 9.99346 15.7075 0.000871045 0.000523887 -0.00248084 0.0021129 0.000994035 0.00120289 +535 2.84785 8.56315 14.2813 0.00188459 0.0012155 -0.00225054 0.00369621 0.00239073 0.0018127 +536 4.2679 9.98856 15.7191 0.00551047 0.00353395 -0.006335 0.00616048 0.000210531 0.0010348 +537 5.68425 8.54536 14.3022 0.00541667 0.00238174 -0.00545037 0.0193195 0.0116277 -0.00164321 +538 7.12192 9.99337 15.7214 -0.0172219 -0.00298907 0.0204979 -0.000536269 0.00144538 0.0177974 +539 8.53647 8.54005 14.3079 -0.0533537 -0.0491305 0.0509742 -0.000632832 0.00312263 0.00917679 +540 9.99482 10.0051 15.7225 -0.0055739 -0.00823437 0.028156 0.00203633 0.00869988 0.0174598 +541 11.4358 8.54309 14.2995 0.0101888 -0.0084134 -0.0101401 0.0173634 0.10752 -0.100201 +542 12.8534 9.99823 15.7149 -0.012512 0.00300147 -0.00541313 -0.008848 0.0318834 -0.0194687 +543 14.2733 8.57289 14.2783 -0.0312078 0.026588 -0.0286511 0.0777946 -0.055141 0.0714177 +544 15.7197 9.98391 15.7232 0.00288548 -0.00562881 0.00333315 0.0100309 0.0158349 0.0151774 +545 17.1318 8.567 14.2779 -0.00827826 0.00291746 -0.00626759 0.00489755 0.00077416 0.0111398 +546 18.5602 9.99361 15.7072 -0.00158982 -0.000682801 -0.00278979 0.00360568 0.00259008 0.00661385 +547 -0.00231752 11.4231 14.2789 -0.000918741 -0.000521443 -0.00183555 0.00306906 0.00179985 0.00331339 +548 1.42453 12.8514 15.7088 0.0016412 -0.00139792 -0.00291675 0.00286887 1.03775e-06 0.00190806 +549 2.84871 11.4222 14.2821 0.004401 -0.000739473 -0.00462981 0.00558327 0.00101043 0.0030967 +550 4.26705 12.8564 15.7207 0.0103857 -0.00330369 -0.01116 -0.00100228 -0.00533643 0.00871693 +551 5.67453 11.4232 14.3092 0.0229413 -0.000895897 -0.0206181 0.0244181 -0.00466567 -0.00831423 +552 7.118 12.8661 15.7236 -0.00562592 0.00247615 0.0060675 -0.00114569 0.0147448 0.0292587 +553 8.52098 11.4529 14.3062 -0.0200872 0.00293364 0.0180065 -0.0297918 0.0154112 0.0132228 +554 9.99433 12.8562 15.7153 -0.00270196 -0.00208244 0.00604202 0.0205922 -0.0160934 -0.0224766 +555 11.4745 11.475 14.3054 -0.0176841 0.00414501 -0.0307683 -0.114566 -0.0964255 -0.254677 +556 12.8769 12.8785 15.749 -0.00465443 -0.00160857 0.021854 -0.0372359 -0.0337646 -0.0550239 +557 14.3195 11.4086 14.3178 -0.00447411 -0.0290348 -0.00326494 0.0265746 0.0444319 0.0167454 +558 15.7357 12.8547 15.7413 0.00889977 -0.00801245 0.0119293 -0.00255623 0.0196025 -0.000942507 +559 17.133 11.4254 14.2834 -0.00770926 -0.0017916 -0.00390351 0.0148231 0.00380476 0.0139324 +560 18.5628 12.8522 15.7114 -0.000844894 -0.00206292 -0.00136066 0.00476096 0.00464817 0.00582281 +561 -0.000461417 14.2803 14.2809 0.000139319 -0.00149223 -0.00144547 0.00492574 0.00198931 0.00302056 +562 1.42576 15.7094 15.709 0.00233513 -0.00273897 -0.00338917 0.00335341 -0.000105412 0.00198909 +563 2.84934 14.282 14.2826 0.00445811 -0.00531595 -0.00586248 0.00755859 -0.000474739 0.00361411 +564 4.26941 15.7193 15.7192 0.0106612 -0.0113032 -0.0125462 -0.011112 0.0127786 0.0159322 +565 5.67794 14.3082 14.3098 0.0260861 -0.0251396 -0.0267646 -0.0203944 0.0286301 0.0319441 +566 7.13934 15.7108 15.7131 -0.00100503 -0.00727226 -0.00677937 0.00493199 0.0154738 0.0187299 +567 8.57731 14.2805 14.2871 -0.00899872 -0.0134359 -0.00891032 0.00752692 0.0267375 0.0226775 +568 9.98396 15.7259 15.7285 -0.0132063 0.00564855 0.00619554 0.0231398 -0.00218837 -0.00125887 +569 11.4045 14.3202 14.3195 -0.020746 0.0272767 0.0273274 0.0126672 -0.0320461 -0.0337819 +570 12.8528 15.7391 15.7427 -0.000984703 0.0161233 0.0199272 0.00238335 -0.019537 -0.0210236 +571 14.3593 14.3624 14.3694 0.0358776 0.0362733 0.0450394 -0.000181477 -0.00367252 -0.0223704 +572 15.7444 15.7466 15.7483 0.0130564 0.0124607 0.0137366 -0.00374919 -0.00143649 -0.00168633 +573 17.1398 14.2896 14.2912 0.000382522 -0.00031981 0.00124191 0.0170589 0.01315 0.0110508 +574 18.5655 15.7134 15.7131 -0.000584094 -0.000413421 -0.000905357 0.0079773 0.00506654 0.00648607 +575 0.00150262 17.1362 14.2795 0.000378804 -0.00250025 -0.00222062 0.00553194 0.00350951 0.00313306 +576 1.42796 18.5636 15.7068 0.00179728 -0.00281188 -0.00316391 0.00218531 0.00365908 0.00139168 +577 2.85095 17.1377 14.2802 0.00536551 -0.00642412 -0.00454658 -0.00196109 0.00427517 0.00308198 +578 4.28319 18.5621 15.7061 0.00155012 -0.0031322 -0.00351525 -0.000317625 0.00215461 0.0025288 +579 5.70875 17.1346 14.2809 0.00488729 -0.00498738 -0.00638633 -0.00091859 0.000788953 0.00888073 +580 7.13911 18.5613 15.7044 -0.00106881 -0.00124297 -0.00166488 0.000604954 0.0033694 0.00621001 +581 8.56686 17.1315 14.2774 -0.00190263 -0.00122913 -0.00253316 0.00546963 0.00945823 0.0134327 +582 9.99185 18.5635 15.7069 -0.000915484 -0.0012821 -0.00119073 0.0052274 0.00498779 0.00829937 +583 11.4225 17.1348 14.2842 0.000697938 -0.00348932 -0.00136551 0.0082593 0.00922713 0.00496227 +584 12.8489 18.5662 15.7109 -0.000279288 -0.000528292 0.000201838 0.005744 0.00509521 0.00718448 +585 14.2913 17.1461 14.2949 -0.000929433 -0.00121449 -0.000264993 0.000190325 0.00727889 0.00148713 +586 15.7114 18.5698 15.7139 0.000405393 -0.00160558 -0.001235 0.0046589 0.00505392 0.00570374 +587 17.1451 17.1474 14.283 0.000117171 -0.000616404 -0.00440766 0.011035 0.0116859 0.0124598 +588 18.5659 18.5685 15.7091 0.000861411 -0.000176499 -0.00237811 0.00769171 0.00561471 0.00521276 +589 0.00288833 0.00420169 17.134 0.000691063 -0.000289482 -0.00222258 0.0057688 0.00481694 0.00156566 +590 1.42919 1.42791 18.5577 -0.000631336 -0.000212421 -0.00106602 0.00401106 0.00503994 0.000147838 +591 2.85699 0.00158441 17.1321 6.16401e-05 -0.00150412 -0.00228841 0.00121028 0.00335926 0.000143031 +592 4.28406 1.42694 18.5578 -0.00179415 -0.00130862 -0.000286706 -0.000495442 0.00427202 -1.6767e-06 +593 5.71197 0.00109634 17.1313 -0.00121445 -0.00118274 -0.00110136 -0.00137866 0.00266659 0.00199484 +594 7.13792 1.42825 18.5588 -0.00127675 -0.00100534 0.000114672 -0.00331178 0.00278131 0.00234961 +595 8.56484 0.00268426 17.1325 -0.000972248 -0.000582668 -0.000644016 -0.000659484 0.00270218 0.00520387 +596 9.99179 1.42968 18.5594 -0.000328019 -0.000540108 0.000176231 -0.00164919 0.00274157 0.00483149 +597 11.4189 0.00413895 17.134 -0.000409338 -0.000200034 -0.000307007 0.00288481 0.00436589 0.00731237 +598 12.8468 1.43052 18.5597 0.000572092 -0.000221725 -4.68669e-05 0.00299541 0.00409762 0.00563314 +599 14.2759 0.00565493 17.1354 0.000673861 2.46217e-05 -0.000503876 0.00579961 0.00537015 0.006417 +600 15.7034 1.43088 18.5597 0.000820521 0.000358158 -0.000370026 0.00677382 0.00509129 0.00405873 +601 17.1349 0.00660603 17.1362 0.000611474 0.000159187 -0.00131981 0.00720617 0.00495717 0.00376805 +602 18.561 1.42995 18.5589 0.000231741 0.000586892 -0.000935378 0.00747162 0.00505926 0.00194819 +603 -0.00091623 2.85567 17.1305 -0.00108094 0.000369512 -0.00151575 0.00481507 0.00471715 -0.000400105 +604 1.42526 4.27929 18.5581 -0.00143381 0.000245124 -0.000909586 0.00355025 0.00498308 -0.000380633 +605 2.85467 2.8538 17.1308 -0.00158367 -0.00103208 -0.000797823 0.00201608 0.00504769 -0.00196743 +606 4.27983 4.278 18.5606 -0.00438345 -0.00335488 0.00277672 0.00153346 0.00515032 -0.00166673 +607 5.71077 2.85457 17.1307 -0.00259853 -0.0024605 0.00100951 0.000769975 0.00468045 -0.00107056 +608 7.13708 4.28064 18.5609 -0.00238919 -0.00351084 0.00285487 -0.000102963 0.00393145 0.00033441 +609 8.56543 2.85643 17.1307 -0.000814384 -0.00180187 0.000832422 -0.00113055 0.00273469 0.00316254 +610 9.99257 4.28276 18.5603 0.000445727 -0.00255806 0.00196856 -0.00128992 0.0017261 0.0039936 +611 11.4194 2.85749 17.1307 0.000500453 -0.00125179 0.000284023 -3.05562e-05 0.00225929 0.00584272 +612 12.8475 4.28303 18.5597 0.00196552 -0.00175552 0.00124235 0.00029727 0.00206418 0.00476516 +613 14.2741 2.85764 17.1307 0.000755553 -0.00042336 -0.000545199 0.00275235 0.00315473 0.00536251 +614 15.7042 4.28172 18.5591 0.00061652 0.000321508 -0.000249362 0.00210975 0.00387487 0.0028671 +615 17.131 2.85673 17.1311 -0.000308488 0.000589652 -0.00133433 0.00566771 0.00341067 0.00318982 +616 18.5585 4.28185 18.557 -0.0015405 0.00171455 -0.00170953 0.00706746 0.00205374 0.00389021 +617 -0.00243093 5.70895 17.1311 -0.00144786 0.00113284 -0.00205977 0.00336116 0.00336531 0.000947761 +618 1.4245 7.13459 18.5603 -0.000408725 0.000375601 -0.00116081 0.002277 0.00281428 0.000679933 +619 2.84914 5.70466 17.1353 -0.0011934 -3.32022e-06 -0.00106111 0.00333534 0.00513373 -0.00223272 +620 4.27797 7.13389 18.5632 -0.00430711 -0.00185319 0.00283867 0.00218454 0.00192797 0.000476544 +621 5.7036 5.70263 17.1387 -0.00949112 -0.00831684 0.00780964 0.00505263 0.00540058 -0.00209542 +622 7.1357 7.1362 18.5621 -0.00373377 -0.00356841 0.00364216 0.00207344 0.00113864 0.00267632 +623 8.56392 5.70733 17.1359 -0.00251499 -0.00669862 0.00660375 0.00684464 0.00641532 0.00020374 +624 9.99202 7.13919 18.5608 4.35223e-05 -0.00229953 0.00217793 0.00395648 0.00219565 0.00557802 +625 11.4209 5.70947 17.134 0.00342896 -0.00495137 0.00420772 -2.99332e-05 0.00376916 0.00471413 +626 12.8478 7.13809 18.5611 0.000748397 -0.000401139 0.000529773 0.00197118 0.00226995 0.00607361 +627 14.2783 5.7081 17.1347 0.00148387 -0.00042427 0.000132907 -0.00557365 0.00544325 0.00258974 +628 15.7037 7.13715 18.5609 -0.00217139 0.00193156 -0.0020631 0.00103457 0.00290688 0.00408665 +629 17.1302 5.71087 17.131 -0.00384384 0.00392122 -0.00417691 0.00990979 -0.00486218 0.0112186 +630 18.5607 7.13454 18.5606 -0.000209045 -0.000364809 -0.000499022 0.00256875 0.00390678 0.00243414 +631 -0.00128372 8.56432 17.1334 -0.000274744 0.000125207 -0.00185181 0.00205636 0.00239477 0.00210406 +632 1.42538 9.9925 18.5623 0.000523988 0.000158593 -0.0014774 0.00205552 -4.41682e-05 0.00203436 +633 2.84785 8.5618 17.138 0.000953768 0.00157151 -0.00256391 0.00285991 0.000968812 0.000245831 +634 4.27795 9.99245 18.5647 -0.00293497 0.000308409 0.00197877 0.00308558 -1.47609e-05 0.00159375 +635 5.70176 8.56119 17.1407 -0.00857985 -0.00313603 0.0074698 0.00358596 0.000157697 0.00421686 +636 7.1354 9.99316 18.5629 -0.00257808 -0.00129504 0.0033112 0.00269852 0.0029685 0.00548302 +637 8.56253 8.5661 17.1316 -0.00569468 -0.00704541 0.00537651 0.00341716 2.97417e-05 0.0194954 +638 9.99268 9.99559 18.5609 -0.000830805 -0.00151973 0.00206795 0.00733086 0.00670199 0.005205 +639 11.4208 8.56677 17.1316 0.000314882 -0.00389627 -0.00135934 0.00993778 0.00736713 0.00456839 +640 12.8487 9.9958 18.5618 -0.00231691 0.000576832 -0.0013698 0.00226671 0.0063959 0.00550763 +641 14.277 8.56564 17.1369 -0.0048647 0.00317408 -0.00496256 -0.00376265 0.00934612 -0.00151389 +642 15.7071 9.99224 18.565 -0.00108723 -0.00115689 -0.000378491 0.00163504 0.0047977 0.00482213 +643 17.1373 8.56038 17.1391 0.000255293 -0.0019892 -5.99705e-05 0.00207871 0.00553416 0.00607641 +644 18.5637 9.99074 18.5645 0.00109153 -0.00178483 0.000448522 0.0017633 0.00403571 0.00240328 +645 0.000285278 11.4218 17.1358 0.000382379 -0.000857053 -0.00155577 0.00280365 0.00150207 0.00262162 +646 1.42657 12.8514 18.5638 0.00103517 -0.000457081 -0.00193572 0.00305929 -0.00123107 0.00291766 +647 2.84833 11.422 17.1394 0.0026043 0.000797002 -0.00388112 0.00120778 -0.00275271 0.00316752 +648 4.27862 12.852 18.566 -0.00213755 0.000817007 0.00119907 0.00317587 -0.000501367 0.00171753 +649 5.70055 11.4239 17.1424 -0.00530515 0.00221478 0.00516317 0.0032455 0.000715871 0.00296997 +650 7.13496 12.8509 18.5651 -0.00172843 0.00015463 0.00228305 0.00210022 0.00529369 0.00591542 +651 8.55978 11.4258 17.1342 -0.00449637 -0.00107982 0.00286541 0.00246532 0.00934517 0.0146592 +652 9.99367 12.8501 18.5632 -0.00023291 -0.000978824 0.000429135 0.00616452 0.004254 0.00494148 +653 11.426 11.4292 17.134 -0.00254151 -0.000162194 -0.00642743 0.00684003 0.00867003 -0.0137759 +654 12.853 12.8549 18.5672 -0.000774659 -0.000770444 0.00175648 0.00270437 0.00533668 0.00392771 +655 14.2857 11.4237 17.1408 -0.00175257 -0.00318273 -0.00429065 -0.0012573 0.0084251 0.00869801 +656 15.7109 12.8525 18.5689 0.000230314 -0.00220624 0.000404013 0.00258889 0.00748 0.00350008 +657 17.1435 11.418 17.146 0.00300103 -0.00416451 0.00259165 0.00129493 0.0106273 0.00492858 +658 18.5662 12.8507 18.5674 0.00182762 -0.00153667 0.000847986 0.00433267 0.00329787 0.00337348 +659 0.00198115 14.281 17.1376 0.000782615 -0.00113521 -0.00196162 0.00490392 0.000894822 0.00338407 +660 1.4282 15.7098 18.5645 0.00164881 -0.00147387 -0.00257482 0.00333424 0.000288907 0.00325287 +661 2.849 14.2826 17.1404 0.00397437 -0.00249101 -0.00550703 -1.85922e-05 -0.00140058 0.00455392 +662 4.28043 15.71 18.5661 -0.00117567 -3.78316e-05 -0.000475585 0.000926121 0.00019217 0.00237767 +663 5.70173 14.2865 17.1435 -0.00244712 0.000942481 0.0024961 0.000902736 0.00364441 0.00100959 +664 7.13745 15.7068 18.5657 -0.00139341 -2.50285e-06 0.000587038 0.00310535 0.00109188 0.00222816 +665 8.56376 14.2803 17.14 -0.00211884 -0.000226183 0.00312138 0.0149032 0.00109449 5.75592e-06 +666 9.99108 15.7088 18.5677 -0.00189055 0.00108061 0.0013321 0.0056045 0.00498985 0.0046457 +667 11.4215 14.2873 17.1413 -0.0024373 0.00315202 0.00217784 0.0048998 -0.00176777 0.00461472 +668 12.8496 15.7127 18.5698 -0.000255984 0.00161651 0.00196802 0.00550995 0.00421671 0.00250518 +669 14.2942 14.2965 17.1533 0.00300096 0.00224111 0.00731999 -0.0112404 -0.00696391 -0.00413059 +670 15.7138 15.7167 18.5722 0.00212597 0.000977099 0.000521883 0.00207091 0.00207069 0.000176549 +671 17.1491 14.2862 17.1522 0.00469341 -0.000691461 0.0042478 0.00334464 0.00591391 0.00379876 +672 18.5686 15.7126 18.5697 0.00270721 1.32379e-06 0.00103222 0.0062456 0.00294895 0.00261526 +673 0.00365743 17.139 17.1374 0.00138422 -0.000992627 -0.00194345 0.00618728 0.0025294 0.00287336 +674 1.42998 18.5645 18.5623 0.00139399 -0.001496 -0.00255591 0.00280289 0.00424403 0.0030254 +675 2.85177 17.1397 17.1385 0.00393204 -0.00474912 -0.00573864 -0.00317867 0.00525282 0.00618962 +676 4.2845 18.5618 18.5612 -0.00052827 -0.00151863 -0.00185191 -0.00102157 0.00299375 0.00289173 +677 5.71062 17.1364 17.1368 -0.000166332 -0.00325031 -0.003529 -0.000716494 0.00547771 0.00755723 +678 7.13623 18.5637 18.5639 -0.00251837 0.000400219 0.000208457 -9.02723e-05 0.00176854 0.00278256 +679 8.56039 17.1418 17.1428 -0.00556251 0.00169782 0.00155977 0.00957628 0.00191161 0.00452317 +680 9.98964 18.5663 18.5664 -0.00241042 0.00157145 0.00128238 0.0032428 0.00321973 0.00411087 +681 11.4165 17.1471 17.148 -0.00484832 0.00437362 0.00429968 0.0111996 0.000362933 0.00192385 +682 12.8472 18.5686 18.5679 -0.000617111 0.00216858 0.00184491 0.00595639 0.00469939 0.00442758 +683 14.2835 17.1521 17.1526 0.00277416 0.00673894 0.00696785 0.000926401 -0.00103412 -0.00110733 +684 15.7084 18.571 18.5693 0.00222237 0.0029274 0.00228672 0.00639032 0.00337845 0.00189706 +685 17.1509 17.1539 17.153 0.00630479 0.00543894 0.00489781 0.00350232 0.00136692 0.00142792 +686 18.568 18.5704 18.568 0.00316726 0.00214046 0.00112646 0.00689416 0.00307038 0.00131717 +687 10.1985 10.7319 10.9228 0.384537 -0.0571837 0.328595 0.0278179 -0.0413041 0.123219 diff --git a/examples/python/in.fix_python_invoke b/examples/python/in.fix_python_invoke index f77cc15c90..ac435762c5 100644 --- a/examples/python/in.fix_python_invoke +++ b/examples/python/in.fix_python_invoke @@ -23,12 +23,12 @@ from lammps import lammps def end_of_step_callback(lmp): L = lammps(ptr=lmp) - t = L.extract_global("ntimestep", 0) + t = L.extract_global("ntimestep") print("### END OF STEP ###", t) def post_force_callback(lmp, v): L = lammps(ptr=lmp) - t = L.extract_global("ntimestep", 0) + t = L.extract_global("ntimestep") print("### POST_FORCE ###", t) """ diff --git a/examples/python/in.fix_python_invoke_neighlist b/examples/python/in.fix_python_invoke_neighlist index 50f1d52c33..e5445227b1 100644 --- a/examples/python/in.fix_python_invoke_neighlist +++ b/examples/python/in.fix_python_invoke_neighlist @@ -35,14 +35,13 @@ def post_force_callback(lmp, v): #mylist = L.get_neighlist(0) mylist = L.find_pair_neighlist("lj/cut", request=0) print(pid_prefix, mylist) - nlocal = L.extract_global("nlocal", 0) - nghost = L.extract_global("nghost", 0) - ntypes = L.extract_global("ntypes", 0) - mass = L.numpy.extract_atom_darray("mass", ntypes+1) - atype = L.numpy.extract_atom_iarray("type", nlocal+nghost) - x = L.numpy.extract_atom_darray("x", nlocal+nghost, dim=3) - v = L.numpy.extract_atom_darray("v", nlocal+nghost, dim=3) - f = L.numpy.extract_atom_darray("f", nlocal+nghost, dim=3) + nlocal = L.extract_global("nlocal") + nghost = L.extract_global("nghost") + mass = L.numpy.extract_atom("mass") + atype = L.numpy.extract_atom("type", nelem=nlocal+nghost) + x = L.numpy.extract_atom("x", nelem=nlocal+nghost, dim=3) + v = L.numpy.extract_atom("v", nelem=nlocal+nghost, dim=3) + f = L.numpy.extract_atom("f", nelem=nlocal+nghost, dim=3) for iatom, numneigh, neighs in mylist: print(pid_prefix, "- {}".format(iatom), x[iatom], v[iatom], f[iatom], " : ", numneigh, "Neighbors") diff --git a/examples/python/py_nve.py b/examples/python/py_nve.py index 79331528b1..9ff7c0978b 100644 --- a/examples/python/py_nve.py +++ b/examples/python/py_nve.py @@ -1,12 +1,12 @@ from __future__ import print_function -import lammps +from lammps import lammps, LAMMPS_INT, LAMMPS_DOUBLE import ctypes import traceback import numpy as np class LAMMPSFix(object): def __init__(self, ptr, group_name="all"): - self.lmp = lammps.lammps(ptr=ptr) + self.lmp = lammps(ptr=ptr) self.group_name = group_name class LAMMPSFixMove(LAMMPSFix): @@ -39,19 +39,18 @@ class NVE(LAMMPSFixMove): assert(self.group_name == "all") def init(self): - dt = self.lmp.extract_global("dt", 1) - ftm2v = self.lmp.extract_global("ftm2v", 1) - self.ntypes = self.lmp.extract_global("ntypes", 0) + dt = self.lmp.extract_global("dt") + ftm2v = self.lmp.extract_global("ftm2v") + self.ntypes = self.lmp.extract_global("ntypes") self.dtv = dt self.dtf = 0.5 * dt * ftm2v def initial_integrate(self, vflag): - nlocal = self.lmp.extract_global("nlocal", 0) - mass = self.lmp.numpy.extract_atom_darray("mass", self.ntypes+1) - atype = self.lmp.numpy.extract_atom_iarray("type", nlocal) - x = self.lmp.numpy.extract_atom_darray("x", nlocal, dim=3) - v = self.lmp.numpy.extract_atom_darray("v", nlocal, dim=3) - f = self.lmp.numpy.extract_atom_darray("f", nlocal, dim=3) + mass = self.lmp.numpy.extract_atom("mass") + atype = self.lmp.numpy.extract_atom("type") + x = self.lmp.numpy.extract_atom("x") + v = self.lmp.numpy.extract_atom("v") + f = self.lmp.numpy.extract_atom("f") for i in range(x.shape[0]): dtfm = self.dtf / mass[int(atype[i])] @@ -59,11 +58,10 @@ class NVE(LAMMPSFixMove): x[i,:] += self.dtv * v[i,:] def final_integrate(self): - nlocal = self.lmp.extract_global("nlocal", 0) - mass = self.lmp.numpy.extract_atom_darray("mass", self.ntypes+1) - atype = self.lmp.numpy.extract_atom_iarray("type", nlocal) - v = self.lmp.numpy.extract_atom_darray("v", nlocal, dim=3) - f = self.lmp.numpy.extract_atom_darray("f", nlocal, dim=3) + mass = self.lmp.numpy.extract_atom("mass") + atype = self.lmp.numpy.extract_atom("type") + v = self.lmp.numpy.extract_atom("v") + f = self.lmp.numpy.extract_atom("f") for i in range(v.shape[0]): dtfm = self.dtf / mass[int(atype[i])] @@ -77,19 +75,19 @@ class NVE_Opt(LAMMPSFixMove): assert(self.group_name == "all") def init(self): - dt = self.lmp.extract_global("dt", 1) - ftm2v = self.lmp.extract_global("ftm2v", 1) - self.ntypes = self.lmp.extract_global("ntypes", 0) + dt = self.lmp.extract_global("dt") + ftm2v = self.lmp.extract_global("ftm2v") + self.ntypes = self.lmp.extract_global("ntypes") self.dtv = dt self.dtf = 0.5 * dt * ftm2v - self.mass = self.lmp.numpy.extract_atom_darray("mass", self.ntypes+1) + self.mass = self.lmp.numpy.extract_atom("mass") def initial_integrate(self, vflag): - nlocal = self.lmp.extract_global("nlocal", 0) - atype = self.lmp.numpy.extract_atom_iarray("type", nlocal) - x = self.lmp.numpy.extract_atom_darray("x", nlocal, dim=3) - v = self.lmp.numpy.extract_atom_darray("v", nlocal, dim=3) - f = self.lmp.numpy.extract_atom_darray("f", nlocal, dim=3) + nlocal = self.lmp.extract_global("nlocal") + atype = self.lmp.numpy.extract_atom("type") + x = self.lmp.numpy.extract_atom("x") + v = self.lmp.numpy.extract_atom("v") + f = self.lmp.numpy.extract_atom("f") dtf = self.dtf dtv = self.dtv mass = self.mass @@ -102,13 +100,12 @@ class NVE_Opt(LAMMPSFixMove): x[:,d] += dtv * v[:,d] def final_integrate(self): - nlocal = self.lmp.extract_global("nlocal", 0) - mass = self.lmp.numpy.extract_atom_darray("mass", self.ntypes+1) - atype = self.lmp.numpy.extract_atom_iarray("type", nlocal) - v = self.lmp.numpy.extract_atom_darray("v", nlocal, dim=3) - f = self.lmp.numpy.extract_atom_darray("f", nlocal, dim=3) + nlocal = self.lmp.extract_global("nlocal") + mass = self.lmp.numpy.extract_atom("mass") + atype = self.lmp.numpy.extract_atom("type") + v = self.lmp.numpy.extract_atom("v") + f = self.lmp.numpy.extract_atom("f") dtf = self.dtf - dtv = self.dtv mass = self.mass dtfm = dtf / np.take(mass, atype) diff --git a/fortran/README b/fortran/README new file mode 100644 index 0000000000..653b6a966e --- /dev/null +++ b/fortran/README @@ -0,0 +1,11 @@ +This directory contains Fortran code which interface LAMMPS as a library +and allows the LAMMPS library interface to be invoked from Fortran codes. +It requires a Fortran compiler that supports the Fortran 2003 standard. + +This interface is based on and supersedes the previous Fortran interfaces +in the examples/COUPLE/fortran* folders. But is fully supported by the +LAMMPS developers and included in the documentation and unit testing. + +Details on this Fortran interface and how to build programs using it +are in the manual in the doc/html/pg_fortran.html file. + diff --git a/fortran/lammps.f90 b/fortran/lammps.f90 new file mode 100644 index 0000000000..6511673c66 --- /dev/null +++ b/fortran/lammps.f90 @@ -0,0 +1,280 @@ +! ------------------------------------------------------------------------- +! LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator +! http://lammps.sandia.gov, Sandia National Laboratories +! Steve Plimpton, sjplimp@sandia.gov +! +! Copyright (2003) Sandia Corporation. Under the terms of Contract +! DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains +! certain rights in this software. This software is distributed under +! the GNU General Public License. +! +! See the README file in the top-level LAMMPS directory. +! ------------------------------------------------------------------------- +! +! Fortran interface to the LAMMPS library implemented as a Fortran 2003 +! style module that wraps the C-style library interface in library.cpp +! and library.h using the ISO_C_BINDING module of the Fortran compiler. +! +! Based on the LAMMPS Fortran 2003 module contributed by: +! Karl D. Hammond +! University of Tennessee, Knoxville (USA), 2012 +! +! The Fortran module tries to follow the API of the C-library interface +! closely, but like the Python wrapper it employs an object oriented +! approach. To accommodate the object oriented approach, all exported +! subroutine and functions have to be implemented in Fortran to then +! call the interfaced C style functions with adapted calling conventions +! as needed. The C-library interfaced functions retain their names +! starting with "lammps_" while the Fortran versions start with "lmp_". +! +MODULE LIBLAMMPS + + USE, INTRINSIC :: ISO_C_BINDING, ONLY: c_ptr, c_null_ptr, c_loc, & + c_int, c_char, c_null_char, c_double + + IMPLICIT NONE + PRIVATE + PUBLIC :: lammps + + TYPE lammps + TYPE(c_ptr) :: handle + CONTAINS + PROCEDURE :: close => lmp_close + PROCEDURE :: file => lmp_file + PROCEDURE :: command => lmp_command + PROCEDURE :: commands_list => lmp_commands_list + PROCEDURE :: commands_string => lmp_commands_string + PROCEDURE :: version => lmp_version + PROCEDURE :: get_natoms => lmp_get_natoms + END TYPE lammps + + INTERFACE lammps + MODULE PROCEDURE lmp_open + END INTERFACE lammps + + ! interface definitions for calling functions in library.cpp + INTERFACE + FUNCTION lammps_open(argc,argv,comm) & + BIND(C, name='lammps_open_fortran') + IMPORT :: c_ptr, c_int + INTEGER(c_int), VALUE, INTENT(in) :: argc, comm + TYPE(c_ptr), DIMENSION(*), INTENT(in) :: argv + TYPE(c_ptr) :: lammps_open + END FUNCTION lammps_open + + FUNCTION lammps_open_no_mpi(argc,argv,handle) & + BIND(C, name='lammps_open_no_mpi') + IMPORT :: c_ptr, c_int + INTEGER(c_int), VALUE, INTENT(in) :: argc + TYPE(c_ptr), DIMENSION(*), INTENT(in) :: argv + TYPE(c_ptr), INTENT(out) :: handle + TYPE(c_ptr) :: lammps_open_no_mpi + END FUNCTION lammps_open_no_mpi + + SUBROUTINE lammps_close(handle) BIND(C, name='lammps_close') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: handle + END SUBROUTINE lammps_close + + SUBROUTINE lammps_mpi_init(handle) BIND(C, name='lammps_mpi_init') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: handle + END SUBROUTINE lammps_mpi_init + + SUBROUTINE lammps_mpi_finalize(handle) & + BIND(C, name='lammps_mpi_finalize') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: handle + END SUBROUTINE lammps_mpi_finalize + + SUBROUTINE lammps_file(handle,filename) BIND(C, name='lammps_file') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: handle + TYPE(c_ptr), VALUE :: filename + END SUBROUTINE lammps_file + + SUBROUTINE lammps_command(handle,cmd) BIND(C, name='lammps_command') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: handle + TYPE(c_ptr), VALUE :: cmd + END SUBROUTINE lammps_command + + SUBROUTINE lammps_commands_list(handle,ncmd,cmds) & + BIND(C, name='lammps_commands_list') + IMPORT :: c_ptr, c_int + TYPE(c_ptr), VALUE :: handle + INTEGER(c_int), VALUE, INTENT(in) :: ncmd + TYPE(c_ptr), DIMENSION(*), INTENT(in) :: cmds + END SUBROUTINE lammps_commands_list + + SUBROUTINE lammps_commands_string(handle,str) & + BIND(C, name='lammps_commands_string') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: handle + TYPE(c_ptr), VALUE :: str + END SUBROUTINE lammps_commands_string + + SUBROUTINE lammps_free(ptr) BIND(C, name='lammps_free') + IMPORT :: c_ptr + TYPE(c_ptr), VALUE :: ptr + END SUBROUTINE lammps_free + + FUNCTION lammps_version(handle) BIND(C, name='lammps_version') + IMPORT :: c_ptr, c_int + TYPE(c_ptr), VALUE :: handle + INTEGER(c_int) :: lammps_version + END FUNCTION lammps_version + + FUNCTION lammps_get_natoms(handle) BIND(C, name='lammps_get_natoms') + IMPORT :: c_ptr, c_double + TYPE(c_ptr), VALUE :: handle + REAL(c_double) :: lammps_get_natoms + END FUNCTION lammps_get_natoms + END INTERFACE + +CONTAINS + + ! Fortran wrappers and helper functions. + + ! Constructor for the LAMMPS class. + ! Combined wrapper around lammps_open_fortran() and lammps_open_no_mpi() + TYPE(lammps) FUNCTION lmp_open(args,comm) + IMPLICIT NONE + INTEGER,INTENT(in), OPTIONAL :: comm + CHARACTER(len=*), INTENT(in), OPTIONAL :: args(:) + TYPE(c_ptr), ALLOCATABLE :: argv(:) + TYPE(c_ptr) :: dummy=c_null_ptr + INTEGER :: i,argc + + IF (PRESENT(args)) THEN + ! convert argument list to c style + argc = SIZE(args) + ALLOCATE(argv(argc)) + DO i=1,argc + argv(i) = f2c_string(args(i)) + END DO + ELSE + argc = 1 + ALLOCATE(argv(1)) + argv(1) = f2c_string("liblammps") + ENDIF + + IF (PRESENT(comm)) THEN + lmp_open%handle = lammps_open(argc,argv,comm) + ELSE + lmp_open%handle = lammps_open_no_mpi(argc,argv,dummy) + END IF + + ! Clean up allocated memory + DO i=1,argc + CALL lammps_free(argv(i)) + END DO + DEALLOCATE(argv) + END FUNCTION lmp_open + + ! Combined Fortran wrapper around lammps_close() and lammps_mpi_finalize() + SUBROUTINE lmp_close(self,finalize) + IMPLICIT NONE + CLASS(lammps) :: self + LOGICAL,INTENT(in),OPTIONAL :: finalize + + CALL lammps_close(self%handle) + + IF (PRESENT(finalize)) THEN + IF (finalize) THEN + CALL lammps_mpi_finalize(self%handle) + END IF + END IF + END SUBROUTINE lmp_close + + INTEGER FUNCTION lmp_version(self) + IMPLICIT NONE + CLASS(lammps) :: self + + lmp_version = lammps_version(self%handle) + END FUNCTION lmp_version + + DOUBLE PRECISION FUNCTION lmp_get_natoms(self) + IMPLICIT NONE + CLASS(lammps) :: self + + lmp_get_natoms = lammps_get_natoms(self%handle) + END FUNCTION lmp_get_natoms + + SUBROUTINE lmp_file(self,filename) + IMPLICIT NONE + CLASS(lammps) :: self + CHARACTER(len=*) :: filename + TYPE(c_ptr) :: str + + str = f2c_string(filename) + CALL lammps_file(self%handle,str) + CALL lammps_free(str) + END SUBROUTINE lmp_file + + ! equivalent function to lammps_command() + SUBROUTINE lmp_command(self,cmd) + IMPLICIT NONE + CLASS(lammps) :: self + CHARACTER(len=*) :: cmd + TYPE(c_ptr) :: str + + str = f2c_string(cmd) + CALL lammps_command(self%handle,str) + CALL lammps_free(str) + END SUBROUTINE lmp_command + + ! equivalent function to lammps_commands_list() + SUBROUTINE lmp_commands_list(self,cmds) + IMPLICIT NONE + CLASS(lammps) :: self + CHARACTER(len=*), INTENT(in), OPTIONAL :: cmds(:) + TYPE(c_ptr), ALLOCATABLE :: cmdv(:) + INTEGER :: i,ncmd + + ! convert command list to c style + ncmd = SIZE(cmds) + ALLOCATE(cmdv(ncmd)) + DO i=1,ncmd + cmdv(i) = f2c_string(cmds(i)) + END DO + + CALL lammps_commands_list(self%handle,ncmd,cmdv) + + ! Clean up allocated memory + DO i=1,ncmd + CALL lammps_free(cmdv(i)) + END DO + DEALLOCATE(cmdv) + END SUBROUTINE lmp_commands_list + + ! equivalent function to lammps_commands_string() + SUBROUTINE lmp_commands_string(self,str) + IMPLICIT NONE + CLASS(lammps) :: self + CHARACTER(len=*) :: str + TYPE(c_ptr) :: tmp + + tmp = f2c_string(str) + CALL lammps_commands_string(self%handle,tmp) + CALL lammps_free(tmp) + END SUBROUTINE lmp_commands_string + + ! ---------------------------------------------------------------------- + ! local helper functions + ! copy fortran string to zero terminated c string + FUNCTION f2c_string(f_string) RESULT(ptr) + CHARACTER (len=*), INTENT(in) :: f_string + CHARACTER (len=1, kind=c_char), POINTER :: c_string(:) + TYPE(c_ptr) :: ptr + INTEGER :: i, n + + n = LEN_TRIM(f_string) + ALLOCATE(c_string(n+1)) + DO i=1,n + c_string(i) = f_string(i:i) + END DO + c_string(n+1) = c_null_char + ptr = c_loc(c_string(1)) + END FUNCTION f2c_string +END MODULE LIBLAMMPS diff --git a/lib/atc/ATC_Coupling.cpp b/lib/atc/ATC_Coupling.cpp index db72b0cb0c..552bb9bb37 100644 --- a/lib/atc/ATC_Coupling.cpp +++ b/lib/atc/ATC_Coupling.cpp @@ -30,26 +30,26 @@ namespace ATC { useFeMdMassMatrix_(false), trackCharge_(false), temperatureDef_(NONE), - prescribedDataMgr_(NULL), - physicsModel_(NULL), + prescribedDataMgr_(nullptr), + physicsModel_(nullptr), extrinsicModelManager_(this), - atomicRegulator_(NULL), + atomicRegulator_(nullptr), atomQuadForInternal_(true), - elementMask_(NULL), - elementMaskMass_(NULL), - elementMaskMassMd_(NULL), - nodalAtomicMass_(NULL), - nodalAtomicCount_(NULL), - nodalAtomicHeatCapacity_(NULL), - internalToMask_(NULL), - internalElement_(NULL), - ghostElement_(NULL), - nodalGeometryType_(NULL), + elementMask_(nullptr), + elementMaskMass_(nullptr), + elementMaskMassMd_(nullptr), + nodalAtomicMass_(nullptr), + nodalAtomicCount_(nullptr), + nodalAtomicHeatCapacity_(nullptr), + internalToMask_(nullptr), + internalElement_(nullptr), + ghostElement_(nullptr), + nodalGeometryType_(nullptr), bndyIntType_(NO_QUADRATURE), - bndyFaceSet_(NULL), - atomicWeightsMask_(NULL), - shpFcnMask_(NULL), - shpFcnDerivsMask_(NULL), + bndyFaceSet_(nullptr), + atomicWeightsMask_(nullptr), + shpFcnMask_(nullptr), + shpFcnDerivsMask_(nullptr), sourceIntegration_(FULL_DOMAIN) { // size the field mask @@ -68,7 +68,7 @@ namespace ATC { ATC_Coupling::~ATC_Coupling() { interscaleManager_.clear(); - if (feEngine_) { delete feEngine_; feEngine_ = NULL; } + if (feEngine_) { delete feEngine_; feEngine_ = nullptr; } if (physicsModel_) delete physicsModel_; if (atomicRegulator_) delete atomicRegulator_; if (prescribedDataMgr_) delete prescribedDataMgr_; @@ -127,7 +127,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string nsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { f = XT_Function_Mgr::instance()->constant_function(atof(arg[argIdx])); @@ -164,7 +164,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string nsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // fix current value if (narg == argIdx) { set nodeSet = (feEngine_->fe_mesh())->nodeset(nsetName); @@ -258,7 +258,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string esetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { string a(arg[argIdx]); @@ -367,7 +367,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string fsetName(arg[argIdx++]); - XT_Function * f = NULL; + XT_Function * f = nullptr; // parse constant if (narg == argIdx+1) { f = XT_Function_Mgr::instance()->constant_function(atof(arg[argIdx])); @@ -529,7 +529,7 @@ namespace ATC { argIdx++; parse_field(arg,argIdx,thisField,thisIndex); string fsetName(arg[argIdx++]); - UXT_Function * f = NULL; + UXT_Function * f = nullptr; // parse linear if (narg == argIdx+2) { f = UXT_Function_Mgr::instance()->linear_function(atof(arg[argIdx]),atof(arg[argIdx+1])); @@ -760,7 +760,7 @@ namespace ATC { WeakEquation::PDE_Type ATC_Coupling::pde_type(const FieldName fieldName) const { const WeakEquation * weakEq = physicsModel_->weak_equation(fieldName); - if (weakEq == NULL) return WeakEquation::PROJECTION_PDE; + if (weakEq == nullptr) return WeakEquation::PROJECTION_PDE; return weakEq->type(); } //-------------------------------------------------- @@ -768,7 +768,7 @@ namespace ATC { bool ATC_Coupling::is_dynamic(const FieldName fieldName) const { const WeakEquation * weakEq = physicsModel_->weak_equation(fieldName); - if (weakEq == NULL) return false; + if (weakEq == nullptr) return false; return (physicsModel_->weak_equation(fieldName)->type() == WeakEquation::DYNAMIC_PDE); } diff --git a/lib/atc/ATC_Coupling.h b/lib/atc/ATC_Coupling.h index 9f406febbe..e119b68738 100644 --- a/lib/atc/ATC_Coupling.h +++ b/lib/atc/ATC_Coupling.h @@ -114,10 +114,10 @@ namespace ATC { FIELDS &rhs, const Array< std::set > atomMaterialGroups, const VectorDependencyManager * shpFcnDerivs, - const SPAR_MAN * shpFcn = NULL, - const DIAG_MAN * atomicWeights = NULL, - const MatrixDependencyManager * elementMask = NULL, - const SetDependencyManager * nodeSet = NULL); + const SPAR_MAN * shpFcn = nullptr, + const DIAG_MAN * atomicWeights = nullptr, + const MatrixDependencyManager * elementMask = nullptr, + const SetDependencyManager * nodeSet = nullptr); /** access to full right hand side / forcing vector */ FIELDS &rhs() {return rhs_;}; Array2D rhs_mask() const { @@ -152,14 +152,14 @@ namespace ATC { const FIELDS &fields, FIELDS &rhs, const IntegrationDomainType domain, // = FULL_DOMAIN - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); /** wrapper for FE_Engine's compute_tangent_matrix */ void compute_rhs_tangent(const std::pair row_col, const RHS_MASK & rhsMask, const FIELDS & fields, SPAR_MAT & stiffness, const IntegrationDomainType integrationType, - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); void tangent_matrix(const std::pair row_col, const RHS_MASK & rhsMask, const PhysicsModel * physicsModel, @@ -197,7 +197,7 @@ namespace ATC { return & (it->second).quantity(); } else { - return NULL; + return nullptr; } } else { @@ -206,7 +206,7 @@ namespace ATC { return & (it->second).quantity(); } else { - return NULL; + return nullptr; } } } @@ -233,7 +233,7 @@ namespace ATC { /** access to time integrator */ const TimeIntegrator * time_integrator(const FieldName & field) const { _ctiIt_ = timeIntegrators_.find(field); - if (_ctiIt_ == timeIntegrators_.end()) return NULL; + if (_ctiIt_ == timeIntegrators_.end()) return nullptr; return _ctiIt_->second; }; @@ -322,7 +322,7 @@ namespace ATC { void compute_flux(const Array2D & rhs_mask, const FIELDS &fields, GRAD_FIELD_MATS &flux, - const PhysicsModel * physicsModel=NULL, + const PhysicsModel * physicsModel=nullptr, const bool normalize = false); /** evaluate rhs on the atomic domain which is near the FE region */ void masked_atom_domain_rhs_integral(const Array2D & rhs_mask, @@ -334,7 +334,7 @@ namespace ATC { const FIELDS &fields, FIELDS &rhs, const IntegrationDomainType domain, - const PhysicsModel * physicsModel=NULL); + const PhysicsModel * physicsModel=nullptr); /** access to boundary fluxes */ DENS_MAT &get_boundary_flux(FieldName thisField){return boundaryFlux_[thisField].set_quantity();}; DENS_MAN &boundary_flux(FieldName thisField){return boundaryFlux_[thisField];}; @@ -352,7 +352,7 @@ namespace ATC { // mass matrix filtering void delete_mass_mat_time_filter(FieldName thisField); /** compute mass matrix for requested field */ - void compute_mass_matrix(FieldName thisField, PhysicsModel * physicsModel = NULL); + void compute_mass_matrix(FieldName thisField, PhysicsModel * physicsModel = nullptr); /** updates filtering of MD contributions */ void update_mass_matrix(FieldName thisField); /** compute the mass matrix components coming from MD integration */ diff --git a/lib/atc/ATC_CouplingEnergy.cpp b/lib/atc/ATC_CouplingEnergy.cpp index c3b07c242d..8fae1f0703 100644 --- a/lib/atc/ATC_CouplingEnergy.cpp +++ b/lib/atc/ATC_CouplingEnergy.cpp @@ -30,8 +30,8 @@ namespace ATC { string matParamFile, ExtrinsicModelType extrinsicModel) : ATC_Coupling(groupName,perAtomArray,thisFix), - nodalAtomicKineticTemperature_(NULL), - nodalAtomicConfigurationalTemperature_(NULL) + nodalAtomicKineticTemperature_(nullptr), + nodalAtomicConfigurationalTemperature_(nullptr) { // Allocate PhysicsModel create_physics_model(THERMAL, matParamFile); @@ -103,7 +103,7 @@ namespace ATC { // always need kinetic energy AtomicEnergyForTemperature * atomicTwiceKineticEnergy = new TwiceKineticEnergy(this); - AtomicEnergyForTemperature * atomEnergyForTemperature = NULL; + AtomicEnergyForTemperature * atomEnergyForTemperature = nullptr; // Appropriate per-atom quantity based on desired temperature definition if (temperatureDef_==KINETIC) { diff --git a/lib/atc/ATC_CouplingMomentumEnergy.cpp b/lib/atc/ATC_CouplingMomentumEnergy.cpp index 1fc2931977..32df5fd7b9 100644 --- a/lib/atc/ATC_CouplingMomentumEnergy.cpp +++ b/lib/atc/ATC_CouplingMomentumEnergy.cpp @@ -32,8 +32,8 @@ namespace ATC { string matParamFile, ExtrinsicModelType extrinsicModel) : ATC_Coupling(groupName,perAtomArray,thisFix), - nodalAtomicKineticTemperature_(NULL), - nodalAtomicConfigurationalTemperature_(NULL), + nodalAtomicKineticTemperature_(nullptr), + nodalAtomicConfigurationalTemperature_(nullptr), refPE_(0) { // Allocate PhysicsModel @@ -190,7 +190,7 @@ namespace ATC { FieldManager fieldManager(this); PerAtomQuantity * fluctuatingAtomicVelocity = fieldManager.per_atom_quantity("AtomicFluctuatingVelocity"); // also creates ProlongedVelocity AtomicEnergyForTemperature * atomicTwiceKineticEnergy = new TwiceKineticEnergy(this,fluctuatingAtomicVelocity); - AtomicEnergyForTemperature * atomEnergyForTemperature = NULL; + AtomicEnergyForTemperature * atomEnergyForTemperature = nullptr; // Appropriate per-atom quantity based on desired temperature definition if (temperatureDef_==KINETIC) { diff --git a/lib/atc/ATC_Method.cpp b/lib/atc/ATC_Method.cpp index f2173e9575..113d175e26 100644 --- a/lib/atc/ATC_Method.cpp +++ b/lib/atc/ATC_Method.cpp @@ -35,37 +35,37 @@ using std::pair; namespace ATC { ATC_Method::ATC_Method(string groupName, double ** & perAtomArray, LAMMPS_NS::Fix * thisFix) : - nodalAtomicVolume_(NULL), + nodalAtomicVolume_(nullptr), needReset_(true), lammpsInterface_(LammpsInterface::instance()), interscaleManager_(this), timeFilterManager_(this), integrateInternalAtoms_(false), - atomTimeIntegrator_(NULL), + atomTimeIntegrator_(nullptr), ghostManager_(this), - feEngine_(NULL), + feEngine_(nullptr), initialized_(false), meshDataInitialized_(false), localStep_(0), sizeComm_(8), // 3 positions + 1 material id * 2 for output - atomCoarseGrainingPositions_(NULL), - atomGhostCoarseGrainingPositions_(NULL), - atomProcGhostCoarseGrainingPositions_(NULL), - atomReferencePositions_(NULL), + atomCoarseGrainingPositions_(nullptr), + atomGhostCoarseGrainingPositions_(nullptr), + atomProcGhostCoarseGrainingPositions_(nullptr), + atomReferencePositions_(nullptr), nNodes_(0), nsd_(lammpsInterface_->dimension()), - xref_(NULL), + xref_(nullptr), readXref_(false), needXrefProcessorGhosts_(false), trackDisplacement_(false), needsAtomToElementMap_(true), - atomElement_(NULL), - atomGhostElement_(NULL), + atomElement_(nullptr), + atomGhostElement_(nullptr), internalElementSet_(""), - atomMasses_(NULL), - atomPositions_(NULL), - atomVelocities_(NULL), - atomForces_(NULL), + atomMasses_(nullptr), + atomPositions_(nullptr), + atomVelocities_(nullptr), + atomForces_(nullptr), parallelConsistency_(true), outputNow_(false), outputTime_(true), @@ -79,13 +79,13 @@ namespace ATC { sizeVector_(0), scalarVectorFreq_(0), sizePerAtomCols_(4), - perAtomOutput_(NULL), + perAtomOutput_(nullptr), perAtomArray_(perAtomArray), extScalar_(0), extVector_(0), - extList_(NULL), + extList_(nullptr), thermoEnergyFlag_(0), - atomVolume_(NULL), + atomVolume_(nullptr), atomicWeightsWriteFlag_(false), atomicWeightsWriteFrequency_(0), atomWeightType_(LATTICE), @@ -103,12 +103,12 @@ namespace ATC { mdMassNormalization_(false), kernelBased_(false), kernelOnTheFly_(false), - kernelFunction_(NULL), + kernelFunction_(nullptr), bondOnTheFly_(false), - accumulant_(NULL), - accumulantMol_(NULL), - accumulantMolGrad_(NULL), - accumulantWeights_(NULL), + accumulant_(nullptr), + accumulantMol_(nullptr), + accumulantMolGrad_(nullptr), + accumulantWeights_(nullptr), accumulantInverseVolumes_(&invNodeVolumes_), accumulantBandwidth_(0), useRestart_(false), @@ -117,7 +117,7 @@ namespace ATC { setRefPEvalue_(false), refPEvalue_(0.), readRefPE_(false), - nodalRefPotentialEnergy_(NULL), + nodalRefPotentialEnergy_(nullptr), simTime_(0.0), stepCounter_(0) { @@ -1122,7 +1122,7 @@ pecified FieldName & thisField, int & thisIndex) { string thisName = args[argIdx++]; - if (args[argIdx] == NULL) { + if (args[argIdx] == nullptr) { throw ATC_Error("Need to give field '"+thisName+"' more args"); } thisField = string_to_field(thisName); @@ -1282,7 +1282,7 @@ pecified if (this->reset_methods()) { // clear memory manager interscaleManager_.clear_temporary_data(); - atomVolume_ = NULL; + atomVolume_ = nullptr; // reference positions and energy if (!initialized_) { @@ -1517,7 +1517,7 @@ pecified } else { // set variables to compute atomic weights - DENS_MAN * nodalVolume(NULL); + DENS_MAN * nodalVolume(nullptr); switch (atomWeightType_) { case USER: atomVolume_ = new AtomVolumeUser(this,Valpha_); diff --git a/lib/atc/ATC_Method.h b/lib/atc/ATC_Method.h index e356243e03..0779990a99 100644 --- a/lib/atc/ATC_Method.h +++ b/lib/atc/ATC_Method.h @@ -423,7 +423,7 @@ namespace ATC { bool use_md_mass_normalization() const { return mdMassNormalization_;} bool kernel_based() { return kernelBased_; } bool kernel_on_the_fly() const { return kernelOnTheFly_;} - bool has_kernel_function() { return kernelFunction_ != NULL; } + bool has_kernel_function() { return kernelFunction_ != nullptr; } KernelFunction * kernel_function() { return kernelFunction_; } std::vector & type_list() { return typeList_; } std::vector & group_list() { return groupList_; } diff --git a/lib/atc/ATC_Transfer.cpp b/lib/atc/ATC_Transfer.cpp index 833e1d1f27..a9e87e3ff9 100644 --- a/lib/atc/ATC_Transfer.cpp +++ b/lib/atc/ATC_Transfer.cpp @@ -68,19 +68,19 @@ namespace ATC { LAMMPS_NS::Fix * thisFix, string matParamFile) : ATC_Method(groupName,perAtomArray,thisFix), - xPointer_(NULL), + xPointer_(nullptr), outputStepZero_(true), neighborReset_(false), - pairMap_(NULL), - bondMatrix_(NULL), - pairVirial_(NULL), - pairHeatFlux_(NULL), + pairMap_(nullptr), + bondMatrix_(nullptr), + pairVirial_(nullptr), + pairHeatFlux_(nullptr), nComputes_(0), hasPairs_(true), hasBonds_(false), resetKernelFunction_(false), dxaExactMode_(true), - cauchyBornStress_(NULL) + cauchyBornStress_(nullptr) { nTypes_ = lammpsInterface_->ntypes(); @@ -114,7 +114,7 @@ namespace ATC { rateFlags_ = false; outputFields_.resize(NUM_TOTAL_FIELDS); - for (int i = 0; i < NUM_TOTAL_FIELDS; i++) { outputFields_[i] = NULL; } + for (int i = 0; i < NUM_TOTAL_FIELDS; i++) { outputFields_[i] = nullptr; } // Hardy requires ref positions for processor ghosts for bond list @@ -491,7 +491,7 @@ namespace ATC { ComputedAtomQuantity * c = new ComputedAtomQuantity(this, tag); interscaleManager_.add_per_atom_quantity(c,tag); int projection = iter->second; - DIAG_MAN * w = NULL; + DIAG_MAN * w = nullptr; if (projection == VOLUME_NORMALIZATION ) { w = accumulantInverseVolumes_; } else if (projection == NUMBER_NORMALIZATION ) @@ -976,7 +976,7 @@ namespace ATC { DENS_MAT & H = hardyData_["displacement_gradient"].set_quantity(); DENS_MAT E(H.nRows(),1); ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); //DENS_MAT & T = hardyData_["temperature"]; //cauchy_born_entropic_energy(H,E,T); E += hardyData_["internal_energy"]; cauchy_born_energy(H, E, temp); @@ -988,14 +988,14 @@ namespace ATC { // compute: cauchy born stress if (fieldFlags_(CAUCHY_BORN_STRESS)) { ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); cauchy_born_stress(hardyData_["displacement_gradient"].quantity(), hardyData_["cauchy_born_stress"].set_quantity(), temp); } // compute: cauchy born energy if (fieldFlags_(CAUCHY_BORN_ENERGY)) { ATOMIC_DATA::const_iterator tfield = hardyData_.find("temperature"); - const DENS_MAT *temp = tfield==hardyData_.end() ? NULL : &((tfield->second).quantity()); + const DENS_MAT *temp = tfield==hardyData_.end() ? nullptr : &((tfield->second).quantity()); cauchy_born_energy(hardyData_["displacement_gradient"].quantity(), hardyData_["cauchy_born_energy"].set_quantity(), temp); } diff --git a/lib/atc/Array.h b/lib/atc/Array.h index 21e66a9551..c29729d320 100644 --- a/lib/atc/Array.h +++ b/lib/atc/Array.h @@ -78,7 +78,7 @@ protected: template Array::Array(void) { len_ = 0; - data_ = NULL; + data_ = nullptr; } template @@ -90,8 +90,8 @@ Array::Array(int len) { template Array::Array(const Array& A) { len_ = A.len_; - if (A.data_==NULL) - data_ = NULL; + if (A.data_==nullptr) + data_ = nullptr; else { data_ = new T[len_]; for(int i=0;i::Array(const Array& A) { template Array::~Array() { - if (data_ != NULL) delete[] data_; + if (data_ != nullptr) delete[] data_; } template @@ -111,12 +111,12 @@ void Array::reset(int len) { } else { // size change, realloc memory len_ = len; - if (data_ != NULL) + if (data_ != nullptr) delete[] data_; if (len_ > 0) data_ = new T[len_]; else { - data_ = NULL; + data_ = nullptr; len_ = 0; } } @@ -130,7 +130,7 @@ void Array::resize(int len, bool copy) { else { // size change, realloc memory len_ = len; if (len_ > 0) { - if (copy && data_ != NULL) { + if (copy && data_ != nullptr) { Array temp(*this); delete[] data_; data_ = new T[len_]; @@ -140,12 +140,12 @@ void Array::resize(int len, bool copy) { } } else { - if (data_ != NULL) delete[] data_; + if (data_ != nullptr) delete[] data_; data_ = new T[len_]; } } else { - data_ = NULL; + data_ = nullptr; len_ = 0; } } @@ -158,10 +158,10 @@ T& Array::operator() (int i) { template Array& Array::operator= (const Array &other) { - if (data_ == NULL) { // initialize my internal storage to match LHS + if (data_ == nullptr) { // initialize my internal storage to match LHS len_ = other.len_; - if (other.data_==NULL) - data_ = NULL; + if (other.data_==nullptr) + data_ = nullptr; else data_ = new T[len_]; } @@ -250,7 +250,7 @@ T* Array::ptr() const { template void Array::print(std::string name) const { std::cout << "------- Begin "<::AliasArray(const Array& A) { template AliasArray::~AliasArray(void) { len_ = 0; - data_ = NULL; // trick base class into not deleting parent data + data_ = nullptr; // trick base class into not deleting parent data } template diff --git a/lib/atc/Array2D.h b/lib/atc/Array2D.h index 25f895f72c..37b7dcb3c9 100644 --- a/lib/atc/Array2D.h +++ b/lib/atc/Array2D.h @@ -57,7 +57,7 @@ template Array2D::Array2D() { nrows_ = 0; ncols_ = 0; - data_ = NULL; + data_ = nullptr; } template @@ -71,8 +71,8 @@ template Array2D::Array2D(const Array2D& A) { nrows_ = A.nrows_; ncols_ = A.ncols_; - if (A.data_==NULL) - data_ = NULL; + if (A.data_==nullptr) + data_ = nullptr; else { data_ = new T[nrows_ * ncols_]; for(int i=0;i::reset(int nrows, int ncols) { else { // size changed; realloc memory nrows_ = nrows; ncols_ = ncols; - if (data_ != NULL) + if (data_ != nullptr) delete [] data_; if (ncols_ > 0 && nrows_ > 0) data_ = new T[nrows_ * ncols_]; else { - data_ = NULL; + data_ = nullptr; nrows_ = 0; ncols_ = 0; } @@ -120,11 +120,11 @@ AliasArray Array2D::column(int col) const { template Array2D& Array2D::operator= (const Array2D& other) { - if (data_ == NULL) { // initialize my internal storage to match LHS + if (data_ == nullptr) { // initialize my internal storage to match LHS nrows_ = other.nrows_; ncols_ = other.ncols_; - if (other.data_==NULL) - data_ = NULL; + if (other.data_==nullptr) + data_ = nullptr; else data_ = new T[nrows_ * ncols_]; } @@ -170,14 +170,14 @@ void Array2D::write_restart(FILE *f) const { template Array2D::~Array2D() { - if (data_ != NULL) + if (data_ != nullptr) delete[] data_; } template void Array2D::print(std::string name) const { std::cout << "------- Begin "< >::iterator it = regulatorData_.find(tag); if (it == regulatorData_.end()) { data = new DENS_MAN(nNodes_,nCols); @@ -115,14 +115,14 @@ namespace ATC { //-------------------------------------------------------- // get_regulator_data: - // gets a pointer to the requested data, or NULL if + // gets a pointer to the requested data, or nullptr if // if doesn't exist //-------------------------------------------------------- const DENS_MAN * AtomicRegulator::regulator_data(const string tag) const { map >::const_iterator it = regulatorData_.find(tag); if (it == regulatorData_.end()) { - return NULL; + return nullptr; } else { return const_cast((it->second).second); @@ -521,7 +521,7 @@ namespace ATC { fieldMask_(NUM_FIELDS,NUM_FLUX), nNodes_(atomicRegulator_->num_nodes()), regulatorPrefix_(atomicRegulator->regulator_prefix()+regulatorPrefix), - shpFcnDerivs_(NULL) + shpFcnDerivs_(nullptr) { fieldMask_ = false; } @@ -552,21 +552,21 @@ namespace ATC { RegulatorShapeFunction::RegulatorShapeFunction(AtomicRegulator * atomicRegulator, const string & regulatorPrefix) : RegulatorMethod(atomicRegulator,regulatorPrefix), - lambda_(NULL), - atomLambdas_(NULL), - shapeFunctionMatrix_(NULL), + lambda_(nullptr), + atomLambdas_(nullptr), + shapeFunctionMatrix_(nullptr), linearSolverType_(AtomicRegulator::NO_SOLVE), maxIterations_(atomicRegulator->max_iterations()), tolerance_(atomicRegulator->tolerance()), - matrixSolver_(NULL), - regulatedNodes_(NULL), - applicationNodes_(NULL), - boundaryNodes_(NULL), - shpFcn_(NULL), - atomicWeights_(NULL), - elementMask_(NULL), - lambdaAtomMap_(NULL), - weights_(NULL), + matrixSolver_(nullptr), + regulatedNodes_(nullptr), + applicationNodes_(nullptr), + boundaryNodes_(nullptr), + shpFcn_(nullptr), + atomicWeights_(nullptr), + elementMask_(nullptr), + lambdaAtomMap_(nullptr), + weights_(nullptr), nsd_(atomicRegulator_->nsd()), nLocal_(atomicRegulator_->nlocal()) { diff --git a/lib/atc/AtomicRegulator.h b/lib/atc/AtomicRegulator.h index b9fccb902c..360af3a4f6 100644 --- a/lib/atc/AtomicRegulator.h +++ b/lib/atc/AtomicRegulator.h @@ -143,7 +143,7 @@ namespace ATC { /** can externally set regulator dynamic contributions */ virtual void reset_lambda_contribution(const DENS_MAT & /* target */, const FieldName /* field */) {}; virtual void reset_lambda_contribution(const DENS_MAT & target) { reset_lambda_contribution(target,NUM_TOTAL_FIELDS); } - /** returns a const pointer to the DENS_MAN associated with the tag, or NULL */ + /** returns a const pointer to the DENS_MAN associated with the tag, or nullptr */ const DENS_MAN * regulator_data(const std::string tag) const; /** return the maximum number of iterations */ int max_iterations() {return maxIterations_;}; diff --git a/lib/atc/CauchyBorn.cpp b/lib/atc/CauchyBorn.cpp index 85b100ca64..81f7b4e1a8 100644 --- a/lib/atc/CauchyBorn.cpp +++ b/lib/atc/CauchyBorn.cpp @@ -426,7 +426,7 @@ namespace ATC { for (INDEX j=i; j<3; j++) s(i,j) += factor * dd(i,j); - // If f_W is not NULL then append thermal contribution. + // If f_W is not nullptr then append thermal contribution. if (F_w) *F_w += 0.5*kb*T*log(detD); } //============================================================================ diff --git a/lib/atc/ChargeRegulator.cpp b/lib/atc/ChargeRegulator.cpp index bae78a7613..972530829c 100644 --- a/lib/atc/ChargeRegulator.cpp +++ b/lib/atc/ChargeRegulator.cpp @@ -164,7 +164,7 @@ namespace ATC { chargeRegulator_(chargeRegulator), lammpsInterface_(LammpsInterface::instance()), rC_(0), rCsq_(0), - targetValue_(NULL), + targetValue_(nullptr), targetPhi_(p.value), surface_(p.faceset), atomGroupBit_(p.groupBit), diff --git a/lib/atc/CloneVector.h b/lib/atc/CloneVector.h index 02db700f27..63d11636b3 100644 --- a/lib/atc/CloneVector.h +++ b/lib/atc/CloneVector.h @@ -52,7 +52,7 @@ private: //----------------------------------------------------------------------------- template CloneVector::CloneVector(const Vector &c) - : Vector(), _baseV(const_cast*>(&c)), _baseM(NULL) + : Vector(), _baseV(const_cast*>(&c)), _baseM(nullptr) {} //----------------------------------------------------------------------------- // Construct from a matrix, the const_cast isn't pretty @@ -65,7 +65,7 @@ CloneVector::CloneVector(const Vector &c) //----------------------------------------------------------------------------- template CloneVector::CloneVector(const Matrix &c, int dim, INDEX idx) - : Vector(), _baseV(NULL), _baseM(const_cast*>(&c)) + : Vector(), _baseV(nullptr), _baseM(const_cast*>(&c)) , _clone_type(dim), _idx(idx) {} //----------------------------------------------------------------------------- @@ -73,7 +73,7 @@ CloneVector::CloneVector(const Matrix &c, int dim, INDEX idx) //----------------------------------------------------------------------------- template CloneVector::CloneVector(const DiagonalMatrix &c, INDEX /* idx */) - : Vector(), _baseV(NULL), _baseM(const_cast*>(&c)) + : Vector(), _baseV(nullptr), _baseM(const_cast*>(&c)) , _clone_type(CLONE_DIAG), _idx(0) {} //----------------------------------------------------------------------------- diff --git a/lib/atc/ConcentrationRegulator.cpp b/lib/atc/ConcentrationRegulator.cpp index 4255b919b9..499a5501c1 100644 --- a/lib/atc/ConcentrationRegulator.cpp +++ b/lib/atc/ConcentrationRegulator.cpp @@ -186,14 +186,14 @@ const double kMinScale_ = 10000.; ConcentrationRegulator::ConcentrationRegulatorParameters & p) : ConcentrationRegulatorMethod(concReg), concentrationRegulator_(concReg), - interscaleManager_(NULL), + interscaleManager_(nullptr), lammpsInterface_(LammpsInterface::instance()), - list_(NULL), + list_(nullptr), targetConcentration_(p.value), targetCount_(0), elemset_(p.elemset), - p_(NULL), - randomNumberGenerator_(NULL), + p_(nullptr), + randomNumberGenerator_(nullptr), q0_(0), controlType_(p.type), controlIndex_(0), diff --git a/lib/atc/DenseMatrix.h b/lib/atc/DenseMatrix.h index e585289aaa..e4759f02d4 100644 --- a/lib/atc/DenseMatrix.h +++ b/lib/atc/DenseMatrix.h @@ -16,10 +16,10 @@ template class DenseMatrix : public Matrix { public: - DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(NULL){ _create(rows, cols, z); } - DenseMatrix(const DenseMatrix& c) : Matrix(), _data(NULL){ _copy(c); } - DenseMatrix(const SparseMatrix& c): Matrix(), _data(NULL){ c.dense_copy(*this);} - DenseMatrix(const Matrix& c) : Matrix(), _data(NULL){ _copy(c); } + DenseMatrix(INDEX rows=0, INDEX cols=0, bool z=1): _data(nullptr){ _create(rows, cols, z); } + DenseMatrix(const DenseMatrix& c) : Matrix(), _data(nullptr){ _copy(c); } + DenseMatrix(const SparseMatrix& c): Matrix(), _data(nullptr){ c.dense_copy(*this);} + DenseMatrix(const Matrix& c) : Matrix(), _data(nullptr){ _copy(c); } // const SparseMatrix * p = sparse_cast(&c); // (p) ? p->dense_copy(*this) : _copy(c); } ~DenseMatrix() { _delete();} @@ -261,7 +261,7 @@ void DenseMatrix::_delete() _nRows = _nCols = 0; if (_data){ delete [] _data; - _data = NULL; + _data = nullptr; } } //---------------------------------------------------------------------------- @@ -273,7 +273,7 @@ void DenseMatrix::_create(INDEX rows, INDEX cols, bool zero) _nRows=rows; _nCols=cols; - _data = (this->size() ? new T [_nCols*_nRows] : NULL); + _data = (this->size() ? new T [_nCols*_nRows] : nullptr); if (zero) this->zero(); } //---------------------------------------------------------------------------- diff --git a/lib/atc/DenseVector.h b/lib/atc/DenseVector.h index 38ed68f937..bab90bf3ff 100644 --- a/lib/atc/DenseVector.h +++ b/lib/atc/DenseVector.h @@ -16,9 +16,9 @@ class DenseVector : public Vector { public: explicit DenseVector(INDEX n=0, bool z=1) { _create(n,z); } - DenseVector(const DenseVector &c) : Vector(), _data(NULL) { _copy(c); } - DenseVector(const Vector &c) : Vector(), _data(NULL) { _copy(c); } - DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(NULL) { copy(ptr,nrows); } + DenseVector(const DenseVector &c) : Vector(), _data(nullptr) { _copy(c); } + DenseVector(const Vector &c) : Vector(), _data(nullptr) { _copy(c); } + DenseVector(const T * ptr, INDEX nrows) : Vector(), _data(nullptr) { copy(ptr,nrows); } virtual ~DenseVector() { _delete(); } //* resizes the Vector, ignores nCols, optionally copys what fits @@ -123,7 +123,7 @@ template inline void DenseVector::_create(INDEX n, bool zero) { _size=n; - _data = _size ? new T [_size] : NULL ; + _data = _size ? new T [_size] : nullptr ; if (zero) this->zero(); } /////////////////////////////////////////////////////////////////////////////// diff --git a/lib/atc/DiagonalMatrix.h b/lib/atc/DiagonalMatrix.h index ca3001f225..b24e19dd4e 100644 --- a/lib/atc/DiagonalMatrix.h +++ b/lib/atc/DiagonalMatrix.h @@ -205,7 +205,7 @@ DiagonalMatrix operator-(const DiagonalMatrix &A, const DiagonalMatrix //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) - : _data(NULL) + : _data(nullptr) { reset(rows, zero); } @@ -214,7 +214,7 @@ DiagonalMatrix::DiagonalMatrix(INDEX rows, bool zero) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) - : Matrix(), _data(NULL) + : Matrix(), _data(nullptr) { reset(c); } @@ -223,7 +223,7 @@ DiagonalMatrix::DiagonalMatrix(const DiagonalMatrix& c) //----------------------------------------------------------------------------- template DiagonalMatrix::DiagonalMatrix(const Vector& v) - : Matrix(), _data(NULL) + : Matrix(), _data(nullptr) { reset(v); } diff --git a/lib/atc/DislocationExtractor.h b/lib/atc/DislocationExtractor.h index c2bfe27e04..a0ba3aa995 100644 --- a/lib/atc/DislocationExtractor.h +++ b/lib/atc/DislocationExtractor.h @@ -197,7 +197,7 @@ protected: a.pos.Y = atom->x[i][1]; a.pos.Z = atom->x[i][2]; a.flags = 0; - a.cluster = NULL; + a.cluster = nullptr; a.numNeighbors = 0; a.setFlag(ATOM_IS_LOCAL_ATOM); } @@ -290,7 +290,7 @@ protected: currentAtom->pos.Y = atom->x[i][1]; currentAtom->pos.Z = atom->x[i][2]; currentAtom->flags = 0; - currentAtom->cluster = NULL; + currentAtom->cluster = nullptr; currentAtom->numNeighbors = 0; currentAtom->setFlag(ATOM_IS_LOCAL_ATOM); } @@ -302,7 +302,7 @@ protected: // Receive atoms from other processors. for(int iproc = 1; iproc < comm->nprocs; iproc++) { MPI_Status status; - MPI_Recv(buffer.empty() ? NULL : &buffer.front(), nlocalatoms_max * 3, MPI_DOUBLE, iproc, 0, world, &status); + MPI_Recv(buffer.empty() ? nullptr : &buffer.front(), nlocalatoms_max * 3, MPI_DOUBLE, iproc, 0, world, &status); int ndoubles; MPI_Get_count(&status, MPI_DOUBLE, &ndoubles); int nReceived = ndoubles / 3; @@ -314,7 +314,7 @@ protected: currentAtom->pos.Y = *data++; currentAtom->pos.Z = *data++; currentAtom->flags = 0; - currentAtom->cluster = NULL; + currentAtom->cluster = nullptr; currentAtom->numNeighbors = 0; currentAtom->setFlag(ATOM_IS_LOCAL_ATOM); } @@ -332,11 +332,11 @@ protected: *data++ = atom->x[i][2]; } // Send local atom coordinates to master proc. - MPI_Send(buffer.empty() ? NULL : &buffer.front(), buffer.size(), MPI_DOUBLE, 0, 0, world); + MPI_Send(buffer.empty() ? nullptr : &buffer.front(), buffer.size(), MPI_DOUBLE, 0, 0, world); } // Make sure all input atoms are wrapped at periodic boundary conditions. - wrapInputAtoms(NULL_VECTOR); + wrapInputAtoms(nullptr_VECTOR); // Build nearest neighbor lists. buildNearestNeighborLists(); @@ -376,7 +376,7 @@ protected: } } // Broadcast segments. - MPI_Bcast(segmentBuffer.empty() ? NULL : &segmentBuffer.front(), segmentBuffer.size() * sizeof(segmentBuffer[0]), MPI_CHAR, 0, world); + MPI_Bcast(segmentBuffer.empty() ? nullptr : &segmentBuffer.front(), segmentBuffer.size() * sizeof(segmentBuffer[0]), MPI_CHAR, 0, world); if(processor != 0) { // Extract segments from receive buffer. @@ -402,7 +402,7 @@ protected: DISLOCATIONS_ASSERT(sendItem == pointBuffer.end()); } // Broadcast segments. - MPI_Bcast(pointBuffer.empty() ? NULL : &pointBuffer.front(), pointBuffer.size() * sizeof(pointBuffer[0]), MPI_CHAR, 0, world); + MPI_Bcast(pointBuffer.empty() ? nullptr : &pointBuffer.front(), pointBuffer.size() * sizeof(pointBuffer[0]), MPI_CHAR, 0, world); if(processor != 0) { // Extract points from receive buffer. diff --git a/lib/atc/ElasticTimeIntegrator.cpp b/lib/atc/ElasticTimeIntegrator.cpp index 5e11f1584c..785568cbb2 100644 --- a/lib/atc/ElasticTimeIntegrator.cpp +++ b/lib/atc/ElasticTimeIntegrator.cpp @@ -184,8 +184,8 @@ namespace ATC { displacement_(atc_->field(DISPLACEMENT)), nodalAtomicDisplacementOut_(atc_->nodal_atomic_field(DISPLACEMENT)), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicDisplacement_(NULL), - nodalAtomicForce_(NULL) + nodalAtomicDisplacement_(nullptr), + nodalAtomicForce_(nullptr) { // do nothing } @@ -410,9 +410,9 @@ namespace ATC { displacement_(atc_->field(DISPLACEMENT)), nodalAtomicDisplacementOut_(atc_->nodal_atomic_field(DISPLACEMENT)), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalAtomicMomentumFiltered_(momentumTimeIntegrator->nodal_atomic_momentum_filtered()), - nodalAtomicDisplacement_(NULL), + nodalAtomicDisplacement_(nullptr), nodalAtomicMomentumOld_(atc_->num_nodes(),atc_->nsd()), nodalAtomicVelocityOld_(atc_->num_nodes(),atc_->nsd()) { @@ -633,7 +633,7 @@ namespace ATC { FluidsTimeIntegratorGear::FluidsTimeIntegratorGear(MomentumTimeIntegrator * momentumTimeIntegrator) : MomentumIntegrationMethod(momentumTimeIntegrator), nodalAtomicForceFiltered_(momentumTimeIntegrator->nodal_atomic_force_filtered()), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalAtomicMomentumFiltered_(momentumTimeIntegrator->nodal_atomic_momentum_filtered()), atomicVelocityDelta_(atc_->num_nodes(),atc_->nsd()), nodalAtomicMomentumOld_(atc_->num_nodes(),atc_->nsd()), diff --git a/lib/atc/ElectronHeatFlux.h b/lib/atc/ElectronHeatFlux.h index d0bc2a44f2..4c5b6200d3 100644 --- a/lib/atc/ElectronHeatFlux.h +++ b/lib/atc/ElectronHeatFlux.h @@ -17,7 +17,7 @@ namespace ATC { class ElectronHeatFlux { public: - ElectronHeatFlux(/*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + ElectronHeatFlux(/*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFlux() {}; /** computes heat flux */ virtual void electron_heat_flux(const FIELD_MATS &fields, @@ -68,7 +68,7 @@ namespace ATC { { public: ElectronHeatFluxLinear(std::fstream &matfile,std::map & parameters, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxLinear() {}; virtual void electron_heat_flux(const FIELD_MATS & /* fields */, const GRAD_FIELD_MATS &gradFields, @@ -95,7 +95,7 @@ namespace ATC { { public: ElectronHeatFluxPowerLaw(std::fstream &matfile,std::map ¶meters, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxPowerLaw() {}; virtual void electron_heat_flux(const FIELD_MATS &fields, const GRAD_FIELD_MATS &gradFields, @@ -134,8 +134,8 @@ ctivity proportional to the ratio of the electron and phonon temperatures with t public: ElectronHeatFluxThermopower(std::fstream &matfile, std::map & parameters, - /*const*/ ElectronFlux * electronFlux = NULL, - /*const*/ ElectronHeatCapacity * electronHeatCapacity = NULL); + /*const*/ ElectronFlux * electronFlux = nullptr, + /*const*/ ElectronHeatCapacity * electronHeatCapacity = nullptr); virtual ~ElectronHeatFluxThermopower() {}; virtual void electron_heat_flux(const FIELD_MATS &fields, const GRAD_FIELD_MATS &gradFields, diff --git a/lib/atc/ExtrinsicModel.cpp b/lib/atc/ExtrinsicModel.cpp index b20b2a26d1..8e0079d965 100644 --- a/lib/atc/ExtrinsicModel.cpp +++ b/lib/atc/ExtrinsicModel.cpp @@ -114,7 +114,7 @@ namespace ATC { ATC::LammpsInterface::instance()->print_msg_once(ss.str()); myModel = new ExtrinsicModelElectrostatic (this,modelType,matFileName); - } else myModel = NULL; + } else myModel = nullptr; extrinsicModels_.push_back(myModel); // add new fields to fields data @@ -157,7 +157,7 @@ namespace ATC { for(imodel=extrinsicModels_.begin(); imodel!=extrinsicModels_.end(); imodel++) { if ((*imodel)->model_type()==type) return *imodel; } - return NULL; + return nullptr; } @@ -343,7 +343,7 @@ namespace ATC { atc_(modelManager->atc()), modelManager_(modelManager), modelType_(modelType), - physicsModel_(NULL) + physicsModel_(nullptr) { rhsMaskIntrinsic_.reset(NUM_FIELDS,NUM_FLUX); rhsMaskIntrinsic_ = false; diff --git a/lib/atc/ExtrinsicModelDriftDiffusion.cpp b/lib/atc/ExtrinsicModelDriftDiffusion.cpp index f9b93a147a..a9d8f27604 100644 --- a/lib/atc/ExtrinsicModelDriftDiffusion.cpp +++ b/lib/atc/ExtrinsicModelDriftDiffusion.cpp @@ -38,17 +38,17 @@ namespace ATC { ExtrinsicModelType modelType, string matFileName) : ExtrinsicModelTwoTemperature(modelManager,modelType,matFileName), - continuityIntegrator_(NULL), + continuityIntegrator_(nullptr), poissonSolverType_(DIRECT), // ITERATIVE | DIRECT - poissonSolver_(NULL), + poissonSolver_(nullptr), baseSize_(0), electronDensityEqn_(ELECTRON_CONTINUITY), fluxUpdateFreq_(1), schrodingerSolverType_(DIRECT), // ITERATIVE | DIRECT - schrodingerSolver_(NULL), + schrodingerSolver_(nullptr), schrodingerPoissonMgr_(), - schrodingerPoissonSolver_(NULL), + schrodingerPoissonSolver_(nullptr), maxConsistencyIter_(0), maxConstraintIter_(1), safe_dEf_(0.1), Ef_shift_(0.0), oneD_(false), oneDcoor_(0), oneDconserve_(0) @@ -351,7 +351,7 @@ namespace ATC { ExtrinsicModelType modelType, string matFileName) : ExtrinsicModelDriftDiffusion(modelManager,modelType,matFileName), - cddmPoissonSolver_(NULL), + cddmPoissonSolver_(nullptr), baseSize_(0) { // delete base class's version of the physics model diff --git a/lib/atc/ExtrinsicModelElectrostatic.cpp b/lib/atc/ExtrinsicModelElectrostatic.cpp index ef3aa52dee..d0aa56d67d 100644 --- a/lib/atc/ExtrinsicModelElectrostatic.cpp +++ b/lib/atc/ExtrinsicModelElectrostatic.cpp @@ -38,15 +38,15 @@ namespace ATC { poissonSolverType_(DIRECT), // ITERATIVE | DIRECT poissonSolverTol_(0), poissonSolverMaxIter_(0), - poissonSolver_(NULL), + poissonSolver_(nullptr), maxSolves_(0), baseSize_(0), - chargeRegulator_(NULL), + chargeRegulator_(nullptr), useSlab_(false), includeShortRange_(true), - atomForces_(NULL), - nodalAtomicCharge_(NULL), - nodalAtomicGhostCharge_(NULL) + atomForces_(nullptr), + nodalAtomicCharge_(nullptr), + nodalAtomicGhostCharge_(nullptr) { physicsModel_ = new PhysicsModelSpeciesElectrostatic(matFileName); // set up correct masks for coupling diff --git a/lib/atc/ExtrinsicModelTwoTemperature.cpp b/lib/atc/ExtrinsicModelTwoTemperature.cpp index 2be6cfeb3c..35846fe496 100644 --- a/lib/atc/ExtrinsicModelTwoTemperature.cpp +++ b/lib/atc/ExtrinsicModelTwoTemperature.cpp @@ -26,7 +26,7 @@ namespace ATC { string matFileName) : ExtrinsicModel(modelManager,modelType,matFileName), electronTimeIntegration_(TimeIntegrator::IMPLICIT), - temperatureIntegrator_(NULL), + temperatureIntegrator_(nullptr), nsubcycle_(1), exchangeFlag_(true), baseSize_(0) @@ -164,7 +164,7 @@ namespace ATC { rhsMask(ELECTRON_TEMPERATURE,i) = atc_->fieldMask_(ELECTRON_TEMPERATURE,i); } if (electronTimeIntegration_ == TimeIntegrator::NONE) { - temperatureIntegrator_ = NULL; + temperatureIntegrator_ = nullptr; return; } if (temperatureIntegrator_) delete temperatureIntegrator_; diff --git a/lib/atc/FE_Element.cpp b/lib/atc/FE_Element.cpp index 0d2fc036c7..299b9f191d 100644 --- a/lib/atc/FE_Element.cpp +++ b/lib/atc/FE_Element.cpp @@ -36,7 +36,7 @@ static const double localCoordinatesTolerance = 1.e-09; tolerance_(localCoordinatesTolerance), projectionGuess_(COORDINATE_ALIGNED) { - feInterpolate_ = NULL; + feInterpolate_ = nullptr; } FE_Element::~FE_Element() diff --git a/lib/atc/FE_Engine.cpp b/lib/atc/FE_Engine.cpp index 5e01709b19..9e3c5180e2 100644 --- a/lib/atc/FE_Engine.cpp +++ b/lib/atc/FE_Engine.cpp @@ -32,7 +32,7 @@ namespace ATC{ //----------------------------------------------------------------- FE_Engine::FE_Engine(MPI_Comm comm) : communicator_(comm), - feMesh_(NULL), + feMesh_(nullptr), initialized_(false), outputManager_() { diff --git a/lib/atc/FE_Engine.h b/lib/atc/FE_Engine.h index eb59f04eef..ade7626f80 100644 --- a/lib/atc/FE_Engine.h +++ b/lib/atc/FE_Engine.h @@ -90,7 +90,7 @@ namespace ATC { /** write data: data is arrayed over _unique_ nodes and then mapped by the engine */ - void write_data(double time, FIELDS &soln, OUTPUT_LIST *data=NULL); + void write_data(double time, FIELDS &soln, OUTPUT_LIST *data=nullptr); void write_data(double time, OUTPUT_LIST *data); void write_restart_file(std::string fileName, RESTART_LIST *data) @@ -150,7 +150,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, SPAR_MAT &tangent, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute tangent matrix for a pair of fields - given quadrature */ void compute_tangent_matrix(const RHS_MASK &rhsMask, @@ -162,7 +162,7 @@ namespace ATC { const SPAR_MAT &N, const SPAR_MAT_VEC &dN, SPAR_MAT &tangent, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute a consistent mass matrix for a field */ void compute_mass_matrix( @@ -171,7 +171,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, CON_MASS_MATS &mass_matrix, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute a dimensionless mass matrix */ void compute_mass_matrix(SPAR_MAT &mass_matrix) const; @@ -191,7 +191,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, MASS_MATS &mass_matrix, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute dimensional lumped mass matrix using given quadrature */ void compute_lumped_mass_matrix( @@ -212,7 +212,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, FIELD_MATS &energy, - const DenseMatrix *elementMask=NULL, + const DenseMatrix *elementMask=nullptr, const IntegrationDomainType domain=FULL_DOMAIN) const; /** compute residual or RHS of the dynamic weak eqn */ @@ -223,7 +223,7 @@ namespace ATC { const Array &elementMaterials, FIELDS &rhs, bool freeOnly=false, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute RHS for given quadrature */ void compute_rhs_vector(const RHS_MASK &rhsMask, @@ -251,7 +251,7 @@ namespace ATC { const PhysicsModel *physicsModel, const Array &elementMaterials, GRAD_FIELD_MATS &flux, - const DenseMatrix *elementMask=NULL) const; + const DenseMatrix *elementMask=nullptr) const; /** compute the flux on the MD/FE boundary */ void compute_boundary_flux(const RHS_MASK &rhsMask, @@ -272,8 +272,8 @@ namespace ATC { const SPAR_MAT_VEC &dN, const DIAG_MAT &flux_mask, FIELDS &rhs, - const DenseMatrix *elementMask=NULL, - const std::set *nodeSet=NULL) const; + const DenseMatrix *elementMask=nullptr, + const std::set *nodeSet=nullptr) const; /** compute prescribed flux given an array of functions of x & t */ void add_fluxes(const Array &fieldMask, @@ -465,7 +465,7 @@ namespace ATC { int nsd() const { return feMesh_->num_spatial_dimensions(); } /** return if the FE mesh has been created */ - int has_mesh() const { return feMesh_!=NULL; } + int has_mesh() const { return feMesh_!=nullptr; } /** get nodal coordinates for a given element */ void element_coordinates(const int eltIdx, DENS_MAT &coords) diff --git a/lib/atc/FE_Mesh.cpp b/lib/atc/FE_Mesh.cpp index 4ea10a681a..6af29ee37e 100644 --- a/lib/atc/FE_Mesh.cpp +++ b/lib/atc/FE_Mesh.cpp @@ -46,7 +46,7 @@ namespace ATC { partitioned_(false), nNodes_(0), nNodesUnique_(0), - feElement_(NULL), + feElement_(nullptr), twoDimensional_(false), hasPlanarFaces_(false) @@ -1708,7 +1708,7 @@ namespace ATC { const Array< pair< string, set > > *nodeSets): FE_Mesh(), minEltSize_(0), - tree_(NULL) + tree_(nullptr) { // Pick which element class to make if (elementType == "HEX8") { @@ -1774,7 +1774,7 @@ namespace ATC { } // Insert nodes and elements into KD-tree for PIE search. - if (tree_ == NULL) { + if (tree_ == nullptr) { tree_ = KD_Tree::create_KD_tree(feElement_->num_elt_nodes(), nNodes_, &nodalCoords_, nElts_, connectivity_); } @@ -2107,7 +2107,7 @@ namespace ATC { // use the KD tree for partitioning, getting more blocks than // processors - if (tree_ == NULL) { + if (tree_ == nullptr) { tree_ = KD_Tree::create_KD_tree(feElement_->num_elt_nodes(), nNodes_, &nodalCoords_, nElts_, connectivity_); @@ -2519,7 +2519,7 @@ namespace ATC { const double zscale) : hx_(hx), hy_(hy), hz_(hz) { - tree_ = NULL; + tree_ = nullptr; hasPlanarFaces_ = true; xscale_ = xscale; yscale_ = yscale; @@ -2820,7 +2820,7 @@ namespace ATC { const double zscale) { hasPlanarFaces_ = true; - tree_ = NULL; + tree_ = nullptr; xscale_ = xscale; yscale_ = yscale; zscale_ = zscale; diff --git a/lib/atc/FieldEulerIntegrator.cpp b/lib/atc/FieldEulerIntegrator.cpp index 0abc71cbab..ba23af40c9 100644 --- a/lib/atc/FieldEulerIntegrator.cpp +++ b/lib/atc/FieldEulerIntegrator.cpp @@ -112,7 +112,7 @@ FieldImplicitDirectEulerIntegrator::FieldImplicitDirectEulerIntegrator( const Array2D< bool > & rhsMask, // copy const double alpha ) : FieldEulerIntegrator(fieldName,physicsModel,feEngine,atc,rhsMask), - alpha_(alpha),solver_(NULL) + alpha_(alpha),solver_(nullptr) { rhsMask_(fieldName_,FLUX) = false; // handle laplacian term with stiffness const BC_SET & bcs = (atc_->prescribed_data_manager()->bcs(fieldName_))[0]; diff --git a/lib/atc/FieldManager.cpp b/lib/atc/FieldManager.cpp index 338f06acad..8a7fb0d50b 100644 --- a/lib/atc/FieldManager.cpp +++ b/lib/atc/FieldManager.cpp @@ -271,7 +271,7 @@ typedef PerAtomQuantity PAQ; u = new AtfShapeFunctionMdProjection(atc_,restricted,VELOCITY); } else { - DENS_MAN * q = NULL; + DENS_MAN * q = nullptr; if (atc_->kernel_on_the_fly()) { if (atc_->kernel_based()) { q = new OnTheFlyKernelAccumulationNormalized(atc_, atomic, diff --git a/lib/atc/FieldManager.h b/lib/atc/FieldManager.h index 9a98676417..b12db230c5 100644 --- a/lib/atc/FieldManager.h +++ b/lib/atc/FieldManager.h @@ -47,7 +47,7 @@ namespace ATC { case SPECIES_FLUX: return species_flux(name); case INTERNAL_ENERGY: return internal_energy(name); case ENERGY: return energy(name); - default: throw ATC_Error("FieldManager:: unknown field"); return NULL; + default: throw ATC_Error("FieldManager:: unknown field"); return nullptr; } } CanonicalName string_to_canonical_name(std::string name){ @@ -83,11 +83,11 @@ namespace ATC { case PROLONGED_VELOCITY: return prolonged_field(VELOCITY); default: - throw ATC_Error("FieldManager:: unknown PAQ"); return NULL; + throw ATC_Error("FieldManager:: unknown PAQ"); return nullptr; } } /** this function returns a restriction of atomic data */ - DENS_MAN * restricted_atom_quantity(FieldName field, std::string name = "default", PAQ * atomi = NULL); + DENS_MAN * restricted_atom_quantity(FieldName field, std::string name = "default", PAQ * atomi = nullptr); protected: ATC_Method * atc_; InterscaleManager & interscaleManager_; @@ -120,10 +120,10 @@ namespace ATC { PAQ * atomic_species_vector(); // internal functions - DENS_MAN * projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, DIAG_MAN * normalization = NULL); - DENS_MAN * scaled_projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, double scale, DIAG_MAN * normalization = NULL); - DENS_MAN * referenced_projected_atom_quantity(FieldName field, std::string name, PAQ * atomic, DENS_MAN * reference, DIAG_MAN * normalization = NULL); - DENS_MAN * inferred_atom_quantity(FieldName /* field */, std::string /* name */, PAQ * /* atomic */){return NULL;}; + DENS_MAN * projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, DIAG_MAN * normalization = nullptr); + DENS_MAN * scaled_projected_atom_quantity(FieldName field,std::string name, PAQ * atomic, double scale, DIAG_MAN * normalization = nullptr); + DENS_MAN * referenced_projected_atom_quantity(FieldName field, std::string name, PAQ * atomic, DENS_MAN * reference, DIAG_MAN * normalization = nullptr); + DENS_MAN * inferred_atom_quantity(FieldName /* field */, std::string /* name */, PAQ * /* atomic */){return nullptr;}; PAQ * prolonged_field(FieldName field); private: FieldManager(void); diff --git a/lib/atc/Function.cpp b/lib/atc/Function.cpp index 062cbcb9b2..e73d64aaea 100644 --- a/lib/atc/Function.cpp +++ b/lib/atc/Function.cpp @@ -26,13 +26,13 @@ namespace ATC { //==================================================================== // UXT_Function_Mgr //==================================================================== - UXT_Function_Mgr * UXT_Function_Mgr::myInstance_ = NULL; + UXT_Function_Mgr * UXT_Function_Mgr::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- UXT_Function_Mgr * UXT_Function_Mgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new UXT_Function_Mgr(); } return myInstance_; @@ -90,7 +90,7 @@ namespace ATC { { string tag = other->tag(); - UXT_Function * returnFunction = NULL; + UXT_Function * returnFunction = nullptr; if (tag=="linear") { ScalarLinearFunction * other_cast = (ScalarLinearFunction*) other; returnFunction = new ScalarLinearFunction(*other_cast); @@ -144,14 +144,14 @@ namespace ATC { // XT_Function_Mgr //-------------------------------------------------------------------- //-------------------------------------------------------------------- -XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; +XT_Function_Mgr * XT_Function_Mgr::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- XT_Function_Mgr * XT_Function_Mgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new XT_Function_Mgr(); } return myInstance_; @@ -227,7 +227,7 @@ XT_Function_Mgr * XT_Function_Mgr::myInstance_ = NULL; { string tag = other->tag(); - XT_Function * returnFunction = NULL; + XT_Function * returnFunction = nullptr; if (tag=="linear") { LinearFunction * other_cast = (LinearFunction*) other; returnFunction = new LinearFunction(*other_cast); diff --git a/lib/atc/FundamentalAtomicQuantity.cpp b/lib/atc/FundamentalAtomicQuantity.cpp index 0ebb54e168..63824bd0dd 100644 --- a/lib/atc/FundamentalAtomicQuantity.cpp +++ b/lib/atc/FundamentalAtomicQuantity.cpp @@ -126,7 +126,7 @@ namespace ATC { double unitsConversion, AtomType atomType) : ShallowAtomQuantity(atc,0,atomType), - computePointer_(NULL), + computePointer_(nullptr), computeTag_(tag), unitsConversion_(unitsConversion) { diff --git a/lib/atc/FundamentalAtomicQuantity.h b/lib/atc/FundamentalAtomicQuantity.h index 5fb525cd6f..d5cf9f8a21 100644 --- a/lib/atc/FundamentalAtomicQuantity.h +++ b/lib/atc/FundamentalAtomicQuantity.h @@ -131,11 +131,11 @@ namespace ATC { /** gets appropriate pointer for lammps data */ virtual double * lammps_scalar() const - {return NULL;}; + {return nullptr;}; /** gets appropriate pointer for lammps data */ virtual double ** lammps_vector() const - {return NULL;}; + {return nullptr;}; private: diff --git a/lib/atc/GhostManager.cpp b/lib/atc/GhostManager.cpp index 77594ec406..1482a5a47d 100644 --- a/lib/atc/GhostManager.cpp +++ b/lib/atc/GhostManager.cpp @@ -23,7 +23,7 @@ namespace ATC { // Constructor //-------------------------------------------------------- GhostManager::GhostManager(ATC_Method * atc) : - ghostModifier_(NULL), + ghostModifier_(nullptr), atc_(atc), boundaryDynamics_(NO_BOUNDARY_DYNAMICS), needReset_(true) @@ -116,7 +116,7 @@ namespace ATC { { if (ghostModifier_) { delete ghostModifier_; - ghostModifier_ = NULL; + ghostModifier_ = nullptr; } if (!atc_->groupbit_ghost()) { @@ -252,7 +252,7 @@ namespace ATC { //-------------------------------------------------------- GhostModifier::GhostModifier(GhostManager * ghostManager) : ghostManager_(ghostManager), - atomTimeIntegrator_(NULL), + atomTimeIntegrator_(nullptr), integrateAtoms_(false) { // do nothing @@ -321,9 +321,9 @@ namespace ATC { //-------------------------------------------------------- GhostModifierPrescribed::GhostModifierPrescribed(GhostManager * ghostManager) : GhostModifier(ghostManager), - atomPositions_(NULL), - atomFeDisplacement_(NULL), - atomRefPositions_(NULL) + atomPositions_(nullptr), + atomFeDisplacement_(nullptr), + atomRefPositions_(nullptr) { // do nothing } @@ -382,9 +382,9 @@ namespace ATC { const vector & gamma, const vector & mu) : GhostModifierPrescribed(ghostManager), - atomVelocities_(NULL), - atomFeVelocity_(NULL), - atomForces_(NULL), + atomVelocities_(nullptr), + atomFeVelocity_(nullptr), + atomForces_(nullptr), kappa_(kappa), gamma_(gamma), mu_(mu) @@ -486,8 +486,8 @@ namespace ATC { const vector & gamma, const vector & mu) : GhostModifierDampedHarmonic(ghostManager,kappa,gamma,mu), - ghostToBoundaryDistance_(NULL), - layerId_(NULL) + ghostToBoundaryDistance_(nullptr), + layerId_(nullptr) { // do nothing @@ -731,8 +731,8 @@ namespace ATC { GhostModifier(ghostManager), lammpsInterface_(LammpsInterface::instance()), elementSet_((((ghostManager_->atc())->fe_engine())->fe_mesh())->elementset((ghostManager_->atc())->internal_element_set())), - atomElement_(NULL), - atomGhostElement_(NULL), + atomElement_(nullptr), + atomGhostElement_(nullptr), internalToAtom_((ghostManager_->atc())->internal_to_atom_map()), ghostToAtom_((ghostManager_->atc())->ghost_to_atom_map()), groupbit_((ghostManager_->atc())->groupbit()), diff --git a/lib/atc/InterscaleOperators.cpp b/lib/atc/InterscaleOperators.cpp index f1e5607b6e..eeac14adf8 100644 --- a/lib/atc/InterscaleOperators.cpp +++ b/lib/atc/InterscaleOperators.cpp @@ -30,7 +30,7 @@ namespace ATC{ for (unsigned int i = 0; i < NUM_ATOM_TYPES; i++) { fundamentalAtomQuantities_[i].resize(LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES); for (unsigned int j = 0; j < LammpsInterface::NUM_FUNDAMENTAL_ATOM_QUANTITIES; j++) - fundamentalAtomQuantities_[i][j] = NULL; + fundamentalAtomQuantities_[i][j] = nullptr; } } @@ -126,7 +126,7 @@ namespace ATC{ if (fundamentalAtomQuantities_[i][j]) { index = dfs_visit(fundamentalAtomQuantities_[i][j],index); if ((fundamentalAtomQuantities_[i][j])->memory_type()==TEMPORARY) { - fundamentalAtomQuantities_[i][j] = NULL; + fundamentalAtomQuantities_[i][j] = nullptr; } } } @@ -453,7 +453,7 @@ namespace ATC{ DependencyManager * InterscaleManager::find(const string & tag) { // REFACTOR add check for duplicate entries - DependencyManager * quantity = NULL; + DependencyManager * quantity = nullptr; quantity = find_in_list(perAtomQuantities_,tag); if (quantity) return quantity; @@ -482,7 +482,7 @@ namespace ATC{ quantity = find_in_list(smallMoleculeSets_,tag); if (quantity) return quantity; - return NULL; + return nullptr; } //-------------------------------------------------------- diff --git a/lib/atc/InterscaleOperators.h b/lib/atc/InterscaleOperators.h index 3a4d81212e..40c5144bf8 100644 --- a/lib/atc/InterscaleOperators.h +++ b/lib/atc/InterscaleOperators.h @@ -277,7 +277,7 @@ namespace ATC { data * return_quantity(std::map & list, const std::string & tag) { typename std::map::iterator it = list.find(tag); - if (it==list.end()) return NULL; + if (it==list.end()) return nullptr; return it->second; } @@ -310,7 +310,7 @@ namespace ATC { { typename std::map::iterator it = list.find(tag); if (it!=list.end()) return it->second; - return NULL; + return nullptr; } /** helper function to force the reset of all data in a list */ diff --git a/lib/atc/KD_Tree.cpp b/lib/atc/KD_Tree.cpp index 1432663e80..181be27dc5 100644 --- a/lib/atc/KD_Tree.cpp +++ b/lib/atc/KD_Tree.cpp @@ -83,17 +83,17 @@ KD_Tree::KD_Tree(vector *points, vector *elements, if (foundElemRight) rightElems->push_back(*elit); } - // Create child tree, or NULL if there's nothing to create + // Create child tree, or nullptr if there's nothing to create if (candElems_->size() - leftElems->size() < 4 || leftElems->size() == 0) { - leftChild_ = NULL; + leftChild_ = nullptr; delete leftPts; delete leftElems; } else { leftChild_ = new KD_Tree(leftPts, leftElems, (dimension+1) % 3); } - // Create child tree, or NULL if there's nothing to create + // Create child tree, or nullptr if there's nothing to create if (candElems_->size() - rightElems->size() < 4 || rightElems->size() == 0) { - rightChild_ = NULL; + rightChild_ = nullptr; delete rightPts; delete rightElems; } else { @@ -109,7 +109,7 @@ vector KD_Tree::find_nearest_elements(Node query, int dimension) { // tree, either recurse to the left or return this node's elements // if there is no left child. if (query.lessThanInDimension(value_, dimension)) { - if (leftChild_ == NULL) { + if (leftChild_ == nullptr) { vector result = vector(); for (vector::iterator elem = candElems_->begin(); elem != candElems_->end(); elem++) { @@ -119,7 +119,7 @@ vector KD_Tree::find_nearest_elements(Node query, int dimension) { } return leftChild_->find_nearest_elements(query, (dimension+1) % 3); } else { - if (rightChild_ == NULL) { + if (rightChild_ == nullptr) { vector result = vector(); for (vector::iterator elem = candElems_->begin(); elem != candElems_->end(); elem++) { @@ -147,7 +147,7 @@ vector > KD_Tree::getElemIDs(int depth) { sort(candElemIDs.begin(), candElemIDs.end()); result.push_back(candElemIDs); - } else if (leftChild_ == NULL || rightChild_ == NULL) { + } else if (leftChild_ == nullptr || rightChild_ == nullptr) { // Insert all nodes at this level once, // then insert a bunch of empty vectors. temp = this->getElemIDs(0); diff --git a/lib/atc/KernelFunction.cpp b/lib/atc/KernelFunction.cpp index 70a1616e01..6095c14284 100644 --- a/lib/atc/KernelFunction.cpp +++ b/lib/atc/KernelFunction.cpp @@ -20,13 +20,13 @@ namespace ATC { //======================================================================== // KernelFunctionMgr //======================================================================== - KernelFunctionMgr * KernelFunctionMgr::myInstance_ = NULL; + KernelFunctionMgr * KernelFunctionMgr::myInstance_ = nullptr; //------------------------------------------------------------------------ // instance //------------------------------------------------------------------------ KernelFunctionMgr * KernelFunctionMgr::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new KernelFunctionMgr(); } return myInstance_; @@ -65,7 +65,7 @@ namespace ATC { No default */ int argIdx = 0; - KernelFunction * ptr = NULL; + KernelFunction * ptr = nullptr; char* type = arg[argIdx++]; if (strcmp(type,"step")==0) { double parameters[1] = {atof(arg[argIdx])}; // cutoff radius diff --git a/lib/atc/KinetoThermostat.cpp b/lib/atc/KinetoThermostat.cpp index c10f7eb458..89d598c102 100644 --- a/lib/atc/KinetoThermostat.cpp +++ b/lib/atc/KinetoThermostat.cpp @@ -151,7 +151,7 @@ namespace ATC { VelocityRescaleCombined::VelocityRescaleCombined(AtomicRegulator * kinetostat) : VelocityGlc(kinetostat), velocity_(atc_->field(VELOCITY)), - thermostatCorrection_(NULL) + thermostatCorrection_(nullptr) { // do nothing } @@ -188,7 +188,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleCombined::ThermostatRescaleCombined(AtomicRegulator * thermostat) : ThermostatRescale(thermostat), - kinetostatCorrection_(NULL) + kinetostatCorrection_(nullptr) { // do nothing } @@ -226,14 +226,14 @@ namespace ATC { KinetoThermostatRescale::KinetoThermostatRescale(AtomicRegulator * kinetoThermostat, int couplingMaxIterations) : KinetoThermostatShapeFunction(kinetoThermostat,couplingMaxIterations), - atomVelocities_(NULL), + atomVelocities_(nullptr), nodalVelocities_(atc_->field(VELOCITY)), - lambdaMomentum_(NULL), - lambdaEnergy_(NULL), - atomicFluctuatingVelocityRescaled_(NULL), - atomicStreamingVelocity_(NULL), - thermostat_(NULL), - kinetostat_(NULL) + lambdaMomentum_(nullptr), + lambdaEnergy_(nullptr), + atomicFluctuatingVelocityRescaled_(nullptr), + atomicStreamingVelocity_(nullptr), + thermostat_(nullptr), + kinetostat_(nullptr) { thermostat_ = this->construct_rescale_thermostat(); kinetostat_ = new VelocityRescaleCombined(kinetoThermostat); @@ -389,7 +389,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleMixedKePeCombined::ThermostatRescaleMixedKePeCombined(AtomicRegulator * thermostat) : ThermostatRescaleMixedKePe(thermostat), - kinetostatCorrection_(NULL) + kinetostatCorrection_(nullptr) { // do nothing } @@ -458,21 +458,21 @@ namespace ATC { velocity_(atc_->field(VELOCITY)), temperature_(atc_->field(TEMPERATURE)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaForce_(NULL), - lambdaForceFiltered_(NULL), - nodalAtomicLambdaPower_(NULL), - lambdaPowerFiltered_(NULL), - atomRegulatorForces_(NULL), - atomThermostatForces_(NULL), - atomMasses_(NULL), - atomVelocities_(NULL), + nodalAtomicLambdaForce_(nullptr), + lambdaForceFiltered_(nullptr), + nodalAtomicLambdaPower_(nullptr), + lambdaPowerFiltered_(nullptr), + atomRegulatorForces_(nullptr), + atomThermostatForces_(nullptr), + atomMasses_(nullptr), + atomVelocities_(nullptr), isFirstTimestep_(true), - nodalAtomicMomentum_(NULL), - nodalAtomicEnergy_(NULL), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedMomentum_(NULL), - nodalAtomicPredictedEnergy_(NULL), - firstHalfAtomForces_(NULL), + nodalAtomicMomentum_(nullptr), + nodalAtomicEnergy_(nullptr), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedMomentum_(nullptr), + nodalAtomicPredictedEnergy_(nullptr), + firstHalfAtomForces_(nullptr), dtFactor_(0.) { // construct/obtain data corresponding to stage 3 of ATC_Method::initialize diff --git a/lib/atc/Kinetostat.cpp b/lib/atc/Kinetostat.cpp index 7f95398dcb..676896a2f9 100644 --- a/lib/atc/Kinetostat.cpp +++ b/lib/atc/Kinetostat.cpp @@ -307,11 +307,11 @@ namespace ATC { RegulatorShapeFunction(kinetostat,regulatorPrefix), mdMassMatrix_(atc_->set_mass_mat_md(VELOCITY)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaForce_(NULL), - lambdaForceFiltered_(NULL), - atomKinetostatForce_(NULL), - atomVelocities_(NULL), - atomMasses_(NULL) + nodalAtomicLambdaForce_(nullptr), + lambdaForceFiltered_(nullptr), + atomKinetostatForce_(nullptr), + atomVelocities_(nullptr), + atomMasses_(nullptr) { // data associated with stage 3 in ATC_Method::initialize lambda_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaMomentum",nsd_); @@ -376,7 +376,7 @@ namespace ATC { //-------------------------------------------------------- GlcKinetostat::GlcKinetostat(AtomicRegulator *kinetostat) : KinetostatShapeFunction(kinetostat), - atomPositions_(NULL) + atomPositions_(nullptr) { // do nothing } @@ -462,7 +462,7 @@ namespace ATC { //-------------------------------------------------------- DisplacementGlc::DisplacementGlc(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), - nodalAtomicMassWeightedDisplacement_(NULL), + nodalAtomicMassWeightedDisplacement_(nullptr), nodalDisplacements_(atc_->field(DISPLACEMENT)) { // do nothing @@ -763,7 +763,7 @@ namespace ATC { //-------------------------------------------------------- VelocityGlc::VelocityGlc(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), - nodalAtomicMomentum_(NULL), + nodalAtomicMomentum_(nullptr), nodalVelocities_(atc_->field(VELOCITY)) { // do nothing @@ -1095,8 +1095,8 @@ namespace ATC { StressFlux::StressFlux(AtomicRegulator * kinetostat) : GlcKinetostat(kinetostat), nodalForce_(atc_->field_rhs(VELOCITY)), - nodalAtomicForce_(NULL), - nodalGhostForce_(NULL), + nodalAtomicForce_(nullptr), + nodalGhostForce_(nullptr), momentumSource_(atc_->atomic_source(VELOCITY)) { // flag for performing boundary flux calculation @@ -1540,14 +1540,14 @@ namespace ATC { KinetostatShapeFunction(kinetostat,regulatorPrefix), velocity_(atc_->field(VELOCITY)), //timeFilter_(atomicRegulator_->time_filter()), - //nodalAtomicLambdaForce_(NULL), - //lambdaPowerFiltered_(NULL), - //atomKinetostatForces_(NULL), - //atomMasses_(NULL), - nodalAtomicMomentum_(NULL), + //nodalAtomicLambdaForce_(nullptr), + //lambdaPowerFiltered_(nullptr), + //atomKinetostatForces_(nullptr), + //atomMasses_(nullptr), + nodalAtomicMomentum_(nullptr), isFirstTimestep_(true), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedMomentum_(NULL), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedMomentum_(nullptr), dtFactor_(0.) { // constuct/obtain data corresponding to stage 3 of ATC_Method::initialize @@ -1796,8 +1796,8 @@ namespace ATC { const string & regulatorPrefix) : KinetostatGlcFs(kinetostat,regulatorPrefix), momentumSource_(atc_->atomic_source(VELOCITY)), - nodalGhostForce_(NULL), - nodalGhostForceFiltered_(NULL) + nodalGhostForce_(nullptr), + nodalGhostForceFiltered_(nullptr) { // flag for performing boundary flux calculation fieldMask_(VELOCITY,FLUX) = true; @@ -2403,9 +2403,9 @@ namespace ATC { KinetostatFluxFixed::KinetostatFluxFixed(AtomicRegulator * kinetostat, bool constructKinetostats) : RegulatorMethod(kinetostat), - kinetostatFlux_(NULL), - kinetostatFixed_(NULL), - kinetostatBcs_(NULL) + kinetostatFlux_(nullptr), + kinetostatFixed_(nullptr), + kinetostatBcs_(nullptr) { if (constructKinetostats) { if (kinetostat->coupling_mode(VELOCITY) == AtomicRegulator::GHOST_FLUX) { diff --git a/lib/atc/LammpsInterface.cpp b/lib/atc/LammpsInterface.cpp index 9964a1c4bb..5727af1904 100644 --- a/lib/atc/LammpsInterface.cpp +++ b/lib/atc/LammpsInterface.cpp @@ -58,14 +58,14 @@ const static int MAX_GROUP_BIT = 2147483647; //4294967295; // pow(2,31)-1; double norm(double * v) {return sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); } -LammpsInterface * LammpsInterface::myInstance_ = NULL; +LammpsInterface * LammpsInterface::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- LammpsInterface * LammpsInterface::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new LammpsInterface(); } return myInstance_; @@ -77,7 +77,7 @@ LammpsInterface * LammpsInterface::instance() void LammpsInterface::Destroy() { if (myInstance_) delete myInstance_; - myInstance_ = NULL; + myInstance_ = nullptr; } @@ -85,13 +85,13 @@ void LammpsInterface::Destroy() // constructor // ----------------------------------------------------------------- LammpsInterface::LammpsInterface() - : lammps_(NULL), - fixPointer_(NULL), + : lammps_(nullptr), + fixPointer_(nullptr), commRank_(0), - atomPE_(NULL), + atomPE_(nullptr), refBoxIsSet_(false), - random_(NULL), - globalrandom_(NULL) + random_(nullptr), + globalrandom_(nullptr) { } @@ -225,7 +225,7 @@ void LammpsInterface::sparse_allsum(SparseMatrix &toShare) const std::string LammpsInterface::read_file(std::string filename) const { - FILE *fp = NULL; + FILE *fp = nullptr; if (! comm_rank()) { fp = fopen(filename.c_str(),"r"); if (!fp) throw ATC_Error("can't open file: "+filename); @@ -343,7 +343,7 @@ double * LammpsInterface::atom_scalar(FundamentalAtomQuantity quantityType) cons } else throw ATC_Error("BAD type requested in atom_scalar"); - return NULL; + return nullptr; } double ** LammpsInterface::atom_vector(FundamentalAtomQuantity quantityType) const @@ -356,7 +356,7 @@ double ** LammpsInterface::atom_vector(FundamentalAtomQuantity quantityType) con return fatom(); else throw ATC_Error("BAD type requested in atom_vector"); - return NULL; + return nullptr; } int LammpsInterface::atom_quantity_ndof(FundamentalAtomQuantity quantityType) const @@ -948,10 +948,10 @@ POTENTIAL LammpsInterface::potential() const "lj/cut/coul/long", "lj/cut/coul/cut", "lj/charmm/coul/long"}; - LAMMPS_NS::Pair *pair = NULL; + LAMMPS_NS::Pair *pair = nullptr; for (int i = 0; i < nStyles; i++){ pair = lammps_->force->pair_match(pairStyles[i].c_str(),1); - if (pair != NULL) break; + if (pair != nullptr) break; } return pair; } @@ -979,8 +979,8 @@ bool LammpsInterface::epsilons(int itype, POTENTIAL pair, double * epsilon0) con int dim = 2; // a return value for extract double ** epsilons = (double**) ( pair->extract(pair_parameter,dim) ); delete [] pair_parameter; - if (epsilons == NULL) return false; - //if (epsilons == NULL) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); + if (epsilons == nullptr) return false; + //if (epsilons == nullptr) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); int i1,i2; for (int i=1; i < ntypes()+1; i++) { if (i < itype) { i1 = i; i2 = itype; } @@ -998,8 +998,8 @@ bool LammpsInterface::set_epsilons(int itype, POTENTIAL pair, double * epsilon) int dim = 2; // a return value for extract double ** epsilons = (double**) ( pair->extract(pair_parameter,dim) ); delete [] pair_parameter; - if (epsilons == NULL) return false; - //if (epsilons == NULL) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); + if (epsilons == nullptr) return false; + //if (epsilons == nullptr) error->all(FLERR,"Fix concentration adapted pair style parameter not supported"); // scale interactions int i1,i2; for (int i = 1; i < ntypes()+1; i++) { @@ -1498,7 +1498,7 @@ double * LammpsInterface::compute_pe_peratom(void) const return atomPE_->vector_atom; } else { - return NULL; + return nullptr; } } @@ -1542,7 +1542,7 @@ LAMMPS_NS::PairEAM* LammpsInterface::pair_eam() const // return lammps_->force->pair; //} LAMMPS_NS::PairEAM* pair_eam = dynamic_cast (lammps_->force->pair); - if (pair_eam != NULL) { + if (pair_eam != nullptr) { return pair_eam; } else { diff --git a/lib/atc/LammpsInterface.h b/lib/atc/LammpsInterface.h index 2032571da5..6883a9ca0b 100644 --- a/lib/atc/LammpsInterface.h +++ b/lib/atc/LammpsInterface.h @@ -534,7 +534,7 @@ class LammpsInterface { /** Dulong-Petit heat capacity per volume in M,L,T,t units */ double heat_capacity(void) const; /** mass per volume in reference configuraturation in M,L units */ - double mass_density(int* numPerType=NULL) const; + double mass_density(int* numPerType=nullptr) const; /** permittivity of free space, converts from LAMMPS potential units implied by the electric field units to LAMMPS charge units/LAMMPS length units (e.g., V to elemental charge/A) */ double epsilon0(void) const; double coulomb_constant(void) const; diff --git a/lib/atc/LinearSolver.cpp b/lib/atc/LinearSolver.cpp index 655d6130c4..0204ddd938 100644 --- a/lib/atc/LinearSolver.cpp +++ b/lib/atc/LinearSolver.cpp @@ -35,9 +35,9 @@ LinearSolver::LinearSolver( allowReinitialization_(false), homogeneousBCs_(false), bcs_(&bcs), - rhs_(NULL), + rhs_(nullptr), rhsDense_(), - b_(NULL), + b_(nullptr), matrix_(A), matrixDense_(), matrixFreeFree_(), matrixFreeFixed_(),matrixInverse_(), @@ -65,9 +65,9 @@ LinearSolver::LinearSolver( matrixModified_(false), allowReinitialization_(false), homogeneousBCs_(false), - bcs_(NULL), // null implies no constraints will be added later - rhs_(NULL), - rhsDense_(), b_(NULL), + bcs_(nullptr), // null implies no constraints will be added later + rhs_(nullptr), + rhsDense_(), b_(nullptr), matrix_(A), matrixDense_(), matrixFreeFree_(), matrixFreeFixed_(),matrixInverse_(), @@ -343,7 +343,7 @@ void LinearSolver::set_fixed_values(VECTOR & X) void LinearSolver::eigen_system( DENS_MAT & eigenvalues, DENS_MAT & eigenvectors, const DENS_MAT * M) /* const */ { initialize_matrix(); // no inverse needed - const DENS_MAT * Kp = NULL; + const DENS_MAT * Kp = nullptr; const DENS_MAT * Mp =M; DENS_MAT MM; DENS_MAT KM; @@ -388,7 +388,7 @@ void LinearSolver::eigen_system( DENS_MAT & eigenvalues, DENS_MAT & eigenvectors bool LinearSolver::solve(VECTOR & x, const VECTOR & b) { - SPAR_MAT * A = NULL; + SPAR_MAT * A = nullptr; rhs_ = &b; initialized_ = false; @@ -479,7 +479,7 @@ bool LinearSolver::solve(VECTOR & x, const VECTOR & b) void LinearSolver::greens_function(int I, VECTOR & G_I) { - SPAR_MAT * A = NULL; + SPAR_MAT * A = nullptr; diff --git a/lib/atc/LinearSolver.h b/lib/atc/LinearSolver.h index 5f456b9a1d..1d429d8816 100644 --- a/lib/atc/LinearSolver.h +++ b/lib/atc/LinearSolver.h @@ -64,7 +64,7 @@ class LinearSolver { allow_reinitialization must be called before first solve, etc */ void allow_reinitialization(void); // depending on method save a copy of A void set_homogeneous_bcs(void) { homogeneousBCs_ = true;} // for nonlinear solver, solve for increment - void initialize(const BC_SET * bcs = NULL); + void initialize(const BC_SET * bcs = nullptr); /** solve - solves A x = b @@ -80,7 +80,7 @@ class LinearSolver { - returns the e-values & e-vectors for constrained system Ax + v x = 0 - if M is provided the eval problem : ( A + v M ) x = 0 is solved*/ void eigen_system(DENS_MAT & eigenvalues, DENS_MAT & eigenvectors, - const DENS_MAT * M = NULL); + const DENS_MAT * M = nullptr); /** access to penalty coefficient - if a penalty method is not being used this returns zero */ diff --git a/lib/atc/Material.cpp b/lib/atc/Material.cpp index 676a87524f..64673d7993 100644 --- a/lib/atc/Material.cpp +++ b/lib/atc/Material.cpp @@ -28,21 +28,21 @@ namespace ATC { Material::Material() : rhoCp_(0), heatCapacity_(0), - electronHeatCapacity_(NULL), + electronHeatCapacity_(nullptr), massDensity_(0), heatConductivity_(0), - electronHeatFlux_(NULL), - stress_(NULL), - viscousStress_(NULL), - bodyForce_(NULL), - electronPhononExchange_(NULL), - electronDragPower_(NULL), - electronFlux_(NULL), + electronHeatFlux_(nullptr), + stress_(nullptr), + viscousStress_(nullptr), + bodyForce_(nullptr), + electronPhononExchange_(nullptr), + electronDragPower_(nullptr), + electronFlux_(nullptr), permittivity_(1.), invEffectiveMass_(1.), electronEquilibriumDensity_(0), electronRecombinationInvTau_(0), - electronChargeDensity_(NULL) + electronChargeDensity_(nullptr) { } //-------------------------------------------------------------- @@ -70,21 +70,21 @@ namespace ATC { : tag_(tag), rhoCp_(0), heatCapacity_(0), - electronHeatCapacity_(NULL), + electronHeatCapacity_(nullptr), massDensity_(0), heatConductivity_(0), - electronHeatFlux_(NULL), - stress_(NULL), - viscousStress_(NULL), - bodyForce_(NULL), - electronPhononExchange_(NULL), - electronDragPower_(NULL), - electronFlux_(NULL), + electronHeatFlux_(nullptr), + stress_(nullptr), + viscousStress_(nullptr), + bodyForce_(nullptr), + electronPhononExchange_(nullptr), + electronDragPower_(nullptr), + electronFlux_(nullptr), permittivity_(1.), invEffectiveMass_(1.), electronEquilibriumDensity_(0), electronRecombinationInvTau_(0), - electronChargeDensity_(NULL) + electronChargeDensity_(nullptr) { /*! \page man_material material \section syntax diff --git a/lib/atc/MoleculeSet.h b/lib/atc/MoleculeSet.h index cffafd950d..763f08ef4d 100644 --- a/lib/atc/MoleculeSet.h +++ b/lib/atc/MoleculeSet.h @@ -33,7 +33,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(std::map * globalAtomsPerMolecule = NULL); + virtual void initialize(std::map * globalAtomsPerMolecule = nullptr); /** reset the number of atoms/molecules on this processor */ void reset_nlocal() {this->set_reset();}; @@ -108,8 +108,8 @@ namespace ATC { public: SmallMoleculeSet(ATC_Method * atc, int groupBit, - PerAtomQuantity * bondList = NULL, - PerAtomQuantity * numBond = NULL); + PerAtomQuantity * bondList = nullptr, + PerAtomQuantity * numBond = nullptr); virtual ~SmallMoleculeSet(); @@ -117,7 +117,7 @@ namespace ATC { virtual void clear(); /** initialize global data */ - virtual void initialize(std::map * globalAtomsPerMolecule = NULL); + virtual void initialize(std::map * globalAtomsPerMolecule = nullptr); /** access molecule atoms by lammps id */ std::set atoms_by_global_molecule(int id) const; diff --git a/lib/atc/NonLinearSolver.h b/lib/atc/NonLinearSolver.h index 010e3ee72e..299408c4c3 100644 --- a/lib/atc/NonLinearSolver.h +++ b/lib/atc/NonLinearSolver.h @@ -43,7 +43,7 @@ class NonLinearSolver { /** Constructor */ NonLinearSolver( TangentOperator * f, // provides f and f' at x, pointer for polymorphism - const BC_SET * bcs = NULL, + const BC_SET * bcs = nullptr, const int dof = 0, bool parallel = false ); diff --git a/lib/atc/OutputManager.cpp b/lib/atc/OutputManager.cpp index 066c240cab..83257a3d21 100644 --- a/lib/atc/OutputManager.cpp +++ b/lib/atc/OutputManager.cpp @@ -48,8 +48,8 @@ OutputManager::OutputManager(string outputPrefix, set & otypes) firstStep_(true), firstGlobalsWrite_(true), writeGlobalsHeader_(true), - coordinates_(NULL), - connectivities_(NULL), + coordinates_(nullptr), + connectivities_(nullptr), dataType_(POINT), outputPrefix_(outputPrefix), ensightOutput_(otypes.count(ENSIGHT)), @@ -68,8 +68,8 @@ OutputManager::OutputManager() firstStep_(true), firstGlobalsWrite_(true), writeGlobalsHeader_(true), - coordinates_(NULL), - connectivities_(NULL), + coordinates_(nullptr), + connectivities_(nullptr), dataType_(POINT), outputPrefix_("NULL"), ensightOutput_(true), @@ -132,7 +132,7 @@ void OutputManager::print_custom_names() { // Dump text-based fields to disk for later restart void OutputManager::write_restart_file(string fileName, RESTART_LIST *data) { - FILE * fp=NULL; + FILE * fp=nullptr; fp=fopen(fileName.c_str(),"wb"); // open RESTART_LIST::iterator iter; for (iter = data->begin(); iter != data->end(); iter++) { @@ -153,7 +153,7 @@ void OutputManager::write_restart_file(string fileName, RESTART_LIST *data) void OutputManager::read_restart_file(string fileName, RESTART_LIST *data) { - FILE * fp=NULL; + FILE * fp=nullptr; fp=fopen(fileName.c_str(),"rb"); // open RESTART_LIST::iterator iter; for (iter = data->begin(); iter != data->end(); iter++) { @@ -230,7 +230,7 @@ void OutputManager::write_geometry_ensight(void) string geom_file_name = outputPrefix_ + ".geo"; // open file - FILE * fp=NULL; + FILE * fp=nullptr; char buffer[80]; if ( ! initialized_ ) { fp=fopen(geom_file_name.c_str(),"wb"); // open @@ -240,7 +240,7 @@ void OutputManager::write_geometry_ensight(void) else { fp=fopen(geom_file_name.c_str(),"ab"); // append } - if (fp == NULL) { + if (fp == nullptr) { throw ATC_Error("can not create Ensight geometry file"); } @@ -491,14 +491,14 @@ void OutputManager::write_data_ensight(string field_name, const MATRIX *field_da // open or append data file string data_file_name = filenames[ifile]; - FILE * fp=NULL; + FILE * fp=nullptr; if ( outputTimes_.size() == 1 ) { fp=fopen(data_file_name.c_str(),"wb"); // open } else { fp=fopen(data_file_name.c_str(),"ab"); // append } - if (fp == NULL) { + if (fp == nullptr) { throw ATC_Error("can not create Ensight data file: "+data_file_name); } @@ -799,8 +799,8 @@ void OutputManager::write_dictionary(double /* time */, OUTPUT_LIST *data) string geom_file_name = outputPrefix_ + ".geo"; // open file - FILE * fp=NULL; - if ((fp=fopen(dict_file_name.c_str(),"w")) == NULL) + FILE * fp=nullptr; + if ((fp=fopen(dict_file_name.c_str(),"w")) == nullptr) { throw ATC_Error("can not create Ensight case file"); } diff --git a/lib/atc/OutputManager.h b/lib/atc/OutputManager.h index c5a901e9f4..4454d65265 100644 --- a/lib/atc/OutputManager.h +++ b/lib/atc/OutputManager.h @@ -52,13 +52,13 @@ namespace ATC { coordinates : num _total_ points/nodes X num spatial dim connectivities : num elements X num nodes per element*/ void write_geometry(const MATRIX *coordinates, - const Array2D *connectivity=NULL); + const Array2D *connectivity=nullptr); /** write data from a time step specify node_map to handle periodic soln & data */ - void write_data(double time, OUTPUT_LIST *data, const int *node_map=NULL); + void write_data(double time, OUTPUT_LIST *data, const int *node_map=nullptr); void write_data(double time, FIELDS *soln, OUTPUT_LIST *data, - const int *node_map=NULL); + const int *node_map=nullptr); /** add custom names for any field */ void add_field_names(const std::string& name, const std::vector& list) { diff --git a/lib/atc/PaqAtcUtility.cpp b/lib/atc/PaqAtcUtility.cpp index b6a2ed2871..bdcf269626 100644 --- a/lib/atc/PaqAtcUtility.cpp +++ b/lib/atc/PaqAtcUtility.cpp @@ -18,7 +18,7 @@ namespace ATC { AtomType atomType) : atc_(atc), atomType_(atomType), - myNlocal(NULL) + myNlocal(nullptr) { switch (atomType_) { case ALL: diff --git a/lib/atc/ParDenseMatrix.h b/lib/atc/ParDenseMatrix.h index 1c9e75f171..873bf0f410 100644 --- a/lib/atc/ParDenseMatrix.h +++ b/lib/atc/ParDenseMatrix.h @@ -148,7 +148,7 @@ namespace ATC_matrix { #endif // Clear out the local matrix's pointer so we don't double-free - A_local._data = NULL; + A_local._data = nullptr; delete [] majorCounts; delete [] offsets; diff --git a/lib/atc/ParSparseMatrix.cpp b/lib/atc/ParSparseMatrix.cpp index 69ab2453e1..77c8eb33d5 100644 --- a/lib/atc/ParSparseMatrix.cpp +++ b/lib/atc/ParSparseMatrix.cpp @@ -233,8 +233,8 @@ DenseMatrix ParSparseMatrix::transMat( SparseMatrix C_local = ((SparseMatrix)A_local) * B; // destroy newA intelligently - A_local._val = NULL; - A_local._ja = NULL; + A_local._val = nullptr; + A_local._ja = nullptr; // Add all the result vectors together on each processor. sumSparse(C_local, C); @@ -285,8 +285,8 @@ void ParSparseMatrix::partition( // Prepare an A_local matrix for deletion after it has been loaded with // data members from another matrix. void ParSparseMatrix::finalize() { - _val = NULL; - _ja = NULL; + _val = nullptr; + _ja = nullptr; } void ParSparseMatrix::operator=(const SparseMatrix &source) diff --git a/lib/atc/ParSparseMatrix.h b/lib/atc/ParSparseMatrix.h index 0985115d07..b2642e87be 100644 --- a/lib/atc/ParSparseMatrix.h +++ b/lib/atc/ParSparseMatrix.h @@ -135,9 +135,9 @@ namespace ATC_matrix { Avar.hasTemplate_ = Ap.hasTemplate_; // Avoid catastrophe - Ap._val = NULL; - Ap._ja = NULL; - Ap._ia = NULL; + Ap._val = nullptr; + Ap._ja = nullptr; + Ap._ia = nullptr; } diff --git a/lib/atc/PerAtomQuantity-inl.h b/lib/atc/PerAtomQuantity-inl.h index f95e5d306d..b570e7645b 100644 --- a/lib/atc/PerAtomQuantity-inl.h +++ b/lib/atc/PerAtomQuantity-inl.h @@ -24,8 +24,8 @@ namespace ATC { atomType_(atomType), nCols_(nCols), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsScalar_(NULL), - lammpsVector_(NULL) + lammpsScalar_(nullptr), + lammpsVector_(nullptr) { // do nothing } @@ -452,7 +452,7 @@ namespace ATC { lammpsInterface_(LammpsInterface::instance()), atomType_(atomType), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsScalar_(NULL) + lammpsScalar_(nullptr) { // do nothing } @@ -610,8 +610,8 @@ namespace ATC { nCols_(nCols), maxEntriesPerRow_(maxEntriesPerRow), quantityToLammps_(atc_.atc_to_lammps_map()), - lammpsVector_(NULL), - lammpsColIndices_(NULL) + lammpsVector_(nullptr), + lammpsColIndices_(nullptr) { // do nothing } diff --git a/lib/atc/PerAtomQuantity.h b/lib/atc/PerAtomQuantity.h index e6cb19981a..a822b6a9b6 100644 --- a/lib/atc/PerAtomQuantity.h +++ b/lib/atc/PerAtomQuantity.h @@ -441,10 +441,10 @@ namespace ATC { virtual void set_lammps_to_quantity() const {}; /** gets appropriate pointer for lammps data */ - virtual T * lammps_scalar() const {return NULL;}; + virtual T * lammps_scalar() const {return nullptr;}; /** gets appropriate pointer for lammps data */ - virtual T ** lammps_vector() const {return NULL;}; + virtual T ** lammps_vector() const {return nullptr;}; private: @@ -1452,10 +1452,10 @@ namespace ATC { virtual void set_quantity_to_lammps() const {}; /** gets appropriate data for lammps pointer */ - virtual T ** lammps_vector() const {return NULL;}; + virtual T ** lammps_vector() const {return nullptr;}; /** gets appropriate data for lammps pointer to column indices */ - virtual int ** lammps_column_indices() const {return NULL;}; + virtual int ** lammps_column_indices() const {return nullptr;}; private: diff --git a/lib/atc/PerAtomQuantityLibrary.h b/lib/atc/PerAtomQuantityLibrary.h index 0089df7855..3e3cb78e95 100644 --- a/lib/atc/PerAtomQuantityLibrary.h +++ b/lib/atc/PerAtomQuantityLibrary.h @@ -125,7 +125,7 @@ namespace ATC { // constructor AtomToElementMap(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, + PerAtomQuantity * atomPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -304,7 +304,7 @@ namespace ATC { // constructor AtomVolumeElement(ATC_Method * atc, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -349,7 +349,7 @@ namespace ATC { // constructor AtomVolumeRegion(ATC_Method * atc, - DENS_MAN * atomCoarseGrainingPositions = NULL, + DENS_MAN * atomCoarseGrainingPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -422,9 +422,9 @@ namespace ATC { // constructor AtomicMassWeightedDisplacement(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomReferencePositions = NULL, + PerAtomQuantity * atomPositions = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomReferencePositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -462,8 +462,8 @@ namespace ATC { // constructor FluctuatingVelocity(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -497,8 +497,8 @@ namespace ATC { // constructor ChargeVelocity(ATC_Method * atc, - PerAtomQuantity * fluctuatingVelocities = NULL, - FundamentalAtomQuantity * atomCharges = NULL, + PerAtomQuantity * fluctuatingVelocities = nullptr, + FundamentalAtomQuantity * atomCharges = nullptr, AtomType atomType = INTERNAL); // destructor @@ -532,8 +532,8 @@ namespace ATC { // constructor SpeciesVelocity(ATC_Method * atc, - PerAtomQuantity * fluctuatingVelocities = NULL, - PerAtomQuantity * atomTypeVector = NULL, + PerAtomQuantity * fluctuatingVelocities = nullptr, + PerAtomQuantity * atomTypeVector = nullptr, AtomType atomType = INTERNAL); // destructor @@ -567,8 +567,8 @@ namespace ATC { // constructor AtomicMomentum(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -631,8 +631,8 @@ namespace ATC { // constructor TwiceKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -670,8 +670,8 @@ namespace ATC { // constructor KineticTensor(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, AtomType atomType = INTERNAL); // destructor @@ -707,9 +707,9 @@ namespace ATC { // constructor FluctuatingKineticTensor(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -747,9 +747,9 @@ namespace ATC { // constructor TwiceFluctuatingKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomVelocities = NULL, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomMeanVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomMeanVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -793,8 +793,8 @@ namespace ATC { MixedKePeEnergy(ATC_Method * atc, double keMultiplier, double peMultiplier, - PerAtomQuantity * twiceKineticEnergy = NULL, - PerAtomQuantity * potentialEnergy = NULL, + PerAtomQuantity * twiceKineticEnergy = nullptr, + PerAtomQuantity * potentialEnergy = nullptr, AtomType atomType = INTERNAL); // destructor @@ -838,8 +838,8 @@ namespace ATC { // constructor TotalEnergy(ATC_Method * atc, - PerAtomQuantity * twiceKineticEnergy = NULL, - PerAtomQuantity * potentialEnergy = NULL, + PerAtomQuantity * twiceKineticEnergy = nullptr, + PerAtomQuantity * potentialEnergy = nullptr, AtomType atomType = INTERNAL); // destructor @@ -871,8 +871,8 @@ namespace ATC { // constructor FluctuatingPotentialEnergy(ATC_Method * atc, - PerAtomQuantity * potentialEnergy = NULL, - PerAtomQuantity * referencePotential = NULL, + PerAtomQuantity * potentialEnergy = nullptr, + PerAtomQuantity * referencePotential = nullptr, AtomType atomType = INTERNAL); // destructor @@ -911,8 +911,8 @@ namespace ATC { // constructor DotTwiceKineticEnergy(ATC_Method * atc, - PerAtomQuantity * atomForces = NULL, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomForces = nullptr, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -948,7 +948,7 @@ namespace ATC { // constructor VelocitySquared(ATC_Method *atc, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -981,9 +981,9 @@ namespace ATC { // constructor LambdaSquared(ATC_Method *atc, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomVelocitiesSquared = NULL, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomVelocitiesSquared = nullptr, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1149,7 +1149,7 @@ namespace ATC { // constructor AtomToNodeset(ATC_Method * atc, SetDependencyManager * subsetNodes, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1194,7 +1194,7 @@ namespace ATC { // constructor AtomToElementset(ATC_Method * atc, MatrixDependencyManager * elementMask, - PerAtomQuantity * atomElement = NULL, + PerAtomQuantity * atomElement = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1273,7 +1273,7 @@ namespace ATC { // constructor VelocitySquaredMapped(ATC_Method *atc, MatrixDependencyManager * atomMap, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1307,9 +1307,9 @@ namespace ATC { // constructor LambdaSquaredMapped(ATC_Method *atc, MatrixDependencyManager * atomMap, - PerAtomQuantity * atomMasses = NULL, - PerAtomQuantity * atomVelocitiesSquared = NULL, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomMasses = nullptr, + PerAtomQuantity * atomVelocitiesSquared = nullptr, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1371,7 +1371,7 @@ namespace ATC { // constructor AtomicVelocityRescaleFactor(ATC_Method * atc, - PerAtomQuantity * atomLambdas = NULL, + PerAtomQuantity * atomLambdas = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1403,8 +1403,8 @@ namespace ATC { // constructor AtomicFluctuatingVelocityRescaled(ATC_Method * atc, - PerAtomQuantity * atomRescaleFactor = NULL, - PerAtomQuantity * atomFluctuatingVelocity = NULL, + PerAtomQuantity * atomRescaleFactor = nullptr, + PerAtomQuantity * atomFluctuatingVelocity = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1439,10 +1439,10 @@ namespace ATC { // constructor AtomicCombinedRescaleThermostatError(ATC_Method * atc, - PerAtomQuantity * atomFluctuatingMomentumRescaled = NULL, - PerAtomQuantity * atomMeanVelocity = NULL, - PerAtomQuantity * atomStreamingVelocity = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomFluctuatingMomentumRescaled = nullptr, + PerAtomQuantity * atomMeanVelocity = nullptr, + PerAtomQuantity * atomStreamingVelocity = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1483,8 +1483,8 @@ namespace ATC { // constructor AtomicThermostatForce(ATC_Method * atc, - PerAtomQuantity * atomLambdas = NULL, - PerAtomQuantity * atomVelocities = NULL, + PerAtomQuantity * atomLambdas = nullptr, + PerAtomQuantity * atomVelocities = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1519,8 +1519,8 @@ namespace ATC { // constructor AtomicKinetostatForceDisplacement(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomLambda = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1558,8 +1558,8 @@ namespace ATC { // constructor AtomicKinetostatForceVelocity(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, - PerAtomQuantity * atomMass = NULL, + PerAtomQuantity * atomLambda = nullptr, + PerAtomQuantity * atomMass = nullptr, AtomType atomType = INTERNAL) : AtomicKinetostatForceDisplacement(atc,atomLambda,atomMass,atomType) {}; @@ -1589,7 +1589,7 @@ namespace ATC { // constructor AtomicKinetostatForceStress(ATC_Method * atc, - PerAtomQuantity * atomLambda = NULL, + PerAtomQuantity * atomLambda = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1621,7 +1621,7 @@ namespace ATC { // constructor PerAtomKernelFunction(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, + PerAtomQuantity * atomPositions = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1656,8 +1656,8 @@ namespace ATC { // constructor PerAtomShapeFunction(ATC_Method * atc, - PerAtomQuantity * atomPositions = NULL, - PerAtomQuantity * atomElements = NULL, + PerAtomQuantity * atomPositions = nullptr, + PerAtomQuantity * atomElements = nullptr, AtomType atomType = INTERNAL); // destructor @@ -1695,8 +1695,8 @@ namespace ATC { // constructor LambdaCouplingMatrix(ATC_Method * atc, - MatrixDependencyManager * nodeToOverlapMap = NULL, - SPAR_MAN * shapeFunction = NULL); + MatrixDependencyManager * nodeToOverlapMap = nullptr, + SPAR_MAN * shapeFunction = nullptr); // destructor virtual ~LambdaCouplingMatrix() { @@ -1734,9 +1734,9 @@ namespace ATC { // constructor LocalLambdaCouplingMatrix(ATC_Method * atc, - MatrixDependencyManager * lambdaAtomMap = NULL, - MatrixDependencyManager * nodeToOverlapMap = NULL, - SPAR_MAN * shapeFunction = NULL); + MatrixDependencyManager * lambdaAtomMap = nullptr, + MatrixDependencyManager * nodeToOverlapMap = nullptr, + SPAR_MAN * shapeFunction = nullptr); // destructor virtual ~LocalLambdaCouplingMatrix() { @@ -1771,7 +1771,7 @@ namespace ATC { GhostCouplingMatrix(ATC_Method * atc, SPAR_MAN * shapeFunction, SetDependencyManager * subsetNodes, - MatrixDependencyManager * nodeToOverlapMap = NULL); + MatrixDependencyManager * nodeToOverlapMap = nullptr); // destructor virtual ~GhostCouplingMatrix() { diff --git a/lib/atc/PerPairQuantity.cpp b/lib/atc/PerPairQuantity.cpp index 3632a87aa9..01308e4b39 100644 --- a/lib/atc/PerPairQuantity.cpp +++ b/lib/atc/PerPairQuantity.cpp @@ -272,7 +272,7 @@ BondMatrixKernel::BondMatrixKernel(LammpsInterface * lammpsInterface, BondMatrix(lammpsInterface,pairMap,x,feMesh), kernelFunction_(kernelFunction) { - if (kernelFunction_ == NULL) + if (kernelFunction_ == nullptr) throw ATC_Error("No AtC kernel function initialized"); }; void BondMatrixKernel::reset(void) const diff --git a/lib/atc/PhysicsModel.h b/lib/atc/PhysicsModel.h index 50b327ce0b..8479727a89 100644 --- a/lib/atc/PhysicsModel.h +++ b/lib/atc/PhysicsModel.h @@ -105,7 +105,7 @@ namespace ATC const WeakEquation * weak_equation(FieldName field) const { std::map::const_iterator itr = weakEqns_.find(field); - if (itr == weakEqns_.end()) return NULL; + if (itr == weakEqns_.end()) return nullptr; return (weakEqns_.find(field))->second; } diff --git a/lib/atc/PoissonSolver.cpp b/lib/atc/PoissonSolver.cpp index 86670ae218..52909fc454 100644 --- a/lib/atc/PoissonSolver.cpp +++ b/lib/atc/PoissonSolver.cpp @@ -33,9 +33,9 @@ PoissonSolver::PoissonSolver( fieldName_(fieldName), rhsMask_(rhsMask), linear_(false), - solver_(NULL), - solverNL_(NULL), - tangent_(NULL), + solver_(nullptr), + solverNL_(nullptr), + tangent_(nullptr), solverType_(solverType), solverTol_(0), solverMaxIter_(0), diff --git a/lib/atc/PrescribedDataManager.cpp b/lib/atc/PrescribedDataManager.cpp index bd649c8ace..947191a0e4 100644 --- a/lib/atc/PrescribedDataManager.cpp +++ b/lib/atc/PrescribedDataManager.cpp @@ -34,8 +34,8 @@ namespace ATC { bcs_[thisField].reset(nNodes_,thisSize); for (int inode = 0; inode < nNodes_ ; ++inode) { for (int idof = 0; idof < thisSize ; ++idof) { - ics_[thisField](inode,idof) = NULL; - bcs_[thisField](inode,idof) = NULL; + ics_[thisField](inode,idof) = nullptr; + bcs_[thisField](inode,idof) = nullptr; } } // compact inode, value lists @@ -44,7 +44,7 @@ namespace ATC { elementSources_[thisField].reset(nElems_,thisSize); for (int ielem = 0; ielem < nElems_ ; ++ielem) { for (int idof = 0; idof < thisSize ; ++idof) { - elementSources_[thisField](ielem,idof) = NULL; + elementSources_[thisField](ielem,idof) = nullptr; } } // node based sources @@ -76,8 +76,8 @@ namespace ATC { bcs_[fieldName].reset(nNodes_,size); for (int inode = 0; inode < nNodes_ ; ++inode) { for (int idof = 0; idof < size ; ++idof) { - ics_[fieldName](inode,idof) = NULL; - bcs_[fieldName](inode,idof) = NULL; + ics_[fieldName](inode,idof) = nullptr; + bcs_[fieldName](inode,idof) = nullptr; } } @@ -85,7 +85,7 @@ namespace ATC { elementSources_[fieldName].reset(nElems_,size); for (int ielem = 0; ielem < nElems_ ; ++ielem) { for (int idof = 0; idof < size ; ++idof) { - elementSources_[fieldName](ielem,idof) = NULL; + elementSources_[fieldName](ielem,idof) = nullptr; } } } @@ -159,7 +159,7 @@ namespace ATC { set::const_iterator iset; for (iset = nodeSet.begin(); iset != nodeSet.end(); iset++) { int inode = *iset; - bcs_[thisField](inode,thisIndex) = NULL; + bcs_[thisField](inode,thisIndex) = nullptr; } } @@ -182,7 +182,7 @@ namespace ATC { const FieldName thisField, const int thisIndex) { - bcs_[thisField](nodeId,thisIndex) = NULL; + bcs_[thisField](nodeId,thisIndex) = nullptr; } //------------------------------------------------------------------------- // fix_flux @@ -203,7 +203,7 @@ namespace ATC { if (dof.size() == 0) { int ndof = (fieldSizes_.find(thisField))->second; dof.reset(ndof); - for(int i = 0; i < ndof; i++) dof(i) = NULL; + for(int i = 0; i < ndof; i++) dof(i) = nullptr; } dof(thisIndex) = (XT_Function*) f; } @@ -222,7 +222,7 @@ namespace ATC { for (iset = fset->begin(); iset != fset->end(); iset++) { pair face = *iset; Array < XT_Function * > & dof = faceSources_[thisField][face]; - dof(thisIndex) = NULL; + dof(thisIndex) = nullptr; } } //------------------------------------------------------------------------- @@ -244,7 +244,7 @@ namespace ATC { if (dof.size() == 0) { int ndof = (fieldSizes_.find(thisField))->second; dof.reset(ndof); - for(int i = 0; i < ndof; i++) dof(i) = NULL; + for(int i = 0; i < ndof; i++) dof(i) = nullptr; } dof(thisIndex) = (UXT_Function*) f; } @@ -263,7 +263,7 @@ namespace ATC { for (iset = fset->begin(); iset != fset->end(); iset++) { pair face = *iset; Array < UXT_Function * > & dof = faceSourcesRobin_[thisField][face]; - dof(thisIndex) = NULL; + dof(thisIndex) = nullptr; } } //------------------------------------------------------------------------- @@ -342,7 +342,7 @@ namespace ATC { set::const_iterator iset; for (iset = elemSet.begin(); iset != elemSet.end(); iset++) { int ielem = *iset; - elementSources_[thisField](ielem,thisIndex) = NULL; + elementSources_[thisField](ielem,thisIndex) = nullptr; } } //------------------------------------------------------------------------- diff --git a/lib/atc/Quadrature.cpp b/lib/atc/Quadrature.cpp index 8efe0e2969..94fe4a701c 100644 --- a/lib/atc/Quadrature.cpp +++ b/lib/atc/Quadrature.cpp @@ -5,14 +5,14 @@ using namespace std; namespace ATC { -Quadrature * Quadrature::myInstance_ = NULL; +Quadrature * Quadrature::myInstance_ = nullptr; // ----------------------------------------------------------------- // instance() // ----------------------------------------------------------------- Quadrature * Quadrature::instance() { - if (myInstance_ == NULL) { + if (myInstance_ == nullptr) { myInstance_ = new Quadrature(); } return myInstance_; @@ -24,7 +24,7 @@ Quadrature * Quadrature::instance() void Quadrature::Destroy() { if (myInstance_) delete myInstance_; - myInstance_ = NULL; + myInstance_ = nullptr; } diff --git a/lib/atc/SchrodingerSolver.cpp b/lib/atc/SchrodingerSolver.cpp index d79fa85595..3819562a70 100644 --- a/lib/atc/SchrodingerSolver.cpp +++ b/lib/atc/SchrodingerSolver.cpp @@ -646,7 +646,7 @@ double fermi_dirac(const double E, const double T) double mu, double D ) : SliceSchrodingerPoissonSolver(atc,schrodingerSolver,poissonSolver,physicsModel,maxConsistencyIter,maxConstraintIter,oneDconserve,0,0), - solver_(NULL), + solver_(nullptr), mobility_(mu),diffusivity_(D) { Ef0_ = Ef0; diff --git a/lib/atc/SparseMatrix-inl.h b/lib/atc/SparseMatrix-inl.h index 36867ad8de..2923d6daa5 100644 --- a/lib/atc/SparseMatrix-inl.h +++ b/lib/atc/SparseMatrix-inl.h @@ -17,14 +17,14 @@ TRI_COORD::TRI_COORD(INDEX row, INDEX col, T val, bool add_to) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(INDEX rows, INDEX cols) - : _val(NULL), _ia(NULL), _ja(NULL), _size(0), _nRowsCRS(0), hasTemplate_(false), + : _val(nullptr), _ia(nullptr), _ja(nullptr), _size(0), _nRowsCRS(0), hasTemplate_(false), _nRows(rows),_nCols(cols) {} //----------------------------------------------------------------------------- // copy constructor //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const SparseMatrix& C) - : Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) + : Matrix(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false) { _copy(C); } @@ -33,7 +33,7 @@ SparseMatrix::SparseMatrix(const SparseMatrix& C) //----------------------------------------------------------------------------- template SparseMatrix::SparseMatrix(const DenseMatrix& C) -: Matrix(), _val(NULL), _ia(NULL), _ja(NULL), hasTemplate_(false) +: Matrix(), _val(nullptr), _ia(nullptr), _ja(nullptr), hasTemplate_(false) { reset(C); } @@ -67,9 +67,9 @@ void SparseMatrix::_create(INDEX size, INDEX nrows) // assign memory to hold matrix try { - _val = (_size && nrows) ? new T [_size] : NULL; - _ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : NULL; - _ja = (_size && nrows) ? new INDEX [_size] : NULL; + _val = (_size && nrows) ? new T [_size] : nullptr; + _ia = (_size && nrows) ? new INDEX [_nRowsCRS+1] : nullptr; + _ja = (_size && nrows) ? new INDEX [_size] : nullptr; } catch (std::exception &e) { @@ -94,8 +94,8 @@ void SparseMatrix::_delete() if (_ia) delete [] _ia; if (_ja) delete [] _ja; _size = _nRowsCRS = 0; - _val = NULL; - _ia = _ja = NULL; + _val = nullptr; + _ia = _ja = nullptr; } //----------------------------------------------------------------------------- // full memory copy of C into this diff --git a/lib/atc/SparseVector.h b/lib/atc/SparseVector.h index 5cb16af527..d387b45b66 100644 --- a/lib/atc/SparseVector.h +++ b/lib/atc/SparseVector.h @@ -88,7 +88,7 @@ protected: //@{ SparseVector(const Matrix &c); SparseVector& operator=(Matrix &c); - T* ptr() const {return NULL; } + T* ptr() const {return nullptr; } //@} STORE data_; //*> sparse data structure diff --git a/lib/atc/SpeciesTimeIntegrator.cpp b/lib/atc/SpeciesTimeIntegrator.cpp index 3a196e745a..3215b159f8 100644 --- a/lib/atc/SpeciesTimeIntegrator.cpp +++ b/lib/atc/SpeciesTimeIntegrator.cpp @@ -108,9 +108,9 @@ namespace ATC { timeFilter_(speciesTimeIntegrator->time_filter()), massDensity_(atc_->field(MASS_DENSITY)), nodalAtomicMassDensityOut_(atc_->nodal_atomic_field(MASS_DENSITY)), - nodalAtomicMassDensity_(NULL), + nodalAtomicMassDensity_(nullptr), speciesConcentration_(atc_->field(SPECIES_CONCENTRATION)), - nodalAtomicSpeciesConcentration_(NULL), + nodalAtomicSpeciesConcentration_(nullptr), nodalAtomicSpeciesConcentrationFiltered_(speciesTimeIntegrator->nodal_atomic_species_concentration_filtered()), moleculeIds_(moleculeIds) { diff --git a/lib/atc/SpeciesTimeIntegrator.h b/lib/atc/SpeciesTimeIntegrator.h index c8fbe97c5e..64cc07022c 100644 --- a/lib/atc/SpeciesTimeIntegrator.h +++ b/lib/atc/SpeciesTimeIntegrator.h @@ -71,7 +71,7 @@ namespace ATC { const std::map > & moleculeIds); // destructor - virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=NULL;}; + virtual ~SpeciesIntegrationMethod() {nodalAtomicMassDensity_=nullptr;}; /** create and get necessary transfer operators */ virtual void construct_transfers(); diff --git a/lib/atc/Stress.cpp b/lib/atc/Stress.cpp index 72656c21ed..a1445bd8ea 100644 --- a/lib/atc/Stress.cpp +++ b/lib/atc/Stress.cpp @@ -299,10 +299,10 @@ void StressCubicElasticDamped::stress(const FIELD_MATS &fields, // cauchy born model //============================================================================== StressCauchyBorn::StressCauchyBorn(fstream &fileId, CbData &cb) - : cblattice_(NULL), - potential_(NULL), + : cblattice_(nullptr), + potential_(nullptr), makeLinear_(false), - cubicMat_(NULL), + cubicMat_(nullptr), initialized_(false), fixed_temperature_(0.), cbdata_(cb) diff --git a/lib/atc/Stress.h b/lib/atc/Stress.h index 513cdb2d97..5a7c9e30a3 100644 --- a/lib/atc/Stress.h +++ b/lib/atc/Stress.h @@ -149,7 +149,7 @@ namespace ATC { DENS_VEC elasticity_tensor(const VECTOR &Fv, MATRIX &C, const ElasticityTensorType type=FIRST_ELASTICITY_TENSOR) const; DENS_VEC elasticity_tensor(const MATRIX &F, MATRIX &C, const ElasticityTensorType type=FIRST_ELASTICITY_TENSOR) const; protected: - void linearize(MATRIX *F=NULL); + void linearize(MATRIX *F=nullptr); CBLattice *cblattice_; //*> CbLattice -> makes atom clusters. CbPotential *potential_; //*> CbPotential -> interatomic forces. bool makeLinear_; diff --git a/lib/atc/ThermalTimeIntegrator.cpp b/lib/atc/ThermalTimeIntegrator.cpp index e74d46a20c..8c0b8d6dae 100644 --- a/lib/atc/ThermalTimeIntegrator.cpp +++ b/lib/atc/ThermalTimeIntegrator.cpp @@ -150,7 +150,7 @@ namespace ATC { temperatureRoc_(atc_->field_roc(TEMPERATURE)), temperature2Roc_(atc_->field_2roc(TEMPERATURE)), nodalAtomicTemperatureOut_(atc_->nodal_atomic_field(TEMPERATURE)), - nodalAtomicTemperature_(NULL), + nodalAtomicTemperature_(nullptr), temperatureRhs_(atc_->field_rhs(TEMPERATURE)), nodalAtomicPowerOut_(atc_->nodal_atomic_field_roc(TEMPERATURE)) { @@ -384,7 +384,7 @@ namespace ATC { nodalAtomicEnergyFiltered_(thermalTimeIntegrator->nodal_atomic_energy_filtered()), nodalAtomicPowerFiltered_(thermalTimeIntegrator->nodal_atomic_power_filtered()), atomicTemperatureDelta_(atc_->num_nodes(),1), - nodalAtomicEnergy_(NULL), + nodalAtomicEnergy_(nullptr), nodalAtomicEnergyOld_(atc_->num_nodes(),1), nodalAtomicTemperatureOld_(atc_->num_nodes(),1) { diff --git a/lib/atc/Thermostat.cpp b/lib/atc/Thermostat.cpp index a602105854..217f2394e2 100644 --- a/lib/atc/Thermostat.cpp +++ b/lib/atc/Thermostat.cpp @@ -367,7 +367,7 @@ namespace ATC { const string & regulatorPrefix) : RegulatorShapeFunction(thermostat,regulatorPrefix), mdMassMatrix_(atc_->set_mass_mat_md(TEMPERATURE)), - atomVelocities_(NULL) + atomVelocities_(nullptr) { fieldMask_(TEMPERATURE,FLUX) = true; lambda_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaEnergy",1); // data associated with stage 3 in ATC_Method::initialize @@ -425,7 +425,7 @@ namespace ATC { ThermostatRescale::ThermostatRescale(AtomicRegulator * thermostat) : ThermostatShapeFunction(thermostat), nodalTemperature_(atc_->field(TEMPERATURE)), - atomVelocityRescalings_(NULL) + atomVelocityRescalings_(nullptr) { // do nothing } @@ -535,7 +535,7 @@ namespace ATC { //-------------------------------------------------------- ThermostatRescaleMixedKePe::ThermostatRescaleMixedKePe(AtomicRegulator * thermostat) : ThermostatRescale(thermostat), - nodalAtomicFluctuatingPotentialEnergy_(NULL) + nodalAtomicFluctuatingPotentialEnergy_(nullptr) { // do nothing } @@ -607,7 +607,7 @@ namespace ATC { const string & regulatorPrefix) : RegulatorShapeFunction(thermostat,regulatorPrefix), lambdaMaxIterations_(lambdaMaxIterations), - rhsLambdaSquared_(NULL), + rhsLambdaSquared_(nullptr), dtFactor_(1.) { fieldMask_(TEMPERATURE,FLUX) = true; @@ -741,21 +741,21 @@ namespace ATC { int /* lambdaMaxIterations */, const string & regulatorPrefix) : RegulatorMethod(thermostat,regulatorPrefix), - lambdaSolver_(NULL), + lambdaSolver_(nullptr), mdMassMatrix_(atc_->set_mass_mat_md(TEMPERATURE)), - atomVelocities_(NULL), + atomVelocities_(nullptr), temperature_(atc_->field(TEMPERATURE)), timeFilter_(atomicRegulator_->time_filter()), - nodalAtomicLambdaPower_(NULL), - lambdaPowerFiltered_(NULL), - atomLambdas_(NULL), - atomThermostatForces_(NULL), - atomMasses_(NULL), + nodalAtomicLambdaPower_(nullptr), + lambdaPowerFiltered_(nullptr), + atomLambdas_(nullptr), + atomThermostatForces_(nullptr), + atomMasses_(nullptr), isFirstTimestep_(true), - nodalAtomicEnergy_(NULL), - atomPredictedVelocities_(NULL), - nodalAtomicPredictedEnergy_(NULL), - firstHalfAtomForces_(NULL) + nodalAtomicEnergy_(nullptr), + atomPredictedVelocities_(nullptr), + nodalAtomicPredictedEnergy_(nullptr), + firstHalfAtomForces_(nullptr) { // construct/obtain data corresponding to stage 3 of ATC_Method::initialize nodalAtomicLambdaPower_ = thermostat->regulator_data(regulatorPrefix_+"NodalAtomicLambdaPower",1); @@ -1389,7 +1389,7 @@ namespace ATC { int lambdaMaxIterations, const string & regulatorPrefix) : ThermostatGlcFs(thermostat,lambdaMaxIterations,regulatorPrefix), - atomThermostatForcesPredVel_(NULL), + atomThermostatForcesPredVel_(nullptr), filterCoefficient_(1.) { lambdaSolver_ = new ThermostatSolverFixed(thermostat, @@ -1887,9 +1887,9 @@ namespace ATC { int lambdaMaxIterations, bool constructThermostats) : RegulatorMethod(thermostat), - thermostatFlux_(NULL), - thermostatFixed_(NULL), - thermostatBcs_(NULL) + thermostatFlux_(nullptr), + thermostatFixed_(nullptr), + thermostatBcs_(nullptr) { if (constructThermostats) { thermostatFlux_ = new ThermostatIntegratorFlux(thermostat,lambdaMaxIterations,regulatorPrefix_+"Flux"); @@ -2022,10 +2022,10 @@ namespace ATC { ThermostatGlc::ThermostatGlc(AtomicRegulator * thermostat) : ThermostatShapeFunction(thermostat), timeFilter_(atomicRegulator_->time_filter()), - lambdaPowerFiltered_(NULL), - atomThermostatForces_(NULL), + lambdaPowerFiltered_(nullptr), + atomThermostatForces_(nullptr), prescribedDataMgr_(atc_->prescribed_data_manager()), - atomMasses_(NULL) + atomMasses_(nullptr) { // consistent with stage 3 of ATC_Method::initialize lambdaPowerFiltered_= atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaPowerFiltered",1); @@ -2080,8 +2080,8 @@ namespace ATC { ThermostatGlc(thermostat), nodalTemperatureRoc_(atc_->field_roc(TEMPERATURE)), heatSource_(atc_->atomic_source(TEMPERATURE)), - nodalAtomicPower_(NULL), - nodalAtomicLambdaPower_(NULL) + nodalAtomicPower_(nullptr), + nodalAtomicLambdaPower_(nullptr) { // do nothing } @@ -2287,8 +2287,8 @@ namespace ATC { //-------------------------------------------------------- ThermostatHooverVerlet::ThermostatHooverVerlet(AtomicRegulator * thermostat) : ThermostatPowerVerlet(thermostat), - lambdaHoover_(NULL), - nodalAtomicHooverLambdaPower_(NULL) + lambdaHoover_(nullptr), + nodalAtomicHooverLambdaPower_(nullptr) { // set up data consistent with stage 3 of ATC_Method::initialize lambdaHoover_ = atomicRegulator_->regulator_data(regulatorPrefix_+"LambdaHoover",1); @@ -2505,8 +2505,8 @@ namespace ATC { //-------------------------------------------------------- ThermostatHooverVerletFiltered::ThermostatHooverVerletFiltered(AtomicRegulator * thermostat) : ThermostatPowerVerletFiltered(thermostat), - lambdaHoover_(NULL), - nodalAtomicHooverLambdaPower_(NULL) + lambdaHoover_(nullptr), + nodalAtomicHooverLambdaPower_(nullptr) { // consistent with stage 3 of ATC_Method::initialize lambdaHoover_ = atomicRegulator_->regulator_data("LambdaHoover",1); diff --git a/lib/atc/TimeFilter.cpp b/lib/atc/TimeFilter.cpp index 08cb64c8fe..ece3429c86 100644 --- a/lib/atc/TimeFilter.cpp +++ b/lib/atc/TimeFilter.cpp @@ -210,7 +210,7 @@ namespace ATC { } else if (filterType_ == STEP_FILTER) { newTimeFilter = new TimeFilterStep(*this); - } else newTimeFilter = NULL; + } else newTimeFilter = nullptr; } else { // default to return base class newTimeFilter = new TimeFilter(*this); diff --git a/lib/atc/TimeIntegrator.cpp b/lib/atc/TimeIntegrator.cpp index 4e8dec8c62..f370d17170 100644 --- a/lib/atc/TimeIntegrator.cpp +++ b/lib/atc/TimeIntegrator.cpp @@ -17,10 +17,10 @@ namespace ATC { AtomTimeIntegratorType::AtomTimeIntegratorType(ATC_Method * atc, AtomType atomType) : atc_(atc), atomType_(atomType), - mass_(NULL), - position_(NULL), - velocity_(NULL), - force_(NULL) + mass_(nullptr), + position_(nullptr), + velocity_(nullptr), + force_(nullptr) { // do nothing } @@ -90,9 +90,9 @@ namespace ATC { //-------------------------------------------------------- TimeIntegrator::TimeIntegrator(ATC_Coupling * atc, TimeIntegrationType timeIntegrationType) : - timeIntegrationMethod_(NULL), + timeIntegrationMethod_(nullptr), atc_(atc), - timeFilter_(NULL), + timeFilter_(nullptr), timeFilterManager_(atc_->time_filter_manager()), timeIntegrationType_(timeIntegrationType), needReset_(true) diff --git a/lib/atc/TransferLibrary.cpp b/lib/atc/TransferLibrary.cpp index d0db0076d7..b77a91fd2e 100644 --- a/lib/atc/TransferLibrary.cpp +++ b/lib/atc/TransferLibrary.cpp @@ -816,7 +816,7 @@ namespace ATC { for (unsigned i = 0; i < quantity_.size(); ++i) { if (quantity_[i]) delete quantity_[i]; } - quantity_.resize(source.size(),NULL); + quantity_.resize(source.size(),nullptr); for (unsigned i = 0; i < source.size(); i++) { quantity_[i] = new SPAR_MAT(map_->size(),source[i]->nCols()); } @@ -1363,7 +1363,7 @@ namespace ATC { { pointToElementMap_->register_dependence(this); pointPositions_->register_dependence(this); - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { quantity_[i] = new SPAR_MAT(); } @@ -1428,7 +1428,7 @@ namespace ATC { atomPositions_->register_dependence(this); // storage container - matrices_.resize(atc->nsd(),NULL); + matrices_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { matrices_[i] = new AtcAtomSparseMatrix(atc,feEngine_->num_nodes(), feEngine_->num_nodes_per_element(), @@ -1440,7 +1440,7 @@ namespace ATC { matrices_[i]->register_dependence(this); } - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); } //-------------------------------------------------------- @@ -1926,7 +1926,7 @@ namespace ATC { VectorTransfer(), feEngine_(atc->fe_engine()) { - quantity_.resize(atc->nsd(),NULL); + quantity_.resize(atc->nsd(),nullptr); for (int i = 0; i < atc->nsd(); ++i) { quantity_[i] = new SPAR_MAT(); } diff --git a/lib/atc/TransferLibrary.h b/lib/atc/TransferLibrary.h index 3a0f420f37..d1f27e5e6d 100644 --- a/lib/atc/TransferLibrary.h +++ b/lib/atc/TransferLibrary.h @@ -115,7 +115,7 @@ namespace ATC { // constructor NodalAtomVolumeElement(ATC_Method * atc, SPAR_MAN * shapeFunction, - PerAtomQuantity * atomElement=NULL); + PerAtomQuantity * atomElement=nullptr); // destructor virtual ~NodalAtomVolumeElement() { @@ -173,7 +173,7 @@ namespace ATC { // constructor AtomTypeElement(ATC_Coupling * atc, - PerAtomQuantity * atomElement = NULL); + PerAtomQuantity * atomElement = nullptr); // destructor virtual ~AtomTypeElement() { @@ -211,8 +211,8 @@ namespace ATC { // constructor ElementMask(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL, - MatrixDependencyManager * hasGhost = NULL); + MatrixDependencyManager * hasInternal = nullptr, + MatrixDependencyManager * hasGhost = nullptr); // destructor virtual ~ElementMask() { @@ -251,7 +251,7 @@ namespace ATC { // constructor AtomElementMask(ATC_Coupling * atc, - MatrixDependencyManager * hasAtoms = NULL); + MatrixDependencyManager * hasAtoms = nullptr); // destructor virtual ~AtomElementMask() { @@ -287,8 +287,8 @@ namespace ATC { // constructor NodalGeometryType(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL, - MatrixDependencyManager * hasGhost = NULL); + MatrixDependencyManager * hasInternal = nullptr, + MatrixDependencyManager * hasGhost = nullptr); // destructor virtual ~NodalGeometryType() { @@ -338,7 +338,7 @@ namespace ATC { // constructor NodalGeometryTypeElementSet(ATC_Coupling * atc, - MatrixDependencyManager * hasInternal = NULL); + MatrixDependencyManager * hasInternal = nullptr); // destructor virtual ~NodalGeometryTypeElementSet() { @@ -659,7 +659,7 @@ namespace ATC { // constructor RegulatedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL); + MatrixDependencyManager * nodalGeometryType = nullptr); // destructor virtual ~RegulatedNodes() { @@ -721,7 +721,7 @@ namespace ATC { // constructor FluxNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -751,7 +751,7 @@ namespace ATC { // constructor BoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -781,7 +781,7 @@ namespace ATC { // constructor FluxBoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FluxNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -811,7 +811,7 @@ namespace ATC { // constructor AllRegulatedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FluxBoundaryNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -841,7 +841,7 @@ namespace ATC { // constructor FixedNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : RegulatedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -871,7 +871,7 @@ namespace ATC { // constructor FixedBoundaryNodes(ATC_Coupling * atc, FieldName fieldName = NUM_TOTAL_FIELDS, - MatrixDependencyManager * nodalGeometryType = NULL) : + MatrixDependencyManager * nodalGeometryType = nullptr) : FixedNodes(atc,fieldName,nodalGeometryType) {}; // destructor @@ -1052,8 +1052,8 @@ namespace ATC { // constructor PerAtomShapeFunctionGradient(ATC_Method * atc, - MatrixDependencyManager* atomToElementMap = NULL, - DENS_MAN* atomPositions = NULL, + MatrixDependencyManager* atomToElementMap = nullptr, + DENS_MAN* atomPositions = nullptr, const std::string & tag = "AtomicShapeFunctionGradient", AtomType atomType = INTERNAL); diff --git a/lib/atc/TransferOperator.h b/lib/atc/TransferOperator.h index 5f776d04ca..5cf578b77c 100644 --- a/lib/atc/TransferOperator.h +++ b/lib/atc/TransferOperator.h @@ -542,7 +542,7 @@ namespace ATC { AtfProjection(ATC_Method * atc, PerAtomQuantity * source, SPAR_MAN * accumulant, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjection(); @@ -587,7 +587,7 @@ namespace ATC { PerAtomQuantity * source, SPAR_MAN * accumulant, const double scale, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjectionScaled(); @@ -620,7 +620,7 @@ namespace ATC { PerAtomQuantity * source, SPAR_MAN * accumulant, DENS_MAN * reference, - DIAG_MAN * weights = NULL); + DIAG_MAN * weights = nullptr); // destructor virtual ~AtfProjectionReferenced(); diff --git a/lib/atc/Utility.h b/lib/atc/Utility.h index 2c0ea7270f..6693df9323 100644 --- a/lib/atc/Utility.h +++ b/lib/atc/Utility.h @@ -226,7 +226,7 @@ namespace ATC_Utility { char *endptr; strtod(s.c_str(), &endptr); - if(endptr != NULL && *endptr == '\0') return true; + if(endptr != nullptr && *endptr == '\0') return true; return false; } diff --git a/lib/awpmd/ivutils/include/logexc.h b/lib/awpmd/ivutils/include/logexc.h index 80942f60bf..2eebfcc0ce 100644 --- a/lib/awpmd/ivutils/include/logexc.h +++ b/lib/awpmd/ivutils/include/logexc.h @@ -129,7 +129,7 @@ public: message_logger(const string &descriptor_="", int out_level=vblALLBAD|vblMESS1, int stop_level=vblFATAL, int throw_exceptions=0, int use_globally=0) - :descriptor(descriptor_),prev(NULL),next(NULL){ + :descriptor(descriptor_),prev(nullptr),next(nullptr){ set_throw(throw_exceptions); set_levels(out_level,stop_level); extra_levels(0,0); @@ -157,8 +157,8 @@ public: return -1; glogp=prev; if(glogp) - glogp->next=NULL; - prev=NULL; + glogp->next=nullptr; + prev=nullptr; } return 1; } @@ -244,7 +244,7 @@ public: FILE *out=stdout, FILE *err=stderr, int out_level=vblALLBAD|vblMESS1,int stop_level=vblFATAL, int use_globally=0) - : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(NULL), ferr(NULL){ + : message_logger(descriptor_,out_level,stop_level,throw_exceptions,use_globally),fout(nullptr), ferr(nullptr){ set_out(out); set_err(err); } @@ -273,7 +273,7 @@ public: }; /// format a string -const char *fmt(const char *format,...); +const char *logfmt(const char *format,...); /// macros with common usage #define LOGFATAL(code,text,lineinfo) ((lineinfo) ? ::message(vblFATAL,(code)," %s at %s:%d",(text),__FILE__,__LINE__) : \ diff --git a/lib/awpmd/ivutils/include/pairhash.h b/lib/awpmd/ivutils/include/pairhash.h index c29f72773f..401b7b91e3 100644 --- a/lib/awpmd/ivutils/include/pairhash.h +++ b/lib/awpmd/ivutils/include/pairhash.h @@ -146,7 +146,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -173,13 +173,13 @@ public: size_t sizex, sizey; //e default constructor - recmatrix(): parr(NULL,1) { + recmatrix(): parr(nullptr,1) { sizey=sizex=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(NULL){ + recmatrix(const recmatrix &other):sizex(0),sizey(0),arr(nullptr){ *this=other; } @@ -222,7 +222,7 @@ public: virtual int init(size_t nx, size_t ny, int smanaged=-1){ int managed=parr.managed(); if(managed && (sizex!=nx || sizey!=ny)){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -355,7 +355,7 @@ public: public: iterator(const iterator &other):ptr(other.ptr),incr(other.incr){ } - iterator():ptr(NULL),incr(0){} + iterator():ptr(nullptr),incr(0){} iterator &operator++(){ // prefix ptr+=incr; return *this; @@ -382,13 +382,13 @@ public: size_t size; //e default constructor - sqmatrix(): parr(NULL,1) { + sqmatrix(): parr(nullptr,1) { size=0; - arr=NULL; + arr=nullptr; } //e copy constructor: makes a managed copy - sqmatrix(const sqmatrix &other):size(0),arr(NULL){ + sqmatrix(const sqmatrix &other):size(0),arr(nullptr){ *this=other; } @@ -430,7 +430,7 @@ public: virtual int init(size_t n, int smanaged=-1){ int managed=parr.managed(); if(managed && size!=n){ - parr.reset(NULL,0); + parr.reset(nullptr,0); } if(smanaged>=0){ // for changing the managed flag? parr.reset(parr.ptr(),smanaged ? smanaged|0x8 : 0 ); @@ -600,9 +600,9 @@ class PairHash{ public: //e find the value with indexes i, j //e @return 0 if not found, 1 otherwise - //e if retval is not NULL, puts the found value there - virtual int Find(long i, long j, T *retval=NULL)=0; - virtual int Find(long i, long j, T **retval=NULL)=0; + //e if retval is not a null pointer, puts the found value there + virtual int Find(long i, long j, T *retval=nullptr)=0; + virtual int Find(long i, long j, T **retval=nullptr)=0; virtual int Del(long i, long j)=0; virtual int Put(long i, long j, const T *value)=0; virtual int Put(long i, long j, const T& value)=0; @@ -621,7 +621,7 @@ public: indm.Set(-1); arr= new T[n*(n+1)/2]; } - int Find(long i, long j, T *retval=NULL){ + int Find(long i, long j, T *retval=nullptr){ long ind=indm(i,j); if(ind>=0){ if(retval){ diff --git a/lib/awpmd/ivutils/include/refobj.h b/lib/awpmd/ivutils/include/refobj.h index a1a4feb0ff..8e5fc7df45 100644 --- a/lib/awpmd/ivutils/include/refobj.h +++ b/lib/awpmd/ivutils/include/refobj.h @@ -158,7 +158,7 @@ public: using base_t::second; using base_t::first; - mngptr(T* ptr=NULL, int managed=0): pair(ptr,managed){ + mngptr(T* ptr=nullptr, int managed=0): pair(ptr,managed){ //if(managed==2)ptr= new T(*ptr); } mngptr(const mngarg &arg): pair(arg.first,arg.second){} @@ -166,7 +166,7 @@ public: reset(arg.first,arg.second); return *this; } - void reset(T* ptr=NULL, int managed=0){ + void reset(T* ptr=nullptr, int managed=0){ if(second && first && first!=ptr){ if(second&0x8)delete [] first; else delete first; @@ -313,7 +313,7 @@ template > class shptr{ template friend class shptr; T *p; - int *num; //if num==NULL than p is not managed (as in mngptr) + int *num; //if num==nullptr than p is not managed (as in mngptr) void set(T *p_, int managed){ p=p_; @@ -321,7 +321,7 @@ class shptr{ num=new int; *num=1; } - else num=NULL; + else num=nullptr; } template void set(const Y &other){ @@ -330,7 +330,7 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } void set(const shptr &other){ p=other.p; @@ -338,11 +338,11 @@ class shptr{ num=other.num; if(num)(*num)++; } - else num=NULL; + else num=nullptr; } public: - shptr(T* p=NULL, int managed=1){ + shptr(T* p=nullptr, int managed=1){ set(p,managed); } shptr(const mngarg &arg){ @@ -398,14 +398,14 @@ public: delete_t()(p); delete num; } - num=NULL; + num=nullptr; } - p=NULL; + p=nullptr; } } bool valid() const { - return p!=NULL; + return p!=nullptr; } T* ptr() const { diff --git a/lib/awpmd/ivutils/include/vector_3.h b/lib/awpmd/ivutils/include/vector_3.h index 468abbda99..5711d3bf35 100644 --- a/lib/awpmd/ivutils/include/vector_3.h +++ b/lib/awpmd/ivutils/include/vector_3.h @@ -374,7 +374,7 @@ struct Vector_Nt { } - T maxcoord(int *ind=NULL) const { + T maxcoord(int *ind=nullptr) const { int im=0; T vv=v[0]; for (int i=1; i -Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=NULL,Vector_3* box_max=NULL){ +Vector_3 get_extent(vec_inp_it beg,vec_inp_it end, Vector_3* box_min=nullptr,Vector_3* box_max=nullptr){ if(beg==end) return Vector_3(); Vector_3 center(*beg++); diff --git a/lib/awpmd/ivutils/src/logexc.cpp b/lib/awpmd/ivutils/src/logexc.cpp index d29745fda1..6e809dd65c 100644 --- a/lib/awpmd/ivutils/src/logexc.cpp +++ b/lib/awpmd/ivutils/src/logexc.cpp @@ -13,10 +13,10 @@ message_logger &message_logger::global(){ return *glogp; } -message_logger *message_logger::glogp=NULL; +message_logger *message_logger::glogp=nullptr; stdfile_logger default_log("",0,stdout,stderr,vblALLBAD|vblMESS1,vblFATAL,1); -const char *fmt(const char *format,...){ +const char *logfmt(const char *format,...){ va_list args; va_start(args,format); static char buff[1024]; diff --git a/lib/awpmd/systems/interact/TCP/wpmd.cpp b/lib/awpmd/systems/interact/TCP/wpmd.cpp index 1e53f3141c..660d7c21d7 100644 --- a/lib/awpmd/systems/interact/TCP/wpmd.cpp +++ b/lib/awpmd/systems/interact/TCP/wpmd.cpp @@ -170,7 +170,7 @@ int AWPMD::set_pbc(const Vector_3P pcell, int pbc_){ int AWPMD::set_electrons(int s, int n, Vector_3P x, Vector_3P v, double* w, double* pw, double mass, double *q) { if(s < 0 || s > 1) - return LOGERR(-1,fmt("AWPMD.set_electrons: invaid s setting (%d)!",s),LINFO); + return LOGERR(-1,logfmt("AWPMD.set_electrons: invaid s setting (%d)!",s),LINFO); norm_matrix_state[s] = NORM_UNDEFINED; nwp[s]=ne[s]=n; @@ -363,20 +363,20 @@ int AWPMD::interaction(int flag, Vector_3P fi, Vector_3P fe_x, //3. inverting the overlap matrix int info=0; if(nes){ - /*FILE *f1=fopen(fmt("matrO_%d.d",s),"wt"); + /*FILE *f1=fopen(logfmt("matrO_%d.d",s),"wt"); fileout(f1,Y[s],"%15g"); fclose(f1);8*/ - + ZPPTRF("L",&nes,Y[s].arr,&info); // analyze return code here if(info<0) - return LOGERR(info,fmt("AWPMD.interacton: call to ZPTRF failed (exitcode %d)!",info),LINFO); + return LOGERR(info,logfmt("AWPMD.interacton: call to ZPTRF failed (exitcode %d)!",info),LINFO); ZPPTRI("L",&nes,Y[s].arr,&info); if(info<0) - return LOGERR(info,fmt("AWPMD.interacton: call to ZPTRI failed (exitcode %d)!",info),LINFO); + return LOGERR(info,logfmt("AWPMD.interacton: call to ZPTRI failed (exitcode %d)!",info),LINFO); - - /*f1=fopen(fmt("matrY_%d.d",s),"wt"); + + /*f1=fopen(logfmt("matrY_%d.d",s),"wt"); fileout(f1,Y[s],"%15g"); fclose(f1);*/ } @@ -758,7 +758,7 @@ void AWPMD::norm_factorize(int s) { int nes8 = ne[s]*8, info; DGETRF(&nes8, &nes8, Norm[s].arr, &nes8, &ipiv[0], &info); if(info < 0) - LOGERR(info,fmt("AWPMD.norm_factorize: call to DGETRF failed (exitcode %d)!",info),LINFO); + LOGERR(info,logfmt("AWPMD.norm_factorize: call to DGETRF failed (exitcode %d)!",info),LINFO); norm_matrix_state[s] = NORM_FACTORIZED; } @@ -773,7 +773,7 @@ void AWPMD::norm_invert(int s) { DGETRI(&nes8, Norm[s].arr, &nes8, &ipiv[0], (double*)IDD.arr, &IDD_size, &info); // use IDD for work storage if(info < 0) - LOGERR(info,fmt("AWPMD.norm_invert: call to DGETRI failed (exitcode %d)!",info),LINFO); + LOGERR(info,logfmt("AWPMD.norm_invert: call to DGETRI failed (exitcode %d)!",info),LINFO); norm_matrix_state[s] = NORM_INVERTED; } @@ -829,7 +829,7 @@ int AWPMD::step(double dt){ //e gets current electronic coordinates int AWPMD::get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, double mass){ if(spin<0 || spin >1) - return -1; // invalid spin: return LOGERR(-1,fmt("AWPMD.get_electrons: invaid spin setting (%d)!",spin),LINFO); + return -1; // invalid spin: return LOGERR(-1,logfmt("AWPMD.get_electrons: invaid spin setting (%d)!",spin),LINFO); if(mass<0) mass=me; for(int i=0;i 1) - return LOGERR(-1,fmt("AWPMD_split.set_electrons: invaid spin setting (%d)!",s),LINFO); + return LOGERR(-1,logfmt("AWPMD_split.set_electrons: invaid spin setting (%d)!",s),LINFO); // calculating the total n nvar[s]=0; @@ -68,22 +68,22 @@ int AWPMD_split::set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* norm_matrix_state[s] = NORM_UNDEFINED; ne[s]=nel; wp[s].resize(n); - + split_c[s].resize(n); split_c[s].assign(c,c+n); - - + + nspl[s].resize(nel); nspl[s].assign(splits,splits+nel); partition1[s].clear(); for(int i=0;i0){ // width PBC, keeping the width are within [0,Lextra] w[i]=fmod(w[i],Lextra); @@ -107,7 +107,7 @@ int AWPMD_split::set_electrons(int s, int nel, Vector_3P x, Vector_3P v, double* else qe[s].assign(nwp[s],-1); - + return 1; } @@ -121,40 +121,40 @@ void AWPMD_split::eterm_deriv(int ic1,int s1,int c1, int j1,int ic2,int s2, int cdouble ck(split_c[s2][ic2+k2][0],split_c[s2][ic2+k2][1]); int indw1=8*ic1, indw2=8*ic2; int indn1=(nvar[s1]/10)*8+2*ic1, indn2=(nvar[s2]/10)*8+2*ic2; - cdouble part_jk=conj(cj)*ck; + cdouble part_jk=conj(cj)*ck; int M= 1; //(j1==k2 ? 1 : 2); // over a_k_re - E_der[s2][indw2+8*k2]+= M*real(pref*part_jk*(o.da2_re()*v+o.I0*dv_ak)); + E_der[s2][indw2+8*k2]+= M*real(pref*part_jk*(o.da2_re()*v+o.I0*dv_ak)); // over a_k_im - E_der[s2][indw2+8*k2+1]+= M*real(pref*part_jk*(o.da2_im()*v+i_unit*o.I0*dv_ak)); + E_der[s2][indw2+8*k2+1]+= M*real(pref*part_jk*(o.da2_im()*v+i_unit*o.I0*dv_ak)); // over a_j_re - E_der[s1][indw1+8*j1]+= M*real(pref*part_jk*(o.da1_re()*v+o.I0*dv_aj_conj)); + E_der[s1][indw1+8*j1]+= M*real(pref*part_jk*(o.da1_re()*v+o.I0*dv_aj_conj)); // over a_j_im - E_der[s1][indw1+8*j1+1]+= M*real(pref*part_jk*(o.da1_im()*v-i_unit*o.I0*dv_aj_conj)); + E_der[s1][indw1+8*j1+1]+= M*real(pref*part_jk*(o.da1_im()*v-i_unit*o.I0*dv_aj_conj)); for(int i=0;i<3;i++){ // over b_k_re - E_der[s2][indw2+8*k2+2+2*i]+= M*real(pref*part_jk*(o.db2_re(i)*v+o.I0*dv_bk[i])); + E_der[s2][indw2+8*k2+2+2*i]+= M*real(pref*part_jk*(o.db2_re(i)*v+o.I0*dv_bk[i])); // over b_k_im - E_der[s2][indw2+8*k2+2+2*i+1]+= M*real(pref*part_jk*(o.db2_im(i)*v+i_unit*o.I0*dv_bk[i])); + E_der[s2][indw2+8*k2+2+2*i+1]+= M*real(pref*part_jk*(o.db2_im(i)*v+i_unit*o.I0*dv_bk[i])); // over b_j_re - E_der[s1][indw1+8*j1+2+2*i]+= M*real(pref*part_jk*(o.db1_re(i)*v+o.I0*dv_bj_conj[i])); + E_der[s1][indw1+8*j1+2+2*i]+= M*real(pref*part_jk*(o.db1_re(i)*v+o.I0*dv_bj_conj[i])); // over b_j_im - E_der[s1][indw1+8*j1+2+2*i+1]+= M*real(pref*part_jk*(o.db1_im(i)*v-i_unit*o.I0*dv_bj_conj[i])); + E_der[s1][indw1+8*j1+2+2*i+1]+= M*real(pref*part_jk*(o.db1_im(i)*v-i_unit*o.I0*dv_bj_conj[i])); } // over ck_re - E_der[s2][indn2+2*k2]+=M*real(pref*conj(cj)*o.I0*v); + E_der[s2][indn2+2*k2]+=M*real(pref*conj(cj)*o.I0*v); // over ck_im E_der[s2][indn2+2*k2+1]+=M*real(pref*i_unit*conj(cj)*o.I0*v); // over cj_re - E_der[s1][indn1+2*j1]+=M*real(pref*ck*o.I0*v); + E_der[s1][indn1+2*j1]+=M*real(pref*ck*o.I0*v); // over cj_im - E_der[s1][indn1+2*j1+1]+=M*real(-pref*i_unit*ck*o.I0*v); - + E_der[s1][indn1+2*j1+1]+=M*real(-pref*i_unit*ck*o.I0*v); + double t= -M*real(pref*part_jk*o.I0*v); // nonlocal terms: TODO: make a separate global loop for summation of nonlocal terms for(int j=0;j -mu, v -> -v !!! } - - + + for(int k1=j1+1;k1(E_der[s1].begin()+indw1,(double *)&fe_x[iv1+k1],(double *)&fe_p[iv1+k1],&fe_w[iv1+k1],&fe_pw[iv1+k1], 1./one_h); @@ -341,14 +341,14 @@ void AWPMD_split::get_el_forces(int flag, Vector_3P fe_x, ic1+=nspl[s1][c1]; // incrementing block1 wp address iv1+=nspl[s1][c1]; // incrementing global variable address } - } + } } } //e same as interaction, but using Hartee factorization (no antisymmetrization) -int AWPMD_split::interaction_hartree(int flag, Vector_3P fi, Vector_3P fe_x, +int AWPMD_split::interaction_hartree(int flag, Vector_3P fi, Vector_3P fe_x, Vector_3P fe_p, double *fe_w, double *fe_pw, Vector_2P fe_c){ - + // resize arrays if needed enum APPROX tmp=HARTREE; swap(tmp,approx); // do not need large matrices @@ -358,39 +358,39 @@ int AWPMD_split::interaction_hartree(int flag, Vector_3P fi, Vector_3P fe_x, // clearing forces clear_forces(flag,fi,fe_x,fe_p,fe_w,fe_pw,fe_c); // calculate block norms and (optionally) derivatives - calc_norms(flag); + calc_norms(flag); Eee = Ew = 0.; for(int s1=0;s1<2;s1++){ Ee[s1]=0.; Eei[s1]=0.; int ic1=0; // starting index of the wp for current electron - + for(int c1=0;c1 1) - return LOGERR(-1,fmt("AWPMD_split.add_electron: invaid spin setting (%d)!",s),LINFO); + return LOGERR(-1,logfmt("AWPMD_split.add_electron: invaid spin setting (%d)!",s),LINFO); s_add=s; spl_add=0; return ne[s_add]; @@ -141,7 +141,7 @@ public: ///\en gets current electronic coordinates, and (optionally) number of wave packets for each electron - int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=NULL, double mass=-1); + int get_electrons(int spin, Vector_3P x, Vector_3P v, double* w, double* pw, cdouble *c, int *splits=nullptr, double mass=-1); void eterm_deriv(int ic1,int s1, int c1,int k1,int ic2,int s2, int c2,int j2,cdouble pref, @@ -164,8 +164,8 @@ public: cdouble overlap(int ic1, int s1, int c1,int ic2, int s2, int c2); //e same as interaction, but using Hartee factorization (no antisymmetrization) - int interaction_hartree(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction_hartree(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Calculates interaction in the system of ni ions + electrons /// the electonic subsystem must be previously setup by set_electrons, ionic by set_ions @@ -174,12 +174,12 @@ public: /// 0x4 -- calculate electronic forces \n /// 0x8 -- add electronic forces to the existing arrays \n /// 0x10 -- calculate internal electronic derivatives only: \n - /// will not update electronic force arrays, which may be NULL, \n + /// will not update electronic force arrays, which may be null pointers, \n /// the forces may be obtained then using \ref get_el_forces() for all WPs \n /// or separately for each WP using \ref get_wp_force() /// if PBCs are used the coords must be within a range [0, cell) - int interaction(int flag=0, Vector_3P fi=NULL, Vector_3P fe_x=NULL, - Vector_3P fe_p=NULL, double *fe_w=NULL, double *fe_pw=NULL, Vector_2P fe_c=NULL); + int interaction(int flag=0, Vector_3P fi=nullptr, Vector_3P fe_x=nullptr, + Vector_3P fe_p=nullptr, double *fe_w=nullptr, double *fe_pw=nullptr, Vector_2P fe_c=nullptr); ///\en Get electronic forcess in the arrays provided, using calculated internal representation /// Valid flag settings are:\n diff --git a/lib/colvars/Makefile.common b/lib/colvars/Makefile.common index 2f2e2beffb..ce501dc5f3 100644 --- a/lib/colvars/Makefile.common +++ b/lib/colvars/Makefile.common @@ -15,7 +15,7 @@ else COLVARS_DEBUG_INCFLAGS = -DCOLVARS_DEBUG endif -COLVARS_INCFLAGS = $(COLVARS_DEBUG_INCFLAGS) $(COLVARS_PYTHON_INCFLAGS) +COLVARS_INCFLAGS = -DCOLVARS_LAMMPS $(COLVARS_DEBUG_INCFLAGS) $(COLVARS_PYTHON_INCFLAGS) -I../../src .SUFFIXES: @@ -38,6 +38,7 @@ COLVARS_SRCS = \ colvarcomp_gpath.cpp \ colvarcomp_protein.cpp \ colvarcomp_rotations.cpp \ + colvarcomp_volmaps.cpp \ colvar.cpp \ colvardeps.cpp \ colvargrid.cpp \ @@ -46,7 +47,12 @@ COLVARS_SRCS = \ colvarparse.cpp \ colvarproxy.cpp \ colvarproxy_replicas.cpp \ + colvarproxy_tcl.cpp \ + colvarproxy_volmaps.cpp \ colvarscript.cpp \ + colvarscript_commands.cpp \ + colvarscript_commands_bias.cpp \ + colvarscript_commands_colvar.cpp \ colvartypes.cpp \ colvarvalue.cpp @@ -61,7 +67,7 @@ ifeq ($(COLVARS_LEPTON),no) LEPTON_INCFLAGS = COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o) else -LEPTON_INCFLAGS = -Ilepton/include -DLEPTON -DLEPTON_USE_STATIC_LIBRARIES +LEPTON_INCFLAGS = -Ilepton/include -DLEPTON COLVARS_OBJS = $(COLVARS_SRCS:.cpp=.o) $(LEPTON_SRCS:.cpp=.o) endif @@ -77,25 +83,9 @@ Makefile.deps: $(COLVARS_SRCS) @echo > $@ @for src in $^ ; do \ obj=`basename $$src .cpp`.o ; \ - $(CXX) -MM $(COLVARS_INCFLAGS) $(LEPTON_INCFLAGS) \ + $(CXX) $(CXXFLAGS) -MM $(COLVARS_INCFLAGS) $(LEPTON_INCFLAGS) \ -MT '$$(COLVARS_OBJ_DIR)'$$obj $$src >> $@ ; \ done include Makefile.deps - -# Exceptions to pattern rule above for Lepton objects - -lepton/src/CompiledExpression.o: lepton/src/CompiledExpression.cpp - $(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $< -lepton/src/ExpressionProgram.o: lepton/src/ExpressionProgram.cpp - $(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $< -lepton/src/ExpressionTreeNode.o: lepton/src/ExpressionTreeNode.cpp - $(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $< -lepton/src/Operation.o: lepton/src/Operation.cpp - $(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $< -lepton/src/ParsedExpression.o: lepton/src/ParsedExpression.cpp - $(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $< -lepton/src/Parser.o: lepton/src/Parser.cpp - $(CXX) $(CXXFLAGS) -Ilepton/include -DLEPTON_BUILDING_STATIC_LIBRARY -c -o $@ $< - include Makefile.lepton.deps # Hand-generated diff --git a/lib/colvars/Makefile.deps b/lib/colvars/Makefile.deps index 2c0dabea6a..78e8768edd 100644 --- a/lib/colvars/Makefile.deps +++ b/lib/colvars/Makefile.deps @@ -1,83 +1,270 @@ $(COLVARS_OBJ_DIR)colvaratoms.o: colvaratoms.cpp colvarmodule.h \ colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ - colvarparse.h colvarparams.h colvaratoms.h colvardeps.h + colvarproxy_tcl.h colvarproxy_volmaps.h colvarparse.h colvarparams.h \ + colvaratoms.h colvardeps.h $(COLVARS_OBJ_DIR)colvarbias_abf.o: colvarbias_abf.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \ - colvarparse.h colvarparams.h colvardeps.h colvarbias_abf.h colvarbias.h \ - colvargrid.h colvar_UIestimator.h + colvars_version.h colvar.h colvarvalue.h colvartypes.h colvarparse.h \ + colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_abf.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \ + colvarbias.h colvargrid.h colvar_UIestimator.h $(COLVARS_OBJ_DIR)colvarbias_alb.o: colvarbias_alb.cpp colvarmodule.h \ colvars_version.h colvarbias.h colvar.h colvarvalue.h colvartypes.h \ - colvarparse.h colvarparams.h colvardeps.h colvarbias_alb.h + colvarparse.h colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_alb.h $(COLVARS_OBJ_DIR)colvarbias.o: colvarbias.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvarbias.h \ - colvar.h colvarparse.h colvarparams.h colvardeps.h colvargrid.h + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ + colvarproxy_tcl.h colvarproxy_volmaps.h colvarbias.h colvar.h \ + colvarparse.h colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvargrid.h $(COLVARS_OBJ_DIR)colvarbias_histogram.o: colvarbias_histogram.cpp \ colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ - colvarvalue.h colvar.h colvarparse.h colvarparams.h colvardeps.h \ + colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h colvar.h \ + colvarparse.h colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ colvarbias_histogram.h colvarbias.h colvargrid.h $(COLVARS_OBJ_DIR)colvarbias_meta.o: colvarbias_meta.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvar.h \ - colvarparse.h colvarparams.h colvardeps.h colvarbias_meta.h colvarbias.h \ - colvargrid.h + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ + colvarproxy_tcl.h colvarproxy_volmaps.h colvar.h colvarparse.h \ + colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias_meta.h colvarbias.h colvargrid.h $(COLVARS_OBJ_DIR)colvarbias_restraint.o: colvarbias_restraint.cpp \ colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ - colvarvalue.h colvarbias_restraint.h colvarbias.h colvar.h colvarparse.h \ - colvarparams.h colvardeps.h + colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h \ + colvarbias_restraint.h colvarbias.h colvar.h colvarparse.h \ + colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h $(COLVARS_OBJ_DIR)colvarcomp_angles.o: colvarcomp_angles.cpp \ colvarmodule.h colvars_version.h colvar.h colvarvalue.h colvartypes.h \ - colvarparse.h colvarparams.h colvardeps.h colvarcomp.h colvaratoms.h \ - colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h + colvarparse.h colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp_apath.o: colvarcomp_apath.cpp colvarmodule.h \ colvars_version.h colvarvalue.h colvartypes.h colvarparse.h \ - colvarparams.h colvar.h colvardeps.h colvarcomp.h colvaratoms.h \ - colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h + colvarparams.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp_coordnums.o: colvarcomp_coordnums.cpp \ colvarmodule.h colvars_version.h colvarparse.h colvarvalue.h \ - colvartypes.h colvarparams.h colvaratoms.h colvarproxy.h colvardeps.h \ - colvar.h colvarcomp.h colvar_arithmeticpath.h colvar_geometricpath.h + colvartypes.h colvarparams.h colvaratoms.h colvarproxy.h \ + colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h colvar.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp.o: colvarcomp.cpp colvarmodule.h \ colvars_version.h colvarvalue.h colvartypes.h colvar.h colvarparse.h \ - colvarparams.h colvardeps.h colvarcomp.h colvaratoms.h colvarproxy.h \ - colvar_arithmeticpath.h colvar_geometricpath.h + colvarparams.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp_distances.o: colvarcomp_distances.cpp \ colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \ - colvaratoms.h colvarproxy.h colvar_arithmeticpath.h \ - colvar_geometricpath.h + colvarparse.h colvarparams.h colvar.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp_gpath.o: colvarcomp_gpath.cpp colvarmodule.h \ colvars_version.h colvarvalue.h colvartypes.h colvarparse.h \ - colvarparams.h colvar.h colvardeps.h colvarcomp.h colvaratoms.h \ - colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h + colvarparams.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp_protein.o: colvarcomp_protein.cpp \ colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \ - colvaratoms.h colvarproxy.h colvar_arithmeticpath.h \ - colvar_geometricpath.h + colvarparse.h colvarparams.h colvar.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarcomp_rotations.o: colvarcomp_rotations.cpp \ colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarparse.h colvarparams.h colvar.h colvardeps.h colvarcomp.h \ - colvaratoms.h colvarproxy.h colvar_arithmeticpath.h \ - colvar_geometricpath.h + colvarparse.h colvarparams.h colvar.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h +$(COLVARS_OBJ_DIR)colvarcomp_volmaps.o: colvarcomp_volmaps.cpp \ + colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ + colvarparse.h colvarparams.h colvar.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvar.o: colvar.cpp colvarmodule.h colvars_version.h \ colvarvalue.h colvartypes.h colvarparse.h colvarparams.h colvar.h \ - colvardeps.h colvarcomp.h colvaratoms.h colvarproxy.h \ - colvar_arithmeticpath.h colvar_geometricpath.h colvarscript.h \ - colvarbias.h + colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h \ + colvarscript.h colvarbias.h colvarscript_commands.h \ + colvarscript_commands_colvar.h colvarscript_commands_bias.h $(COLVARS_OBJ_DIR)colvardeps.o: colvardeps.cpp colvarmodule.h \ - colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h colvardeps.h \ - colvarparse.h colvarparams.h + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ + colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h colvarparse.h \ + colvarparams.h $(COLVARS_OBJ_DIR)colvargrid.o: colvargrid.cpp colvarmodule.h \ colvars_version.h colvarvalue.h colvartypes.h colvarparse.h \ - colvarparams.h colvar.h colvardeps.h colvarcomp.h colvaratoms.h \ - colvarproxy.h colvar_arithmeticpath.h colvar_geometricpath.h \ + colvarparams.h colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarcomp.h colvaratoms.h colvarproxy.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvar_arithmeticpath.h colvar_geometricpath.h \ colvargrid.h $(COLVARS_OBJ_DIR)colvarmodule.o: colvarmodule.cpp colvarmodule.h \ colvars_version.h colvarparse.h colvarvalue.h colvartypes.h \ - colvarparams.h colvarproxy.h colvar.h colvardeps.h colvarbias.h \ - colvarbias_abf.h colvargrid.h colvar_UIestimator.h colvarbias_alb.h \ - colvarbias_histogram.h colvarbias_meta.h colvarbias_restraint.h \ - colvarscript.h colvaratoms.h colvarcomp.h colvar_arithmeticpath.h \ + colvarparams.h colvarproxy.h colvarproxy_tcl.h colvarproxy_volmaps.h \ + colvar.h colvardeps.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarbias.h colvarbias_abf.h colvargrid.h colvar_UIestimator.h \ + colvarbias_alb.h colvarbias_histogram.h colvarbias_meta.h \ + colvarbias_restraint.h colvarscript.h colvarscript_commands.h \ + colvarscript_commands_colvar.h colvarscript_commands_bias.h \ + colvaratoms.h colvarcomp.h colvar_arithmeticpath.h \ colvar_geometricpath.h $(COLVARS_OBJ_DIR)colvarparams.o: colvarparams.cpp colvarmodule.h \ colvars_version.h colvarvalue.h colvartypes.h colvarparams.h @@ -86,17 +273,92 @@ $(COLVARS_OBJ_DIR)colvarparse.o: colvarparse.cpp colvarmodule.h \ colvarparams.h $(COLVARS_OBJ_DIR)colvarproxy.o: colvarproxy.cpp colvarmodule.h \ colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ - colvarscript.h colvarbias.h colvar.h colvarparse.h colvarparams.h \ - colvardeps.h colvaratoms.h + colvarproxy_tcl.h colvarproxy_volmaps.h colvarscript.h colvarbias.h \ + colvar.h colvarparse.h colvarparams.h colvardeps.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarscript_commands.h colvarscript_commands_colvar.h \ + colvarscript_commands_bias.h colvaratoms.h $(COLVARS_OBJ_DIR)colvarproxy_replicas.o: colvarproxy_replicas.cpp \ colvarmodule.h colvars_version.h colvarproxy.h colvartypes.h \ - colvarvalue.h -$(COLVARS_OBJ_DIR)colvarscript.o: colvarscript.cpp colvarscript.h \ - colvarmodule.h colvars_version.h colvarvalue.h colvartypes.h \ - colvarbias.h colvar.h colvarparse.h colvarparams.h colvardeps.h \ - colvarproxy.h + colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h +$(COLVARS_OBJ_DIR)colvarproxy_tcl.o: colvarproxy_tcl.cpp colvarmodule.h \ + colvars_version.h colvarproxy.h colvartypes.h colvarvalue.h \ + colvarproxy_tcl.h colvarproxy_volmaps.h colvaratoms.h colvarparse.h \ + colvarparams.h colvardeps.h +$(COLVARS_OBJ_DIR)colvarproxy_volmaps.o: colvarproxy_volmaps.cpp \ + colvarmodule.h colvars_version.h colvarproxy_volmaps.h +$(COLVARS_OBJ_DIR)colvarscript.o: colvarscript.cpp colvarproxy.h \ + colvarmodule.h colvars_version.h colvartypes.h colvarvalue.h \ + colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h colvarparse.h \ + colvarparams.h colvarscript.h colvarbias.h colvar.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarscript_commands.h colvarscript_commands_colvar.h \ + colvarscript_commands_bias.h +$(COLVARS_OBJ_DIR)colvarscript_commands.o: colvarscript_commands.cpp \ + colvarproxy.h colvarmodule.h colvars_version.h colvartypes.h \ + colvarvalue.h colvarproxy_tcl.h colvarproxy_volmaps.h colvardeps.h \ + colvarparse.h colvarparams.h colvarscript.h colvarbias.h colvar.h \ + lepton/include/Lepton.h lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarscript_commands.h colvarscript_commands_colvar.h \ + colvarscript_commands_bias.h +$(COLVARS_OBJ_DIR)colvarscript_commands_bias.o: \ + colvarscript_commands_bias.cpp colvarproxy.h colvarmodule.h \ + colvars_version.h colvartypes.h colvarvalue.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvardeps.h colvarparse.h colvarparams.h \ + colvarscript.h colvarbias.h colvar.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarscript_commands.h colvarscript_commands_colvar.h \ + colvarscript_commands_bias.h +$(COLVARS_OBJ_DIR)colvarscript_commands_colvar.o: \ + colvarscript_commands_colvar.cpp colvarproxy.h colvarmodule.h \ + colvars_version.h colvartypes.h colvarvalue.h colvarproxy_tcl.h \ + colvarproxy_volmaps.h colvardeps.h colvarparse.h colvarparams.h \ + colvarscript.h colvarbias.h colvar.h lepton/include/Lepton.h \ + lepton/include/lepton/CompiledExpression.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/windowsIncludes.h \ + lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/ExpressionProgram.h \ + lepton/include/lepton/ExpressionTreeNode.h \ + lepton/include/lepton/Operation.h lepton/include/lepton/CustomFunction.h \ + lepton/include/lepton/Exception.h \ + lepton/include/lepton/ParsedExpression.h lepton/include/lepton/Parser.h \ + colvarscript_commands.h colvarscript_commands_colvar.h \ + colvarscript_commands_bias.h $(COLVARS_OBJ_DIR)colvartypes.o: colvartypes.cpp colvarmodule.h \ colvars_version.h colvartypes.h colvarparse.h colvarvalue.h \ - colvarparams.h + colvarparams.h ../../src/math_eigen.h $(COLVARS_OBJ_DIR)colvarvalue.o: colvarvalue.cpp colvarmodule.h \ colvars_version.h colvarvalue.h colvartypes.h diff --git a/lib/colvars/colvar.cpp b/lib/colvars/colvar.cpp index 1002dc35d8..ed6fec1ac5 100644 --- a/lib/colvars/colvar.cpp +++ b/lib/colvars/colvar.cpp @@ -18,7 +18,9 @@ #include "colvarcomp.h" #include "colvarscript.h" - +#if (__cplusplus >= 201103L) +std::map> colvar::global_cvc_map = std::map>(); +#endif colvar::colvar() { @@ -541,7 +543,7 @@ int colvar::init_grid_parameters(std::string const &conf) cvm::log("Reading legacy options lowerWall and lowerWallConstant: " "consider using a harmonicWalls restraint (caution: force constant would then be scaled by width^2).\n"); if (!get_keyval(conf, "lowerWall", lower_wall)) { - error_code != cvm::error("Error: the value of lowerWall must be set " + error_code |= cvm::error("Error: the value of lowerWall must be set " "explicitly.\n", INPUT_ERROR); } lw_conf = std::string("\n\ @@ -554,7 +556,7 @@ int colvar::init_grid_parameters(std::string const &conf) cvm::log("Reading legacy options upperWall and upperWallConstant: " "consider using a harmonicWalls restraint (caution: force constant would then be scaled by width^2).\n"); if (!get_keyval(conf, "upperWall", upper_wall)) { - error_code != cvm::error("Error: the value of upperWall must be set " + error_code |= cvm::error("Error: the value of upperWall must be set " "explicitly.\n", INPUT_ERROR); } uw_conf = std::string("\n\ @@ -616,7 +618,7 @@ harmonicWalls {\n\ "are enabled).\n", INPUT_ERROR); } - return COLVARS_OK; + return error_code; } @@ -681,6 +683,9 @@ int colvar::init_extended_Lagrangian(std::string const &conf) // Adjust Langevin sigma for slow time step if time_step_factor != 1 ext_sigma = cvm::sqrt(2.0 * cvm::boltzmann() * temp * ext_gamma * ext_mass / (cvm::dt() * cvm::real(time_step_factor))); } + + get_keyval_feature(this, conf, "reflectingLowerBoundary", f_cv_reflecting_lower_boundary, false); + get_keyval_feature(this, conf, "reflectingUpperBoundary", f_cv_reflecting_upper_boundary, false); } return COLVARS_OK; @@ -721,15 +726,15 @@ int colvar::init_output_flags(std::string const &conf) return COLVARS_OK; } - - - // read the configuration and set up corresponding instances, for // each type of component implemented template int colvar::init_components_type(std::string const &conf, char const * /* def_desc */, char const *def_config_key) { +#if (__cplusplus >= 201103L) + global_cvc_map[def_config_key] = [](const std::string& cvc_conf){return new def_class_name(cvc_conf);}; +#endif size_t def_count = 0; std::string def_conf = ""; size_t pos = 0; @@ -863,6 +868,8 @@ int colvar::init_components(std::string const &conf) error_code |= init_components_type(conf, "arithmetic path collective variables (s) for other CVs", "aspathCV"); error_code |= init_components_type(conf, "arithmetic path collective variables (s) for other CVs", "azpathCV"); + error_code |= init_components_type(conf, "total value of atomic map", "mapTotal"); + if (!cvcs.size() || (error_code != COLVARS_OK)) { cvm::error("Error: no valid components were provided " "for this collective variable.\n", @@ -1040,85 +1047,93 @@ int colvar::init_dependencies() { init_feature(f_cv_gradient, "gradient", f_type_dynamic); require_feature_children(f_cv_gradient, f_cvc_gradient); - init_feature(f_cv_collect_gradient, "collect gradient", f_type_dynamic); + init_feature(f_cv_collect_gradient, "collect_gradient", f_type_dynamic); require_feature_self(f_cv_collect_gradient, f_cv_gradient); require_feature_self(f_cv_collect_gradient, f_cv_scalar); // The following exlusion could be lifted by implementing the feature exclude_feature_self(f_cv_collect_gradient, f_cv_scripted); require_feature_children(f_cv_collect_gradient, f_cvc_explicit_gradient); - init_feature(f_cv_fdiff_velocity, "velocity from finite differences", f_type_dynamic); + init_feature(f_cv_fdiff_velocity, "velocity_from_finite_differences", f_type_dynamic); // System force: either trivial (spring force); through extended Lagrangian, or calculated explicitly - init_feature(f_cv_total_force, "total force", f_type_dynamic); + init_feature(f_cv_total_force, "total_force", f_type_dynamic); require_feature_alt(f_cv_total_force, f_cv_extended_Lagrangian, f_cv_total_force_calc); // Deps for explicit total force calculation - init_feature(f_cv_total_force_calc, "total force calculation", f_type_dynamic); + init_feature(f_cv_total_force_calc, "total_force_calculation", f_type_dynamic); require_feature_self(f_cv_total_force_calc, f_cv_scalar); require_feature_self(f_cv_total_force_calc, f_cv_linear); require_feature_children(f_cv_total_force_calc, f_cvc_inv_gradient); require_feature_self(f_cv_total_force_calc, f_cv_Jacobian); - init_feature(f_cv_Jacobian, "Jacobian derivative", f_type_dynamic); + init_feature(f_cv_Jacobian, "Jacobian_derivative", f_type_dynamic); require_feature_self(f_cv_Jacobian, f_cv_scalar); require_feature_self(f_cv_Jacobian, f_cv_linear); require_feature_children(f_cv_Jacobian, f_cvc_Jacobian); - init_feature(f_cv_hide_Jacobian, "hide Jacobian force", f_type_user); + init_feature(f_cv_hide_Jacobian, "hide_Jacobian_force", f_type_user); require_feature_self(f_cv_hide_Jacobian, f_cv_Jacobian); // can only hide if calculated - init_feature(f_cv_extended_Lagrangian, "extended Lagrangian", f_type_user); + init_feature(f_cv_extended_Lagrangian, "extended_Lagrangian", f_type_user); require_feature_self(f_cv_extended_Lagrangian, f_cv_scalar); require_feature_self(f_cv_extended_Lagrangian, f_cv_gradient); - init_feature(f_cv_Langevin, "Langevin dynamics", f_type_user); + init_feature(f_cv_Langevin, "Langevin_dynamics", f_type_user); require_feature_self(f_cv_Langevin, f_cv_extended_Lagrangian); - init_feature(f_cv_single_cvc, "single component", f_type_static); + init_feature(f_cv_single_cvc, "single_component", f_type_static); init_feature(f_cv_linear, "linear", f_type_static); init_feature(f_cv_scalar, "scalar", f_type_static); - init_feature(f_cv_output_energy, "output energy", f_type_user); + init_feature(f_cv_output_energy, "output_energy", f_type_user); - init_feature(f_cv_output_value, "output value", f_type_user); + init_feature(f_cv_output_value, "output_value", f_type_user); - init_feature(f_cv_output_velocity, "output velocity", f_type_user); + init_feature(f_cv_output_velocity, "output_velocity", f_type_user); require_feature_self(f_cv_output_velocity, f_cv_fdiff_velocity); - init_feature(f_cv_output_applied_force, "output applied force", f_type_user); + init_feature(f_cv_output_applied_force, "output_applied_force", f_type_user); - init_feature(f_cv_output_total_force, "output total force", f_type_user); + init_feature(f_cv_output_total_force, "output_total_force", f_type_user); require_feature_self(f_cv_output_total_force, f_cv_total_force); - init_feature(f_cv_subtract_applied_force, "subtract applied force from total force", f_type_user); + init_feature(f_cv_subtract_applied_force, "subtract_applied_force_from_total_force", f_type_user); require_feature_self(f_cv_subtract_applied_force, f_cv_total_force); - init_feature(f_cv_lower_boundary, "lower boundary", f_type_user); + init_feature(f_cv_lower_boundary, "lower_boundary", f_type_user); require_feature_self(f_cv_lower_boundary, f_cv_scalar); - init_feature(f_cv_upper_boundary, "upper boundary", f_type_user); + init_feature(f_cv_upper_boundary, "upper_boundary", f_type_user); require_feature_self(f_cv_upper_boundary, f_cv_scalar); - init_feature(f_cv_hard_lower_boundary, "hard lower boundary", f_type_user); + init_feature(f_cv_hard_lower_boundary, "hard_lower_boundary", f_type_user); require_feature_self(f_cv_hard_lower_boundary, f_cv_lower_boundary); - init_feature(f_cv_hard_upper_boundary, "hard upper boundary", f_type_user); + init_feature(f_cv_hard_upper_boundary, "hard_upper_boundary", f_type_user); require_feature_self(f_cv_hard_upper_boundary, f_cv_upper_boundary); + init_feature(f_cv_reflecting_lower_boundary, "reflecting_lower_boundary", f_type_user); + require_feature_self(f_cv_reflecting_lower_boundary, f_cv_lower_boundary); + require_feature_self(f_cv_reflecting_lower_boundary, f_cv_extended_Lagrangian); + + init_feature(f_cv_reflecting_upper_boundary, "reflecting_upper_boundary", f_type_user); + require_feature_self(f_cv_reflecting_upper_boundary, f_cv_upper_boundary); + require_feature_self(f_cv_reflecting_upper_boundary, f_cv_extended_Lagrangian); + init_feature(f_cv_grid, "grid", f_type_dynamic); require_feature_self(f_cv_grid, f_cv_lower_boundary); require_feature_self(f_cv_grid, f_cv_upper_boundary); - init_feature(f_cv_runave, "running average", f_type_user); + init_feature(f_cv_runave, "running_average", f_type_user); - init_feature(f_cv_corrfunc, "correlation function", f_type_user); + init_feature(f_cv_corrfunc, "correlation_function", f_type_user); init_feature(f_cv_scripted, "scripted", f_type_user); - init_feature(f_cv_custom_function, "custom function", f_type_user); + init_feature(f_cv_custom_function, "custom_function", f_type_user); exclude_feature_self(f_cv_custom_function, f_cv_scripted); init_feature(f_cv_periodic, "periodic", f_type_static); @@ -1129,7 +1144,7 @@ int colvar::init_dependencies() { // because total forces are obtained from the previous time step, // we cannot (currently) have colvar values and total forces for the same timestep - init_feature(f_cv_multiple_ts, "multiple timestep colvar", f_type_static); + init_feature(f_cv_multiple_ts, "multiple_timestep", f_type_static); exclude_feature_self(f_cv_multiple_ts, f_cv_total_force_calc); // check that everything is initialized @@ -1199,8 +1214,17 @@ colvar::~colvar() (*ci)->remove_all_children(); delete *ci; } + cvcs.clear(); - // remove reference to this colvar from the CVM + while (biases.size() > 0) { + size_t const i = biases.size()-1; + cvm::log("Warning: before deleting colvar " + name + + ", deleting related bias " + biases[i]->name); + delete biases[i]; + } + biases.clear(); + + // remove reference to this colvar from the module colvarmodule *cv = cvm::main(); for (std::vector::iterator cvi = cv->variables()->begin(); cvi != cv->variables()->end(); @@ -1211,6 +1235,8 @@ colvar::~colvar() } } + cv->config_changed(); + #ifdef LEPTON for (std::vector::iterator cei = value_evaluators.begin(); cei != value_evaluators.end(); @@ -1599,6 +1625,15 @@ int colvar::calc_colvar_properties() // just calculated from the cvcs if ((cvm::step_relative() == 0 && !after_restart) || x_ext.type() == colvarvalue::type_notset) { x_ext = x; + if (is_enabled(f_cv_reflecting_lower_boundary) && x_ext < lower_boundary) { + cvm::log("Warning: initializing extended coordinate to reflective lower boundary, as colvar value is below."); + x_ext = lower_boundary; + } + if (is_enabled(f_cv_reflecting_upper_boundary) && x_ext > upper_boundary) { + cvm::log("Warning: initializing extended coordinate to reflective upper boundary, as colvar value is above."); + x_ext = upper_boundary; + } + v_ext.reset(); // (already 0; added for clarity) } @@ -1672,10 +1707,10 @@ cvm::real colvar::update_forces_energy() cvm::log("Updating extended-Lagrangian degree of freedom.\n"); } - if (prev_timestep > -1) { + if (prev_timestep > -1L) { // Keep track of slow timestep to integrate MTS colvars // the colvar checks the interval after waking up twice - int n_timesteps = cvm::step_relative() - prev_timestep; + cvm::step_number n_timesteps = cvm::step_relative() - prev_timestep; if (n_timesteps != 0 && n_timesteps != time_step_factor) { cvm::error("Error: extended-Lagrangian " + description + " has timeStepFactor " + cvm::to_str(time_step_factor) + ", but was activated after " + cvm::to_str(n_timesteps) + @@ -1737,6 +1772,14 @@ cvm::real colvar::update_forces_energy() } v_ext += (0.5 * dt) * f_ext / ext_mass; x_ext += dt * v_ext; + + cvm::real delta = 0; // Length of overshoot past either reflecting boundary + if ((is_enabled(f_cv_reflecting_lower_boundary) && (delta = x_ext - lower_boundary) < 0) || + (is_enabled(f_cv_reflecting_upper_boundary) && (delta = x_ext - upper_boundary) > 0)) { + x_ext -= 2.0 * delta; + v_ext *= -1.0; + } + x_ext.apply_constraints(); this->wrap(x_ext); } else { @@ -2082,7 +2125,7 @@ void colvar::wrap(colvarvalue &x_unwrapped) const std::istream & colvar::read_state(std::istream &is) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); std::string conf; if ( !(is >> colvarparse::read_block("colvar", &conf)) ) { @@ -2163,7 +2206,7 @@ std::istream & colvar::read_state(std::istream &is) std::istream & colvar::read_traj(std::istream &is) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); if (is_enabled(f_cv_output_value)) { diff --git a/lib/colvars/colvar.h b/lib/colvars/colvar.h index e6fafbdec3..5cf0077a39 100644 --- a/lib/colvars/colvar.h +++ b/lib/colvars/colvar.h @@ -12,6 +12,11 @@ #include +#if (__cplusplus >= 201103L) +#include +#include +#endif + #include "colvarmodule.h" #include "colvarvalue.h" #include "colvarparse.h" @@ -114,6 +119,7 @@ public: /// List of biases that depend on this colvar std::vector biases; + protected: @@ -602,6 +608,17 @@ public: class cartesian; class orientation; + // components that do not handle any atoms directly + class map_total; + + /// getter of the global cvc map +#if (__cplusplus >= 201103L) + /// A global mapping of cvc names to the cvc constructors + static const std::map>& get_global_cvc_map() { + return global_cvc_map; + } +#endif + protected: /// \brief Array of \link colvar::cvc \endlink objects @@ -636,6 +653,11 @@ protected: double dev_null; #endif +#if (__cplusplus >= 201103L) + /// A global mapping of cvc names to the cvc constructors + static std::map> global_cvc_map; +#endif + public: /// \brief Sorted array of (zero-based) IDs for all atoms involved diff --git a/lib/colvars/colvar_UIestimator.h b/lib/colvars/colvar_UIestimator.h index cb4c7ed57d..1ec378f90c 100644 --- a/lib/colvars/colvar_UIestimator.h +++ b/lib/colvars/colvar_UIestimator.h @@ -116,7 +116,7 @@ namespace UIestimator { int i; for (i = 0; i < dimension; i++) { - temp[i] = round((round(y[i] / width[i] + EPSILON) - round(x[i] / width[i] + EPSILON)) + (y_size - 1) / 2 + EPSILON); + temp[i] = int(round((round(y[i] / width[i] + EPSILON) - round(x[i] / width[i] + EPSILON)) + (y_size - 1) / 2 + EPSILON)); } int index = 0; @@ -305,12 +305,6 @@ namespace UIestimator { int i; - if (step % output_freq == 0) { - calc_pmf(); - write_files(); - //write_interal_data(); - } - for (i = 0; i < dimension; i++) { // for dihedral RC, it is possible that x = 179 and y = -179, should correct it // may have problem, need to fix @@ -381,6 +375,7 @@ namespace UIestimator { bool written; bool written_1D; + public: // calculate gradients from the internal variables void calc_pmf() { int norm; diff --git a/lib/colvars/colvaratoms.cpp b/lib/colvars/colvaratoms.cpp index 180fc69a85..1a4280a202 100644 --- a/lib/colvars/colvaratoms.cpp +++ b/lib/colvars/colvaratoms.cpp @@ -240,19 +240,19 @@ int cvm::atom_group::init_dependencies() { } init_feature(f_ag_active, "active", f_type_dynamic); - init_feature(f_ag_center, "translational fit", f_type_static); - init_feature(f_ag_rotate, "rotational fit", f_type_static); - init_feature(f_ag_fitting_group, "fitting group", f_type_static); - init_feature(f_ag_explicit_gradient, "explicit atom gradient", f_type_dynamic); - init_feature(f_ag_fit_gradients, "fit gradients", f_type_user); + init_feature(f_ag_center, "translational_fit", f_type_static); + init_feature(f_ag_rotate, "rotational_fit", f_type_static); + init_feature(f_ag_fitting_group, "fitting_group", f_type_static); + init_feature(f_ag_explicit_gradient, "explicit_atom_gradient", f_type_dynamic); + init_feature(f_ag_fit_gradients, "fit_gradients", f_type_user); require_feature_self(f_ag_fit_gradients, f_ag_explicit_gradient); - init_feature(f_ag_atom_forces, "atomic forces", f_type_dynamic); + init_feature(f_ag_atom_forces, "atomic_forces", f_type_dynamic); // parallel calculation implies that we have at least a scalable center of mass, // but f_ag_scalable is kept as a separate feature to deal with future dependencies - init_feature(f_ag_scalable, "scalable group calculation", f_type_static); - init_feature(f_ag_scalable_com, "scalable group center of mass calculation", f_type_static); + init_feature(f_ag_scalable, "scalable_group", f_type_static); + init_feature(f_ag_scalable_com, "scalable_group_center_of_mass", f_type_static); require_feature_self(f_ag_scalable, f_ag_scalable_com); // check that everything is initialized diff --git a/lib/colvars/colvarbias.cpp b/lib/colvars/colvarbias.cpp index 09bcca01b5..65e9dedc36 100644 --- a/lib/colvars/colvarbias.cpp +++ b/lib/colvars/colvarbias.cpp @@ -7,6 +7,9 @@ // If you wish to distribute your changes, please submit them to the // Colvars repository at GitHub. +#include +#include + #include "colvarmodule.h" #include "colvarproxy.h" #include "colvarvalue.h" @@ -23,8 +26,12 @@ colvarbias::colvarbias(char const *key) init_dependencies(); rank = 1; + time_step_factor = 1; + has_data = false; b_output_energy = false; + output_freq = cvm::restart_out_freq; + reset(); state_file_step = 0L; matching_state = false; @@ -93,12 +100,18 @@ int colvarbias::init(std::string const &conf) output_prefix = cvm::output_prefix(); + get_keyval_feature(this, conf, "stepZeroData", f_cvb_step_zero_data, is_enabled(f_cvb_step_zero_data)); + + // Write energy to traj file? get_keyval(conf, "outputEnergy", b_output_energy, b_output_energy); - // Disabled by default in base class; default value can be overridden by derived class constructor - get_keyval_feature(this, conf, "bypassExtendedLagrangian", f_cvb_bypass_ext_lagrangian, is_enabled(f_cvb_bypass_ext_lagrangian), parse_silent); + // How often to write full output files? + get_keyval(conf, "outputFreq", output_freq, output_freq); - get_keyval(conf, "timeStepFactor", time_step_factor, 1); + // Disabled by default in base class; default value can be overridden by derived class constructor + get_keyval_feature(this, conf, "bypassExtendedLagrangian", f_cvb_bypass_ext_lagrangian, is_enabled(f_cvb_bypass_ext_lagrangian), parse_echo); + + get_keyval(conf, "timeStepFactor", time_step_factor, time_step_factor); if (time_step_factor < 1) { cvm::error("Error: timeStepFactor must be 1 or greater.\n"); return COLVARS_ERROR; @@ -125,37 +138,40 @@ int colvarbias::init_dependencies() { init_feature(f_cvb_awake, "awake", f_type_static); require_feature_self(f_cvb_awake, f_cvb_active); - init_feature(f_cvb_apply_force, "apply force", f_type_user); + init_feature(f_cvb_step_zero_data, "step_zero_data", f_type_user); + + init_feature(f_cvb_apply_force, "apply_force", f_type_user); require_feature_children(f_cvb_apply_force, f_cv_gradient); - init_feature(f_cvb_bypass_ext_lagrangian, "bypass extended-Lagrangian coordinates", f_type_user); + init_feature(f_cvb_bypass_ext_lagrangian, "bypass_extended_Lagrangian_coordinates", f_type_user); + // The exclusion below prevents the inconsistency where biasing forces are applied onto // the actual colvar, while total forces are measured on the extended coordinate exclude_feature_self(f_cvb_bypass_ext_lagrangian, f_cvb_get_total_force); - init_feature(f_cvb_get_total_force, "obtain total force", f_type_dynamic); + init_feature(f_cvb_get_total_force, "obtain_total_force", f_type_dynamic); require_feature_children(f_cvb_get_total_force, f_cv_total_force); - init_feature(f_cvb_output_acc_work, "output accumulated work", f_type_user); + init_feature(f_cvb_output_acc_work, "output_accumulated_work", f_type_user); require_feature_self(f_cvb_output_acc_work, f_cvb_apply_force); - init_feature(f_cvb_history_dependent, "history-dependent", f_type_static); + init_feature(f_cvb_history_dependent, "history_dependent", f_type_static); - init_feature(f_cvb_time_dependent, "time-dependent", f_type_static); + init_feature(f_cvb_time_dependent, "time_dependent", f_type_static); - init_feature(f_cvb_scalar_variables, "require scalar variables", f_type_static); + init_feature(f_cvb_scalar_variables, "require_scalar_variables", f_type_static); require_feature_children(f_cvb_scalar_variables, f_cv_scalar); - init_feature(f_cvb_calc_pmf, "calculate a PMF", f_type_static); + init_feature(f_cvb_calc_pmf, "calculate_a_PMF", f_type_static); - init_feature(f_cvb_calc_ti_samples, "calculate TI samples", f_type_dynamic); + init_feature(f_cvb_calc_ti_samples, "calculate_TI_samples", f_type_dynamic); require_feature_self(f_cvb_calc_ti_samples, f_cvb_get_total_force); require_feature_children(f_cvb_calc_ti_samples, f_cv_grid); - init_feature(f_cvb_write_ti_samples, "write TI samples ", f_type_user); + init_feature(f_cvb_write_ti_samples, "write_TI_samples_", f_type_user); require_feature_self(f_cvb_write_ti_samples, f_cvb_calc_ti_samples); - init_feature(f_cvb_write_ti_pmf, "write TI PMF", f_type_user); + init_feature(f_cvb_write_ti_pmf, "write_TI_PMF", f_type_user); require_feature_self(f_cvb_write_ti_pmf, f_cvb_calc_ti_samples); // check that everything is initialized @@ -237,6 +253,8 @@ int colvarbias::clear() } } + cv->config_changed(); + return COLVARS_OK; } @@ -302,6 +320,17 @@ int colvarbias::update() } +bool colvarbias::can_accumulate_data() +{ + colvarproxy *proxy = cvm::main()->proxy; + if (((cvm::step_relative() > 0) && !proxy->simulation_continuing()) || + is_enabled(f_cvb_step_zero_data)) { + return true; + } + return false; +} + + int colvarbias::calc_energy(std::vector const *) { bias_energy = 0.0; @@ -451,7 +480,7 @@ std::ostream & colvarbias::write_state(std::ostream &os) std::istream & colvarbias::read_state(std::istream &is) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); std::string key, brace, conf; if ( !(is >> key) || !(key == state_keyword || key == bias_type) || @@ -501,12 +530,80 @@ std::istream & colvarbias::read_state(std::istream &is) } +int colvarbias::write_state_prefix(std::string const &prefix) +{ + std::string const filename = + cvm::state_file_prefix(prefix.c_str())+".colvars.state"; + std::ostream *os = cvm::proxy->output_stream(filename.c_str()); + int error_code = COLVARS_OK; + if (os != NULL) { + os->setf(std::ios::scientific, std::ios::floatfield); + error_code = write_state(*os).good() ? COLVARS_OK : FILE_ERROR; + } else { + error_code = FILE_ERROR; + } + cvm::proxy->close_output_stream(filename.c_str()); + return error_code; +} + + +int colvarbias::write_state_string(std::string &output) +{ + std::ostringstream os; + if (!write_state(os)) { + return cvm::error("Error: in writing state of bias \""+name+ + "\" to buffer.\n", FILE_ERROR); + } + output = os.str(); + return COLVARS_OK; +} + + +int colvarbias::read_state_prefix(std::string const &prefix) +{ + std::string filename((prefix+std::string(".colvars.state")).c_str()); + std::ifstream is(filename.c_str()); + if (!is.good()) { + // try without the suffix + is.clear(); + filename = prefix; + is.open(filename.c_str()); + } + return read_state(is).good() ? COLVARS_OK : + cvm::error("Error: in reading state for \""+name+"\" from input file \""+ + std::string(filename)+"\".\n", FILE_ERROR); +} + + +int colvarbias::read_state_string(char const *buffer) +{ + if (buffer != NULL) { + size_t const buffer_size = strlen(buffer); + if (cvm::debug()) { + cvm::log("colvarbias::read_state_string() with argument:\n"); + cvm::log(buffer); + } + + if (buffer_size > 0) { + std::istringstream is; + is.rdbuf()->pubsetbuf(const_cast(buffer), buffer_size); + return read_state(is).good() ? COLVARS_OK : + cvm::error("Error: in reading state for \""+name+"\" from buffer.\n", + FILE_ERROR); + } + return COLVARS_OK; + } + return cvm::error("Error: NULL pointer for colvarbias::read_state_string()", + BUG_ERROR); +} + + std::istream & colvarbias::read_state_data_key(std::istream &is, char const *key) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); std::string key_in; if ( !(is >> key_in) || - !(key_in == to_lower_cppstr(std::string(key))) ) { + !(to_lower_cppstr(key_in) == to_lower_cppstr(std::string(key))) ) { cvm::error("Error: in reading restart configuration for "+ bias_type+" bias \""+this->name+"\" at position "+ cvm::to_str(static_cast(is.tellg()))+ @@ -546,7 +643,12 @@ std::ostream & colvarbias::write_traj(std::ostream &os) colvarbias_ti::colvarbias_ti(char const *key) : colvarbias(key) { + colvarproxy *proxy = cvm::main()->proxy; provide(f_cvb_calc_ti_samples); + if (!proxy->total_forces_same_step()) { + // Samples at step zero can not be collected + feature_states[f_cvb_step_zero_data].available = false; + } ti_avg_forces = NULL; ti_count = NULL; } @@ -683,7 +785,9 @@ int colvarbias_ti::update_system_forces(std::vector const (*subtract_forces)[i] : previous_colvar_forces[i]); } } - ti_avg_forces->acc_value(ti_bin, ti_system_forces); + if (cvm::step_relative() > 0 || is_enabled(f_cvb_step_zero_data)) { + ti_avg_forces->acc_value(ti_bin, ti_system_forces); + } } } diff --git a/lib/colvars/colvarbias.h b/lib/colvars/colvarbias.h index 5179c42853..a2788eea72 100644 --- a/lib/colvars/colvarbias.h +++ b/lib/colvars/colvarbias.h @@ -57,6 +57,10 @@ public: /// Some implementations may use calc_energy() and calc_forces() virtual int update(); + /// Returns true if the current step represent a valid increment, whose data + /// can be recorded (as opposed to e.g. a continuation step from a restart) + virtual bool can_accumulate_data(); + /// Compute the energy of the bias /// Uses the vector of colvar values provided if not NULL, and the values /// currently cached in the bias instance otherwise @@ -144,14 +148,28 @@ public: } /// Read a keyword from the state data (typically a header) + /// \param Input stream + /// \param Keyword labeling the header block std::istream & read_state_data_key(std::istream &is, char const *key); - /// Write the bias configuration to a restart file or other stream + /// Write the bias configuration to a state file or other stream std::ostream & write_state(std::ostream &os); /// Read the bias configuration from a restart file or other stream std::istream & read_state(std::istream &is); + /// Write the bias state to a file with the given prefix + int write_state_prefix(std::string const &prefix); + + /// Write the bias state to a string + int write_state_string(std::string &output); + + /// Read the bias state from a file with this name or prefix + int read_state_prefix(std::string const &prefix); + + /// Read the bias state from this string buffer + int read_state_string(char const *buffer); + /// Write a label to the trajectory file (comment line) virtual std::ostream & write_traj_label(std::ostream &os); @@ -164,6 +182,9 @@ public: return COLVARS_OK; } + /// Frequency for writing output files + size_t output_freq; + /// Write any output files that this bias may have (e.g. PMF files) virtual int write_output_files() { diff --git a/lib/colvars/colvarbias_abf.cpp b/lib/colvars/colvarbias_abf.cpp index 5382a828f7..a84ec358dd 100644 --- a/lib/colvars/colvarbias_abf.cpp +++ b/lib/colvars/colvarbias_abf.cpp @@ -8,7 +8,6 @@ // Colvars repository at GitHub. #include "colvarmodule.h" -#include "colvarproxy.h" #include "colvar.h" #include "colvarbias_abf.h" @@ -29,8 +28,14 @@ colvarbias_abf::colvarbias_abf(char const *key) last_gradients(NULL), last_samples(NULL) { + colvarproxy *proxy = cvm::main()->proxy; + if (!proxy->total_forces_same_step()) { + // Samples at step zero can not be collected + feature_states[f_cvb_step_zero_data].available = false; + } } + int colvarbias_abf::init(std::string const &conf) { colvarbias::init(conf); @@ -71,8 +76,19 @@ int colvarbias_abf::init(std::string const &conf) // full_samples - min_samples >= 1 is guaranteed get_keyval(conf, "inputPrefix", input_prefix, std::vector()); - get_keyval(conf, "outputFreq", output_freq, cvm::restart_out_freq); + get_keyval(conf, "historyFreq", history_freq, 0); + if (history_freq != 0) { + if (output_freq == 0) { + cvm::error("Error: historyFreq must be a multiple of outputFreq.\n", + INPUT_ERROR); + } else { + if ((history_freq % output_freq) != 0) { + cvm::error("Error: historyFreq must be a multiple of outputFreq.\n", + INPUT_ERROR); + } + } + } b_history_files = (history_freq > 0); // shared ABF @@ -146,6 +162,7 @@ int colvarbias_abf::init(std::string const &conf) for (i = 0; i < num_variables(); i++) { if (max_force[i] < 0.0) { cvm::error("Error: maxForce should be non-negative."); + return COLVARS_ERROR; } } cap_force = true; @@ -184,25 +201,24 @@ int colvarbias_abf::init(std::string const &conf) czar_gradients = new colvar_grid_gradient(colvars); } - // For now, we integrate on-the-fly iff the grid is < 3D - if ( num_variables() <= 3 ) { + get_keyval(conf, "integrate", b_integrate, num_variables() <= 3); // Integrate for output if d<=3 + if (b_integrate) { + // For now, we integrate on-the-fly iff the grid is < 3D + if ( num_variables() > 3 ) { + cvm::error("Error: cannot integrate free energy in dimension > 3.\n"); + return COLVARS_ERROR; + } pmf = new integrate_potential(colvars, gradients); if ( b_CZAR_estimator ) { czar_pmf = new integrate_potential(colvars, czar_gradients); } - get_keyval(conf, "integrate", b_integrate, true); // Integrate for output - if ( num_variables() > 1 ) { - // Projected ABF - get_keyval(conf, "pABFintegrateFreq", pabf_freq, 0); - // Parameters for integrating initial (and final) gradient data - get_keyval(conf, "integrateInitMaxIterations", integrate_initial_iterations, 1e4); - get_keyval(conf, "integrateInitTol", integrate_initial_tol, 1e-6); - // for updating the integrated PMF on the fly - get_keyval(conf, "integrateMaxIterations", integrate_iterations, 100); - get_keyval(conf, "integrateTol", integrate_tol, 1e-4); - } - } else { - b_integrate = false; + // Parameters for integrating initial (and final) gradient data + get_keyval(conf, "integrateMaxIterations", integrate_iterations, 1e4, colvarparse::parse_silent); + get_keyval(conf, "integrateTol", integrate_tol, 1e-6, colvarparse::parse_silent); + // Projected ABF, updating the integrated PMF on the fly + get_keyval(conf, "pABFintegrateFreq", pabf_freq, 0, colvarparse::parse_silent); + get_keyval(conf, "pABFintegrateMaxIterations", pabf_integrate_iterations, 100, colvarparse::parse_silent); + get_keyval(conf, "pABFintegrateTol", pabf_integrate_tol, 1e-4, colvarparse::parse_silent); } // For shared ABF, we store a second set of grids. @@ -330,7 +346,7 @@ int colvarbias_abf::update() force_bin = bin; } - if (cvm::step_relative() > 0 || cvm::proxy->total_forces_same_step()) { + if (cvm::step_relative() > 0 || is_enabled(f_cvb_step_zero_data)) { if (update_bias) { // if (b_adiabatic_reweighting) { @@ -346,10 +362,10 @@ int colvarbias_abf::update() // and subtract previous ABF force if necessary update_system_force(i); } - gradients->acc_force(force_bin, system_force); - if ( b_integrate ) { - pmf->update_div_neighbors(force_bin); - } + gradients->acc_force(force_bin, system_force); + if ( b_integrate ) { + pmf->update_div_neighbors(force_bin); + } } } @@ -370,10 +386,10 @@ int colvarbias_abf::update() if ( b_integrate ) { if ( pabf_freq && cvm::step_relative() % pabf_freq == 0 ) { cvm::real err; - int iter = pmf->integrate(integrate_iterations, integrate_tol, err); - if ( iter == integrate_iterations ) { - cvm::log("Warning: PMF integration did not converge to " + cvm::to_str(integrate_tol) - + " in " + cvm::to_str(integrate_iterations) + int iter = pmf->integrate(pabf_integrate_iterations, pabf_integrate_tol, err); + if ( iter == pabf_integrate_iterations ) { + cvm::log("Warning: PMF integration did not converge to " + cvm::to_str(pabf_integrate_tol) + + " in " + cvm::to_str(pabf_integrate_iterations) + " steps. Residual error: " + cvm::to_str(err)); } pmf->set_zero_minimum(); // TODO: do this only when necessary @@ -448,17 +464,6 @@ int colvarbias_abf::update() output_prefix = cvm::output_prefix() + "." + this->name; } - if (output_freq && (cvm::step_absolute() % output_freq) == 0) { - if (cvm::debug()) cvm::log("ABF bias trying to write gradients and samples to disk"); - write_gradients_samples(output_prefix); - } - - if (b_history_files && (cvm::step_absolute() % history_freq) == 0) { - // file already exists iff cvm::step_relative() > 0 - // otherwise, backup and replace - write_gradients_samples(output_prefix + ".hist", (cvm::step_relative() > 0)); - } - if (shared_on && shared_last_step >= 0 && cvm::step_absolute() % shared_freq == 0) { // Share gradients and samples for shared ABF. replica_share(); @@ -487,10 +492,10 @@ int colvarbias_abf::update() eabf_UI.update(cvm::step_absolute(), x, y); } - /// Add the bias energy for 1D ABF - bias_energy = calc_energy(NULL); + /// Compute the bias energy + int error_code = calc_energy(NULL); - return COLVARS_OK; + return error_code; } @@ -570,83 +575,71 @@ int colvarbias_abf::replica_share() { last_samples->copy_grid(*samples); shared_last_step = cvm::step_absolute(); + if (b_integrate) { + // Update divergence to account for newly shared gradients + pmf->set_div(); + } return COLVARS_OK; } - -void colvarbias_abf::write_gradients_samples(const std::string &prefix, bool append) -{ - std::string samples_out_name = prefix + ".count"; - std::string gradients_out_name = prefix + ".grad"; - std::ios::openmode mode = (append ? std::ios::app : std::ios::out); - - std::ostream *samples_os = - cvm::proxy->output_stream(samples_out_name, mode); - if (!samples_os) return; - samples->write_multicol(*samples_os); - cvm::proxy->close_output_stream(samples_out_name); - - // In dimension higher than 2, dx is easier to handle and visualize - if (num_variables() > 2) { - std::string samples_dx_out_name = prefix + ".count.dx"; - std::ostream *samples_dx_os = cvm::proxy->output_stream(samples_dx_out_name, mode); - if (!samples_os) return; - samples->write_opendx(*samples_dx_os); - *samples_dx_os << std::endl; - cvm::proxy->close_output_stream(samples_dx_out_name); +template int colvarbias_abf::write_grid_to_file(T const *grid, + std::string const &filename, + bool close) { + std::ostream *os = cvm::proxy->output_stream(filename); + if (!os) { + return cvm::error("Error opening file " + filename + " for writing.\n", COLVARS_ERROR | FILE_ERROR); + } + grid->write_multicol(*os); + if (close) { + cvm::proxy->close_output_stream(filename); + } else { + // Insert empty line between frames in history files + *os << std::endl; + cvm::proxy->flush_output_stream(os); } - std::ostream *gradients_os = - cvm::proxy->output_stream(gradients_out_name, mode); - if (!gradients_os) return; - gradients->write_multicol(*gradients_os); - cvm::proxy->close_output_stream(gradients_out_name); + // In dimension higher than 2, dx is easier to handle and visualize + // but we cannot write multiple frames in a dx file now + // (could be implemented as multiple dx files) + if (num_variables() > 2 && close) { + std::string dx = filename + ".dx"; + std::ostream *dx_os = cvm::proxy->output_stream(dx); + if (!dx_os) { + return cvm::error("Error opening file " + dx + " for writing.\n", COLVARS_ERROR | FILE_ERROR); + } + grid->write_opendx(*dx_os); + // if (close) { + cvm::proxy->close_output_stream(dx); + // } + // else { + // // TODO, decide convention for multiple datasets in dx file + // *dx_os << std::endl; + // dx_os->flush(); + // } + } + return COLVARS_OK; +} + + +void colvarbias_abf::write_gradients_samples(const std::string &prefix, bool close) +{ + write_grid_to_file(samples, prefix + ".count", close); + write_grid_to_file(gradients, prefix + ".grad", close); if (b_integrate) { // Do numerical integration (to high precision) and output a PMF cvm::real err; - pmf->integrate(integrate_initial_iterations, integrate_initial_tol, err); + pmf->integrate(integrate_iterations, integrate_tol, err); pmf->set_zero_minimum(); - - std::string pmf_out_name = prefix + ".pmf"; - std::ostream *pmf_os = cvm::proxy->output_stream(pmf_out_name, mode); - if (!pmf_os) return; - pmf->write_multicol(*pmf_os); - - // In dimension higher than 2, dx is easier to handle and visualize - if (num_variables() > 2) { - std::string pmf_dx_out_name = prefix + ".pmf.dx"; - std::ostream *pmf_dx_os = cvm::proxy->output_stream(pmf_dx_out_name, mode); - if (!pmf_dx_os) return; - pmf->write_opendx(*pmf_dx_os); - *pmf_dx_os << std::endl; - cvm::proxy->close_output_stream(pmf_dx_out_name); - } - - *pmf_os << std::endl; - cvm::proxy->close_output_stream(pmf_out_name); + write_grid_to_file(pmf, prefix + ".pmf", close); } if (b_CZAR_estimator) { // Write eABF CZAR-related quantities - - std::string z_samples_out_name = prefix + ".zcount"; - - std::ostream *z_samples_os = - cvm::proxy->output_stream(z_samples_out_name, mode); - if (!z_samples_os) return; - z_samples->write_multicol(*z_samples_os); - cvm::proxy->close_output_stream(z_samples_out_name); - + write_grid_to_file(z_samples, prefix + ".zcount", close); if (b_czar_window_file) { - std::string z_gradients_out_name = prefix + ".zgrad"; - - std::ostream *z_gradients_os = - cvm::proxy->output_stream(z_gradients_out_name, mode); - if (!z_gradients_os) return; - z_gradients->write_multicol(*z_gradients_os); - cvm::proxy->close_output_stream(z_gradients_out_name); + write_grid_to_file(z_gradients, prefix + ".zgrad", close); } // Calculate CZAR estimator of gradients @@ -657,39 +650,15 @@ void colvarbias_abf::write_gradients_samples(const std::string &prefix, bool app - cvm::temperature() * cvm::boltzmann() * z_samples->log_gradient_finite_diff(ix, n), n); } } - - std::string czar_gradients_out_name = prefix + ".czar.grad"; - - std::ostream *czar_gradients_os = - cvm::proxy->output_stream(czar_gradients_out_name, mode); - if (!czar_gradients_os) return; - czar_gradients->write_multicol(*czar_gradients_os); - cvm::proxy->close_output_stream(czar_gradients_out_name); + write_grid_to_file(czar_gradients, prefix + ".czar.grad", close); if (b_integrate) { // Do numerical integration (to high precision) and output a PMF cvm::real err; czar_pmf->set_div(); - czar_pmf->integrate(integrate_initial_iterations, integrate_initial_tol, err); + czar_pmf->integrate(integrate_iterations, integrate_tol, err); czar_pmf->set_zero_minimum(); - - std::string czar_pmf_out_name = prefix + ".czar.pmf"; - std::ostream *czar_pmf_os = cvm::proxy->output_stream(czar_pmf_out_name, mode); - if (!czar_pmf_os) return; - czar_pmf->write_multicol(*czar_pmf_os); - - // In dimension higher than 2, dx is easier to handle and visualize - if (num_variables() > 2) { - std::string czar_pmf_dx_out_name = prefix + ".czar.pmf.dx"; - std::ostream *czar_pmf_dx_os = cvm::proxy->output_stream(czar_pmf_dx_out_name, mode); - if (!czar_pmf_dx_os) return; - czar_pmf->write_opendx(*czar_pmf_dx_os); - *czar_pmf_dx_os << std::endl; - cvm::proxy->close_output_stream(czar_pmf_dx_out_name); - } - - *czar_pmf_os << std::endl; - cvm::proxy->close_output_stream(czar_pmf_out_name); + write_grid_to_file(czar_pmf, prefix + ".czar.pmf", close); } } return; @@ -836,25 +805,56 @@ std::istream & colvarbias_abf::read_state_data(std::istream& is) return is; } + int colvarbias_abf::write_output_files() { + if (cvm::debug()) { + cvm::log("ABF bias trying to write gradients and samples to disk"); + } + + if (shared_on && cvm::main()->proxy->replica_index() > 0) { + // No need to report the same data as replica 0, let it do the I/O job + return COLVARS_OK; + } + write_gradients_samples(output_prefix); + if (b_history_files) { + if ((cvm::step_absolute() % history_freq) == 0) { + write_gradients_samples(output_prefix + ".hist", false); + } + } + + if (b_UI_estimator) { + eabf_UI.calc_pmf(); + eabf_UI.write_files(); + } + return COLVARS_OK; } + int colvarbias_abf::calc_energy(std::vector const *values) { - if (values) { - return cvm::error("colvarbias_abf::calc_energy() with an argument " - "is currently not implemented.\n", - COLVARS_NOT_IMPLEMENTED); - } + bias_energy = 0.0; // default value, overridden if a value can be calculated - if (num_variables() != 1) return 0.0; + if (num_variables() > 1 || values != NULL) { + // Use simple estimate: neglect effect of fullSamples, + // return value at center of bin + if (pmf != NULL) { + std::vector const curr_bin = values ? + pmf->get_colvars_index(*values) : + pmf->get_colvars_index(); + + if (pmf->index_ok(curr_bin)) { + bias_energy = pmf->value(curr_bin); + } + } + return COLVARS_OK; + } // Get the home bin. int home0 = gradients->current_bin_scalar(0); - if (home0 < 0) return 0.0; + if (home0 < 0) return COLVARS_OK; int gradient_len = (int)(gradients->number_of_points(0)); int home = (home0 < gradient_len) ? home0 : (gradient_len-1); @@ -886,5 +886,6 @@ int colvarbias_abf::calc_energy(std::vector const *values) sum += fact*gradients->value(ix)/count*gradients->widths[0]*frac; // The applied potential is the negative integral of force samples. - return -sum; + bias_energy = -sum; + return COLVARS_OK; } diff --git a/lib/colvars/colvarbias_abf.h b/lib/colvars/colvarbias_abf.h index 1939b61a8b..15c81e9466 100644 --- a/lib/colvars/colvarbias_abf.h +++ b/lib/colvars/colvarbias_abf.h @@ -15,6 +15,7 @@ #include #include +#include "colvarproxy.h" #include "colvarbias.h" #include "colvargrid.h" #include "colvar_UIestimator.h" @@ -56,8 +57,6 @@ private: size_t full_samples; /// Number of samples per bin before applying a scaled-down biasing force size_t min_samples; - /// frequency for updating output files - int output_freq; /// Write combined files with a history of all output data? bool b_history_files; /// Write CZAR output file for stratified eABF (.zgrad) @@ -74,13 +73,13 @@ private: /// Frequency for updating pABF PMF (if zero, pABF is not used) int pabf_freq; /// Max number of CG iterations for integrating PMF at startup and for file output - int integrate_initial_iterations; - /// Tolerance for integrating PMF at startup and for file output - cvm::real integrate_initial_tol; - /// Max number of CG iterations for integrating PMF at on-the-fly pABF updates int integrate_iterations; - /// Tolerance for integrating PMF at on-the-fly pABF updates + /// Tolerance for integrating PMF at startup and for file output cvm::real integrate_tol; + /// Max number of CG iterations for integrating PMF at on-the-fly pABF updates + int pabf_integrate_iterations; + /// Tolerance for integrating PMF at on-the-fly pABF updates + cvm::real pabf_integrate_tol; /// Cap the biasing force to be applied? (option maxForce) bool cap_force; @@ -151,11 +150,16 @@ private: virtual int bin_count(int bin_index); /// Write human-readable FE gradients and sample count, and DX file in dim > 2 - void write_gradients_samples(const std::string &prefix, bool append = false); + void write_gradients_samples(const std::string &prefix, bool close = true); /// Read human-readable FE gradients and sample count (if not using restart) void read_gradients_samples(); + /// Template used in write_gradient_samples() + template int write_grid_to_file(T const *grid, + std::string const &name, + bool close); + virtual std::istream& read_state_data(std::istream&); virtual std::ostream& write_state_data(std::ostream&); virtual int write_output_files(); diff --git a/lib/colvars/colvarbias_histogram.cpp b/lib/colvars/colvarbias_histogram.cpp index 92985b0f61..3efe0b0acc 100644 --- a/lib/colvars/colvarbias_histogram.cpp +++ b/lib/colvars/colvarbias_histogram.cpp @@ -30,9 +30,10 @@ int colvarbias_histogram::init(std::string const &conf) size_t i; - get_keyval(conf, "outputFile", out_name, std::string("")); - get_keyval(conf, "outputFileDX", out_name_dx, std::string("")); - get_keyval(conf, "outputFreq", output_freq, cvm::restart_out_freq); + get_keyval(conf, "outputFile", out_name, ""); + // Write DX file by default only in dimension >= 3 + std::string default_name_dx = this->num_variables() > 2 ? "" : "none"; + get_keyval(conf, "outputFileDX", out_name_dx, default_name_dx); /// with VMD, this may not be an error // if ( output_freq == 0 ) { @@ -146,8 +147,10 @@ int colvarbias_histogram::update() bin[i] = grid->current_bin_scalar(i); } - if (grid->index_ok(bin)) { - grid->acc_value(bin, 1.0); + if (can_accumulate_data()) { + if (grid->index_ok(bin)) { + grid->acc_value(bin, 1.0); + } } } else { // update indices for vector/array values @@ -163,10 +166,6 @@ int colvarbias_histogram::update() } } - if (output_freq && (cvm::step_absolute() % output_freq) == 0) { - write_output_files(); - } - error_code |= cvm::get_error(); return error_code; } @@ -179,7 +178,7 @@ int colvarbias_histogram::write_output_files() return COLVARS_OK; } - if (out_name.size()) { + if (out_name.size() && out_name != "none") { cvm::log("Writing the histogram file \""+out_name+"\".\n"); cvm::backup_file(out_name.c_str()); std::ostream *grid_os = cvm::proxy->output_stream(out_name); @@ -191,7 +190,7 @@ int colvarbias_histogram::write_output_files() cvm::proxy->close_output_stream(out_name); } - if (out_name_dx.size()) { + if (out_name_dx.size() && out_name_dx != "none") { cvm::log("Writing the histogram file \""+out_name_dx+"\".\n"); cvm::backup_file(out_name_dx.c_str()); std::ostream *grid_os = cvm::proxy->output_stream(out_name_dx); diff --git a/lib/colvars/colvarbias_meta.cpp b/lib/colvars/colvarbias_meta.cpp index 05f293d872..d448b1f2e4 100644 --- a/lib/colvars/colvarbias_meta.cpp +++ b/lib/colvars/colvarbias_meta.cpp @@ -566,8 +566,8 @@ int colvarbias_meta::update_grid_params() int colvarbias_meta::update_bias() { // add a new hill if the required time interval has passed - if ((cvm::step_absolute() % new_hill_freq) == 0 && - is_enabled(f_cvb_history_dependent)) { + if (((cvm::step_absolute() % new_hill_freq) == 0) && + can_accumulate_data() && is_enabled(f_cvb_history_dependent)) { if (cvm::debug()) { cvm::log("Metadynamics bias \""+this->name+"\""+ @@ -883,7 +883,7 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, // TODO: improve it by looping over a small subgrid instead of the whole grid - std::vector colvar_values(num_variables()); + std::vector new_colvar_values(num_variables()); std::vector colvar_forces_scalar(num_variables()); std::vector he_ix = he->new_index(); @@ -902,17 +902,17 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, count++) { size_t i; for (i = 0; i < num_variables(); i++) { - colvar_values[i] = hills_energy->bin_to_value_scalar(he_ix[i], i); + new_colvar_values[i] = hills_energy->bin_to_value_scalar(he_ix[i], i); } // loop over the hills and increment the energy grid locally hills_energy_here = 0.0; - calc_hills(h_first, h_last, hills_energy_here, &colvar_values); + calc_hills(h_first, h_last, hills_energy_here, &new_colvar_values); he->acc_value(he_ix, hills_energy_here); for (i = 0; i < num_variables(); i++) { hills_forces_here[i].reset(); - calc_hills_force(i, h_first, h_last, hills_forces_here, &colvar_values); + calc_hills_force(i, h_first, h_last, hills_forces_here, &new_colvar_values); colvar_forces_scalar[i] = hills_forces_here[i].real_value; } hg->acc_force(hg_ix, &(colvar_forces_scalar.front())); @@ -935,16 +935,18 @@ void colvarbias_meta::project_hills(colvarbias_meta::hill_iter h_first, } else { + // TODO delete this (never used) + // simpler version, with just the energy for ( ; (he->index_ok(he_ix)); ) { for (size_t i = 0; i < num_variables(); i++) { - colvar_values[i] = hills_energy->bin_to_value_scalar(he_ix[i], i); + new_colvar_values[i] = hills_energy->bin_to_value_scalar(he_ix[i], i); } hills_energy_here = 0.0; - calc_hills(h_first, h_last, hills_energy_here, &colvar_values); + calc_hills(h_first, h_last, hills_energy_here, &new_colvar_values); he->acc_value(he_ix, hills_energy_here); he->incr(he_ix); @@ -1240,7 +1242,7 @@ void colvarbias_meta::read_replica_files() // test whether this is the end of the file is.seekg(0, std::ios::end); - if (is.tellg() > (replicas[ir])->replica_hills_file_pos+1) { + if (is.tellg() > (replicas[ir])->replica_hills_file_pos + ((std::streampos) 1)) { (replicas[ir])->update_status++; } else { (replicas[ir])->update_status = 0; @@ -1324,7 +1326,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) hills_energy_gradients = new colvar_grid_gradient(colvars); } - size_t const hills_energy_pos = is.tellg(); + std::streampos const hills_energy_pos = is.tellg(); std::string key; if (!(is >> key)) { if (hills_energy_backup != NULL) { @@ -1363,7 +1365,7 @@ std::istream & colvarbias_meta::read_state_data(std::istream& is) } } - size_t const hills_energy_gradients_pos = is.tellg(); + std::streampos const hills_energy_gradients_pos = is.tellg(); if (!(is >> key)) { if (hills_energy_backup != NULL) { delete hills_energy; @@ -1511,7 +1513,7 @@ std::istream & colvarbias_meta::read_hill(std::istream &is) { if (!is) return is; // do nothing if failbit is set - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); size_t i = 0; std::string data; @@ -1958,11 +1960,12 @@ colvarbias_meta::hill::hill(cvm::step_number it_in, colvarbias_meta::hill::hill(colvarbias_meta::hill const &h) - : sW(1.0), + : it(h.it), + hill_value(0.0), + sW(1.0), W(h.W), centers(h.centers), sigmas(h.sigmas), - it(h.it), replica(h.replica) {} diff --git a/lib/colvars/colvarbias_meta.h b/lib/colvars/colvarbias_meta.h index 9f9fc63fc7..2f34abcc77 100644 --- a/lib/colvars/colvarbias_meta.h +++ b/lib/colvars/colvarbias_meta.h @@ -257,7 +257,7 @@ protected: std::string replica_hills_file; /// Position within replica_hills_file (when reading it) - int replica_hills_file_pos; + std::streampos replica_hills_file_pos; }; diff --git a/lib/colvars/colvarcomp.cpp b/lib/colvars/colvarcomp.cpp index 05d1195d58..a1542d05bf 100644 --- a/lib/colvars/colvarcomp.cpp +++ b/lib/colvars/colvarcomp.cpp @@ -169,7 +169,7 @@ cvm::atom_group *colvar::cvc::parse_group(std::string const &conf, group->check_keywords(group_conf, group_key); if (cvm::get_error()) { cvm::error("Error parsing definition for atom group \""+ - std::string(group_key)+"\"\n.", INPUT_ERROR); + std::string(group_key)+"\".", INPUT_ERROR); } cvm::decrease_depth(); @@ -200,40 +200,40 @@ int colvar::cvc::init_dependencies() { init_feature(f_cvc_periodic, "periodic", f_type_static); - init_feature(f_cvc_width, "defined width", f_type_static); + init_feature(f_cvc_width, "defined_width", f_type_static); - init_feature(f_cvc_lower_boundary, "defined lower boundary", f_type_static); + init_feature(f_cvc_lower_boundary, "defined_lower_boundary", f_type_static); - init_feature(f_cvc_upper_boundary, "defined upper boundary", f_type_static); + init_feature(f_cvc_upper_boundary, "defined_upper_boundary", f_type_static); init_feature(f_cvc_gradient, "gradient", f_type_dynamic); - init_feature(f_cvc_explicit_gradient, "explicit gradient", f_type_static); + init_feature(f_cvc_explicit_gradient, "explicit_gradient", f_type_static); require_feature_children(f_cvc_explicit_gradient, f_ag_explicit_gradient); - init_feature(f_cvc_inv_gradient, "inverse gradient", f_type_dynamic); + init_feature(f_cvc_inv_gradient, "inverse_gradient", f_type_dynamic); require_feature_self(f_cvc_inv_gradient, f_cvc_gradient); - init_feature(f_cvc_debug_gradient, "debug gradient", f_type_user); + init_feature(f_cvc_debug_gradient, "debug_gradient", f_type_user); require_feature_self(f_cvc_debug_gradient, f_cvc_gradient); require_feature_self(f_cvc_debug_gradient, f_cvc_explicit_gradient); - init_feature(f_cvc_Jacobian, "Jacobian derivative", f_type_dynamic); + init_feature(f_cvc_Jacobian, "Jacobian_derivative", f_type_dynamic); require_feature_self(f_cvc_Jacobian, f_cvc_inv_gradient); // Compute total force on first site only to avoid unwanted // coupling to other colvars (see e.g. Ciccotti et al., 2005) - init_feature(f_cvc_one_site_total_force, "compute total force from one group", f_type_user); + init_feature(f_cvc_one_site_total_force, "total_force_from_one_group", f_type_user); require_feature_self(f_cvc_one_site_total_force, f_cvc_com_based); - init_feature(f_cvc_com_based, "depends on group centers of mass", f_type_static); + init_feature(f_cvc_com_based, "function_of_centers_of_mass", f_type_static); - init_feature(f_cvc_pbc_minimum_image, "use minimum-image distances with PBCs", f_type_user); + init_feature(f_cvc_pbc_minimum_image, "use_minimum-image_with_PBCs", f_type_user); - init_feature(f_cvc_scalable, "scalable calculation", f_type_static); + init_feature(f_cvc_scalable, "scalable_calculation", f_type_static); require_feature_self(f_cvc_scalable, f_cvc_scalable_com); - init_feature(f_cvc_scalable_com, "scalable calculation of centers of mass", f_type_static); + init_feature(f_cvc_scalable_com, "scalable_calculation_of_centers_of_mass", f_type_static); require_feature_self(f_cvc_scalable_com, f_cvc_com_based); @@ -626,6 +626,7 @@ void colvar::cvc::wrap(colvarvalue & /* x_unwrapped */) const } + // Static members std::vector colvar::cvc::cvc_features; diff --git a/lib/colvars/colvarcomp.h b/lib/colvars/colvarcomp.h index e405f4c9b1..57df68ab6e 100644 --- a/lib/colvars/colvarcomp.h +++ b/lib/colvars/colvarcomp.h @@ -1358,8 +1358,14 @@ protected: cvm::atom_group *atoms; /// Reference coordinates (for RMSD calculation only) + /// Includes sets with symmetry permutations (n_permutations * n_atoms) std::vector ref_pos; + /// Number of permutations of symmetry-related atoms + size_t n_permutations; + + /// Index of the permutation yielding the smallest RMSD (0 for identity) + size_t best_perm_index; public: /// Constructor @@ -1487,8 +1493,6 @@ class colvar::linearCombination : public colvar::cvc { protected: - /// Map from string to the types of colvar components - std::map> string_cv_map; /// Sub-colvar components std::vector cv; /// If all sub-cvs use explicit gradients then we also use it @@ -1508,8 +1512,6 @@ class colvar::CVBasedPath : public colvar::cvc { protected: - /// Map from string to the types of colvar components - std::map> string_cv_map; /// Sub-colvar components std::vector cv; /// Reference colvar values from path @@ -1661,6 +1663,33 @@ public: #endif // C++11 checking + +// \brief Colvar component: total value of a scalar map +// (usually implemented as a grid by the simulation engine) +class colvar::map_total + : public colvar::cvc +{ +public: + + map_total(); + map_total(std::string const &conf); + virtual ~map_total() {} + virtual int init(std::string const &conf); + virtual void calc_value(); + virtual void calc_gradients(); + virtual void apply_force(colvarvalue const &force); + +protected: + + /// Identifier of the map object (as used by the simulation engine) + std::string map_name; + + /// Index of the map objet in the proxy arrays + int volmap_index; +}; + + + // metrics functions for cvc implementations // simple definitions of the distance functions; these are useful only @@ -1691,6 +1720,6 @@ public: { \ return this->dist2_lgrad(x2, x1); \ } \ - \ + #endif diff --git a/lib/colvars/colvarcomp_distances.cpp b/lib/colvars/colvarcomp_distances.cpp index c3c1ee55d5..1b1b295ff1 100644 --- a/lib/colvars/colvarcomp_distances.cpp +++ b/lib/colvars/colvarcomp_distances.cpp @@ -7,6 +7,8 @@ // If you wish to distribute your changes, please submit them to the // Colvars repository at GitHub. +#include + #include "colvarmodule.h" #include "colvarvalue.h" #include "colvarparse.h" @@ -1045,6 +1047,44 @@ colvar::rmsd::rmsd(std::string const &conf) // this is only required for ABF, but we do both groups here for better caching atoms->rot.request_group2_gradients(atoms->size()); } + + std::string perm_conf; + size_t pos = 0; // current position in config string + n_permutations = 1; + + while (key_lookup(conf, "atomPermutation", &perm_conf, &pos)) { + std::vector perm; + if (perm_conf.size()) { + std::istringstream is(perm_conf); + size_t index; + while (is >> index) { + std::vector const &ids = atoms->ids(); + size_t const ia = std::find(ids.begin(), ids.end(), index-1) - ids.begin(); + if (ia == atoms->size()) { + cvm::error("Error: atom id " + cvm::to_str(index) + + " is not a member of group \"atoms\"."); + return; + } + if (std::find(perm.begin(), perm.end(), ia) != perm.end()) { + cvm::error("Error: atom id " + cvm::to_str(index) + + " is mentioned more than once in atomPermutation list."); + return; + } + perm.push_back(ia); + } + if (perm.size() != atoms->size()) { + cvm::error("Error: symmetry permutation in input contains " + cvm::to_str(perm.size()) + + " indices, but group \"atoms\" contains " + cvm::to_str(atoms->size()) + " atoms."); + return; + } + cvm::log("atomPermutation = " + cvm::to_str(perm)); + n_permutations++; + // Record a copy of reference positions in new order + for (size_t ia = 0; ia < atoms->size(); ia++) { + ref_pos.push_back(ref_pos[perm[ia]]); + } + } + } } @@ -1056,6 +1096,20 @@ void colvar::rmsd::calc_value() for (size_t ia = 0; ia < atoms->size(); ia++) { x.real_value += ((*atoms)[ia].pos - ref_pos[ia]).norm2(); } + best_perm_index = 0; + + // Compute sum of squares for each symmetry permutation of atoms, keep the smallest + size_t ref_pos_index = atoms->size(); + for (size_t ip = 1; ip < n_permutations; ip++) { + cvm::real value = 0.0; + for (size_t ia = 0; ia < atoms->size(); ia++) { + value += ((*atoms)[ia].pos - ref_pos[ref_pos_index++]).norm2(); + } + if (value < x.real_value) { + x.real_value = value; + best_perm_index = ip; + } + } x.real_value /= cvm::real(atoms->size()); // MSD x.real_value = cvm::sqrt(x.real_value); } @@ -1067,8 +1121,10 @@ void colvar::rmsd::calc_gradients() 0.5 / (x.real_value * cvm::real(atoms->size())) : 0.0; + // Use the appropriate symmetry permutation of reference positions to calculate gradients + size_t const start = atoms->size() * best_perm_index; for (size_t ia = 0; ia < atoms->size(); ia++) { - (*atoms)[ia].grad = (drmsddx2 * 2.0 * ((*atoms)[ia].pos - ref_pos[ia])); + (*atoms)[ia].grad = (drmsddx2 * 2.0 * ((*atoms)[ia].pos - ref_pos[start + ia])); } } diff --git a/lib/colvars/colvarcomp_gpath.cpp b/lib/colvars/colvarcomp_gpath.cpp index d563403628..8849f9dbe4 100644 --- a/lib/colvars/colvarcomp_gpath.cpp +++ b/lib/colvars/colvarcomp_gpath.cpp @@ -19,10 +19,6 @@ #include "colvar.h" #include "colvarcomp.h" -namespace GeometricPathCV { -void init_string_cv_map(std::map>& string_cv_map); -} - bool compareColvarComponent(colvar::cvc *i, colvar::cvc *j) { return i->name < j->name; @@ -406,9 +402,8 @@ void colvar::gzpath::apply_force(colvarvalue const &force) { } colvar::linearCombination::linearCombination(std::string const &conf): cvc(conf) { - GeometricPathCV::init_string_cv_map(string_cv_map); // Lookup all available sub-cvcs - for (auto it_cv_map = string_cv_map.begin(); it_cv_map != string_cv_map.end(); ++it_cv_map) { + for (auto it_cv_map = colvar::get_global_cvc_map().begin(); it_cv_map != colvar::get_global_cvc_map().end(); ++it_cv_map) { if (key_lookup(conf, it_cv_map->first.c_str())) { std::vector sub_cvc_confs; get_key_string_multi_value(conf, it_cv_map->first.c_str(), sub_cvc_confs); @@ -506,9 +501,8 @@ void colvar::linearCombination::apply_force(colvarvalue const &force) { } colvar::CVBasedPath::CVBasedPath(std::string const &conf): cvc(conf) { - GeometricPathCV::init_string_cv_map(string_cv_map); // Lookup all available sub-cvcs - for (auto it_cv_map = string_cv_map.begin(); it_cv_map != string_cv_map.end(); ++it_cv_map) { + for (auto it_cv_map = colvar::get_global_cvc_map().begin(); it_cv_map != colvar::get_global_cvc_map().end(); ++it_cv_map) { if (key_lookup(conf, it_cv_map->first.c_str())) { std::vector sub_cvc_confs; get_key_string_multi_value(conf, it_cv_map->first.c_str(), sub_cvc_confs); @@ -909,33 +903,4 @@ void colvar::gzpathCV::apply_force(colvarvalue const &force) { } } -void GeometricPathCV::init_string_cv_map(std::map>& string_cv_map) { - string_cv_map["distance"] = [](const std::string& conf){return new colvar::distance(conf);}; - string_cv_map["dihedral"] = [](const std::string& conf){return new colvar::dihedral(conf);}; - string_cv_map["angle"] = [](const std::string& conf){return new colvar::angle(conf);}; - string_cv_map["rmsd"] = [](const std::string& conf){return new colvar::rmsd(conf);}; - string_cv_map["gyration"] = [](const std::string& conf){return new colvar::gyration(conf);}; - string_cv_map["inertia"] = [](const std::string& conf){return new colvar::inertia(conf);}; - string_cv_map["inertiaZ"] = [](const std::string& conf){return new colvar::inertia_z(conf);}; - string_cv_map["tilt"] = [](const std::string& conf){return new colvar::tilt(conf);}; - string_cv_map["distanceZ"] = [](const std::string& conf){return new colvar::distance_z(conf);}; - string_cv_map["distanceXY"] = [](const std::string& conf){return new colvar::distance_xy(conf);}; - string_cv_map["polarTheta"] = [](const std::string& conf){return new colvar::polar_theta(conf);}; - string_cv_map["polarPhi"] = [](const std::string& conf){return new colvar::polar_phi(conf);}; - string_cv_map["distanceVec"] = [](const std::string& conf){return new colvar::distance_vec(conf);}; - string_cv_map["orientationAngle"] = [](const std::string& conf){return new colvar::orientation_angle(conf);}; - string_cv_map["distancePairs"] = [](const std::string& conf){return new colvar::distance_pairs(conf);}; - string_cv_map["dipoleMagnitude"] = [](const std::string& conf){return new colvar::dipole_magnitude(conf);}; - string_cv_map["coordNum"] = [](const std::string& conf){return new colvar::coordnum(conf);}; - string_cv_map["selfCoordNum"] = [](const std::string& conf){return new colvar::selfcoordnum(conf);}; - string_cv_map["dipoleAngle"] = [](const std::string& conf){return new colvar::dipole_angle(conf);}; - string_cv_map["orientation"] = [](const std::string& conf){return new colvar::orientation(conf);}; - string_cv_map["orientationProj"] = [](const std::string& conf){return new colvar::orientation_proj(conf);}; - string_cv_map["eigenvector"] = [](const std::string& conf){return new colvar::eigenvector(conf);}; - string_cv_map["cartesian"] = [](const std::string& conf){return new colvar::cartesian(conf);}; - string_cv_map["alpha"] = [](const std::string& conf){return new colvar::alpha_angles(conf);}; - string_cv_map["dihedralPC"] = [](const std::string& conf){return new colvar::dihedPC(conf);}; - string_cv_map["linearCombination"] = [](const std::string& conf){return new colvar::linearCombination(conf);}; -} - #endif diff --git a/lib/colvars/colvarcomp_volmaps.cpp b/lib/colvars/colvarcomp_volmaps.cpp new file mode 100644 index 0000000000..8ea2b76de4 --- /dev/null +++ b/lib/colvars/colvarcomp_volmaps.cpp @@ -0,0 +1,60 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + +#include "colvarmodule.h" +#include "colvarvalue.h" +#include "colvarparse.h" +#include "colvar.h" +#include "colvarcomp.h" + + + +colvar::map_total::map_total() + : cvc(), volmap_index(-1) +{ + function_type = "map_total"; + x.type(colvarvalue::type_scalar); +} + + +colvar::map_total::map_total(std::string const &conf) + : cvc(), volmap_index(-1) +{ + function_type = "map_total"; + x.type(colvarvalue::type_scalar); + map_total::init(conf); +} + + +int colvar::map_total::init(std::string const &conf) +{ + int error_code = cvc::init(conf); + get_keyval(conf, "mapName", map_name, map_name); + volmap_index = (cvm::proxy)->init_volmap(map_name); + error_code |= volmap_index > 0 ? COLVARS_OK : INPUT_ERROR; + return error_code; +} + + +void colvar::map_total::calc_value() +{ + x.real_value = (cvm::proxy)->get_volmap_value(volmap_index); +} + + +void colvar::map_total::calc_gradients() +{ + // Atomic coordinates are not available here +} + + +void colvar::map_total::apply_force(colvarvalue const &force) +{ + (cvm::proxy)->apply_volmap_force(volmap_index, force.real_value); +} diff --git a/lib/colvars/colvardeps.cpp b/lib/colvars/colvardeps.cpp index f83458b51c..94c5cfbda7 100644 --- a/lib/colvars/colvardeps.cpp +++ b/lib/colvars/colvardeps.cpp @@ -115,7 +115,9 @@ bool colvardeps::get_keyval_feature(colvarparse *cvp, } bool value; bool const found = cvp->get_keyval(conf, key, value, def_value, parse_mode); - if (value) enable(feature_id); + // If the default value is on, this function should be able to disable the feature! + set_enabled(feature_id, value); + return found; } diff --git a/lib/colvars/colvardeps.h b/lib/colvars/colvardeps.h index 63669536fe..f4f543f336 100644 --- a/lib/colvars/colvardeps.h +++ b/lib/colvars/colvardeps.h @@ -227,6 +227,8 @@ public: f_cvb_active, /// \brief Bias is awake (active on its own accord) this timestep f_cvb_awake, + /// Accumulates data starting from step 0 of a simulation run + f_cvb_step_zero_data, /// \brief will apply forces f_cvb_apply_force, /// \brief force this bias to act on actual value for extended-Lagrangian coordinates @@ -302,6 +304,10 @@ public: f_cv_hard_lower_boundary, /// \brief The upper boundary is not defined from user's choice f_cv_hard_upper_boundary, + /// \brief Reflecting lower boundary condition + f_cv_reflecting_lower_boundary, + /// \brief Reflecting upper boundary condition + f_cv_reflecting_upper_boundary, /// \brief Provide a discretization of the values of the colvar to /// be used by the biases or in analysis (needs lower and upper /// boundary) diff --git a/lib/colvars/colvargrid.h b/lib/colvars/colvargrid.h index 314a92b8c6..427e5b0825 100644 --- a/lib/colvars/colvargrid.h +++ b/lib/colvars/colvargrid.h @@ -239,19 +239,21 @@ public: } /// \brief Constructor from a vector of colvars + /// \param add_extra_bin requests that non-periodic dimensions are extended + /// by 1 bin to accommodate the integral (PMF) of another gridded quantity (gradient) colvar_grid(std::vector const &colvars, T const &t = T(), size_t mult_i = 1, - bool margin = false) + bool add_extra_bin = false) : has_data(false) { - this->init_from_colvars(colvars, t, mult_i, margin); + this->init_from_colvars(colvars, t, mult_i, add_extra_bin); } int init_from_colvars(std::vector const &colvars, T const &t = T(), size_t mult_i = 1, - bool margin = false) + bool add_extra_bin = false) { if (cvm::debug()) { cvm::log("Reading grid configuration from collective variables.\n"); @@ -299,7 +301,7 @@ public: use_actual_value[i-1] = true; } - if (margin) { + if (add_extra_bin) { if (periodic[i]) { // Shift the grid by half the bin width (values at edges instead of center of bins) lower_boundaries.push_back(cv[i]->lower_boundary.real_value - 0.5 * widths[i]); @@ -699,7 +701,7 @@ public: } if (scale_factor != 1.0) for (size_t i = 0; i < data.size(); i++) { - data[i] += scale_factor * other_grid.data[i]; + data[i] += static_cast(scale_factor * other_grid.data[i]); } else // skip multiplication if possible @@ -712,7 +714,7 @@ public: /// \brief Return the value suitable for output purposes (so that it /// may be rescaled or manipulated without changing it permanently) virtual inline T value_output(std::vector const &ix, - size_t const &imult = 0) + size_t const &imult = 0) const { return value(ix, imult); } @@ -820,6 +822,8 @@ public: std::vector old_nx = nx; std::vector old_lb = lower_boundaries; + std::vector old_ub = upper_boundaries; + std::vector old_w = widths; { size_t nd_in = 0; @@ -858,12 +862,15 @@ public: if (! periodic.size()) periodic.assign(nd, false); if (! widths.size()) widths.assign(nd, 1.0); + cvm::real eps = 1.e-10; + bool new_params = false; if (old_nx.size()) { for (size_t i = 0; i < nd; i++) { - if ( (old_nx[i] != nx[i]) || - (cvm::sqrt(cv[i]->dist2(old_lb[i], - lower_boundaries[i])) > 1.0E-10) ) { + if (old_nx[i] != nx[i] || + cvm::sqrt(cv[i]->dist2(old_lb[i], lower_boundaries[i])) > eps || + cvm::sqrt(cv[i]->dist2(old_ub[i], upper_boundaries[i])) > eps || + cvm::fabs(old_w[i] - widths[i]) > eps) { new_params = true; } } @@ -928,7 +935,7 @@ public: /// \brief Read grid entry in restart file std::istream & read_restart(std::istream &is) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); std::string key, conf; if ((is >> key) && (key == std::string("grid_parameters"))) { is.seekg(start_pos, std::ios::beg); @@ -955,7 +962,7 @@ public: /// represented in memory /// \param buf_size Number of values per line std::ostream & write_raw(std::ostream &os, - size_t const buf_size = 3) + size_t const buf_size = 3) const { std::streamsize const w = os.width(); std::streamsize const p = os.precision(); @@ -981,7 +988,7 @@ public: /// \brief Read data written by colvar_grid::write_raw() std::istream & read_raw(std::istream &is) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); for (std::vector ix = new_index(); index_ok(ix); incr(ix)) { for (size_t imult = 0; imult < mult; imult++) { @@ -1004,7 +1011,7 @@ public: /// \brief Write the grid in a format which is both human readable /// and suitable for visualization e.g. with gnuplot - void write_multicol(std::ostream &os) + void write_multicol(std::ostream &os) const { std::streamsize const w = os.width(); std::streamsize const p = os.precision(); @@ -1145,7 +1152,7 @@ public: /// \brief Write the grid data without labels, as they are /// represented in memory - std::ostream & write_opendx(std::ostream &os) + std::ostream & write_opendx(std::ostream &os) const { // write the header os << "object 1 class gridpositions counts"; @@ -1208,7 +1215,7 @@ public: /// Constructor from a vector of colvars colvar_grid_count(std::vector &colvars, size_t const &def_count = 0, - bool margin = false); + bool add_extra_bin = false); /// Increment the counter at given position inline void incr_count(std::vector const &ix) @@ -1360,7 +1367,7 @@ public: /// Constructor from a vector of colvars colvar_grid_scalar(std::vector &colvars, - bool margin = 0); + bool add_extra_bin = false); /// Accumulate the value inline void acc_value(std::vector const &ix, @@ -1419,9 +1426,9 @@ public: // 100 101 110 111 000 001 010 011 grad[0] = 0.25 * ((p[4] + p[5] + p[6] + p[7]) - (p[0] + p[1] + p[2] + p[3])) / widths[0]; // 010 011 110 111 000 001 100 101 - grad[1] = 0.25 * ((p[2] + p[3] + p[6] + p[7]) - (p[0] + p[1] + p[4] + p[5])) / widths[0]; + grad[1] = 0.25 * ((p[2] + p[3] + p[6] + p[7]) - (p[0] + p[1] + p[4] + p[5])) / widths[1]; // 001 011 101 111 000 010 100 110 - grad[2] = 0.25 * ((p[1] + p[3] + p[5] + p[7]) - (p[0] + p[2] + p[4] + p[6])) / widths[0]; + grad[2] = 0.25 * ((p[1] + p[3] + p[5] + p[7]) - (p[0] + p[2] + p[4] + p[6])) / widths[2]; } else { cvm::error("Finite differences available in dimension 2 and 3 only."); } @@ -1430,7 +1437,7 @@ public: /// \brief Return the value of the function at ix divided by its /// number of samples (if the count grid is defined) virtual cvm::real value_output(std::vector const &ix, - size_t const &imult = 0) + size_t const &imult = 0) const { if (imult > 0) { cvm::error("Error: trying to access a component " @@ -1574,7 +1581,7 @@ public: /// \brief Return the value of the function at ix divided by its /// number of samples (if the count grid is defined) virtual inline cvm::real value_output(std::vector const &ix, - size_t const &imult = 0) + size_t const &imult = 0) const { if (samples) return (samples->value(ix) > 0) ? diff --git a/lib/colvars/colvarmodule.cpp b/lib/colvars/colvarmodule.cpp index 1d5f75bbca..95d42560fc 100644 --- a/lib/colvars/colvarmodule.cpp +++ b/lib/colvars/colvarmodule.cpp @@ -50,7 +50,7 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) cvm::log("Initializing the collective variables module, version "+ cvm::to_str(COLVARS_VERSION)+".\n"); cvm::log("Please cite Fiorin et al, Mol Phys 2013:\n " - "https://doi.org/10.1080/00268976.2013.813594\n" + "https://dx.doi.org/10.1080/00268976.2013.813594\n" "in any publication based on this calculation.\n"); if (proxy->smp_enabled() == COLVARS_OK) { @@ -80,7 +80,7 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) colvarmodule::rotation::crossing_threshold = 1.0e-02; cv_traj_freq = 100; - restart_out_freq = proxy->restart_frequency(); + restart_out_freq = proxy->default_restart_frequency(); // by default overwrite the existing trajectory file cv_traj_append = false; @@ -91,7 +91,7 @@ colvarmodule::colvarmodule(colvarproxy *proxy_in) colvarmodule * colvarmodule::main() { - return proxy->colvars; + return proxy ? proxy->colvars : NULL; } @@ -245,9 +245,6 @@ int colvarmodule::parse_config(std::string &conf) // Update any necessary proxy data proxy->setup(); - // configuration might have changed, better redo the labels - cv_traj_write_labels = true; - return get_error(); } @@ -265,6 +262,12 @@ int colvarmodule::append_new_config(std::string const &new_conf) } +void colvarmodule::config_changed() +{ + cv_traj_write_labels = true; +} + + int colvarmodule::parse_global_params(std::string const &conf) { // TODO document and then echo this keyword @@ -332,8 +335,13 @@ int colvarmodule::parse_global_params(std::string const &conf) scripting_after_biases, scripting_after_biases); if (use_scripted_forces && !proxy->force_script_defined) { - return cvm::error("User script for scripted colvar forces not found.", - INPUT_ERROR); + if (proxy->simulation_running()) { + return cvm::error("User script for scripted colvar forces not found.", + INPUT_ERROR); + } else { + // Not necessary if we are not applying biases in a real simulation (eg. VMD) + cvm::log("Warning: User script for scripted colvar forces not found."); + } } return cvm::get_error(); @@ -369,6 +377,11 @@ int colvarmodule::parse_colvars(std::string const &conf) colvar_conf = ""; } + if (pos > 0) { + // One or more new variables were added + config_changed(); + } + if (!colvars.size()) { cvm::log("Warning: no collective variables defined.\n"); } @@ -419,6 +432,10 @@ int colvarmodule::parse_biases_type(std::string const &conf, } bias_conf = ""; } + if (conf_saved_pos > 0) { + // One or more new biases were added + config_changed(); + } return COLVARS_OK; } @@ -656,6 +673,7 @@ std::string colvarmodule::read_colvar(std::string const &name) return ss.str(); } + cvm::real colvarmodule::energy_difference(std::string const &bias_name, std::string const &conf) { @@ -672,75 +690,6 @@ cvm::real colvarmodule::energy_difference(std::string const &bias_name, return energy_diff; } -int colvarmodule::bias_current_bin(std::string const &bias_name) -{ - cvm::increase_depth(); - int ret; - colvarbias *b = bias_by_name(bias_name); - - if (b != NULL) { - ret = b->current_bin(); - } else { - cvm::error("Error: bias not found.\n"); - ret = COLVARS_ERROR; - } - - cvm::decrease_depth(); - return ret; -} - -int colvarmodule::bias_bin_num(std::string const &bias_name) -{ - cvm::increase_depth(); - int ret; - colvarbias *b = bias_by_name(bias_name); - - if (b != NULL) { - ret = b->bin_num(); - } else { - cvm::error("Error: bias not found.\n"); - ret = COLVARS_ERROR; - } - - cvm::decrease_depth(); - return ret; -} - -int colvarmodule::bias_bin_count(std::string const &bias_name, size_t bin_index) -{ - cvm::increase_depth(); - int ret; - colvarbias *b = bias_by_name(bias_name); - - if (b != NULL) { - ret = b->bin_count(bin_index); - } else { - cvm::error("Error: bias not found.\n"); - ret = COLVARS_ERROR; - } - - cvm::decrease_depth(); - return ret; -} - -int colvarmodule::bias_share(std::string const &bias_name) -{ - cvm::increase_depth(); - int ret; - colvarbias *b = bias_by_name(bias_name); - - if (b != NULL) { - b->replica_share(); - ret = COLVARS_OK; - } else { - cvm::error("Error: bias not found.\n"); - ret = COLVARS_ERROR; - } - - cvm::decrease_depth(); - return ret; -} - int colvarmodule::calc() { @@ -753,11 +702,6 @@ int colvarmodule::calc() } error_code |= calc_colvars(); - // set biasing forces to zero before biases are calculated and summed over - for (std::vector::iterator cvi = colvars.begin(); - cvi != colvars.end(); cvi++) { - (*cvi)->reset_bias_force(); - } error_code |= calc_biases(); error_code |= update_colvar_forces(); @@ -768,18 +712,46 @@ int colvarmodule::calc() error_code |= write_traj_files(); } - // write restart files, if needed + // write restart files and similar data if (restart_out_freq && (cvm::step_relative() > 0) && ((cvm::step_absolute() % restart_out_freq) == 0) ) { + if (restart_out_name.size()) { // Write restart file, if different from main output error_code |= write_restart_file(restart_out_name); } else { error_code |= write_restart_file(output_prefix()+".colvars.state"); } - write_output_files(); + + cvm::increase_depth(); + for (std::vector::iterator cvi = colvars.begin(); + cvi != colvars.end(); + cvi++) { + // TODO remove this when corrFunc becomes a bias + error_code |= (*cvi)->write_output_files(); + } + for (std::vector::iterator bi = biases.begin(); + bi != biases.end(); + bi++) { + error_code |= (*bi)->write_state_to_replicas(); + } + cvm::decrease_depth(); } + // Write output files for biases, at the specified frequency for each + cvm::increase_depth(); + for (std::vector::iterator bi = biases.begin(); + bi != biases.end(); + bi++) { + if ((*bi)->output_freq > 0) { + if ((cvm::step_relative() > 0) && + ((cvm::step_absolute() % (*bi)->output_freq) == 0) ) { + error_code |= (*bi)->write_output_files(); + } + } + } + cvm::decrease_depth(); + error_code |= end_of_step(); return error_code; @@ -885,6 +857,12 @@ int colvarmodule::calc_biases() if (cvm::debug() && num_biases()) cvm::log("Updating collective variable biases.\n"); + // set biasing forces to zero before biases are calculated and summed over + for (std::vector::iterator cvi = colvars.begin(); + cvi != colvars.end(); cvi++) { + (*cvi)->reset_bias_force(); + } + std::vector::iterator bi; int error_code = COLVARS_OK; @@ -1031,12 +1009,32 @@ int colvarmodule::write_restart_file(std::string const &out_name) return cvm::error("Error: in writing restart file.\n", FILE_ERROR); } proxy->close_output_stream(out_name); + if (cv_traj_os != NULL) { + // Take the opportunity to flush colvars.traj + proxy->flush_output_stream(cv_traj_os); + } return (cvm::get_error() ? COLVARS_ERROR : COLVARS_OK); } +int colvarmodule::write_restart_string(std::string &output) +{ + cvm::log("Saving state to output buffer.\n"); + std::ostringstream os; + if (!write_restart(os)) { + return cvm::error("Error: in writing restart to buffer.\n", FILE_ERROR); + } + output = os.str(); + return COLVARS_OK; +} + + int colvarmodule::write_traj_files() { + if (cvm::debug()) { + cvm::log("colvarmodule::write_traj_files()\n"); + } + if (cv_traj_os == NULL) { if (open_traj_file(cv_traj_name) != COLVARS_OK) { return cvm::get_error(); @@ -1057,14 +1055,11 @@ int colvarmodule::write_traj_files() write_traj(*cv_traj_os); } - if (restart_out_freq && (cv_traj_os != NULL)) { - // flush the trajectory file if we are at the restart frequency - if ( (cvm::step_relative() > 0) && - ((cvm::step_absolute() % restart_out_freq) == 0) ) { - cvm::log("Synchronizing (emptying the buffer of) trajectory file \""+ - cv_traj_name+"\".\n"); - proxy->flush_output_stream(cv_traj_os); - } + if (restart_out_freq && (cv_traj_os != NULL) && + ((cvm::step_absolute() % restart_out_freq) == 0)) { + cvm::log("Synchronizing (emptying the buffer of) trajectory file \""+ + cv_traj_name+"\".\n"); + proxy->flush_output_stream(cv_traj_os); } return (cvm::get_error() ? COLVARS_ERROR : COLVARS_OK); @@ -1182,52 +1177,63 @@ int colvarmodule::reset() reset_index_groups(); + proxy->flush_output_streams(); proxy->reset(); - if (cv_traj_os != NULL) { - // Do not close traj file here, as we might not be done with it yet. - proxy->flush_output_stream(cv_traj_os); - } - return (cvm::get_error() ? COLVARS_ERROR : COLVARS_OK); } int colvarmodule::setup_input() { - std::string restart_in_name(""); - - // read the restart configuration, if available if (proxy->input_prefix().size()) { - // read the restart file - restart_in_name = proxy->input_prefix(); + // Read a state file + std::string restart_in_name(proxy->input_prefix()+ + std::string(".colvars.state")); std::ifstream input_is(restart_in_name.c_str()); if (!input_is.good()) { - // try by adding the suffix + // Try without the suffix input_is.clear(); - restart_in_name = restart_in_name+std::string(".colvars.state"); + restart_in_name = proxy->input_prefix(); input_is.open(restart_in_name.c_str()); } + // Now that the file has been opened, clear this for the next round + proxy->input_prefix().clear(); + if (!input_is.good()) { - cvm::error("Error: in opening input file \""+ - std::string(restart_in_name)+"\".\n", - FILE_ERROR); - return COLVARS_ERROR; + return cvm::error("Error: in opening input state file \""+ + std::string(restart_in_name)+"\".\n", + FILE_ERROR); } else { cvm::log(cvm::line_marker); - cvm::log("Restarting from file \""+restart_in_name+"\".\n"); + cvm::log("Loading state from file \""+restart_in_name+"\".\n"); read_restart(input_is); - if (cvm::get_error() != COLVARS_OK) { - return COLVARS_ERROR; - } else { - proxy->input_prefix().clear(); - } cvm::log(cvm::line_marker); + return cvm::get_error(); } } - return cvm::get_error(); + if (proxy->input_buffer() != NULL) { + // Read a string buffer + char const *buffer = proxy->input_buffer(); + size_t const buffer_size = strlen(proxy->input_buffer()); + // Clear proxy pointer for the next round + proxy->input_buffer() = NULL; + if (buffer_size > 0) { + std::istringstream input_is; + // Replace the buffer of input_is; work around the lack of const in + // pubsetbuf's prototype (which also needs to support output streams) + input_is.rdbuf()->pubsetbuf(const_cast(buffer), buffer_size); + cvm::log(cvm::line_marker); + cvm::log("Loading state from input buffer.\n"); + read_restart(input_is); + cvm::log(cvm::line_marker); + return cvm::get_error(); + } + } + + return COLVARS_OK; } @@ -1277,6 +1283,20 @@ int colvarmodule::setup_output() } +std::string colvarmodule::state_file_prefix(char const *filename) +{ + std::string const filename_str(filename); + std::string const prefix = + filename_str.substr(0, filename_str.find(".colvars.state")); + if (prefix.size() == 0) { + cvm::error("Error: invalid filename/prefix value \""+filename_str+"\".", + INPUT_ERROR); + } + return prefix; +} + + + std::istream & colvarmodule::read_restart(std::istream &is) { bool warn_total_forces = false; @@ -1340,7 +1360,7 @@ std::istream & colvarmodule::read_restart(std::istream &is) std::istream & colvarmodule::read_objects_state(std::istream &is) { - size_t pos = 0; + std::streampos pos = 0; std::string word; while (is.good()) { @@ -1365,7 +1385,7 @@ std::istream & colvarmodule::read_objects_state(std::istream &is) "collective variable \""+(*cvi)->name+"\".\n", INPUT_ERROR); } - if (static_cast(is.tellg()) > pos) break; // found it + if (is.tellg() > pos) break; // found it } cvm::decrease_depth(); @@ -1386,13 +1406,13 @@ std::istream & colvarmodule::read_objects_state(std::istream &is) (*bi)->name+"\".\n", INPUT_ERROR); } - if (static_cast(is.tellg()) > pos) break; // found it + if (is.tellg() > pos) break; // found it } cvm::decrease_depth(); } } - if (static_cast(is.tellg()) == pos) { + if (is.tellg() == pos) { // This block has not been read by any object: discard it and move on // to the next one is >> colvarparse::read_block(word, NULL); @@ -1438,34 +1458,21 @@ int colvarmodule::backup_file(char const *filename) int colvarmodule::write_output_files() { int error_code = COLVARS_OK; - - cvm::increase_depth(); - for (std::vector::iterator cvi = colvars.begin(); - cvi != colvars.end(); - cvi++) { - error_code |= (*cvi)->write_output_files(); - } - cvm::decrease_depth(); - cvm::increase_depth(); for (std::vector::iterator bi = biases.begin(); bi != biases.end(); bi++) { - error_code |= (*bi)->write_output_files(); + // Only write output files if they have not already been written this time step + if ((*bi)->output_freq == 0 || (cvm::step_absolute() % (*bi)->output_freq) != 0) { + error_code |= (*bi)->write_output_files(); + } error_code |= (*bi)->write_state_to_replicas(); } cvm::decrease_depth(); - - if (cv_traj_os != NULL) { - // do not close, there may be another run command - proxy->flush_output_stream(cv_traj_os); - } - return (cvm::get_error() ? COLVARS_ERROR : COLVARS_OK); } - int colvarmodule::read_traj(char const *traj_filename, long traj_read_begin, long traj_read_end) @@ -1581,12 +1588,10 @@ int colvarmodule::open_traj_file(std::string const &file_name) // (re)open trajectory file if (cv_traj_append) { - cvm::log("Appending to colvar trajectory file \""+file_name+ - "\".\n"); + cvm::log("Appending to trajectory file \""+file_name+"\".\n"); cv_traj_os = (cvm::proxy)->output_stream(file_name, std::ios::app); } else { - cvm::log("Writing to colvar trajectory file \""+file_name+ - "\".\n"); + cvm::log("Opening trajectory file \""+file_name+"\".\n"); proxy->backup_file(file_name.c_str()); cv_traj_os = (cvm::proxy)->output_stream(file_name); } @@ -1603,6 +1608,7 @@ int colvarmodule::open_traj_file(std::string const &file_name) int colvarmodule::close_traj_file() { if (cv_traj_os != NULL) { + cvm::log("Closing trajectory file \""+cv_traj_name+"\".\n"); proxy->close_output_stream(cv_traj_name); cv_traj_os = NULL; } @@ -1668,7 +1674,7 @@ std::ostream & colvarmodule::write_traj(std::ostream &os) } -void cvm::log(std::string const &message, int min_log_level) +void colvarmodule::log(std::string const &message, int min_log_level) { if (cvm::log_level() < min_log_level) return; // allow logging when the module is not fully initialized @@ -1681,13 +1687,13 @@ void cvm::log(std::string const &message, int min_log_level) } -void cvm::increase_depth() +void colvarmodule::increase_depth() { (depth())++; } -void cvm::decrease_depth() +void colvarmodule::decrease_depth() { if (depth() > 0) { (depth())--; @@ -1695,7 +1701,7 @@ void cvm::decrease_depth() } -size_t & cvm::depth() +size_t & colvarmodule::depth() { // NOTE: do not call log() or error() here, to avoid recursion colvarmodule *cv = cvm::main(); @@ -1726,16 +1732,19 @@ void colvarmodule::set_error_bits(int code) proxy->smp_unlock(); } + bool colvarmodule::get_error_bit(int code) { return bool(errorCode & code); } + void colvarmodule::clear_error() { proxy->smp_lock(); errorCode = COLVARS_OK; proxy->smp_unlock(); + proxy->clear_error_msgs(); } @@ -1749,9 +1758,7 @@ int colvarmodule::error(std::string const &message, int code) int colvarmodule::fatal_error(std::string const &message) { - set_error_bits(FATAL_ERROR); - proxy->fatal_error(message); - return get_error(); + return error(message, FATAL_ERROR); } @@ -1793,7 +1800,7 @@ int cvm::read_index_file(char const *filename) std::vector *new_index_group = new std::vector(); int atom_number = 1; - size_t pos = is.tellg(); + std::streampos pos = is.tellg(); while ( (is >> atom_number) && (atom_number > 0) ) { new_index_group->push_back(atom_number); pos = is.tellg(); diff --git a/lib/colvars/colvarmodule.h b/lib/colvars/colvarmodule.h index 9346e8e1d6..1cad4195d6 100644 --- a/lib/colvars/colvarmodule.h +++ b/lib/colvars/colvarmodule.h @@ -221,7 +221,6 @@ public: static void clear_error(); - /// Current step number static step_number it; /// Starting step number for this run @@ -371,6 +370,9 @@ public: /// anything that triggers another call int append_new_config(std::string const &conf); + /// Signals to the module object that the configuration has changed + void config_changed(); + private: /// Configuration string read so far by the module (includes comments) @@ -441,6 +443,9 @@ public: /// Write the output restart file std::ostream & write_restart(std::ostream &os); + /// Strips .colvars.state from filename and checks that it is not empty + static std::string state_file_prefix(char const *filename); + /// Open a trajectory file if requested (and leave it open) int open_traj_file(std::string const &file_name); /// Close it (note: currently unused) @@ -459,6 +464,9 @@ public: /// Backup a file before writing it static int backup_file(char const *filename); + /// Write the state into a string + int write_restart_string(std::string &output); + /// Look up a bias by name; returns NULL if not found static colvarbias * bias_by_name(std::string const &name); @@ -479,15 +487,6 @@ public: /// currently works for harmonic (force constant and/or centers) real energy_difference(std::string const &bias_name, std::string const &conf); - /// Give the total number of bins for a given bias. - int bias_bin_num(std::string const &bias_name); - /// Calculate the bin index for a given bias. - int bias_current_bin(std::string const &bias_name); - //// Give the count at a given bin index. - int bias_bin_count(std::string const &bias_name, size_t bin_index); - //// Share among replicas. - int bias_share(std::string const &bias_name); - /// Main worker function int calc(); diff --git a/lib/colvars/colvarparse.cpp b/lib/colvars/colvarparse.cpp index a09d6be9ef..cbe19c1914 100644 --- a/lib/colvars/colvarparse.cpp +++ b/lib/colvars/colvarparse.cpp @@ -853,7 +853,7 @@ colvarparse::read_block::~read_block() std::istream & operator>> (std::istream &is, colvarparse::read_block const &rb) { - size_t start_pos = is.tellg(); + std::streampos start_pos = is.tellg(); std::string read_key, next; if ( !(is >> read_key) || !(read_key == rb.key) || diff --git a/lib/colvars/colvarproxy.cpp b/lib/colvars/colvarproxy.cpp index 63ae07a57c..24f833f857 100644 --- a/lib/colvars/colvarproxy.cpp +++ b/lib/colvars/colvarproxy.cpp @@ -20,11 +20,6 @@ #include #endif -#if defined(NAMD_TCL) || defined(VMDTCL) -#define COLVARS_TCL -#include -#endif - #include "colvarmodule.h" #include "colvarproxy.h" #include "colvarscript.h" @@ -33,8 +28,9 @@ colvarproxy_system::colvarproxy_system() - : angstrom_value(0.) { + angstrom_value = 0.0; + total_force_requested = false; reset_pbc_lattice(); } @@ -67,7 +63,7 @@ bool colvarproxy_system::total_forces_same_step() const inline int round_to_integer(cvm::real x) { - return cvm::floor(x+0.5); + return int(cvm::floor(x+0.5)); } @@ -135,6 +131,14 @@ cvm::rvector colvarproxy_system::position_distance(cvm::atom_pos const &pos1, } +int colvarproxy_system::get_molid(int &) +{ + cvm::error("Error: only VMD allows the use of multiple \"molecules\", " + "i.e. multiple molecular systems.", COLVARS_NOT_IMPLEMENTED); + return -1; +} + + colvarproxy_atoms::colvarproxy_atoms() { @@ -505,144 +509,12 @@ int colvarproxy_script::run_colvar_gradient_callback(std::string const & /* name -colvarproxy_tcl::colvarproxy_tcl() +colvarproxy_io::colvarproxy_io() { - tcl_interp_ = NULL; + input_buffer_ = NULL; } -colvarproxy_tcl::~colvarproxy_tcl() -{ -} - - -void colvarproxy_tcl::init_tcl_pointers() -{ - cvm::error("Error: Tcl support is currently unavailable " - "outside NAMD or VMD.\n", COLVARS_NOT_IMPLEMENTED); -} - - -char const *colvarproxy_tcl::tcl_obj_to_str(unsigned char *obj) -{ -#if defined(COLVARS_TCL) - return Tcl_GetString(reinterpret_cast(obj)); -#else - return NULL; -#endif -} - - -int colvarproxy_tcl::tcl_run_force_callback() -{ -#if defined(COLVARS_TCL) - Tcl_Interp *const tcl_interp = reinterpret_cast(tcl_interp_); - std::string cmd = std::string("calc_colvar_forces ") - + cvm::to_str(cvm::step_absolute()); - int err = Tcl_Eval(tcl_interp, cmd.c_str()); - if (err != TCL_OK) { - cvm::log(std::string("Error while executing calc_colvar_forces:\n")); - cvm::error(Tcl_GetStringResult(tcl_interp)); - return COLVARS_ERROR; - } - return cvm::get_error(); -#else - return COLVARS_NOT_IMPLEMENTED; -#endif -} - - -int colvarproxy_tcl::tcl_run_colvar_callback( - std::string const & name, - std::vector const & cvc_values, - colvarvalue & value) -{ -#if defined(COLVARS_TCL) - - Tcl_Interp *const tcl_interp = reinterpret_cast(tcl_interp_); - size_t i; - std::string cmd = std::string("calc_") + name; - for (i = 0; i < cvc_values.size(); i++) { - cmd += std::string(" {") + (*(cvc_values[i])).to_simple_string() + - std::string("}"); - } - int err = Tcl_Eval(tcl_interp, cmd.c_str()); - const char *result = Tcl_GetStringResult(tcl_interp); - if (err != TCL_OK) { - return cvm::error(std::string("Error while executing ") - + cmd + std::string(":\n") + - std::string(Tcl_GetStringResult(tcl_interp)), COLVARS_ERROR); - } - std::istringstream is(result); - if (value.from_simple_string(is.str()) != COLVARS_OK) { - cvm::log("Error parsing colvar value from script:"); - cvm::error(result); - return COLVARS_ERROR; - } - return cvm::get_error(); - -#else - - return COLVARS_NOT_IMPLEMENTED; - -#endif -} - - -int colvarproxy_tcl::tcl_run_colvar_gradient_callback( - std::string const & name, - std::vector const & cvc_values, - std::vector > & gradient) -{ -#if defined(COLVARS_TCL) - - Tcl_Interp *const tcl_interp = reinterpret_cast(tcl_interp_); - size_t i; - std::string cmd = std::string("calc_") + name + "_gradient"; - for (i = 0; i < cvc_values.size(); i++) { - cmd += std::string(" {") + (*(cvc_values[i])).to_simple_string() + - std::string("}"); - } - int err = Tcl_Eval(tcl_interp, cmd.c_str()); - if (err != TCL_OK) { - return cvm::error(std::string("Error while executing ") - + cmd + std::string(":\n") + - std::string(Tcl_GetStringResult(tcl_interp)), COLVARS_ERROR); - } - Tcl_Obj **list; - int n; - Tcl_ListObjGetElements(tcl_interp, Tcl_GetObjResult(tcl_interp), - &n, &list); - if (n != int(gradient.size())) { - cvm::error("Error parsing list of gradient values from script: found " - + cvm::to_str(n) + " values instead of " + - cvm::to_str(gradient.size())); - return COLVARS_ERROR; - } - for (i = 0; i < gradient.size(); i++) { - std::istringstream is(Tcl_GetString(list[i])); - if (gradient[i].from_simple_string(is.str()) != COLVARS_OK) { - cvm::log("Gradient matrix size: " + cvm::to_str(gradient[i].size())); - cvm::log("Gradient string: " + cvm::to_str(Tcl_GetString(list[i]))); - cvm::error("Error parsing gradient value from script", COLVARS_ERROR); - return COLVARS_ERROR; - } - } - - return cvm::get_error(); - -#else - - return COLVARS_NOT_IMPLEMENTED; - -#endif -} - - - -colvarproxy_io::colvarproxy_io() {} - - colvarproxy_io::~colvarproxy_io() {} @@ -658,78 +530,6 @@ int colvarproxy_io::set_frame(long int) } -std::ostream * colvarproxy_io::output_stream(std::string const &output_name, - std::ios_base::openmode mode) -{ - if (cvm::debug()) { - cvm::log("Using colvarproxy::output_stream()\n"); - } - - std::ostream *os = get_output_stream(output_name); - if (os != NULL) return os; - - if (!(mode & (std::ios_base::app | std::ios_base::ate))) { - backup_file(output_name); - } - std::ofstream *osf = new std::ofstream(output_name.c_str(), mode); - if (!osf->is_open()) { - cvm::error("Error: cannot write to file/channel \""+output_name+"\".\n", - FILE_ERROR); - return NULL; - } - output_stream_names.push_back(output_name); - output_files.push_back(osf); - return osf; -} - - -std::ostream *colvarproxy_io::get_output_stream(std::string const &output_name) -{ - std::list::iterator osi = output_files.begin(); - std::list::iterator osni = output_stream_names.begin(); - for ( ; osi != output_files.end(); osi++, osni++) { - if (*osni == output_name) { - return *osi; - } - } - return NULL; -} - - - -int colvarproxy_io::flush_output_stream(std::ostream *os) -{ - std::list::iterator osi = output_files.begin(); - std::list::iterator osni = output_stream_names.begin(); - for ( ; osi != output_files.end(); osi++, osni++) { - if (*osi == os) { - ((std::ofstream *) (*osi))->flush(); - return COLVARS_OK; - } - } - return cvm::error("Error: trying to flush an output file/channel " - "that wasn't open.\n", BUG_ERROR); -} - - -int colvarproxy_io::close_output_stream(std::string const &output_name) -{ - std::list::iterator osi = output_files.begin(); - std::list::iterator osni = output_stream_names.begin(); - for ( ; osi != output_files.end(); osi++, osni++) { - if (*osni == output_name) { - ((std::ofstream *) (*osi))->close(); - delete *osi; - output_files.erase(osi); - output_stream_names.erase(osni); - return COLVARS_OK; - } - } - return cvm::error("Error: trying to close an output file/channel " - "that wasn't open.\n", BUG_ERROR); -} - - int colvarproxy_io::backup_file(char const * /* filename */) { // TODO implement this using rename_file() @@ -796,11 +596,33 @@ colvarproxy::colvarproxy() { colvars = NULL; b_simulation_running = true; + b_simulation_continuing = false; b_delete_requested = false; } -colvarproxy::~colvarproxy() {} +colvarproxy::~colvarproxy() +{ + close_files(); +} + + +int colvarproxy::close_files() +{ + if (smp_enabled() == COLVARS_OK && smp_thread_id() > 0) { + // Nothing to do on non-master threads + return COLVARS_OK; + } + std::list::iterator osni = output_stream_names.begin(); + std::list::iterator osi = output_files.begin(); + for ( ; osi != output_files.end(); osi++, osni++) { + ((std::ofstream *) (*osi))->close(); + delete *osi; + } + output_files.clear(); + output_stream_names.clear(); + return COLVARS_OK; +} int colvarproxy::reset() @@ -838,9 +660,37 @@ int colvarproxy::update_output() } -size_t colvarproxy::restart_frequency() +int colvarproxy::post_run() { - return 0; + int error_code = COLVARS_OK; + if (colvars->output_prefix().size()) { + error_code |= colvars->write_restart_file(cvm::output_prefix()+".colvars.state"); + error_code |= colvars->write_output_files(); + } + error_code |= flush_output_streams(); + return error_code; +} + + +void colvarproxy::add_error_msg(std::string const &message) +{ + std::istringstream is(message); + std::string line; + while (std::getline(is, line)) { + error_output += line+"\n"; + } +} + + +void colvarproxy::clear_error_msgs() +{ + error_output.clear(); +} + + +std::string const & colvarproxy::get_error_msgs() +{ + return error_output; } @@ -852,3 +702,105 @@ int colvarproxy::get_version_from_string(char const *version_string) is >> newint; return newint; } + + +void colvarproxy::smp_stream_error() +{ + cvm::error("Error: trying to access an output stream from a " + "multi-threaded region (bug). For a quick workaround, use " + "\"smp off\" in the Colvars config.\n", BUG_ERROR); +} + + +std::ostream * colvarproxy::output_stream(std::string const &output_name, + std::ios_base::openmode mode) +{ + if (cvm::debug()) { + cvm::log("Using colvarproxy::output_stream()\n"); + } + + std::ostream *os = get_output_stream(output_name); + if (os != NULL) return os; + + if (!(mode & (std::ios_base::app | std::ios_base::ate))) { + backup_file(output_name); + } + std::ofstream *osf = new std::ofstream(output_name.c_str(), mode); + if (!osf->is_open()) { + cvm::error("Error: cannot write to file/channel \""+output_name+"\".\n", + FILE_ERROR); + return NULL; + } + output_stream_names.push_back(output_name); + output_files.push_back(osf); + return osf; +} + + +std::ostream *colvarproxy::get_output_stream(std::string const &output_name) +{ + if (smp_enabled() == COLVARS_OK) { + if (smp_thread_id() > 0) smp_stream_error(); + } + std::list::iterator osi = output_files.begin(); + std::list::iterator osni = output_stream_names.begin(); + for ( ; osi != output_files.end(); osi++, osni++) { + if (*osni == output_name) { + return *osi; + } + } + return NULL; +} + + + +int colvarproxy::flush_output_stream(std::ostream *os) +{ + if (smp_enabled() == COLVARS_OK) { + if (smp_thread_id() > 0) smp_stream_error(); + } + std::list::iterator osi = output_files.begin(); + std::list::iterator osni = output_stream_names.begin(); + for ( ; osi != output_files.end(); osi++, osni++) { + if (*osi == os) { + ((std::ofstream *) (*osi))->flush(); + return COLVARS_OK; + } + } + return cvm::error("Error: trying to flush an output file/channel " + "that wasn't open.\n", BUG_ERROR); +} + + +int colvarproxy::flush_output_streams() +{ + if (smp_enabled() == COLVARS_OK && smp_thread_id() > 0) + return COLVARS_OK; + + std::list::iterator osi = output_files.begin(); + for ( ; osi != output_files.end(); osi++) { + ((std::ofstream *) (*osi))->flush(); + } + return COLVARS_OK; +} + + +int colvarproxy::close_output_stream(std::string const &output_name) +{ + if (smp_enabled() == COLVARS_OK) { + if (smp_thread_id() > 0) smp_stream_error(); + } + std::list::iterator osi = output_files.begin(); + std::list::iterator osni = output_stream_names.begin(); + for ( ; osi != output_files.end(); osi++, osni++) { + if (*osni == output_name) { + ((std::ofstream *) (*osi))->close(); + delete *osi; + output_files.erase(osi); + output_stream_names.erase(osni); + return COLVARS_OK; + } + } + return cvm::error("Error: trying to close an output file/channel " + "that wasn't open.\n", BUG_ERROR); +} diff --git a/lib/colvars/colvarproxy.h b/lib/colvars/colvarproxy.h index ba91afb40e..7a60292092 100644 --- a/lib/colvars/colvarproxy.h +++ b/lib/colvars/colvarproxy.h @@ -16,7 +16,8 @@ #include "colvarmodule.h" #include "colvartypes.h" #include "colvarvalue.h" - +#include "colvarproxy_tcl.h" +#include "colvarproxy_volmaps.h" /// \file colvarproxy.h /// \brief Colvars proxy classes @@ -29,7 +30,7 @@ /// /// To interface to a new MD engine, the simplest solution is to derive a new /// class from \link colvarproxy \endlink. Currently implemented are: \link -/// colvarproxy_lammps \endlink, \link colvarproxy_namd \endlink, \link +/// colvarproxy_lammps, \endlink, \link colvarproxy_namd, \endlink, \link /// colvarproxy_vmd \endlink. @@ -121,8 +122,15 @@ public: /// Are total forces from the current step available? virtual bool total_forces_same_step() const; + /// Get the molecule ID when called in VMD; raise error otherwise + /// \param molid Set this argument equal to the current VMD molid + virtual int get_molid(int &molid); + protected: + /// Whether the total forces have been requested + bool total_force_requested; + /// \brief Type of boundary conditions /// /// Orthogonal and triclinic cells are made available to objects. @@ -542,46 +550,6 @@ public: }; -/// Methods for using Tcl within Colvars -class colvarproxy_tcl { - -public: - - /// Constructor - colvarproxy_tcl(); - - /// Destructor - virtual ~colvarproxy_tcl(); - - /// Is Tcl available? (trigger initialization if needed) - int tcl_available(); - - /// Tcl implementation of script_obj_to_str() - char const *tcl_obj_to_str(unsigned char *obj); - - /// Run a user-defined colvar forces script - int tcl_run_force_callback(); - - int tcl_run_colvar_callback( - std::string const &name, - std::vector const &cvcs, - colvarvalue &value); - - int tcl_run_colvar_gradient_callback( - std::string const &name, - std::vector const &cvcs, - std::vector > &gradient); - -protected: - - /// Pointer to Tcl interpreter object - void *tcl_interp_; - - /// Set Tcl pointers - virtual void init_tcl_pointers(); -}; - - /// Methods for data input/output class colvarproxy_io { @@ -601,21 +569,6 @@ public: // Returns error code virtual int set_frame(long int); - /// \brief Returns a reference to the given output channel; - /// if this is not open already, then open it - virtual std::ostream *output_stream(std::string const &output_name, - std::ios_base::openmode mode = - std::ios_base::out); - - /// Returns a reference to output_name if it exists, NULL otherwise - virtual std::ostream *get_output_stream(std::string const &output_name); - - /// \brief Flushes the given output channel - virtual int flush_output_stream(std::ostream *os); - - /// \brief Closes the given output channel - virtual int close_output_stream(std::string const &output_name); - /// \brief Rename the given file, before overwriting it virtual int backup_file(char const *filename); @@ -644,30 +597,49 @@ public: return rename_file(filename.c_str(), newfilename.c_str()); } - /// \brief Prefix of the input state file + /// Prefix of the input state file to be read next inline std::string & input_prefix() { return input_prefix_str; } - /// \brief Prefix to be used for output restart files - inline std::string & restart_output_prefix() - { - return restart_output_prefix_str; - } - - /// \brief Prefix to be used for output files (final system - /// configuration) + /// Default prefix to be used for all output files (final configuration) inline std::string & output_prefix() { return output_prefix_str; } + /// Prefix of the restart (checkpoint) file to be written next + inline std::string & restart_output_prefix() + { + return restart_output_prefix_str; + } + + /// Default restart frequency (as set by the simulation engine) + inline int default_restart_frequency() const + { + return restart_frequency_engine; + } + + /// Buffer from which the input state information may be read + inline char const * & input_buffer() + { + return input_buffer_; + } + protected: - /// \brief Prefix to be used for input files (restarts, not - /// configuration) - std::string input_prefix_str, output_prefix_str, restart_output_prefix_str; + /// Prefix of the input state file to be read next + std::string input_prefix_str; + + /// Default prefix to be used for all output files (final configuration) + std::string output_prefix_str; + + /// Prefix of the restart (checkpoint) file to be written next + std::string restart_output_prefix_str; + + /// How often the simulation engine will write its own restart + int restart_frequency_engine; /// \brief Currently opened output files: by default, these are ofstream objects. /// Allows redefinition to implement different output mechanisms @@ -675,6 +647,8 @@ protected: /// \brief Identifiers for output_stream objects: by default, these are the names of the files std::list output_stream_names; + /// Buffer from which the input state information may be read + char const *input_buffer_; }; @@ -687,6 +661,7 @@ class colvarproxy : public colvarproxy_system, public colvarproxy_atoms, public colvarproxy_atom_groups, + public colvarproxy_volmaps, public colvarproxy_smp, public colvarproxy_replicas, public colvarproxy_script, @@ -717,6 +692,9 @@ public: /// \brief Reset proxy state, e.g. requested atoms virtual int reset(); + /// Close any open files to prevent data loss + int close_files(); + /// (Re)initialize required member data after construction virtual int setup(); @@ -731,14 +709,17 @@ public: /// Print a message to the main log virtual void log(std::string const &message) = 0; - /// Print a message to the main log and let the rest of the program handle the error + /// Print a message to the main log and/or let the host code know about it virtual void error(std::string const &message) = 0; - /// Print a message to the main log and exit with error code - virtual void fatal_error(std::string const &message) = 0; + /// Record error message (used by VMD to collect them after a script call) + void add_error_msg(std::string const &message); - /// \brief Restarts will be written each time this number of steps has passed - virtual size_t restart_frequency(); + /// Retrieve accumulated error messages + std::string const & get_error_msgs(); + + /// As the name says + void clear_error_msgs(); /// Whether a simulation is running (warn against irrecovarable errors) inline bool simulation_running() const @@ -746,6 +727,17 @@ public: return b_simulation_running; } + /// Is the current step a repetition of a step just executed? + /// This is set to true when the step 0 of a new "run" command is being + /// executed, regardless of whether a state file has been loaded. + inline bool simulation_continuing() const + { + return b_simulation_continuing; + } + + /// Called at the end of a simulation segment (i.e. "run" command) + int post_run(); + /// Convert a version string "YYYY-MM-DD" into an integer int get_version_from_string(char const *version_string); @@ -755,17 +747,46 @@ public: return version_int; } + /// \brief Returns a reference to the given output channel; + /// if this is not open already, then open it + virtual std::ostream *output_stream(std::string const &output_name, + std::ios_base::openmode mode = + std::ios_base::out); + + /// Returns a reference to output_name if it exists, NULL otherwise + virtual std::ostream *get_output_stream(std::string const &output_name); + + /// \brief Flushes the given output channel + virtual int flush_output_stream(std::ostream *os); + + /// \brief Flushes all output channels + virtual int flush_output_streams(); + + /// \brief Closes the given output channel + virtual int close_output_stream(std::string const &output_name); + protected: + /// Collected error messages + std::string error_output; + /// Whether a simulation is running (warn against irrecovarable errors) bool b_simulation_running; + /// Is the current step a repetition of a step just executed? + /// This is set to true when the step 0 of a new "run" command is being + /// executed, regardless of whether a state file has been loaded. + bool b_simulation_continuing; + /// Whether the entire module should be deallocated by the host engine bool b_delete_requested; /// Integer representing the version string (allows comparisons) int version_int; + /// Raise when the output stream functions are used on threads other than 0 + void smp_stream_error(); + }; diff --git a/lib/colvars/colvarproxy_tcl.cpp b/lib/colvars/colvarproxy_tcl.cpp new file mode 100644 index 0000000000..a799bead7d --- /dev/null +++ b/lib/colvars/colvarproxy_tcl.cpp @@ -0,0 +1,160 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + +#include + +#if defined(NAMD_TCL) || defined(VMDTCL) +#define COLVARS_TCL +#include +#endif + +#include "colvarmodule.h" +#include "colvarproxy.h" +#include "colvarproxy_tcl.h" +#include "colvaratoms.h" + + + +colvarproxy_tcl::colvarproxy_tcl() +{ + tcl_interp_ = NULL; +} + + +colvarproxy_tcl::~colvarproxy_tcl() +{ +} + + +void colvarproxy_tcl::init_tcl_pointers() +{ + cvm::error("Error: Tcl support is not available in this build.\n", + COLVARS_NOT_IMPLEMENTED); +} + + +char const *colvarproxy_tcl::tcl_get_str(void *obj) +{ +#if defined(COLVARS_TCL) + return Tcl_GetString(reinterpret_cast(obj)); +#else + return NULL; +#endif +} + + +int colvarproxy_tcl::tcl_run_force_callback() +{ +#if defined(COLVARS_TCL) + Tcl_Interp *const tcl_interp = + reinterpret_cast(get_tcl_interp()); + std::string cmd = std::string("calc_colvar_forces ") + + cvm::to_str(cvm::step_absolute()); + int err = Tcl_Eval(tcl_interp, cmd.c_str()); + if (err != TCL_OK) { + cvm::log(std::string("Error while executing calc_colvar_forces:\n")); + cvm::error(Tcl_GetStringResult(tcl_interp)); + return COLVARS_ERROR; + } + return cvm::get_error(); +#else + return COLVARS_NOT_IMPLEMENTED; +#endif +} + + +int colvarproxy_tcl::tcl_run_colvar_callback( + std::string const &name, + std::vector const &cvc_values, + colvarvalue &value) +{ +#if defined(COLVARS_TCL) + + Tcl_Interp *const tcl_interp = + reinterpret_cast(get_tcl_interp()); + size_t i; + std::string cmd = std::string("calc_") + name; + for (i = 0; i < cvc_values.size(); i++) { + cmd += std::string(" {") + (*(cvc_values[i])).to_simple_string() + + std::string("}"); + } + int err = Tcl_Eval(tcl_interp, cmd.c_str()); + const char *result = Tcl_GetStringResult(tcl_interp); + if (err != TCL_OK) { + return cvm::error(std::string("Error while executing ") + + cmd + std::string(":\n") + + std::string(Tcl_GetStringResult(tcl_interp)), + COLVARS_ERROR); + } + std::istringstream is(result); + if (value.from_simple_string(is.str()) != COLVARS_OK) { + cvm::log("Error parsing colvar value from script:"); + cvm::error(result); + return COLVARS_ERROR; + } + return cvm::get_error(); + +#else + + return COLVARS_NOT_IMPLEMENTED; + +#endif +} + + +int colvarproxy_tcl::tcl_run_colvar_gradient_callback( + std::string const &name, + std::vector const &cvc_values, + std::vector > &gradient) +{ +#if defined(COLVARS_TCL) + + Tcl_Interp *const tcl_interp = + reinterpret_cast(get_tcl_interp()); + size_t i; + std::string cmd = std::string("calc_") + name + "_gradient"; + for (i = 0; i < cvc_values.size(); i++) { + cmd += std::string(" {") + (*(cvc_values[i])).to_simple_string() + + std::string("}"); + } + int err = Tcl_Eval(tcl_interp, cmd.c_str()); + if (err != TCL_OK) { + return cvm::error(std::string("Error while executing ") + + cmd + std::string(":\n") + + std::string(Tcl_GetStringResult(tcl_interp)), + COLVARS_ERROR); + } + Tcl_Obj **list; + int n; + Tcl_ListObjGetElements(tcl_interp, Tcl_GetObjResult(tcl_interp), + &n, &list); + if (n != int(gradient.size())) { + cvm::error("Error parsing list of gradient values from script: found " + + cvm::to_str(n) + " values instead of " + + cvm::to_str(gradient.size())); + return COLVARS_ERROR; + } + for (i = 0; i < gradient.size(); i++) { + std::istringstream is(Tcl_GetString(list[i])); + if (gradient[i].from_simple_string(is.str()) != COLVARS_OK) { + cvm::log("Gradient matrix size: " + cvm::to_str(gradient[i].size())); + cvm::log("Gradient string: " + cvm::to_str(Tcl_GetString(list[i]))); + cvm::error("Error parsing gradient value from script", COLVARS_ERROR); + return COLVARS_ERROR; + } + } + + return cvm::get_error(); + +#else + + return COLVARS_NOT_IMPLEMENTED; + +#endif +} diff --git a/lib/colvars/colvarproxy_tcl.h b/lib/colvars/colvarproxy_tcl.h new file mode 100644 index 0000000000..371b3c0224 --- /dev/null +++ b/lib/colvars/colvarproxy_tcl.h @@ -0,0 +1,64 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + +#ifndef COLVARPROXY_TCL_H +#define COLVARPROXY_TCL_H + +#include + + +/// Methods for using Tcl within Colvars +class colvarproxy_tcl { + +public: + + /// Constructor + colvarproxy_tcl(); + + /// Destructor + virtual ~colvarproxy_tcl(); + + /// Is Tcl available? (trigger initialization if needed) + int tcl_available(); + + /// Tcl implementation of script_obj_to_str() + char const *tcl_get_str(void *obj); + + /// Tcl implementation of run_force_callback() + int tcl_run_force_callback(); + + /// Tcl implementation of run_colvar_callback() + int tcl_run_colvar_callback( + std::string const &name, + std::vector const &cvcs, + colvarvalue &value); + + /// Tcl implementation of run_colvar_gradient_callback() + int tcl_run_colvar_gradient_callback( + std::string const &name, + std::vector const &cvcs, + std::vector > &gradient); + + /// Get a pointer to the Tcl interpreter + inline void *get_tcl_interp() + { + return tcl_interp_; + } + +protected: + + /// Pointer to Tcl interpreter object + void *tcl_interp_; + + /// Set Tcl pointers + virtual void init_tcl_pointers(); +}; + + +#endif diff --git a/lib/colvars/colvarproxy_volmaps.cpp b/lib/colvars/colvarproxy_volmaps.cpp new file mode 100644 index 0000000000..fc665eec99 --- /dev/null +++ b/lib/colvars/colvarproxy_volmaps.cpp @@ -0,0 +1,81 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + +#include "colvarmodule.h" +#include "colvarproxy_volmaps.h" + + +colvarproxy_volmaps::colvarproxy_volmaps() {} + + +colvarproxy_volmaps::~colvarproxy_volmaps() {} + + +int colvarproxy_volmaps::volmaps_available() +{ + return COLVARS_NOT_IMPLEMENTED; +} + + +int colvarproxy_volmaps::reset() +{ + for (size_t i = 0; i < volmaps_ids.size(); i++) { + clear_volmap(i); + } + volmaps_ids.clear(); + volmaps_ncopies.clear(); + volmaps_values.clear(); + volmaps_new_colvar_forces.clear(); + return COLVARS_OK; +} + + +int colvarproxy_volmaps::add_volmap_slot(int volmap_id) +{ + volmaps_ids.push_back(volmap_id); + volmaps_ncopies.push_back(1); + volmaps_values.push_back(0.0); + volmaps_new_colvar_forces.push_back(0.0); + return (volmaps_ids.size() - 1); +} + + +int colvarproxy_volmaps::init_volmap(int volmap_id) +{ + return cvm::error("Error: access to volumetric maps is unavailable " + "in this build.\n", + COLVARS_NOT_IMPLEMENTED); +} + + +int colvarproxy_volmaps::init_volmap(const char *volmap_name) +{ + return cvm::error("Error: access to volumetric maps is unavailable " + "in this build.\n", + COLVARS_NOT_IMPLEMENTED); +} + + +int colvarproxy_volmaps::init_volmap(const std::string &volmap_name) +{ + return init_volmap(volmap_name.c_str()); +} + + +void colvarproxy_volmaps::clear_volmap(int index) +{ + if (((size_t) index) >= volmaps_ids.size()) { + cvm::error("Error: trying to unrequest a volumetric map that was not " + "previously requested.\n", INPUT_ERROR); + } + + if (volmaps_ncopies[index] > 0) { + volmaps_ncopies[index] -= 1; + } +} diff --git a/lib/colvars/colvarproxy_volmaps.h b/lib/colvars/colvarproxy_volmaps.h new file mode 100644 index 0000000000..67cbb2cd2d --- /dev/null +++ b/lib/colvars/colvarproxy_volmaps.h @@ -0,0 +1,76 @@ +// -*- c++ -*- + +#ifndef COLVARPROXY_VOLMAPS_H +#define COLVARPROXY_VOLMAPS_H + + +/// \brief Container of grid-based objects +class colvarproxy_volmaps { + +public: + + /// Contructor + colvarproxy_volmaps(); + + /// Destructor + virtual ~colvarproxy_volmaps(); + + /// Clear volumetric map data + int reset(); + + /// \brief Whether this implementation has capability to use volumetric maps + virtual int volmaps_available(); + + /// Create a slot for a volumetric map not requested yet + int add_volmap_slot(int volmap_id); + + /// Request and prepare this volumetric map for use by Colvars + virtual int init_volmap(int volmap_id); + + /// Request and prepare this volumetric map for use by Colvars + virtual int init_volmap(char const *volmap_name); + + /// Request and prepare this volumetric map for use by Colvars + int init_volmap(std::string const &volmap_name); + + /// \brief Used by the CVC destructors + virtual void clear_volmap(int index); + + /// Get the numeric ID of the given volumetric map (for the MD program) + inline int get_volmap_id(int index) const + { + return volmaps_ids[index]; + } + + /// Read the current value of the volumetric map + inline cvm::real get_volmap_value(int index) const + { + return volmaps_values[index]; + } + + /// Request that this force is applied to the given volumetric map + inline void apply_volmap_force(int index, cvm::real const &new_force) + { + volmaps_new_colvar_forces[index] += new_force; + } + + +protected: + + /// \brief Array of numeric IDs of volumetric maps + std::vector volmaps_ids; + + /// \brief Keep track of how many times each vol map is used by a + /// separate colvar object + std::vector volmaps_ncopies; + + /// \brief Current values of the vol maps + std::vector volmaps_values; + + /// \brief Forces applied from colvars, to be communicated to the MD + /// integrator + std::vector volmaps_new_colvar_forces; +}; + + +#endif diff --git a/lib/colvars/colvars_version.h b/lib/colvars/colvars_version.h index cc8744d62b..33e05d72d1 100644 --- a/lib/colvars/colvars_version.h +++ b/lib/colvars/colvars_version.h @@ -1,3 +1,3 @@ #ifndef COLVARS_VERSION -#define COLVARS_VERSION "2020-02-25" +#define COLVARS_VERSION "2020-09-17" #endif diff --git a/lib/colvars/colvarscript.cpp b/lib/colvars/colvarscript.cpp index 10b276c89e..ebd52b10ad 100644 --- a/lib/colvars/colvarscript.cpp +++ b/lib/colvars/colvarscript.cpp @@ -9,58 +9,239 @@ #include #include +#include -#define COLVARSCRIPT_CPP -#include "colvarscript.h" -#undef COLVARSCRIPT_CPP +#if defined(NAMD_TCL) || defined(VMDTCL) +#define COLVARS_TCL +#include +#endif #include "colvarproxy.h" #include "colvardeps.h" +#include "colvarscript.h" +#include "colvarscript_commands.h" + colvarscript::colvarscript(colvarproxy *p) - : proxy(p), + : proxy_(p), colvars(p->colvars), proxy_error(0) { - comm_help.resize(colvarscript::cv_n_commands); - comm_fns.resize(colvarscript::cv_n_commands); -#define COLVARSCRIPT_INIT_FN -#include "colvarscript.h" -#undef COLVARSCRIPT_INIT_FN + cmd_names = NULL; + init_commands(); +#ifdef COLVARS_TCL + // TODO put this in backend functions so we don't have to delete + Tcl_Interp *interp = reinterpret_cast(proxy_->get_tcl_interp()); + Tcl_DeleteCommand(interp, "cv"); + Tcl_CreateObjCommand(interp, "cv", tcl_run_colvarscript_command, + (ClientData) this, (Tcl_CmdDeleteProc *) NULL); + cvm::log("Redefining the Tcl \"cv\" command to the new script interface."); +#endif } -extern "C" { - - // Generic hooks; NAMD and VMD have Tcl-specific versions in the respective proxies - - int run_colvarscript_command(int objc, unsigned char *const objv[]) - { - colvarproxy *cvp = cvm::proxy; - if (!cvp) { - return -1; - } - if (!cvp->script) { - cvm::error("Called run_colvarscript_command without a script object initialized.\n"); - return -1; - } - return cvp->script->run(objc, objv); - } - - const char * get_colvarscript_result() - { - colvarproxy *cvp = cvm::proxy; - if (!cvp->script) { - cvm::error("Called run_colvarscript_command without a script object initialized.\n"); - return ""; - } - return cvp->script->result.c_str(); +colvarscript::~colvarscript() +{ + if (cmd_names) { + delete [] cmd_names; + cmd_names = NULL; } } -/// Run method based on given arguments +int colvarscript::init_commands() +{ + if (cvm::debug()) { + cvm::log("Called colvarcript::init_commands()\n"); + } + + cmd_help.resize(colvarscript::cv_n_commands); + cmd_n_args_min.resize(colvarscript::cv_n_commands); + cmd_n_args_max.resize(colvarscript::cv_n_commands); + cmd_arghelp.resize(colvarscript::cv_n_commands); + cmd_fns.resize(colvarscript::cv_n_commands); + + if (cmd_names) { + delete [] cmd_names; + cmd_names = NULL; + } + cmd_names = new char const * [colvarscript::cv_n_commands]; + +#undef COLVARSCRIPT_COMMANDS_H // disable include guard +#if defined(CVSCRIPT) +#undef CVSCRIPT // disable default macro +#endif +#define CVSCRIPT_COMM_INIT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGHELP) { \ + init_command(COMM,#COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGHELP,&(CVSCRIPT_COMM_FNAME(COMM))); \ + } +#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + CVSCRIPT_COMM_INIT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS) + +#include "colvarscript_commands.h" + +#undef CVSCRIPT_COMM_INIT +#undef CVSCRIPT + + return COLVARS_OK; +} + + +int colvarscript::init_command(colvarscript::command const &comm, + char const *name, char const *help, + int n_args_min, int n_args_max, + char const *arghelp, + int (*fn)(void *, int, unsigned char * const *)) +{ + cmd_str_map[std::string(name)] = comm; + cmd_names[comm] = name; + cmd_help[comm] = help; + cmd_n_args_min[comm] = n_args_min; + cmd_n_args_max[comm] = n_args_max; + std::string const arghelp_str(arghelp); + std::istringstream is(arghelp_str); + std::string line; + for (int iarg = 0; iarg < n_args_max; iarg++) { + if (! std::getline(is, line)) { + return cvm::error("Error: could not initialize help string for scripting " + "command \""+std::string(name)+"\".\n", BUG_ERROR); + } + cmd_arghelp[comm].push_back(line); + } + cmd_fns[comm] = fn; + if (cvm::debug()) { + cvm::log("Defined command \""+std::string(name)+"\", with help string:\n"); + cvm::log(get_command_help(name)); + } + return COLVARS_OK; +} + + +std::string colvarscript::get_cmd_prefix(colvarscript::Object_type t) +{ + switch (t) { + case use_module: + return std::string("cv_"); break; + case use_colvar: + return std::string("colvar_"); break; + case use_bias: + return std::string("bias_"); break; + default: + cvm::error("Error: undefined colvarscript object type.", BUG_ERROR); + return std::string(""); + } +} + + +std::string colvarscript::get_command_help(char const *cmd) +{ + if (cmd_str_map.count(cmd) > 0) { + colvarscript::command const c = cmd_str_map[std::string(cmd)]; + std::string new_result(cmd_help[c]+"\n"); + if (cmd_n_args_max[c] == 0) return new_result; + new_result += "\nParameters\n"; + new_result += "----------\n\n"; + size_t i; + for (i = 0; i < cmd_n_args_min[c]; i++) { + new_result += cmd_arghelp[c][i]+"\n"; + } + for (i = cmd_n_args_min[c]; i < cmd_n_args_max[c]; i++) { + new_result += cmd_arghelp[c][i]+" (optional)\n"; + } + return new_result; + } + + cvm::error("Error: command "+std::string(cmd)+ + " is not implemented.\n", INPUT_ERROR); + return std::string(""); +} + + +std::string colvarscript::get_command_cmdline_syntax(colvarscript::Object_type t, + colvarscript::command cmd) +{ + std::string const prefix = get_cmd_prefix(t); + std::string const cmdstr(cmd_names[cmd]); + + // Get the sub-command as used in the command line + std::string const cmdline_cmd(cmdstr, prefix.size()); + std::string cmdline_args; + + size_t i; + for (i = 0; i < cmd_n_args_min[cmd]; i++) { + std::string const &arghelp = cmd_arghelp[cmd][i]; + size_t space = arghelp.find(" : "); + cmdline_args += " <"+cmd_arghelp[cmd][i].substr(0, space)+">"; + } + for (i = cmd_n_args_min[cmd]; i < cmd_n_args_max[cmd]; i++) { + std::string const &arghelp = cmd_arghelp[cmd][i]; + size_t space = arghelp.find(" : "); + cmdline_args += " ["+cmd_arghelp[cmd][i].substr(0, space)+"]"; + } + + switch (t) { + case use_module: + return std::string("cv "+cmdline_cmd+cmdline_args); break; + case use_colvar: + return std::string("cv colvar name "+cmdline_cmd+cmdline_args); break; + case use_bias: + return std::string("cv bias name "+cmdline_cmd+cmdline_args); break; + default: + // Already handled, but silence the warning + return std::string(""); + } + + return std::string(""); +} + + +std::string colvarscript::get_cmdline_help_summary(colvarscript::Object_type t) +{ + std::string output; + output += "List of commands:\n\n"; + + for (size_t i = 0; i < cmd_help.size(); i++) { + std::string const prefix = get_cmd_prefix(t); + command const c = cmd_str_map[std::string(cmd_names[i])]; + if (std::string(cmd_names[i], prefix.size()) == prefix) { + output += get_command_cmdline_syntax(t, c)+std::string("\n"); + } + } + if (t == use_module) { + output += "\nFor detailed help on each command use:\n" + " cv help \n"; + output += "\nTo list all commands acting on collective variables use:\n" + " cv help colvar\n"; + output += "\nTo list all commands acting on biases use:\n" + " cv help bias\n"; + } + if (t == use_colvar) { + output += "\nFor detailed help on each command use:\n" + " cv colvar name help (\"name\" does not need to exist)\n"; + } + if (t == use_bias) { + output += "\nFor detailed help on each command use:\n" + " cv bias name help (\"name\" does not need to exist)\n"; + } + return output; +} + + +std::string colvarscript::get_command_cmdline_help(colvarscript::Object_type t, + std::string const &cmd) +{ + std::string const cmdkey(get_cmd_prefix(t)+cmd); + if (cmd_str_map.count(cmdkey) > 0) { + command const c = cmd_str_map[cmdkey]; + return get_command_cmdline_syntax(t, c)+"\n\n"+ + get_command_help(cmd_names[c]); + } + cvm::error("Error: could not find scripting command \""+cmd+"\".", + INPUT_ERROR); + return std::string(""); +} + + int colvarscript::run(int objc, unsigned char *const objv[]) { result.clear(); @@ -73,497 +254,114 @@ int colvarscript::run(int objc, unsigned char *const objv[]) } if (objc < 2) { - set_str_result("No commands given: use \"cv help\" " + set_result_str("No commands given: use \"cv help\" " "for a list of commands."); return COLVARSCRIPT_ERROR; } + // Main command; usually "cv" + std::string const main_cmd(std::string(obj_to_str(objv[0]))); + + // Name of the (sub)command std::string const cmd(obj_to_str(objv[1])); + // Build a safe-to-print command line to print in case of error + std::string cmdline(main_cmd+std::string(" ")+cmd); + + // Pointer to the function implementing it + int (*cmd_fn)(void *, int, unsigned char * const *) = NULL; + + // Pointer to object handling the command (the functions are C) + void *obj_for_cmd = NULL; + + if (cmd == "colvar") { + + if (objc < 4) { + add_error_msg("Missing parameters: use \""+main_cmd+ + " help colvar\" for a summary"); + return COLVARSCRIPT_ERROR; + } + std::string const name(obj_to_str(objv[2])); + std::string const subcmd(obj_to_str(objv[3])); + obj_for_cmd = reinterpret_cast(cvm::colvar_by_name(name)); + if (obj_for_cmd == NULL) { + if (subcmd != std::string("help")) { + // Unless asking for help, a valid colvar name must be given + add_error_msg("Colvar not found: " + name); + return COLVARSCRIPT_ERROR; + } + } + cmd_fn = get_cmd_fn(get_cmd_prefix(use_colvar)+subcmd); + cmdline += std::string(" name ")+subcmd; + if (objc > 4) { + cmdline += " ..."; + } + + } else if (cmd == "bias") { + + if (objc < 4) { + add_error_msg("Missing parameters: use \""+main_cmd+ + " help bias\" for a summary"); + return COLVARSCRIPT_ERROR; + } + std::string const name(obj_to_str(objv[2])); + std::string const subcmd(obj_to_str(objv[3])); + obj_for_cmd = reinterpret_cast(cvm::bias_by_name(name)); + if (obj_for_cmd == NULL) { + if ((subcmd == "") || (subcmd != std::string("help"))) { + // Unless asking for help, a valid bias name must be given + add_error_msg("Bias not found: " + name); + return COLVARSCRIPT_ERROR; + } + } + cmd_fn = get_cmd_fn(get_cmd_prefix(use_bias)+subcmd); + cmdline += std::string(" name ")+subcmd; + if (objc > 4) { + cmdline += " ..."; + } + + } else { + + cmd_fn = get_cmd_fn(get_cmd_prefix(use_module)+cmd); + obj_for_cmd = reinterpret_cast(this); + + if (objc > 2) { + cmdline += " ..."; + } + } + int error_code = COLVARS_OK; - // If command is found in map, execute it - std::string const cmd_key("cv_"+cmd); - if (comm_str_map.count(cmd_key) > 0) { - error_code |= (*(comm_fns[comm_str_map[cmd_key]]))( - reinterpret_cast(this), objc, objv); - return error_code; + // If command was found in map, execute it + if (cmd_fn) { + error_code = (*cmd_fn)(obj_for_cmd, objc, objv); + } else { + add_error_msg("Syntax error: "+cmdline+"\n" + " Run \"cv help\" or \"cv help \" " + "to get the correct syntax.\n"); + error_code = COLVARSCRIPT_ERROR; } - if (cmd == "colvar") { - if (objc < 3) { - result = "Missing parameters\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - std::string const name(obj_to_str(objv[2])); - colvar *cv = cvm::colvar_by_name(name); - if (cv == NULL) { - result = "Colvar not found: " + name; - return COLVARSCRIPT_ERROR; - } - return proc_colvar(cv, objc-1, &(objv[1])); - } - - if (cmd == "bias") { - if (objc < 3) { - result = "Missing parameters\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - std::string const name(obj_to_str(objv[2])); - colvarbias *b = cvm::bias_by_name(name); - if (b == NULL) { - result = "Bias not found: " + name; - return COLVARSCRIPT_ERROR; - } - return proc_bias(b, objc-1, &(objv[1])); - } - - if (cmd == "version") { - result = COLVARS_VERSION; - return COLVARS_OK; - } - - if (cmd == "reset") { - /// Delete every child object - colvars->reset(); - return COLVARS_OK; - } - - if (cmd == "delete") { - // Note: the delete bit may be ignored by some backends - // it is mostly useful in VMD - return proxy->request_deletion(); - } - - if (cmd == "update") { - error_code |= proxy->update_input(); - if (error_code) { - result += "Error updating the Colvars module.\n"; - return error_code; - } - error_code |= colvars->calc(); - error_code |= proxy->update_output(); - if (error_code) { - result += "Error updating the Colvars module.\n"; - } - return error_code; - } - - if (cmd == "list") { - if (objc == 2) { - for (std::vector::iterator cvi = colvars->colvars.begin(); - cvi != colvars->colvars.end(); - ++cvi) { - result += (cvi == colvars->colvars.begin() ? "" : " ") + (*cvi)->name; - } - return COLVARS_OK; - } else if (objc == 3 && !strcmp(obj_to_str(objv[2]), "biases")) { - for (std::vector::iterator bi = colvars->biases.begin(); - bi != colvars->biases.end(); - ++bi) { - result += (bi == colvars->biases.begin() ? "" : " ") + (*bi)->name; - } - return COLVARS_OK; - } else { - result = "Wrong arguments to command \"list\"\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - } - - /// Parse config from file - if (cmd == "configfile") { - if (objc < 3) { - result = "Missing arguments\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - if (colvars->read_config_file(obj_to_str(objv[2])) == COLVARS_OK) { - return COLVARS_OK; - } else { - result = "Error parsing configuration file"; - return COLVARSCRIPT_ERROR; - } - } - - /// Parse config from string - if (cmd == "config") { - return exec_command(cv_config, NULL, objc, objv); - } - - /// Load an input state file - if (cmd == "load") { - if (objc < 3) { - result = "Missing arguments\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - proxy->input_prefix() = obj_to_str(objv[2]); - if (colvars->setup_input() == COLVARS_OK) { - return COLVARS_OK; - } else { - result = "Error loading state file"; - return COLVARSCRIPT_ERROR; - } - } - - /// Save to an output state file - if (cmd == "save") { - if (objc < 3) { - result = "Missing arguments"; - return COLVARSCRIPT_ERROR; - } - proxy->output_prefix() = obj_to_str(objv[2]); - int error = 0; - error |= colvars->setup_output(); - error |= colvars->write_restart_file(colvars->output_prefix()+ - ".colvars.state"); - error |= colvars->write_output_files(); - return error ? COLVARSCRIPT_ERROR : COLVARS_OK; - } - - /// Print the values that would go on colvars.traj - if (cmd == "printframelabels") { - std::ostringstream os; - colvars->write_traj_label(os); - result = os.str(); - return COLVARS_OK; - } - if (cmd == "printframe") { - std::ostringstream os; - colvars->write_traj(os); - result = os.str(); - return COLVARS_OK; - } - - if (cmd == "frame") { - if (objc == 2) { - long int f; - int error = proxy->get_frame(f); - if (error == COLVARS_OK) { - result = cvm::to_str(f); - return COLVARS_OK; - } else { - result = "Frame number is not available"; - return COLVARSCRIPT_ERROR; - } - } else if (objc == 3) { - // Failure of this function does not trigger an error, but - // returns nonzero, to let scripts detect available frames - int error = proxy->set_frame(strtol(obj_to_str(objv[2]), NULL, 10)); - result = cvm::to_str(error == COLVARS_OK ? 0 : -1); - return COLVARS_OK; - } else { - result = "Wrong arguments to command \"frame\"\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - } - - if (cmd == "addenergy") { - if (objc == 3) { - colvars->total_bias_energy += strtod(obj_to_str(objv[2]), NULL); - return COLVARS_OK; - } else { - result = "Wrong arguments to command \"addenergy\"\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - } - - if (cmd == "help") { - return exec_command(cv_help, NULL, objc, objv); - } - - result = "Syntax error\n" + help_string(); - return COLVARSCRIPT_ERROR; -} - - -int colvarscript::proc_colvar(colvar *cv, int objc, unsigned char *const objv[]) { - - if (objc < 3) { - result = "Missing arguments"; - return COLVARSCRIPT_ERROR; - } - std::string const subcmd(obj_to_str(objv[2])); - - if (subcmd == "value") { - result = (cv->value()).to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "run_ave") { - result = (cv->run_ave()).to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "width") { - result = cvm::to_str(cv->width, 0, cvm::cv_prec); - return COLVARS_OK; - } - - if (subcmd == "type") { - result = cv->value().type_desc(cv->value().value_type); - return COLVARS_OK; - } - - if (subcmd == "update") { - cv->calc(); - cv->update_forces_energy(); - result = (cv->value()).to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "delete") { - while (cv->biases.size() > 0) { - size_t i = cv->biases.size()-1; - cvm::log("Warning: before deleting colvar " + cv->name - + ", deleting parent bias " + cv->biases[i]->name); - delete cv->biases[i]; - } - // colvar destructor is tasked with the cleanup - delete cv; - // TODO this could be done by the destructors - if (colvars->cv_traj_os != NULL) { - colvars->write_traj_label(*(colvars->cv_traj_os)); - } - return COLVARS_OK; - } - - if (subcmd == "getconfig") { - result = cv->get_config(); - return COLVARS_OK; - } - - if (subcmd == "getatomgroups") { - std::vector > lists = cv->get_atom_lists(); - std::vector >::iterator li = lists.begin(); - - for ( ; li != lists.end(); ++li) { - result += "{"; - std::vector::iterator lj = (*li).begin(); - for ( ; lj != (*li).end(); ++lj) { - result += cvm::to_str(*lj); - result += " "; - } - result += "} "; - } - return COLVARS_OK; - } - - if (subcmd == "getatomids") { - std::vector::iterator li = cv->atom_ids.begin(); - - for ( ; li != cv->atom_ids.end(); ++li) { - result += cvm::to_str(*li); - result += " "; - } - return COLVARS_OK; - } - - if (subcmd == "getgradients") { - std::vector::iterator li = cv->atomic_gradients.begin(); - - for ( ; li != cv->atomic_gradients.end(); ++li) { - result += "{"; - int j; - for (j = 0; j < 3; ++j) { - result += cvm::to_str((*li)[j]); - result += " "; - } - result += "} "; - } - return COLVARS_OK; - } - - if (subcmd == "getappliedforce") { - result = (cv->applied_force()).to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "getsystemforce") { - // TODO warning here - result = (cv->total_force()).to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "gettotalforce") { - result = (cv->total_force()).to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "addforce") { - if (objc < 4) { - result = "addforce: missing parameter: force value\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - std::string const f_str(obj_to_str(objv[3])); - std::istringstream is(f_str); - is.width(cvm::cv_width); - is.precision(cvm::cv_prec); - colvarvalue force(cv->value()); - force.is_derivative(); - if (force.from_simple_string(is.str()) != COLVARS_OK) { - result = "addforce : error parsing force value"; - return COLVARSCRIPT_ERROR; - } - cv->add_bias_force(force); - result = force.to_simple_string(); - return COLVARS_OK; - } - - if (subcmd == "cvcflags") { - if (objc < 4) { - result = "cvcflags: missing parameter: vector of flags"; - return COLVARSCRIPT_ERROR; - } - std::string const flags_str(obj_to_str(objv[3])); - std::istringstream is(flags_str); - std::vector flags; - - int flag; - while (is >> flag) { - flags.push_back(flag != 0); - } - - int res = cv->set_cvc_flags(flags); - if (res != COLVARS_OK) { - result = "Error setting CVC flags"; - return COLVARSCRIPT_ERROR; - } - result = "0"; - return COLVARS_OK; - } - - if (subcmd == "modifycvcs") { - if (objc < 4) { - result = "cvcflags: missing parameter: vector of strings"; - return COLVARSCRIPT_ERROR; - } - std::vector const confs(proxy->script_obj_to_str_vector(objv[3])); - cvm::increase_depth(); - int res = cv->update_cvc_config(confs); - cvm::decrease_depth(); - if (res != COLVARS_OK) { - result = "Error setting CVC flags"; - return COLVARSCRIPT_ERROR; - } - result = "0"; - return COLVARS_OK; - } - - if ((subcmd == "get") || (subcmd == "set") || (subcmd == "state")) { - return proc_features(cv, objc, objv); - } - - result = "Syntax error\n" + help_string(); - return COLVARSCRIPT_ERROR; -} - - -int colvarscript::proc_bias(colvarbias *b, int objc, unsigned char *const objv[]) { - - if (objc < 3) { - result = "Missing arguments"; - return COLVARSCRIPT_ERROR; - } - std::string const subcmd(obj_to_str(objv[2])); - - if (subcmd == "energy") { - result = cvm::to_str(b->get_energy()); - return COLVARS_OK; - } - - if (subcmd == "update") { - b->update(); - result = cvm::to_str(b->get_energy()); - return COLVARS_OK; - } - - if (subcmd == "getconfig") { - result = b->get_config(); - return COLVARS_OK; - } - - // Subcommands for MW ABF - if (subcmd == "bin") { - int r = b->current_bin(); - result = cvm::to_str(r); - return COLVARS_OK; - } - - if (subcmd == "binnum") { - int r = b->bin_num(); - if (r < 0) { - result = "Error: calling bin_num() for bias " + b->name; - return COLVARSCRIPT_ERROR; - } - result = cvm::to_str(r); - return COLVARS_OK; - } - - if (subcmd == "share") { - int r = b->replica_share(); - if (r < 0) { - result = "Error: calling replica_share() for bias " + b->name; - return COLVARSCRIPT_ERROR; - } - result = cvm::to_str(r); - return COLVARS_OK; - } - // End commands for MW ABF - - if (subcmd == "delete") { - // the bias destructor takes care of the cleanup at cvm level - delete b; - // TODO this could be done by the destructors - if (colvars->cv_traj_os != NULL) { - colvars->write_traj_label(*(colvars->cv_traj_os)); - } - return COLVARS_OK; - } - - if ((subcmd == "get") || (subcmd == "set") || (subcmd == "state")) { - return proc_features(b, objc, objv); - } - - if (objc >= 4) { - std::string const param(obj_to_str(objv[3])); - if (subcmd == "count") { - int index; - if (!(std::istringstream(param) >> index)) { - result = "bin_count: error parsing bin index"; - return COLVARSCRIPT_ERROR; - } - result = cvm::to_str(b->bin_count(index)); - return COLVARS_OK; - } - - result = "Syntax error\n" + help_string(); - return COLVARSCRIPT_ERROR; - } - - result = "Syntax error\n" + help_string(); - return COLVARSCRIPT_ERROR; + return error_code; } int colvarscript::proc_features(colvardeps *obj, int objc, unsigned char *const objv[]) { + // size was already checked before calling - std::string const subcmd(obj_to_str(objv[2])); + std::string const subcmd(obj_to_str(objv[3])); - if (objc == 3) { - if (subcmd == "state") { - // TODO make this returned as result? - obj->print_state(); - return COLVARS_OK; + if (cvm::debug()) { + cvm::log("Called proc_features() with " + cvm::to_str(objc) + " args:"); + for (int i = 0; i < objc; i++) { + cvm::log(obj_to_str(objv[i])); } - - // get and set commands require more arguments - result = "Syntax error\n" + help_string(); - return COLVARSCRIPT_ERROR; } if ((subcmd == "get") || (subcmd == "set")) { std::vector const &features = obj->features(); - std::string const req_feature(obj_to_str(objv[3])); + std::string const req_feature(obj_to_str(objv[4])); colvardeps::feature *f = NULL; int fid = 0; for (fid = 0; fid < int(features.size()); fid++) { @@ -576,25 +374,25 @@ int colvarscript::proc_features(colvardeps *obj, if (f == NULL) { - result = "Error: feature \""+req_feature+"\" does not exist.\n"; + add_error_msg("Error: feature \""+req_feature+"\" does not exist.\n"); return COLVARSCRIPT_ERROR; } else { if (! obj->is_available(fid)) { - result = "Error: feature \""+req_feature+"\" is unavailable.\n"; + add_error_msg("Error: feature \""+req_feature+"\" is unavailable.\n"); return COLVARSCRIPT_ERROR; } if (subcmd == "get") { - result = cvm::to_str(obj->is_enabled(fid) ? 1 : 0); + set_result_str(cvm::to_str(obj->is_enabled(fid) ? 1 : 0)); return COLVARS_OK; } if (subcmd == "set") { - if (objc == 5) { + if (objc == 6) { std::string const yesno = - colvarparse::to_lower_cppstr(std::string(obj_to_str(objv[4]))); + colvarparse::to_lower_cppstr(std::string(obj_to_str(objv[5]))); if ((yesno == std::string("yes")) || (yesno == std::string("on")) || (yesno == std::string("1"))) { @@ -607,71 +405,156 @@ int colvarscript::proc_features(colvardeps *obj, return COLVARS_OK; } } - result = "Syntax error\n" + help_string(); + add_error_msg("Missing value when setting feature \""+req_feature+ + "\".\n"); return COLVARSCRIPT_ERROR; } } } - result = "Syntax error\n" + help_string(); + // This shouldn't be reached any more return COLVARSCRIPT_ERROR; } -std::string colvarscript::help_string() const +int colvarscript::unsupported_op() { - std::string buf; - buf = "Usage: cv [args...]\n\ -\n\ -Managing the Colvars module:\n\ - configfile -- read configuration from a file\n\ - config -- read configuration from the given string\n\ - getconfig -- get the module's configuration string\n\ - resetindexgroups -- clear the index groups loaded so far\n\ - reset -- delete all internal configuration\n\ - delete -- delete this Colvars module instance\n\ - version -- return version of Colvars code\n\ - \n\ -Input and output:\n\ - list -- return a list of all variables\n\ - list biases -- return a list of all biases\n\ - load -- load a state file (requires configuration)\n\ - save -- save a state file (requires configuration)\n\ - update -- recalculate colvars and biases\n\ - addenergy -- add to the total bias energy\n\ - printframe -- return a summary of the current frame\n\ - printframelabels -- return labels to annotate printframe's output\n"; + return cvm::error("Error: unsupported script operation.\n", + COLVARS_NOT_IMPLEMENTED); +} - long int tmp; - if (proxy->get_frame(tmp) != COLVARS_NOT_IMPLEMENTED) { - buf += "\ - frame -- return current frame number\n\ - frame -- set frame number\n"; + +int colvarscript::set_result_str(std::string const &s) +{ + if (cvm::get_error() != COLVARS_OK) { + // Avoid overwriting the error message + result += s; + } else { + result = s; + } + return COLVARS_OK; +} + + +void colvarscript::add_error_msg(std::string const &s) +{ + result += s; + // Ensure terminating newlines + if (s[s.size()-1] != '\n') { + result += "\n"; + } +} + + +int colvarscript::clear_str_result() +{ + result.clear(); + return COLVARS_OK; +} + + +extern "C" +int run_colvarscript_command(int objc, unsigned char *const objv[]) +{ + colvarmodule *cv = cvm::main(); + colvarscript *script = cv ? cv->proxy->script : NULL; + if (!script) { + cvm::error("Called run_colvarscript_command without a script object.\n", + BUG_ERROR); + return -1; + } + int retval = script->run(objc, objv); + return retval; +} + + +extern "C" +const char * get_colvarscript_result() +{ + colvarscript *script = colvarscript_obj(); + if (!script) { + cvm::error("Called get_colvarscript_result without a script object.\n"); + return NULL; + } + return script->str_result().c_str(); +} + + +#if defined(COLVARS_TCL) + +#if defined(VMDTCL) +// Function used by VMD to set up the module +int tcl_colvars_vmd_init(Tcl_Interp *interp, int molid); +#endif + +extern "C" +int tcl_run_colvarscript_command(ClientData /* clientData */, + Tcl_Interp *my_interp, + int objc, Tcl_Obj *const objv[]) +{ + colvarmodule *colvars = cvm::main(); + + if (!colvars) { +#if defined(VMDTCL) + if (objc >= 3) { + // require a molid to create the module + if (!strcmp(Tcl_GetString(objv[1]), "molid")) { + int molid = -1; + if (strcmp(Tcl_GetString(objv[2]), "top")) { + // If this is not "top", get the integer value + Tcl_GetIntFromObj(my_interp, objv[2], &molid); + } + return tcl_colvars_vmd_init(my_interp, molid); + } else { + // TODO allow calling cv help after this + Tcl_SetResult(my_interp, (char *) "Syntax error.", TCL_STATIC); + return TCL_ERROR; + } + } + Tcl_SetResult(my_interp, (char *) "First, setup the Colvars module with: " + "cv molid ", TCL_STATIC); +#else + Tcl_SetResult(my_interp, + const_cast("Error: Colvars module not yet initialized"), + TCL_STATIC); +#endif + return TCL_ERROR; } - buf += "\n\ -Accessing collective variables:\n\ - colvar value -- return the current value of colvar \n\ - colvar update -- recalculate colvar \n\ - colvar type -- return the type of colvar \n\ - colvar delete -- delete colvar \n\ - colvar addforce -- apply given force on colvar \n\ - colvar getappliedforce -- return applied force of colvar \n\ - colvar gettotalforce -- return total force of colvar \n\ - colvar getconfig -- return config string of colvar \n\ - colvar cvcflags -- enable or disable cvcs according to 0/1 flags\n\ - colvar modifycvcs -- pass new config strings to each CVC\n\ - colvar get -- get the value of the colvar feature \n\ - colvar set -- set the value of the colvar feature \n\ -\n\ -Accessing biases:\n\ - bias energy -- return the current energy of bias \n\ - bias update -- recalculate bias \n\ - bias delete -- delete bias \n\ - bias getconfig -- return config string of bias \n\ - bias get -- get the value of the bias feature \n\ - bias set -- set the value of the bias feature \n\ -"; + colvarproxy *proxy = colvars->proxy; + Tcl_Interp *interp = my_interp ? my_interp : + reinterpret_cast(proxy->get_tcl_interp()); + colvarscript *script = colvarscript_obj(); + if (!script) { + char const *errstr = "Called tcl_run_colvarscript_command " + "without a Colvars script interface set up.\n"; + Tcl_SetResult(interp, const_cast(errstr), TCL_VOLATILE); + return TCL_ERROR; + } - return buf; + cvm::clear_error(); + + int retval = script->run(objc, + reinterpret_cast(objv)); + + std::string result = proxy->get_error_msgs() + script->result; + + Tcl_SetResult(interp, const_cast(result.c_str()), + TCL_VOLATILE); + + if (proxy->delete_requested() || cvm::get_error_bit(FATAL_ERROR)) { + if (proxy->delete_requested() && !proxy->simulation_running()) { + // Running in VMD + Tcl_SetResult(interp, + const_cast("Deleting Colvars module" + ": to recreate, use cv molid "), + TCL_STATIC); + } + delete proxy; + proxy = NULL; + } + + return (retval == COLVARS_OK) ? TCL_OK : TCL_ERROR; } + +#endif // #if defined(COLVARS_TCL) diff --git a/lib/colvars/colvarscript.h b/lib/colvars/colvarscript.h index 69d52cbb51..d6f77668e6 100644 --- a/lib/colvars/colvarscript.h +++ b/lib/colvars/colvarscript.h @@ -8,7 +8,7 @@ // Colvars repository at GitHub. #ifndef COLVARSCRIPT_H -//#define COLVARSCRIPT_H // Delay definition until later +#define COLVARSCRIPT_H #include #include @@ -29,7 +29,7 @@ class colvarscript { private: - colvarproxy *proxy; + colvarproxy *proxy_; colvarmodule *colvars; inline colvarscript() {} // no-argument construction forbidden @@ -38,8 +38,9 @@ public: friend class colvarproxy; - colvarscript(colvarproxy * p); - inline ~colvarscript() {} + colvarscript(colvarproxy *p); + + ~colvarscript(); /// If an error is caught by the proxy through fatal_error(), this is set to /// COLVARSCRIPT_ERROR @@ -49,112 +50,196 @@ public: /// error message std::string result; - /// Run script command with given positional arguments (objects) + /// Run a script command with space-separated positional arguments (objects) int run(int objc, unsigned char *const objv[]); - /// Set the return value of the script command to the given string - inline void set_str_result(std::string const &s) + /// Get the string result of the current scripting call + inline std::string const &str_result() const { - result = s; + return result; } - /// Build and return a short help - std::string help_string(void) const; + /// Modify the string result of the current scripting call + inline std::string &modify_str_result() + { + return result; + } + + /// Set the return value to the given string + int set_result_str(std::string const &s); + + /// Clear the string result + int clear_str_result(); + + /// Add the given string to the error message of the script interface + void add_error_msg(std::string const &s); + + /// Commands available + enum command { +#define CVSCRIPT_ENUM_COMM(COMM) COMM, +#undef CVSCRIPT +#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + CVSCRIPT_ENUM_COMM(COMM) +#ifdef COLVARSCRIPT_COMMANDS_H +#undef COLVARSCRIPT_COMMANDS_H +#endif +#include "colvarscript_commands.h" +#undef COLVARSCRIPT_COMMANDS_H +#undef CVSCRIPT +#undef CVSCRIPT_ENUM_COMM + cv_n_commands + }; + + /// Type of object handling a script command + enum Object_type { + use_module, + use_colvar, + use_bias + }; + + /// Return the prefix of the individual command for each object function + std::string get_cmd_prefix(Object_type t); + + /// Get a pointer to the i-th argument of the command (NULL if not given) + template + unsigned char *get_cmd_arg(int iarg, int objc, unsigned char *const objv[]); + + /// Instantiation of get_cmd_arg<> for module-level commands + unsigned char *get_module_cmd_arg(int iarg, int objc, + unsigned char *const objv[]); + + /// Instantiation of get_cmd_arg<> for colvar-level commands + unsigned char *get_colvar_cmd_arg(int iarg, int objc, + unsigned char *const objv[]); + + /// Instantiation of get_cmd_arg<> for bias-level commands + unsigned char *get_bias_cmd_arg(int iarg, int objc, + unsigned char *const objv[]); + + /// Check the argument count of the command + template + int check_cmd_nargs(char const *cmd, int objc, + int n_args_min, int n_args_max); + + /// Instantiation of check_cmd_nargs<> for module-level commands + int check_module_cmd_nargs(char const *cmd, int objc, + int n_args_min, int n_args_max); + + /// Instantiation of check_cmd_nargs<> for colvar-level commands + int check_colvar_cmd_nargs(char const *cmd, int objc, + int n_args_min, int n_args_max); + + /// Instantiation of get_cmd_arg<> for bias-level commands + int check_bias_cmd_nargs(char const *cmd, int objc, + int n_args_min, int n_args_max); + + /// Number of positional arguments to shift for each object type + template + int cmd_arg_shift(); /// Use scripting language to get the string representation of an object inline char const *obj_to_str(unsigned char *const obj) { - return cvm::proxy->script_obj_to_str(obj); + return (obj == NULL ? NULL : proxy_->script_obj_to_str(obj)); } - enum command { - cv_help, - cv_version, - cv_config, - cv_getconfig, - cv_configfile, - cv_reset, - cv_resetindexgroups, - cv_delete, - cv_list, - cv_list_biases, - cv_load, - cv_save, - cv_update, - cv_addenergy, - cv_getenergy, - cv_printframe, - cv_printframelabels, - cv_frame, - cv_units, - cv_colvar, - cv_colvar_value, - cv_colvar_update, - cv_colvar_type, - cv_colvar_delete, - cv_colvar_addforce, - cv_colvar_getappliedforce, - cv_colvar_gettotalforce, - cv_colvar_cvcflags, - cv_colvar_getconfig, - cv_colvar_get, - cv_colvar_set, - cv_bias, - cv_bias_energy, - cv_bias_update, - cv_bias_delete, - cv_bias_getconfig, - cv_bias_get, - cv_bias_set, - cv_n_commands - }; + /// Get names of all commands + inline char const **get_command_names() const + { + return cmd_names; + } + + /// Get help string for a command (does not specify how it is launched) + /// \param cmd Name of the command's function (e.g. "cv_units") + std::string get_command_help(char const *cmd); + + /// Get summary of command line syntax for all commands of a given context + /// \param t One of use_module, use_colvar or use_bias + std::string get_cmdline_help_summary(Object_type t); + + /// Get a description of how the command should be used in a command line + /// \param t One of use_module, use_colvar or use_bias + /// \param c Value of the \link command \endlink enum + std::string get_command_cmdline_syntax(Object_type t, command c); + + /// Get the command line syntax following by the help string + /// \param t One of use_module, use_colvar or use_bias + /// \param cmd Name of the subcommand (e.g. "units") + std::string get_command_cmdline_help(Object_type t, std::string const &cmd); + + /// Set error code for unsupported script operation + int unsupported_op(); + + /// Pointer to the Colvars main object + inline colvarmodule *module() + { + return this->colvars; + } + + /// Pointer to the colvarproxy object (interface with host engine) + inline colvarproxy *proxy() + { + return this->proxy_; + } + +private: + + /// Set up all script API functions + int init_commands(); + + /// Set up a single script API function + int init_command(colvarscript::command const &comm, + char const *name, char const *help, + int n_args_min, int n_args_max, char const *arghelp, + int (*fn)(void *, int, unsigned char * const *)); /// Execute a script command inline int exec_command(command c, void *pobj, int objc, unsigned char * const *objv) { - return (*(comm_fns[c]))(pobj, objc, objv); + return (*(cmd_fns[c]))(pobj, objc, objv); } - /// Get help for a command (TODO reformat for each language?) - inline std::string command_help(colvarscript::command c) const - { - return comm_help[c]; - } - - /// Clear all object results - inline void clear_results() - { - result.clear(); - } - -private: - - /// Run subcommands on colvar - int proc_colvar(colvar *cv, int argc, unsigned char *const argv[]); - - /// Run subcommands on bias - int proc_bias(colvarbias *b, int argc, unsigned char *const argv[]); +public: // TODO this function will be removed soon /// Run subcommands on base colvardeps object (colvar, bias, ...) int proc_features(colvardeps *obj, int argc, unsigned char *const argv[]); +private: // TODO + /// Internal identifiers of command strings - std::map comm_str_map; + std::map cmd_str_map; + + /// Inverse of cmd_str_map (to be exported outside this class) + char const **cmd_names; /// Help strings for each command - std::vector comm_help; + std::vector cmd_help; - /// Number of arguments for each command - std::vector comm_n_args; + /// Minimum number of arguments for each command + std::vector cmd_n_args_min; - /// Arguments for each command - std::vector< std::vector > comm_args; + /// Maximum number of arguments for each command + std::vector cmd_n_args_max; + + /// Help strings for each command argument + std::vector< std::vector > cmd_arghelp; /// Implementations of each command - std::vector comm_fns; + std::vector cmd_fns; + + /// Get a pointer to the implementation of the given command + inline int (*get_cmd_fn(std::string const &cmd_key))(void *, + int, + unsigned char * const *) + { + if (cmd_str_map.count(cmd_key) > 0) { + return cmd_fns[cmd_str_map[cmd_key]]; + } + return NULL; + } }; @@ -165,12 +250,14 @@ inline static colvarscript *colvarscript_obj() return cvm::main()->proxy->script; } + /// Get a pointer to the colvar object pointed to by pobj inline static colvar *colvar_obj(void *pobj) { return reinterpret_cast(pobj); } + /// Get a pointer to the colvarbias object pointed to by pobj inline static colvarbias *colvarbias_obj(void *pobj) { @@ -178,137 +265,124 @@ inline static colvarbias *colvarbias_obj(void *pobj) } -#define CVSCRIPT_COMM_FNAME(COMM) cvscript_ ## COMM -#define CVSCRIPT_COMM_PROTO(COMM) \ - int CVSCRIPT_COMM_FNAME(COMM)(void *, int, unsigned char *const *); - -#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ - CVSCRIPT_COMM_PROTO(COMM) - -#undef COLVARSCRIPT_H -#endif // #ifndef COLVARSCRIPT_H +template +unsigned char *colvarscript::get_cmd_arg(int iarg, + int objc, + unsigned char *const objv[]) +{ + int const shift = cmd_arg_shift(); + return (shift+iarg < objc) ? objv[shift+iarg] : NULL; +} -#ifdef COLVARSCRIPT_CPP -#define CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ - extern "C" int CVSCRIPT_COMM_FNAME(COMM)(void *pobj, \ - int objc, \ - unsigned char *const objv[]) \ - { \ - colvarscript *script = colvarscript_obj(); \ - script->clear_results(); \ - if (objc < 2+N_ARGS_MIN) /* "cv" and "COMM" are 1st and 2nd */ { \ - script->set_str_result("Missing arguments\n" + \ - script->command_help(colvarscript::COMM)); \ - return COLVARSCRIPT_ERROR; \ - } \ - if (objc > 2+N_ARGS_MAX) { \ - script->set_str_result("Too many arguments\n" + \ - script->command_help(colvarscript::COMM)); \ - return COLVARSCRIPT_ERROR; \ - } \ - FN_BODY; \ +inline unsigned char *colvarscript::get_module_cmd_arg(int iarg, int objc, + unsigned char *const objv[]) +{ + return get_cmd_arg(iarg, objc, objv); +} + + +inline unsigned char *colvarscript::get_colvar_cmd_arg(int iarg, int objc, + unsigned char *const objv[]) +{ + return get_cmd_arg(iarg, objc, objv); +} + + +inline unsigned char *colvarscript::get_bias_cmd_arg(int iarg, int objc, + unsigned char *const objv[]) +{ + return get_cmd_arg(iarg, objc, objv); +} + + +template +int colvarscript::check_cmd_nargs(char const *cmd, + int objc, + int n_args_min, + int n_args_max) +{ + int const shift = cmd_arg_shift(); + if (objc < shift+n_args_min) { + add_error_msg("Missing arguments for script function \""+std::string(cmd)+ + "\":\n"+get_command_help(cmd)); + return COLVARSCRIPT_ERROR; } -#undef CVSCRIPT -#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ - CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) -#endif // #ifdef COLVARSCRIPT_CPP - - -#ifdef COLVARSCRIPT_INIT_FN -#define CVSCRIPT_COMM_INIT(COMM,HELP,ARGS) { \ - comm_str_map[#COMM] = COMM; \ - comm_help[COMM] = HELP; \ - comm_fns[COMM] = &(CVSCRIPT_COMM_FNAME(COMM)); \ + if (objc > shift+n_args_max) { + add_error_msg("Too many arguments for script function \""+std::string(cmd)+ + "\":\n"+get_command_help(cmd)); + return COLVARSCRIPT_ERROR; } -#undef CVSCRIPT -#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ - CVSCRIPT_COMM_INIT(COMM,HELP,ARGS) -#endif + return COLVARSCRIPT_OK; +} -#if !defined(COLVARSCRIPT_H) || defined(COLVARSCRIPT_INIT_FN) -#define COLVARSCRIPT_H +inline int colvarscript::check_module_cmd_nargs(char const *cmd, + int objc, + int n_args_min, + int n_args_max) +{ + return check_cmd_nargs(cmd, objc, n_args_min, n_args_max); +} + + +inline int colvarscript::check_colvar_cmd_nargs(char const *cmd, + int objc, + int n_args_min, + int n_args_max) +{ + return check_cmd_nargs(cmd, objc, n_args_min, n_args_max); +} + + +inline int colvarscript::check_bias_cmd_nargs(char const *cmd, + int objc, + int n_args_min, + int n_args_max) +{ + return check_cmd_nargs(cmd, objc, n_args_min, n_args_max); +} + + +template +int colvarscript::cmd_arg_shift() +{ + int shift = 0; + if (T == use_module) { + // "cv" and "COMMAND" are 1st and 2nd argument, and shift is equal to 2 + shift = 2; + } else if (T == use_colvar) { + // Same as above with additional arguments "colvar" and "NAME" + shift = 4; + } else if (T == use_bias) { + shift = 4; + } + return shift; +} + -#ifndef COLVARSCRIPT_INIT_FN -#ifdef __cplusplus extern "C" { -#endif -#endif - // Add optional arguments for command-specific help? - CVSCRIPT(cv_help, - "Print the help message", - 0, 0, - {}, - script->set_str_result(script->help_string()); - return COLVARS_OK; - ) +#if defined(COLVARS_TCL) + /// Run the script API via Tcl command-line interface + /// \param clientData Not used + /// \param my_interp Pointer to Tcl_Interp object (read from Colvars if NULL) + /// \param objc Number of Tcl command parameters + /// \param objv Array of command parameters + /// \return Result of the script command + int tcl_run_colvarscript_command(ClientData clientData, + Tcl_Interp *interp_in, + int objc, Tcl_Obj *const objv[]); +#endif // #if defined(COLVARS_TCL) - CVSCRIPT(cv_config, - "Read configuration from the given string", - 1, 1, - { "conf (str) - Configuration string" }, - std::string const conf(script->obj_to_str(objv[2])); - if (cvm::main()->read_config_string(conf) == COLVARS_OK) { - return COLVARS_OK; - } - script->set_str_result("Error parsing configuration string"); - return COLVARSCRIPT_ERROR; - ) + /// Generic wrapper for string-based scripting + int run_colvarscript_command(int objc, unsigned char *const objv[]); - CVSCRIPT(cv_getconfig, - "Get the module's configuration string read so far", - 0, 0, - { }, - script->set_str_result(cvm::main()->get_config()); - return COLVARS_OK; - ) + /// Get the string result of a script call + const char * get_colvarscript_result(); - CVSCRIPT(cv_resetindexgroups, - "Clear the index groups loaded so far, allowing to replace them", - 0, 0, - { }, - return cvm::main()->reset_index_groups(); - ) +} - CVSCRIPT(cv_addenergy, - "Add an energy to the MD engine", - 1, 1, - { "E (float) - Amount of energy to add" }, - cvm::main()->total_bias_energy += - strtod(script->obj_to_str(objv[2]), NULL); - return COLVARS_OK; - ) - - CVSCRIPT(cv_getenergy, - "Get the current Colvars energy", - 1, 1, - { "E (float) - Store the energy in this variable" }, - double *energy = reinterpret_cast(objv[2]); - *energy = cvm::main()->total_bias_energy; - return COLVARS_OK; - ) - - CVSCRIPT(cv_units, - "Get the current Colvars unit system", - 0, 1, - { }, - if (objc < 3) { - script->set_str_result(cvm::proxy->units); - return COLVARS_OK; - } else { - return cvm::proxy->set_unit_system(script->obj_to_str(objv[2]) , false); - } - ) - -#ifndef COLVARSCRIPT_INIT_FN -#ifdef __cplusplus -} // extern "C" -#endif -#endif - -#undef CVSCRIPT #endif // #ifndef COLVARSCRIPT_H diff --git a/lib/colvars/colvarscript_commands.cpp b/lib/colvars/colvarscript_commands.cpp new file mode 100644 index 0000000000..c74663d2fd --- /dev/null +++ b/lib/colvars/colvarscript_commands.cpp @@ -0,0 +1,65 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + +#include +#include +#include + +#include "colvarproxy.h" +#include "colvardeps.h" +#include "colvarscript.h" +#include "colvarscript_commands.h" + + + +extern "C" +int cvscript_n_commands() +{ + return static_cast(colvarscript::cv_n_commands); +} + + +extern "C" +char const **cvscript_command_names() +{ + colvarscript *script = colvarscript_obj(); + return script->get_command_names(); +} + + +// Instantiate the body of all script commands + +#define CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + int CVSCRIPT_COMM_FNAME(COMM)(void *pobj, \ + int objc, unsigned char *const objv[]) \ + { \ + if (cvm::debug()) { \ + cvm::log("Executing script function \""+std::string(#COMM)+"\""); \ + } \ + colvarscript *script = colvarscript_obj(); \ + script->clear_str_result(); \ + if (script->check_module_cmd_nargs(#COMM, \ + objc, N_ARGS_MIN, N_ARGS_MAX) != \ + COLVARSCRIPT_OK) { \ + return COLVARSCRIPT_ERROR; \ + } \ + FN_BODY; \ + } +#undef CVSCRIPT +#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) + +// Skips the colvar- and bias- specific commands +#define COLVARSCRIPT_COMMANDS_GLOBAL + +#undef COLVARSCRIPT_COMMANDS_H +#include "colvarscript_commands.h" + +#undef CVSCRIPT_COMM_FN +#undef CVSCRIPT diff --git a/lib/colvars/colvarscript_commands.h b/lib/colvars/colvarscript_commands.h new file mode 100644 index 0000000000..d90a3ac422 --- /dev/null +++ b/lib/colvars/colvarscript_commands.h @@ -0,0 +1,407 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + +#ifndef COLVARSCRIPT_COMMANDS_H +#define COLVARSCRIPT_COMMANDS_H + +// The following is a complete definition of the scripting API. + +// The CVSCRIPT macro is used in four distinct contexts: +// 1) Expand to the functions' prototypes (when included generically) +// 2) List colvarscript::command entries (when included in colvarscript.h) +// 3) Implement colvarscript::init() (when included in colvarscript.cpp) +// 4) Define the functions' bodies (when included in colvarscript_commands.cpp) + + +// Each command is created by an instance of the CVSCRIPT macro + +// The arguments of the CVSCRIPT macro are: + +// COMM = the id of the command (must be a member of colvarscript::command) + +// HELP = a one-line description (C string literal) for the command + +// N_ARGS_MIN = the lowest number of arguments allowed + +// N_ARGS_MAX = the highest number of arguments allowed + +// ARGS = multi-line string literal describing each parameter; each line +// follows the format "name : type - description" + +// FN_BODY = the implementation of the function; this should be a thin wrapper +// over existing functions; the "script" pointer to the colvarscript +// object is already set by the CVSCRIPT_COMM_FN macro; see also the +// functions in colvarscript_commands.h. + +#ifndef CVSCRIPT_COMM_FNAME +#define CVSCRIPT_COMM_FNAME(COMM) cvscript_ ## COMM +#endif + +// If CVSCRIPT is not defined, this file yields the function prototypes +#ifndef CVSCRIPT + +#ifdef __cplusplus +#define CVSCRIPT_COMM_PROTO(COMM) \ + extern "C" int CVSCRIPT_COMM_FNAME(COMM)(void *, \ + int, unsigned char *const *); +#else +#define CVSCRIPT_COMM_PROTO(COMM) \ + int CVSCRIPT_COMM_FNAME(COMM)(void *, int, unsigned char *const *); +#endif + +#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + CVSCRIPT_COMM_PROTO(COMM) + + +// Utility functions used to query the command database +extern "C" { + + /// Get the number of colvarscript commands + int cvscript_n_commands(); + + /// Get the names of all commands (array of strings) + char const ** cvscript_command_names(); + +} + +#endif + + +CVSCRIPT(cv_addenergy, + "Add an energy to the MD engine (no effect in VMD)", + 1, 1, + "E : float - Amount of energy to add", + char const *Earg = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + cvm::main()->total_bias_energy += strtod(Earg, NULL); + return cvm::get_error(); // TODO Make this multi-language + ) + +CVSCRIPT(cv_bias, + "Prefix for bias-specific commands", + 0, 0, + "", + // This cannot be executed from a command line + return COLVARS_OK; + ) + +CVSCRIPT(cv_colvar, + "Prefix for colvar-specific commands", + 0, 0, + "", + // This cannot be executed from a command line + return COLVARS_OK; + ) + +CVSCRIPT(cv_config, + "Read configuration from the given string", + 1, 1, + "conf : string - Configuration string", + char const *conf_str = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + std::string const conf(conf_str); + if (cvm::main()->read_config_string(conf) == COLVARS_OK) { + return COLVARS_OK; + } + script->add_error_msg("Error parsing configuration string"); + return COLVARSCRIPT_ERROR; + ) + +CVSCRIPT(cv_configfile, + "Read configuration from a file", + 1, 1, + "conf_file : string - Path to configuration file", + char const *conf_file_name = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + if (script->module()->read_config_file(conf_file_name) == COLVARS_OK) { + return COLVARS_OK; + } else { + script->add_error_msg("Error parsing configuration file"); + return COLVARSCRIPT_ERROR; + } + ) + +CVSCRIPT(cv_delete, + "Delete this Colvars module instance (VMD only)", + 0, 0, + "", + return script->proxy()->request_deletion(); + ) + +CVSCRIPT(cv_frame, + "Get or set current frame number (VMD only)", + 0, 1, + "frame : integer - Frame number", + char const *arg = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + if (arg == NULL) { + long int f = -1; + if (script->proxy()->get_frame(f) == COLVARS_OK) { + script->set_result_str(cvm::to_str(f)); + return COLVARS_OK; + } else { + script->add_error_msg("Frame number is not available"); + return COLVARSCRIPT_ERROR; + } + } else { + int const f = strtol(const_cast(arg), NULL, 10); + int error_code = script->proxy()->set_frame(f); + if (error_code == COLVARS_NO_SUCH_FRAME) { + script->add_error_msg("Invalid frame number: \""+std::string(arg)+ + "\"\n"); + } + return error_code; + } + return COLVARS_OK; + ) + +CVSCRIPT(cv_getconfig, + "Get the module's configuration string read so far", + 0, 0, + "", + script->set_result_str(cvm::main()->get_config()); + return COLVARS_OK; + ) + +CVSCRIPT(cv_getenergy, + "Get the current Colvars energy", + 0, 0, + "", + script->set_result_str(cvm::to_str(cvm::main()->total_bias_energy)); + return COLVARS_OK; + ) + +CVSCRIPT(cv_help, + "Get the help string of the Colvars scripting interface", + 0, 1, + "command : string - Get the help string of this specific command", + unsigned char *const cmdobj = + script->get_module_cmd_arg(0, objc, objv); + if (cmdobj) { + std::string const cmdstr(script->obj_to_str(cmdobj)); + if (cmdstr.size()) { + if (cmdstr == std::string("colvar")) { + script->set_result_str(script->get_cmdline_help_summary(colvarscript::use_colvar)); + } else if (cmdstr == std::string("bias")) { + script->set_result_str(script->get_cmdline_help_summary(colvarscript::use_bias)); + } else { + script->set_result_str(script->get_command_cmdline_help(colvarscript::use_module, + cmdstr)); + } + return cvm::get_error(); + } else { + return COLVARSCRIPT_ERROR; + } + } else { + script->set_result_str(script->get_cmdline_help_summary(colvarscript::use_module)); + return COLVARS_OK; + } + ) + +CVSCRIPT(cv_list, + "Return a list of all variables or biases", + 0, 1, + "param : string - \"colvars\" or \"biases\"; default is \"colvars\"", + std::string res; + unsigned char *const kwarg = script->get_module_cmd_arg(0, objc, objv); + std::string const kwstr = kwarg ? script->obj_to_str(kwarg) : + std::string("colvars"); + if (kwstr == "colvars") { + for (std::vector::iterator cvi = script->module()->variables()->begin(); + cvi != script->module()->variables()->end(); + ++cvi) { + res += (cvi == script->module()->variables()->begin() ? "" : " ") + (*cvi)->name; + } + script->set_result_str(res); + return COLVARS_OK; + } else if (kwstr == "biases") { + for (std::vector::iterator bi = script->module()->biases.begin(); + bi != script->module()->biases.end(); + ++bi) { + res += (bi == script->module()->biases.begin() ? "" : " ") + (*bi)->name; + } + script->set_result_str(res); + return COLVARS_OK; + } else { + script->add_error_msg("Wrong arguments to command \"list\"\n"); + return COLVARSCRIPT_ERROR; + } + ) + +CVSCRIPT(cv_listcommands, + "Get the list of script functions, prefixed with \"cv_\", \"colvar_\" or \"bias_\"", + 0, 0, + "", + int const n_commands = cvscript_n_commands(); + char const **command_names = cvscript_command_names(); + std::string result; + for (int i = 0; i < n_commands; i++) { + if (i > 0) result.append(1, ' '); + result.append(std::string(command_names[i])); + } + script->set_result_str(result); + return COLVARS_OK; + ) + +CVSCRIPT(cv_load, + "Load data from a state file into all matching colvars and biases", + 1, 1, + "prefix : string - Path to existing state file or input prefix", + char const *arg = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + script->proxy()->input_prefix() = cvm::state_file_prefix(arg); + if (script->module()->setup_input() == COLVARS_OK) { + return COLVARS_OK; + } else { + script->add_error_msg("Error loading state file"); + return COLVARSCRIPT_ERROR; + } + ) + +CVSCRIPT(cv_loadfromstring, + "Load state data from a string into all matching colvars and biases", + 1, 1, + "buffer : string - String buffer containing the state information", + char const *arg = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + script->proxy()->input_buffer() = arg; + if (script->module()->setup_input() == COLVARS_OK) { + return COLVARS_OK; + } else { + script->add_error_msg("Error loading state string"); + return COLVARSCRIPT_ERROR; + } + ) + +CVSCRIPT(cv_molid, + "Get or set the molecule ID on which Colvars is defined (VMD only)", + 0, 1, + "molid : integer - Molecule ID; -1 means undefined", + char const *arg = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + if (arg == NULL) { + int molid = -1; + script->proxy()->get_molid(molid); + script->set_result_str(cvm::to_str(molid)); + return COLVARS_OK; + } else { + script->add_error_msg("Error: To change the molecule ID in VMD, use cv delete first."); + return COLVARS_NOT_IMPLEMENTED; + } + ) + +CVSCRIPT(cv_printframe, + "Return the values that would be written to colvars.traj", + 0, 0, + "", + std::ostringstream os; + script->module()->write_traj(os); + script->set_result_str(os.str()); + return COLVARS_OK; + ) + +CVSCRIPT(cv_printframelabels, + "Return the labels that would be written to colvars.traj", + 0, 0, + "", + std::ostringstream os; + script->module()->write_traj_label(os); + script->set_result_str(os.str()); + return COLVARS_OK; + ) + +CVSCRIPT(cv_reset, + "Delete all internal configuration", + 0, 0, + "", + return script->module()->reset(); + ) + +CVSCRIPT(cv_resetindexgroups, + "Clear the index groups loaded so far, allowing to replace them", + 0, 0, + "", + cvm::main()->index_group_names.clear(); + cvm::main()->index_groups.clear(); + return COLVARS_OK; + ) + +CVSCRIPT(cv_save, + "Change the prefix of all output files and save them", + 1, 1, + "prefix : string - Output prefix with trailing \".colvars.state\" gets removed)", + std::string const prefix = + cvm::state_file_prefix(script->obj_to_str(script->get_module_cmd_arg(0, objc, objv))); + script->proxy()->output_prefix() = prefix; + int error_code = COLVARS_OK; + error_code |= script->module()->setup_output(); + error_code |= script->module()->write_restart_file(prefix+ + ".colvars.state"); + error_code |= script->module()->write_output_files(); + return error_code; + ) + +CVSCRIPT(cv_savetostring, + "Write the Colvars state to a string and return it", + 0, 0, + "", + return script->module()->write_restart_string(script->modify_str_result()); + ) + +CVSCRIPT(cv_units, + "Get or set the current Colvars unit system", + 0, 1, + "units : string - The new unit system", + char const *argstr = + script->obj_to_str(script->get_module_cmd_arg(0, objc, objv)); + if (argstr) { + return cvm::proxy->set_unit_system(argstr, false); + } else { + script->set_result_str(cvm::proxy->units); + return COLVARS_OK; + } + ) + +CVSCRIPT(cv_update, + "Recalculate colvars and biases", + 0, 0, + "", + int error_code = script->proxy()->update_input(); + if (error_code) { + script->add_error_msg("Error updating the Colvars module (input)"); + return error_code; + } + error_code |= script->module()->calc(); + if (error_code) { + script->add_error_msg("Error updating the Colvars module (calc)"); + return error_code; + } + error_code |= script->proxy()->update_output(); + if (error_code) { + script->add_error_msg("Error updating the Colvars module (output)"); + } + return error_code; + ) + +CVSCRIPT(cv_version, + "Get the Colvars Module version number", + 0, 0, + "", + script->set_result_str(COLVARS_VERSION); + return COLVARS_OK; + ) + +// This guard allows compiling colvar and bias function bodies in their +// respecitve files instead of colvarscript_commands.o +#ifndef COLVARSCRIPT_COMMANDS_GLOBAL +#include "colvarscript_commands_colvar.h" +#include "colvarscript_commands_bias.h" +#endif + +#endif // #ifndef COLVARSCRIPT_COMMANDS_H diff --git a/lib/colvars/colvarscript_commands_bias.cpp b/lib/colvars/colvarscript_commands_bias.cpp new file mode 100644 index 0000000000..293fbb1fb4 --- /dev/null +++ b/lib/colvars/colvarscript_commands_bias.cpp @@ -0,0 +1,49 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + + +#include +#include +#include +#include + +#include "colvarproxy.h" +#include "colvardeps.h" +#include "colvarscript.h" +#include "colvarscript_commands.h" + + + +// Instantiate the body of all bias-specific script commands + +#define CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + int CVSCRIPT_COMM_FNAME(COMM)(void *pobj, \ + int objc, unsigned char *const objv[]) \ + { \ + if (cvm::debug()) { \ + cvm::log("Executing script function \""+std::string(#COMM)+"\""); \ + } \ + colvarscript *script = colvarscript_obj(); \ + script->clear_str_result(); \ + if (script->check_bias_cmd_nargs(#COMM, \ + objc, N_ARGS_MIN, N_ARGS_MAX) != \ + COLVARSCRIPT_OK) { \ + return COLVARSCRIPT_ERROR; \ + } \ + colvarbias *this_bias = colvarbias_obj(pobj); \ + FN_BODY; \ + } +#undef CVSCRIPT +#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) + +#include "colvarscript_commands_bias.h" + +#undef CVSCRIPT_COMM_FN +#undef CVSCRIPT diff --git a/lib/colvars/colvarscript_commands_bias.h b/lib/colvars/colvarscript_commands_bias.h new file mode 100644 index 0000000000..990902e239 --- /dev/null +++ b/lib/colvars/colvarscript_commands_bias.h @@ -0,0 +1,173 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + + +CVSCRIPT(bias_bin, + "Get the current grid bin index (1D ABF only for now)", + 0, 0, + "", + script->set_result_str(cvm::to_str(this_bias->current_bin())); + return COLVARS_OK; + ) + +CVSCRIPT(bias_bincount, + "Get the number of samples at the given grid bin (1D ABF only for now)", + 0, 1, + "index : integer - Grid index; defaults to current bin", + int index = this_bias->current_bin(); + char const *indexarg = + script->obj_to_str(script->get_bias_cmd_arg(0, objc, objv)); + if (indexarg) { + std::string const param(indexarg); + if (!(std::istringstream(param) >> index)) { + script->add_error_msg("bincount: error parsing bin index"); + return COLVARSCRIPT_ERROR; + } + } + script->set_result_str(cvm::to_str(this_bias->bin_count(index))); + return COLVARS_OK; + ) + +CVSCRIPT(bias_binnum, + "Get the total number of grid points of this bias (1D ABF only for now)", + 0, 0, + "", + int r = this_bias->bin_num(); + if (r < 0) { + script->add_error_msg("Error: calling bin_num() for bias " + + this_bias->name); + return COLVARSCRIPT_ERROR; + } + script->set_result_str(cvm::to_str(r)); + return COLVARS_OK; + ) + +CVSCRIPT(bias_delete, + "Delete this bias", + 0, 0, + "", + delete this_bias; + return COLVARS_OK; + ) + +CVSCRIPT(bias_energy, + "Get the current energy of this bias", + 0, 0, + "", + script->set_result_str(cvm::to_str(this_bias->get_energy())); + return COLVARS_OK; + ) + +CVSCRIPT(bias_get, + "Get the value of the given feature for this bias", + 1, 1, + "feature : string - Name of the feature", + return script->proc_features(this_bias, objc, objv); + ) + +CVSCRIPT(bias_getconfig, + "Return the configuration string of this bias", + 0, 0, + "", + script->set_result_str(this_bias->get_config()); + return COLVARS_OK; + ) + +CVSCRIPT(bias_help, + "Get a help summary or the help string of one bias subcommand", + 0, 1, + "command : string - Get the help string of this specific command", + unsigned char *const cmdobj = + script->get_colvar_cmd_arg(0, objc, objv); + if (this_bias) { + } + if (cmdobj) { + std::string const cmdstr(script->obj_to_str(cmdobj)); + if (cmdstr.size()) { + script->set_result_str(script->get_command_cmdline_help(colvarscript::use_bias, + cmdstr)); + return COLVARS_OK; + } else { + return COLVARSCRIPT_ERROR; + } + } else { + script->set_result_str(script->get_cmdline_help_summary(colvarscript::use_bias)); + return COLVARS_OK; + } + ) + +CVSCRIPT(bias_load, + "Load data into this bias", + 1, 1, + "prefix : string - Read from a file with this name or prefix", + char const *arg = + script->obj_to_str(script->get_bias_cmd_arg(0, objc, objv)); + return this_bias->read_state_prefix(std::string(arg)); + ) + +CVSCRIPT(bias_loadfromstring, + "Load state data into this bias from a string", + 1, 1, + "buffer : string - String buffer containing the state information", + char const *buffer = script->obj_to_str(script->get_bias_cmd_arg(0, objc, objv)); + return this_bias->read_state_string(buffer); + ) + +CVSCRIPT(bias_save, + "Save data from this bias into a file with the given prefix", + 1, 1, + "prefix : string - Prefix for the state file of this bias", + std::string const prefix = + cvm::state_file_prefix(script->obj_to_str(script->get_bias_cmd_arg(0, objc, objv))); + return this_bias->write_state_prefix(prefix); + ) + +CVSCRIPT(bias_savetostring, + "Save data from this bias into a string and return it", + 0, 0, + "", + return this_bias->write_state_string(script->modify_str_result()); + ) + +CVSCRIPT(bias_set, + "Set the given feature of this bias to a new value", + 2, 2, + "feature : string - Name of the feature\n" + "value : string - String representation of the new feature value", + return script->proc_features(this_bias, objc, objv); + ) + +CVSCRIPT(bias_share, + "Share bias information with other replicas (multiple-walker scheme)", + 0, 0, + "", + if (this_bias->replica_share() != COLVARS_OK) { + script->add_error_msg("Error: calling replica_share() for bias " + + this_bias->name); + return COLVARSCRIPT_ERROR; + } + return COLVARS_OK; + ) + +CVSCRIPT(bias_state, + "Print a string representation of the feature state of this bias", + 0, 0, + "", + this_bias->print_state(); + return COLVARS_OK; + ) + +CVSCRIPT(bias_update, + "Recompute this bias and return its up-to-date energy", + 0, 0, + "", + this_bias->update(); + script->set_result_str(cvm::to_str(this_bias->get_energy())); + return COLVARS_OK; + ) diff --git a/lib/colvars/colvarscript_commands_colvar.cpp b/lib/colvars/colvarscript_commands_colvar.cpp new file mode 100644 index 0000000000..12c90ceb2b --- /dev/null +++ b/lib/colvars/colvarscript_commands_colvar.cpp @@ -0,0 +1,49 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + + +#include +#include +#include +#include + +#include "colvarproxy.h" +#include "colvardeps.h" +#include "colvarscript.h" +#include "colvarscript_commands.h" + + + +// Instantiate the body of all colvar-specific script commands + +#define CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + int CVSCRIPT_COMM_FNAME(COMM)(void *pobj, \ + int objc, unsigned char *const objv[]) \ + { \ + if (cvm::debug()) { \ + cvm::log("Executing script function \""+std::string(#COMM)+"\""); \ + } \ + colvarscript *script = colvarscript_obj(); \ + script->clear_str_result(); \ + if (script->check_colvar_cmd_nargs(#COMM, \ + objc, N_ARGS_MIN, N_ARGS_MAX) != \ + COLVARSCRIPT_OK) { \ + return COLVARSCRIPT_ERROR; \ + } \ + colvar *this_colvar = colvar_obj(pobj); \ + FN_BODY; \ + } +#undef CVSCRIPT +#define CVSCRIPT(COMM,HELP,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) \ + CVSCRIPT_COMM_FN(COMM,N_ARGS_MIN,N_ARGS_MAX,ARGS,FN_BODY) + +#include "colvarscript_commands_colvar.h" + +#undef CVSCRIPT_COMM_FN +#undef CVSCRIPT diff --git a/lib/colvars/colvarscript_commands_colvar.h b/lib/colvars/colvarscript_commands_colvar.h new file mode 100644 index 0000000000..b880b5b8be --- /dev/null +++ b/lib/colvars/colvarscript_commands_colvar.h @@ -0,0 +1,239 @@ +// -*- c++ -*- + +// This file is part of the Collective Variables module (Colvars). +// The original version of Colvars and its updates are located at: +// https://github.com/Colvars/colvars +// Please update all Colvars source files before making any changes. +// If you wish to distribute your changes, please submit them to the +// Colvars repository at GitHub. + + +CVSCRIPT(colvar_addforce, + "Apply the given force onto this colvar and return the same", + 1, 1, + "force : float or array - Applied force; must match colvar dimensionality", + std::string const f_str(script->obj_to_str(script->get_colvar_cmd_arg(0, objc, objv))); + std::istringstream is(f_str); + is.width(cvm::cv_width); + is.precision(cvm::cv_prec); + colvarvalue force(this_colvar->value()); + force.is_derivative(); + if (force.from_simple_string(is.str()) != COLVARS_OK) { + script->add_error_msg("addforce : error parsing force value"); + return COLVARSCRIPT_ERROR; + } + this_colvar->add_bias_force(force); + script->set_result_str(force.to_simple_string()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_cvcflags, + "Enable or disable individual components by setting their active flags", + 1, 1, + "flags : integer array - Zero/nonzero value disables/enables the CVC", + std::string const flags_str(script->obj_to_str(script->get_colvar_cmd_arg(0, objc, objv))); + std::istringstream is(flags_str); + std::vector flags; + int flag; + while (is >> flag) { + flags.push_back(flag != 0); + } + int res = this_colvar->set_cvc_flags(flags); + if (res != COLVARS_OK) { + script->add_error_msg("Error setting CVC flags"); + return COLVARSCRIPT_ERROR; + } + script->set_result_str("0"); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_delete, + "Delete this colvar, along with all biases that depend on it", + 0, 0, + "", + delete this_colvar; + return COLVARS_OK; + ) + +CVSCRIPT(colvar_get, + "Get the value of the given feature for this colvar", + 1, 1, + "feature : string - Name of the feature", + return script->proc_features(this_colvar, objc, objv); + ) + +CVSCRIPT(colvar_getappliedforce, + "Return the total of the forces applied to this colvar", + 0, 0, + "", + script->set_result_str((this_colvar->applied_force()).to_simple_string()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_getatomgroups, + "Return the atom indices used by this colvar as a list of lists", + 0, 0, + "", + std::string result; + std::vector > lists = this_colvar->get_atom_lists(); + std::vector >::iterator li = lists.begin(); + for ( ; li != lists.end(); ++li) { + result += "{"; + std::vector::iterator lj = (*li).begin(); + for ( ; lj != (*li).end(); ++lj) { + result += cvm::to_str(*lj); + result += " "; + } + result += "} "; + } + script->set_result_str(result); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_getatomids, + "Return the list of atom indices used by this colvar", + 0, 0, + "", + std::string result; + std::vector::iterator li = this_colvar->atom_ids.begin(); + for ( ; li != this_colvar->atom_ids.end(); ++li) { + result += cvm::to_str(*li); + result += " "; + } + script->set_result_str(result); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_getconfig, + "Return the configuration string of this colvar", + 0, 0, + "", + script->set_result_str(this_colvar->get_config()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_getgradients, + "Return the atomic gradients of this colvar", + 0, 0, + "", + std::string result; + std::vector::iterator li = + this_colvar->atomic_gradients.begin(); + for ( ; li != this_colvar->atomic_gradients.end(); ++li) { + result += "{"; + int j; + for (j = 0; j < 3; ++j) { + result += cvm::to_str((*li)[j]); + result += " "; + } + result += "} "; + } + script->set_result_str(result); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_gettotalforce, + "Return the sum of internal and external forces to this colvar", + 0, 0, + "", + script->set_result_str((this_colvar->total_force()).to_simple_string()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_help, + "Get a help summary or the help string of one colvar subcommand", + 0, 1, + "command : string - Get the help string of this specific command", + unsigned char *const cmdobj = + script->get_colvar_cmd_arg(0, objc, objv); + if (this_colvar) { + } + if (cmdobj) { + std::string const cmdstr(script->obj_to_str(cmdobj)); + if (cmdstr.size()) { + script->set_result_str(script->get_command_cmdline_help(colvarscript::use_colvar, + cmdstr)); + return cvm::get_error(); + } else { + return COLVARSCRIPT_ERROR; + } + } else { + script->set_result_str(script->get_cmdline_help_summary(colvarscript::use_colvar)); + return COLVARS_OK; + } + ) + +CVSCRIPT(colvar_modifycvcs, + "Modify configuration of individual components by passing string arguments", + 1, 1, + "confs : sequence of strings - New configurations; empty strings are skipped", + std::vector const confs(script->proxy()->script_obj_to_str_vector(script->get_colvar_cmd_arg(0, objc, objv))); + cvm::increase_depth(); + int res = this_colvar->update_cvc_config(confs); + cvm::decrease_depth(); + if (res != COLVARS_OK) { + script->add_error_msg("Error setting CVC flags"); + return COLVARSCRIPT_ERROR; + } + script->set_result_str("0"); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_run_ave, + "Get the current running average of the value of this colvar", + 0, 0, + "", + script->set_result_str(this_colvar->run_ave().to_simple_string()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_set, + "Set the given feature of this colvar to a new value", + 2, 2, + "feature : string - Name of the feature\n" + "value : string - String representation of the new feature value", + return script->proc_features(this_colvar, objc, objv); + ) + +CVSCRIPT(colvar_state, + "Print a string representation of the feature state of this colvar", + 0, 0, + "", + this_colvar->print_state(); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_type, + "Get the type description of this colvar", + 0, 0, + "", + script->set_result_str(this_colvar->value().type_desc(this_colvar->value().value_type)); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_update, + "Recompute this colvar and return its up-to-date value", + 0, 0, + "", + this_colvar->calc(); + this_colvar->update_forces_energy(); + script->set_result_str((this_colvar->value()).to_simple_string()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_value, + "Get the current value of this colvar", + 0, 0, + "", + script->set_result_str(this_colvar->value().to_simple_string()); + return COLVARS_OK; + ) + +CVSCRIPT(colvar_width, + "Get the width of this colvar", + 0, 0, + "", + script->set_result_str(cvm::to_str(this_colvar->width, 0, + cvm::cv_prec)); + return COLVARS_OK; + ) diff --git a/lib/colvars/colvartypes.cpp b/lib/colvars/colvartypes.cpp index da00183323..3cbaed63a8 100644 --- a/lib/colvars/colvartypes.cpp +++ b/lib/colvars/colvartypes.cpp @@ -14,25 +14,19 @@ #include "colvartypes.h" #include "colvarparse.h" +#ifdef COLVARS_LAMMPS +// Use open-source Jacobi implementation +#include "math_eigen_impl.h" +#else +// Fall back to NR routine +#include "nr_jacobi.h" +#endif + bool colvarmodule::rotation::monitor_crossings = false; cvm::real colvarmodule::rotation::crossing_threshold = 1.0E-02; -namespace { - -/// Numerical recipes diagonalization -static int jacobi(cvm::real **a, cvm::real *d, cvm::real **v, int *nrot); - -/// Eigenvector sort -static int eigsrt(cvm::real *d, cvm::real **v); - -/// Transpose the matrix -static int transpose(cvm::real **v); - -} - - std::string cvm::rvector::to_simple_string() const { std::ostringstream os; @@ -74,7 +68,7 @@ std::ostream & operator << (std::ostream &os, colvarmodule::rvector const &v) std::istream & operator >> (std::istream &is, colvarmodule::rvector &v) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); char sep; if ( !(is >> sep) || !(sep == '(') || !(is >> v.x) || !(is >> sep) || !(sep == ',') || @@ -130,7 +124,7 @@ std::ostream & operator << (std::ostream &os, colvarmodule::quaternion const &q) std::istream & operator >> (std::istream &is, colvarmodule::quaternion &q) { - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); std::string euler(""); @@ -248,6 +242,66 @@ cvm::quaternion::position_derivative_inner(cvm::rvector const &pos, // Seok C, Dill KA. Using quaternions to calculate RMSD. J Comput // Chem. 25(15):1849-57 (2004) DOI: 10.1002/jcc.20110 PubMed: 15376254 +#ifdef COLVARS_LAMMPS +namespace { + inline void *new_Jacobi_solver(int size) { + return reinterpret_cast(new MathEigen::Jacobi &, + cvm::matrix2d &>(4)); + } +} +#endif + + +colvarmodule::rotation::rotation() +{ + b_debug_gradients = false; +#ifdef COLVARS_LAMMPS + jacobi = new_Jacobi_solver(4); +#else + jacobi = NULL; +#endif +} + + +colvarmodule::rotation::rotation(cvm::quaternion const &qi) + : q(qi) +{ + b_debug_gradients = false; +#ifdef COLVARS_LAMMPS + jacobi = new_Jacobi_solver(4); +#else + jacobi = NULL; +#endif +} + + +colvarmodule::rotation::rotation(cvm::real angle, cvm::rvector const &axis) +{ + b_debug_gradients = false; + cvm::rvector const axis_n = axis.unit(); + cvm::real const sina = cvm::sin(angle/2.0); + q = cvm::quaternion(cvm::cos(angle/2.0), + sina * axis_n.x, sina * axis_n.y, sina * axis_n.z); +#ifdef COLVARS_LAMMPS + jacobi = new_Jacobi_solver(4); +#else + jacobi = NULL; +#endif +} + + +colvarmodule::rotation::~rotation() +{ +#ifdef COLVARS_LAMMPS + delete reinterpret_cast< + MathEigen::Jacobi &, + cvm::matrix2d &> *>(jacobi); +#endif +} + + void colvarmodule::rotation::build_correlation_matrix( std::vector const &pos1, std::vector const &pos2) @@ -291,10 +345,12 @@ void colvarmodule::rotation::compute_overlap_matrix() } -void colvarmodule::rotation::diagonalize_matrix( - cvm::matrix2d &m, - cvm::vector1d &eigval, - cvm::matrix2d &eigvec) +#ifndef COLVARS_LAMMPS +namespace { + +void diagonalize_matrix(cvm::matrix2d &m, + cvm::vector1d &eigval, + cvm::matrix2d &eigvec) { eigval.resize(4); eigval.reset(); @@ -303,15 +359,15 @@ void colvarmodule::rotation::diagonalize_matrix( // diagonalize int jac_nrot = 0; - if (jacobi(m.c_array(), eigval.c_array(), eigvec.c_array(), &jac_nrot) != + if (NR_Jacobi::jacobi(m.c_array(), eigval.c_array(), eigvec.c_array(), &jac_nrot) != COLVARS_OK) { - cvm::error("Too many iterations in routine jacobi.\n" + cvm::error("Too many iterations in jacobi diagonalization.\n" "This is usually the result of an ill-defined set of atoms for " "rotational alignment (RMSD, rotateReference, etc).\n"); } - eigsrt(eigval.c_array(), eigvec.c_array()); + NR_Jacobi::eigsrt(eigval.c_array(), eigvec.c_array()); // jacobi saves eigenvectors by columns - transpose(eigvec.c_array()); + NR_Jacobi::transpose(eigvec.c_array()); // normalize eigenvectors for (size_t ie = 0; ie < 4; ie++) { @@ -327,6 +383,9 @@ void colvarmodule::rotation::diagonalize_matrix( } } +} +#endif + // Calculate the rotation, plus its derivatives @@ -349,7 +408,28 @@ void colvarmodule::rotation::calc_optimal_rotation( cvm::log("S = "+cvm::to_str(S_backup, cvm::cv_width, cvm::cv_prec)+"\n"); } + S_eigval.resize(4); + S_eigvec.resize(4, 4); + +#ifdef COLVARS_LAMMPS + MathEigen::Jacobi &, + cvm::matrix2d &> *ecalc = + reinterpret_cast &, + cvm::matrix2d &> *>(jacobi); + + int ierror = ecalc->Diagonalize(S, S_eigval, S_eigvec); + if (ierror) { + cvm::error("Too many iterations in jacobi diagonalization.\n" + "This is usually the result of an ill-defined set of atoms for " + "rotational alignment (RMSD, rotateReference, etc).\n"); + } +#else diagonalize_matrix(S, S_eigval, S_eigvec); +#endif + + // eigenvalues and eigenvectors cvm::real const L0 = S_eigval[0]; cvm::real const L1 = S_eigval[1]; @@ -521,7 +601,11 @@ void colvarmodule::rotation::calc_optimal_rotation( // cvm::log("S_new = "+cvm::to_str(cvm::to_str (S_new), cvm::cv_width, cvm::cv_prec)+"\n"); +#ifdef COLVARS_LAMMPS + ecalc->Diagonalize(S_new, S_new_eigval, S_new_eigvec); +#else diagonalize_matrix(S_new, S_new_eigval, S_new_eigvec); +#endif cvm::real const &L0_new = S_new_eigval[0]; cvm::quaternion const Q0_new(S_new_eigvec[0]); @@ -544,138 +628,3 @@ void colvarmodule::rotation::calc_optimal_rotation( -// Numerical Recipes routine for diagonalization - -#define ROTATE(a,i,j,k,l) g=a[i][j]; \ - h=a[k][l]; \ - a[i][j]=g-s*(h+g*tau); \ - a[k][l]=h+s*(g-h*tau); - -#define n 4 - - -namespace { - -int jacobi(cvm::real **a, cvm::real *d, cvm::real **v, int *nrot) -{ - int j,iq,ip,i; - cvm::real tresh,theta,tau,t,sm,s,h,g,c; - - cvm::vector1d b(n); - cvm::vector1d z(n); - - for (ip=0;ip 4 && (cvm::real)(cvm::fabs(d[ip])+g) == (cvm::real)cvm::fabs(d[ip]) - && (cvm::real)(cvm::fabs(d[iq])+g) == (cvm::real)cvm::fabs(d[iq])) - a[ip][iq]=0.0; - else if (cvm::fabs(a[ip][iq]) > tresh) { - h=d[iq]-d[ip]; - if ((cvm::real)(cvm::fabs(h)+g) == (cvm::real)cvm::fabs(h)) - t=(a[ip][iq])/h; - else { - theta=0.5*h/(a[ip][iq]); - t=1.0/(cvm::fabs(theta)+cvm::sqrt(1.0+theta*theta)); - if (theta < 0.0) t = -t; - } - c=1.0/cvm::sqrt(1+t*t); - s=t*c; - tau=s/(1.0+c); - h=t*a[ip][iq]; - z[ip] -= h; - z[iq] += h; - d[ip] -= h; - d[iq] += h; - a[ip][iq]=0.0; - for (j=0;j<=ip-1;j++) { - ROTATE(a,j,ip,j,iq) - } - for (j=ip+1;j<=iq-1;j++) { - ROTATE(a,ip,j,j,iq) - } - for (j=iq+1;j= p) p=d[k=j]; - if (k != i) { - d[k]=d[i]; - d[i]=p; - for (j=0;j &v) { if (v.size() == 0) return is; - size_t const start_pos = is.tellg(); + std::streampos const start_pos = is.tellg(); char sep; if ( !(is >> sep) || !(sep == '(') ) { is.clear(); @@ -1389,30 +1389,16 @@ public: std::vector const &pos2); /// Default constructor - inline rotation() - : b_debug_gradients(false) - {} + rotation(); /// Constructor after a quaternion - inline rotation(cvm::quaternion const &qi) - : q(qi), - b_debug_gradients(false) - { - } + rotation(cvm::quaternion const &qi); /// Constructor after an axis of rotation and an angle (in radians) - inline rotation(cvm::real angle, cvm::rvector const &axis) - : b_debug_gradients(false) - { - cvm::rvector const axis_n = axis.unit(); - cvm::real const sina = cvm::sin(angle/2.0); - q = cvm::quaternion(cvm::cos(angle/2.0), - sina * axis_n.x, sina * axis_n.y, sina * axis_n.z); - } + rotation(cvm::real angle, cvm::rvector const &axis); /// Destructor - inline ~rotation() - {} + ~rotation(); /// Return the rotated vector inline cvm::rvector rotate(cvm::rvector const &v) const @@ -1432,7 +1418,6 @@ public: return q.rotation_matrix(); } - /// \brief Return the spin angle (in degrees) with respect to the /// provided axis (which MUST be normalized) inline cvm::real spin_angle(cvm::rvector const &axis) const @@ -1537,10 +1522,8 @@ protected: /// Compute the overlap matrix S (used by calc_optimal_rotation()) void compute_overlap_matrix(); - /// Diagonalize a given matrix m (used by calc_optimal_rotation()) - static void diagonalize_matrix(cvm::matrix2d &m, - cvm::vector1d &eigval, - cvm::matrix2d &eigvec); + /// Pointer to instance of Jacobi solver + void *jacobi; }; diff --git a/lib/compress/Makefile.lammps b/lib/compress/Makefile.lammps index 2d06990d82..c0a42443ba 100644 --- a/lib/compress/Makefile.lammps +++ b/lib/compress/Makefile.lammps @@ -1,21 +1,24 @@ # This file contains the settings to build and link LAMMPS with # support for data compression libraries. -# +# # When you build LAMMPS with the COMPRESS package installed, it will # use the 3 settings in this file. They should be set as follows. -# -# The compress_SYSLIB setting is for linking the compression library. -# By default, the setting will point to zlib (-lz). -# -# The compress_SYSINC and compress_SYSPATH variables do not typically need -# to be set, as compression libraries are usually installed as packages -# in system locations. Otherwise, specify its directory via the -# compress_SYSPATH variable, e.g. -Ldir or compress_SYSINC variable( -Idir) +# +# The compress_SYSLIB setting is for linking the compression libraries. +# By default, the setting will point to zlib (-lz). For including +# Zstandard support add -DLAMMPS_ZSTD to compress_SYSINC and also +# add -lzstd to compress_SYSLIB to link to the library. +# +# The compress_SYSINC and compress_SYSPATH variables typically do not +# need any additional settings, as compression libraries are usually +# installed as packages in system locations. Otherwise, specify its +# library directory via the compress_SYSPATH variable, e.g. -Ldir or +# its include directory via the compress_SYSINC variable( -Idir) # ----------------------------------------------------------- # Settings that the LAMMPS build will import when this package is installed -compress_SYSINC = -compress_SYSLIB = -lz +compress_SYSINC = # -DLAMMPS_ZSTD +compress_SYSLIB = -lz # -lzstd compress_SYSPATH = diff --git a/lib/gpu/Makefile.linux b/lib/gpu/Makefile.linux index a26fbe114c..da18ae41ca 100644 --- a/lib/gpu/Makefile.linux +++ b/lib/gpu/Makefile.linux @@ -22,13 +22,13 @@ NVCC = nvcc #CUDA_ARCH = -arch=sm_21 # Kepler hardware -CUDA_ARCH = -arch=sm_30 +#CUDA_ARCH = -arch=sm_30 #CUDA_ARCH = -arch=sm_32 #CUDA_ARCH = -arch=sm_35 #CUDA_ARCH = -arch=sm_37 # Maxwell hardware -#CUDA_ARCH = -arch=sm_50 +CUDA_ARCH = -arch=sm_50 #CUDA_ARCH = -arch=sm_52 # Pascal hardware @@ -57,7 +57,7 @@ CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC -CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC +CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11 CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias BIN_DIR = ./ diff --git a/lib/gpu/Makefile.linux.double b/lib/gpu/Makefile.linux.double index 05f083697d..485b636e15 100644 --- a/lib/gpu/Makefile.linux.double +++ b/lib/gpu/Makefile.linux.double @@ -7,18 +7,40 @@ EXTRAMAKE = Makefile.lammps.standard +ifeq ($(CUDA_HOME),) CUDA_HOME = /usr/local/cuda +endif + NVCC = nvcc -# Kepler CUDA -#CUDA_ARCH = -arch=sm_35 -# Tesla CUDA -CUDA_ARCH = -arch=sm_21 -# newer CUDA +# obsolete hardware. not supported by current drivers anymore. #CUDA_ARCH = -arch=sm_13 -# older CUDA #CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE +# Fermi hardware +#CUDA_ARCH = -arch=sm_20 +#CUDA_ARCH = -arch=sm_21 + +# Kepler hardware +#CUDA_ARCH = -arch=sm_30 +#CUDA_ARCH = -arch=sm_32 +#CUDA_ARCH = -arch=sm_35 +#CUDA_ARCH = -arch=sm_37 + +# Maxwell hardware +CUDA_ARCH = -arch=sm_50 +#CUDA_ARCH = -arch=sm_52 + +# Pascal hardware +#CUDA_ARCH = -arch=sm_60 +#CUDA_ARCH = -arch=sm_61 + +# Volta hardware +#CUDA_ARCH = -arch=sm_70 + +# Turing hardware +#CUDA_ARCH = -arch=sm_75 + # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL @@ -33,10 +55,10 @@ CUDA_PRECISION = -D_DOUBLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -CUDA_OPTS = -DUNIX -O3 --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC -CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias +CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11 +CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias BIN_DIR = ./ OBJ_DIR = ./ diff --git a/lib/gpu/Makefile.linux.mixed b/lib/gpu/Makefile.linux.mixed index ca414f1fc1..69c2de9ab0 100644 --- a/lib/gpu/Makefile.linux.mixed +++ b/lib/gpu/Makefile.linux.mixed @@ -7,18 +7,41 @@ EXTRAMAKE = Makefile.lammps.standard +ifeq ($(CUDA_HOME),) CUDA_HOME = /usr/local/cuda +endif + NVCC = nvcc -# Kepler CUDA -#CUDA_ARCH = -arch=sm_35 -# Tesla CUDA -CUDA_ARCH = -arch=sm_21 -# newer CUDA +# obsolete hardware. not supported by current drivers anymore. #CUDA_ARCH = -arch=sm_13 # older CUDA #CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE +# Fermi hardware +#CUDA_ARCH = -arch=sm_20 +#CUDA_ARCH = -arch=sm_21 + +# Kepler hardware +#CUDA_ARCH = -arch=sm_30 +#CUDA_ARCH = -arch=sm_32 +#CUDA_ARCH = -arch=sm_35 +#CUDA_ARCH = -arch=sm_37 + +# Maxwell hardware +CUDA_ARCH = -arch=sm_50 +#CUDA_ARCH = -arch=sm_52 + +# Pascal hardware +#CUDA_ARCH = -arch=sm_60 +#CUDA_ARCH = -arch=sm_61 + +# Volta hardware +#CUDA_ARCH = -arch=sm_70 + +# Turing hardware +#CUDA_ARCH = -arch=sm_75 + # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL @@ -33,10 +56,10 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -CUDA_OPTS = -DUNIX -O3 --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC -CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias +CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11 +CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias BIN_DIR = ./ OBJ_DIR = ./ diff --git a/lib/gpu/Makefile.linux.single b/lib/gpu/Makefile.linux.single index 1b349faac2..38ea3dc204 100644 --- a/lib/gpu/Makefile.linux.single +++ b/lib/gpu/Makefile.linux.single @@ -7,18 +7,40 @@ EXTRAMAKE = Makefile.lammps.standard +ifeq ($(CUDA_HOME),) CUDA_HOME = /usr/local/cuda +endif + NVCC = nvcc -# Kepler CUDA -#CUDA_ARCH = -arch=sm_35 -# Tesla CUDA -CUDA_ARCH = -arch=sm_21 -# newer CUDA +# obsolete hardware. not supported by current drivers anymore. #CUDA_ARCH = -arch=sm_13 -# older CUDA #CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE +# Fermi hardware +#CUDA_ARCH = -arch=sm_20 +#CUDA_ARCH = -arch=sm_21 + +# Kepler hardware +#CUDA_ARCH = -arch=sm_30 +#CUDA_ARCH = -arch=sm_32 +#CUDA_ARCH = -arch=sm_35 +#CUDA_ARCH = -arch=sm_37 + +# Maxwell hardware +CUDA_ARCH = -arch=sm_50 +#CUDA_ARCH = -arch=sm_52 + +# Pascal hardware +#CUDA_ARCH = -arch=sm_60 +#CUDA_ARCH = -arch=sm_61 + +# Volta hardware +#CUDA_ARCH = -arch=sm_70 + +# Turing hardware +#CUDA_ARCH = -arch=sm_75 + # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL @@ -33,10 +55,10 @@ CUDA_PRECISION = -D_SINGLE_SINGLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -CUDA_OPTS = -DUNIX -O3 --use_fast_math +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC -CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias +CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11 +CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias BIN_DIR = ./ OBJ_DIR = ./ diff --git a/lib/gpu/Makefile.linux_multi b/lib/gpu/Makefile.linux_multi index ba50170f39..e0c250a951 100644 --- a/lib/gpu/Makefile.linux_multi +++ b/lib/gpu/Makefile.linux_multi @@ -13,17 +13,27 @@ endif NVCC = nvcc -# Kepler CUDA -#CUDA_ARCH = -arch=sm_35 -# newer CUDA +# obsolete hardware. not supported by current drivers anymore. #CUDA_ARCH = -arch=sm_13 -# older CUDA #CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE -CUDA_ARCH = -arch=sm_30 -CUDA_CODE = -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ - -gencode arch=compute_30,code=[sm_30,compute_30] -gencode arch=compute_35,code=[sm_35,compute_35] \ - -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] +# Fermi hardware +#CUDA_ARCH = -arch=sm_20 +#CUDA_ARCH = -arch=sm_21 + +# Kepler hardware +#CUDA_ARCH = -arch=sm_30 +#CUDA_ARCH = -arch=sm_32 +#CUDA_ARCH = -arch=sm_35 +#CUDA_ARCH = -arch=sm_37 + +# Maxwell hardware +CUDA_ARCH = -arch=sm_50 +#CUDA_ARCH = -arch=sm_52 + +CUDA_CODE = -gencode arch=compute_50,code=[sm_50,compute_50] -gencode arch=compute_52,code=[sm_52,compute_52] \ + -gencode arch=compute_60,code=[sm_60,compute_60] -gencode arch=compute_61,code=[sm_61,compute_61] \ + -gencode arch=compute_70,code=[sm_70,compute_70] -gencode arch=compute_75,code=[sm_75,compute_75] CUDA_ARCH += $(CUDA_CODE) @@ -41,9 +51,9 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler "-fPIC -std=c++98" +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC -CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC +CUDR_CPP = mpicxx -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -DOMPI_SKIP_MPICXX=1 -fPIC -std=c++11 CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias BIN_DIR = ./ diff --git a/lib/gpu/Makefile.linux_opencl b/lib/gpu/Makefile.linux_opencl index 640562dca5..2aea7f5a46 100644 --- a/lib/gpu/Makefile.linux_opencl +++ b/lib/gpu/Makefile.linux_opencl @@ -17,8 +17,8 @@ OCL_TUNE = -DGENERIC_OCL # -- Uncomment for generic device LMP_INC = -DLAMMPS_SMALLBIG OCL_INC = -I/usr/local/cuda/include # Path to CL directory -OCL_CPP = mpic++ $(DEFAULT_DEVICE) -O3 -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) -OCL_LINK = -lOpenCL +OCL_CPP = mpic++ $(DEFAULT_DEVICE) -O3 -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK $(LMP_INC) $(OCL_INC) -std=c++11 +OCL_LINK = -L/usr/local/cuda/lib64 -lOpenCL OCL_PREC = -D_SINGLE_DOUBLE BIN_DIR = ./ diff --git a/lib/gpu/Makefile.mac b/lib/gpu/Makefile.mac deleted file mode 100644 index b571e8d85a..0000000000 --- a/lib/gpu/Makefile.mac +++ /dev/null @@ -1,32 +0,0 @@ -# /* ---------------------------------------------------------------------- -# Generic Mac Makefile for CUDA -# - 32-bit (requires adding -m32 to LAMMPS Makefile) -# - Change CUDA_ARCH for your GPU -# ------------------------------------------------------------------------- */ - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.standard - -CUDA_HOME = /usr/local/cuda -NVCC = nvcc -m64 - -CUDA_ARCH = -arch=sm_11 -CUDA_PRECISION = -D_SINGLE_SINGLE -CUDA_INCLUDE = -I$(CUDA_HOME)/include -CUDA_LIB = -L$(CUDA_HOME)/lib -L$(CUDA_HOME)/lib/stubs -CUDA_OPTS = -DUNIX -DUCL_NO_EXIT -O3 --use_fast_math - -CUDR_CPP = mpic++ -m64 -CUDR_OPTS = -O2 -g - -BIN_DIR = ./ -OBJ_DIR = ./ -LIB_DIR = ./ -AR = ar -BSH = /bin/sh - -CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini - -include Nvidia.makefile - diff --git a/lib/gpu/Makefile.serial b/lib/gpu/Makefile.serial index b0cfb3c86b..82d10deea2 100644 --- a/lib/gpu/Makefile.serial +++ b/lib/gpu/Makefile.serial @@ -13,13 +13,33 @@ endif NVCC = nvcc -# Tesla CUDA -CUDA_ARCH = -arch=sm_21 -# newer CUDA +# obsolete hardware. not supported by current drivers anymore. #CUDA_ARCH = -arch=sm_13 -# older CUDA #CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE -CUDA_ARCH = -arch=sm_35 + +# Fermi hardware +#CUDA_ARCH = -arch=sm_20 +#CUDA_ARCH = -arch=sm_21 + +# Kepler hardware +#CUDA_ARCH = -arch=sm_30 +#CUDA_ARCH = -arch=sm_32 +#CUDA_ARCH = -arch=sm_35 +#CUDA_ARCH = -arch=sm_37 + +# Maxwell hardware +CUDA_ARCH = -arch=sm_50 +#CUDA_ARCH = -arch=sm_52 + +# Pascal hardware +#CUDA_ARCH = -arch=sm_60 +#CUDA_ARCH = -arch=sm_61 + +# Volta hardware +#CUDA_ARCH = -arch=sm_70 + +# Turing hardware +#CUDA_ARCH = -arch=sm_75 # this setting should match LAMMPS Makefile # one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL @@ -35,9 +55,9 @@ CUDA_PRECISION = -D_SINGLE_DOUBLE CUDA_INCLUDE = -I$(CUDA_HOME)/include CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -L../../src/STUBS -lmpi_stubs -CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) +CUDA_OPTS = -DUNIX -O3 --use_fast_math $(LMP_INC) -Xcompiler -fPIC -CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -fPIC -I../../src/STUBS +CUDR_CPP = g++ -DMPI_GERYON -DUCL_NO_EXIT -fPIC -I../../src/STUBS -std=c++11 CUDR_OPTS = -O2 $(LMP_INC) # -xHost -no-prec-div -ansi-alias BIN_DIR = ./ diff --git a/lib/gpu/Makefile.shannon b/lib/gpu/Makefile.shannon deleted file mode 100644 index b14bd01ec2..0000000000 --- a/lib/gpu/Makefile.shannon +++ /dev/null @@ -1,50 +0,0 @@ -# /* ---------------------------------------------------------------------- -# Generic Linux Makefile for CUDA -# - Change CUDA_ARCH for your GPU -# ------------------------------------------------------------------------- */ - -# which file will be copied to Makefile.lammps - -EXTRAMAKE = Makefile.lammps.standard - -CUDA_HOME = ${CUDA_ROOT} -NVCC = nvcc - -# Kepler CUDA -CUDA_ARCH = -arch=sm_35 -# Tesla CUDA -#CUDA_ARCH = -arch=sm_21 -# newer CUDA -#CUDA_ARCH = -arch=sm_13 -# older CUDA -#CUDA_ARCH = -arch=sm_10 -DCUDA_PRE_THREE - -# this setting should match LAMMPS Makefile -# one of LAMMPS_SMALLBIG (default), LAMMPS_BIGBIG and LAMMPS_SMALLSMALL - -LMP_INC = -DLAMMPS_SMALLBIG - -# precision for GPU calculations -# -D_SINGLE_SINGLE # Single precision for all calculations -# -D_DOUBLE_DOUBLE # Double precision for all calculations -# -D_SINGLE_DOUBLE # Accumulation of forces, etc. in double - -CUDA_PRECISION = -D_DOUBLE_DOUBLE - -CUDA_INCLUDE = -I$(CUDA_HOME)/include -CUDA_LIB = -L$(CUDA_HOME)/lib64 -L$(CUDA_HOME)/lib64/stubs -CUDA_OPTS = -DUNIX -O3 --use_fast_math - -CUDR_CPP = mpic++ -DMPI_GERYON -DUCL_NO_EXIT -DMPICH_IGNORE_CXX_SEEK -CUDR_OPTS = -O2 # -xHost -no-prec-div -ansi-alias - -BIN_DIR = ./ -OBJ_DIR = ./ -LIB_DIR = ./ -AR = ar -BSH = /bin/sh - -CUDPP_OPT = -DUSE_CUDPP -Icudpp_mini - -include Nvidia.makefile - diff --git a/lib/gpu/cudpp_mini/cudpp.cpp b/lib/gpu/cudpp_mini/cudpp.cpp index e2cd4621a4..9506320748 100644 --- a/lib/gpu/cudpp_mini/cudpp.cpp +++ b/lib/gpu/cudpp_mini/cudpp.cpp @@ -95,7 +95,7 @@ CUDPPResult cudppScan(CUDPPHandle planHandle, size_t numElements) { CUDPPScanPlan *plan = (CUDPPScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppScanDispatch(d_out, d_in, numElements, 1, plan); return CUDPP_SUCCESS; @@ -159,7 +159,7 @@ CUDPPResult cudppSegmentedScan(CUDPPHandle planHandle, { CUDPPSegmentedScanPlan *plan = (CUDPPSegmentedScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppSegmentedScanDispatch(d_out, d_idata, d_iflags, numElements, plan); return CUDPP_SUCCESS; @@ -200,7 +200,7 @@ CUDPPResult cudppMultiScan(CUDPPHandle planHandle, size_t numRows) { CUDPPScanPlan *plan = (CUDPPScanPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppScanDispatch(d_out, d_in, numElements, numRows, plan); return CUDPP_SUCCESS; @@ -255,7 +255,7 @@ CUDPPResult cudppCompact(CUDPPHandle planHandle, size_t numElements) { CUDPPCompactPlan *plan = (CUDPPCompactPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppCompactDispatch(d_out, d_numValidElements, d_in, d_isValid, numElements, plan); @@ -300,7 +300,7 @@ CUDPPResult cudppSort(CUDPPHandle planHandle, size_t numElements) { CUDPPRadixSortPlan *plan = (CUDPPRadixSortPlan*)CUDPPPlanManager::GetPlan(planHandle); - if (plan != NULL) + if (plan != nullptr) { cudppRadixSortDispatch(d_keys, d_values, numElements, keyBits, plan); return CUDPP_SUCCESS; @@ -331,7 +331,7 @@ CUDPPResult cudppSparseMatrixVectorMultiply(CUDPPHandle sparseMatrixHandl CUDPPSparseMatrixVectorMultiplyPlan *plan = (CUDPPSparseMatrixVectorMultiplyPlan*)CUDPPPlanManager::GetPlan(sparseMatrixHandle); - if (plan != NULL) + if (plan != nullptr) { cudppSparseMatrixVectorMultiplyDispatch(d_y, d_x, plan); return CUDPP_SUCCESS; @@ -366,7 +366,7 @@ CUDPP_DLL CUDPPResult cudppRand(CUDPPHandle planHandle,void * d_out, size_t numElements) { CUDPPRandPlan * plan = (CUDPPRandPlan *) CUDPPPlanManager::GetPlan(planHandle); - if(plan != NULL) + if(plan != nullptr) { //dispatch the rand algorithm here cudppRandDispatch(d_out, numElements, plan); diff --git a/lib/gpu/cudpp_mini/cudpp_plan.cpp b/lib/gpu/cudpp_mini/cudpp_plan.cpp index e92a857dd1..8ea99a23fe 100644 --- a/lib/gpu/cudpp_mini/cudpp_plan.cpp +++ b/lib/gpu/cudpp_mini/cudpp_plan.cpp @@ -18,7 +18,7 @@ #include -CUDPPPlanManager* CUDPPPlanManager::m_instance = NULL; +CUDPPPlanManager* CUDPPPlanManager::m_instance = nullptr; CUDPPResult validateOptions(CUDPPConfiguration config, size_t /*numElements*/, size_t numRows, size_t /*rowPitch*/) { diff --git a/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp b/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp index dd9d6eb9db..33c8621d29 100644 --- a/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp +++ b/lib/gpu/cudpp_mini/cudpp_plan_manager.cpp @@ -26,17 +26,17 @@ extern "C" void compNumCTAs(KernelPointer kernel, size_t bytesDynamicSharedMem, //! @internal Instantiate the plan manager singleton object void CUDPPPlanManager::Instantiate() { - if (NULL == m_instance) + if (nullptr == m_instance) m_instance = new CUDPPPlanManager; } //! @internal Destroy the plan manager singleton object void CUDPPPlanManager::Destroy() { - if (NULL != m_instance) + if (nullptr != m_instance) { delete m_instance; - m_instance = NULL; + m_instance = nullptr; } } @@ -51,7 +51,7 @@ CUDPPPlanManager::~CUDPPPlanManager() { CUDPPPlan* plan = it->second; delete plan; - plan = NULL; + plan = nullptr; } m_instance->plans.clear(); @@ -85,7 +85,7 @@ CUDPPHandle CUDPPPlanManager::AddPlan(CUDPPPlan* plan) */ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) { - if (m_instance == NULL) + if (m_instance == nullptr) { return false; } @@ -97,7 +97,7 @@ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) { CUDPPPlan* plan = it->second; delete plan; - plan = NULL; + plan = nullptr; m_instance->plans.erase(it); if (0 == m_instance->plans.size()) @@ -115,14 +115,14 @@ bool CUDPPPlanManager::RemovePlan(CUDPPHandle handle) /** @brief Get a plan from the plan manager by handle * -* @returns A pointer to the plan if found, or NULL otherwise +* @returns A pointer to the plan if found, or nullptr otherwise * @param handle The handle to the requested plan */ CUDPPPlan* CUDPPPlanManager::GetPlan(CUDPPHandle handle) { - if (m_instance == NULL) + if (m_instance == nullptr) { - return NULL; + return nullptr; } std::map::iterator it; @@ -133,13 +133,13 @@ CUDPPPlan* CUDPPPlanManager::GetPlan(CUDPPHandle handle) } else { - return NULL; + return nullptr; } } size_t CUDPPPlanManager::numCTAs(KernelPointer kernel) { - if (m_instance == NULL) + if (m_instance == nullptr) { return 0; } diff --git a/lib/gpu/cudpp_mini/cutil.h b/lib/gpu/cudpp_mini/cutil.h index 7d1fcc17ee..54f29f498e 100644 --- a/lib/gpu/cudpp_mini/cutil.h +++ b/lib/gpu/cudpp_mini/cutil.h @@ -136,7 +136,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -152,7 +152,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -168,7 +168,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -183,7 +183,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -199,7 +199,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -215,7 +215,7 @@ extern "C" { //! @param data uninitialized pointer, returned initialized and pointing to //! the data read //! @param len number of data elements in data, -1 on error - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -307,7 +307,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -350,7 +350,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -366,7 +366,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// @@ -381,7 +381,7 @@ extern "C" { //! @param data handle to the data read //! @param w width of the image //! @param h height of the image - //! @note If a NULL pointer is passed to this function and it is + //! @note If a nullptr pointer is passed to this function and it is //! initialized within Cutil then cutFree() has to be used to //! deallocate the memory //////////////////////////////////////////////////////////////////////////// diff --git a/lib/gpu/geryon/hip_device.h b/lib/gpu/geryon/hip_device.h index 93f38d28bb..d2fb1919b7 100644 --- a/lib/gpu/geryon/hip_device.h +++ b/lib/gpu/geryon/hip_device.h @@ -261,7 +261,7 @@ class UCL_Device { /// Select the platform that has accelerators (for compatibility with OpenCL) inline int set_platform_accelerator(int pid=-1) { return UCL_SUCCESS; } - inline int load_module(const void* program, hipModule_t& module, std::string *log=NULL){ + inline int load_module(const void* program, hipModule_t& module, std::string *log=nullptr){ auto it = _loaded_modules.emplace(program, hipModule_t()); if(!it.second){ module = it.first->second; @@ -281,7 +281,7 @@ class UCL_Device { hipError_t err=hipModuleLoadDataEx(&module,program,num_opts, options,(void **)values); - if (log!=NULL) + if (log!=nullptr) *log=std::string(clog); if (err != hipSuccess) { diff --git a/lib/gpu/geryon/hip_kernel.h b/lib/gpu/geryon/hip_kernel.h index 654eb44772..c5014b52e7 100644 --- a/lib/gpu/geryon/hip_kernel.h +++ b/lib/gpu/geryon/hip_kernel.h @@ -30,7 +30,7 @@ class UCL_Program { public: inline UCL_Program(UCL_Device &device) { _device_ptr = &device; _cq=device.cq(); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) { + const char *flags="", std::string *log=nullptr) { _device_ptr = &device; _cq=device.cq(); init(device); load_string(program,flags,log); @@ -46,7 +46,7 @@ class UCL_Program { inline void clear() { } /// Load a program from a file and compile with flags - inline int load(const char *filename, const char *flags="", std::string *log=NULL) { + inline int load(const char *filename, const char *flags="", std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -64,7 +64,7 @@ class UCL_Program { } /// Load a program from a string and compile with flags - inline int load_string(const void *program, const char *flags="", std::string *log=NULL) { + inline int load_string(const void *program, const char *flags="", std::string *log=nullptr) { return _device_ptr->load_module(program, _module, log); } @@ -263,7 +263,7 @@ class UCL_Kernel { }; const auto res = hipModuleLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], - _block_size[2],0,_cq, NULL, config); + _block_size[2],0,_cq, nullptr, config); CU_SAFE_CALL(res); //#endif } diff --git a/lib/gpu/geryon/hip_memory.h b/lib/gpu/geryon/hip_memory.h index 13f60ad939..a983ba3227 100644 --- a/lib/gpu/geryon/hip_memory.h +++ b/lib/gpu/geryon/hip_memory.h @@ -55,7 +55,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); return UCL_SUCCESS; @@ -71,7 +71,7 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=dev.cq(); return UCL_SUCCESS; @@ -97,7 +97,7 @@ inline int _host_resize(mat_type &mat, const size_t n) { err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocWriteCombined); else err=hipHostMalloc((void **)mat.host_ptr(),n,hipHostMallocDefault); - if (err!=hipSuccess || *(mat.host_ptr())==NULL) + if (err!=hipSuccess || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; return UCL_SUCCESS; } diff --git a/lib/gpu/geryon/hip_texture.h b/lib/gpu/geryon/hip_texture.h index e7aa4e1461..ae16bee900 100644 --- a/lib/gpu/geryon/hip_texture.h +++ b/lib/gpu/geryon/hip_texture.h @@ -99,7 +99,7 @@ class UCL_Texture { else CU_SAFE_CALL(hipTexRefSetFormat(_tex,HIP_AD_FORMAT_SIGNED_INT32,numel*2)); } - CU_SAFE_CALL(hipTexRefSetAddress(NULL, _tex, vec.cbegin(), vec.numel()*vec.element_size())); + CU_SAFE_CALL(hipTexRefSetAddress(nullptr, _tex, vec.cbegin(), vec.numel()*vec.element_size())); #else void* data_ptr = (void*)vec.cbegin(); CU_SAFE_CALL(hipMemcpyHtoD(hipDeviceptr_t(_device_ptr_to_global_var), &data_ptr, sizeof(void*))); diff --git a/lib/gpu/geryon/nvd_kernel.h b/lib/gpu/geryon/nvd_kernel.h index 9293db2fe4..d74b0e2dc1 100644 --- a/lib/gpu/geryon/nvd_kernel.h +++ b/lib/gpu/geryon/nvd_kernel.h @@ -41,7 +41,7 @@ class UCL_Program { public: inline UCL_Program(UCL_Device &device) { _cq=device.cq(); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) { + const char *flags="", std::string *log=nullptr) { _cq=device.cq(); init(device); load_string(program,flags,log); @@ -58,7 +58,7 @@ class UCL_Program { /// Load a program from a file and compile with flags inline int load(const char *filename, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -77,7 +77,7 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { if (std::string(flags)=="BINARY") return load_binary((const char *)program); const unsigned int num_opts=2; @@ -95,7 +95,7 @@ class UCL_Program { CUresult err=cuModuleLoadDataEx(&_module,program,num_opts, options,(void **)values); - if (log!=NULL) + if (log!=nullptr) *log=std::string(clog); if (err != CUDA_SUCCESS) { @@ -361,7 +361,7 @@ class UCL_Kernel { #if CUDA_VERSION >= 4000 CU_SAFE_CALL(cuLaunchKernel(_kernel,_num_blocks[0],_num_blocks[1], _num_blocks[2],_block_size[0],_block_size[1], - _block_size[2],0,_cq,_kernel_args,NULL)); + _block_size[2],0,_cq,_kernel_args,nullptr)); #else CU_SAFE_CALL(cuParamSetSize(_kernel,_param_size)); CU_SAFE_CALL(cuLaunchGridAsync(_kernel,_num_blocks[0],_num_blocks[1],_cq)); diff --git a/lib/gpu/geryon/nvd_memory.h b/lib/gpu/geryon/nvd_memory.h index 0484e33de6..bcfc055ac2 100644 --- a/lib/gpu/geryon/nvd_memory.h +++ b/lib/gpu/geryon/nvd_memory.h @@ -55,7 +55,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); return UCL_SUCCESS; @@ -71,7 +71,7 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; mat.cq()=dev.cq(); return UCL_SUCCESS; @@ -97,7 +97,7 @@ inline int _host_resize(mat_type &mat, const size_t n) { err=cuMemHostAlloc((void **)mat.host_ptr(),n,CU_MEMHOSTALLOC_WRITECOMBINED); else err=cuMemAllocHost((void **)mat.host_ptr(),n); - if (err!=CUDA_SUCCESS || *(mat.host_ptr())==NULL) + if (err!=CUDA_SUCCESS || *(mat.host_ptr())==nullptr) return UCL_MEMORY_ERROR; return UCL_SUCCESS; } diff --git a/lib/gpu/geryon/nvd_texture.h b/lib/gpu/geryon/nvd_texture.h index 965595a448..c766af826c 100644 --- a/lib/gpu/geryon/nvd_texture.h +++ b/lib/gpu/geryon/nvd_texture.h @@ -80,7 +80,7 @@ class UCL_Texture { #ifdef UCL_DEBUG assert(numel!=0 && numel<5); #endif - CU_SAFE_CALL(cuTexRefSetAddress(NULL, _tex, vec.cbegin(), + CU_SAFE_CALL(cuTexRefSetAddress(nullptr, _tex, vec.cbegin(), vec.numel()*vec.element_size())); if (vec.element_size()==sizeof(float)) CU_SAFE_CALL(cuTexRefSetFormat(_tex, CU_AD_FORMAT_FLOAT, numel)); diff --git a/lib/gpu/geryon/ocl_device.h b/lib/gpu/geryon/ocl_device.h index 10e84a436a..de4def0bc1 100644 --- a/lib/gpu/geryon/ocl_device.h +++ b/lib/gpu/geryon/ocl_device.h @@ -360,7 +360,7 @@ int UCL_Device::set_platform(int pid) { // --- Get Number of Devices cl_uint n; - errorv=clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,0,NULL,&n); + errorv=clGetDeviceIDs(_cl_platform,CL_DEVICE_TYPE_ALL,0,nullptr,&n); _num_devices=n; if (errorv!=CL_SUCCESS || _num_devices==0) { _num_devices=0; @@ -385,7 +385,7 @@ int UCL_Device::create_context() { props[0]=CL_CONTEXT_PLATFORM; props[1]=_platform; props[2]=0; - _context=clCreateContext(0,1,&_cl_device,NULL,NULL,&errorv); + _context=clCreateContext(0,1,&_cl_device,nullptr,nullptr,&errorv); if (errorv!=CL_SUCCESS) { #ifndef UCL_NO_EXIT std::cerr << "UCL Error: Could not access accelerator number " << _device @@ -404,36 +404,36 @@ void UCL_Device::add_properties(cl_device_id device_list) { char buffer[1024]; cl_bool ans_bool; - CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_NAME,1024,buffer,NULL)); + CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_NAME,1024,buffer,nullptr)); op.name=buffer; CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_GLOBAL_MEM_SIZE, - sizeof(op.global_mem),&op.global_mem,NULL)); + sizeof(op.global_mem),&op.global_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_LOCAL_MEM_SIZE, - sizeof(op.shared_mem),&op.shared_mem,NULL)); + sizeof(op.shared_mem),&op.shared_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_CONSTANT_BUFFER_SIZE, - sizeof(op.const_mem),&op.const_mem,NULL)); + sizeof(op.const_mem),&op.const_mem,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_TYPE, - sizeof(op.device_type),&op.device_type,NULL)); + sizeof(op.device_type),&op.device_type,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_COMPUTE_UNITS, sizeof(op.compute_units),&op.compute_units, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_CLOCK_FREQUENCY, - sizeof(op.clock),&op.clock,NULL)); + sizeof(op.clock),&op.clock,nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_WORK_GROUP_SIZE, sizeof(op.work_group_size),&op.work_group_size, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MAX_WORK_ITEM_SIZES, 3*sizeof(op.work_item_size[0]),op.work_item_size, - NULL)); + nullptr)); CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_MEM_BASE_ADDR_ALIGN, - sizeof(cl_uint),&op.alignment,NULL)); + sizeof(cl_uint),&op.alignment,nullptr)); op.alignment/=8; // Determine if double precision is supported cl_uint double_width; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE, - sizeof(double_width),&double_width,NULL)); + sizeof(double_width),&double_width,nullptr)); if (double_width==0) op.double_precision=false; else @@ -441,13 +441,13 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PROFILING_TIMER_RESOLUTION, - sizeof(size_t),&op.timer_resolution,NULL)); + sizeof(size_t),&op.timer_resolution,nullptr)); op.ecc_support=false; CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_ERROR_CORRECTION_SUPPORT, - sizeof(ans_bool),&ans_bool,NULL)); + sizeof(ans_bool),&ans_bool,nullptr)); if (ans_bool==CL_TRUE) op.ecc_support=true; @@ -459,7 +459,7 @@ void UCL_Device::add_properties(cl_device_id device_list) { #ifdef CL_VERSION_1_2 size_t return_bytes; CL_SAFE_CALL(clGetDeviceInfo(device_list,CL_DEVICE_OPENCL_C_VERSION,1024, - buffer,NULL)); + buffer,nullptr)); op.c_version=buffer; cl_device_partition_property pinfo[4]; @@ -479,7 +479,7 @@ void UCL_Device::add_properties(cl_device_id device_list) { CL_SAFE_CALL(clGetDeviceInfo(device_list, CL_DEVICE_PARTITION_MAX_SUB_DEVICES, - sizeof(cl_uint),&op.max_sub_devices,NULL)); + sizeof(cl_uint),&op.max_sub_devices,nullptr)); #endif _properties.push_back(op); @@ -489,15 +489,15 @@ std::string UCL_Device::platform_name() { char info[1024]; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_VENDOR,1024,info, - NULL)); + nullptr)); std::string ans=std::string(info)+' '; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_NAME,1024,info, - NULL)); + nullptr)); ans+=std::string(info)+' '; CL_SAFE_CALL(clGetPlatformInfo(_cl_platform,CL_PLATFORM_VERSION,1024,info, - NULL)); + nullptr)); ans+=std::string(info); return ans; diff --git a/lib/gpu/geryon/ocl_kernel.h b/lib/gpu/geryon/ocl_kernel.h index b65049b9e6..77593f4515 100644 --- a/lib/gpu/geryon/ocl_kernel.h +++ b/lib/gpu/geryon/ocl_kernel.h @@ -42,7 +42,7 @@ class UCL_Program { inline UCL_Program() : _init_done(false) {} inline UCL_Program(UCL_Device &device) : _init_done(false) { init(device); } inline UCL_Program(UCL_Device &device, const void *program, - const char *flags="", std::string *log=NULL) : + const char *flags="", std::string *log=nullptr) : _init_done(false) { init(device); load_string(program,flags,log); @@ -74,7 +74,7 @@ class UCL_Program { /// Load a program from a file and compile with flags inline int load(const char *filename, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { std::ifstream in(filename); if (!in || in.is_open()==false) { #ifndef UCL_NO_EXIT @@ -93,29 +93,29 @@ class UCL_Program { /// Load a program from a string and compile with flags inline int load_string(const void *program, const char *flags="", - std::string *log=NULL) { + std::string *log=nullptr) { cl_int error_flag; const char *prog=(const char *)program; - _program=clCreateProgramWithSource(_context,1,&prog,NULL,&error_flag); + _program=clCreateProgramWithSource(_context,1,&prog,nullptr,&error_flag); CL_CHECK_ERR(error_flag); - error_flag = clBuildProgram(_program,1,&_device,flags,NULL,NULL); + error_flag = clBuildProgram(_program,1,&_device,flags,nullptr,nullptr); if (error_flag!=-11) CL_CHECK_ERR(error_flag); cl_build_status build_status; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device, CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status),&build_status, - NULL)); + nullptr)); - if (build_status != CL_SUCCESS || log!=NULL) { + if (build_status != CL_SUCCESS || log!=nullptr) { size_t ms; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,0, - NULL, &ms)); + nullptr, &ms)); char *build_log = new char[ms]; CL_SAFE_CALL(clGetProgramBuildInfo(_program,_device,CL_PROGRAM_BUILD_LOG,ms, - build_log, NULL)); + build_log, nullptr)); - if (log!=NULL) + if (log!=nullptr) *log=std::string(build_log); if (build_status != CL_SUCCESS) { @@ -363,7 +363,7 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) _kernel_info_name=function; cl_uint nargs; CL_SAFE_CALL(clGetKernelInfo(_kernel,CL_KERNEL_NUM_ARGS,sizeof(cl_uint), - &nargs,NULL)); + &nargs,nullptr)); _kernel_info_nargs=nargs; #ifdef NOT_TEST_CL_VERSION_1_2 char tname[256]; @@ -380,8 +380,8 @@ inline int UCL_Kernel::set_function(UCL_Program &program, const char *function) } void UCL_Kernel::run() { - CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,NULL, - _num_blocks,_block_size,0,NULL,NULL)); + CL_SAFE_CALL(clEnqueueNDRangeKernel(_cq,_kernel,_dimensions,nullptr, + _num_blocks,_block_size,0,nullptr,nullptr)); } } // namespace diff --git a/lib/gpu/geryon/ocl_memory.h b/lib/gpu/geryon/ocl_memory.h index 9692f4dd7b..740020ab18 100644 --- a/lib/gpu/geryon/ocl_memory.h +++ b/lib/gpu/geryon/ocl_memory.h @@ -58,7 +58,7 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags buffer_perm; cl_map_flags map_perm; @@ -103,12 +103,12 @@ inline int _host_alloc(mat_type &mat, copy_type &cm, const size_t n, map_perm=CL_MAP_READ | CL_MAP_WRITE; } - mat.cbegin()=clCreateBuffer(context,buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(cm.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); mat.cq()=cm.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); @@ -120,10 +120,10 @@ inline int _host_view(mat_type &mat, copy_type &cm, const size_t n) { cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags orig_flags; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_FLAGS,sizeof(orig_flags), - &orig_flags,NULL)); + &orig_flags,nullptr)); orig_flags=orig_flags & ~CL_MEM_ALLOC_HOST_PTR; mat.cbegin()=clCreateBuffer(context, CL_MEM_USE_HOST_PTR | orig_flags, n, @@ -159,13 +159,13 @@ inline int _host_alloc(mat_type &mat, UCL_Device &dev, const size_t n, } cl_int error_flag; - mat.cbegin()=clCreateBuffer(dev.context(),buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(dev.context(),buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(dev.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); mat.cq()=dev.cq(); CL_SAFE_CALL(clRetainCommandQueue(mat.cq())); return UCL_SUCCESS; @@ -194,10 +194,10 @@ inline int _host_resize(mat_type &mat, const size_t n) { cl_int error_flag; cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags buffer_perm; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_FLAGS,sizeof(buffer_perm), - &buffer_perm,NULL)); + &buffer_perm,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); @@ -209,12 +209,12 @@ inline int _host_resize(mat_type &mat, const size_t n) { else map_perm=CL_MAP_READ | CL_MAP_WRITE; - mat.cbegin()=clCreateBuffer(context,buffer_perm,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,buffer_perm,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; *mat.host_ptr() = (typename mat_type::data_type*) clEnqueueMapBuffer(mat.cq(),mat.cbegin(),CL_TRUE, - map_perm,0,n,0,NULL,NULL,NULL); + map_perm,0,n,0,nullptr,nullptr,nullptr); return UCL_SUCCESS; } @@ -229,7 +229,7 @@ inline int _device_alloc(mat_type &mat, copy_type &cm, const size_t n, cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(cm.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_mem_flags flag; if (kind==UCL_READ_WRITE) flag=CL_MEM_READ_WRITE; @@ -247,7 +247,7 @@ inline int _device_alloc(mat_type &mat, copy_type &cm, const size_t n, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; mat.cq()=cm.cq(); @@ -276,7 +276,7 @@ inline int _device_alloc(mat_type &mat, UCL_Device &dev, const size_t n, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(dev.context(),flag,n,NULL, + mat.cbegin()=clCreateBuffer(dev.context(),flag,n,nullptr, &error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; @@ -321,7 +321,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); cl_mem_flags flag; @@ -341,7 +341,7 @@ inline int _device_resize(mat_type &mat, const size_t n) { #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,n,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,n,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; return UCL_SUCCESS; @@ -359,7 +359,7 @@ inline int _device_resize(mat_type &mat, const size_t rows, cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); CL_DESTRUCT_CALL(clReleaseMemObject(mat.cbegin())); cl_mem_flags flag; @@ -379,7 +379,7 @@ inline int _device_resize(mat_type &mat, const size_t rows, #endif else assert(0==1); - mat.cbegin()=clCreateBuffer(context,flag,pitch*rows,NULL,&error_flag); + mat.cbegin()=clCreateBuffer(context,flag,pitch*rows,nullptr,&error_flag); if (error_flag != CL_SUCCESS) return UCL_MEMORY_ERROR; return UCL_SUCCESS; @@ -395,21 +395,21 @@ inline void _host_zero(void *ptr, const size_t n) { inline void _ocl_build(cl_program &program, cl_device_id &device, const char* options = "") { - clBuildProgram(program,1,&device,options,NULL,NULL); + clBuildProgram(program,1,&device,options,nullptr,nullptr); cl_build_status build_status; CL_SAFE_CALL(clGetProgramBuildInfo(program, device, CL_PROGRAM_BUILD_STATUS, sizeof(cl_build_status),&build_status, - NULL)); + nullptr)); if (build_status == CL_SUCCESS) return; size_t ms; CL_SAFE_CALL(clGetProgramBuildInfo(program, device,CL_PROGRAM_BUILD_LOG, 0, - NULL, &ms)); + nullptr, &ms)); char *build_log = new char[ms]; CL_SAFE_CALL(clGetProgramBuildInfo(program,device,CL_PROGRAM_BUILD_LOG,ms, - build_log, NULL)); + build_log, nullptr)); std::cerr << std::endl << "----------------------------------------------------------\n" @@ -426,7 +426,7 @@ inline void _ocl_kernel_from_source(cl_context &context, cl_device_id &device, cl_int error_flag; cl_program program=clCreateProgramWithSource(context,lines,source, - NULL,&error_flag); + nullptr,&error_flag); CL_CHECK_ERR(error_flag); _ocl_build(program,device,options); kernel=clCreateKernel(program,function,&error_flag); @@ -444,15 +444,15 @@ inline void _device_zero(mat_type &mat, const size_t n, command_queue &cq) { #ifdef UCL_CL_ZERO cl_int zeroint=0; CL_SAFE_CALL(clEnqueueFillBuffer(cq,mat.begin(),&zeroint,sizeof(cl_int), - mat.byteoff(),n,0,NULL,NULL)); + mat.byteoff(),n,0,nullptr,nullptr)); #else cl_context context; CL_SAFE_CALL(clGetMemObjectInfo(mat.cbegin(),CL_MEM_CONTEXT,sizeof(context), - &context,NULL)); + &context,nullptr)); cl_device_id device; CL_SAFE_CALL(clGetContextInfo(context,CL_CONTEXT_DEVICES, - sizeof(cl_device_id),&device,NULL)); + sizeof(cl_device_id),&device,nullptr)); const char * szero[3]={ "#pragma OPENCL EXTENSION cl_khr_fp64 : enable\n", @@ -585,7 +585,7 @@ template <> struct _ucl_memcpy<1,0> { std::cerr << "UCL_COPY 1NS\n"; #endif CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset,n, - dst.begin(),0,NULL,NULL)); + dst.begin(),0,nullptr,nullptr)); } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -607,13 +607,13 @@ template <> struct _ucl_memcpy<1,0> { src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueReadBuffer(cq,src.cbegin(),block,src_offset, spitch*rows, - (char *)dst.begin()+dst_offset,0,NULL, - NULL)); + (char *)dst.begin()+dst_offset,0,nullptr, + nullptr)); else for (size_t i=0; i struct _ucl_memcpy<0,1> { std::cerr << "UCL_COPY 3NS\n"; #endif CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset,n, - src.begin(),0,NULL,NULL)); + src.begin(),0,nullptr,nullptr)); } template static inline void mc(p1 &dst, const size_t dpitch, const p2 &src, @@ -659,13 +659,13 @@ template <> struct _ucl_memcpy<0,1> { src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueWriteBuffer(cq,dst.cbegin(),block,dst_offset, spitch*rows, - (char *)src.begin()+src_offset,0,NULL, - NULL)); + (char *)src.begin()+src_offset,0,nullptr, + nullptr)); else for (size_t i=0; i struct _ucl_memcpy { const size_t dst_offset, const size_t src_offset) { if (src.cbegin()!=dst.cbegin() || src_offset!=dst_offset) { CL_SAFE_CALL(clEnqueueCopyBuffer(cq,src.cbegin(),dst.cbegin(),src_offset, - dst_offset,n,0,NULL,NULL)); + dst_offset,n,0,nullptr,nullptr)); #ifdef UCL_DBG_MEM_TRACE std::cerr << "UCL_COPY 6NS\n"; #endif @@ -704,13 +704,13 @@ template struct _ucl_memcpy { if (spitch==dpitch && dst.cols()==src.cols() && src.cols()==cols/src.element_size()) CL_SAFE_CALL(clEnqueueCopyBuffer(cq,src.cbegin(),dst.cbegin(),src_offset, - dst_offset,spitch*rows,0,NULL,NULL)); + dst_offset,spitch*rows,0,nullptr,nullptr)); else for (size_t i=0; i AnswerT::Answer() : _allocated(false),_eflag(false),_vflag(false), - _inum(0),_ilist(NULL),_newton(false) { + _inum(0),_ilist(nullptr),_newton(false) { } template @@ -119,7 +119,7 @@ void AnswerT::clear() { engv.clear(); time_answer.clear(); _inum=0; - _ilist=NULL; + _ilist=nullptr; _eflag=false; _vflag=false; } @@ -180,7 +180,7 @@ double AnswerT::energy_virial(double *eatom, double **vatom, for (int i=0; i<_inum; i++) evdwl+=engv[i]; if (_ef_atom) { - if (_ilist==NULL) { + if (_ilist==nullptr) { for (int i=0; i<_inum; i++) eatom[i]+=engv[i]; } else { @@ -196,7 +196,7 @@ double AnswerT::energy_virial(double *eatom, double **vatom, for (int i=vstart; i void AnswerT::get_answers(double **f, double **tor) { int fl=0; - if (_ilist==NULL) { + if (_ilist==nullptr) { for (int i=0; i<_inum; i++) { f[i][0]+=force[fl]; f[i][1]+=force[fl+1]; diff --git a/lib/gpu/lal_base_atomic.cpp b/lib/gpu/lal_base_atomic.cpp index eb0eab87b6..42925aaeec 100644 --- a/lib/gpu/lal_base_atomic.cpp +++ b/lib/gpu/lal_base_atomic.cpp @@ -25,8 +25,8 @@ BaseAtomicT::BaseAtomic() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -135,7 +135,7 @@ int * BaseAtomicT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -231,7 +231,7 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -244,7 +244,7 @@ int ** BaseAtomicT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; hd_balancer.start_timer(); } else { atom->cast_x_data(host_x,host_type); diff --git a/lib/gpu/lal_base_charge.cpp b/lib/gpu/lal_base_charge.cpp index 52e8ae2d89..d5a6e06222 100644 --- a/lib/gpu/lal_base_charge.cpp +++ b/lib/gpu/lal_base_charge.cpp @@ -25,8 +25,8 @@ BaseChargeT::BaseCharge() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -137,7 +137,7 @@ int * BaseChargeT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -240,7 +240,7 @@ int** BaseChargeT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -253,7 +253,7 @@ int** BaseChargeT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_q_data(host_q); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_dipole.cpp b/lib/gpu/lal_base_dipole.cpp index ed71029e68..57773a3b80 100644 --- a/lib/gpu/lal_base_dipole.cpp +++ b/lib/gpu/lal_base_dipole.cpp @@ -25,8 +25,8 @@ BaseDipoleT::BaseDipole() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -139,7 +139,7 @@ int * BaseDipoleT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -245,7 +245,7 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -258,7 +258,7 @@ int** BaseDipoleT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_q_data(host_q); atom->cast_quat_data(host_mu[0]); hd_balancer.start_timer(); diff --git a/lib/gpu/lal_base_dpd.cpp b/lib/gpu/lal_base_dpd.cpp index c0d7ad47bc..e4fd80fcc3 100644 --- a/lib/gpu/lal_base_dpd.cpp +++ b/lib/gpu/lal_base_dpd.cpp @@ -25,8 +25,8 @@ BaseDPDT::BaseDPD() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -138,7 +138,7 @@ int * BaseDPDT::reset_nbors(const int nall, const int inum, int *ilist, resize_atom(inum,nall,success); resize_local(inum,mn,success); if (!success) - return NULL; + return nullptr; nbor->get_host(inum,ilist,numj,firstneigh,block_size()); @@ -245,7 +245,7 @@ int** BaseDPDT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -258,7 +258,7 @@ int** BaseDPDT::compute(const int ago, const int inum_full, build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_v_data(host_v,tag); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_ellipsoid.cpp b/lib/gpu/lal_base_ellipsoid.cpp index abc8807a8b..524705ed41 100644 --- a/lib/gpu/lal_base_ellipsoid.cpp +++ b/lib/gpu/lal_base_ellipsoid.cpp @@ -33,10 +33,10 @@ BaseEllipsoidT::BaseEllipsoid() : _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); nbor=new Neighbor(); - nbor_program=NULL; - ellipsoid_program=NULL; - lj_program=NULL; - ucl_device=NULL; + nbor_program=nullptr; + ellipsoid_program=nullptr; + lj_program=nullptr; + ucl_device=nullptr; } template @@ -356,7 +356,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, if (inum_full==0) { host_start=0; zero_timers(); - return NULL; + return nullptr; } int ago=hd_balancer.ago_first(f_ago); @@ -369,7 +369,7 @@ int* BaseEllipsoidT::compute(const int f_ago, const int inum_full, reset_nbors(nall, inum, inum_full, ilist, numj, host_type, firstneigh, success); if (!success) - return NULL; + return nullptr; } int *list; if (_multiple_forms) @@ -406,7 +406,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall if (inum_full==0) { host_start=0; zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -420,7 +420,7 @@ int** BaseEllipsoidT::compute(const int ago, const int inum_full, const int nall build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; atom->cast_quat_data(host_quat[0]); hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_base_three.cpp b/lib/gpu/lal_base_three.cpp index 0b4dbdc89a..cfc138aea2 100644 --- a/lib/gpu/lal_base_three.cpp +++ b/lib/gpu/lal_base_three.cpp @@ -27,8 +27,8 @@ BaseThreeT::BaseThree() : _compiled(false), _max_bytes(0) { #ifdef THREE_CONCURRENT ans2=new Answer(); #endif - pair_program=NULL; - ucl_device=NULL; + pair_program=nullptr; + ucl_device=nullptr; } template @@ -176,7 +176,7 @@ int * BaseThreeT::reset_nbors(const int nall, const int inum, const int nlist, resize_atom(inum,nall,success); resize_local(nall,mn,success); if (!success) - return NULL; + return nullptr; _nall = nall; @@ -310,7 +310,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style resize_atom(0,nall,success); zero_timers(); - return NULL; + return nullptr; } hd_balancer.balance(cpu_time); @@ -326,7 +326,7 @@ int ** BaseThreeT::compute(const int ago, const int inum_full, _max_nbors = build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; hd_balancer.start_timer(); } else { atom->cast_x_data(host_x,host_type); diff --git a/lib/gpu/lal_base_three.h b/lib/gpu/lal_base_three.h index 38af78b78e..36129e6168 100644 --- a/lib/gpu/lal_base_three.h +++ b/lib/gpu/lal_base_three.h @@ -59,7 +59,7 @@ class BaseThree { const double gpu_split, FILE *screen, const void *pair_program, const char *k_two, const char *k_three_center, const char *k_three_end, - const char *k_short_nbor=NULL); + const char *k_short_nbor=nullptr); /// Estimate the overhead for GPU context changes and CPU driver void estimate_gpu_overhead(); diff --git a/lib/gpu/lal_device.cpp b/lib/gpu/lal_device.cpp index aaf74ed28c..6c6a206307 100644 --- a/lib/gpu/lal_device.cpp +++ b/lib/gpu/lal_device.cpp @@ -72,7 +72,7 @@ int DeviceT::init_device(MPI_Comm world, MPI_Comm replica, const int first_gpu, // "0:generic" will select platform 0 and tune for generic device // "1:fermi" will select platform 1 and tune for Nvidia Fermi gpu if (ocl_vendor) { - char *sep = NULL; + char *sep = nullptr; if ((sep = strstr(ocl_vendor,":"))) { *sep = '\0'; _platform_id = atoi(ocl_vendor); @@ -182,7 +182,7 @@ template int DeviceT::set_ocl_params(char *ocl_vendor) { #ifdef USE_OPENCL std::string s_vendor=OCL_DEFAULT_VENDOR; - if (ocl_vendor!=NULL) + if (ocl_vendor!=nullptr) s_vendor=ocl_vendor; if (s_vendor=="none") s_vendor="generic"; @@ -215,14 +215,14 @@ int DeviceT::set_ocl_params(char *ocl_vendor) { int token_count=0; std::string params[13]; char *pch = strtok(ocl_vendor,","); - pch = strtok(NULL,","); - if (pch == NULL) return -11; - while (pch != NULL) { + pch = strtok(nullptr,","); + if (pch == nullptr) return -11; + while (pch != nullptr) { if (token_count==13) return -11; params[token_count]=pch; token_count++; - pch = strtok(NULL,","); + pch = strtok(nullptr,","); } _ocl_vendor_string+=" -DMEM_THREADS="+params[0]+ " -DTHREADS_PER_ATOM="+params[1]+ @@ -430,9 +430,9 @@ template void DeviceT::estimate_gpu_overhead(const int kernel_calls, double &gpu_overhead, double &gpu_driver_overhead) { - UCL_H_Vec *host_data_in=NULL, *host_data_out=NULL; - UCL_D_Vec *dev_data_in=NULL, *dev_data_out=NULL, *kernel_data=NULL; - UCL_Timer *timers_in=NULL, *timers_out=NULL, *timers_kernel=NULL; + UCL_H_Vec *host_data_in=nullptr, *host_data_out=nullptr; + UCL_D_Vec *dev_data_in=nullptr, *dev_data_out=nullptr, *kernel_data=nullptr; + UCL_Timer *timers_in=nullptr, *timers_out=nullptr, *timers_kernel=nullptr; UCL_Timer over_timer(*gpu); if (_data_in_estimate>0) { diff --git a/lib/gpu/lal_eam.cpp b/lib/gpu/lal_eam.cpp index 8c81353f36..03479cd16a 100644 --- a/lib/gpu/lal_eam.cpp +++ b/lib/gpu/lal_eam.cpp @@ -380,7 +380,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall, // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } // load balance, returning the atom count on the device (inum) @@ -394,7 +394,7 @@ int** EAMT::compute(const int ago, const int inum_full, const int nall, this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; } else { this->atom->cast_x_data(host_x,host_type); this->atom->add_x_data(host_x,host_type); @@ -429,7 +429,7 @@ void EAMT::compute2(int *ilist, const bool eflag, const bool vflag, time_fp2.stop(); loop2(eflag,vflag); - if (ilist == NULL) + if (ilist == nullptr) this->ans->copy_answers(eflag,vflag,eatom,vatom); else this->ans->copy_answers(eflag,vflag,eatom,vatom, ilist); diff --git a/lib/gpu/lal_gauss.cu b/lib/gpu/lal_gauss.cu index ae6ab00edd..2192fb39ca 100644 --- a/lib/gpu/lal_gauss.cu +++ b/lib/gpu/lal_gauss.cu @@ -60,11 +60,9 @@ __kernel void k_gauss(const __global numtyp4 *restrict x_, numtyp4 ix; fetch4(ix,i,pos_tex); //x_[i]; int itype=ix.w; - numtyp factor_lj; for ( ; nbor0) { numtyp e=-(gauss1[mtype].x*ucl_exp(-gauss1[mtype].y*rsq) - gauss1[mtype].w); - energy+=factor_lj*e; + energy+=e; //factor_lj*e; } if (vflag>0) { virial[0] += delx*delx*force; @@ -148,11 +146,9 @@ __kernel void k_gauss_fast(const __global numtyp4 *restrict x_, int iw=ix.w; int itype=fast_mul((int)MAX_SHARED_TYPES,iw); - numtyp factor_lj; for ( ; nbor0) { numtyp e=-(gauss1[mtype].x*ucl_exp(-gauss1[mtype].y*rsq) - gauss1[mtype].w); - energy+=factor_lj*e; + energy+=e; //factor_lj*e; } if (vflag>0) { virial[0] += delx*delx*force; diff --git a/lib/gpu/lal_lj_tip4p_long.cpp b/lib/gpu/lal_lj_tip4p_long.cpp index bb848ad5c3..1f3b32248c 100644 --- a/lib/gpu/lal_lj_tip4p_long.cpp +++ b/lib/gpu/lal_lj_tip4p_long.cpp @@ -340,7 +340,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } this->hd_balancer.balance(cpu_time); @@ -353,7 +353,7 @@ int** LJTIP4PLongT::compute(const int ago, const int inum_full, this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; this->atom->cast_q_data(host_q); this->hd_balancer.start_timer(); } else { diff --git a/lib/gpu/lal_neighbor.cpp b/lib/gpu/lal_neighbor.cpp index 3e128bcf57..6c4890ef47 100644 --- a/lib/gpu/lal_neighbor.cpp +++ b/lib/gpu/lal_neighbor.cpp @@ -158,7 +158,7 @@ void Neighbor::alloc(bool &success) { } _c_bytes+=nbor_host.device.row_bytes()+dev_numj_host.row_bytes(); } else { - // Some OpenCL implementations return errors for NULL pointers as args + // Some OpenCL implementations return errors for nullptr pointers as args nbor_host.device.view(dev_nbor); dev_numj_host.view(dev_nbor); } diff --git a/lib/gpu/lal_pppm.cpp b/lib/gpu/lal_pppm.cpp index 84d6c16e14..6b5bf88ea5 100644 --- a/lib/gpu/lal_pppm.cpp +++ b/lib/gpu/lal_pppm.cpp @@ -35,7 +35,7 @@ PPPMT::PPPM() : _allocated(false), _compiled(false), _max_bytes(0) { device=&global_device; ans=new Answer(); - pppm_program=NULL; + pppm_program=nullptr; } template diff --git a/lib/gpu/lal_pppm.cu b/lib/gpu/lal_pppm.cu index 6cf8aafbd0..ee9f1b61d6 100644 --- a/lib/gpu/lal_pppm.cu +++ b/lib/gpu/lal_pppm.cu @@ -26,7 +26,7 @@ _texture( q_tex,int2); // Allow PPPM to compile without atomics for NVIDIA 1.0 cards, error // generated at runtime with use of pppm/gpu -#if (__CUDA_ARCH__ < 110) +#if defined(NV_KERNEL) && (__CUDA_ARCH__ < 110) #define atomicAdd(x,y) *(x)+=0 #endif diff --git a/lib/gpu/lal_pppm_ext.cpp b/lib/gpu/lal_pppm_ext.cpp index a75536eb19..b826881392 100644 --- a/lib/gpu/lal_pppm_ext.cpp +++ b/lib/gpu/lal_pppm_ext.cpp @@ -56,7 +56,7 @@ grdtyp * pppm_gpu_init(memtyp &pppm, const int nlocal, const int nall, } success=0; - grdtyp * host_brick=NULL; + grdtyp * host_brick=nullptr; if (world_me==0) host_brick=pppm.init(nlocal,nall,screen,order,nxlo_out,nylo_out,nzlo_out, nxhi_out,nyhi_out,nzhi_out,rho_coeff,vd_brick, @@ -129,7 +129,7 @@ double pppm_gpu_bytes_f() { void pppm_gpu_forces_f(double **f) { double etmp; PPPMF.atom->data_unavail(); - PPPMF.ans->get_answers(f,NULL,NULL,NULL,NULL,etmp); + PPPMF.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); } double * pppm_gpu_init_d(const int nlocal, const int nall, FILE *screen, @@ -173,6 +173,6 @@ double pppm_gpu_bytes_d() { void pppm_gpu_forces_d(double **f) { double etmp; PPPMD.atom->data_unavail(); - PPPMD.ans->get_answers(f,NULL,NULL,NULL,NULL,etmp); + PPPMD.ans->get_answers(f,nullptr,nullptr,nullptr,nullptr,etmp); } diff --git a/lib/gpu/lal_tersoff.cu b/lib/gpu/lal_tersoff.cu index 7d3ede8dfc..b08fddfd6e 100644 --- a/lib/gpu/lal_tersoff.cu +++ b/lib/gpu/lal_tersoff.cu @@ -709,7 +709,7 @@ __kernel void k_tersoff_three_end(const __global numtyp4 *restrict x_, for (int i=0; i<6; i++) virial[i]=(acctyp)0; - __local int red_acc[BLOCK_PAIR]; + __local int ijnum_shared[BLOCK_PAIR]; __syncthreads(); @@ -789,14 +789,14 @@ __kernel void k_tersoff_three_end(const __global numtyp4 *restrict x_, k &= NEIGHMASK; if (k == i) { ijnum = nbor_k; - red_acc[m] = ijnum; + ijnum_shared[m] = ijnum; break; } } numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); - if (ijnum < 0) ijnum = red_acc[m]; + if (ijnum < 0) ijnum = ijnum_shared[m]; // idx to zetaij is shifted by n_stride relative to ijnum in dev_short_nbor int idx = ijnum; diff --git a/lib/gpu/lal_tersoff_mod.cu b/lib/gpu/lal_tersoff_mod.cu index bb5aabca44..0f45653264 100644 --- a/lib/gpu/lal_tersoff_mod.cu +++ b/lib/gpu/lal_tersoff_mod.cu @@ -719,7 +719,7 @@ __kernel void k_tersoff_mod_three_end(const __global numtyp4 *restrict x_, for (int i=0; i<6; i++) virial[i]=(acctyp)0; - __local int red_acc[BLOCK_PAIR]; + __local int ijnum_shared[BLOCK_PAIR]; __syncthreads(); @@ -799,14 +799,14 @@ __kernel void k_tersoff_mod_three_end(const __global numtyp4 *restrict x_, k &= NEIGHMASK; if (k == i) { ijnum = nbor_k; - red_acc[m] = ijnum; + ijnum_shared[m] = ijnum; break; } } numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); - if (ijnum < 0) ijnum = red_acc[m]; + if (ijnum < 0) ijnum = ijnum_shared[m]; // idx to zetaij is shifted by n_stride relative to ijnum in dev_short_nbor int idx = ijnum; @@ -957,7 +957,7 @@ __kernel void k_tersoff_mod_three_end_vatom(const __global numtyp4 *restrict x_, for (int i=0; i<6; i++) virial[i]=(acctyp)0; - __local int red_acc[BLOCK_PAIR]; + __local int ijnum_shared[BLOCK_PAIR]; __syncthreads(); @@ -1037,14 +1037,14 @@ __kernel void k_tersoff_mod_three_end_vatom(const __global numtyp4 *restrict x_, k &= NEIGHMASK; if (k == i) { ijnum = nbor_k; - red_acc[m] = ijnum; + ijnum_shared[m] = ijnum; break; } } numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); - if (ijnum < 0) ijnum = red_acc[m]; + if (ijnum < 0) ijnum = ijnum_shared[m]; // idx to zetaij is shifted by n_stride relative to ijnum in dev_short_nbor int idx = ijnum; diff --git a/lib/gpu/lal_tersoff_zbl.cu b/lib/gpu/lal_tersoff_zbl.cu index cd8d453b3c..f631cab91f 100644 --- a/lib/gpu/lal_tersoff_zbl.cu +++ b/lib/gpu/lal_tersoff_zbl.cu @@ -729,7 +729,7 @@ __kernel void k_tersoff_zbl_three_end(const __global numtyp4 *restrict x_, for (int i=0; i<6; i++) virial[i]=(acctyp)0; - __local int red_acc[BLOCK_PAIR]; + __local int ijnum_shared[BLOCK_PAIR]; __syncthreads(); @@ -809,14 +809,14 @@ __kernel void k_tersoff_zbl_three_end(const __global numtyp4 *restrict x_, k &= NEIGHMASK; if (k == i) { ijnum = nbor_k; - red_acc[m] = ijnum; + ijnum_shared[m] = ijnum; break; } } numtyp r1 = ucl_sqrt(rsq1); numtyp r1inv = ucl_rsqrt(rsq1); - if (ijnum < 0) ijnum = red_acc[m]; + if (ijnum < 0) ijnum = ijnum_shared[m]; // idx to zetaij is shifted by n_stride relative to ijnum in dev_short_nbor int idx = ijnum; diff --git a/lib/gpu/lal_yukawa_colloid.cpp b/lib/gpu/lal_yukawa_colloid.cpp index e71e962ffd..46d4d64328 100644 --- a/lib/gpu/lal_yukawa_colloid.cpp +++ b/lib/gpu/lal_yukawa_colloid.cpp @@ -213,7 +213,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall // Make sure textures are correct if realloc by a different hybrid style this->resize_atom(0,nall,success); this->zero_timers(); - return NULL; + return nullptr; } // load balance, returning the atom count on the device (inum) @@ -227,7 +227,7 @@ int** YukawaColloidT::compute(const int ago, const int inum_full, const int nall this->build_nbor_list(inum, inum_full-inum, nall, host_x, host_type, sublo, subhi, tag, nspecial, special, success); if (!success) - return NULL; + return nullptr; this->cast_rad_data(rad); this->hd_balancer.start_timer(); } else { diff --git a/lib/kokkos/BUILD.md b/lib/kokkos/BUILD.md index 63dbf7fdb2..0a5dc69c93 100644 --- a/lib/kokkos/BUILD.md +++ b/lib/kokkos/BUILD.md @@ -10,33 +10,45 @@ for C++. Applications heavily leveraging Kokkos are strongly encouraged to use You can either use Kokkos as an installed package (encouraged) or use Kokkos in-tree in your project. Modern CMake is exceedingly simple at a high-level (with the devil in the details). Once Kokkos is installed In your `CMakeLists.txt` simply use: -```` +````cmake find_package(Kokkos REQUIRED) ```` Then for every executable or library in your project: -```` +````cmake target_link_libraries(myTarget Kokkos::kokkos) ```` That's it! There is no checking Kokkos preprocessor, compiler, or linker flags. Kokkos propagates all the necessary flags to your project. This means not only is linking to Kokkos easy, but Kokkos itself can actually configure compiler and linker flags for *your* -project. If building in-tree, there is no `find_package` and you link with `target_link_libraries(kokkos)`. +project. +When configuring your project just set: +````bash +> cmake ${srcdir} \ + -DKokkos_ROOT=${kokkos_install_prefix} \ + -DCMAKE_CXX_COMPILER=${compiler_used_to_build_kokkos} +```` +Note: You may need the following if using some versions of CMake (e.g. 3.12): +````cmake +cmake_policy(SET CMP0074 NEW) +```` +If building in-tree, there is no `find_package`. You can use `add_subdirectory(kokkos)` with the Kokkos source and again just link with `target_link_libraries(Kokkos::kokkos)`. +The examples in `examples/cmake_build_installed` and `examples/cmake_build_in_tree` can help get you started. ## Configuring CMake -A very basic installation is done with: -```` -cmake ${srcdir} \ +A very basic installation of Kokkos is done with: +````bash +> cmake ${srcdir} \ -DCMAKE_CXX_COMPILER=g++ \ - -DCMAKE_INSTALL_PREFIX=${my_install_folder} + -DCMAKE_INSTALL_PREFIX=${kokkos_install_folder} ```` which builds and installed a default Kokkos when you run `make install`. There are numerous device backends, options, and architecture-specific optimizations that can be configured, e.g. -```` -cmake ${srcdir} \ +````bash +> cmake ${srcdir} \ -DCMAKE_CXX_COMPILER=g++ \ - -DCMAKE_INSTALL_PREFIX=${my_install_folder} \ - -DKokkos_ENABLE_OPENMP=On + -DCMAKE_INSTALL_PREFIX=${kokkos_install_folder} \ + -DKokkos_ENABLE_OPENMP=ON ```` which activates the OpenMP backend. All of the options controlling device backends, options, architectures, and third-party libraries (TPLs) are given below. @@ -50,16 +62,16 @@ which activates the OpenMP backend. All of the options controlling device backen ## Spack An alternative to manually building with the CMake is to use the Spack package manager. To do so, download the `kokkos-spack` git repo and add to the package list: -```` -spack repo add $path-to-kokkos-spack +````bash +> spack repo add $path-to-kokkos-spack ```` A basic installation would be done as: -```` -spack install kokkos +````bash +> spack install kokkos ```` Spack allows options and and compilers to be tuned in the install command. -```` -spack install kokkos@3.0 %gcc@7.3.0 +openmp +````bash +> spack install kokkos@3.0 %gcc@7.3.0 +openmp ```` This example illustrates the three most common parameters to Spack: * Variants: specified with, e.g. `+openmp`, this activates (or deactivates with, e.g. `~openmp`) certain options. @@ -67,17 +79,17 @@ This example illustrates the three most common parameters to Spack: * Compiler: a default compiler will be chosen if not specified, but an exact compiler version can be given with the `%`option. For a complete list of Kokkos options, run: +````bash +> spack info kokkos ```` -spack info kokkos -```` -More details can be found in the kokkos-spack repository [README](https://github.com/kokkos/kokkos-spack/blob/master/README.md). +More details can be found in the [Spack README](Spack.md) #### Spack Development Spack currently installs packages to a location determined by a unique hash. This hash name is not really "human readable". Generally, Spack usage should never really require you to reference the computer-generated unique install folder. If you must know, you can locate Spack Kokkos installations with: -```` -spack find -p kokkos ... +````bash +> spack find -p kokkos ... ```` where `...` is the unique spec identifying the particular Kokkos configuration and version. @@ -102,8 +114,14 @@ Device backends can be enabled by specifying `-DKokkos_ENABLE_X`. * Whether to build Pthread backend * BOOL Default: OFF * Kokkos_ENABLE_SERIAL - * Whether to build serial backend + * Whether to build serial backend * BOOL Default: ON +* Kokkos_ENABLE_HIP (Experimental) + * Whether to build HIP backend + * BOOL Default: OFF +* Kokkos_ENABLE_OPENMPTARGET (Experimental) + * Whether to build the OpenMP target backend + * BOOL Default: OFF ## Enable Options Options can be enabled by specifying `-DKokkos_ENABLE_X`. @@ -138,9 +156,6 @@ Options can be enabled by specifying `-DKokkos_ENABLE_X`. * Kokkos_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK * Debug check on dual views * BOOL Default: OFF -* Kokkos_ENABLE_DEPRECATED_CODE - * Whether to enable deprecated code - * BOOL Default: OFF * Kokkos_ENABLE_EXAMPLES * Whether to enable building examples * BOOL Default: OFF @@ -150,9 +165,6 @@ Options can be enabled by specifying `-DKokkos_ENABLE_X`. * Kokkos_ENABLE_LARGE_MEM_TESTS * Whether to perform extra large memory tests * BOOL_Default: OFF -* Kokkos_ENABLE_PROFILING - * Whether to create bindings for profiling tools - * BOOL Default: ON * Kokkos_ENABLE_PROFILING_LOAD_PRINT * Whether to print information about which profiling tools gotloaded * BOOL Default: OFF @@ -235,8 +247,11 @@ Architecture-specific optimizations can be enabled by specifying `-DKokkos_ARCH_ * Kokkos_ARCH_BGQ * Whether to optimize for the BGQ architecture * BOOL Default: OFF -* Kokkos_ARCH_EPYC - * Whether to optimize for the EPYC architecture +* Kokkos_ARCH_ZEN + * Whether to optimize for the Zen architecture + * BOOL Default: OFF +* Kokkos_ARCH_ZEN2 + * Whether to optimize for the Zen2 architecture * BOOL Default: OFF * Kokkos_ARCH_HSW * Whether to optimize for the HSW architecture diff --git a/lib/kokkos/CHANGELOG.md b/lib/kokkos/CHANGELOG.md index 9595b03ff9..c0c227999d 100644 --- a/lib/kokkos/CHANGELOG.md +++ b/lib/kokkos/CHANGELOG.md @@ -1,6 +1,113 @@ # Change Log -## [3.1.1](https://github.com/kokkos/kokkos/tree/3.1.1) (2020-04-14) +## [3.2.00](https://github.com/kokkos/kokkos/tree/3.2.00) (2020-08-19) +[Full Changelog](https://github.com/kokkos/kokkos/compare/3.1.01...3.2.00) + +**Implemented enhancements:** + +- HIP:Enable stream in HIP [\#3163](https://github.com/kokkos/kokkos/issues/3163) +- HIP:Add support for shuffle reduction for the HIP backend [\#3154](https://github.com/kokkos/kokkos/issues/3154) +- HIP:Add implementations of missing HIPHostPinnedSpace methods for LAMMPS [\#3137](https://github.com/kokkos/kokkos/issues/3137) +- HIP:Require HIP 3.5.0 or higher [\#3099](https://github.com/kokkos/kokkos/issues/3099) +- HIP:WorkGraphPolicy for HIP [\#3096](https://github.com/kokkos/kokkos/issues/3096) +- OpenMPTarget: Significant update to the new experimental backend. Requires C++17, works on Intel GPUs, reference counting fixes. [\#3169](https://github.com/kokkos/kokkos/issues/3169) +- Windows Cuda support [\#3018](https://github.com/kokkos/kokkos/issues/3018) +- Pass `-Wext-lambda-captures-this` to NVCC when support for `__host__ __device__` lambda is enabled from CUDA 11 [\#3241](https://github.com/kokkos/kokkos/issues/3241) +- Use explicit staging buffer for constant memory kernel launches and cleanup host/device synchronization [\#3234](https://github.com/kokkos/kokkos/issues/3234) +- Various fixup to policies including making TeamPolicy default constructible and making RangePolicy and TeamPolicy assignable 1: [\#3202](https://github.com/kokkos/kokkos/issues/3202) +- Various fixup to policies including making TeamPolicy default constructible and making RangePolicy and TeamPolicy assignable 2: [\#3203](https://github.com/kokkos/kokkos/issues/3203) +- Various fixup to policies including making TeamPolicy default constructible and making RangePolicy and TeamPolicy assignable 3: [\#3196](https://github.com/kokkos/kokkos/issues/3196) +- Annotations for `DefaultExectutionSpace` and `DefaultHostExectutionSpace` to use in static analysis [\#3189](https://github.com/kokkos/kokkos/issues/3189) +- Add documentation on using Spack to install Kokkos and developing packages that depend on Kokkos [\#3187](https://github.com/kokkos/kokkos/issues/3187) +- Improve support for nvcc\_wrapper with exotic host compiler [\#3186](https://github.com/kokkos/kokkos/issues/3186) +- Add OpenMPTarget backend flags for NVC++ compiler [\#3185](https://github.com/kokkos/kokkos/issues/3185) +- Move deep\_copy/create\_mirror\_view on Experimental::OffsetView into Kokkos:: namespace [\#3166](https://github.com/kokkos/kokkos/issues/3166) +- Allow for larger block size in HIP [\#3165](https://github.com/kokkos/kokkos/issues/3165) +- View: Added names of Views to the different View initialize/free kernels [\#3159](https://github.com/kokkos/kokkos/issues/3159) +- Cuda: Caching cudaFunctorAttributes and whether L1/Shmem prefer was set [\#3151](https://github.com/kokkos/kokkos/issues/3151) +- BuildSystem: Provide an explicit default CMAKE\_BUILD\_TYPE [\#3131](https://github.com/kokkos/kokkos/issues/3131) +- Cuda: Update CUDA occupancy calculation [\#3124](https://github.com/kokkos/kokkos/issues/3124) +- Vector: Adding data() to Vector [\#3123](https://github.com/kokkos/kokkos/issues/3123) +- BuildSystem: Add CUDA Ampere configuration support [\#3122](https://github.com/kokkos/kokkos/issues/3122) +- General: Apply [[noreturn]] to Kokkos::abort when applicable [\#3106](https://github.com/kokkos/kokkos/issues/3106) +- TeamPolicy: Validate storage level argument passed to TeamPolicy::set\_scratch\_size() [\#3098](https://github.com/kokkos/kokkos/issues/3098) +- nvcc\_wrapper: send --cudart to nvcc instead of host compiler [\#3092](https://github.com/kokkos/kokkos/issues/3092) +- BuildSystem: Make kokkos\_has\_string() function in Makefile.kokkos case insensitive [\#3091](https://github.com/kokkos/kokkos/issues/3091) +- Modify KOKKOS\_FUNCTION macro for clang-tidy analysis [\#3087](https://github.com/kokkos/kokkos/issues/3087) +- Move allocation profiling to allocate/deallocate calls [\#3084](https://github.com/kokkos/kokkos/issues/3084) +- BuildSystem: FATAL\_ERROR when attempting in-source build [\#3082](https://github.com/kokkos/kokkos/issues/3082) +- Change enums in ScatterView to types [\#3076](https://github.com/kokkos/kokkos/issues/3076) +- HIP: Changes for new compiler/runtime [\#3067](https://github.com/kokkos/kokkos/issues/3067) +- Extract and use get\_gpu [\#3061](https://github.com/kokkos/kokkos/issues/3061) +- Extract and use get\_gpu [\#3048](https://github.com/kokkos/kokkos/issues/3048) +- Add is\_allocated to View-like containers [\#3059](https://github.com/kokkos/kokkos/issues/3059) +- Combined reducers for scalar references [\#3052](https://github.com/kokkos/kokkos/issues/3052) +- Add configurable capacity for UniqueToken [\#3051](https://github.com/kokkos/kokkos/issues/3051) +- Add installation testing [\#3034](https://github.com/kokkos/kokkos/issues/3034) +- BuildSystem: Add -expt-relaxed-constexpr flag to nvcc\_wrapper [\#3021](https://github.com/kokkos/kokkos/issues/3021) +- HIP: Add UniqueToken [\#3020](https://github.com/kokkos/kokkos/issues/3020) +- Autodetect number of devices [\#3013](https://github.com/kokkos/kokkos/issues/3013) + + +**Fixed bugs:** + +- Check error code from `cudaStreamSynchronize` in CUDA fences [\#3255](https://github.com/kokkos/kokkos/issues/3255) +- Fix issue with C++ standard flags when using `nvcc\_wrapper` with PGI [\#3254](https://github.com/kokkos/kokkos/issues/3254) +- Add missing threadfence in lock-based atomics [\#3208](https://github.com/kokkos/kokkos/issues/3208) +- Fix dedup of linker flags for shared lib on CMake <=3.12 [\#3176](https://github.com/kokkos/kokkos/issues/3176) +- Fix memory leak with CUDA streams [\#3170](https://github.com/kokkos/kokkos/issues/3170) +- BuildSystem: Fix OpenMP Target flags for Cray [\#3161](https://github.com/kokkos/kokkos/issues/3161) +- ScatterView: fix for OpenmpTarget remove inheritance from reducers [\#3162](https://github.com/kokkos/kokkos/issues/3162) +- BuildSystem: Set OpenMP flags according to host compiler [\#3127](https://github.com/kokkos/kokkos/issues/3127) +- OpenMP: Fix logic for nested omp in partition\_master bug [\#3101](https://github.com/kokkos/kokkos/issues/3101) +- BuildSystem: Fixes for Cuda/11 and c++17 [\#3085](https://github.com/kokkos/kokkos/issues/3085) +- HIP: Fix print\_configuration [\#3080](https://github.com/kokkos/kokkos/issues/3080) +- Conditionally define get\_gpu [\#3072](https://github.com/kokkos/kokkos/issues/3072) +- Fix bounds for ranges in random number generator [\#3069](https://github.com/kokkos/kokkos/issues/3069) +- Fix Cuda minor arch check [\#3035](https://github.com/kokkos/kokkos/issues/3035) + +**Incompatibilities:** + +- Remove ETI support [\#3157](https://github.com/kokkos/kokkos/issues/3157) +- Remove KOKKOS\_INTERNAL\_ENABLE\_NON\_CUDA\_BACKEND [\#3147](https://github.com/kokkos/kokkos/issues/3147) +- Remove core/unit\_test/config [\#3146](https://github.com/kokkos/kokkos/issues/3146) +- Removed the preprocessor branch for KOKKOS\_ENABLE\_PROFILING [\#3115](https://github.com/kokkos/kokkos/issues/3115) +- Disable profiling with MSVC [\#3066](https://github.com/kokkos/kokkos/issues/3066) + +**Closed issues:** + +- Silent error (Validate storage level arg to set_scratch_size) [\#3097](https://github.com/kokkos/kokkos/issues/3097) +- Remove KOKKKOS\_ENABLE\_PROFILING Option [\#3095](https://github.com/kokkos/kokkos/issues/3095) +- Cuda 11 -\> allow C++17 [\#3083](https://github.com/kokkos/kokkos/issues/3083) +- In source build failure not explained [\#3081](https://github.com/kokkos/kokkos/issues/3081) +- Allow naming of Views for initialization kernel [\#3070](https://github.com/kokkos/kokkos/issues/3070) +- DefaultInit tests failing when using CTest resource allocation feature [\#3040](https://github.com/kokkos/kokkos/issues/3040) +- Add installation testing. [\#3037](https://github.com/kokkos/kokkos/issues/3037) +- nvcc\_wrapper needs to handle `-expt-relaxed-constexpr` flag [\#3017](https://github.com/kokkos/kokkos/issues/3017) +- CPU core oversubscription warning on macOS with OpenMP backend [\#2996](https://github.com/kokkos/kokkos/issues/2996) +- Default behavior of KOKKOS\_NUM\_DEVICES to use all devices available [\#2975](https://github.com/kokkos/kokkos/issues/2975) +- Assert blocksize \> 0 [\#2974](https://github.com/kokkos/kokkos/issues/2974) +- Add ability to assign kokkos profile function from executable [\#2973](https://github.com/kokkos/kokkos/issues/2973) +- ScatterView Support for the pre/post increment operator [\#2967](https://github.com/kokkos/kokkos/issues/2967) + +- Compiler issue: Cuda build with clang 10 has errors with the atomic unit tests [\#3237](https://github.com/kokkos/kokkos/issues/3237) +- Incompatibility of flags for C++ standard with PGI v20.4 on Power9/NVIDIA V100 system [\#3252](https://github.com/kokkos/kokkos/issues/3252) +- Error configuring as subproject [\#3140](https://github.com/kokkos/kokkos/issues/3140) +- CMake fails with Nvidia compilers when the GPU architecture option is not supplied (Fix configure with OMPT and Cuda) [\#3207](https://github.com/kokkos/kokkos/issues/3207) +- PGI compiler being passed the gcc -fopenmp flag [\#3125](https://github.com/kokkos/kokkos/issues/3125) +- Cuda: Memory leak when using CUDA stream [\#3167](https://github.com/kokkos/kokkos/issues/3167) +- RangePolicy has an implicitly deleted assignment operator [\#3192](https://github.com/kokkos/kokkos/issues/3192) +- MemorySpace::allocate needs to have memory pool counting. [\#3064](https://github.com/kokkos/kokkos/issues/3064) +- Missing write fence for lock based atomics on CUDA [\#3038](https://github.com/kokkos/kokkos/issues/3038) +- CUDA compute capability version check problem [\#3026](https://github.com/kokkos/kokkos/issues/3026) +- Make DynRankView fencing consistent [\#3014](https://github.com/kokkos/kokkos/issues/3014) +- nvcc\_wrapper cant handle -Xcompiler -o out.o [\#2993](https://github.com/kokkos/kokkos/issues/2993) +- Reductions of non-trivial types of size 4 fail in CUDA shfl operations [\#2990](https://github.com/kokkos/kokkos/issues/2990) +- complex\_double misalignment in reduce, clang+CUDA [\#2989](https://github.com/kokkos/kokkos/issues/2989) +- Span of degenerated \(zero-length\) subviews is not zero in some special cases [\#2979](https://github.com/kokkos/kokkos/issues/2979) +- Rank 1 custom layouts dont work as expected. [\#2840](https://github.com/kokkos/kokkos/issues/2840) + +## [3.1.01](https://github.com/kokkos/kokkos/tree/3.1.1) (2020-04-14) [Full Changelog](https://github.com/kokkos/kokkos/compare/3.1.00...3.1.1) **Fixed bugs:** diff --git a/lib/kokkos/CMakeLists.txt b/lib/kokkos/CMakeLists.txt index 0e2aaa1897..540665e48a 100644 --- a/lib/kokkos/CMakeLists.txt +++ b/lib/kokkos/CMakeLists.txt @@ -1,4 +1,9 @@ +# Disable in-source builds to prevent source tree corruption. +if( "${CMAKE_SOURCE_DIR}" STREQUAL "${CMAKE_BINARY_DIR}" ) + message( FATAL_ERROR "FATAL: In-source builds are not allowed. You should create a separate directory for build files." ) +endif() + # We want to determine if options are given with the wrong case # In order to detect which arguments are given to compare against # the list of valid arguments, at the beginning here we need to @@ -34,6 +39,9 @@ IF(COMMAND TRIBITS_PACKAGE_DECL) ELSE() SET(KOKKOS_HAS_TRILINOS OFF) ENDIF() +# Is this build a subdirectory of another project +GET_DIRECTORY_PROPERTY(HAS_PARENT PARENT_DIRECTORY) + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_functions.cmake) INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_pick_cxx_std.cmake) @@ -75,16 +83,17 @@ IF(NOT KOKKOS_HAS_TRILINOS) SET(CMAKE_CXX_COMPILER ${SPACK_CXX} CACHE STRING "the C++ compiler" FORCE) SET(ENV{CXX} ${SPACK_CXX}) ENDIF() - ENDif() - IF(NOT DEFINED ${PROJECT_NAME}) - # WORKAROUND FOR HIPCC - IF(Kokkos_ENABLE_HIP) - SET(KOKKOS_INTERNAL_CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS}) - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} --amdgpu-target=gfx906") - ENDIF() - PROJECT(Kokkos CXX) - IF(Kokkos_ENABLE_HIP) - SET(CMAKE_CXX_FLAGS ${KOKKOS_INTERNAL_CMAKE_CXX_FLAGS}) + ENDIF() + # Always call the project command to define Kokkos_ variables + # and to make sure that C++ is an enabled language + PROJECT(Kokkos CXX) + IF(NOT HAS_PARENT) + IF (NOT CMAKE_BUILD_TYPE) + SET(DEFAULT_BUILD_TYPE "RelWithDebInfo") + MESSAGE(STATUS "Setting build type to '${DEFAULT_BUILD_TYPE}' as none was specified.") + SET(CMAKE_BUILD_TYPE "${DEFAULT_BUILD_TYPE}" CACHE STRING + "Choose the type of build, options are: Debug, Release, RelWithDebInfo and MinSizeRel." + FORCE) ENDIF() ENDIF() ENDIF() @@ -102,8 +111,8 @@ ENDIF() set(Kokkos_VERSION_MAJOR 3) -set(Kokkos_VERSION_MINOR 1) -set(Kokkos_VERSION_PATCH 1) +set(Kokkos_VERSION_MINOR 2) +set(Kokkos_VERSION_PATCH 0) set(Kokkos_VERSION "${Kokkos_VERSION_MAJOR}.${Kokkos_VERSION_MINOR}.${Kokkos_VERSION_PATCH}") math(EXPR KOKKOS_VERSION "${Kokkos_VERSION_MAJOR} * 10000 + ${Kokkos_VERSION_MINOR} * 100 + ${Kokkos_VERSION_PATCH}") @@ -147,6 +156,7 @@ INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_tribits.cmake) # Check the environment and set certain variables # to allow platform-specific checks INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_check_env.cmake) + # The build environment setup goes in the following steps # 1) Check all the enable options. This includes checking Kokkos_DEVICES # 2) Check the compiler ID (type and version) @@ -169,7 +179,6 @@ SET(KOKKOS_EXT_LIBRARIES Kokkos::kokkos Kokkos::kokkoscore Kokkos::kokkoscontain SET(KOKKOS_INT_LIBRARIES kokkos kokkoscore kokkoscontainers kokkosalgorithms) SET_PROPERTY(GLOBAL PROPERTY KOKKOS_INT_LIBRARIES ${KOKKOS_INT_LIBRARIES}) -GET_DIRECTORY_PROPERTY(HAS_PARENT PARENT_DIRECTORY) IF (KOKKOS_HAS_TRILINOS) SET(TRILINOS_INCDIR ${CMAKE_INSTALL_PREFIX}/${${PROJECT_NAME}_INSTALL_INCLUDE_DIR}) SET(KOKKOS_HEADER_DIR ${TRILINOS_INCDIR}) @@ -203,7 +212,7 @@ IF (KOKKOS_HAS_TRILINOS) SET(KOKKOSCORE_XCOMPILER_OPTIONS "${KOKKOSCORE_XCOMPILER_OPTIONS} -Xcompiler ${XCOMP_FLAG}") LIST(APPEND KOKKOS_ALL_COMPILE_OPTIONS -Xcompiler ${XCOMP_FLAG}) ENDFOREACH() - SET(KOKKOSCORE_CXX_FLAGS "${KOKKOSCORE_COMPILE_OPTIONS} ${CMAKE_CXX${KOKKOS_CXX_STANDARD}_STANDARD_COMPILE_OPTION} ${KOKKOSCORE_XCOMPILER_OPTIONS}") + SET(KOKKOSCORE_CXX_FLAGS "${KOKKOSCORE_COMPILE_OPTIONS} ${KOKKOSCORE_XCOMPILER_OPTIONS}") IF (KOKKOS_ENABLE_CUDA) STRING(REPLACE ";" " " KOKKOSCORE_CUDA_OPTIONS "${KOKKOS_CUDA_OPTIONS}") FOREACH(CUDAFE_FLAG ${KOKKOS_CUDAFE_OPTIONS}) @@ -246,7 +255,7 @@ KOKKOS_PACKAGE_POSTPROCESS() #We are ready to configure the header CONFIGURE_FILE(cmake/KokkosCore_config.h.in KokkosCore_config.h @ONLY) -IF (NOT KOKKOS_HAS_TRILINOS) +IF (NOT KOKKOS_HAS_TRILINOS AND NOT Kokkos_INSTALL_TESTING) ADD_LIBRARY(kokkos INTERFACE) #Make sure in-tree projects can reference this as Kokkos:: #to match the installed target names @@ -262,8 +271,6 @@ INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_install.cmake) # If the argument of DESTINATION is a relative path, CMake computes it # as relative to ${CMAKE_INSTALL_PATH}. INSTALL(PROGRAMS ${CMAKE_CURRENT_SOURCE_DIR}/bin/nvcc_wrapper DESTINATION ${CMAKE_INSTALL_BINDIR}) -INSTALL(FILES "${CMAKE_CURRENT_BINARY_DIR}/KokkosCore_config.h" DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}) - # Finally - if we are a subproject - make sure the enabled devices are visible IF (HAS_PARENT) diff --git a/lib/kokkos/Makefile.kokkos b/lib/kokkos/Makefile.kokkos index cf5f06c64c..0736d75833 100644 --- a/lib/kokkos/Makefile.kokkos +++ b/lib/kokkos/Makefile.kokkos @@ -11,20 +11,20 @@ CXXFLAGS += $(SHFLAGS) endif KOKKOS_VERSION_MAJOR = 3 -KOKKOS_VERSION_MINOR = 1 -KOKKOS_VERSION_PATCH = 1 +KOKKOS_VERSION_MINOR = 2 +KOKKOS_VERSION_PATCH = 0 KOKKOS_VERSION = $(shell echo $(KOKKOS_VERSION_MAJOR)*10000+$(KOKKOS_VERSION_MINOR)*100+$(KOKKOS_VERSION_PATCH) | bc) # Options: Cuda,HIP,ROCm,OpenMP,Pthread,Serial KOKKOS_DEVICES ?= "OpenMP" #KOKKOS_DEVICES ?= "Pthread" -# Options: +# Options: # Intel: KNC,KNL,SNB,HSW,BDW,SKX -# NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61,Volta70,Volta72,Turing75 +# NVIDIA: Kepler,Kepler30,Kepler32,Kepler35,Kepler37,Maxwell,Maxwell50,Maxwell52,Maxwell53,Pascal60,Pascal61,Volta70,Volta72,Turing75,Ampere80 # ARM: ARMv80,ARMv81,ARMv8-ThunderX,ARMv8-TX2 # IBM: BGQ,Power7,Power8,Power9 # AMD-GPUS: Vega900,Vega906 -# AMD-CPUS: AMDAVX,EPYC +# AMD-CPUS: AMDAVX,Zen,Zen2 KOKKOS_ARCH ?= "" # Options: yes,no KOKKOS_DEBUG ?= "no" @@ -32,10 +32,8 @@ KOKKOS_DEBUG ?= "no" KOKKOS_USE_TPLS ?= "" # Options: c++11,c++14,c++1y,c++17,c++1z,c++2a KOKKOS_CXX_STANDARD ?= "c++11" -# Options: aggressive_vectorization,disable_profiling,enable_deprecated_code,disable_deprecated_code,enable_large_mem_tests,disable_complex_align +# Options: aggressive_vectorization,disable_profiling,enable_large_mem_tests,disable_complex_align KOKKOS_OPTIONS ?= "" -# Option for setting ETI path -KOKKOS_ETI_PATH ?= ${KOKKOS_PATH}/core/src/eti KOKKOS_CMAKE ?= "no" KOKKOS_TRIBITS ?= "no" KOKKOS_STANDALONE_CMAKE ?= "no" @@ -74,6 +72,7 @@ KOKKOS_INTERNAL_ENABLE_CXX1Y := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD), KOKKOS_INTERNAL_ENABLE_CXX17 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++17) KOKKOS_INTERNAL_ENABLE_CXX1Z := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++1z) KOKKOS_INTERNAL_ENABLE_CXX2A := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++2a) +KOKKOS_INTERNAL_ENABLE_CXX20 := $(call kokkos_has_string,$(KOKKOS_CXX_STANDARD),c++20) # Check for external libraries. KOKKOS_INTERNAL_USE_HWLOC := $(call kokkos_has_string,$(KOKKOS_USE_TPLS),hwloc) @@ -83,9 +82,7 @@ KOKKOS_INTERNAL_USE_MEMKIND := $(call kokkos_has_string,$(KOKKOS_USE_TPLS),exper # Check for advanced settings. KOKKOS_INTERNAL_ENABLE_COMPILER_WARNINGS := $(call kokkos_has_string,$(KOKKOS_OPTIONS),compiler_warnings) KOKKOS_INTERNAL_OPT_RANGE_AGGRESSIVE_VECTORIZATION := $(call kokkos_has_string,$(KOKKOS_OPTIONS),aggressive_vectorization) -KOKKOS_INTERNAL_DISABLE_PROFILING := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_profiling) -KOKKOS_INTERNAL_DISABLE_DEPRECATED_CODE := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_deprecated_code) -KOKKOS_INTERNAL_ENABLE_DEPRECATED_CODE := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_deprecated_code) +KOKKOS_INTERNAL_ENABLE_TUNING := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_tuning) KOKKOS_INTERNAL_DISABLE_COMPLEX_ALIGN := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_complex_align) KOKKOS_INTERNAL_DISABLE_DUALVIEW_MODIFY_CHECK := $(call kokkos_has_string,$(KOKKOS_OPTIONS),disable_dualview_modify_check) KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_PRINT := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_profile_load_print) @@ -96,7 +93,6 @@ KOKKOS_INTERNAL_CUDA_USE_RELOC := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS KOKKOS_INTERNAL_CUDA_USE_LAMBDA := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS),enable_lambda) KOKKOS_INTERNAL_CUDA_USE_CONSTEXPR := $(call kokkos_has_string,$(KOKKOS_CUDA_OPTIONS),enable_constexpr) KOKKOS_INTERNAL_HPX_ENABLE_ASYNC_DISPATCH := $(call kokkos_has_string,$(KOKKOS_HPX_OPTIONS),enable_async_dispatch) -KOKKOS_INTERNAL_ENABLE_ETI := $(call kokkos_has_string,$(KOKKOS_OPTIONS),enable_eti) KOKKOS_INTERNAL_HIP_USE_RELOC := $(call kokkos_has_string,$(KOKKOS_HIP_OPTIONS),rdc) @@ -140,6 +136,12 @@ ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) KOKKOS_DEVICELIST += OPENMPTARGET + KOKKOS_INTERNAL_HAVE_CXX17_OR_NEWER := $(shell expr $(KOKKOS_INTERNAL_ENABLE_CXX17) \ + + $(KOKKOS_INTERNAL_ENABLE_CXX20) \ + + $(KOKKOS_INTERNAL_ENABLE_CXX2A)) + ifneq ($(KOKKOS_INTERNAL_HAVE_CXX17_OR_NEWER), 1) + $(error OpenMPTarget backend requires C++17 or newer) + endif endif ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) @@ -281,7 +283,7 @@ endif ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) KOKKOS_INTERNAL_CXX11_FLAG := --c++11 KOKKOS_INTERNAL_CXX14_FLAG := --c++14 - #KOKKOS_INTERNAL_CXX17_FLAG := --c++17 + KOKKOS_INTERNAL_CXX17_FLAG := --c++17 else ifeq ($(KOKKOS_INTERNAL_COMPILER_XL), 1) KOKKOS_INTERNAL_CXX11_FLAG := -std=c++11 @@ -338,35 +340,27 @@ KOKKOS_INTERNAL_USE_ARCH_PASCAL60 := $(call kokkos_has_string,$(KOKKOS_ARCH),Pas KOKKOS_INTERNAL_USE_ARCH_VOLTA70 := $(call kokkos_has_string,$(KOKKOS_ARCH),Volta70) KOKKOS_INTERNAL_USE_ARCH_VOLTA72 := $(call kokkos_has_string,$(KOKKOS_ARCH),Volta72) KOKKOS_INTERNAL_USE_ARCH_TURING75 := $(call kokkos_has_string,$(KOKKOS_ARCH),Turing75) +KOKKOS_INTERNAL_USE_ARCH_AMPERE80 := $(call kokkos_has_string,$(KOKKOS_ARCH),Ampere80) KOKKOS_INTERNAL_USE_ARCH_NVIDIA := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_KEPLER30) \ + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER32) \ + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER35) \ + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER37) \ + + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50) \ + + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52) \ + + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53) \ + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL61) \ + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL60) \ + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA70) \ + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA72) \ + $(KOKKOS_INTERNAL_USE_ARCH_TURING75) \ - + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50) \ - + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52) \ - + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53)) + + $(KOKKOS_INTERNAL_USE_ARCH_AMPERE80)) #SEK: This seems like a bug to me ifeq ($(KOKKOS_INTERNAL_USE_ARCH_NVIDIA), 0) KOKKOS_INTERNAL_USE_ARCH_MAXWELL50 := $(call kokkos_has_string,$(KOKKOS_ARCH),Maxwell) KOKKOS_INTERNAL_USE_ARCH_KEPLER35 := $(call kokkos_has_string,$(KOKKOS_ARCH),Kepler) - KOKKOS_INTERNAL_USE_ARCH_NVIDIA := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_KEPLER30) \ - + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER32) \ - + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER35) \ - + $(KOKKOS_INTERNAL_USE_ARCH_KEPLER37) \ - + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL61) \ - + $(KOKKOS_INTERNAL_USE_ARCH_PASCAL60) \ - + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA70) \ - + $(KOKKOS_INTERNAL_USE_ARCH_VOLTA72) \ - + $(KOKKOS_INTERNAL_USE_ARCH_TURING75) \ - + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50) \ - + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52) \ - + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53)) + KOKKOS_INTERNAL_USE_ARCH_NVIDIA := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_KEPLER35) \ + + $(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50)) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_NVIDIA), 1) @@ -394,19 +388,20 @@ KOKKOS_INTERNAL_USE_ARCH_IBM := $(strip $(shell echo $(KOKKOS_INTERNAL_USE_ARCH_ # AMD based. KOKKOS_INTERNAL_USE_ARCH_AMDAVX := $(call kokkos_has_string,$(KOKKOS_ARCH),AMDAVX) -KOKKOS_INTERNAL_USE_ARCH_EPYC := $(call kokkos_has_string,$(KOKKOS_ARCH),EPYC) +KOKKOS_INTERNAL_USE_ARCH_ZEN2 := $(call kokkos_has_string,$(KOKKOS_ARCH),Zen2) +KOKKOS_INTERNAL_USE_ARCH_ZEN := $(call kokkos_has_string,$(KOKKOS_ARCH),Zen) KOKKOS_INTERNAL_USE_ARCH_VEGA900 := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega900) KOKKOS_INTERNAL_USE_ARCH_VEGA906 := $(call kokkos_has_string,$(KOKKOS_ARCH),Vega906) # Any AVX? KOKKOS_INTERNAL_USE_ARCH_SSE42 := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_WSM)) KOKKOS_INTERNAL_USE_ARCH_AVX := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_SNB) + $(KOKKOS_INTERNAL_USE_ARCH_AMDAVX)) -KOKKOS_INTERNAL_USE_ARCH_AVX2 := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_HSW) + $(KOKKOS_INTERNAL_USE_ARCH_BDW) + $(KOKKOS_INTERNAL_USE_ARCH_EPYC)) +KOKKOS_INTERNAL_USE_ARCH_AVX2 := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_HSW) + $(KOKKOS_INTERNAL_USE_ARCH_BDW) + $(KOKKOS_INTERNAL_USE_ARCH_ZEN) + $(KOKKOS_INTERNAL_USE_ARCH_ZEN2)) KOKKOS_INTERNAL_USE_ARCH_AVX512MIC := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_KNL)) KOKKOS_INTERNAL_USE_ARCH_AVX512XEON := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_SKX)) # Decide what ISA level we are able to support. -KOKKOS_INTERNAL_USE_ISA_X86_64 := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_WSM) + $(KOKKOS_INTERNAL_USE_ARCH_SNB) + $(KOKKOS_INTERNAL_USE_ARCH_HSW) + $(KOKKOS_INTERNAL_USE_ARCH_BDW) + $(KOKKOS_INTERNAL_USE_ARCH_KNL) + $(KOKKOS_INTERNAL_USE_ARCH_SKX) + $(KOKKOS_INTERNAL_USE_ARCH_EPYC)) +KOKKOS_INTERNAL_USE_ISA_X86_64 := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_WSM) + $(KOKKOS_INTERNAL_USE_ARCH_SNB) + $(KOKKOS_INTERNAL_USE_ARCH_HSW) + $(KOKKOS_INTERNAL_USE_ARCH_BDW) + $(KOKKOS_INTERNAL_USE_ARCH_KNL) + $(KOKKOS_INTERNAL_USE_ARCH_SKX) + $(KOKKOS_INTERNAL_USE_ARCH_ZEN) + $(KOKKOS_INTERNAL_USE_ARCH_ZEN2)) KOKKOS_INTERNAL_USE_ISA_KNC := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_KNC)) KOKKOS_INTERNAL_USE_ISA_POWERPCLE := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_POWER8) + $(KOKKOS_INTERNAL_USE_ARCH_POWER9)) KOKKOS_INTERNAL_USE_ISA_POWERPCBE := $(shell expr $(KOKKOS_INTERNAL_USE_ARCH_POWER7)) @@ -430,7 +425,7 @@ endif KOKKOS_CPPFLAGS = KOKKOS_LIBDIRS = ifneq ($(KOKKOS_CMAKE), yes) - KOKKOS_CPPFLAGS = -I./ -I$(KOKKOS_PATH)/core/src -I$(KOKKOS_PATH)/containers/src -I$(KOKKOS_PATH)/algorithms/src -I$(KOKKOS_ETI_PATH) + KOKKOS_CPPFLAGS = -I./ -I$(KOKKOS_PATH)/core/src -I$(KOKKOS_PATH)/containers/src -I$(KOKKOS_PATH)/algorithms/src endif KOKKOS_TPL_INCLUDE_DIRS = KOKKOS_TPL_LIBRARY_DIRS = @@ -458,88 +453,91 @@ KOKKOS_CONFIG_HEADER=KokkosCore_config.h # Functions for generating config header file kokkos_append_header = $(shell echo $1 >> $(KOKKOS_INTERNAL_CONFIG_TMP)) +# assign hash sign to variable for compat. with make 4.3 +H := \# + # Do not append first line tmp := $(shell echo "/* ---------------------------------------------" > KokkosCore_config.tmp) tmp := $(call kokkos_append_header,"Makefile constructed configuration:") tmp := $(call kokkos_append_header,"$(shell date)") tmp := $(call kokkos_append_header,"----------------------------------------------*/") -tmp := $(call kokkos_append_header,'\#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H)') -tmp := $(call kokkos_append_header,'\#error "Do not include $(KOKKOS_CONFIG_HEADER) directly; include Kokkos_Macros.hpp instead."') -tmp := $(call kokkos_append_header,'\#else') -tmp := $(call kokkos_append_header,'\#define KOKKOS_CORE_CONFIG_H') -tmp := $(call kokkos_append_header,'\#endif') +tmp := $(call kokkos_append_header,'$H''if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H)') +tmp := $(call kokkos_append_header,'$H''error "Do not include $(KOKKOS_CONFIG_HEADER) directly; include Kokkos_Macros.hpp instead."') +tmp := $(call kokkos_append_header,'$H''else') +tmp := $(call kokkos_append_header,'$H''define KOKKOS_CORE_CONFIG_H') +tmp := $(call kokkos_append_header,'$H''endif') tmp := $(call kokkos_append_header,"") -tmp := $(call kokkos_append_header,"\#define KOKKOS_VERSION $(KOKKOS_VERSION)") +tmp := $(call kokkos_append_header,"$H""define KOKKOS_VERSION $(KOKKOS_VERSION)") tmp := $(call kokkos_append_header,"") - + tmp := $(call kokkos_append_header,"/* Execution Spaces */") ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA") - tmp := $(call kokkos_append_header,"\#define KOKKOS_COMPILER_CUDA_VERSION $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION)") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_COMPILER_CUDA_VERSION $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION)") endif ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) - tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_ROCM') - tmp := $(call kokkos_append_header,'\#define KOKKOS_IMPL_ROCM_CLANG_WORKAROUND 1') + tmp := $(call kokkos_append_header,'$H''define KOKKOS_ENABLE_ROCM') + tmp := $(call kokkos_append_header,'$H''define KOKKOS_IMPL_ROCM_CLANG_WORKAROUND 1') endif ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) - tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_HIP') + tmp := $(call kokkos_append_header,'$H''define KOKKOS_ENABLE_HIP') endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMPTARGET), 1) - tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_OPENMPTARGET') + tmp := $(call kokkos_append_header,'$H''define KOKKOS_ENABLE_OPENMPTARGET') ifeq ($(KOKKOS_INTERNAL_COMPILER_GCC), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_WORKAROUND_OPENMPTARGET_GCC") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_WORKAROUND_OPENMPTARGET_GCC") endif endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) - tmp := $(call kokkos_append_header,'\#define KOKKOS_ENABLE_OPENMP') + tmp := $(call kokkos_append_header,'$H''define KOKKOS_ENABLE_OPENMP') endif ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_THREADS") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_THREADS") endif ifeq ($(KOKKOS_INTERNAL_USE_HPX), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HPX") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_HPX") endif ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_SERIAL") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_SERIAL") endif ifeq ($(KOKKOS_INTERNAL_USE_TM), 1) - tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_TM") - tmp := $(call kokkos_append_header,"\#endif") + tmp := $(call kokkos_append_header,"$H""ifndef __CUDA_ARCH__") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_TM") + tmp := $(call kokkos_append_header,"$H""endif") endif ifeq ($(KOKKOS_INTERNAL_USE_ISA_X86_64), 1) - tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__") - tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_X86_64") - tmp := $(call kokkos_append_header,"\#endif") + tmp := $(call kokkos_append_header,"$H""ifndef __CUDA_ARCH__") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_USE_ISA_X86_64") + tmp := $(call kokkos_append_header,"$H""endif") endif ifeq ($(KOKKOS_INTERNAL_USE_ISA_KNC), 1) - tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__") - tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_KNC") - tmp := $(call kokkos_append_header,"\#endif") + tmp := $(call kokkos_append_header,"$H""ifndef __CUDA_ARCH__") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_USE_ISA_KNC") + tmp := $(call kokkos_append_header,"$H""endif") endif ifeq ($(KOKKOS_INTERNAL_USE_ISA_POWERPCLE), 1) - tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__") - tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_POWERPCLE") - tmp := $(call kokkos_append_header,"\#endif") + tmp := $(call kokkos_append_header,"$H""ifndef __CUDA_ARCH__") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_USE_ISA_POWERPCLE") + tmp := $(call kokkos_append_header,"$H""endif") endif ifeq ($(KOKKOS_INTERNAL_USE_ISA_POWERPCBE), 1) - tmp := $(call kokkos_append_header,"\#ifndef __CUDA_ARCH__") - tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_ISA_POWERPCBE") - tmp := $(call kokkos_append_header,"\#endif") + tmp := $(call kokkos_append_header,"$H""ifndef __CUDA_ARCH__") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_USE_ISA_POWERPCBE") + tmp := $(call kokkos_append_header,"$H""endif") endif #only add the c++ standard flags if this is not CMake @@ -548,34 +546,39 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX11), 1) ifneq ($(KOKKOS_STANDALONE_CMAKE), yes) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX11_FLAG) endif - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX11") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX11") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX14), 1) ifneq ($(KOKKOS_STANDALONE_CMAKE), yes) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX14_FLAG) endif - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX14") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX14") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Y), 1) #I cannot make CMake add this in a good way - so add it here KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Y_FLAG) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX14") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX14") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX17), 1) ifneq ($(KOKKOS_STANDALONE_CMAKE), yes) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX17_FLAG) endif - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX17") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX17") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX1Z), 1) #I cannot make CMake add this in a good way - so add it here KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX1Z_FLAG) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX17") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX17") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX2A), 1) #I cannot make CMake add this in a good way - so add it here KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX2A_FLAG) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CXX20") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX20") +endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_CXX20), 1) + #I cannot make CMake add this in a good way - so add it here + KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CXX20_FLAG) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CXX20") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_DEBUG), 1) @@ -585,20 +588,26 @@ ifeq ($(KOKKOS_INTERNAL_ENABLE_DEBUG), 1) KOKKOS_CXXFLAGS += -g KOKKOS_LDFLAGS += -g - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEBUG") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_DEBUG") ifeq ($(KOKKOS_INTERNAL_DISABLE_DUALVIEW_MODIFY_CHECK), 0) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK") endif endif ifeq ($(KOKKOS_INTERNAL_DISABLE_COMPLEX_ALIGN), 0) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_COMPLEX_ALIGN") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_COMPLEX_ALIGN") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_PROFILING_LOAD_PRINT), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_PROFILING_LOAD_PRINT") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_PROFILING_LOAD_PRINT") endif +ifeq ($(KOKKOS_INTERNAL_ENABLE_TUNING), 1) + tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_TUNING") +endif + +tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_LIBDL") + ifeq ($(KOKKOS_INTERNAL_USE_HWLOC), 1) ifneq ($(KOKKOS_CMAKE), yes) ifneq ($(HWLOC_PATH),) @@ -611,11 +620,11 @@ ifeq ($(KOKKOS_INTERNAL_USE_HWLOC), 1) KOKKOS_LIBS += -lhwloc KOKKOS_TPL_LIBRARY_NAMES += hwloc endif - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HWLOC") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_HWLOC") endif ifeq ($(KOKKOS_INTERNAL_USE_LIBRT), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_USE_LIBRT") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_USE_LIBRT") KOKKOS_LIBS += -lrt KOKKOS_TPL_LIBRARY_NAMES += rt endif @@ -632,50 +641,36 @@ ifeq ($(KOKKOS_INTERNAL_USE_MEMKIND), 1) KOKKOS_LIBS += -lmemkind -lnuma KOKKOS_TPL_LIBRARY_NAMES += memkind numa endif - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HBWSPACE") -endif - -ifeq ($(KOKKOS_INTERNAL_DISABLE_PROFILING), 0) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_PROFILING") -endif - -ifeq ($(KOKKOS_INTERNAL_USE_HPX), 0) - ifeq ($(KOKKOS_INTERNAL_ENABLE_DEPRECATED_CODE), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_DEPRECATED_CODE") - endif -endif - -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_ETI") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_HBWSPACE") endif ifeq ($(KOKKOS_INTERNAL_ENABLE_LARGE_MEM_TESTS), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_LARGE_MEM_TESTS") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_LARGE_MEM_TESTS") endif tmp := $(call kokkos_append_header,"/* Optimization Settings */") ifeq ($(KOKKOS_INTERNAL_OPT_RANGE_AGGRESSIVE_VECTORIZATION), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION") endif tmp := $(call kokkos_append_header,"/* Cuda Settings */") ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) ifeq ($(KOKKOS_INTERNAL_CUDA_USE_LDG), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") else ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC") endif endif ifeq ($(KOKKOS_INTERNAL_CUDA_USE_UVM), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_UVM") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_UVM") endif ifeq ($(KOKKOS_INTERNAL_CUDA_USE_RELOC), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE") ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) KOKKOS_CXXFLAGS += -fcuda-rdc KOKKOS_LDFLAGS += -fcuda-rdc @@ -696,7 +691,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) ifeq ($(KOKKOS_INTERNAL_CUDA_USE_LAMBDA), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) ifeq ($(shell test $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION) -gt 70; echo $$?),0) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LAMBDA") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LAMBDA") KOKKOS_CXXFLAGS += -expt-extended-lambda else $(warning Warning: Cuda Lambda support was requested but NVCC version is too low. This requires NVCC for Cuda version 7.5 or higher. Disabling Lambda support now.) @@ -704,14 +699,14 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) endif ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_LAMBDA") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_LAMBDA") endif endif ifeq ($(KOKKOS_INTERNAL_CUDA_USE_CONSTEXPR), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) ifeq ($(shell test $(KOKKOS_INTERNAL_COMPILER_NVCC_VERSION) -ge 80; echo $$?),0) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_CONSTEXPR") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_CONSTEXPR") KOKKOS_CXXFLAGS += -expt-relaxed-constexpr else $(warning Warning: Cuda relaxed constexpr support was requested but NVCC version is too low. This requires NVCC for Cuda version 8.0 or higher. Disabling relaxed constexpr support now.) @@ -719,25 +714,25 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) endif ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_CUDA_CONSTEXPR") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_CUDA_CONSTEXPR") endif endif ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_IMPL_CUDA_CLANG_WORKAROUND") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_IMPL_CUDA_CLANG_WORKAROUND") endif endif ifeq ($(KOKKOS_INTERNAL_USE_HPX), 1) ifeq ($(KOKKOS_INTERNAL_HPX_ENABLE_ASYNC_DISPATCH), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HPX_ASYNC_DISPATCH") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_HPX_ASYNC_DISPATCH") endif endif # Add Architecture flags. ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV80), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV80") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV80") ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) KOKKOS_CXXFLAGS += @@ -754,7 +749,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV80), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV81), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV81") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV81") ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) KOKKOS_CXXFLAGS += @@ -770,9 +765,9 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV81), 1) endif endif -ifeq ($(KOKKOS_INTERNAL_USE_ARCH_EPYC), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AMD_EPYC") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AMD_AVX2") +ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ZEN), 1) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_ZEN") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_AVX2") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -mavx2 @@ -783,9 +778,22 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_EPYC), 1) endif endif +ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ZEN2), 1) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_ZEN2") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMD_AVX2") + + ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) + KOKKOS_CXXFLAGS += -mavx2 + KOKKOS_LDFLAGS += -mavx2 + else + KOKKOS_CXXFLAGS += -march=znver2 -mtune=znver2 + KOKKOS_LDFLAGS += -march=znver2 -mtune=znver2 + endif +endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV80") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV8_THUNDERX") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV80") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV8_THUNDERX") ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) KOKKOS_CXXFLAGS += @@ -802,8 +810,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV81") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_ARMV8_THUNDERX2") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV81") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_ARMV8_THUNDERX2") ifeq ($(KOKKOS_INTERNAL_COMPILER_CRAY), 1) KOKKOS_CXXFLAGS += @@ -820,7 +828,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_ARMV8_THUNDERX2), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SSE42), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_SSE42") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_SSE42") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xSSE4.2 @@ -842,7 +850,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_SSE42), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AVX") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -mavx @@ -864,7 +872,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER7), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_POWER7") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER7") ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) @@ -876,7 +884,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER7), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_POWER8") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER8") ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) @@ -897,7 +905,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER8), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_POWER9") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_POWER9") ifeq ($(KOKKOS_INTERNAL_COMPILER_PGI), 1) @@ -918,7 +926,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_POWER9), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_HSW), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX2") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AVX2") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xCORE-AVX2 @@ -940,7 +948,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_HSW), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_BDW), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX2") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AVX2") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xCORE-AVX2 @@ -962,7 +970,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_BDW), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512MIC), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX512MIC") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AVX512MIC") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xMIC-AVX512 @@ -983,7 +991,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512MIC), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512XEON), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_AVX512XEON") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AVX512XEON") ifeq ($(KOKKOS_INTERNAL_COMPILER_INTEL), 1) KOKKOS_CXXFLAGS += -xCORE-AVX512 @@ -1004,7 +1012,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AVX512XEON), 1) endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KNC), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KNC") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KNC") KOKKOS_CXXFLAGS += -mmic KOKKOS_LDFLAGS += -mmic endif @@ -1022,8 +1030,8 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA_ARCH), 1) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) KOKKOS_INTERNAL_CUDA_ARCH_FLAG=-arch else ifeq ($(KOKKOS_INTERNAL_COMPILER_CLANG), 1) - KOKKOS_INTERNAL_CUDA_ARCH_FLAG=--cuda-gpu-arch - KOKKOS_CXXFLAGS += -x cuda + KOKKOS_INTERNAL_CUDA_ARCH_FLAG=--cuda-gpu-arch + KOKKOS_CXXFLAGS += -x cuda else $(error Makefile.kokkos: CUDA is enabled but the compiler is neither NVCC nor Clang (got version string $(KOKKOS_CXX_VERSION)) ) endif @@ -1039,65 +1047,70 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_CUDA_ARCH), 1) ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER30), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER30") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER30") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_30 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER32), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER32") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER32") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_32 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER35), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER35") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER35") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_35 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_KEPLER37), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_KEPLER37") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_KEPLER37") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_37 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_MAXWELL50), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL50") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_MAXWELL") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_MAXWELL50") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_50 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_MAXWELL52), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL52") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_MAXWELL") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_MAXWELL52") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_52 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_MAXWELL53), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_MAXWELL53") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_MAXWELL") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_MAXWELL53") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_53 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_PASCAL60), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL60") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_PASCAL") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_PASCAL60") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_60 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_PASCAL61), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_PASCAL61") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_PASCAL") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_PASCAL61") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_61 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VOLTA70), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA70") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VOLTA") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VOLTA70") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_70 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VOLTA72), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VOLTA72") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VOLTA") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VOLTA72") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_72 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_TURING75), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_TURING") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_TURING75") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_TURING") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_TURING75") KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_75 endif + ifeq ($(KOKKOS_INTERNAL_USE_ARCH_AMPERE80), 1) + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMPERE") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_AMPERE80") + KOKKOS_INTERNAL_CUDA_ARCH_FLAG := $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG)=sm_80 + endif ifneq ($(KOKKOS_INTERNAL_USE_ARCH_NVIDIA), 0) KOKKOS_CXXFLAGS += $(KOKKOS_INTERNAL_CUDA_ARCH_FLAG) @@ -1121,13 +1134,13 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) # Lets start with adding architecture defines ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA900), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_HIP 900") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VEGA900") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_HIP 900") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA900") KOKKOS_INTERNAL_HIP_ARCH_FLAG := --amdgpu-target=gfx900 endif ifeq ($(KOKKOS_INTERNAL_USE_ARCH_VEGA906), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_HIP 906") - tmp := $(call kokkos_append_header,"\#define KOKKOS_ARCH_VEGA906") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_HIP 906") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ARCH_VEGA906") KOKKOS_INTERNAL_HIP_ARCH_FLAG := --amdgpu-target=gfx906 endif @@ -1138,7 +1151,7 @@ ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) KOKKOS_LDFLAGS+=$(KOKKOS_INTERNAL_HIP_ARCH_FLAG) ifeq ($(KOKKOS_INTERNAL_HIP_USE_RELOC), 1) - tmp := $(call kokkos_append_header,"\#define KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE") + tmp := $(call kokkos_append_header,"$H""define KOKKOS_ENABLE_HIP_RELOCATABLE_DEVICE_CODE") KOKKOS_CXXFLAGS+=-fgpu-rdc KOKKOS_LDFLAGS+=-fgpu-rdc else @@ -1171,9 +1184,6 @@ KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/containers/src/impl/*.cpp) ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/Cuda/*.cpp) -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - KOKKOS_SRC += $(wildcard $(KOKKOS_ETI_PATH)/Cuda/*.cpp) -endif KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Cuda/*.hpp) ifneq ($(CUDA_PATH),) KOKKOS_CPPLAGS += -I$(CUDA_PATH)/include @@ -1211,9 +1221,6 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/OpenMP/*.cpp) -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - KOKKOS_SRC += $(wildcard $(KOKKOS_ETI_PATH)/OpenMP/*.cpp) -endif KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/OpenMP/*.hpp) ifeq ($(KOKKOS_INTERNAL_COMPILER_NVCC), 1) @@ -1228,9 +1235,6 @@ endif ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) KOKKOS_SRC += $(wildcard $(KOKKOS_PATH)/core/src/Threads/*.cpp) -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - KOKKOS_SRC += $(wildcard $(KOKKOS_ETI_PATH)/Threads/*.cpp) -endif KOKKOS_HEADERS += $(wildcard $(KOKKOS_PATH)/core/src/Threads/*.hpp) KOKKOS_LIBS += -lpthread KOKKOS_TPL_LIBRARY_NAMES += pthread @@ -1279,9 +1283,6 @@ endif # Don't include Kokkos_Serial.cpp or Kokkos_Serial_Task.cpp if not using Serial # device to avoid a link warning. ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - KOKKOS_SRC += $(wildcard $(KOKKOS_ETI_PATH)/Serial/*.cpp) -endif endif ifneq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) KOKKOS_SRC := $(filter-out $(KOKKOS_PATH)/core/src/impl/Kokkos_Serial.cpp,$(KOKKOS_SRC)) diff --git a/lib/kokkos/Makefile.targets b/lib/kokkos/Makefile.targets index 18e37a71f7..525962d2d5 100644 --- a/lib/kokkos/Makefile.targets +++ b/lib/kokkos/Makefile.targets @@ -26,21 +26,17 @@ Kokkos_Spinwait.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_Spi $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_Spinwait.cpp Kokkos_HostBarrier.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_HostBarrier.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_HostBarrier.cpp -Kokkos_Profiling_Interface.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_Profiling_Interface.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_Profiling_Interface.cpp +Kokkos_Profiling.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_Profiling.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_Profiling.cpp Kokkos_SharedAlloc.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_SharedAlloc.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_SharedAlloc.cpp Kokkos_MemoryPool.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_MemoryPool.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_MemoryPool.cpp +Kokkos_MemorySpace.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_MemorySpace.cpp + $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_MemorySpace.cpp Kokkos_HostSpace_deepcopy.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/impl/Kokkos_HostSpace_deepcopy.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/impl/Kokkos_HostSpace_deepcopy.cpp -ifeq ($(KOKKOS_INTERNAL_USE_SERIAL), 1) -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - include $(KOKKOS_ETI_PATH)/Serial/Makefile.eti_Serial -endif -endif - ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) Kokkos_Cuda_Instance.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Cuda/Kokkos_Cuda_Instance.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Cuda/Kokkos_Cuda_Instance.cpp @@ -50,9 +46,6 @@ Kokkos_Cuda_Task.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Cuda/Kokkos_Cu $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Cuda/Kokkos_Cuda_Task.cpp Kokkos_Cuda_Locks.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Cuda/Kokkos_Cuda_Locks.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Cuda/Kokkos_Cuda_Locks.cpp -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - include $(KOKKOS_ETI_PATH)/Cuda/Makefile.eti_Cuda -endif endif ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) @@ -75,9 +68,6 @@ Kokkos_ROCm_Task.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/ROCm/Kokkos_RO $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/ROCm/Kokkos_ROCm_Task.cpp Kokkos_ROCm_Impl.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/ROCm/Kokkos_ROCm_Impl.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/ROCm/Kokkos_ROCm_Impl.cpp -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - include $(KOKKOS_ETI_PATH)/ROCm/Makefile.eti_ROCm -endif endif ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) @@ -85,9 +75,6 @@ Kokkos_ThreadsExec_base.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Threads $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Threads/Kokkos_ThreadsExec_base.cpp Kokkos_ThreadsExec.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/Threads/Kokkos_ThreadsExec.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/Threads/Kokkos_ThreadsExec.cpp -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - include $(KOKKOS_ETI_PATH)/Threads/Makefile.eti_Threads -endif endif ifeq ($(KOKKOS_INTERNAL_USE_OPENMP), 1) @@ -95,9 +82,6 @@ Kokkos_OpenMP_Exec.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenMP/Kokko $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp Kokkos_OpenMP_Task.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_PATH)/core/src/OpenMP/Kokkos_OpenMP_Task.cpp $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_PATH)/core/src/OpenMP/Kokkos_OpenMP_Task.cpp -ifeq ($(KOKKOS_INTERNAL_ENABLE_ETI), 1) - include $(KOKKOS_ETI_PATH)/OpenMP/Makefile.eti_OpenMP -endif endif ifeq ($(KOKKOS_INTERNAL_USE_HPX), 1) diff --git a/lib/kokkos/README.md b/lib/kokkos/README.md index a04df9eb9b..a08d238e5d 100644 --- a/lib/kokkos/README.md +++ b/lib/kokkos/README.md @@ -151,7 +151,7 @@ Full details are given in the [build instructions](BUILD.md). Basic setups are s ## CMake The best way to install Kokkos is using the CMake build system. Assuming Kokkos lives in `$srcdir`: -```` +````bash cmake $srcdir \ -DCMAKE_CXX_COMPILER=$path_to_compiler \ -DCMAKE_INSTALL_PREFIX=$path_to_install \ @@ -170,7 +170,7 @@ and run `make test` after completing the build. For your CMake project using Kokkos, code such as the following: -```` +````cmake find_package(Kokkos) ... target_link_libraries(myTarget Kokkos::kokkos) @@ -187,17 +187,15 @@ for the install location given above. ## Spack An alternative to manually building with the CMake is to use the Spack package manager. -To do so, download the `kokkos-spack` git repo and add to the package list: -```` -spack repo add $path-to-kokkos-spack +To get started, download the Spack [repo](https://github.com/spack/spack). ```` A basic installation would be done as: -```` -spack install kokkos +````bash +> spack install kokkos ```` Spack allows options and and compilers to be tuned in the install command. -```` -spack install kokkos@3.0 %gcc@7.3.0 +openmp +````bash +> spack install kokkos@3.0 %gcc@7.3.0 +openmp ```` This example illustrates the three most common parameters to Spack: * Variants: specified with, e.g. `+openmp`, this activates (or deactivates with, e.g. `~openmp`) certain options. @@ -205,33 +203,33 @@ This example illustrates the three most common parameters to Spack: * Compiler: a default compiler will be chosen if not specified, but an exact compiler version can be given with the `%`option. For a complete list of Kokkos options, run: -```` -spack info kokkos +````bash +> spack info kokkos ```` Spack currently installs packages to a location determined by a unique hash. This hash name is not really "human readable". Generally, Spack usage should never really require you to reference the computer-generated unique install folder. More details are given in the [build instructions](BUILD.md). If you must know, you can locate Spack Kokkos installations with: -```` -spack find -p kokkos ... +````bash +> spack find -p kokkos ... ```` where `...` is the unique spec identifying the particular Kokkos configuration and version. - +Some more details can found in the Kokkos spack [documentation](Spack.md) or the Spack [website](https://spack.readthedocs.io/en/latest). ## Raw Makefile A bash script is provided to generate raw makefiles. To install Kokkos as a library create a build directory and run the following -```` -$KOKKOS_PATH/generate_makefile.bash --prefix=$path_to_install +````bash +> $KOKKOS_PATH/generate_makefile.bash --prefix=$path_to_install ```` Once the Makefile is generated, run: -```` -make kokkoslib -make install +````bash +> make kokkoslib +> make install ```` To additionally run the unit tests: -```` -make build-test -make test +````bash +> make build-test +> make test ```` Run `generate_makefile.bash --help` for more detailed options such as changing the device type for which to build. @@ -274,7 +272,7 @@ more than a single GPU is used by a single process. If you publish work which mentions Kokkos, please cite the following paper: -```` +````BibTeX @article{CarterEdwards20143202, title = "Kokkos: Enabling manycore performance portability through polymorphic memory access patterns ", journal = "Journal of Parallel and Distributed Computing ", diff --git a/lib/kokkos/Spack.md b/lib/kokkos/Spack.md new file mode 100644 index 0000000000..31a07deb56 --- /dev/null +++ b/lib/kokkos/Spack.md @@ -0,0 +1,267 @@ +![Kokkos](https://avatars2.githubusercontent.com/u/10199860?s=200&v=4) + +# Kokkos Spack + +This gives instructions for using Spack to install Kokkos and developing packages that depend on Kokkos. + +## Getting Started + +Make sure you have downloaded [Spack](https://github.com/spack/spack). +The easiest way to configure the Spack environment is: +````bash +> source spack/share/spack/setup-env.sh +```` +with other scripts available for other shells. +You can display information about how to install packages with: +````bash +> spack info kokkos +```` +This will print all the information about how to install Kokkos with Spack. +For detailed instructions on how to use Spack, see the [User Manual](https://spack.readthedocs.io). + +## Setting Up Spack: Avoiding the Package Cascade +By default, Spack doesn't 'see' anything on your system - including things like CMake and CUDA. +This can be limited by adding a `packages.yaml` to your `$HOME/.spack` folder that includes CMake (and CUDA, if applicable). For example, your `packages.yaml` file could be: +````yaml +packages: + cuda: + modules: + cuda@10.1.243: [cuda/10.1.243] + paths: + cuda@10.1.243: + /opt/local/ppc64le-pwr8-nvidia/cuda/10.1.243 + buildable: false + cmake: + modules: + cmake: [cmake/3.16.8] + paths: + cmake: + /opt/local/ppc64le/cmake/3.16.8 + buildable: false +```` +The `modules` entry is only necessary on systems that require loading Modules (i.e. most DOE systems). +The `buildable` flag is useful to make sure Spack crashes if there is a path error, +rather than having a type-o and Spack rebuilding everything because `cmake` isn't found. +You can verify your environment is set up correctly by running `spack graph` or `spack spec`. +For example: +````bash +> spack graph kokkos +cuda +o kokkos +|\ +o | cuda + / +o cmake +```` +Without the existing CUDA and CMake being identified in `packages.yaml`, a (subset!) of the output would be: +````bash +o kokkos +|\ +| o cmake +| |\ +| | | |\ +| | | | | |\ +| | | | | | | |\ +| | | | | | | | | |\ +| | | | | | | o | | | libarchive +| | | | | | | |\ \ \ \ +| | | | | | | | | |\ \ \ \ +| | | | | | | | | | | | |_|/ +| | | | | | | | | | | |/| | +| | | | | | | | | | | | | o curl +| | |_|_|_|_|_|_|_|_|_|_|/| +| |/| | | |_|_|_|_|_|_|_|/ +| | | | |/| | | | | | | | +| | | | o | | | | | | | | openssl +| |/| | | | | | | | | | | +| | | | | | | | | | o | | libxml2 +| | |_|_|_|_|_|_|_|/| | | +| | | | | | | | | | |\ \ \ +| o | | | | | | | | | | | | zlib +| / / / / / / / / / / / / +| o | | | | | | | | | | | xz +| / / / / / / / / / / / +| o | | | | | | | | | | rhash +| / / / / / / / / / / +| | | | o | | | | | | nettle +| | | | |\ \ \ \ \ \ \ +| | | o | | | | | | | | libuv +| | | | o | | | | | | | autoconf +| | |_|/| | | | | | | | +| | | | |/ / / / / / / +| o | | | | | | | | | perl +| o | | | | | | | | | gdbm +| o | | | | | | | | | readline +```` + +## Configuring Kokkos as a Project Dependency +Say you have a project "SuperScience" which needs to use Kokkos. +In your `package.py` file, you would generally include something like: +````python +class SuperScience(CMakePackage): + ... + depends_on("kokkos") +```` +Often projects want to tweak behavior when using certain features, e.g. +````python + depends_on("kokkos+cuda", when="+cuda") +```` +if your project needs CUDA-specific logic to configure and build. +This illustrates the general principle in Spack of "flowing-up". +A user requests a feature in the final app: +````bash +> spack install superscience+cuda +```` +This flows upstream to the Kokkos dependency, causing the `kokkos+cuda` variant to build. +The downstream app (SuperScience) tells the upstream app (Kokkos) how to build. + +Because Kokkos is a performance portability library, it somewhat inverts this principle. +Kokkos "flows-down", telling your application how best to configure for performance. +Rather than a downstream app (SuperScience) telling the upstream (Kokkos) what variants to build, +a pre-built Kokkos should be telling the downstream app SuperScience what variants to use. +Kokkos works best when there is an "expert" configuration installed on your system. +Your build should simply request `-DKokkos_ROOT=` and configure appropriately based on the Kokkos it finds. + +Kokkos has many, many build variants. +Where possible, projects should only depend on a general Kokkos, not specific variants. +We recommend instead adding for each system you build on a Kokkos configuration to your `packages.yaml` file (usually found in `~/.spack` for specific users). +For a Xeon + Volta system, this could look like: +````yaml + kokkos: + variants: +cuda +openmp +cuda_lambda +wrapper ^cuda@10.1 cuda_arch=70 + compiler: [gcc@7.2.0] +```` +which gives the "best" Kokkos configuration as CUDA+OpenMP optimized for a Volta 70 architecture using CUDA 10.1. +It also enables support for CUDA Lambdas. +The `+wrapper` option tells Kokkos to build with the special `nvcc_wrapper` (more below). +Note here that we use the built-in `cuda_arch` variant of Spack to specify the archicture. +For a Haswell system, we use +````yaml + kokkos: + variants: +openmp std=14 target=haswell + compiler: [intel@18] +```` +which uses the built-in microarchitecture variants of Spack. +Consult the Spack documentation for more details of Spack microarchitectures +and CUDA architectures. +Spack does not currently provide an AMD GPU microarchitecture option. +If building for HIP or an AMD GPU, Kokkos provides an `amd_gpu_arch` similar to `cuda_arch`. +````yaml + kokkos: + variants: +hip amd_gpu_arch=vega900 +```` + +Without an optimal default in your `packages.yaml` file, it is highly likely that the default Kokkos configuration you get will not be what you want. +For example, CUDA is not enabled by default (there is no easy logic to conditionally activate this for CUDA-enabled systems). +If you don't specify a CUDA build variant in a `packages.yaml` and you build your Kokkos-dependent project: +````bash +> spack install superscience +```` +you may end up just getting the default Kokkos (i.e. Serial). +Some examples are included in the `config/yaml` folder for common platforms. +Before running `spack install ` we recommend running `spack spec ` to confirm your dependency tree is correct. +For example, with Kokkos Kernels: +````bash +kokkos-kernels@3.0%gcc@8.3.0~blas build_type=RelWithDebInfo ~cblas~complex_double~complex_float~cublas~cuda cuda_arch=none ~cusparse~diy+double execspace_cuda=auto execspace_openmp=auto execspace_serial=auto execspace_threads=auto ~float~lapack~lapacke+layoutleft~layoutright memspace_cudaspace=auto memspace_cudauvmspace=auto +memspace_hostspace~mkl+offset_int+offset_size_t~openmp+ordinal_int~ordinal_int64_t~serial~superlu arch=linux-rhel7-skylake_avx512 + ^cmake@3.16.2%gcc@8.3.0~doc+ncurses+openssl+ownlibs~qt arch=linux-rhel7-skylake_avx512 + ^kokkos@3.0%gcc@8.3.0~aggressive_vectorization~amdavx~armv80~armv81~armv8_thunderx~armv8_tx2~bdw~bgq build_type=RelWithDebInfo ~carrizo~compiler_warnings+cuda cuda_arch=none +cuda_lambda~cuda_ldg_intrinsic~cuda_relocatable_device_code~cuda_uvm~debug~debug_bounds_check~debug_dualview_modify_check~deprecated_code~diy~epyc~examples~explicit_instantiation~fiji~gfx901~hpx~hpx_async_dispatch~hsw~hwloc~kaveri~kepler30~kepler32~kepler35~kepler37~knc~knl~maxwell50~maxwell52~maxwell53~memkind~numactl+openmp~pascal60~pascal61~power7~power8~power9+profiling~profiling_load_print~pthread~qthread~rocm~ryzen~serial~skx~snb std=14 ~tests~turing75~vega+volta70~volta72+wrapper~wsm arch=linux-rhel7-skylake_avx512 + ^cuda@10.1%gcc@8.3.0 arch=linux-rhel7-skylake_avx512 + ^kokkos-nvcc-wrapper@old%gcc@8.3.0 build_type=RelWithDebInfo +mpi arch=linux-rhel7-skylake_avx512 + ^openmpi@4.0.2%gcc@8.3.0~cuda+cxx_exceptions fabrics=none ~java~legacylaunchers~memchecker patches=073477a76bba780c67c36e959cd3ee6910743e2735c7e76850ffba6791d498e4 ~pmi schedulers=none ~sqlite3~thread_multiple+vt arch=linux-rhel7-skylake_avx512 +```` +The output can be very verbose, but we can verify the expected `kokkos`: +````bash +kokkos@3.0%gcc@8.3.0~aggressive_vectorization~amdavx~armv80~armv81~armv8_thunderx~armv8_tx2~bdw~bgq build_type=RelWithDebInfo ~carrizo~compiler_warnings+cuda cuda_arch=none +cuda_lambda~cuda_ldg_intrinsic~cuda_relocatable_device_code~cuda_uvm~debug~debug_bounds_check~debug_dualview_modify_check~deprecated_code~diy~epyc~examples~explicit_instantiation~fiji~gfx901~hpx~hpx_async_dispatch~hsw~hwloc~kaveri~kepler30~kepler32~kepler35~kepler37~knc~knl~maxwell50~maxwell52~maxwell53~memkind~numactl+openmp~pascal60~pascal61~power7~power8~power9+profiling~profiling_load_print~pthread~qthread~rocm~ryzen~serial~skx~snb std=11 ~tests~turing75~vega+volta70~volta72+wrapper~wsm arch=linux-rhel7-skylake_avx512 +```` +We see that we do have `+volta70` and `+wrapper`, e.g. + +### Spack Environments +The encouraged way to use Spack is with Spack environments ([more details here](https://spack-tutorial.readthedocs.io/en/latest/tutorial_environments.html#dealing-with-many-specs-at-once)). +Rather than installing packages one-at-a-time, you add packages to an environment. +After adding all packages, you concretize and install them all. +Using environments, one can explicitly add a desired Kokkos for the environment, e.g. +````bash +> spack add kokkos +cuda +cuda_lambda +volta70 +> spack add my_project +my_variant +> ... +> spack install +```` +All packages within the environment will build against the CUDA-enabled Kokkos, +even if they only request a default Kokkos. + +## NVCC Wrapper +Kokkos is a C++ project, but often builds for the CUDA backend. +This is particularly problematic with CMake. At this point, `nvcc` does not accept all the flags that normally get passed to a C++ compiler. +Kokkos provides `nvcc_wrapper` that identifies correctly as a C++ compiler to CMake and accepts C++ flags, but uses `nvcc` as the underlying compiler. +`nvcc` itself also uses an underlying host compiler, e.g. GCC. + +In Spack, the underlying host compiler is specified as below, e.g.: +````bash +> spack install package %gcc@8.0.0 +```` +This is still valid for Kokkos. To use the special wrapper for CUDA builds, request a desired compiler and simply add the `+wrapper` variant. +````bash +> spack install kokkos +cuda +wrapper %gcc@7.2.0 +```` +Downstream projects depending on Kokkos need to override their compiler. +Kokkos provides the compiler in a `kokkos_cxx` variable, +which points to either `nvcc_wrapper` when needed or the regular compiler otherwise. +Spack projects already do this to use MPI compiler wrappers. +````python +def cmake_args(self): + options = [] + ... + options.append("-DCMAKE_CXX_COMPILER=%s" % self.spec["kokkos"].kokkos_cxx) + ... + return options +```` +Note: `nvcc_wrapper` works with the MPI compiler wrappers. +If building your project with MPI, do NOT set your compiler to `nvcc_wrapper`. +Instead set your compiler to `mpicxx` and `nvcc_wrapper` will be used under the hood. +````python +def cmake_args(self): + options = [] + ... + options.append("-DCMAKE_CXX_COMPILER=%s" % self.spec["mpi"].mpicxx) + ... + return options +```` +To accomplish this, `nvcc_wrapper` must depend on MPI (even though it uses no MPI). +This has the unfortunate consequence that Kokkos CUDA projects not using MPI will implicitly depend on MPI anyway. +This behavior is necessary for now, but will hopefully be removed later. +When using environments, if MPI is not needed, you can remove the MPI dependency with: +````bash +> spack add kokkos-nvcc-wrapper ~mpi +```` + +## Developing With Spack + +Spack has historically been much more suited to *deployment* of mature packages than active testing or developing. +However, recent features have improved support for development. +Future releases are likely to make this even easier and incorporate Git integration. +The most common commands will do a full build and install of the packages. +If doing development, you may wish to merely set up a build environment. +This allows you to modify the source and re-build. +In this case, you can stop after configuring. +Suppose you have Kokkos checkout in the folder `kokkos-src`: +````bash +> spack dev-build -d kokkos-src -u cmake kokkos@develop +wrapper +openmp +```` +This sets up a development environment for you in `kokkos-src` which you can use (Bash example shown): +Note: Always specify `develop` as the version when doing `dev-build`, except in rare cases. +You are usually developing a feature branch that will merge into `develop`, +hence you are making a new `develop` branch. + +````bash +> cd kokko-src +> source spack-build-env.txt +> cd spack-build +> make +```` +Before sourcing the Spack development environment, you may wish to save your current environment: +````bash +> declare -px > myenv.sh +```` +When done with Spack, you can then restore your original environment: +````bash +> source myenv.sh +```` diff --git a/lib/kokkos/algorithms/CMakeLists.txt b/lib/kokkos/algorithms/CMakeLists.txt index 38747c152c..fd099054ba 100644 --- a/lib/kokkos/algorithms/CMakeLists.txt +++ b/lib/kokkos/algorithms/CMakeLists.txt @@ -2,7 +2,9 @@ KOKKOS_SUBPACKAGE(Algorithms) -ADD_SUBDIRECTORY(src) +IF (NOT Kokkos_INSTALL_TESTING) + ADD_SUBDIRECTORY(src) +ENDIF() KOKKOS_ADD_TEST_DIRECTORIES(unit_tests) diff --git a/lib/kokkos/algorithms/src/CMakeLists.txt b/lib/kokkos/algorithms/src/CMakeLists.txt index 5afd319fcc..cf5564032c 100644 --- a/lib/kokkos/algorithms/src/CMakeLists.txt +++ b/lib/kokkos/algorithms/src/CMakeLists.txt @@ -7,9 +7,15 @@ KOKKOS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) #----------------------------------------------------------------------------- -FILE(GLOB HEADERS *.hpp) -FILE(GLOB SOURCES *.cpp) -LIST(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h) +FILE(GLOB ALGO_HEADERS *.hpp) +FILE(GLOB ALGO_SOURCES *.cpp) +LIST(APPEND ALGO_HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h) + +INSTALL ( + DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" + DESTINATION ${KOKKOS_HEADER_DIR} + FILES_MATCHING PATTERN "*.hpp" +) #----------------------------------------------------------------------------- @@ -17,8 +23,8 @@ LIST(APPEND HEADERS ${CMAKE_CURRENT_BINARY_DIR}/${PACKAGE_NAME}_config.h) # These will get ignored for standalone CMake and a true interface library made KOKKOS_ADD_INTERFACE_LIBRARY( kokkosalgorithms - HEADERS ${HEADERS} - SOURCES ${SOURCES} + HEADERS ${ALGO_HEADERS} + SOURCES ${ALGO_SOURCES} ) KOKKOS_LIB_INCLUDE_DIRECTORIES(kokkosalgorithms ${KOKKOS_TOP_BUILD_DIR} diff --git a/lib/kokkos/algorithms/src/Kokkos_Random.hpp b/lib/kokkos/algorithms/src/Kokkos_Random.hpp index 0a79675236..40d8db2663 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Random.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Random.hpp @@ -94,9 +94,9 @@ namespace Kokkos { class Pool { public: //The Kokkos device type - typedef Device device_type; + using device_type = Device; //The actual generator type - typedef Generator generator_type; + using generator_type = Generator; //Default constructor: does not initialize a pool Pool(); @@ -124,7 +124,7 @@ namespace Kokkos { class Generator { public: //The Kokkos device type - typedef DeviceType device_type; + using device_type = DeviceType; //Max return values of respective [X]rand[S]() functions enum {MAX_URAND = 0xffffffffU}; @@ -138,75 +138,75 @@ namespace Kokkos { KOKKOS_INLINE_FUNCTION Generator (STATE_ARGUMENTS, int state_idx = 0); - //Draw a equidistributed uint32_t in the range (0,MAX_URAND] + //Draw a equidistributed uint32_t in the range [0,MAX_URAND) KOKKOS_INLINE_FUNCTION uint32_t urand(); - //Draw a equidistributed uint64_t in the range (0,MAX_URAND64] + //Draw a equidistributed uint64_t in the range [0,MAX_URAND64) KOKKOS_INLINE_FUNCTION uint64_t urand64(); - //Draw a equidistributed uint32_t in the range (0,range] + //Draw a equidistributed uint32_t in the range [0,range) KOKKOS_INLINE_FUNCTION uint32_t urand(const uint32_t& range); - //Draw a equidistributed uint32_t in the range (start,end] + //Draw a equidistributed uint32_t in the range [start,end) KOKKOS_INLINE_FUNCTION uint32_t urand(const uint32_t& start, const uint32_t& end ); - //Draw a equidistributed uint64_t in the range (0,range] + //Draw a equidistributed uint64_t in the range [0,range) KOKKOS_INLINE_FUNCTION uint64_t urand64(const uint64_t& range); - //Draw a equidistributed uint64_t in the range (start,end] + //Draw a equidistributed uint64_t in the range [start,end) KOKKOS_INLINE_FUNCTION uint64_t urand64(const uint64_t& start, const uint64_t& end ); - //Draw a equidistributed int in the range (0,MAX_RAND] + //Draw a equidistributed int in the range [0,MAX_RAND) KOKKOS_INLINE_FUNCTION int rand(); - //Draw a equidistributed int in the range (0,range] + //Draw a equidistributed int in the range [0,range) KOKKOS_INLINE_FUNCTION int rand(const int& range); - //Draw a equidistributed int in the range (start,end] + //Draw a equidistributed int in the range [start,end) KOKKOS_INLINE_FUNCTION int rand(const int& start, const int& end ); - //Draw a equidistributed int64_t in the range (0,MAX_RAND64] + //Draw a equidistributed int64_t in the range [0,MAX_RAND64) KOKKOS_INLINE_FUNCTION int64_t rand64(); - //Draw a equidistributed int64_t in the range (0,range] + //Draw a equidistributed int64_t in the range [0,range) KOKKOS_INLINE_FUNCTION int64_t rand64(const int64_t& range); - //Draw a equidistributed int64_t in the range (start,end] + //Draw a equidistributed int64_t in the range [start,end) KOKKOS_INLINE_FUNCTION int64_t rand64(const int64_t& start, const int64_t& end ); - //Draw a equidistributed float in the range (0,1.0] + //Draw a equidistributed float in the range [0,1.0) KOKKOS_INLINE_FUNCTION float frand(); - //Draw a equidistributed float in the range (0,range] + //Draw a equidistributed float in the range [0,range) KOKKOS_INLINE_FUNCTION float frand(const float& range); - //Draw a equidistributed float in the range (start,end] + //Draw a equidistributed float in the range [start,end) KOKKOS_INLINE_FUNCTION float frand(const float& start, const float& end ); - //Draw a equidistributed double in the range (0,1.0] + //Draw a equidistributed double in the range [0,1.0) KOKKOS_INLINE_FUNCTION double drand(); - //Draw a equidistributed double in the range (0,range] + //Draw a equidistributed double in the range [0,range) KOKKOS_INLINE_FUNCTION double drand(const double& range); - //Draw a equidistributed double in the range (start,end] + //Draw a equidistributed double in the range [start,end) KOKKOS_INLINE_FUNCTION double drand(const double& start, const double& end ); @@ -221,11 +221,11 @@ namespace Kokkos { //Additional Functions: - //Fills view with random numbers in the range (0,range] + //Fills view with random numbers in the range [0,range) template void fill_random(ViewType view, PoolType pool, ViewType::value_type range); - //Fills view with random numbers in the range (start,end] + //Fills view with random numbers in the range [start,end) template void fill_random(ViewType view, PoolType pool, ViewType::value_type start, ViewType::value_type end); @@ -381,7 +381,7 @@ struct rand { // NOTE (mfh 26 oct 2014) This is a partial specialization for long // long, a C99 / C++11 signed type which is guaranteed to be at // least 64 bits. Do NOT write a partial specialization for -// int64_t!!! This is just a typedef! It could be either long or +// int64_t!!! This is just an alias! It could be either long or // long long. We don't know which a priori, and I've seen both. // The types long and long long are guaranteed to differ, so it's // always safe to specialize for both. @@ -413,7 +413,7 @@ struct rand { // NOTE (mfh 26 oct 2014) This is a partial specialization for // unsigned long long, a C99 / C++11 unsigned type which is // guaranteed to be at least 64 bits. Do NOT write a partial -// specialization for uint64_t!!! This is just a typedef! It could +// specialization for uint64_t!!! This is just an alias! It could // be either unsigned long or unsigned long long. We don't know // which a priori, and I've seen both. The types unsigned long and // unsigned long long are guaranteed to differ, so it's always safe @@ -604,11 +604,7 @@ struct Random_UniqueIndex { KOKKOS_FUNCTION static int get_state_idx(const locks_view_type) { #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int i = ExecutionSpace::hardware_thread_id(); -#else const int i = ExecutionSpace::impl_hardware_thread_id(); -#endif return i; #else return 0; @@ -652,15 +648,13 @@ struct Random_UniqueIndex { static int get_state_idx(const locks_view_type& locks_) { #ifdef __HIP_DEVICE_COMPILE__ const int i_offset = - (hipThreadIdx_x * hipBlockDim_y + hipThreadIdx_y) * hipBlockDim_z + - hipThreadIdx_z; - int i = (((hipBlockIdx_x * hipGridDim_y + hipBlockIdx_y) * hipGridDim_z + - hipBlockIdx_z) * - hipBlockDim_x * hipBlockDim_y * hipBlockDim_z + + (threadIdx.x * blockDim.y + threadIdx.y) * blockDim.z + threadIdx.z; + int i = (((blockIdx.x * gridDim.y + blockIdx.y) * gridDim.z + blockIdx.z) * + blockDim.x * blockDim.y * blockDim.z + i_offset) % locks_.extent(0); while (Kokkos::atomic_compare_exchange(&locks_(i), 0, 1)) { - i += hipBlockDim_x * hipBlockDim_y * hipBlockDim_z; + i += blockDim.x * blockDim.y * blockDim.z; if (i >= static_cast(locks_.extent(0))) { i = i_offset; } @@ -687,7 +681,7 @@ class Random_XorShift64 { friend class Random_XorShift64_Pool; public: - typedef DeviceType device_type; + using device_type = DeviceType; constexpr static uint32_t MAX_URAND = std::numeric_limits::max(); constexpr static uint64_t MAX_URAND64 = std::numeric_limits::max(); @@ -805,11 +799,6 @@ class Random_XorShift64 { // number KOKKOS_INLINE_FUNCTION double normal() { -#ifndef __HIP_DEVICE_COMPILE__ // FIXME_HIP - using std::sqrt; -#else - using ::sqrt; -#endif double S = 2.0; double U; while (S >= 1.0) { @@ -817,7 +806,7 @@ class Random_XorShift64 { const double V = 2.0 * drand() - 1.0; S = U * U + V * V; } - return U * sqrt(-2.0 * log(S) / S); + return U * std::sqrt(-2.0 * log(S) / S); } KOKKOS_INLINE_FUNCTION @@ -830,15 +819,15 @@ template class Random_XorShift64_Pool { private: using execution_space = typename DeviceType::execution_space; - typedef View locks_type; - typedef View state_data_type; + using locks_type = View; + using state_data_type = View; locks_type locks_; state_data_type state_; int num_states_; public: - typedef Random_XorShift64 generator_type; - typedef DeviceType device_type; + using generator_type = Random_XorShift64; + using device_type = DeviceType; KOKKOS_INLINE_FUNCTION Random_XorShift64_Pool() { num_states_ = 0; } @@ -923,8 +912,8 @@ class Random_XorShift1024 { friend class Random_XorShift1024_Pool; public: - typedef Random_XorShift1024_Pool pool_type; - typedef DeviceType device_type; + using pool_type = Random_XorShift1024_Pool; + using device_type = DeviceType; constexpr static uint32_t MAX_URAND = std::numeric_limits::max(); constexpr static uint64_t MAX_URAND64 = std::numeric_limits::max(); @@ -1046,11 +1035,6 @@ class Random_XorShift1024 { // number KOKKOS_INLINE_FUNCTION double normal() { -#ifndef KOKKOS_ENABLE_HIP // FIXME_HIP - using std::sqrt; -#else - using ::sqrt; -#endif double S = 2.0; double U; while (S >= 1.0) { @@ -1058,7 +1042,7 @@ class Random_XorShift1024 { const double V = 2.0 * drand() - 1.0; S = U * U + V * V; } - return U * sqrt(-2.0 * log(S) / S); + return U * std::sqrt(-2.0 * log(S) / S); } KOKKOS_INLINE_FUNCTION @@ -1071,9 +1055,9 @@ template class Random_XorShift1024_Pool { private: using execution_space = typename DeviceType::execution_space; - typedef View locks_type; - typedef View int_view_type; - typedef View state_data_type; + using locks_type = View; + using int_view_type = View; + using state_data_type = View; locks_type locks_; state_data_type state_; @@ -1082,9 +1066,9 @@ class Random_XorShift1024_Pool { friend class Random_XorShift1024; public: - typedef Random_XorShift1024 generator_type; + using generator_type = Random_XorShift1024; - typedef DeviceType device_type; + using device_type = DeviceType; KOKKOS_INLINE_FUNCTION Random_XorShift1024_Pool() { num_states_ = 0; } @@ -1176,14 +1160,13 @@ struct fill_random_functor_begin_end; template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1203,14 +1186,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1232,14 +1214,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1262,14 +1243,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1293,14 +1273,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1326,14 +1305,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1361,14 +1339,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1398,14 +1375,13 @@ struct fill_random_functor_range { template struct fill_random_functor_range { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type range; - typedef rand - Rand; + using Rand = rand; fill_random_functor_range(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type range_) @@ -1437,14 +1413,13 @@ struct fill_random_functor_range { template struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1466,14 +1441,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1497,14 +1471,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1529,14 +1502,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1562,14 +1534,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1597,14 +1568,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1634,14 +1604,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, @@ -1673,14 +1642,13 @@ struct fill_random_functor_begin_end struct fill_random_functor_begin_end { - typedef typename ViewType::execution_space execution_space; + using execution_space = typename ViewType::execution_space; ViewType a; RandomPool rand_pool; typename ViewType::const_value_type begin, end; - typedef rand - Rand; + using Rand = rand; fill_random_functor_begin_end(ViewType a_, RandomPool rand_pool_, typename ViewType::const_value_type begin_, diff --git a/lib/kokkos/algorithms/src/Kokkos_Sort.hpp b/lib/kokkos/algorithms/src/Kokkos_Sort.hpp index 1c79a505bb..a95b652eab 100644 --- a/lib/kokkos/algorithms/src/Kokkos_Sort.hpp +++ b/lib/kokkos/algorithms/src/Kokkos_Sort.hpp @@ -95,9 +95,9 @@ class BinSort { public: template struct copy_functor { - typedef typename SrcViewType::const_type src_view_type; + using src_view_type = typename SrcViewType::const_type; - typedef Impl::CopyOp copy_op; + using copy_op = Impl::CopyOp; DstViewType dst_values; src_view_type src_values; @@ -120,17 +120,17 @@ class BinSort { // If a Kokkos::View then can generate constant random access // otherwise can only use the constant type. - typedef typename std::conditional< + using src_view_type = typename std::conditional< Kokkos::is_view::value, Kokkos::View >, - typename SrcViewType::const_type>::type src_view_type; + typename SrcViewType::const_type>::type; - typedef typename PermuteViewType::const_type perm_view_type; + using perm_view_type = typename PermuteViewType::const_type; - typedef Impl::CopyOp copy_op; + using copy_op = Impl::CopyOp; DstViewType dst_values; perm_view_type sort_order; @@ -151,8 +151,8 @@ class BinSort { } }; - typedef typename Space::execution_space execution_space; - typedef BinSortOp bin_op_type; + using execution_space = typename Space::execution_space; + using bin_op_type = BinSortOp; struct bin_count_tag {}; struct bin_offset_tag {}; @@ -160,30 +160,30 @@ class BinSort { struct bin_sort_bins_tag {}; public: - typedef SizeType size_type; - typedef size_type value_type; + using size_type = SizeType; + using value_type = size_type; - typedef Kokkos::View offset_type; - typedef Kokkos::View bin_count_type; + using offset_type = Kokkos::View; + using bin_count_type = Kokkos::View; - typedef typename KeyViewType::const_type const_key_view_type; + using const_key_view_type = typename KeyViewType::const_type; // If a Kokkos::View then can generate constant random access // otherwise can only use the constant type. - typedef typename std::conditional< + using const_rnd_key_view_type = typename std::conditional< Kokkos::is_view::value, Kokkos::View >, - const_key_view_type>::type const_rnd_key_view_type; + const_key_view_type>::type; - typedef typename KeyViewType::non_const_value_type non_const_key_scalar; - typedef typename KeyViewType::const_value_type const_key_scalar; + using non_const_key_scalar = typename KeyViewType::non_const_value_type; + using const_key_scalar = typename KeyViewType::const_value_type; - typedef Kokkos::View > - bin_count_atomic_type; + using bin_count_atomic_type = + Kokkos::View >; private: const_key_view_type keys; @@ -266,10 +266,10 @@ class BinSort { template void sort(ValuesViewType const& values, int values_range_begin, int values_range_end) const { - typedef Kokkos::View - scratch_view_type; + using scratch_view_type = + Kokkos::View; const size_t len = range_end - range_begin; const size_t values_len = values_range_end - values_range_begin; @@ -278,13 +278,6 @@ class BinSort { "BinSort::sort: values range length != permutation vector length"); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - scratch_view_type sorted_values( - ViewAllocateWithoutInitializing( - "Kokkos::SortImpl::BinSortFunctor::sorted_values"), - len, values.extent(1), values.extent(2), values.extent(3), - values.extent(4), values.extent(5), values.extent(6), values.extent(7)); -#else scratch_view_type sorted_values( ViewAllocateWithoutInitializing( "Kokkos::SortImpl::BinSortFunctor::sorted_values"), @@ -303,7 +296,6 @@ class BinSort { : KOKKOS_IMPL_CTOR_DEFAULT_ARG, values.rank_dynamic > 7 ? values.extent(7) : KOKKOS_IMPL_CTOR_DEFAULT_ARG); -#endif { copy_permute_functor struct min_max_functor { - typedef Kokkos::MinMaxScalar - minmax_scalar; + using minmax_scalar = + Kokkos::MinMaxScalar; ViewType view; min_max_functor(const ViewType& view_) : view(view_) {} @@ -531,7 +523,7 @@ void sort(ViewType const& view, bool const always_use_kokkos_sort = false) { if (!always_use_kokkos_sort) { if (Impl::try_std_sort(view)) return; } - typedef BinOp1D CompType; + using CompType = BinOp1D; Kokkos::MinMaxScalar result; Kokkos::MinMax reducer(result); @@ -548,8 +540,8 @@ void sort(ViewType const& view, bool const always_use_kokkos_sort = false) { template void sort(ViewType view, size_t const begin, size_t const end) { - typedef Kokkos::RangePolicy range_policy; - typedef BinOp1D CompType; + using range_policy = Kokkos::RangePolicy; + using CompType = BinOp1D; Kokkos::MinMaxScalar result; Kokkos::MinMax reducer(result); diff --git a/lib/kokkos/algorithms/unit_tests/CMakeLists.txt b/lib/kokkos/algorithms/unit_tests/CMakeLists.txt index e3563a8b98..969e67c41b 100644 --- a/lib/kokkos/algorithms/unit_tests/CMakeLists.txt +++ b/lib/kokkos/algorithms/unit_tests/CMakeLists.txt @@ -20,14 +20,18 @@ KOKKOS_ADD_TEST_LIBRARY( HEADERS ${GTEST_SOURCE_DIR}/gtest/gtest.h SOURCES ${GTEST_SOURCE_DIR}/gtest/gtest-all.cc ) -# WORKAROUND FOR HIPCC -IF(Kokkos_ENABLE_HIP) - TARGET_COMPILE_DEFINITIONS(kokkosalgorithms_gtest PUBLIC "-DGTEST_HAS_PTHREAD=0 --amdgpu-target=gfx906") -ELSE() - TARGET_COMPILE_DEFINITIONS(kokkosalgorithms_gtest PUBLIC "-DGTEST_HAS_PTHREAD=0") + +# avoid deprecation warnings from MSVC +TARGET_COMPILE_DEFINITIONS(kokkosalgorithms_gtest PUBLIC GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_PTHREAD=0) + +IF(NOT (Kokkos_ENABLE_CUDA AND WIN32)) +TARGET_COMPILE_FEATURES(kokkosalgorithms_gtest PUBLIC cxx_std_11) ENDIF() -TARGET_COMPILE_FEATURES(kokkosalgorithms_gtest PUBLIC cxx_std_11) +# Suppress clang-tidy diagnostics on code that we do not have control over +IF(CMAKE_CXX_CLANG_TIDY) + SET_TARGET_PROPERTIES(kokkosalgorithms_gtest PROPERTIES CXX_CLANG_TIDY "") +ENDIF() SET(SOURCES UnitTestMain.cpp diff --git a/lib/kokkos/algorithms/unit_tests/TestRandom.hpp b/lib/kokkos/algorithms/unit_tests/TestRandom.hpp index 10a496242b..caba92c152 100644 --- a/lib/kokkos/algorithms/unit_tests/TestRandom.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestRandom.hpp @@ -111,10 +111,10 @@ struct RandomProperties { template struct test_random_functor { - typedef typename GeneratorPool::generator_type rnd_type; + using rnd_type = typename GeneratorPool::generator_type; - typedef RandomProperties value_type; - typedef typename GeneratorPool::device_type device_type; + using value_type = RandomProperties; + using device_type = typename GeneratorPool::device_type; GeneratorPool rand_pool; const double mean; @@ -125,12 +125,12 @@ struct test_random_functor { // implementations might violate this upper bound, due to rounding // error. Just in case, we leave an extra space at the end of each // dimension, in the View types below. - typedef Kokkos::View - type_1d; + using type_1d = + Kokkos::View; type_1d density_1d; - typedef Kokkos::View - type_3d; + using type_3d = + Kokkos::View; type_3d density_3d; test_random_functor(GeneratorPool rand_pool_, type_1d d1d, type_3d d3d) @@ -200,9 +200,9 @@ struct test_random_functor { template struct test_histogram1d_functor { - typedef RandomProperties value_type; - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; + using value_type = RandomProperties; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; // NOTE (mfh 03 Nov 2014): Kokkos::rand::max() is supposed to define // an exclusive upper bound on the range of random numbers that @@ -210,7 +210,7 @@ struct test_histogram1d_functor { // implementations might violate this upper bound, due to rounding // error. Just in case, we leave an extra space at the end of each // dimension, in the View type below. - typedef Kokkos::View type_1d; + using type_1d = Kokkos::View; type_1d density_1d; double mean; @@ -219,7 +219,7 @@ struct test_histogram1d_functor { KOKKOS_INLINE_FUNCTION void operator()( const typename memory_space::size_type i, RandomProperties& prop) const { - typedef typename memory_space::size_type size_type; + using size_type = typename memory_space::size_type; const double count = density_1d(i); prop.mean += count; prop.variance += 1.0 * (count - mean) * (count - mean); @@ -234,9 +234,9 @@ struct test_histogram1d_functor { template struct test_histogram3d_functor { - typedef RandomProperties value_type; - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; + using value_type = RandomProperties; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; // NOTE (mfh 03 Nov 2014): Kokkos::rand::max() is supposed to define // an exclusive upper bound on the range of random numbers that @@ -244,9 +244,9 @@ struct test_histogram3d_functor { // implementations might violate this upper bound, due to rounding // error. Just in case, we leave an extra space at the end of each // dimension, in the View type below. - typedef Kokkos::View - type_3d; + using type_3d = + Kokkos::View; type_3d density_3d; double mean; @@ -255,7 +255,7 @@ struct test_histogram3d_functor { KOKKOS_INLINE_FUNCTION void operator()( const typename memory_space::size_type i, RandomProperties& prop) const { - typedef typename memory_space::size_type size_type; + using size_type = typename memory_space::size_type; const double count = density_3d( i / (HIST_DIM3D * HIST_DIM3D), (i % (HIST_DIM3D * HIST_DIM3D)) / HIST_DIM3D, i % HIST_DIM3D); @@ -276,7 +276,7 @@ struct test_histogram3d_functor { // template struct test_random_scalar { - typedef typename RandomGenerator::generator_type rnd_type; + using rnd_type = typename RandomGenerator::generator_type; int pass_mean, pass_var, pass_covar; int pass_hist1d_mean, pass_hist1d_var, pass_hist1d_covar; @@ -294,7 +294,7 @@ struct test_random_scalar { cout << " -- Testing randomness properties" << endl; RandomProperties result; - typedef test_random_functor functor_type; + using functor_type = test_random_functor; parallel_reduce(num_draws / 1024, functor_type(pool, density_1d, density_3d), result); @@ -325,8 +325,8 @@ struct test_random_scalar { cout << " -- Testing 1-D histogram" << endl; RandomProperties result; - typedef test_histogram1d_functor - functor_type; + using functor_type = + test_histogram1d_functor; parallel_reduce(HIST_DIM1D, functor_type(density_1d, num_draws), result); double tolerance = 6 * std::sqrt(1.0 / HIST_DIM1D); @@ -357,8 +357,8 @@ struct test_random_scalar { cout << " -- Testing 3-D histogram" << endl; RandomProperties result; - typedef test_histogram3d_functor - functor_type; + using functor_type = + test_histogram3d_functor; parallel_reduce(HIST_DIM1D, functor_type(density_3d, num_draws), result); double tolerance = 6 * std::sqrt(1.0 / HIST_DIM1D); diff --git a/lib/kokkos/algorithms/unit_tests/TestSort.hpp b/lib/kokkos/algorithms/unit_tests/TestSort.hpp index b6ff91c25f..a3c362ec20 100644 --- a/lib/kokkos/algorithms/unit_tests/TestSort.hpp +++ b/lib/kokkos/algorithms/unit_tests/TestSort.hpp @@ -55,8 +55,8 @@ namespace Impl { template struct is_sorted_struct { - typedef unsigned int value_type; - typedef ExecutionSpace execution_space; + using value_type = unsigned int; + using execution_space = ExecutionSpace; Kokkos::View keys; @@ -69,8 +69,8 @@ struct is_sorted_struct { template struct sum { - typedef double value_type; - typedef ExecutionSpace execution_space; + using value_type = double; + using execution_space = ExecutionSpace; Kokkos::View keys; @@ -81,8 +81,8 @@ struct sum { template struct bin3d_is_sorted_struct { - typedef unsigned int value_type; - typedef ExecutionSpace execution_space; + using value_type = unsigned int; + using execution_space = ExecutionSpace; Kokkos::View keys; @@ -115,8 +115,8 @@ struct bin3d_is_sorted_struct { template struct sum3D { - typedef double value_type; - typedef ExecutionSpace execution_space; + using value_type = double; + using execution_space = ExecutionSpace; Kokkos::View keys; @@ -131,7 +131,7 @@ struct sum3D { template void test_1D_sort_impl(unsigned int n, bool force_kokkos) { - typedef Kokkos::View KeyViewType; + using KeyViewType = Kokkos::View; KeyViewType keys("Keys", n); // Test sorting array with all numbers equal @@ -166,7 +166,7 @@ void test_1D_sort_impl(unsigned int n, bool force_kokkos) { template void test_3D_sort_impl(unsigned int n) { - typedef Kokkos::View KeyViewType; + using KeyViewType = Kokkos::View; KeyViewType keys("Keys", n * n * n); @@ -186,7 +186,7 @@ void test_3D_sort_impl(unsigned int n) { typename KeyViewType::value_type min[3] = {0, 0, 0}; typename KeyViewType::value_type max[3] = {100, 100, 100}; - typedef Kokkos::BinOp3D BinOp; + using BinOp = Kokkos::BinOp3D; BinOp bin_op(bin_max, min, max); Kokkos::BinSort Sorter(keys, bin_op, false); Sorter.create_permute_vector(); @@ -215,9 +215,9 @@ void test_3D_sort_impl(unsigned int n) { template void test_dynamic_view_sort_impl(unsigned int n) { - typedef Kokkos::Experimental::DynamicView - KeyDynamicViewType; - typedef Kokkos::View KeyViewType; + using KeyDynamicViewType = + Kokkos::Experimental::DynamicView; + using KeyViewType = Kokkos::View; const size_t upper_bound = 2 * n; const size_t min_chunk_size = 1024; @@ -305,8 +305,8 @@ void test_issue_1160_impl() { Kokkos::deep_copy(x_, h_x); Kokkos::deep_copy(v_, h_v); - typedef decltype(element_) KeyViewType; - typedef Kokkos::BinOp1D BinOp; + using KeyViewType = decltype(element_); + using BinOp = Kokkos::BinOp1D; int begin = 3; int end = 8; diff --git a/lib/kokkos/appveyor.yml b/lib/kokkos/appveyor.yml index 8f139ba6ab..c40bf066b7 100644 --- a/lib/kokkos/appveyor.yml +++ b/lib/kokkos/appveyor.yml @@ -5,6 +5,6 @@ build_script: - cmd: >- mkdir build && cd build && - cmake c:\projects\source -DKokkos_ENABLE_TESTS=ON -DKokkos_ENABLE_LIBDL=OFF -DKokkos_ENABLE_PROFILING=OFF && + cmake c:\projects\source -DKokkos_ENABLE_TESTS=ON && cmake --build . --target install && ctest -C Debug -V diff --git a/lib/kokkos/benchmarks/atomic/main.cpp b/lib/kokkos/benchmarks/atomic/main.cpp index 5f0977f754..7b5caa1aee 100644 --- a/lib/kokkos/benchmarks/atomic/main.cpp +++ b/lib/kokkos/benchmarks/atomic/main.cpp @@ -69,13 +69,13 @@ int main(int argc, char* argv[]) { return 0; } - int L = atoi(argv[1]); - int N = atoi(argv[2]); - int M = atoi(argv[3]); - int D = atoi(argv[4]); - int K = atoi(argv[5]); - int R = atoi(argv[6]); - int type = atoi(argv[7]); + int L = std::stoi(argv[1]); + int N = std::stoi(argv[2]); + int M = std::stoi(argv[3]); + int D = std::stoi(argv[4]); + int K = std::stoi(argv[5]); + int R = std::stoi(argv[6]); + int type = std::stoi(argv[7]); Kokkos::View offsets("Offsets", L, M); Kokkos::Random_XorShift64_Pool<> pool(12371); diff --git a/lib/kokkos/benchmarks/bytes_and_flops/main.cpp b/lib/kokkos/benchmarks/bytes_and_flops/main.cpp index c21a16200e..6da2407a08 100644 --- a/lib/kokkos/benchmarks/bytes_and_flops/main.cpp +++ b/lib/kokkos/benchmarks/bytes_and_flops/main.cpp @@ -73,15 +73,15 @@ int main(int argc, char* argv[]) { return 0; } - int P = atoi(argv[1]); - int N = atoi(argv[2]); - int K = atoi(argv[3]); - int R = atoi(argv[4]); - int D = atoi(argv[5]); - int U = atoi(argv[6]); - int F = atoi(argv[7]); - int T = atoi(argv[8]); - int S = atoi(argv[9]); + int P = std::stoi(argv[1]); + int N = std::stoi(argv[2]); + int K = std::stoi(argv[3]); + int R = std::stoi(argv[4]); + int D = std::stoi(argv[5]); + int U = std::stoi(argv[6]); + int F = std::stoi(argv[7]); + int T = std::stoi(argv[8]); + int S = std::stoi(argv[9]); if (U > 8) { printf("U must be 1-8\n"); diff --git a/lib/kokkos/benchmarks/gather/main.cpp b/lib/kokkos/benchmarks/gather/main.cpp index 6a2db3e024..5f10e4dcc1 100644 --- a/lib/kokkos/benchmarks/gather/main.cpp +++ b/lib/kokkos/benchmarks/gather/main.cpp @@ -72,13 +72,13 @@ int main(int argc, char* argv[]) { return 0; } - int S = atoi(argv[1]); - int N = atoi(argv[2]); - int K = atoi(argv[3]); - int D = atoi(argv[4]); - int R = atoi(argv[5]); - int U = atoi(argv[6]); - int F = atoi(argv[7]); + int S = std::stoi(argv[1]); + int N = std::stoi(argv[2]); + int K = std::stoi(argv[3]); + int D = std::stoi(argv[4]); + int R = std::stoi(argv[5]); + int U = std::stoi(argv[6]); + int F = std::stoi(argv[7]); if ((S != 1) && (S != 2) && (S != 4)) { printf("S must be one of 1,2,4\n"); diff --git a/lib/kokkos/benchmarks/gups/gups-kokkos.cc b/lib/kokkos/benchmarks/gups/gups-kokkos.cc index 36fc36925b..5a3ad23800 100644 --- a/lib/kokkos/benchmarks/gups/gups-kokkos.cc +++ b/lib/kokkos/benchmarks/gups/gups-kokkos.cc @@ -50,151 +50,152 @@ #define HLINE "-------------------------------------------------------------\n" #if defined(KOKKOS_ENABLE_CUDA) -typedef Kokkos::View::HostMirror GUPSHostArray; -typedef Kokkos::View GUPSDeviceArray; +using GUPSHostArray = Kokkos::View::HostMirror; +using GUPSDeviceArray = Kokkos::View; #else -typedef Kokkos::View::HostMirror GUPSHostArray; -typedef Kokkos::View GUPSDeviceArray; +using GUPSHostArray = Kokkos::View::HostMirror; +using GUPSDeviceArray = Kokkos::View; #endif -typedef int GUPSIndex; +using GUPSIndex = int; double now() { - struct timeval now; - gettimeofday(&now, nullptr); + struct timeval now; + gettimeofday(&now, nullptr); - return (double) now.tv_sec + ((double) now.tv_usec * 1.0e-6); + return (double)now.tv_sec + ((double)now.tv_usec * 1.0e-6); } -void randomize_indices(GUPSHostArray& indices, GUPSDeviceArray& dev_indices, const int64_t dataCount) { - for( GUPSIndex i = 0; i < indices.extent(0); ++i ) { - indices[i] = lrand48() % dataCount; - } +void randomize_indices(GUPSHostArray& indices, GUPSDeviceArray& dev_indices, + const int64_t dataCount) { + for (GUPSIndex i = 0; i < indices.extent(0); ++i) { + indices[i] = lrand48() % dataCount; + } - Kokkos::deep_copy(dev_indices, indices); + Kokkos::deep_copy(dev_indices, indices); } -void run_gups(GUPSDeviceArray& indices, GUPSDeviceArray& data, const int64_t datum, - const bool performAtomics) { +void run_gups(GUPSDeviceArray& indices, GUPSDeviceArray& data, + const int64_t datum, const bool performAtomics) { + if (performAtomics) { + Kokkos::parallel_for( + "bench-gups-atomic", indices.extent(0), + KOKKOS_LAMBDA(const GUPSIndex i) { + Kokkos::atomic_fetch_xor(&data[indices[i]], datum); + }); + } else { + Kokkos::parallel_for( + "bench-gups-non-atomic", indices.extent(0), + KOKKOS_LAMBDA(const GUPSIndex i) { data[indices[i]] ^= datum; }); + } - if( performAtomics ) { - Kokkos::parallel_for("bench-gups-atomic", indices.extent(0), KOKKOS_LAMBDA(const GUPSIndex i) { - Kokkos::atomic_fetch_xor( &data[indices[i]], datum ); - }); - } else { - Kokkos::parallel_for("bench-gups-non-atomic", indices.extent(0), KOKKOS_LAMBDA(const GUPSIndex i) { - data[indices[i]] ^= datum; - }); - } - - Kokkos::fence(); + Kokkos::fence(); } -int run_benchmark(const GUPSIndex indicesCount, const GUPSIndex dataCount, const int repeats, - const bool useAtomics) { +int run_benchmark(const GUPSIndex indicesCount, const GUPSIndex dataCount, + const int repeats, const bool useAtomics) { + printf("Reports fastest timing per kernel\n"); + printf("Creating Views...\n"); - printf("Reports fastest timing per kernel\n"); - printf("Creating Views...\n"); + printf("Memory Sizes:\n"); + printf("- Elements: %15" PRIu64 " (%12.4f MB)\n", + static_cast(dataCount), + 1.0e-6 * ((double)dataCount * (double)sizeof(int64_t))); + printf("- Indices: %15" PRIu64 " (%12.4f MB)\n", + static_cast(indicesCount), + 1.0e-6 * ((double)indicesCount * (double)sizeof(int64_t))); + printf(" - Atomics: %15s\n", (useAtomics ? "Yes" : "No")); + printf("Benchmark kernels will be performed for %d iterations.\n", repeats); - printf("Memory Sizes:\n"); - printf("- Elements: %15" PRIu64 " (%12.4f MB)\n", static_cast(dataCount), - 1.0e-6 * ((double) dataCount * (double) sizeof(int64_t))); - printf("- Indices: %15" PRIu64 " (%12.4f MB)\n", static_cast(indicesCount), - 1.0e-6 * ((double) indicesCount * (double) sizeof(int64_t))); - printf(" - Atomics: %15s\n", (useAtomics ? "Yes" : "No") ); - printf("Benchmark kernels will be performed for %d iterations.\n", repeats); + printf(HLINE); - printf(HLINE); + GUPSDeviceArray dev_indices("indices", indicesCount); + GUPSDeviceArray dev_data("data", dataCount); + int64_t datum = -1; - GUPSDeviceArray dev_indices("indices", indicesCount); - GUPSDeviceArray dev_data("data", dataCount); - int64_t datum = -1; + GUPSHostArray indices = Kokkos::create_mirror_view(dev_indices); + GUPSHostArray data = Kokkos::create_mirror_view(dev_data); - GUPSHostArray indices = Kokkos::create_mirror_view(dev_indices); - GUPSHostArray data = Kokkos::create_mirror_view(dev_data); + double gupsTime = 0.0; - double gupsTime = 0.0; - - printf("Initializing Views...\n"); + printf("Initializing Views...\n"); #if defined(KOKKOS_HAVE_OPENMP) - Kokkos::parallel_for("init-data", Kokkos::RangePolicy(0, dataCount), + Kokkos::parallel_for( + "init-data", Kokkos::RangePolicy(0, dataCount), #else - Kokkos::parallel_for("init-data", Kokkos::RangePolicy(0, dataCount), + Kokkos::parallel_for( + "init-data", Kokkos::RangePolicy(0, dataCount), #endif - KOKKOS_LAMBDA(const int i) { - - data[i] = 10101010101; - }); + KOKKOS_LAMBDA(const int i) { data[i] = 10101010101; }); #if defined(KOKKOS_HAVE_OPENMP) - Kokkos::parallel_for("init-indices", Kokkos::RangePolicy(0, indicesCount), + Kokkos::parallel_for( + "init-indices", Kokkos::RangePolicy(0, indicesCount), #else - Kokkos::parallel_for("init-indices", Kokkos::RangePolicy(0, indicesCount), + Kokkos::parallel_for( + "init-indices", Kokkos::RangePolicy(0, indicesCount), #endif - KOKKOS_LAMBDA(const int i) { + KOKKOS_LAMBDA(const int i) { indices[i] = 0; }); - indices[i] = 0; - }); + Kokkos::deep_copy(dev_data, data); + Kokkos::deep_copy(dev_indices, indices); + double start; - Kokkos::deep_copy(dev_data, data); - Kokkos::deep_copy(dev_indices, indices); - double start; + printf("Starting benchmarking...\n"); - printf("Starting benchmarking...\n"); + for (GUPSIndex k = 0; k < repeats; ++k) { + randomize_indices(indices, dev_indices, data.extent(0)); - for( GUPSIndex k = 0; k < repeats; ++k ) { - randomize_indices(indices, dev_indices, data.extent(0)); + start = now(); + run_gups(dev_indices, dev_data, datum, useAtomics); + gupsTime += now() - start; + } - start = now(); - run_gups(dev_indices, dev_data, datum, useAtomics); - gupsTime += now() - start; - } + Kokkos::deep_copy(indices, dev_indices); + Kokkos::deep_copy(data, dev_data); - Kokkos::deep_copy(indices, dev_indices); - Kokkos::deep_copy(data, dev_data); + printf(HLINE); + printf( + "GUP/s Random: %18.6f\n", + (1.0e-9 * ((double)repeats) * (double)dev_indices.extent(0)) / gupsTime); + printf(HLINE); - printf(HLINE); - printf("GUP/s Random: %18.6f\n", - (1.0e-9 * ((double) repeats) * (double) dev_indices.extent(0)) / gupsTime); - printf(HLINE); - - return 0; + return 0; } int main(int argc, char* argv[]) { + printf(HLINE); + printf("Kokkos GUPS Benchmark\n"); + printf(HLINE); - printf(HLINE); - printf("Kokkos GUPS Benchmark\n"); - printf(HLINE); + srand48(1010101); - srand48(1010101); + Kokkos::initialize(argc, argv); - Kokkos::initialize(argc, argv); + int64_t indices = 8192; + int64_t data = 33554432; + int64_t repeats = 10; + bool useAtomics = false; - int64_t indices = 8192; - int64_t data = 33554432; - int64_t repeats = 10; - bool useAtomics = false; + for (int i = 1; i < argc; ++i) { + if (strcmp(argv[i], "--indices") == 0) { + indices = std::atoll(argv[i + 1]); + ++i; + } else if (strcmp(argv[i], "--data") == 0) { + data = std::atoll(argv[i + 1]); + ++i; + } else if (strcmp(argv[i], "--repeats") == 0) { + repeats = std::atoll(argv[i + 1]); + ++i; + } else if (strcmp(argv[i], "--atomics") == 0) { + useAtomics = true; + } + } - for( int i = 1; i < argc; ++i ) { - if( strcmp( argv[i], "--indices" ) == 0 ) { - indices = std::atoll(argv[i+1]); - ++i; - } else if( strcmp( argv[i], "--data" ) == 0 ) { - data = std::atoll(argv[i+1]); - ++i; - } else if( strcmp( argv[i], "--repeats" ) == 0 ) { - repeats = std::atoll(argv[i+1]); - ++i; - } else if( strcmp( argv[i], "--atomics" ) == 0 ) { - useAtomics = true; - } - } + const int rc = run_benchmark(indices, data, repeats, useAtomics); - const int rc = run_benchmark(indices, data, repeats, useAtomics); + Kokkos::finalize(); - Kokkos::finalize(); - - return rc; + return rc; } diff --git a/lib/kokkos/benchmarks/policy_performance/main.cpp b/lib/kokkos/benchmarks/policy_performance/main.cpp index 332e5574da..5b04c6ab93 100644 --- a/lib/kokkos/benchmarks/policy_performance/main.cpp +++ b/lib/kokkos/benchmarks/policy_performance/main.cpp @@ -94,22 +94,22 @@ int main(int argc, char* argv[]) { return 0; } - int team_range = atoi(argv[1]); - int thread_range = atoi(argv[2]); - int vector_range = atoi(argv[3]); + int team_range = std::stoi(argv[1]); + int thread_range = std::stoi(argv[2]); + int vector_range = std::stoi(argv[3]); - int outer_repeat = atoi(argv[4]); - int thread_repeat = atoi(argv[5]); - int vector_repeat = atoi(argv[6]); + int outer_repeat = std::stoi(argv[4]); + int thread_repeat = std::stoi(argv[5]); + int vector_repeat = std::stoi(argv[6]); - int team_size = atoi(argv[7]); - int vector_size = atoi(argv[8]); - int schedule = atoi(argv[9]); - int test_type = atoi(argv[10]); + int team_size = std::stoi(argv[7]); + int vector_size = std::stoi(argv[8]); + int schedule = std::stoi(argv[9]); + int test_type = std::stoi(argv[10]); int disable_verbose_output = 0; if (argc > 11) { - disable_verbose_output = atoi(argv[11]); + disable_verbose_output = std::stoi(argv[11]); } if (schedule != 1 && schedule != 2) { @@ -138,9 +138,9 @@ int main(int argc, char* argv[]) { double& lval) { lval += 1; }, result); - typedef Kokkos::View view_type_1d; - typedef Kokkos::View view_type_2d; - typedef Kokkos::View view_type_3d; + using view_type_1d = Kokkos::View; + using view_type_2d = Kokkos::View; + using view_type_3d = Kokkos::View; // Allocate view without initializing // Call a 'warmup' test with 1 repeat - this will initialize the corresponding diff --git a/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp b/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp index 7a1500891f..8e6cd7447d 100644 --- a/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp +++ b/lib/kokkos/benchmarks/policy_performance/policy_perf_test.hpp @@ -68,8 +68,8 @@ void test_policy(int team_range, int thread_range, int vector_range, int team_size, int vector_size, int test_type, ViewType1& v1, ViewType2& v2, ViewType3& v3, double& result, double& result_expect, double& time) { - typedef Kokkos::TeamPolicy t_policy; - typedef typename t_policy::member_type t_team; + using t_policy = Kokkos::TeamPolicy; + using t_team = typename t_policy::member_type; Kokkos::Timer timer; for (int orep = 0; orep < outer_repeat; orep++) { diff --git a/lib/kokkos/benchmarks/stream/stream-kokkos.cc b/lib/kokkos/benchmarks/stream/stream-kokkos.cc index 8d604079d4..e7ef67e080 100644 --- a/lib/kokkos/benchmarks/stream/stream-kokkos.cc +++ b/lib/kokkos/benchmarks/stream/stream-kokkos.cc @@ -48,219 +48,224 @@ #include #define STREAM_ARRAY_SIZE 100000000 -#define STREAM_NTIMES 20 +#define STREAM_NTIMES 20 #define HLINE "-------------------------------------------------------------\n" #if defined(KOKKOS_ENABLE_CUDA) -typedef Kokkos::View::HostMirror StreamHostArray; -typedef Kokkos::View StreamDeviceArray; +using StreamHostArray = Kokkos::View::HostMirror; +using StreamDeviceArray = Kokkos::View; #else -typedef Kokkos::View::HostMirror StreamHostArray; -typedef Kokkos::View StreamDeviceArray; +using StreamHostArray = Kokkos::View::HostMirror; +using StreamDeviceArray = Kokkos::View; #endif -typedef int StreamIndex; +using StreamIndex = int; double now() { - struct timeval now; - gettimeofday(&now, nullptr); + struct timeval now; + gettimeofday(&now, nullptr); - return (double) now.tv_sec + ((double) now.tv_usec * 1.0e-6); + return (double)now.tv_sec + ((double)now.tv_usec * 1.0e-6); } -void perform_copy(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c) { +void perform_copy(StreamDeviceArray& a, StreamDeviceArray& b, + StreamDeviceArray& c) { + Kokkos::parallel_for( + "copy", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { c[i] = a[i]; }); - Kokkos::parallel_for("copy", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { - c[i] = a[i]; - }); - - Kokkos::fence(); + Kokkos::fence(); } -void perform_scale(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c, - const double scalar) { +void perform_scale(StreamDeviceArray& a, StreamDeviceArray& b, + StreamDeviceArray& c, const double scalar) { + Kokkos::parallel_for( + "copy", a.extent(0), + KOKKOS_LAMBDA(const StreamIndex i) { b[i] = scalar * c[i]; }); - Kokkos::parallel_for("copy", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { - b[i] = scalar * c[i]; - }); - - Kokkos::fence(); + Kokkos::fence(); } -void perform_add(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c) { - Kokkos::parallel_for("add", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { - c[i] = a[i] + b[i]; - }); +void perform_add(StreamDeviceArray& a, StreamDeviceArray& b, + StreamDeviceArray& c) { + Kokkos::parallel_for( + "add", a.extent(0), + KOKKOS_LAMBDA(const StreamIndex i) { c[i] = a[i] + b[i]; }); - Kokkos::fence(); + Kokkos::fence(); } -void perform_triad(StreamDeviceArray& a, StreamDeviceArray& b, StreamDeviceArray& c, - const double scalar) { +void perform_triad(StreamDeviceArray& a, StreamDeviceArray& b, + StreamDeviceArray& c, const double scalar) { + Kokkos::parallel_for( + "triad", a.extent(0), + KOKKOS_LAMBDA(const StreamIndex i) { a[i] = b[i] + scalar * c[i]; }); - Kokkos::parallel_for("triad", a.extent(0), KOKKOS_LAMBDA(const StreamIndex i) { - a[i] = b[i] + scalar * c[i]; - }); - - Kokkos::fence(); + Kokkos::fence(); } -int perform_validation(StreamHostArray& a, StreamHostArray& b, StreamHostArray& c, - const StreamIndex arraySize, const double scalar) { +int perform_validation(StreamHostArray& a, StreamHostArray& b, + StreamHostArray& c, const StreamIndex arraySize, + const double scalar) { + double ai = 1.0; + double bi = 2.0; + double ci = 0.0; - double ai = 1.0; - double bi = 2.0; - double ci = 0.0; + for (StreamIndex i = 0; i < arraySize; ++i) { + ci = ai; + bi = scalar * ci; + ci = ai + bi; + ai = bi + scalar * ci; + }; - for( StreamIndex i = 0; i < arraySize; ++i ) { - ci = ai; - bi = scalar * ci; - ci = ai + bi; - ai = bi + scalar * ci; - }; + double aError = 0.0; + double bError = 0.0; + double cError = 0.0; - double aError = 0.0; - double bError = 0.0; - double cError = 0.0; + for (StreamIndex i = 0; i < arraySize; ++i) { + aError = std::abs(a[i] - ai); + bError = std::abs(b[i] - bi); + cError = std::abs(c[i] - ci); + } - for( StreamIndex i = 0; i < arraySize; ++i ) { - aError = std::abs( a[i] - ai ); - bError = std::abs( b[i] - bi ); - cError = std::abs( c[i] - ci ); - } + double aAvgError = aError / (double)arraySize; + double bAvgError = bError / (double)arraySize; + double cAvgError = cError / (double)arraySize; - double aAvgError = aError / (double) arraySize; - double bAvgError = bError / (double) arraySize; - double cAvgError = cError / (double) arraySize; + const double epsilon = 1.0e-13; + int errorCount = 0; - const double epsilon = 1.0e-13; - int errorCount = 0; + if (std::abs(aAvgError / ai) > epsilon) { + fprintf(stderr, "Error: validation check on View a failed.\n"); + errorCount++; + } - if( std::abs( aAvgError / ai ) > epsilon ) { - fprintf(stderr, "Error: validation check on View a failed.\n"); - errorCount++; - } + if (std::abs(bAvgError / bi) > epsilon) { + fprintf(stderr, "Error: validation check on View b failed.\n"); + errorCount++; + } - if( std::abs( bAvgError / bi ) > epsilon ) { - fprintf(stderr, "Error: validation check on View b failed.\n"); - errorCount++; - } + if (std::abs(cAvgError / ci) > epsilon) { + fprintf(stderr, "Error: validation check on View c failed.\n"); + errorCount++; + } - if( std::abs( cAvgError / ci ) > epsilon ) { - fprintf(stderr, "Error: validation check on View c failed.\n"); - errorCount++; - } + if (errorCount == 0) { + printf("All solutions checked and verified.\n"); + } - if( errorCount == 0 ) { - printf("All solutions checked and verified.\n"); - } - - return errorCount; + return errorCount; } int run_benchmark() { + printf("Reports fastest timing per kernel\n"); + printf("Creating Views...\n"); - printf("Reports fastest timing per kernel\n"); - printf("Creating Views...\n"); + printf("Memory Sizes:\n"); + printf("- Array Size: %" PRIu64 "\n", + static_cast(STREAM_ARRAY_SIZE)); + printf("- Per Array: %12.2f MB\n", + 1.0e-6 * (double)STREAM_ARRAY_SIZE * (double)sizeof(double)); + printf("- Total: %12.2f MB\n", + 3.0e-6 * (double)STREAM_ARRAY_SIZE * (double)sizeof(double)); - printf("Memory Sizes:\n"); - printf("- Array Size: %" PRIu64 "\n", static_cast(STREAM_ARRAY_SIZE)); - printf("- Per Array: %12.2f MB\n", 1.0e-6 * (double) STREAM_ARRAY_SIZE * (double) sizeof(double)); - printf("- Total: %12.2f MB\n", 3.0e-6 * (double) STREAM_ARRAY_SIZE * (double) sizeof(double)); + printf("Benchmark kernels will be performed for %d iterations.\n", + STREAM_NTIMES); - printf("Benchmark kernels will be performed for %d iterations.\n", STREAM_NTIMES); + printf(HLINE); - printf(HLINE); + StreamDeviceArray dev_a("a", STREAM_ARRAY_SIZE); + StreamDeviceArray dev_b("b", STREAM_ARRAY_SIZE); + StreamDeviceArray dev_c("c", STREAM_ARRAY_SIZE); - StreamDeviceArray dev_a("a", STREAM_ARRAY_SIZE); - StreamDeviceArray dev_b("b", STREAM_ARRAY_SIZE); - StreamDeviceArray dev_c("c", STREAM_ARRAY_SIZE); + StreamHostArray a = Kokkos::create_mirror_view(dev_a); + StreamHostArray b = Kokkos::create_mirror_view(dev_b); + StreamHostArray c = Kokkos::create_mirror_view(dev_c); - StreamHostArray a = Kokkos::create_mirror_view(dev_a); - StreamHostArray b = Kokkos::create_mirror_view(dev_b); - StreamHostArray c = Kokkos::create_mirror_view(dev_c); + const double scalar = 3.0; - const double scalar = 3.0; + double copyTime = std::numeric_limits::max(); + double scaleTime = std::numeric_limits::max(); + double addTime = std::numeric_limits::max(); + double triadTime = std::numeric_limits::max(); - double copyTime = std::numeric_limits::max(); - double scaleTime = std::numeric_limits::max(); - double addTime = std::numeric_limits::max(); - double triadTime = std::numeric_limits::max(); - - printf("Initializing Views...\n"); + printf("Initializing Views...\n"); #if defined(KOKKOS_HAVE_OPENMP) - Kokkos::parallel_for("init", Kokkos::RangePolicy(0, STREAM_ARRAY_SIZE), + Kokkos::parallel_for( + "init", Kokkos::RangePolicy(0, STREAM_ARRAY_SIZE), #else - Kokkos::parallel_for("init", Kokkos::RangePolicy(0, STREAM_ARRAY_SIZE), + Kokkos::parallel_for( + "init", Kokkos::RangePolicy(0, STREAM_ARRAY_SIZE), #endif - KOKKOS_LAMBDA(const int i) { + KOKKOS_LAMBDA(const int i) { + a[i] = 1.0; + b[i] = 2.0; + c[i] = 0.0; + }); - a[i] = 1.0; - b[i] = 2.0; - c[i] = 0.0; - }); + // Copy contents of a (from the host) to the dev_a (device) + Kokkos::deep_copy(dev_a, a); + Kokkos::deep_copy(dev_b, b); + Kokkos::deep_copy(dev_c, c); - // Copy contents of a (from the host) to the dev_a (device) - Kokkos::deep_copy(dev_a, a); - Kokkos::deep_copy(dev_b, b); - Kokkos::deep_copy(dev_c, c); + double start; - double start; + printf("Starting benchmarking...\n"); - printf("Starting benchmarking...\n"); + for (StreamIndex k = 0; k < STREAM_NTIMES; ++k) { + start = now(); + perform_copy(dev_a, dev_b, dev_c); + copyTime = std::min(copyTime, (now() - start)); - for( StreamIndex k = 0; k < STREAM_NTIMES; ++k ) { - start = now(); - perform_copy(dev_a, dev_b, dev_c); - copyTime = std::min( copyTime, (now() - start) ); + start = now(); + perform_scale(dev_a, dev_b, dev_c, scalar); + scaleTime = std::min(scaleTime, (now() - start)); - start = now(); - perform_scale(dev_a, dev_b, dev_c, scalar); - scaleTime = std::min( scaleTime, (now() - start) ); + start = now(); + perform_add(dev_a, dev_b, dev_c); + addTime = std::min(addTime, (now() - start)); - start = now(); - perform_add(dev_a, dev_b, dev_c); - addTime = std::min( addTime, (now() - start) ); + start = now(); + perform_triad(dev_a, dev_b, dev_c, scalar); + triadTime = std::min(triadTime, (now() - start)); + } - start = now(); - perform_triad(dev_a, dev_b, dev_c, scalar); - triadTime = std::min( triadTime, (now() - start) ); - } + Kokkos::deep_copy(a, dev_a); + Kokkos::deep_copy(b, dev_b); + Kokkos::deep_copy(c, dev_c); - Kokkos::deep_copy(a, dev_a); - Kokkos::deep_copy(b, dev_b); - Kokkos::deep_copy(c, dev_c); + printf("Performing validation...\n"); + int rc = perform_validation(a, b, c, STREAM_ARRAY_SIZE, scalar); - printf("Performing validation...\n"); - int rc = perform_validation(a, b, c, STREAM_ARRAY_SIZE, scalar); + printf(HLINE); - printf(HLINE); + printf("Copy %11.2f MB/s\n", + (1.0e-06 * 2.0 * (double)sizeof(double) * (double)STREAM_ARRAY_SIZE) / + copyTime); + printf("Scale %11.2f MB/s\n", + (1.0e-06 * 2.0 * (double)sizeof(double) * (double)STREAM_ARRAY_SIZE) / + scaleTime); + printf("Add %11.2f MB/s\n", + (1.0e-06 * 3.0 * (double)sizeof(double) * (double)STREAM_ARRAY_SIZE) / + addTime); + printf("Triad %11.2f MB/s\n", + (1.0e-06 * 3.0 * (double)sizeof(double) * (double)STREAM_ARRAY_SIZE) / + triadTime); - printf("Copy %11.2f MB/s\n", - ( 1.0e-06 * 2.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / copyTime ); - printf("Scale %11.2f MB/s\n", - ( 1.0e-06 * 2.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / scaleTime ); - printf("Add %11.2f MB/s\n", - ( 1.0e-06 * 3.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / addTime ); - printf("Triad %11.2f MB/s\n", - ( 1.0e-06 * 3.0 * (double) sizeof(double) * (double) STREAM_ARRAY_SIZE) / triadTime ); + printf(HLINE); - printf(HLINE); - - return rc; + return rc; } int main(int argc, char* argv[]) { + printf(HLINE); + printf("Kokkos STREAM Benchmark\n"); + printf(HLINE); - printf(HLINE); - printf("Kokkos STREAM Benchmark\n"); - printf(HLINE); + Kokkos::initialize(argc, argv); + const int rc = run_benchmark(); + Kokkos::finalize(); - Kokkos::initialize(argc, argv); - const int rc = run_benchmark(); - Kokkos::finalize(); - - return rc; + return rc; } diff --git a/lib/kokkos/bin/nvcc_wrapper b/lib/kokkos/bin/nvcc_wrapper index 8a23d0d620..bc213497bf 100755 --- a/lib/kokkos/bin/nvcc_wrapper +++ b/lib/kokkos/bin/nvcc_wrapper @@ -19,6 +19,13 @@ default_arch="sm_35" # The default C++ compiler. # host_compiler=${NVCC_WRAPPER_DEFAULT_COMPILER:-"g++"} + +# Default to whatever is in the path +nvcc_compiler=nvcc +if [ ! -z $CUDA_ROOT ]; then + nvcc_compiler="$CUDA_ROOT/bin/nvcc" +fi + #host_compiler="icpc" #host_compiler="/usr/local/gcc/4.8.3/bin/g++" #host_compiler="/usr/local/gcc/4.9.1/bin/g++" @@ -58,7 +65,7 @@ object_files_xlinker="" shared_versioned_libraries_host="" shared_versioned_libraries="" -# Does the User set the architecture +# Does the User set the architecture arch_set=0 # Does the user overwrite the host compiler @@ -77,7 +84,7 @@ host_only_args="" # Just run version on host compiler get_host_version=0 -# Enable workaround for CUDA 6.5 for pragma ident +# Enable workaround for CUDA 6.5 for pragma ident replace_pragma_ident=0 # Mark first host compiler argument @@ -179,7 +186,7 @@ do shift ;; #Handle known nvcc args - --dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|--resource-usage|-Xptxas*|--fmad*) + --dryrun|--verbose|--keep|--keep-dir*|-G|--relocatable-device-code*|-lineinfo|-expt-extended-lambda|-expt-relaxed-constexpr|--resource-usage|-Xptxas*|--fmad*|--Wext-lambda-captures-this|-Wext-lambda-captures-this) cuda_args="$cuda_args $1" ;; #Handle more known nvcc args @@ -187,7 +194,7 @@ do cuda_args="$cuda_args $1" ;; #Handle known nvcc args that have an argument - -rdc|-maxrregcount|--default-stream|-Xnvlink|--fmad) + -rdc|-maxrregcount|--default-stream|-Xnvlink|--fmad|-cudart|--cudart) cuda_args="$cuda_args $1 $2" shift ;; @@ -195,11 +202,11 @@ do cuda_args="$cuda_args $1" ;; #Handle unsupported standard flags - --std=c++1y|-std=c++1y|--std=c++1z|-std=c++1z|--std=gnu++1y|-std=gnu++1y|--std=gnu++1z|-std=gnu++1z|--std=c++2a|-std=c++2a|--std=c++17|-std=c++17) + --std=c++1y|-std=c++1y|--std=gnu++1y|-std=gnu++1y|--std=c++1z|-std=c++1z|--std=gnu++1z|-std=gnu++1z|--std=c++2a|-std=c++2a) fallback_std_flag="-std=c++14" # this is hopefully just occurring in a downstream project during CMake feature tests # we really have no choice here but to accept the flag and change to an accepted C++ standard - echo "nvcc_wrapper does not accept standard flags $1 since partial standard flags and standards after C++14 are not supported. nvcc_wrapper will use $fallback_std_flag instead. It is undefined behavior to use this flag. This should only be occurring during CMake configuration." + echo "nvcc_wrapper does not accept standard flags $1 since partial standard flags and standards after C++17 are not supported. nvcc_wrapper will use $fallback_std_flag instead. It is undefined behavior to use this flag. This should only be occurring during CMake configuration." if [ -n "$std_flag" ]; then warn_std_flag shared_args=${shared_args/ $std_flag/} @@ -216,7 +223,25 @@ do fi std_flag=$corrected_std_flag shared_args="$shared_args $std_flag" - ;; + ;; + --std=c++17|-std=c++17) + if [ -n "$std_flag" ]; then + warn_std_flag + shared_args=${shared_args/ $std_flag/} + fi + # NVCC only has C++17 from version 11 on + cuda_main_version=$([[ $(${nvcc_compiler} --version) =~ V([0-9]+) ]] && echo ${BASH_REMATCH[1]}) + if [ ${cuda_main_version} -lt 11 ]; then + fallback_std_flag="-std=c++14" + # this is hopefully just occurring in a downstream project during CMake feature tests + # we really have no choice here but to accept the flag and change to an accepted C++ standard + echo "nvcc_wrapper does not accept standard flags $1 since partial standard flags and standards after C++14 are not supported. nvcc_wrapper will use $fallback_std_flag instead. It is undefined behavior to use this flag. This should only be occurring during CMake configuration." + std_flag=$fallback_std_flag + else + std_flag=$1 + fi + shared_args="$shared_args $std_flag" + ;; --std=c++11|-std=c++11|--std=c++14|-std=c++14) if [ -n "$std_flag" ]; then warn_std_flag @@ -226,6 +251,20 @@ do shared_args="$shared_args $std_flag" ;; + #convert PGI standard flags to something nvcc can handle + --c++11|--c++14|--c++17) + if [ -n "$std_flag" ]; then + warn_std_flag + shared_args=${shared_args/ $std_flag/} + fi + std_flag="-std=${1#--}" + shared_args="$shared_args $std_flag" + ;; + + #ignore PGI forcing ISO C++-conforming code + -A) + ;; + #strip of -std=c++98 due to nvcc warnings and Tribits will place both -std=c++11 and -std=c++98 -std=c++98|--std=c++98) ;; @@ -237,13 +276,17 @@ do ;; #strip -Xcompiler because we add it -Xcompiler) - if [ $first_xcompiler_arg -eq 1 ]; then - xcompiler_args="$2" - first_xcompiler_arg=0 - else - xcompiler_args="$xcompiler_args,$2" + if [[ $2 != "-o" ]]; then + if [ $first_xcompiler_arg -eq 1 ]; then + xcompiler_args="$2" + first_xcompiler_arg=0 + else + xcompiler_args="$xcompiler_args,$2" + fi + shift fi - shift + # else this we have -Xcompiler -o , in this case just drop -Xcompiler and process + # the -o flag with the filename (done above) ;; #strip of "-x cu" because we add that -x) @@ -329,7 +372,7 @@ do if [ $first_xcompiler_arg -eq 1 ]; then xcompiler_args=$1 first_xcompiler_arg=0 - else + else xcompiler_args="$xcompiler_args,$1" fi ;; @@ -387,7 +430,7 @@ if [ $arch_set -ne 1 ]; then fi #Compose compilation command -nvcc_command="nvcc $cuda_args $shared_args $xlinker_args $shared_versioned_libraries" +nvcc_command="$nvcc_compiler $cuda_args $shared_args $xlinker_args $shared_versioned_libraries" if [ $first_xcompiler_arg -eq 0 ]; then nvcc_command="$nvcc_command -Xcompiler $xcompiler_args" fi diff --git a/lib/kokkos/cmake/KokkosConfigCommon.cmake.in b/lib/kokkos/cmake/KokkosConfigCommon.cmake.in index 8c663d01c1..8e664b27a3 100644 --- a/lib/kokkos/cmake/KokkosConfigCommon.cmake.in +++ b/lib/kokkos/cmake/KokkosConfigCommon.cmake.in @@ -2,6 +2,7 @@ SET(Kokkos_DEVICES @KOKKOS_ENABLED_DEVICES@) SET(Kokkos_OPTIONS @KOKKOS_ENABLED_OPTIONS@) SET(Kokkos_TPLS @KOKKOS_ENABLED_TPLS@) SET(Kokkos_ARCH @KOKKOS_ENABLED_ARCH_LIST@) +SET(Kokkos_CXX_COMPILER "@CMAKE_CXX_COMPILER@") # These are needed by KokkosKernels FOREACH(DEV ${Kokkos_DEVICES}) @@ -38,7 +39,7 @@ include(FindPackageHandleStandardArgs) # kokkos_check( # [DEVICES ...] # Set of backends (e.g. "OpenMP" and/or "Cuda") # [ARCH ...] # Target architectures (e.g. "Power9" and/or "Volta70") -# [OPTIONS ...] # Optional settings (e.g. "PROFILING") +# [OPTIONS ...] # Optional settings (e.g. "TUNING") # [TPLS ...] # Third party libraries # [RETURN_VALUE ] # Set a variable that indicates the result of the # # check instead of a fatal error diff --git a/lib/kokkos/cmake/KokkosCore_config.h.in b/lib/kokkos/cmake/KokkosCore_config.h.in index 1d0b58fe02..c0362e4fb0 100644 --- a/lib/kokkos/cmake/KokkosCore_config.h.in +++ b/lib/kokkos/cmake/KokkosCore_config.h.in @@ -1,6 +1,7 @@ #if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." +#error \ + "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." #else #define KOKKOS_CORE_CONFIG_H #endif @@ -10,7 +11,6 @@ // KOKKOS_VERSION / 10000 is the major version #cmakedefine KOKKOS_VERSION @KOKKOS_VERSION@ - /* Execution Spaces */ #cmakedefine KOKKOS_ENABLE_SERIAL #cmakedefine KOKKOS_ENABLE_OPENMP @@ -47,10 +47,9 @@ #cmakedefine KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK #cmakedefine KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK #cmakedefine KOKKOS_ENABLE_COMPILER_WARNINGS -#cmakedefine KOKKOS_ENABLE_PROFILING #cmakedefine KOKKOS_ENABLE_PROFILING_LOAD_PRINT +#cmakedefine KOKKOS_ENABLE_TUNING #cmakedefine KOKKOS_ENABLE_DEPRECATED_CODE -#cmakedefine KOKKOS_ENABLE_ETI #cmakedefine KOKKOS_ENABLE_LARGE_MEM_TESTS #cmakedefine KOKKOS_ENABLE_DUALVIEW_MODIFY_CHECK #cmakedefine KOKKOS_ENABLE_COMPLEX_ALIGN @@ -60,7 +59,7 @@ #cmakedefine KOKKOS_ENABLE_HWLOC #cmakedefine KOKKOS_USE_LIBRT #cmakedefine KOKKOS_ENABLE_HWBSPACE - +#cmakedefine KOKKOS_ENABLE_LIBDL #cmakedefine KOKKOS_IMPL_CUDA_CLANG_WORKAROUND #cmakedefine KOKKOS_COMPILER_CUDA_VERSION @KOKKOS_COMPILER_CUDA_VERSION@ @@ -95,4 +94,6 @@ #cmakedefine KOKKOS_ARCH_VOLTA70 #cmakedefine KOKKOS_ARCH_VOLTA72 #cmakedefine KOKKOS_ARCH_TURING75 -#cmakedefine KOKKOS_ARCH_AMD_EPYC +#cmakedefine KOKKOS_ARCH_AMPERE80 +#cmakedefine KOKKOS_ARCH_AMD_ZEN +#cmakedefine KOKKOS_ARCH_AMD_ZEN2 diff --git a/lib/kokkos/cmake/Modules/CudaToolkit.cmake b/lib/kokkos/cmake/Modules/CudaToolkit.cmake new file mode 100644 index 0000000000..d620a71d36 --- /dev/null +++ b/lib/kokkos/cmake/Modules/CudaToolkit.cmake @@ -0,0 +1,958 @@ +# Distributed under the OSI-approved BSD 3-Clause License. See accompanying +# file Copyright.txt or https://cmake.org/licensing for details. + +#[=======================================================================[.rst: +FindCUDAToolkit +--------------- + +This script locates the NVIDIA CUDA toolkit and the associated libraries, but +does not require the ``CUDA`` language be enabled for a given project. This +module does not search for the NVIDIA CUDA Samples. + +Search Behavior +^^^^^^^^^^^^^^^ + +Finding the CUDA Toolkit requires finding the ``nvcc`` executable, which is +searched for in the following order: + +1. If the ``CUDA`` language has been enabled we will use the directory + containing the compiler as the first search location for ``nvcc``. + +2. If the ``CUDAToolkit_ROOT`` cmake configuration variable (e.g., + ``-DCUDAToolkit_ROOT=/some/path``) *or* environment variable is defined, it + will be searched. If both an environment variable **and** a + configuration variable are specified, the *configuration* variable takes + precedence. + + The directory specified here must be such that the executable ``nvcc`` can be + found underneath the directory specified by ``CUDAToolkit_ROOT``. If + ``CUDAToolkit_ROOT`` is specified, but no ``nvcc`` is found underneath, this + package is marked as **not** found. No subsequent search attempts are + performed. + +3. If the CUDA_PATH environment variable is defined, it will be searched. + +4. The user's path is searched for ``nvcc`` using :command:`find_program`. If + this is found, no subsequent search attempts are performed. Users are + responsible for ensuring that the first ``nvcc`` to show up in the path is + the desired path in the event that multiple CUDA Toolkits are installed. + +5. On Unix systems, if the symbolic link ``/usr/local/cuda`` exists, this is + used. No subsequent search attempts are performed. No default symbolic link + location exists for the Windows platform. + +6. The platform specific default install locations are searched. If exactly one + candidate is found, this is used. The default CUDA Toolkit install locations + searched are: + + +-------------+-------------------------------------------------------------+ + | Platform | Search Pattern | + +=============+=============================================================+ + | macOS | ``/Developer/NVIDIA/CUDA-X.Y`` | + +-------------+-------------------------------------------------------------+ + | Other Unix | ``/usr/local/cuda-X.Y`` | + +-------------+-------------------------------------------------------------+ + | Windows | ``C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y`` | + +-------------+-------------------------------------------------------------+ + + Where ``X.Y`` would be a specific version of the CUDA Toolkit, such as + ``/usr/local/cuda-9.0`` or + ``C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.0`` + + .. note:: + + When multiple CUDA Toolkits are installed in the default location of a + system (e.g., both ``/usr/local/cuda-9.0`` and ``/usr/local/cuda-10.0`` + exist but the ``/usr/local/cuda`` symbolic link does **not** exist), this + package is marked as **not** found. + + There are too many factors involved in making an automatic decision in + the presence of multiple CUDA Toolkits being installed. In this + situation, users are encouraged to either (1) set ``CUDAToolkit_ROOT`` or + (2) ensure that the correct ``nvcc`` executable shows up in ``$PATH`` for + :command:`find_program` to find. + +Options +^^^^^^^ + +``VERSION`` + If specified, describes the version of the CUDA Toolkit to search for. + +``REQUIRED`` + If specified, configuration will error if a suitable CUDA Toolkit is not + found. + +``QUIET`` + If specified, the search for a suitable CUDA Toolkit will not produce any + messages. + +``EXACT`` + If specified, the CUDA Toolkit is considered found only if the exact + ``VERSION`` specified is recovered. + +Imported targets +^^^^^^^^^^^^^^^^ + +An :ref:`imported target ` named ``CUDA::toolkit`` is provided. + +This module defines :prop_tgt:`IMPORTED` targets for each +of the following libraries that are part of the CUDAToolkit: + +- :ref:`CUDA Runtime Library` +- :ref:`CUDA Driver Library` +- :ref:`cuBLAS` +- :ref:`cuFFT` +- :ref:`cuRAND` +- :ref:`cuSOLVER` +- :ref:`cuSPARSE` +- :ref:`cuPTI` +- :ref:`NPP` +- :ref:`nvBLAS` +- :ref:`nvGRAPH` +- :ref:`nvJPEG` +- :ref:`nvidia-ML` +- :ref:`nvRTC` +- :ref:`nvToolsExt` +- :ref:`OpenCL` +- :ref:`cuLIBOS` + +.. _`cuda_toolkit_rt_lib`: + +CUDA Runtime Library +"""""""""""""""""""" + +The CUDA Runtime library (cudart) are what most applications will typically +need to link against to make any calls such as `cudaMalloc`, and `cudaFree`. + +Targets Created: + +- ``CUDA::cudart`` +- ``CUDA::cudart_static`` + +.. _`cuda_toolkit_driver_lib`: + +CUDA Driver Library +"""""""""""""""""""" + +The CUDA Driver library (cuda) are used by applications that use calls +such as `cuMemAlloc`, and `cuMemFree`. This is generally used by advanced + + +Targets Created: + +- ``CUDA::cuda_driver`` +- ``CUDA::cuda_driver`` + +.. _`cuda_toolkit_cuBLAS`: + +cuBLAS +"""""" + +The `cuBLAS `_ library. + +Targets Created: + +- ``CUDA::cublas`` +- ``CUDA::cublas_static`` + +.. _`cuda_toolkit_cuFFT`: + +cuFFT +""""" + +The `cuFFT `_ library. + +Targets Created: + +- ``CUDA::cufft`` +- ``CUDA::cufftw`` +- ``CUDA::cufft_static`` +- ``CUDA::cufftw_static`` + +cuRAND +"""""" + +The `cuRAND `_ library. + +Targets Created: + +- ``CUDA::curand`` +- ``CUDA::curand_static`` + +.. _`cuda_toolkit_cuSOLVER`: + +cuSOLVER +"""""""" + +The `cuSOLVER `_ library. + +Targets Created: + +- ``CUDA::cusolver`` +- ``CUDA::cusolver_static`` + +.. _`cuda_toolkit_cuSPARSE`: + +cuSPARSE +"""""""" + +The `cuSPARSE `_ library. + +Targets Created: + +- ``CUDA::cusparse`` +- ``CUDA::cusparse_static`` + +.. _`cuda_toolkit_cupti`: + +cupti +""""" + +The `NVIDIA CUDA Profiling Tools Interface `_. + +Targets Created: + +- ``CUDA::cupti`` +- ``CUDA::cupti_static`` + +.. _`cuda_toolkit_NPP`: + +NPP +""" + +The `NPP `_ libraries. + +Targets Created: + +- `nppc`: + + - ``CUDA::nppc`` + - ``CUDA::nppc_static`` + +- `nppial`: Arithmetic and logical operation functions in `nppi_arithmetic_and_logical_operations.h` + + - ``CUDA::nppial`` + - ``CUDA::nppial_static`` + +- `nppicc`: Color conversion and sampling functions in `nppi_color_conversion.h` + + - ``CUDA::nppicc`` + - ``CUDA::nppicc_static`` + +- `nppicom`: JPEG compression and decompression functions in `nppi_compression_functions.h` + + - ``CUDA::nppicom`` + - ``CUDA::nppicom_static`` + +- `nppidei`: Data exchange and initialization functions in `nppi_data_exchange_and_initialization.h` + + - ``CUDA::nppidei`` + - ``CUDA::nppidei_static`` + +- `nppif`: Filtering and computer vision functions in `nppi_filter_functions.h` + + - ``CUDA::nppif`` + - ``CUDA::nppif_static`` + +- `nppig`: Geometry transformation functions found in `nppi_geometry_transforms.h` + + - ``CUDA::nppig`` + - ``CUDA::nppig_static`` + +- `nppim`: Morphological operation functions found in `nppi_morphological_operations.h` + + - ``CUDA::nppim`` + - ``CUDA::nppim_static`` + +- `nppist`: Statistics and linear transform in `nppi_statistics_functions.h` and `nppi_linear_transforms.h` + + - ``CUDA::nppist`` + - ``CUDA::nppist_static`` + +- `nppisu`: Memory support functions in `nppi_support_functions.h` + + - ``CUDA::nppisu`` + - ``CUDA::nppisu_static`` + +- `nppitc`: Threshold and compare operation functions in `nppi_threshold_and_compare_operations.h` + + - ``CUDA::nppitc`` + - ``CUDA::nppitc_static`` + +- `npps`: + + - ``CUDA::npps`` + - ``CUDA::npps_static`` + +.. _`cuda_toolkit_nvBLAS`: + +nvBLAS +"""""" + +The `nvBLAS `_ libraries. +This is a shared library only. + +Targets Created: + +- ``CUDA::nvblas`` + +.. _`cuda_toolkit_nvGRAPH`: + +nvGRAPH +""""""" + +The `nvGRAPH `_ library. + +Targets Created: + +- ``CUDA::nvgraph`` +- ``CUDA::nvgraph_static`` + + +.. _`cuda_toolkit_nvJPEG`: + +nvJPEG +"""""" + +The `nvJPEG `_ library. +Introduced in CUDA 10. + +Targets Created: + +- ``CUDA::nvjpeg`` +- ``CUDA::nvjpeg_static`` + +.. _`cuda_toolkit_nvRTC`: + +nvRTC +""""" + +The `nvRTC `_ (Runtime Compilation) library. +This is a shared library only. + +Targets Created: + +- ``CUDA::nvrtc`` + +.. _`cuda_toolkit_nvml`: + +nvidia-ML +""""""""" + +The `NVIDIA Management Library `_. +This is a shared library only. + +Targets Created: + +- ``CUDA::nvml`` + +.. _`cuda_toolkit_nvToolsExt`: + +nvToolsExt +"""""""""" + +The `NVIDIA Tools Extension `_. +This is a shared library only. + +Targets Created: + +- ``CUDA::nvToolsExt`` + +.. _`cuda_toolkit_opencl`: + +OpenCL +"""""" + +The `NVIDIA OpenCL Library `_. +This is a shared library only. + +Targets Created: + +- ``CUDA::OpenCL`` + +.. _`cuda_toolkit_cuLIBOS`: + +cuLIBOS +""""""" + +The cuLIBOS library is a backend thread abstraction layer library which is +static only. The ``CUDA::cublas_static``, ``CUDA::cusparse_static``, +``CUDA::cufft_static``, ``CUDA::curand_static``, and (when implemented) NPP +libraries all automatically have this dependency linked. + +Target Created: + +- ``CUDA::culibos`` + +**Note**: direct usage of this target by consumers should not be necessary. + +.. _`cuda_toolkit_cuRAND`: + + + +Result variables +^^^^^^^^^^^^^^^^ + +``CUDAToolkit_FOUND`` + A boolean specifying whether or not the CUDA Toolkit was found. + +``CUDAToolkit_VERSION`` + The exact version of the CUDA Toolkit found (as reported by + ``nvcc --version``). + +``CUDAToolkit_VERSION_MAJOR`` + The major version of the CUDA Toolkit. + +``CUDAToolkit_VERSION_MAJOR`` + The minor version of the CUDA Toolkit. + +``CUDAToolkit_VERSION_PATCH`` + The patch version of the CUDA Toolkit. + +``CUDAToolkit_BIN_DIR`` + The path to the CUDA Toolkit library directory that contains the CUDA + executable ``nvcc``. + +``CUDAToolkit_INCLUDE_DIRS`` + The path to the CUDA Toolkit ``include`` folder containing the header files + required to compile a project linking against CUDA. + +``CUDAToolkit_LIBRARY_DIR`` + The path to the CUDA Toolkit library directory that contains the CUDA + Runtime library ``cudart``. + +``CUDAToolkit_TARGET_DIR`` + The path to the CUDA Toolkit directory including the target architecture + when cross-compiling. When not cross-compiling this will be equivalant to + ``CUDAToolkit_ROOT_DIR``. + +``CUDAToolkit_NVCC_EXECUTABLE`` + The path to the NVIDIA CUDA compiler ``nvcc``. Note that this path may + **not** be the same as + :variable:`CMAKE_CUDA_COMPILER _COMPILER>`. ``nvcc`` must be + found to determine the CUDA Toolkit version as well as determining other + features of the Toolkit. This variable is set for the convenience of + modules that depend on this one. + + +#]=======================================================================] + +# NOTE: much of this was simply extracted from FindCUDA.cmake. + +# James Bigler, NVIDIA Corp (nvidia.com - jbigler) +# Abe Stephens, SCI Institute -- http://www.sci.utah.edu/~abe/FindCuda.html +# +# Copyright (c) 2008 - 2009 NVIDIA Corporation. All rights reserved. +# +# Copyright (c) 2007-2009 +# Scientific Computing and Imaging Institute, University of Utah +# +# This code is licensed under the MIT License. See the FindCUDA.cmake script +# for the text of the license. + +# The MIT License +# +# License for the specific language governing rights and limitations under +# Permission is hereby granted, free of charge, to any person obtaining a +# copy of this software and associated documentation files (the "Software"), +# to deal in the Software without restriction, including without limitation +# the rights to use, copy, modify, merge, publish, distribute, sublicense, +# and/or sell copies of the Software, and to permit persons to whom the +# Software is furnished to do so, subject to the following conditions: +# +# The above copyright notice and this permission notice shall be included +# in all copies or substantial portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +# OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER +# DEALINGS IN THE SOFTWARE. +# +############################################################################### + +# For NVCC we can easily deduce the SDK binary directory from the compiler path. +if(CMAKE_CUDA_COMPILER_LOADED AND NOT CUDAToolkit_BIN_DIR AND CMAKE_CUDA_COMPILER_ID STREQUAL "NVIDIA") + get_filename_component(cuda_dir "${CMAKE_CUDA_COMPILER}" DIRECTORY) + set(CUDAToolkit_BIN_DIR "${cuda_dir}" CACHE PATH "") + mark_as_advanced(CUDAToolkit_BIN_DIR) + unset(cuda_dir) +endif() + +IF(CMAKE_VERSION VERSION_LESS "3.12.0") + function(import_target_link_libraries target) + cmake_parse_arguments(HACK + "SYSTEM;INTERFACE;PUBLIC" + "" + "" + ${ARGN} + ) + get_target_property(LIBS ${target} INTERFACE_LINK_LIBRARIES) + if (LIBS) + list(APPEND LIBS ${HACK_UNPARSED_ARGUMENTS}) + else() + set(LIBS ${HACK_UNPARSED_ARGUMENTS}) + endif() + set_target_properties(${target} PROPERTIES + INTERFACE_LINK_LIBRARIES "${LIBS}") + endfunction() +ELSE() + function(import_target_link_libraries) + target_link_libraries(${ARGN}) + endfunction() +ENDIF() + +IF(CMAKE_VERSION VERSION_LESS "3.13.0") + function(import_target_link_directories target) + cmake_parse_arguments(HACK + "SYSTEM;INTERFACE;PUBLIC" + "" + "" + ${ARGN} + ) + get_target_property(LINK_LIBS ${target} INTERFACE_LINK_LIBRARIES) + if (LINK_LIBS) #could be not-found + set(LINK_LIBS_LIST ${LINK_LIBS}) + endif() + foreach(LIB ${HACK_UNPARSED_ARGUMENTS}) + list(APPEND LINK_LIBS_LIST -L${LIB}) + endforeach() + set_target_properties(${target} PROPERTIES + INTERFACE_LINK_LIBRARIES "${LINK_LIBS_LIST}") + endfunction() +ELSE() + function(import_target_link_directories) + target_link_directories(${ARGN}) + endfunction() +ENDIF() + +IF(CMAKE_VERSION VERSION_LESS "3.12.0") + function(import_target_include_directories target) + cmake_parse_arguments(HACK + "SYSTEM;INTERFACE;PUBLIC" + "" + "" + ${ARGN} + ) + get_target_property(INLUDE_DIRS ${target} INTERFACE_INCLUDE_DIRECTORIES) + if (INCLUDE_DIRS) + list(APPEND INCLUDE_DIRS ${HACK_UNPARSED_ARGUMENTS}) + else() + set(INCLUDE_DIRS ${HACK_UNPARSED_ARGUMENTS}) + endif() + set_target_properties(${target} PROPERTIES + INTERFACE_INCLUDE_DIRECTORIES "${INCLUDE_DIRS}") + endfunction() +ELSE() + function(import_target_include_directories) + target_include_directories(${ARGN}) + endfunction() +ENDIF() + +# Try language- or user-provided path first. +if(CUDAToolkit_BIN_DIR) + find_program(CUDAToolkit_NVCC_EXECUTABLE + NAMES nvcc nvcc.exe + PATHS ${CUDAToolkit_BIN_DIR} + NO_DEFAULT_PATH + ) +endif() + +# Search using CUDAToolkit_ROOT +find_program(CUDAToolkit_NVCC_EXECUTABLE + NAMES nvcc nvcc.exe + PATHS ENV CUDA_PATH + PATH_SUFFIXES bin +) + +# If the user specified CUDAToolkit_ROOT but nvcc could not be found, this is an error. +if (NOT CUDAToolkit_NVCC_EXECUTABLE AND (DEFINED CUDAToolkit_ROOT OR DEFINED ENV{CUDAToolkit_ROOT})) + # Declare error messages now, print later depending on find_package args. + set(fail_base "Could not find nvcc executable in path specified by") + set(cuda_root_fail "${fail_base} CUDAToolkit_ROOT=${CUDAToolkit_ROOT}") + set(env_cuda_root_fail "${fail_base} environment variable CUDAToolkit_ROOT=$ENV{CUDAToolkit_ROOT}") + + if (CUDAToolkit_FIND_REQUIRED) + if (DEFINED CUDAToolkit_ROOT) + message(FATAL_ERROR ${cuda_root_fail}) + elseif (DEFINED ENV{CUDAToolkit_ROOT}) + message(FATAL_ERROR ${env_cuda_root_fail}) + endif() + else() + if (NOT CUDAToolkit_FIND_QUIETLY) + if (DEFINED CUDAToolkit_ROOT) + message(STATUS ${cuda_root_fail}) + elseif (DEFINED ENV{CUDAToolkit_ROOT}) + message(STATUS ${env_cuda_root_fail}) + endif() + endif() + set(CUDAToolkit_FOUND FALSE) + unset(fail_base) + unset(cuda_root_fail) + unset(env_cuda_root_fail) + return() + endif() +endif() + +# CUDAToolkit_ROOT cmake / env variable not specified, try platform defaults. +# +# - Linux: /usr/local/cuda-X.Y +# - macOS: /Developer/NVIDIA/CUDA-X.Y +# - Windows: C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vX.Y +# +# We will also search the default symlink location /usr/local/cuda first since +# if CUDAToolkit_ROOT is not specified, it is assumed that the symlinked +# directory is the desired location. +if (NOT CUDAToolkit_NVCC_EXECUTABLE) + if (UNIX) + if (NOT APPLE) + set(platform_base "/usr/local/cuda-") + else() + set(platform_base "/Developer/NVIDIA/CUDA-") + endif() + else() + set(platform_base "C:\\Program Files\\NVIDIA GPU Computing Toolkit\\CUDA\\v") + endif() + + # Build out a descending list of possible cuda installations, e.g. + file(GLOB possible_paths "${platform_base}*") + # Iterate the glob results and create a descending list. + set(possible_versions) + foreach (p ${possible_paths}) + # Extract version number from end of string + string(REGEX MATCH "[0-9][0-9]?\\.[0-9]$" p_version ${p}) + if (IS_DIRECTORY ${p} AND p_version) + list(APPEND possible_versions ${p_version}) + endif() + endforeach() + + # Cannot use list(SORT) because that is alphabetical, we need numerical. + # NOTE: this is not an efficient sorting strategy. But even if a user had + # every possible version of CUDA installed, this wouldn't create any + # significant overhead. + set(versions) + foreach (v ${possible_versions}) + list(LENGTH versions num_versions) + # First version, nothing to compare with so just append. + if (num_versions EQUAL 0) + list(APPEND versions ${v}) + else() + # Loop through list. Insert at an index when comparison is + # VERSION_GREATER since we want a descending list. Duplicates will not + # happen since this came from a glob list of directories. + set(i 0) + set(early_terminate FALSE) + while (i LESS num_versions) + list(GET versions ${i} curr) + if (v VERSION_GREATER curr) + list(INSERT versions ${i} ${v}) + set(early_terminate TRUE) + break() + endif() + math(EXPR i "${i} + 1") + endwhile() + # If it did not get inserted, place it at the end. + if (NOT early_terminate) + list(APPEND versions ${v}) + endif() + endif() + endforeach() + + # With a descending list of versions, populate possible paths to search. + set(search_paths) + foreach (v ${versions}) + list(APPEND search_paths "${platform_base}${v}") + endforeach() + + # Force the global default /usr/local/cuda to the front on Unix. + if (UNIX) + list(INSERT search_paths 0 "/usr/local/cuda") + endif() + + # Now search for nvcc again using the platform default search paths. + find_program(CUDAToolkit_NVCC_EXECUTABLE + NAMES nvcc nvcc.exe + PATHS ${search_paths} + PATH_SUFFIXES bin + ) + + # We are done with these variables now, cleanup for caller. + unset(platform_base) + unset(possible_paths) + unset(possible_versions) + unset(versions) + unset(i) + unset(early_terminate) + unset(search_paths) + + if (NOT CUDAToolkit_NVCC_EXECUTABLE) + if (CUDAToolkit_FIND_REQUIRED) + message(FATAL_ERROR "Could not find nvcc, please set CUDAToolkit_ROOT.") + elseif(NOT CUDAToolkit_FIND_QUIETLY) + message(STATUS "Could not find nvcc, please set CUDAToolkit_ROOT.") + endif() + + set(CUDAToolkit_FOUND FALSE) + return() + endif() +endif() + +if(NOT CUDAToolkit_BIN_DIR AND CUDAToolkit_NVCC_EXECUTABLE) + get_filename_component(cuda_dir "${CUDAToolkit_NVCC_EXECUTABLE}" DIRECTORY) + set(CUDAToolkit_BIN_DIR "${cuda_dir}" CACHE PATH "" FORCE) + mark_as_advanced(CUDAToolkit_BIN_DIR) + unset(cuda_dir) +endif() + +if(CUDAToolkit_NVCC_EXECUTABLE AND + CUDAToolkit_NVCC_EXECUTABLE STREQUAL CMAKE_CUDA_COMPILER) + # Need to set these based off the already computed CMAKE_CUDA_COMPILER_VERSION value + # This if statement will always match, but is used to provide variables for MATCH 1,2,3... + if(CMAKE_CUDA_COMPILER_VERSION MATCHES [=[([0-9]+)\.([0-9]+)\.([0-9]+)]=]) + set(CUDAToolkit_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(CUDAToolkit_VERSION_MINOR "${CMAKE_MATCH_2}") + set(CUDAToolkit_VERSION_PATCH "${CMAKE_MATCH_3}") + set(CUDAToolkit_VERSION "${CMAKE_CUDA_COMPILER_VERSION}") + endif() +else() + # Compute the version by invoking nvcc + execute_process (COMMAND ${CUDAToolkit_NVCC_EXECUTABLE} "--version" OUTPUT_VARIABLE NVCC_OUT) + if(NVCC_OUT MATCHES [=[ V([0-9]+)\.([0-9]+)\.([0-9]+)]=]) + set(CUDAToolkit_VERSION_MAJOR "${CMAKE_MATCH_1}") + set(CUDAToolkit_VERSION_MINOR "${CMAKE_MATCH_2}") + set(CUDAToolkit_VERSION_PATCH "${CMAKE_MATCH_3}") + set(CUDAToolkit_VERSION "${CMAKE_MATCH_1}.${CMAKE_MATCH_2}.${CMAKE_MATCH_3}") + endif() + unset(NVCC_OUT) +endif() + + +get_filename_component(CUDAToolkit_ROOT_DIR ${CUDAToolkit_BIN_DIR} DIRECTORY ABSOLUTE) + +# Handle cross compilation +if(CMAKE_CROSSCOMPILING) + if(CMAKE_SYSTEM_PROCESSOR STREQUAL "armv7-a") + # Support for NVPACK + set (CUDAToolkit_TARGET_NAME "armv7-linux-androideabi") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "arm") + # Support for arm cross compilation + set(CUDAToolkit_TARGET_NAME "armv7-linux-gnueabihf") + elseif(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch64") + # Support for aarch64 cross compilation + if (ANDROID_ARCH_NAME STREQUAL "arm64") + set(CUDAToolkit_TARGET_NAME "aarch64-linux-androideabi") + else() + set(CUDAToolkit_TARGET_NAME "aarch64-linux") + endif (ANDROID_ARCH_NAME STREQUAL "arm64") + elseif(CMAKE_SYSTEM_PROCESSOR STREQUAL "x86_64") + set(CUDAToolkit_TARGET_NAME "x86_64-linux") + endif() + + if (EXISTS "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}") + set(CUDAToolkit_TARGET_DIR "${CUDAToolkit_ROOT_DIR}/targets/${CUDAToolkit_TARGET_NAME}") + # add known CUDA target root path to the set of directories we search for programs, libraries and headers + list(PREPEND CMAKE_FIND_ROOT_PATH "${CUDAToolkit_TARGET_DIR}") + + # Mark that we need to pop the root search path changes after we have + # found all cuda libraries so that searches for our cross-compilation + # libraries work when another cuda sdk is in CMAKE_PREFIX_PATH or + # PATh + set(_CUDAToolkit_Pop_ROOT_PATH True) + endif() +else() + # Not cross compiling + set(CUDAToolkit_TARGET_DIR "${CUDAToolkit_ROOT_DIR}") + # Now that we have the real ROOT_DIR, find components inside it. + list(APPEND CMAKE_PREFIX_PATH ${CUDAToolkit_ROOT_DIR}) + + # Mark that we need to pop the prefix path changes after we have + # found the cudart library. + set(_CUDAToolkit_Pop_Prefix True) +endif() + + +# Find the include/ directory +find_path(CUDAToolkit_INCLUDE_DIR + NAMES cuda_runtime.h +) + +# And find the CUDA Runtime Library libcudart +find_library(CUDA_CUDART + NAMES cudart + PATH_SUFFIXES lib64 lib/x64 +) +if (NOT CUDA_CUDART) + find_library(CUDA_CUDART + NAMES cudart + PATH_SUFFIXES lib64/stubs lib/x64/stubs + ) +endif() + +if (NOT CUDA_CUDART AND NOT CUDAToolkit_FIND_QUIETLY) + message(STATUS "Unable to find cudart library.") +endif() + +unset(CUDAToolkit_ROOT_DIR) +if(_CUDAToolkit_Pop_Prefix) + list(REMOVE_AT CMAKE_PREFIX_PATH -1) + unset(_CUDAToolkit_Pop_Prefix) +endif() + +#----------------------------------------------------------------------------- +# Perform version comparison and validate all required variables are set. +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(CUDAToolkit + REQUIRED_VARS + CUDAToolkit_INCLUDE_DIR + CUDA_CUDART + CUDAToolkit_NVCC_EXECUTABLE + VERSION_VAR + CUDAToolkit_VERSION +) +mark_as_advanced(CUDA_CUDART + CUDAToolkit_INCLUDE_DIR + CUDAToolkit_NVCC_EXECUTABLE + ) + +#----------------------------------------------------------------------------- +# Construct result variables +if(CUDAToolkit_FOUND) + set(CUDAToolkit_INCLUDE_DIRS ${CUDAToolkit_INCLUDE_DIR}) + get_filename_component(CUDAToolkit_LIBRARY_DIR ${CUDA_CUDART} DIRECTORY ABSOLUTE) +endif() + +#----------------------------------------------------------------------------- +# Construct import targets +if(CUDAToolkit_FOUND) + + function(_CUDAToolkit_find_and_add_import_lib lib_name) + cmake_parse_arguments(arg "" "" "ALT;DEPS;EXTRA_PATH_SUFFIXES" ${ARGN}) + + set(search_names ${lib_name} ${arg_ALT}) + + find_library(CUDA_${lib_name}_LIBRARY + NAMES ${search_names} + HINTS ${CUDAToolkit_LIBRARY_DIR} + ENV CUDA_PATH + PATH_SUFFIXES nvidia/current lib64 lib/x64 lib + ${arg_EXTRA_PATH_SUFFIXES} + ) + # Don't try any stub directories intil we have exhausted all other + # search locations. + if(NOT CUDA_${lib_name}_LIBRARY) + find_library(CUDA_${lib_name}_LIBRARY + NAMES ${search_names} + HINTS ${CUDAToolkit_LIBRARY_DIR} + ENV CUDA_PATH + PATH_SUFFIXES lib64/stubs lib/x64/stubs lib/stubs stubs + ) + endif() + + mark_as_advanced(CUDA_${lib_name}_LIBRARY) + + if (NOT TARGET CUDA::${lib_name} AND CUDA_${lib_name}_LIBRARY) + add_library(CUDA::${lib_name} IMPORTED INTERFACE) + import_target_include_directories(CUDA::${lib_name} SYSTEM INTERFACE "${CUDAToolkit_INCLUDE_DIRS}") + import_target_link_libraries(CUDA::${lib_name} INTERFACE "${CUDA_${lib_name}_LIBRARY}") + foreach(dep ${arg_DEPS}) + if(TARGET CUDA::${dep}) + import_target_link_libraries(CUDA::${lib_name} INTERFACE CUDA::${dep}) + endif() + endforeach() + endif() + endfunction() + + if(NOT TARGET CUDA::toolkit) + add_library(CUDA::toolkit IMPORTED INTERFACE) + import_target_include_directories(CUDA::toolkit SYSTEM INTERFACE "${CUDAToolkit_INCLUDE_DIRS}") + import_target_link_directories(CUDA::toolkit INTERFACE "${CUDAToolkit_LIBRARY_DIR}") + endif() + + _CUDAToolkit_find_and_add_import_lib(cuda_driver ALT cuda) + + _CUDAToolkit_find_and_add_import_lib(cudart) + _CUDAToolkit_find_and_add_import_lib(cudart_static) + + # setup dependencies that are required for cudart_static when building + # on linux. These are generally only required when using the CUDA toolkit + # when CUDA language is disabled + if(NOT TARGET CUDA::cudart_static_deps + AND TARGET CUDA::cudart_static) + + add_library(CUDA::cudart_static_deps IMPORTED INTERFACE) + import_target_link_libraries(CUDA::cudart_static INTERFACE CUDA::cudart_static_deps) + + if(UNIX AND (CMAKE_C_COMPILER OR CMAKE_CXX_COMPILER)) + find_package(Threads REQUIRED) + import_target_link_libraries(CUDA::cudart_static_deps INTERFACE Threads::Threads ${CMAKE_DL_LIBS}) + endif() + + if(UNIX AND NOT APPLE) + # On Linux, you must link against librt when using the static cuda runtime. + find_library(CUDAToolkit_rt_LIBRARY rt) + mark_as_advanced(CUDAToolkit_rt_LIBRARY) + if(NOT CUDAToolkit_rt_LIBRARY) + message(WARNING "Could not find librt library, needed by CUDA::cudart_static") + else() + import_target_link_libraries(CUDA::cudart_static_deps INTERFACE ${CUDAToolkit_rt_LIBRARY}) + endif() + endif() + endif() + + _CUDAToolkit_find_and_add_import_lib(culibos) # it's a static library + foreach (cuda_lib cublas cufft curand cusparse nppc nvjpeg) + _CUDAToolkit_find_and_add_import_lib(${cuda_lib}) + _CUDAToolkit_find_and_add_import_lib(${cuda_lib}_static DEPS culibos) + endforeach() + + # cuFFTW depends on cuFFT + _CUDAToolkit_find_and_add_import_lib(cufftw DEPS cufft) + _CUDAToolkit_find_and_add_import_lib(cufftw DEPS cufft_static) + + # cuSOLVER depends on cuBLAS, and cuSPARSE + _CUDAToolkit_find_and_add_import_lib(cusolver DEPS cublas cusparse) + _CUDAToolkit_find_and_add_import_lib(cusolver_static DEPS cublas_static cusparse_static culibos) + + # nvGRAPH depends on cuRAND, and cuSOLVER. + _CUDAToolkit_find_and_add_import_lib(nvgraph DEPS curand cusolver) + _CUDAToolkit_find_and_add_import_lib(nvgraph_static DEPS curand_static cusolver_static) + + # Process the majority of the NPP libraries. + foreach (cuda_lib nppial nppicc nppidei nppif nppig nppim nppist nppitc npps nppicom nppisu) + _CUDAToolkit_find_and_add_import_lib(${cuda_lib} DEPS nppc) + _CUDAToolkit_find_and_add_import_lib(${cuda_lib}_static DEPS nppc_static) + endforeach() + + _CUDAToolkit_find_and_add_import_lib(cupti + EXTRA_PATH_SUFFIXES ../extras/CUPTI/lib64/ + ../extras/CUPTI/lib/) + _CUDAToolkit_find_and_add_import_lib(cupti_static + EXTRA_PATH_SUFFIXES ../extras/CUPTI/lib64/ + ../extras/CUPTI/lib/) + + _CUDAToolkit_find_and_add_import_lib(nvrtc DEPS cuda_driver) + + _CUDAToolkit_find_and_add_import_lib(nvml ALT nvidia-ml nvml) + + if(WIN32) + # nvtools can be installed outside the CUDA toolkit directory + # so prefer the NVTOOLSEXT_PATH windows only environment variable + # In addition on windows the most common name is nvToolsExt64_1 + find_library(CUDA_nvToolsExt_LIBRARY + NAMES nvToolsExt64_1 nvToolsExt64 nvToolsExt + PATHS ENV NVTOOLSEXT_PATH + ENV CUDA_PATH + PATH_SUFFIXES lib/x64 lib + ) + endif() + _CUDAToolkit_find_and_add_import_lib(nvToolsExt ALT nvToolsExt64) + + _CUDAToolkit_find_and_add_import_lib(OpenCL) +endif() + +if(_CUDAToolkit_Pop_ROOT_PATH) + list(REMOVE_AT CMAKE_FIND_ROOT_PATH 0) + unset(_CUDAToolkit_Pop_ROOT_PATH) +endif() diff --git a/lib/kokkos/cmake/Modules/FindTPLCUDA.cmake b/lib/kokkos/cmake/Modules/FindTPLCUDA.cmake index 1b36ab819f..a1072a60c6 100644 --- a/lib/kokkos/cmake/Modules/FindTPLCUDA.cmake +++ b/lib/kokkos/cmake/Modules/FindTPLCUDA.cmake @@ -1,17 +1,37 @@ - -IF (KOKKOS_CXX_COMPILER_ID STREQUAL Clang) - # Note: "stubs" suffix allows CMake to find the dummy - # libcuda.so provided by the NVIDIA CUDA Toolkit for - # cross-compiling CUDA on a host without a GPU. - KOKKOS_FIND_IMPORTED(CUDA INTERFACE - LIBRARIES cudart cuda - LIBRARY_PATHS ENV LD_LIBRARY_PATH ENV CUDA_PATH /usr/local/cuda - LIBRARY_SUFFIXES lib lib64 lib/stubs lib64/stubs - ALLOW_SYSTEM_PATH_FALLBACK - ) -ELSE() - KOKKOS_CREATE_IMPORTED_TPL(CUDA INTERFACE - LINK_LIBRARIES cuda - ) +IF (NOT CUDAToolkit_ROOT) + IF (NOT CUDA_ROOT) + SET(CUDA_ROOT $ENV{CUDA_ROOT}) + ENDIF() + IF(CUDA_ROOT) + SET(CUDAToolkit_ROOT ${CUDA_ROOT}) + ENDIF() ENDIF() +IF(CMAKE_VERSION VERSION_GREATER_EQUAL "3.17.0") + find_package(CUDAToolkit) +ELSE() + include(${CMAKE_CURRENT_LIST_DIR}/CudaToolkit.cmake) +ENDIF() + + +IF (TARGET CUDA::cudart) + SET(FOUND_CUDART TRUE) + KOKKOS_EXPORT_IMPORTED_TPL(CUDA::cudart) +ELSE() + SET(FOUND_CUDART FALSE) +ENDIF() + +IF (TARGET CUDA::cuda_driver) + SET(FOUND_CUDA_DRIVER TRUE) + KOKKOS_EXPORT_IMPORTED_TPL(CUDA::cuda_driver) +ELSE() + SET(FOUND_CUDA_DRIVVER FALSE) +ENDIF() + +include(FindPackageHandleStandardArgs) +FIND_PACKAGE_HANDLE_STANDARD_ARGS(TPLCUDA DEFAULT_MSG FOUND_CUDART FOUND_CUDA_DRIVER) +IF (FOUND_CUDA_DRIVER AND FOUND_CUDART) + KOKKOS_CREATE_IMPORTED_TPL(CUDA INTERFACE + LINK_LIBRARIES CUDA::cuda_driver CUDA::cudart + ) +ENDIF() diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc similarity index 54% rename from lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp rename to lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc index ea2da28f10..48c01c070c 100644 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +++ b/lib/kokkos/cmake/compile_tests/cuda_compute_capability.cc @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,18 +40,43 @@ // // ************************************************************************ //@HEADER +*/ -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, OpenMP, int64_t) +#include -} // namespace Impl -} // namespace Kokkos +int main() { + cudaDeviceProp device_properties; + const cudaError_t error = cudaGetDeviceProperties(&device_properties, + /*device*/ 0); + if (error != cudaSuccess) { + std::cout << "CUDA error: " << cudaGetErrorString(error) << '\n'; + return error; + } + unsigned int const compute_capability = + device_properties.major * 10 + device_properties.minor; +#ifdef SM_ONLY + std::cout << compute_capability; +#else + switch (compute_capability) { + // clang-format off + case 30: std::cout << "Set -DKokkos_ARCH_KEPLER30=ON ." << std::endl; break; + case 32: std::cout << "Set -DKokkos_ARCH_KEPLER32=ON ." << std::endl; break; + case 35: std::cout << "Set -DKokkos_ARCH_KEPLER35=ON ." << std::endl; break; + case 37: std::cout << "Set -DKokkos_ARCH_KEPLER37=ON ." << std::endl; break; + case 50: std::cout << "Set -DKokkos_ARCH_MAXWELL50=ON ." << std::endl; break; + case 52: std::cout << "Set -DKokkos_ARCH_MAXWELL52=ON ." << std::endl; break; + case 53: std::cout << "Set -DKokkos_ARCH_MAXWELL53=ON ." << std::endl; break; + case 60: std::cout << "Set -DKokkos_ARCH_PASCAL60=ON ." << std::endl; break; + case 61: std::cout << "Set -DKokkos_ARCH_PASCAL61=ON ." << std::endl; break; + case 70: std::cout << "Set -DKokkos_ARCH_VOLTA70=ON ." << std::endl; break; + case 72: std::cout << "Set -DKokkos_ARCH_VOLTA72=ON ." << std::endl; break; + case 75: std::cout << "Set -DKokkos_ARCH_TURING75=ON ." << std::endl; break; + case 80: std::cout << "Set -DKokkos_ARCH_AMPERE80=ON ." << std::endl; break; + default: + std::cout << "Compute capability " << compute_capability + << " is not supported" << std::endl; + // clang-format on + } +#endif + return 0; +} diff --git a/lib/kokkos/cmake/fake_tribits.cmake b/lib/kokkos/cmake/fake_tribits.cmake index acee4a249d..94ec0aa152 100644 --- a/lib/kokkos/cmake/fake_tribits.cmake +++ b/lib/kokkos/cmake/fake_tribits.cmake @@ -88,7 +88,7 @@ FUNCTION(KOKKOS_ADD_TEST) if (KOKKOS_HAS_TRILINOS) CMAKE_PARSE_ARGUMENTS(TEST "" - "EXE;NAME" + "EXE;NAME;TOOL" "" ${ARGN}) IF(TEST_EXE) @@ -104,10 +104,15 @@ FUNCTION(KOKKOS_ADD_TEST) NUM_MPI_PROCS 1 ${TEST_UNPARSED_ARGUMENTS} ) + + if(TEST_TOOL) + add_dependencies(${EXE} ${TEST_TOOL}) #make sure the exe has to build the tool + set_property(TEST ${TEST_NAME} APPEND_STRING PROPERTY ENVIRONMENT "KOKKOS_PROFILE_LIBRARY=$") + endif() else() CMAKE_PARSE_ARGUMENTS(TEST "WILL_FAIL" - "FAIL_REGULAR_EXPRESSION;PASS_REGULAR_EXPRESSION;EXE;NAME" + "FAIL_REGULAR_EXPRESSION;PASS_REGULAR_EXPRESSION;EXE;NAME;TOOL" "CATEGORIES;CMD_ARGS" ${ARGN}) # To match Tribits, we should always be receiving @@ -135,6 +140,10 @@ FUNCTION(KOKKOS_ADD_TEST) IF(TEST_PASS_REGULAR_EXPRESSION) SET_TESTS_PROPERTIES(${TEST_NAME} PROPERTIES PASS_REGULAR_EXPRESSION ${TEST_PASS_REGULAR_EXPRESSION}) ENDIF() + if(TEST_TOOL) + add_dependencies(${EXE} ${TEST_TOOL}) #make sure the exe has to build the tool + set_property(TEST ${TEST_NAME} APPEND_STRING PROPERTY ENVIRONMENT "KOKKOS_PROFILE_LIBRARY=$") + endif() VERIFY_EMPTY(KOKKOS_ADD_TEST ${TEST_UNPARSED_ARGUMENTS}) endif() ENDFUNCTION() diff --git a/lib/kokkos/cmake/kokkos_arch.cmake b/lib/kokkos/cmake/kokkos_arch.cmake index d73a353981..a63f662d2e 100644 --- a/lib/kokkos/cmake/kokkos_arch.cmake +++ b/lib/kokkos/cmake/kokkos_arch.cmake @@ -2,11 +2,14 @@ FUNCTION(KOKKOS_ARCH_OPTION SUFFIX DEV_TYPE DESCRIPTION) #all optimizations off by default KOKKOS_OPTION(ARCH_${SUFFIX} OFF BOOL "Optimize for ${DESCRIPTION} (${DEV_TYPE})") - IF (KOKKOS_ARCH_${SUFFIX}) + SET(KOKKOS_ARCH_${SUFFIX} ${KOKKOS_ARCH_${SUFFIX}} PARENT_SCOPE) + SET(KOKKOS_OPTION_KEYS ${KOKKOS_OPTION_KEYS} PARENT_SCOPE) + SET(KOKKOS_OPTION_VALUES ${KOKKOS_OPTION_VALUES} PARENT_SCOPE) + SET(KOKKOS_OPTION_TYPES ${KOKKOS_OPTION_TYPES} PARENT_SCOPE) + IF(KOKKOS_ARCH_${SUFFIX}) LIST(APPEND KOKKOS_ENABLED_ARCH_LIST ${SUFFIX}) SET(KOKKOS_ENABLED_ARCH_LIST ${KOKKOS_ENABLED_ARCH_LIST} PARENT_SCOPE) ENDIF() - SET(KOKKOS_ARCH_${SUFFIX} ${KOKKOS_ARCH_${SUFFIX}} PARENT_SCOPE) ENDFUNCTION() @@ -15,6 +18,10 @@ KOKKOS_CFG_DEPENDS(ARCH COMPILER_ID) KOKKOS_CFG_DEPENDS(ARCH DEVICES) KOKKOS_CFG_DEPENDS(ARCH OPTIONS) +KOKKOS_CHECK_DEPRECATED_OPTIONS( + ARCH_EPYC "Please replace EPYC with ZEN or ZEN2, depending on your platform" + ARCH_RYZEN "Please replace RYZEN with ZEN or ZEN2, depending on your platform" +) #------------------------------------------------------------------------------- # List of possible host architectures. @@ -51,9 +58,12 @@ KOKKOS_ARCH_OPTION(PASCAL61 GPU "NVIDIA Pascal generation CC 6.1") KOKKOS_ARCH_OPTION(VOLTA70 GPU "NVIDIA Volta generation CC 7.0") KOKKOS_ARCH_OPTION(VOLTA72 GPU "NVIDIA Volta generation CC 7.2") KOKKOS_ARCH_OPTION(TURING75 GPU "NVIDIA Turing generation CC 7.5") -KOKKOS_ARCH_OPTION(EPYC HOST "AMD Epyc architecture") +KOKKOS_ARCH_OPTION(AMPERE80 GPU "NVIDIA Ampere generation CC 8.0") +KOKKOS_ARCH_OPTION(ZEN HOST "AMD Zen architecture") +KOKKOS_ARCH_OPTION(ZEN2 HOST "AMD Zen2 architecture") KOKKOS_ARCH_OPTION(VEGA900 GPU "AMD GPU MI25 GFX900") KOKKOS_ARCH_OPTION(VEGA906 GPU "AMD GPU MI50/MI60 GFX906") +KOKKOS_ARCH_OPTION(INTEL_GEN GPU "Intel GPUs Gen9+") IF (KOKKOS_ENABLE_CUDA) #Regardless of version, make sure we define the general architecture name @@ -75,6 +85,10 @@ IF (KOKKOS_ENABLE_CUDA) IF (KOKKOS_ARCH_VOLTA70 OR KOKKOS_ARCH_VOLTA72) SET(KOKKOS_ARCH_VOLTA ON) ENDIF() + + IF (KOKKOS_ARCH_AMPERE80) + SET(KOKKOS_ARCH_AMPERE ON) + ENDIF() ENDIF() @@ -88,9 +102,10 @@ IF(KOKKOS_ENABLE_COMPILER_WARNINGS) ${COMMON_WARNINGS}) COMPILER_SPECIFIC_FLAGS( - PGI NO-VALUE-SPECIFIED - GNU ${GNU_WARNINGS} - DEFAULT ${COMMON_WARNINGS} + COMPILER_ID CMAKE_CXX_COMPILER_ID + PGI NO-VALUE-SPECIFIED + GNU ${GNU_WARNINGS} + DEFAULT ${COMMON_WARNINGS} ) ENDIF() @@ -102,6 +117,9 @@ GLOBAL_SET(KOKKOS_CUDA_OPTIONS) IF (KOKKOS_ENABLE_CUDA_LAMBDA) IF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS "-expt-extended-lambda") + IF(KOKKOS_COMPILER_CUDA_VERSION GREATER_EQUAL 110) + GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS "-Wext-lambda-captures-this") + ENDIF() ENDIF() ENDIF() @@ -113,7 +131,6 @@ ENDIF() IF (KOKKOS_CXX_COMPILER_ID STREQUAL Clang) SET(CUDA_ARCH_FLAG "--cuda-gpu-arch") - SET(AMDGPU_ARCH_FLAG "--amdgpu-target") GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS -x cuda) IF (KOKKOS_ENABLE_CUDA) SET(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND ON CACHE BOOL "enable CUDA Clang workarounds" FORCE) @@ -133,6 +150,15 @@ IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) ENDIF() ENDIF() + +#------------------------------- KOKKOS_HIP_OPTIONS --------------------------- +#clear anything that might be in the cache +GLOBAL_SET(KOKKOS_AMDGPU_OPTIONS) +IF(KOKKOS_CXX_COMPILER_ID STREQUAL HIP) + SET(AMDGPU_ARCH_FLAG "--amdgpu-target") +ENDIF() + + IF (KOKKOS_ARCH_ARMV80) COMPILER_SPECIFIC_FLAGS( Cray NO-VALUE-SPECIFIED @@ -167,12 +193,21 @@ IF (KOKKOS_ARCH_ARMV8_THUNDERX2) ) ENDIF() -IF (KOKKOS_ARCH_EPYC) +IF (KOKKOS_ARCH_ZEN) COMPILER_SPECIFIC_FLAGS( Intel -mavx2 DEFAULT -march=znver1 -mtune=znver1 ) - SET(KOKKOS_ARCH_AMD_EPYC ON) + SET(KOKKOS_ARCH_AMD_ZEN ON) + SET(KOKKOS_ARCH_AMD_AVX2 ON) +ENDIF() + +IF (KOKKOS_ARCH_ZEN2) + COMPILER_SPECIFIC_FLAGS( + Intel -mavx2 + DEFAULT -march=znver2 -mtune=znver2 + ) + SET(KOKKOS_ARCH_AMD_ZEN2 ON) SET(KOKKOS_ARCH_AMD_AVX2 ON) ENDIF() @@ -216,14 +251,6 @@ IF (KOKKOS_ARCH_BDW) ) ENDIF() -IF (KOKKOS_ARCH_EPYC) - SET(KOKKOS_ARCH_AMD_AVX2 ON) - COMPILER_SPECIFIC_FLAGS( - Intel -mvax2 - DEFAULT -march=znver1 -mtune=znver1 - ) -ENDIF() - IF (KOKKOS_ARCH_KNL) #avx512-mic SET(KOKKOS_ARCH_AVX512MIC ON) #not a cache variable @@ -253,7 +280,7 @@ IF (KOKKOS_ARCH_SKX) ) ENDIF() -IF (KOKKOS_ARCH_WSM OR KOKKOS_ARCH_SNB OR KOKKOS_ARCH_HSW OR KOKKOS_ARCH_BDW OR KOKKOS_ARCH_KNL OR KOKKOS_ARCH_SKX OR KOKKOS_ARCH_EPYC) +IF (KOKKOS_ARCH_WSM OR KOKKOS_ARCH_SNB OR KOKKOS_ARCH_HSW OR KOKKOS_ARCH_BDW OR KOKKOS_ARCH_KNL OR KOKKOS_ARCH_SKX OR KOKKOS_ARCH_ZEN OR KOKKOS_ARCH_ZEN2) SET(KOKKOS_USE_ISA_X86_64 ON) ENDIF() @@ -296,6 +323,21 @@ IF (Kokkos_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) ) ENDIF() +# Clang needs mcx16 option enabled for Windows atomic functions +IF (CMAKE_CXX_COMPILER_ID STREQUAL Clang AND WIN32) + COMPILER_SPECIFIC_OPTIONS( + Clang -mcx16 + ) +ENDIF() + +# MSVC ABI has many deprecation warnings, so ignore them +IF (CMAKE_CXX_COMPILER_ID STREQUAL MSVC OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + COMPILER_SPECIFIC_DEFS( + Clang _CRT_SECURE_NO_WARNINGS + ) +ENDIF() + + #Right now we cannot get the compiler ID when cross-compiling, so just check #that HIP is enabled IF (Kokkos_ENABLE_HIP) @@ -324,11 +366,15 @@ FUNCTION(CHECK_CUDA_ARCH ARCH FLAG) ELSE() SET(KOKKOS_CUDA_ARCH_FLAG ${FLAG} PARENT_SCOPE) GLOBAL_APPEND(KOKKOS_CUDA_OPTIONS "${CUDA_ARCH_FLAG}=${FLAG}") - IF(KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) + IF(KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE OR KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) GLOBAL_APPEND(KOKKOS_LINK_OPTIONS "${CUDA_ARCH_FLAG}=${FLAG}") ENDIF() ENDIF() ENDIF() + LIST(APPEND KOKKOS_CUDA_ARCH_FLAGS ${FLAG}) + SET(KOKKOS_CUDA_ARCH_FLAGS ${KOKKOS_CUDA_ARCH_FLAGS} PARENT_SCOPE) + LIST(APPEND KOKKOS_CUDA_ARCH_LIST ${ARCH}) + SET(KOKKOS_CUDA_ARCH_LIST ${KOKKOS_CUDA_ARCH_LIST} PARENT_SCOPE) ENDFUNCTION() @@ -346,6 +392,7 @@ CHECK_CUDA_ARCH(PASCAL61 sm_61) CHECK_CUDA_ARCH(VOLTA70 sm_70) CHECK_CUDA_ARCH(VOLTA72 sm_72) CHECK_CUDA_ARCH(TURING75 sm_75) +CHECK_CUDA_ARCH(AMPERE80 sm_80) SET(AMDGPU_ARCH_ALREADY_SPECIFIED "") FUNCTION(CHECK_AMDGPU_ARCH ARCH FLAG) @@ -372,12 +419,19 @@ ENDFUNCTION() CHECK_AMDGPU_ARCH(VEGA900 gfx900) # Radeon Instinct MI25 CHECK_AMDGPU_ARCH(VEGA906 gfx906) # Radeon Instinct MI50 and MI60 +IF(KOKKOS_ENABLE_HIP AND NOT AMDGPU_ARCH_ALREADY_SPECIFIED) + MESSAGE(SEND_ERROR "HIP enabled but no AMD GPU architecture currently enabled. " + "Please enable one AMD GPU architecture via -DKokkos_ARCH_{..}=ON'.") +ENDIF() + IF (KOKKOS_ENABLE_OPENMPTARGET) SET(CLANG_CUDA_ARCH ${KOKKOS_CUDA_ARCH_FLAG}) IF (CLANG_CUDA_ARCH) + STRING(REPLACE "sm_" "cc" PGI_CUDA_ARCH ${CLANG_CUDA_ARCH}) COMPILER_SPECIFIC_FLAGS( Clang -Xopenmp-target -march=${CLANG_CUDA_ARCH} -fopenmp-targets=nvptx64-nvidia-cuda XL -qtgtarch=${KOKKOS_CUDA_ARCH_FLAG} + PGI -gpu=${PGI_CUDA_ARCH} ) ENDIF() SET(CLANG_AMDGPU_ARCH ${KOKKOS_AMDGPU_ARCH_FLAG}) @@ -386,10 +440,39 @@ IF (KOKKOS_ENABLE_OPENMPTARGET) Clang -Xopenmp-target=amdgcn-amd-amdhsa -march=${CLANG_AMDGPU_ARCH} -fopenmp-targets=amdgcn-amd-amdhsa ) ENDIF() + IF (KOKKOS_ARCH_INTEL_GEN) + COMPILER_SPECIFIC_FLAGS( + IntelClang -fopenmp-targets=spir64 -D__STRICT_ANSI__ + ) + ENDIF() ENDIF() IF(KOKKOS_ENABLE_CUDA AND NOT CUDA_ARCH_ALREADY_SPECIFIED) - MESSAGE(SEND_ERROR "CUDA enabled but no NVIDIA GPU architecture currently enabled. Please give one -DKokkos_ARCH_{..}=ON' to enable an NVIDIA GPU architecture.") + # Try to autodetect the CUDA Compute Capability by asking the device + SET(_BINARY_TEST_DIR ${CMAKE_CURRENT_BINARY_DIR}/cmake/compile_tests/CUDAComputeCapabilityWorkdir) + FILE(REMOVE_RECURSE ${_BINARY_TEST_DIR}) + FILE(MAKE_DIRECTORY ${_BINARY_TEST_DIR}) + + TRY_RUN( + _RESULT + _COMPILE_RESULT + ${_BINARY_TEST_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/cmake/compile_tests/cuda_compute_capability.cc + COMPILE_DEFINITIONS -DSM_ONLY + RUN_OUTPUT_VARIABLE _CUDA_COMPUTE_CAPABILITY) + LIST(FIND KOKKOS_CUDA_ARCH_FLAGS sm_${_CUDA_COMPUTE_CAPABILITY} FLAG_INDEX) + IF(_COMPILE_RESULT AND _RESULT EQUAL 0 AND NOT FLAG_INDEX EQUAL -1) + MESSAGE(STATUS "Detected CUDA Compute Capability ${_CUDA_COMPUTE_CAPABILITY}") + LIST(GET KOKKOS_CUDA_ARCH_LIST ${FLAG_INDEX} ARCHITECTURE) + KOKKOS_SET_OPTION(ARCH_${ARCHITECTURE} ON) + CHECK_CUDA_ARCH(${ARCHITECTURE} sm_${_CUDA_COMPUTE_CAPABILITY}) + LIST(APPEND KOKKOS_ENABLED_ARCH_LIST ${ARCHITECTURE}) + ELSE() + MESSAGE(SEND_ERROR "CUDA enabled but no NVIDIA GPU architecture currently enabled and auto-detection failed. " + "Please give one -DKokkos_ARCH_{..}=ON' to enable an NVIDIA GPU architecture.\n" + "You can yourself try to compile ${CMAKE_CURRENT_SOURCE_DIR}/cmake/compile_tests/cuda_compute_capability.cc and run the executable. " + "If you are cross-compiling, you should try to do this on a compute node.") + ENDIF() ENDIF() #CMake verbose is kind of pointless @@ -453,4 +536,3 @@ MESSAGE(STATUS "Architectures:") FOREACH(Arch ${KOKKOS_ENABLED_ARCH_LIST}) MESSAGE(STATUS " ${Arch}") ENDFOREACH() - diff --git a/lib/kokkos/cmake/kokkos_compiler_id.cmake b/lib/kokkos/cmake/kokkos_compiler_id.cmake index cd5e7c9e4e..4a77a94e07 100644 --- a/lib/kokkos/cmake/kokkos_compiler_id.cmake +++ b/lib/kokkos/cmake/kokkos_compiler_id.cmake @@ -4,33 +4,54 @@ SET(KOKKOS_CXX_COMPILER ${CMAKE_CXX_COMPILER}) SET(KOKKOS_CXX_COMPILER_ID ${CMAKE_CXX_COMPILER_ID}) SET(KOKKOS_CXX_COMPILER_VERSION ${CMAKE_CXX_COMPILER_VERSION}) -# Check if the compiler is nvcc (which really means nvcc_wrapper). -EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version - COMMAND grep nvcc - COMMAND wc -l - OUTPUT_VARIABLE INTERNAL_HAVE_COMPILER_NVCC - OUTPUT_STRIP_TRAILING_WHITESPACE) +IF(Kokkos_ENABLE_CUDA) + # Check if the compiler is nvcc (which really means nvcc_wrapper). + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version + OUTPUT_VARIABLE INTERNAL_COMPILER_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + STRING(REPLACE "\n" " - " INTERNAL_COMPILER_VERSION_ONE_LINE ${INTERNAL_COMPILER_VERSION} ) + + STRING(FIND ${INTERNAL_COMPILER_VERSION_ONE_LINE} "nvcc" INTERNAL_COMPILER_VERSION_CONTAINS_NVCC) -STRING(REGEX REPLACE "^ +" "" - INTERNAL_HAVE_COMPILER_NVCC "${INTERNAL_HAVE_COMPILER_NVCC}") - + STRING(REGEX REPLACE "^ +" "" + INTERNAL_HAVE_COMPILER_NVCC "${INTERNAL_HAVE_COMPILER_NVCC}") + IF(${INTERNAL_COMPILER_VERSION_CONTAINS_NVCC} GREATER -1) + SET(INTERNAL_HAVE_COMPILER_NVCC true) + ELSE() + SET(INTERNAL_HAVE_COMPILER_NVCC false) + ENDIF() +ENDIF() IF(INTERNAL_HAVE_COMPILER_NVCC) + # Save the host compiler id before overwriting it. + SET(KOKKOS_CXX_HOST_COMPILER_ID ${KOKKOS_CXX_COMPILER_ID}) + # SET the compiler id to nvcc. We use the value used by CMake 3.8. SET(KOKKOS_CXX_COMPILER_ID NVIDIA CACHE STRING INTERNAL FORCE) - # SET nvcc's compiler version. - EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version - COMMAND grep release - OUTPUT_VARIABLE INTERNAL_CXX_COMPILER_VERSION - OUTPUT_STRIP_TRAILING_WHITESPACE) - - STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+$" - TEMP_CXX_COMPILER_VERSION ${INTERNAL_CXX_COMPILER_VERSION}) + STRING(REGEX MATCH "V[0-9]+\\.[0-9]+\\.[0-9]+" + TEMP_CXX_COMPILER_VERSION ${INTERNAL_COMPILER_VERSION_ONE_LINE}) + STRING(SUBSTRING ${TEMP_CXX_COMPILER_VERSION} 1 -1 TEMP_CXX_COMPILER_VERSION) SET(KOKKOS_CXX_COMPILER_VERSION ${TEMP_CXX_COMPILER_VERSION} CACHE STRING INTERNAL FORCE) + MESSAGE(STATUS "Compiler Version: ${KOKKOS_CXX_COMPILER_VERSION}") ENDIF() +IF(Kokkos_ENABLE_HIP) + # get HIP version + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version + OUTPUT_VARIABLE INTERNAL_COMPILER_VERSION + OUTPUT_STRIP_TRAILING_WHITESPACE) + + STRING(REPLACE "\n" " - " INTERNAL_COMPILER_VERSION_ONE_LINE ${INTERNAL_COMPILER_VERSION} ) + SET(KOKKOS_CXX_COMPILER_ID HIP CACHE STRING INTERNAL FORCE) + + STRING(REGEX MATCH "[0-9]+\\.[0-9]+\\.[0-9]+" + TEMP_CXX_COMPILER_VERSION ${INTERNAL_COMPILER_VERSION_ONE_LINE}) + SET(KOKKOS_CXX_COMPILER_VERSION ${TEMP_CXX_COMPILER_VERSION} CACHE STRING INTERNAL FORCE) + MESSAGE(STATUS "Compiler Version: ${KOKKOS_CXX_COMPILER_VERSION}") +ENDIF() IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang) # The Cray compiler reports as Clang to most versions of CMake @@ -42,6 +63,16 @@ IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang) IF (INTERNAL_HAVE_CRAY_COMPILER) #not actually Clang SET(KOKKOS_CLANG_IS_CRAY TRUE) ENDIF() + # The clang based Intel compiler reports as Clang to most versions of CMake + EXECUTE_PROCESS(COMMAND ${CMAKE_CXX_COMPILER} --version + COMMAND grep icpx + COMMAND wc -l + OUTPUT_VARIABLE INTERNAL_HAVE_INTEL_COMPILER + OUTPUT_STRIP_TRAILING_WHITESPACE) + IF (INTERNAL_HAVE_INTEL_COMPILER) #not actually Clang + SET(KOKKOS_CLANG_IS_INTEL TRUE) + SET(KOKKOS_CXX_COMPILER_ID IntelClang CACHE STRING INTERNAL FORCE) + ENDIF() ENDIF() IF(KOKKOS_CXX_COMPILER_ID STREQUAL Cray OR KOKKOS_CLANG_IS_CRAY) @@ -65,6 +96,7 @@ SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Clang 3.5.2 or higher" SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n GCC 4.8.4 or higher") SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n Intel 15.0.2 or higher") SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n NVCC 9.0.69 or higher") +SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n HIPCC 3.5.0 or higher") SET(KOKKOS_MESSAGE_TEXT "${KOKKOS_MESSAGE_TEXT}\n PGI 17.1 or higher\n") IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang) @@ -84,6 +116,10 @@ ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") ENDIF() SET(CMAKE_CXX_EXTENSIONS OFF CACHE BOOL "Kokkos turns off CXX extensions" FORCE) +ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL HIP) + IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 3.5.0) + MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") + ENDIF() ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL PGI) IF(KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 17.1) MESSAGE(FATAL_ERROR "${KOKKOS_MESSAGE_TEXT}") diff --git a/lib/kokkos/cmake/kokkos_corner_cases.cmake b/lib/kokkos/cmake/kokkos_corner_cases.cmake index e30be3c841..a792590bac 100644 --- a/lib/kokkos/cmake/kokkos_corner_cases.cmake +++ b/lib/kokkos/cmake/kokkos_corner_cases.cmake @@ -1,4 +1,4 @@ -IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang AND KOKKOS_ENABLE_OPENMP AND NOT KOKKOS_CLANG_IS_CRAY) +IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang AND KOKKOS_ENABLE_OPENMP AND NOT KOKKOS_CLANG_IS_CRAY AND NOT "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") # The clang "version" doesn't actually tell you what runtimes and tools # were built into Clang. We should therefore make sure that libomp # was actually built into Clang. Otherwise the user will get nonsensical @@ -49,11 +49,11 @@ ENDIF() IF (KOKKOS_CXX_STANDARD STREQUAL 17) IF (KOKKOS_CXX_COMPILER_ID STREQUAL GNU AND KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 7) - MESSAGE(FATAL_ERROR "You have requested c++17 support for GCC ${KOKKOS_CXX_COMPILER_VERSION}. Although CMake has allowed this and GCC accepts -std=c++1z/c++17, GCC <= 6 does not properly support *this capture. Please reduce the C++ standard to 14 or upgrade the compiler if you do need 17 support") + MESSAGE(FATAL_ERROR "You have requested c++17 support for GCC ${KOKKOS_CXX_COMPILER_VERSION}. Although CMake has allowed this and GCC accepts -std=c++1z/c++17, GCC <= 6 does not properly support *this capture. Please reduce the C++ standard to 14 or upgrade the compiler if you do need C++17 support.") ENDIF() - IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) - MESSAGE(FATAL_ERROR "You have requested c++17 support for NVCC. Please reduce the C++ standard to 14. No versions of NVCC currently support 17.") + IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND KOKKOS_CXX_COMPILER_VERSION VERSION_LESS 11) + MESSAGE(FATAL_ERROR "You have requested c++17 support for NVCC ${KOKKOS_CXX_COMPILER_VERSION}. NVCC only supports C++17 from version 11 on. Please reduce the C++ standard to 14 or upgrade the compiler if you need C++17 support.") ENDIF() ENDIF() diff --git a/lib/kokkos/cmake/kokkos_enable_devices.cmake b/lib/kokkos/cmake/kokkos_enable_devices.cmake index 7b50cfe458..7d1c375ae6 100644 --- a/lib/kokkos/cmake/kokkos_enable_devices.cmake +++ b/lib/kokkos/cmake/kokkos_enable_devices.cmake @@ -36,25 +36,51 @@ IF(KOKKOS_ENABLE_OPENMP) IF(KOKKOS_CLANG_IS_CRAY) SET(ClangOpenMPFlag -fopenmp) ENDIF() - COMPILER_SPECIFIC_FLAGS( - Clang ${ClangOpenMPFlag} - AppleClang -Xpreprocessor -fopenmp - PGI -mp - NVIDIA -Xcompiler -fopenmp - Cray NO-VALUE-SPECIFIED - XL -qsmp=omp - DEFAULT -fopenmp - ) - COMPILER_SPECIFIC_LIBS( - AppleClang -lomp - ) + IF(KOKKOS_CLANG_IS_INTEL) + SET(ClangOpenMPFlag -fiopenmp) + ENDIF() + IF(KOKKOS_CXX_COMPILER_ID STREQUAL Clang AND "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") + #expression /openmp yields error, so add a specific Clang flag + COMPILER_SPECIFIC_OPTIONS(Clang /clang:-fopenmp) + #link omp library from LLVM lib dir + get_filename_component(LLVM_BIN_DIR ${CMAKE_CXX_COMPILER_AR} DIRECTORY) + COMPILER_SPECIFIC_LIBS(Clang "${LLVM_BIN_DIR}/../lib/libomp.lib") + ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA) + COMPILER_SPECIFIC_FLAGS( + COMPILER_ID KOKKOS_CXX_HOST_COMPILER_ID + Clang -Xcompiler ${ClangOpenMPFlag} + PGI -Xcompiler -mp + Cray NO-VALUE-SPECIFIED + XL -Xcompiler -qsmp=omp + DEFAULT -Xcompiler -fopenmp + ) + ELSE() + COMPILER_SPECIFIC_FLAGS( + Clang ${ClangOpenMPFlag} + AppleClang -Xpreprocessor -fopenmp + PGI -mp + Cray NO-VALUE-SPECIFIED + XL -qsmp=omp + DEFAULT -fopenmp + ) + COMPILER_SPECIFIC_LIBS( + AppleClang -lomp + ) + ENDIF() ENDIF() KOKKOS_DEVICE_OPTION(OPENMPTARGET OFF DEVICE "Whether to build the OpenMP target backend") IF (KOKKOS_ENABLE_OPENMPTARGET) +SET(ClangOpenMPFlag -fopenmp=libomp) + IF(KOKKOS_CLANG_IS_CRAY) + SET(ClangOpenMPFlag -fopenmp) + ENDIF() + COMPILER_SPECIFIC_FLAGS( - Clang -fopenmp -fopenmp=libomp + Clang ${ClangOpenMPFlag} -Wno-openmp-mapping + IntelClang -fiopenmp -Wno-openmp-mapping XL -qsmp=omp -qoffload -qnoeh + PGI -mp=gpu DEFAULT -fopenmp ) COMPILER_SPECIFIC_DEFS( @@ -65,6 +91,9 @@ IF (KOKKOS_ENABLE_OPENMPTARGET) # COMPILER_SPECIFIC_LIBS( # Clang -lopenmptarget # ) + IF(KOKKOS_CXX_STANDARD LESS 17) + MESSAGE(FATAL_ERROR "OpenMPTarget backend requires C++17 or newer") + ENDIF() ENDIF() IF(Trilinos_ENABLE_Kokkos AND TPL_ENABLE_CUDA) @@ -76,6 +105,9 @@ KOKKOS_DEVICE_OPTION(CUDA ${CUDA_DEFAULT} DEVICE "Whether to build CUDA backend" IF (KOKKOS_ENABLE_CUDA) GLOBAL_SET(KOKKOS_DONT_ALLOW_EXTENSIONS "CUDA enabled") + IF(WIN32) + GLOBAL_APPEND(KOKKOS_COMPILE_OPTIONS -x cu) + ENDIF() ENDIF() # We want this to default to OFF for cache reasons, but if no diff --git a/lib/kokkos/cmake/kokkos_enable_options.cmake b/lib/kokkos/cmake/kokkos_enable_options.cmake index 4560c3df8f..22ac7a0038 100644 --- a/lib/kokkos/cmake/kokkos_enable_options.cmake +++ b/lib/kokkos/cmake/kokkos_enable_options.cmake @@ -45,10 +45,9 @@ UNSET(_UPPERCASE_CMAKE_BUILD_TYPE) KOKKOS_ENABLE_OPTION(LARGE_MEM_TESTS OFF "Whether to perform extra large memory tests") KOKKOS_ENABLE_OPTION(DEBUG_BOUNDS_CHECK OFF "Whether to use bounds checking - will increase runtime") KOKKOS_ENABLE_OPTION(COMPILER_WARNINGS OFF "Whether to print all compiler warnings") -KOKKOS_ENABLE_OPTION(PROFILING ON "Whether to create bindings for profiling tools") KOKKOS_ENABLE_OPTION(PROFILING_LOAD_PRINT OFF "Whether to print information about which profiling tools got loaded") +KOKKOS_ENABLE_OPTION(TUNING OFF "Whether to create bindings for tuning tools") KOKKOS_ENABLE_OPTION(AGGRESSIVE_VECTORIZATION OFF "Whether to aggressively vectorize loops") -KOKKOS_ENABLE_OPTION(DEPRECATED_CODE OFF "Whether to enable deprecated code") IF (KOKKOS_ENABLE_CUDA) SET(KOKKOS_COMPILER_CUDA_VERSION "${KOKKOS_COMPILER_VERSION_MAJOR}${KOKKOS_COMPILER_VERSION_MINOR}") diff --git a/lib/kokkos/cmake/kokkos_functions.cmake b/lib/kokkos/cmake/kokkos_functions.cmake index fd04966baf..ca537da193 100644 --- a/lib/kokkos/cmake/kokkos_functions.cmake +++ b/lib/kokkos/cmake/kokkos_functions.cmake @@ -47,6 +47,13 @@ FUNCTION(kokkos_option CAMEL_SUFFIX DEFAULT TYPE DOCSTRING) SET(CAMEL_NAME Kokkos_${CAMEL_SUFFIX}) STRING(TOUPPER ${CAMEL_NAME} UC_NAME) + LIST(APPEND KOKKOS_OPTION_KEYS ${CAMEL_SUFFIX}) + SET(KOKKOS_OPTION_KEYS ${KOKKOS_OPTION_KEYS} PARENT_SCOPE) + LIST(APPEND KOKKOS_OPTION_VALUES "${DOCSTRING}") + SET(KOKKOS_OPTION_VALUES ${KOKKOS_OPTION_VALUES} PARENT_SCOPE) + LIST(APPEND KOKKOS_OPTION_TYPES ${TYPE}) + SET(KOKKOS_OPTION_TYPES ${KOKKOS_OPTION_TYPES} PARENT_SCOPE) + # Make sure this appears in the cache with the appropriate DOCSTRING SET(${CAMEL_NAME} ${DEFAULT} CACHE ${TYPE} ${DOCSTRING}) @@ -73,7 +80,21 @@ FUNCTION(kokkos_option CAMEL_SUFFIX DEFAULT TYPE DOCSTRING) ELSE() SET(${UC_NAME} ${DEFAULT} PARENT_SCOPE) ENDIF() +ENDFUNCTION() +FUNCTION(kokkos_set_option CAMEL_SUFFIX VALUE) + LIST(FIND KOKKOS_OPTION_KEYS ${CAMEL_SUFFIX} OPTION_INDEX) + IF(OPTION_INDEX EQUAL -1) + MESSAGE(FATAL_ERROR "Couldn't set value for Kokkos_${CAMEL_SUFFIX}") + ENDIF() + SET(CAMEL_NAME Kokkos_${CAMEL_SUFFIX}) + STRING(TOUPPER ${CAMEL_NAME} UC_NAME) + + LIST(GET KOKKOS_OPTION_VALUES ${OPTION_INDEX} DOCSTRING) + LIST(GET KOKKOS_OPTION_TYPES ${OPTION_INDEX} TYPE) + SET(${CAMEL_NAME} ${VALUE} CACHE ${TYPE} ${DOCSTRING} FORCE) + MESSAGE(STATUS "Setting ${CAMEL_NAME}=${VALUE}") + SET(${UC_NAME} ${VALUE} PARENT_SCOPE) ENDFUNCTION() FUNCTION(kokkos_append_config_line LINE) @@ -109,8 +130,8 @@ ENDMACRO() MACRO(kokkos_export_imported_tpl NAME) IF (NOT KOKKOS_HAS_TRILINOS) - GET_TARGET_PROPERTY(LIB_TYPE ${NAME} TYPE) - IF (${LIB_TYPE} STREQUAL "INTERFACE_LIBRARY") + GET_TARGET_PROPERTY(LIB_IMPORTED ${NAME} IMPORTED) + IF (NOT LIB_IMPORTED) # This is not an imported target # This an interface library that we created INSTALL( @@ -123,12 +144,18 @@ MACRO(kokkos_export_imported_tpl NAME) ELSE() #make sure this also gets "exported" in the config file KOKKOS_APPEND_CONFIG_LINE("IF(NOT TARGET ${NAME})") - KOKKOS_APPEND_CONFIG_LINE("ADD_LIBRARY(${NAME} UNKNOWN IMPORTED)") - KOKKOS_APPEND_CONFIG_LINE("SET_TARGET_PROPERTIES(${NAME} PROPERTIES") - GET_TARGET_PROPERTY(TPL_LIBRARY ${NAME} IMPORTED_LOCATION) - IF(TPL_LIBRARY) - KOKKOS_APPEND_CONFIG_LINE("IMPORTED_LOCATION ${TPL_LIBRARY}") + GET_TARGET_PROPERTY(LIB_TYPE ${NAME} TYPE) + IF (${LIB_TYPE} STREQUAL "INTERFACE_LIBRARY") + KOKKOS_APPEND_CONFIG_LINE("ADD_LIBRARY(${NAME} INTERFACE IMPORTED)") + KOKKOS_APPEND_CONFIG_LINE("SET_TARGET_PROPERTIES(${NAME} PROPERTIES") + ELSE() + KOKKOS_APPEND_CONFIG_LINE("ADD_LIBRARY(${NAME} UNKNOWN IMPORTED)") + KOKKOS_APPEND_CONFIG_LINE("SET_TARGET_PROPERTIES(${NAME} PROPERTIES") + GET_TARGET_PROPERTY(TPL_LIBRARY ${NAME} IMPORTED_LOCATION) + IF(TPL_LIBRARY) + KOKKOS_APPEND_CONFIG_LINE("IMPORTED_LOCATION ${TPL_LIBRARY}") + ENDIF() ENDIF() GET_TARGET_PROPERTY(TPL_INCLUDES ${NAME} INTERFACE_INCLUDE_DIRECTORIES) @@ -737,18 +764,22 @@ FUNCTION(kokkos_link_tpl TARGET) ENDFUNCTION() FUNCTION(COMPILER_SPECIFIC_OPTIONS_HELPER) - SET(COMPILERS NVIDIA PGI XL DEFAULT Cray Intel Clang AppleClang GNU) + SET(COMPILERS NVIDIA PGI XL DEFAULT Cray Intel Clang AppleClang IntelClang GNU HIP) CMAKE_PARSE_ARGUMENTS( PARSE "LINK_OPTIONS;COMPILE_OPTIONS;COMPILE_DEFINITIONS;LINK_LIBRARIES" - "" + "COMPILER_ID" "${COMPILERS}" ${ARGN}) IF(PARSE_UNPARSED_ARGUMENTS) MESSAGE(SEND_ERROR "'${PARSE_UNPARSED_ARGUMENTS}' argument(s) not recognized when providing compiler specific options") ENDIF() - SET(COMPILER ${KOKKOS_CXX_COMPILER_ID}) + IF(PARSE_COMPILER_ID) + SET(COMPILER ${${PARSE_COMPILER_ID}}) + ELSE() + SET(COMPILER ${KOKKOS_CXX_COMPILER_ID}) + ENDIF() SET(COMPILER_SPECIFIC_FLAGS_TMP) FOREACH(COMP ${COMPILERS}) @@ -792,6 +823,14 @@ FUNCTION(COMPILER_SPECIFIC_FLAGS) COMPILER_SPECIFIC_OPTIONS_HELPER(${ARGN} COMPILE_OPTIONS LINK_OPTIONS) ENDFUNCTION(COMPILER_SPECIFIC_FLAGS) +FUNCTION(COMPILER_SPECIFIC_OPTIONS) + COMPILER_SPECIFIC_OPTIONS_HELPER(${ARGN} COMPILE_OPTIONS) +ENDFUNCTION(COMPILER_SPECIFIC_OPTIONS) + +FUNCTION(COMPILER_SPECIFIC_LINK_OPTIONS) + COMPILER_SPECIFIC_OPTIONS_HELPER(${ARGN} LINK_OPTIONS) +ENDFUNCTION(COMPILER_SPECIFIC_LINK_OPTIONS) + FUNCTION(COMPILER_SPECIFIC_DEFS) COMPILER_SPECIFIC_OPTIONS_HELPER(${ARGN} COMPILE_DEFINITIONS) ENDFUNCTION(COMPILER_SPECIFIC_DEFS) @@ -799,3 +838,36 @@ ENDFUNCTION(COMPILER_SPECIFIC_DEFS) FUNCTION(COMPILER_SPECIFIC_LIBS) COMPILER_SPECIFIC_OPTIONS_HELPER(${ARGN} LINK_LIBRARIES) ENDFUNCTION(COMPILER_SPECIFIC_LIBS) + +# Given a list of the form +# key1;value1;key2;value2,... +# Create a list of all keys in a variable named ${KEY_LIST_NAME} +# and set the value for each key in a variable ${VAR_PREFIX}key1,... +# kokkos_key_value_map(ARCH ALL_ARCHES key1;value1;key2;value2) +# would produce a list variable ALL_ARCHES=key1;key2 +# and individual variables ARCHkey1=value1 and ARCHkey2=value2 +MACRO(KOKKOS_KEY_VALUE_MAP VAR_PREFIX KEY_LIST_NAME) + SET(PARSE_KEY ON) + SET(${KEY_LIST_NAME}) + FOREACH(ENTRY ${ARGN}) + IF(PARSE_KEY) + SET(CURRENT_KEY ${ENTRY}) + SET(PARSE_KEY OFF) + LIST(APPEND ${KEY_LIST_NAME} ${CURRENT_KEY}) + ELSE() + SET(${VAR_PREFIX}${CURRENT_KEY} ${ENTRY}) + SET(PARSE_KEY ON) + ENDIF() + ENDFOREACH() +ENDMACRO() + +FUNCTION(KOKKOS_CHECK_DEPRECATED_OPTIONS) + KOKKOS_KEY_VALUE_MAP(DEPRECATED_MSG_ DEPRECATED_LIST ${ARGN}) + FOREACH(OPTION_SUFFIX ${DEPRECATED_LIST}) + SET(OPTION_NAME Kokkos_${OPTION_SUFFIX}) + SET(OPTION_MESSAGE ${DEPRECATED_MSG_${OPTION_SUFFIX}}) + IF(DEFINED ${OPTION_NAME}) # This variable has been given by the user as on or off + MESSAGE(SEND_ERROR "Removed option ${OPTION_NAME} has been given with value ${${OPTION_NAME}}. ${OPT_MESSAGE}") + ENDIF() + ENDFOREACH() +ENDFUNCTION() diff --git a/lib/kokkos/cmake/kokkos_install.cmake b/lib/kokkos/cmake/kokkos_install.cmake index 97bb2bd0b0..ff66d015fb 100644 --- a/lib/kokkos/cmake/kokkos_install.cmake +++ b/lib/kokkos/cmake/kokkos_install.cmake @@ -1,5 +1,5 @@ INCLUDE(CMakePackageConfigHelpers) -IF (NOT KOKKOS_HAS_TRILINOS) +IF (NOT KOKKOS_HAS_TRILINOS AND NOT Kokkos_INSTALL_TESTING) INCLUDE(GNUInstallDirs) #Set all the variables needed for KokkosConfig.cmake diff --git a/lib/kokkos/cmake/kokkos_test_cxx_std.cmake b/lib/kokkos/cmake/kokkos_test_cxx_std.cmake index 603b4b3d7a..cb857bc11e 100644 --- a/lib/kokkos/cmake/kokkos_test_cxx_std.cmake +++ b/lib/kokkos/cmake/kokkos_test_cxx_std.cmake @@ -28,19 +28,30 @@ FUNCTION(kokkos_set_cxx_standard_feature standard) GLOBAL_SET(KOKKOS_CXX_STANDARD_FEATURE ${FEATURE_NAME}) ELSEIF(NOT KOKKOS_USE_CXX_EXTENSIONS AND ${STANDARD_NAME}) MESSAGE(STATUS "Using ${${STANDARD_NAME}} for C++${standard} standard as feature") + IF (KOKKOS_CXX_COMPILER_ID STREQUAL NVIDIA AND (KOKKOS_CXX_HOST_COMPILER_ID STREQUAL GNU OR KOKKOS_CXX_HOST_COMPILER_ID STREQUAL Clang)) + SET(SUPPORTED_NVCC_FLAGS "-std=c++11;-std=c++14;-std=c++17") + IF (NOT ${${STANDARD_NAME}} IN_LIST SUPPORTED_NVCC_FLAGS) + MESSAGE(FATAL_ERROR "CMake wants to use ${${STANDARD_NAME}} which is not supported by NVCC. Using a more recent host compiler or a more recent CMake version might help.") + ENDIF() + ENDIF() GLOBAL_SET(KOKKOS_CXX_STANDARD_FEATURE ${FEATURE_NAME}) - ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL "MSVC") + ELSEIF (CMAKE_CXX_COMPILER_ID STREQUAL "MSVC" OR "x${CMAKE_CXX_SIMULATE_ID}" STREQUAL "xMSVC") #MSVC doesn't need a command line flag, that doesn't mean it has no support MESSAGE(STATUS "Using no flag for C++${standard} standard as feature") GLOBAL_SET(KOKKOS_CXX_STANDARD_FEATURE ${FEATURE_NAME}) + ELSEIF((KOKKOS_CXX_COMPILER_ID STREQUAL "NVIDIA") AND WIN32) + MESSAGE(STATUS "Using no flag for C++${standard} standard as feature") + GLOBAL_SET(KOKKOS_CXX_STANDARD_FEATURE "") ELSE() #nope, we can't do anything here MESSAGE(WARNING "C++${standard} is not supported as a compiler feature. We will choose custom flags for now, but this behavior has been deprecated. Please open an issue at https://github.com/kokkos/kokkos/issues reporting that ${KOKKOS_CXX_COMPILER_ID} ${KOKKOS_CXX_COMPILER_VERSION} failed for ${KOKKOS_CXX_STANDARD}, preferrably including your CMake command.") GLOBAL_SET(KOKKOS_CXX_STANDARD_FEATURE "") ENDIF() - IF(NOT ${FEATURE_NAME} IN_LIST CMAKE_CXX_COMPILE_FEATURES) - MESSAGE(FATAL_ERROR "Compiler ${KOKKOS_CXX_COMPILER_ID} should support ${FEATURE_NAME}, but CMake reports feature not supported") + IF(NOT WIN32) + IF(NOT ${FEATURE_NAME} IN_LIST CMAKE_CXX_COMPILE_FEATURES) + MESSAGE(FATAL_ERROR "Compiler ${KOKKOS_CXX_COMPILER_ID} should support ${FEATURE_NAME}, but CMake reports feature not supported") + ENDIF() ENDIF() ENDFUNCTION() @@ -123,7 +134,7 @@ IF (NOT KOKKOS_CXX_STANDARD_FEATURE) ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL Intel) INCLUDE(${KOKKOS_SRC_PATH}/cmake/intel.cmake) kokkos_set_intel_flags(${KOKKOS_CXX_STANDARD} ${KOKKOS_CXX_INTERMEDIATE_STANDARD}) - ELSEIF(KOKKOS_CXX_COMPILER_ID STREQUAL "MSVC") + ELSEIF((KOKKOS_CXX_COMPILER_ID STREQUAL "MSVC") OR ((KOKKOS_CXX_COMPILER_ID STREQUAL "NVIDIA") AND WIN32)) INCLUDE(${KOKKOS_SRC_PATH}/cmake/msvc.cmake) kokkos_set_msvc_flags(${KOKKOS_CXX_STANDARD} ${KOKKOS_CXX_INTERMEDIATE_STANDARD}) ELSE() diff --git a/lib/kokkos/cmake/kokkos_tpls.cmake b/lib/kokkos/cmake/kokkos_tpls.cmake index 76efd42847..861d79727f 100644 --- a/lib/kokkos/cmake/kokkos_tpls.cmake +++ b/lib/kokkos/cmake/kokkos_tpls.cmake @@ -13,10 +13,10 @@ KOKKOS_TPL_OPTION(LIBNUMA Off) KOKKOS_TPL_OPTION(MEMKIND Off) KOKKOS_TPL_OPTION(CUDA Off) KOKKOS_TPL_OPTION(LIBRT Off) -KOKKOS_TPL_OPTION(LIBDL On) - -IF(KOKKOS_ENABLE_PROFILING AND NOT KOKKOS_ENABLE_LIBDL) - MESSAGE(SEND_ERROR "Kokkos_ENABLE_PROFILING requires Kokkos_ENABLE_LIBDL=ON") +IF (WIN32) + KOKKOS_TPL_OPTION(LIBDL Off) +ELSE() + KOKKOS_TPL_OPTION(LIBDL On) ENDIF() IF(Trilinos_ENABLE_Kokkos AND TPL_ENABLE_HPX) diff --git a/lib/kokkos/cmake/kokkos_tribits.cmake b/lib/kokkos/cmake/kokkos_tribits.cmake index 6ee1409aa7..9ba817d2c9 100644 --- a/lib/kokkos/cmake/kokkos_tribits.cmake +++ b/lib/kokkos/cmake/kokkos_tribits.cmake @@ -21,10 +21,6 @@ IF (KOKKOS_HAS_TRILINOS) SET(${PROJECT_NAME}_ENABLE_DEBUG OFF) ENDIF() - IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_CXX11) - SET(${PROJECT_NAME}_ENABLE_CXX11 ON) - ENDIF() - IF(NOT DEFINED ${PROJECT_NAME}_ENABLE_TESTS) SET(${PROJECT_NAME}_ENABLE_TESTS OFF) ENDIF() @@ -134,7 +130,7 @@ FUNCTION(KOKKOS_ADD_EXECUTABLE ROOT_NAME) VERIFY_EMPTY(KOKKOS_ADD_EXECUTABLE ${PARSE_UNPARSED_ARGUMENTS}) #All executables must link to all the kokkos targets #This is just private linkage because exe is final - TARGET_LINK_LIBRARIES(${EXE_NAME} PRIVATE kokkos) + TARGET_LINK_LIBRARIES(${EXE_NAME} PRIVATE Kokkos::kokkos) endif() ENDFUNCTION() @@ -174,16 +170,42 @@ FUNCTION(KOKKOS_SET_EXE_PROPERTY ROOT_NAME) ENDFUNCTION() MACRO(KOKKOS_SETUP_BUILD_ENVIRONMENT) - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_compiler_id.cmake) - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_enable_devices.cmake) - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_enable_options.cmake) - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_test_cxx_std.cmake) - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_arch.cmake) - IF (NOT KOKKOS_HAS_TRILINOS) - SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Kokkos_SOURCE_DIR}/cmake/Modules/") - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_tpls.cmake) - ENDIF() - INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_corner_cases.cmake) + # This is needed for both regular build and install tests + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_compiler_id.cmake) + #set an internal option, if not already set + SET(Kokkos_INSTALL_TESTING OFF CACHE INTERNAL "Whether to build tests and examples against installation") + IF (Kokkos_INSTALL_TESTING) + SET(KOKKOS_ENABLE_TESTS ON) + SET(KOKKOS_ENABLE_EXAMPLES ON) + # This looks a little weird, but what we are doing + # is to NOT build Kokkos but instead look for an + # installed Kokkos - then build examples and tests + # against that installed Kokkos + FIND_PACKAGE(Kokkos REQUIRED) + # Just grab the configuration from the installation + FOREACH(DEV ${Kokkos_DEVICES}) + SET(KOKKOS_ENABLE_${DEV} ON) + ENDFOREACH() + FOREACH(OPT ${Kokkos_OPTIONS}) + SET(KOKKOS_ENABLE_${OPT} ON) + ENDFOREACH() + FOREACH(TPL ${Kokkos_TPLS}) + SET(KOKKOS_ENABLE_${TPL} ON) + ENDFOREACH() + FOREACH(ARCH ${Kokkos_ARCH}) + SET(KOKKOS_ARCH_${ARCH} ON) + ENDFOREACH() + ELSE() + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_enable_devices.cmake) + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_enable_options.cmake) + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_test_cxx_std.cmake) + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_arch.cmake) + IF (NOT KOKKOS_HAS_TRILINOS) + SET(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${Kokkos_SOURCE_DIR}/cmake/Modules/") + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_tpls.cmake) + ENDIF() + INCLUDE(${KOKKOS_SRC_PATH}/cmake/kokkos_corner_cases.cmake) + ENDIF() ENDMACRO() MACRO(KOKKOS_ADD_TEST_EXECUTABLE ROOT_NAME) @@ -310,28 +332,40 @@ FUNCTION(KOKKOS_INTERNAL_ADD_LIBRARY LIBRARY_NAME) LIST(REMOVE_DUPLICATES PARSE_SOURCES) ENDIF() + IF(PARSE_STATIC) + SET(LINK_TYPE STATIC) + ENDIF() + + IF(PARSE_SHARED) + SET(LINK_TYPE SHARED) + ENDIF() + + # MSVC and other platforms want to have + # the headers included as source files + # for better dependency detection ADD_LIBRARY( ${LIBRARY_NAME} + ${LINK_TYPE} ${PARSE_HEADERS} ${PARSE_SOURCES} ) KOKKOS_INTERNAL_ADD_LIBRARY_INSTALL(${LIBRARY_NAME}) - INSTALL( - FILES ${PARSE_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT ${PACKAGE_NAME} - ) - #In case we are building in-tree, add an alias name #that matches the install Kokkos:: name ADD_LIBRARY(Kokkos::${LIBRARY_NAME} ALIAS ${LIBRARY_NAME}) ENDFUNCTION() FUNCTION(KOKKOS_ADD_LIBRARY LIBRARY_NAME) + CMAKE_PARSE_ARGUMENTS(PARSE + "ADD_BUILD_OPTIONS" + "" + "" + ${ARGN} + ) IF (KOKKOS_HAS_TRILINOS) - TRIBITS_ADD_LIBRARY(${LIBRARY_NAME} ${ARGN}) + TRIBITS_ADD_LIBRARY(${LIBRARY_NAME} ${PARSE_UNPARSED_ARGUMENTS}) #Stolen from Tribits - it can add prefixes SET(TRIBITS_LIBRARY_NAME_PREFIX "${${PROJECT_NAME}_LIBRARY_NAME_PREFIX}") SET(TRIBITS_LIBRARY_NAME ${TRIBITS_LIBRARY_NAME_PREFIX}${LIBRARY_NAME}) @@ -346,8 +380,10 @@ FUNCTION(KOKKOS_ADD_LIBRARY LIBRARY_NAME) #KOKKOS_SET_LIBRARY_PROPERTIES(${TRIBITS_LIBRARY_NAME} PLAIN_STYLE) ELSE() KOKKOS_INTERNAL_ADD_LIBRARY( - ${LIBRARY_NAME} ${ARGN}) - KOKKOS_SET_LIBRARY_PROPERTIES(${LIBRARY_NAME}) + ${LIBRARY_NAME} ${PARSE_UNPARSED_ARGUMENTS}) + IF (PARSE_ADD_BUILD_OPTIONS) + KOKKOS_SET_LIBRARY_PROPERTIES(${LIBRARY_NAME}) + ENDIF() ENDIF() ENDFUNCTION() @@ -364,17 +400,6 @@ ELSE() ADD_LIBRARY(${NAME} INTERFACE) KOKKOS_INTERNAL_ADD_LIBRARY_INSTALL(${NAME}) - - INSTALL( - FILES ${PARSE_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - ) - - INSTALL( - FILES ${PARSE_HEADERS} - DESTINATION ${CMAKE_INSTALL_INCLUDEDIR} - COMPONENT ${PACKAGE_NAME} - ) ENDIF() ENDFUNCTION() diff --git a/lib/kokkos/config/yaml/volta.yaml b/lib/kokkos/config/yaml/volta.yaml new file mode 100644 index 0000000000..f67af9c2a4 --- /dev/null +++ b/lib/kokkos/config/yaml/volta.yaml @@ -0,0 +1,4 @@ +packages: + kokkos: + variants: +cuda +openmp +volta70 +cuda_lambda +wrapper ^cuda@10.1 + compiler: [gcc@7.2.0] diff --git a/lib/kokkos/containers/CMakeLists.txt b/lib/kokkos/containers/CMakeLists.txt index 2bfaea7a13..b0e0c4eade 100644 --- a/lib/kokkos/containers/CMakeLists.txt +++ b/lib/kokkos/containers/CMakeLists.txt @@ -2,7 +2,9 @@ KOKKOS_SUBPACKAGE(Containers) -ADD_SUBDIRECTORY(src) +IF (NOT Kokkos_INSTALL_TESTING) + ADD_SUBDIRECTORY(src) +ENDIF() KOKKOS_ADD_TEST_DIRECTORIES(unit_tests) KOKKOS_ADD_TEST_DIRECTORIES(performance_tests) diff --git a/lib/kokkos/containers/performance_tests/Makefile b/lib/kokkos/containers/performance_tests/Makefile index f309a220d0..8ef1dd9938 100644 --- a/lib/kokkos/containers/performance_tests/Makefile +++ b/lib/kokkos/containers/performance_tests/Makefile @@ -31,10 +31,10 @@ ifeq ($(KOKKOS_INTERNAL_USE_CUDA), 1) TEST_TARGETS += test-cuda endif -ifeq ($(KOKKOS_INTERNAL_USE_ROCM), 1) - OBJ_ROCM = TestROCm.o TestMain.o gtest-all.o - TARGETS += KokkosContainers_PerformanceTest_ROCm - TEST_TARGETS += test-rocm +ifeq ($(KOKKOS_INTERNAL_USE_HIP), 1) + OBJ_HIP = TestHIP.o TestMain.o gtest-all.o + TARGETS += KokkosContainers_PerformanceTest_HIP + TEST_TARGETS += test-hip endif ifeq ($(KOKKOS_INTERNAL_USE_PTHREADS), 1) diff --git a/lib/kokkos/containers/performance_tests/TestDynRankView.hpp b/lib/kokkos/containers/performance_tests/TestDynRankView.hpp index ee13f7e58b..8c507c7662 100644 --- a/lib/kokkos/containers/performance_tests/TestDynRankView.hpp +++ b/lib/kokkos/containers/performance_tests/TestDynRankView.hpp @@ -58,7 +58,7 @@ namespace Performance { // View functor template struct InitViewFunctor { - typedef Kokkos::View inviewtype; + using inviewtype = Kokkos::View; inviewtype _inview; InitViewFunctor(inviewtype &inview_) : _inview(inview_) {} @@ -73,10 +73,10 @@ struct InitViewFunctor { } struct SumComputationTest { - typedef Kokkos::View inviewtype; + using inviewtype = Kokkos::View; inviewtype _inview; - typedef Kokkos::View outviewtype; + using outviewtype = Kokkos::View; outviewtype _outview; KOKKOS_INLINE_FUNCTION @@ -96,7 +96,7 @@ struct InitViewFunctor { template struct InitStrideViewFunctor { - typedef Kokkos::View inviewtype; + using inviewtype = Kokkos::View; inviewtype _inview; InitStrideViewFunctor(inviewtype &inview_) : _inview(inview_) {} @@ -113,7 +113,7 @@ struct InitStrideViewFunctor { template struct InitViewRank7Functor { - typedef Kokkos::View inviewtype; + using inviewtype = Kokkos::View; inviewtype _inview; InitViewRank7Functor(inviewtype &inview_) : _inview(inview_) {} @@ -131,7 +131,7 @@ struct InitViewRank7Functor { // DynRankView functor template struct InitDynRankViewFunctor { - typedef Kokkos::DynRankView inviewtype; + using inviewtype = Kokkos::DynRankView; inviewtype _inview; InitDynRankViewFunctor(inviewtype &inview_) : _inview(inview_) {} @@ -146,10 +146,10 @@ struct InitDynRankViewFunctor { } struct SumComputationTest { - typedef Kokkos::DynRankView inviewtype; + using inviewtype = Kokkos::DynRankView; inviewtype _inview; - typedef Kokkos::DynRankView outviewtype; + using outviewtype = Kokkos::DynRankView; outviewtype _outview; KOKKOS_INLINE_FUNCTION @@ -169,8 +169,8 @@ struct InitDynRankViewFunctor { template void test_dynrankview_op_perf(const int par_size) { - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; const size_type dim_2 = 90; const size_type dim_3 = 30; @@ -184,7 +184,7 @@ void test_dynrankview_op_perf(const int par_size) { { Kokkos::View testview("testview", par_size, dim_2, dim_3); - typedef InitViewFunctor FunctorType; + using FunctorType = InitViewFunctor; timer.reset(); Kokkos::RangePolicy policy(0, par_size); @@ -204,7 +204,7 @@ void test_dynrankview_op_perf(const int par_size) { Kokkos::View teststrideview = Kokkos::subview(testview, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL); - typedef InitStrideViewFunctor FunctorStrideType; + using FunctorStrideType = InitStrideViewFunctor; timer.reset(); Kokkos::parallel_for(policy, FunctorStrideType(teststrideview)); @@ -216,7 +216,7 @@ void test_dynrankview_op_perf(const int par_size) { { Kokkos::View testview("testview", par_size, dim_2, dim_3, 1, 1, 1, 1); - typedef InitViewRank7Functor FunctorType; + using FunctorType = InitViewRank7Functor; timer.reset(); Kokkos::RangePolicy policy(0, par_size); @@ -229,7 +229,7 @@ void test_dynrankview_op_perf(const int par_size) { { Kokkos::DynRankView testdrview("testdrview", par_size, dim_2, dim_3); - typedef InitDynRankViewFunctor FunctorType; + using FunctorType = InitDynRankViewFunctor; timer.reset(); Kokkos::RangePolicy policy(0, par_size); diff --git a/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp b/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp index 0d2ee4bc8d..65de551b27 100644 --- a/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp +++ b/lib/kokkos/containers/performance_tests/TestGlobal2LocalIds.hpp @@ -65,9 +65,9 @@ union helper { template struct generate_ids { - typedef Device execution_space; - typedef typename execution_space::size_type size_type; - typedef Kokkos::View local_id_view; + using execution_space = Device; + using size_type = typename execution_space::size_type; + using local_id_view = Kokkos::View; local_id_view local_2_global; @@ -96,13 +96,12 @@ struct generate_ids { template struct fill_map { - typedef Device execution_space; - typedef typename execution_space::size_type size_type; - typedef Kokkos::View - local_id_view; - typedef Kokkos::UnorderedMap - global_id_view; + using execution_space = Device; + using size_type = typename execution_space::size_type; + using local_id_view = Kokkos::View; + using global_id_view = + Kokkos::UnorderedMap; global_id_view global_2_local; local_id_view local_2_global; @@ -120,18 +119,17 @@ struct fill_map { template struct find_test { - typedef Device execution_space; - typedef typename execution_space::size_type size_type; - typedef Kokkos::View - local_id_view; - typedef Kokkos::UnorderedMap - global_id_view; + using execution_space = Device; + using size_type = typename execution_space::size_type; + using local_id_view = Kokkos::View; + using global_id_view = + Kokkos::UnorderedMap; global_id_view global_2_local; local_id_view local_2_global; - typedef size_t value_type; + using value_type = size_t; find_test(global_id_view gIds, local_id_view lIds, value_type& num_errors) : global_2_local(gIds), local_2_global(lIds) { @@ -156,12 +154,12 @@ struct find_test { template void test_global_to_local_ids(unsigned num_ids) { - typedef Device execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = Device; + using size_type = typename execution_space::size_type; - typedef Kokkos::View local_id_view; - typedef Kokkos::UnorderedMap - global_id_view; + using local_id_view = Kokkos::View; + using global_id_view = + Kokkos::UnorderedMap; // size std::cout << num_ids << ", "; diff --git a/lib/kokkos/containers/performance_tests/TestScatterView.hpp b/lib/kokkos/containers/performance_tests/TestScatterView.hpp index 3d4c57f3e2..0f3ba103ef 100644 --- a/lib/kokkos/containers/performance_tests/TestScatterView.hpp +++ b/lib/kokkos/containers/performance_tests/TestScatterView.hpp @@ -50,14 +50,14 @@ namespace Perf { -template +template void test_scatter_view(int m, int n) { Kokkos::View original_view("original_view", n); { auto scatter_view = Kokkos::Experimental::create_scatter_view< - Kokkos::Experimental::ScatterSum, duplication, contribution>( + Kokkos::Experimental::ScatterSum, Duplication, Contribution>( original_view); Kokkos::Experimental::UniqueToken< ExecSpace, Kokkos::Experimental::UniqueTokenScope::Global> diff --git a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp index 9057842340..c31412552a 100644 --- a/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp +++ b/lib/kokkos/containers/performance_tests/TestUnorderedMapPerformance.hpp @@ -55,9 +55,9 @@ namespace Perf { template struct UnorderedMapTest { - typedef Device execution_space; - typedef Kokkos::UnorderedMap map_type; - typedef typename map_type::histogram_type histogram_type; + using execution_space = Device; + using map_type = Kokkos::UnorderedMap; + using histogram_type = typename map_type::histogram_type; struct value_type { uint32_t failed_count; diff --git a/lib/kokkos/containers/src/CMakeLists.txt b/lib/kokkos/containers/src/CMakeLists.txt index 0c9d24d641..7000624b6b 100644 --- a/lib/kokkos/containers/src/CMakeLists.txt +++ b/lib/kokkos/containers/src/CMakeLists.txt @@ -9,6 +9,10 @@ KOKKOS_INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) SET(KOKKOS_CONTAINERS_SRCS) APPEND_GLOB(KOKKOS_CONTAINERS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp) +SET(KOKKOS_CONTAINER_HEADERS) +APPEND_GLOB(KOKKOS_CONTAINERS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.hpp) +APPEND_GLOB(KOKKOS_CONTAINERS_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) + INSTALL ( DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" @@ -19,6 +23,7 @@ INSTALL ( KOKKOS_ADD_LIBRARY( kokkoscontainers SOURCES ${KOKKOS_CONTAINERS_SRCS} + HEADERS ${KOKKOS_CONTAINER_HEADERS} ) SET_TARGET_PROPERTIES(kokkoscontainers PROPERTIES VERSION ${Kokkos_VERSION}) diff --git a/lib/kokkos/containers/src/Kokkos_Bitset.hpp b/lib/kokkos/containers/src/Kokkos_Bitset.hpp index ab75fc1e1d..eedfd5f9ef 100644 --- a/lib/kokkos/containers/src/Kokkos_Bitset.hpp +++ b/lib/kokkos/containers/src/Kokkos_Bitset.hpp @@ -73,8 +73,8 @@ void deep_copy(ConstBitset& dst, ConstBitset const& src); template class Bitset { public: - typedef Device execution_space; - typedef unsigned size_type; + using execution_space = Device; + using size_type = unsigned; enum { BIT_SCAN_REVERSE = 1u }; enum { MOVE_HINT_BACKWARD = 2u }; @@ -137,9 +137,9 @@ class Bitset { if (m_last_block_mask) { // clear the unused bits in the last block - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; raw_deep_copy(m_blocks.data() + (m_blocks.extent(0) - 1u), &m_last_block_mask, sizeof(unsigned)); } @@ -234,6 +234,10 @@ class Bitset { return find_any_helper(block_idx, offset, block, scan_direction); } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return m_blocks.is_allocated(); + } + private: KOKKOS_FORCEINLINE_FUNCTION Kokkos::pair find_any_helper(unsigned block_idx, @@ -304,8 +308,8 @@ class Bitset { template class ConstBitset { public: - typedef Device execution_space; - typedef unsigned size_type; + using execution_space = Device; + using size_type = unsigned; private: enum { block_size = static_cast(sizeof(unsigned) * CHAR_BIT) }; @@ -380,9 +384,9 @@ void deep_copy(Bitset& dst, Bitset const& src) { "Error: Cannot deep_copy bitsets of different sizes!"); } - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; raw_deep_copy(dst.m_blocks.data(), src.m_blocks.data(), sizeof(unsigned) * src.m_blocks.extent(0)); } @@ -394,9 +398,9 @@ void deep_copy(Bitset& dst, ConstBitset const& src) { "Error: Cannot deep_copy bitsets of different sizes!"); } - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; raw_deep_copy(dst.m_blocks.data(), src.m_blocks.data(), sizeof(unsigned) * src.m_blocks.extent(0)); } @@ -408,9 +412,9 @@ void deep_copy(ConstBitset& dst, ConstBitset const& src) { "Error: Cannot deep_copy bitsets of different sizes!"); } - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; raw_deep_copy(dst.m_blocks.data(), src.m_blocks.data(), sizeof(unsigned) * src.m_blocks.extent(0)); } diff --git a/lib/kokkos/containers/src/Kokkos_DualView.hpp b/lib/kokkos/containers/src/Kokkos_DualView.hpp index ede7d9a31f..3fc0371c69 100644 --- a/lib/kokkos/containers/src/Kokkos_DualView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DualView.hpp @@ -100,99 +100,91 @@ class DualView : public ViewTraits { public: //! \name Typedefs for device types and various Kokkos::View specializations. //@{ - typedef ViewTraits traits; + using traits = ViewTraits; //! The Kokkos Host Device type; - typedef typename traits::host_mirror_space host_mirror_space; + using host_mirror_space = typename traits::host_mirror_space; //! The type of a Kokkos::View on the device. - typedef View t_dev; + using t_dev = View; /// \typedef t_host /// \brief The type of a Kokkos::View host mirror of \c t_dev. - typedef typename t_dev::HostMirror t_host; + using t_host = typename t_dev::HostMirror; //! The type of a const View on the device. //! The type of a Kokkos::View on the device. - typedef View - t_dev_const; + using t_dev_const = + View; /// \typedef t_host_const /// \brief The type of a const View host mirror of \c t_dev_const. - typedef typename t_dev_const::HostMirror t_host_const; + using t_host_const = typename t_dev_const::HostMirror; //! The type of a const, random-access View on the device. - typedef View > - t_dev_const_randomread; + using t_dev_const_randomread = + View >; /// \typedef t_host_const_randomread /// \brief The type of a const, random-access View host mirror of /// \c t_dev_const_randomread. - typedef typename t_dev_const_randomread::HostMirror t_host_const_randomread; + using t_host_const_randomread = typename t_dev_const_randomread::HostMirror; //! The type of an unmanaged View on the device. - typedef View - t_dev_um; + using t_dev_um = + View; //! The type of an unmanaged View host mirror of \c t_dev_um. - typedef View - t_host_um; + using t_host_um = + View; //! The type of a const unmanaged View on the device. - typedef View - t_dev_const_um; + using t_dev_const_um = + View; //! The type of a const unmanaged View host mirror of \c t_dev_const_um. - typedef View - t_host_const_um; + using t_host_const_um = + View; //! The type of a const, random-access View on the device. - typedef View > - t_dev_const_randomread_um; + using t_dev_const_randomread_um = + View >; /// \typedef t_host_const_randomread /// \brief The type of a const, random-access View host mirror of /// \c t_dev_const_randomread. - typedef - typename t_dev_const_randomread::HostMirror t_host_const_randomread_um; - - //@} - //! \name The two View instances. - //@{ - - t_dev d_view; - t_host h_view; + using t_host_const_randomread_um = + typename t_dev_const_randomread::HostMirror; //@} //! \name Counters to keep track of changes ("modified" flags) //@{ -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE protected: // modified_flags[0] -> host // modified_flags[1] -> device - typedef View t_modified_flags; + using t_modified_flags = View; t_modified_flags modified_flags; public: -#else - typedef View - t_modified_flags; - typedef View - t_modified_flag; - t_modified_flags modified_flags; - t_modified_flag modified_host, modified_device; -#endif - //@} + + // Moved this specifically after modified_flags to resolve an alignment issue + // on MSVC/NVCC + //! \name The two View instances. + //@{ + t_dev d_view; + t_host h_view; + //@} + //! \name Constructors //@{ @@ -201,14 +193,7 @@ class DualView : public ViewTraits { /// Both device and host View objects are constructed using their /// default constructors. The "modified" flags are both initialized /// to "unmodified." -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE DualView() = default; -#else - DualView() : modified_flags(t_modified_flags("DualView::modified_flags")) { - modified_host = t_modified_flag(modified_flags, 0); - modified_device = t_modified_flag(modified_flags, 1); - } -#endif /// \brief Constructor that allocates View objects on both host and device. /// @@ -228,15 +213,10 @@ class DualView : public ViewTraits { const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG) - : d_view(label, n0, n1, n2, n3, n4, n5, n6, n7), + : modified_flags(t_modified_flags("DualView::modified_flags")), + d_view(label, n0, n1, n2, n3, n4, n5, n6, n7), h_view(create_mirror_view(d_view)) // without UVM, host View mirrors - , - modified_flags(t_modified_flags("DualView::modified_flags")) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - modified_host = t_modified_flag(modified_flags, 0); - modified_device = t_modified_flag(modified_flags, 1); -#endif - } + {} /// \brief Constructor that allocates View objects on both host and device. /// @@ -260,15 +240,10 @@ class DualView : public ViewTraits { const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG) - : d_view(arg_prop, n0, n1, n2, n3, n4, n5, n6, n7), + : modified_flags(t_modified_flags("DualView::modified_flags")), + d_view(arg_prop, n0, n1, n2, n3, n4, n5, n6, n7), h_view(create_mirror_view(d_view)) // without UVM, host View mirrors - , - modified_flags(t_modified_flags("DualView::modified_flags")) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - modified_host = t_modified_flag(modified_flags, 0); - modified_device = t_modified_flag(modified_flags, 1); -#endif - } + {} explicit inline DualView(const ViewAllocateWithoutInitializing& arg_prop, const size_t arg_N0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, @@ -288,30 +263,16 @@ class DualView : public ViewTraits { //! Copy constructor (shallow copy) template DualView(const DualView& src) - : d_view(src.d_view), - h_view(src.h_view), - modified_flags(src.modified_flags) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - , - modified_host(src.modified_host), - modified_device(src.modified_device) -#endif - { - } + : modified_flags(src.modified_flags), + d_view(src.d_view), + h_view(src.h_view) {} //! Subview constructor template DualView(const DualView& src, const Arg0& arg0, Args... args) - : d_view(Kokkos::subview(src.d_view, arg0, args...)), - h_view(Kokkos::subview(src.h_view, arg0, args...)), - modified_flags(src.modified_flags) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - , - modified_host(src.modified_host), - modified_device(src.modified_device) -#endif - { - } + : modified_flags(src.modified_flags), + d_view(Kokkos::subview(src.d_view, arg0, args...)), + h_view(Kokkos::subview(src.h_view, arg0, args...)) {} /// \brief Create DualView from existing device and host View objects. /// @@ -324,9 +285,9 @@ class DualView : public ViewTraits { /// \param d_view_ Device View /// \param h_view_ Host View (must have type t_host = t_dev::HostMirror) DualView(const t_dev& d_view_, const t_host& h_view_) - : d_view(d_view_), - h_view(h_view_), - modified_flags(t_modified_flags("DualView::modified_flags")) { + : modified_flags(t_modified_flags("DualView::modified_flags")), + d_view(d_view_), + h_view(h_view_) { if (int(d_view.rank) != int(h_view.rank) || d_view.extent(0) != h_view.extent(0) || d_view.extent(1) != h_view.extent(1) || @@ -348,10 +309,6 @@ class DualView : public ViewTraits { Kokkos::Impl::throw_runtime_exception( "DualView constructed with incompatible views"); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - modified_host = t_modified_flag(modified_flags, 0); - modified_device = t_modified_flag(modified_flags, 1); -#endif } //@} @@ -367,20 +324,25 @@ class DualView : public ViewTraits { /// /// For example, suppose you create a DualView on Cuda, like this: /// \code - /// typedef Kokkos::DualView - /// dual_view_type; dual_view_type DV ("my dual view", 100); \endcode If you - /// want to get the CUDA device View, do this: \code typename - /// dual_view_type::t_dev cudaView = DV.view (); \endcode and if - /// you want to get the host mirror of that View, do this: \code typedef - /// typename Kokkos::HostSpace::execution_space host_device_type; typename - /// dual_view_type::t_host hostView = DV.view (); \endcode + /// using dual_view_type = + /// Kokkos::DualView; + /// dual_view_type DV ("my dual view", 100); + /// \endcode + /// If you want to get the CUDA device View, do this: + /// \code + /// typename dual_view_type::t_dev cudaView = DV.view (); + /// \endcode + /// and if you want to get the host mirror of that View, do this: + /// \code + /// using host_device_type = typename Kokkos::HostSpace::execution_space; + /// typename dual_view_type::t_host hostView = DV.view (); + /// \endcode template KOKKOS_INLINE_FUNCTION const typename Impl::if_c< std::is_same::value, t_dev, t_host>::type& view() const { -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE constexpr bool device_is_memspace = std::is_same::value; constexpr bool device_is_execspace = @@ -415,7 +377,6 @@ class DualView : public ViewTraits { (device_exec_is_t_dev_exec || device_exec_is_t_host_exec))), "Template parameter to .view() must exactly match one of the " "DualView's device types or one of the execution or memory spaces"); -#endif return Impl::if_c::value, @@ -428,6 +389,10 @@ class DualView : public ViewTraits { KOKKOS_INLINE_FUNCTION t_dev view_device() const { return d_view; } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return (d_view.is_allocated() && h_view.is_allocated()); + } + template static int get_device_side() { constexpr bool device_is_memspace = @@ -453,7 +418,6 @@ class DualView : public ViewTraits { std::is_same::value; -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE static_assert( device_is_t_dev_device || device_is_t_host_device || (device_is_memspace && @@ -465,13 +429,8 @@ class DualView : public ViewTraits { (device_exec_is_t_dev_exec || device_exec_is_t_host_exec))), "Template parameter to .sync() must exactly match one of the " "DualView's device types or one of the execution or memory spaces"); -#endif -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE int dev = -1; -#else - int dev = 0; -#endif if (device_is_t_dev_device) dev = 1; else if (device_is_t_host_device) @@ -822,11 +781,6 @@ class DualView : public ViewTraits { //! \name Methods for getting capacity, stride, or dimension(s). //@{ -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - //! The allocation size (same as Kokkos::View::capacity). - size_t capacity() const { return d_view.span(); } -#endif - //! The allocation size (same as Kokkos::View::span). KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return d_view.span(); } @@ -854,29 +808,6 @@ class DualView : public ViewTraits { return static_cast(d_view.extent(r)); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /* Deprecate all 'dimension' functions in favor of - * ISO/C++ vocabulary 'extent'. - */ - - /* \brief return size of dimension 0 */ - size_t dimension_0() const { return d_view.extent(0); } - /* \brief return size of dimension 1 */ - size_t dimension_1() const { return d_view.extent(1); } - /* \brief return size of dimension 2 */ - size_t dimension_2() const { return d_view.extent(2); } - /* \brief return size of dimension 3 */ - size_t dimension_3() const { return d_view.extent(3); } - /* \brief return size of dimension 4 */ - size_t dimension_4() const { return d_view.extent(4); } - /* \brief return size of dimension 5 */ - size_t dimension_5() const { return d_view.extent(5); } - /* \brief return size of dimension 6 */ - size_t dimension_6() const { return d_view.extent(6); } - /* \brief return size of dimension 7 */ - size_t dimension_7() const { return d_view.extent(7); } -#endif - //@} }; @@ -893,13 +824,12 @@ namespace Impl { template struct DualViewSubview { - typedef typename Kokkos::Impl::ViewMapping< - void, Kokkos::ViewTraits, Args...>::traits_type dst_traits; + using dst_traits = typename Kokkos::Impl::ViewMapping< + void, Kokkos::ViewTraits, Args...>::traits_type; - typedef Kokkos::DualView< + using type = Kokkos::DualView< typename dst_traits::data_type, typename dst_traits::array_layout, - typename dst_traits::device_type, typename dst_traits::memory_traits> - type; + typename dst_traits::device_type, typename dst_traits::memory_traits>; }; } /* namespace Impl */ diff --git a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp index 4ab212d7b9..afb4b682c4 100644 --- a/lib/kokkos/containers/src/Kokkos_DynRankView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynRankView.hpp @@ -349,8 +349,8 @@ class ViewMapping< public: enum { is_assignable = is_assignable_value_type && is_assignable_layout }; - typedef ViewMapping DstType; - typedef ViewMapping SrcType; + using DstType = ViewMapping; + using SrcType = ViewMapping; template KOKKOS_INLINE_FUNCTION static void assign( @@ -365,13 +365,13 @@ class ViewMapping< // Removed dimension checks... - typedef typename DstType::offset_type dst_offset_type; + using dst_offset_type = typename DstType::offset_type; dst.m_map.m_impl_offset = dst_offset_type( std::integral_constant(), src.layout()); // Check this for integer input1 for padding, etc dst.m_map.m_impl_handle = Kokkos::Impl::ViewDataHandle::assign( - src.m_map.m_impl_handle, src.m_track); - dst.m_track.assign(src.m_track, DstTraits::is_managed); + src.m_map.m_impl_handle, src.m_track.m_tracker); + dst.m_track.assign(src.m_track.m_tracker, DstTraits::is_managed); dst.m_rank = src.Rank; } }; @@ -415,16 +415,16 @@ class DynRankView : public ViewTraits { friend class Kokkos::Impl::ViewMapping; public: - typedef ViewTraits drvtraits; + using drvtraits = ViewTraits; - typedef View view_type; + using view_type = View; - typedef ViewTraits traits; + using traits = ViewTraits; private: - typedef Kokkos::Impl::ViewMapping - map_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using map_type = + Kokkos::Impl::ViewMapping; + using track_type = Kokkos::Impl::SharedAllocationTracker; track_type m_track; map_type m_map; @@ -440,28 +440,24 @@ class DynRankView : public ViewTraits { // 7 data_type of the traits /** \brief Compatible view of array of scalar types */ - typedef DynRankView< + using array_type = DynRankView< typename drvtraits::scalar_array_type, typename drvtraits::array_layout, - typename drvtraits::device_type, typename drvtraits::memory_traits> - array_type; + typename drvtraits::device_type, typename drvtraits::memory_traits>; /** \brief Compatible view of const data type */ - typedef DynRankView< + using const_type = DynRankView< typename drvtraits::const_data_type, typename drvtraits::array_layout, - typename drvtraits::device_type, typename drvtraits::memory_traits> - const_type; + typename drvtraits::device_type, typename drvtraits::memory_traits>; /** \brief Compatible view of non-const data type */ - typedef DynRankView< + using non_const_type = DynRankView< typename drvtraits::non_const_data_type, typename drvtraits::array_layout, - typename drvtraits::device_type, typename drvtraits::memory_traits> - non_const_type; + typename drvtraits::device_type, typename drvtraits::memory_traits>; /** \brief Compatible HostMirror view */ - typedef DynRankView - HostMirror; + using HostMirror = DynRankView; //---------------------------------------- // Domain rank and extents @@ -493,42 +489,6 @@ class DynRankView : public ViewTraits { * ISO/C++ vocabulary 'extent'. */ -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - KOKKOS_INLINE_FUNCTION constexpr - typename std::enable_if::value, size_t>::type - dimension(const iType& r) const { - return extent(r); - } - - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const { - return m_map.dimension_0(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { - return m_map.dimension_1(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { - return m_map.dimension_2(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { - return m_map.dimension_3(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { - return m_map.dimension_4(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { - return m_map.dimension_5(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { - return m_map.dimension_6(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { - return m_map.dimension_7(); - } -#endif - - //---------------------------------------- - KOKKOS_INLINE_FUNCTION constexpr size_t size() const { return m_map.extent(0) * m_map.extent(1) * m_map.extent(2) * m_map.extent(3) * m_map.extent(4) * m_map.extent(5) * @@ -568,8 +528,8 @@ class DynRankView : public ViewTraits { //---------------------------------------- // Range span is the span which contains all members. - typedef typename map_type::reference_type reference_type; - typedef typename map_type::pointer_type pointer_type; + using reference_type = typename map_type::reference_type; + using pointer_type = typename map_type::pointer_type; enum { reference_type_is_lvalue_reference = @@ -577,39 +537,18 @@ class DynRankView : public ViewTraits { }; KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_map.span(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // Deprecated, use 'span()' instead - KOKKOS_INLINE_FUNCTION constexpr size_t capacity() const { - return m_map.span(); - } -#endif KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const { return m_map.span_is_contiguous(); } KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { return m_map.data(); } - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // Deprecated, use 'span_is_contigous()' instead - KOKKOS_INLINE_FUNCTION constexpr bool is_contiguous() const { - return m_map.span_is_contiguous(); + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return (m_map.data() != nullptr); } - // Deprecated, use 'data()' instead - KOKKOS_INLINE_FUNCTION constexpr pointer_type ptr_on_device() const { - return m_map.data(); - } -#endif //---------------------------------------- // Allow specializations to query their specialized map -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - KOKKOS_INLINE_FUNCTION - const Kokkos::Impl::ViewMapping& - implementation_map() const { - return m_map; - } -#endif KOKKOS_INLINE_FUNCTION const Kokkos::Impl::ViewMapping& impl_map() const { @@ -709,12 +648,11 @@ class DynRankView : public ViewTraits { const size_t dim_scalar = m_map.dimension_scalar(); const size_t bytes = this->span() / dim_scalar; - typedef Kokkos::View< + using tmp_view_type = Kokkos::View< DataType*, typename traits::array_layout, typename traits::device_type, Kokkos::MemoryTraits > - tmp_view_type; + traits::memory_traits::is_atomic> >; tmp_view_type rankone_view(this->data(), bytes, dim_scalar); return rankone_view(i0); } @@ -1102,10 +1040,9 @@ class DynRankView : public ViewTraits { template KOKKOS_INLINE_FUNCTION DynRankView(const DynRankView& rhs) : m_track(rhs.m_track, traits::is_managed), m_map(), m_rank(rhs.m_rank) { - typedef typename DynRankView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping - Mapping; + using SrcTraits = typename DynRankView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible DynRankView copy construction"); Mapping::assign(m_map, rhs.m_map, rhs.m_track); @@ -1114,10 +1051,9 @@ class DynRankView : public ViewTraits { template KOKKOS_INLINE_FUNCTION DynRankView& operator=( const DynRankView& rhs) { - typedef typename DynRankView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping - Mapping; + using SrcTraits = typename DynRankView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible DynRankView copy construction"); Mapping::assign(m_map, rhs.m_map, rhs.m_track); @@ -1130,10 +1066,10 @@ class DynRankView : public ViewTraits { template KOKKOS_INLINE_FUNCTION DynRankView(const View& rhs) : m_track(), m_map(), m_rank(rhs.Rank) { - typedef typename View::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping - Mapping; + using SrcTraits = typename View::traits; + using Mapping = + Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible View to DynRankView copy construction"); Mapping::assign(*this, rhs); @@ -1141,10 +1077,10 @@ class DynRankView : public ViewTraits { template KOKKOS_INLINE_FUNCTION DynRankView& operator=(const View& rhs) { - typedef typename View::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping - Mapping; + using SrcTraits = typename View::traits; + using Mapping = + Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible View to DynRankView copy assignment"); Mapping::assign(*this, rhs); @@ -1177,11 +1113,11 @@ class DynRankView : public ViewTraits { template computeRank( arg_prop, arg_layout)) { // Append layout and spaces if not input - typedef Kokkos::Impl::ViewCtorProp alloc_prop_input; + using alloc_prop_input = Kokkos::Impl::ViewCtorProp; // use 'std::integral_constant' for non-types // to avoid duplicate class error. - typedef Kokkos::Impl::ViewCtorProp< + using alloc_prop = Kokkos::Impl::ViewCtorProp< P..., typename std::conditional, @@ -1193,19 +1129,13 @@ class DynRankView : public ViewTraits { typename std::conditional< alloc_prop_input::has_execution_space, std::integral_constant, - typename traits::device_type::execution_space>::type> - alloc_prop; + typename traits::device_type::execution_space>::type>; static_assert(traits::is_managed, "View allocation constructor requires managed memory"); if (alloc_prop::initialize && -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - !alloc_prop::execution_space::is_initialized() -#else - !alloc_prop::execution_space::impl_is_initialized() -#endif - ) { + !alloc_prop::execution_space::impl_is_initialized()) { // If initializing view data then // the execution space must be initialized. Kokkos::Impl::throw_runtime_exception( @@ -1499,36 +1429,34 @@ struct ViewMapping< unsigned(R4) + unsigned(R5) + unsigned(R6) }; - typedef Kokkos::LayoutStride array_layout; + using array_layout = Kokkos::LayoutStride; - typedef typename SrcTraits::value_type value_type; + using value_type = typename SrcTraits::value_type; - typedef value_type******* data_type; + using data_type = value_type*******; public: - typedef Kokkos::ViewTraits - traits_type; + using traits_type = Kokkos::ViewTraits; - typedef Kokkos::View - type; + using type = + Kokkos::View; template struct apply { static_assert(Kokkos::Impl::is_memory_traits::value, ""); - typedef Kokkos::ViewTraits - traits_type; + using traits_type = + Kokkos::ViewTraits; - typedef Kokkos::View - type; + using type = Kokkos::View; }; - typedef typename SrcTraits::dimension dimension; + using dimension = typename SrcTraits::dimension; template - ret_type; + using ret_type = Kokkos::DynRankView; template KOKKOS_INLINE_FUNCTION static ret_type subview( const unsigned src_rank, Kokkos::DynRankView const& src, Args... args) { - typedef ViewMapping DstType; + using DstType = ViewMapping; - typedef typename std::conditional< + using DstDimType = typename std::conditional< (rank == 0), ViewDimension<>, typename std::conditional< (rank == 1), ViewDimension<0>, @@ -1570,10 +1497,10 @@ struct ViewMapping< typename std::conditional< (rank == 6), ViewDimension<0, 0, 0, 0, 0, 0>, ViewDimension<0, 0, 0, 0, 0, 0, 0> >::type>:: - type>::type>::type>::type>::type>::type DstDimType; + type>::type>::type>::type>::type>::type; - typedef ViewOffset dst_offset_type; - typedef typename DstType::handle_type dst_handle_type; + using dst_offset_type = ViewOffset; + using dst_handle_type = typename DstType::handle_type; ret_type dst; @@ -1636,9 +1563,9 @@ subdynrankview(const Kokkos::DynRankView& src, Args... args) { "DynRankView"); } - typedef Kokkos::Impl::ViewMapping, Args...> - metafcn; + using metafcn = + Kokkos::Impl::ViewMapping, Args...>; return metafcn::subview(src.rank(), src, args...); } @@ -1659,8 +1586,8 @@ template KOKKOS_INLINE_FUNCTION bool operator==(const DynRankView& lhs, const DynRankView& rhs) { // Same data, layout, dimensions - typedef ViewTraits lhs_traits; - typedef ViewTraits rhs_traits; + using lhs_traits = ViewTraits; + using rhs_traits = ViewTraits; return std::is_same::value && @@ -1691,7 +1618,7 @@ namespace Impl { template struct DynRankViewFill { - typedef typename OutputView::traits::const_value_type const_value_type; + using const_value_type = typename OutputView::traits::const_value_type; const OutputView output; const_value_type input; @@ -1722,15 +1649,11 @@ struct DynRankViewFill { DynRankViewFill(const OutputView& arg_out, const_value_type& arg_in) : output(arg_out), input(arg_in) { - typedef typename OutputView::execution_space execution_space; - typedef Kokkos::RangePolicy Policy; + using execution_space = typename OutputView::execution_space; + using Policy = Kokkos::RangePolicy; - const Kokkos::Impl::ParallelFor closure( - *this, Policy(0, output.extent(0))); - - closure.execute(); - - execution_space().fence(); + Kokkos::parallel_for("Kokkos::DynRankViewFill", Policy(0, output.extent(0)), + *this); } }; @@ -1770,11 +1693,9 @@ struct DynRankViewRemap { n5(std::min((size_t)arg_out.extent(5), (size_t)arg_in.extent(5))), n6(std::min((size_t)arg_out.extent(6), (size_t)arg_in.extent(6))), n7(std::min((size_t)arg_out.extent(7), (size_t)arg_in.extent(7))) { - typedef Kokkos::RangePolicy Policy; - const Kokkos::Impl::ParallelFor closure( - *this, Policy(0, n0)); - closure.execute(); - // ExecSpace().fence(); // ?? + using Policy = Kokkos::RangePolicy; + + Kokkos::parallel_for("Kokkos::DynRankViewRemap", Policy(0, n0), *this); } KOKKOS_INLINE_FUNCTION @@ -1814,7 +1735,9 @@ inline void deep_copy( typename ViewTraits::value_type>::value, "deep_copy requires non-const type"); + Kokkos::fence(); Kokkos::Impl::DynRankViewFill >(dst, value); + Kokkos::fence(); } /** \brief Deep copy into a value in Host memory from a view. */ @@ -1828,10 +1751,12 @@ inline void deep_copy( Kokkos::abort(""); } - typedef ViewTraits src_traits; - typedef typename src_traits::memory_space src_memory_space; + using src_traits = ViewTraits; + using src_memory_space = typename src_traits::memory_space; + Kokkos::fence(); Kokkos::Impl::DeepCopy(&dst, src.data(), sizeof(ST)); + Kokkos::fence(); } //---------------------------------------------------------------------------- @@ -1851,13 +1776,13 @@ inline void deep_copy( typename DstType::traits::non_const_value_type>::value, "deep_copy requires non-const destination type"); - typedef DstType dst_type; - typedef SrcType src_type; + using dst_type = DstType; + using src_type = SrcType; - typedef typename dst_type::execution_space dst_execution_space; - typedef typename src_type::execution_space src_execution_space; - typedef typename dst_type::memory_space dst_memory_space; - typedef typename src_type::memory_space src_memory_space; + using dst_execution_space = typename dst_type::execution_space; + using src_execution_space = typename src_type::execution_space; + using dst_memory_space = typename dst_type::memory_space; + using src_memory_space = typename src_type::memory_space; enum { DstExecCanAccessSrc = @@ -1878,9 +1803,11 @@ inline void deep_copy( // If same type, equal layout, equal dimensions, equal span, and contiguous // memory then can byte-wise copy if (rank(src) == 0 && rank(dst) == 0) { - typedef typename dst_type::value_type value_type; + using value_type = typename dst_type::value_type; + Kokkos::fence(); Kokkos::Impl::DeepCopy( dst.data(), src.data(), sizeof(value_type)); + Kokkos::fence(); } else if (std::is_same< typename DstType::traits::value_type, typename SrcType::traits::non_const_value_type>::value && @@ -1902,9 +1829,10 @@ inline void deep_copy( dst.extent(6) == src.extent(6) && dst.extent(7) == src.extent(7)) { const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); - + Kokkos::fence(); Kokkos::Impl::DeepCopy( dst.data(), src.data(), nbytes); + Kokkos::fence(); } else if (std::is_same< typename DstType::traits::value_type, typename SrcType::traits::non_const_value_type>::value && @@ -1931,22 +1859,29 @@ inline void deep_copy( dst.stride_6() == src.stride_6() && dst.stride_7() == src.stride_7()) { const size_t nbytes = sizeof(typename dst_type::value_type) * dst.span(); - + Kokkos::fence(); Kokkos::Impl::DeepCopy( dst.data(), src.data(), nbytes); + Kokkos::fence(); } else if (DstExecCanAccessSrc) { // Copying data between views in accessible memory spaces and either // non-contiguous or incompatible shape. + Kokkos::fence(); Kokkos::Impl::DynRankViewRemap(dst, src); + Kokkos::fence(); } else if (SrcExecCanAccessDst) { // Copying data between views in accessible memory spaces and either // non-contiguous or incompatible shape. + Kokkos::fence(); Kokkos::Impl::DynRankViewRemap( dst, src); + Kokkos::fence(); } else { Kokkos::Impl::throw_runtime_exception( "deep_copy given views that would require a temporary allocation"); } + } else { + Kokkos::fence(); } } @@ -1962,45 +1897,45 @@ namespace Impl { template struct MirrorDRViewType { // The incoming view_type - typedef typename Kokkos::DynRankView src_view_type; + using src_view_type = typename Kokkos::DynRankView; // The memory space for the mirror view - typedef typename Space::memory_space memory_space; + using memory_space = typename Space::memory_space; // Check whether it is the same memory space enum { is_same_memspace = std::is_same::value }; // The array_layout - typedef typename src_view_type::array_layout array_layout; + using array_layout = typename src_view_type::array_layout; // The data type (we probably want it non-const since otherwise we can't even // deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; + using data_type = typename src_view_type::non_const_data_type; // The destination view type if it is not the same memory space - typedef Kokkos::DynRankView dest_view_type; + using dest_view_type = Kokkos::DynRankView; // If it is the same memory_space return the existsing view_type // This will also keep the unmanaged trait if necessary - typedef typename std::conditional::type view_type; + using view_type = typename std::conditional::type; }; template struct MirrorDRVType { // The incoming view_type - typedef typename Kokkos::DynRankView src_view_type; + using src_view_type = typename Kokkos::DynRankView; // The memory space for the mirror view - typedef typename Space::memory_space memory_space; + using memory_space = typename Space::memory_space; // Check whether it is the same memory space enum { is_same_memspace = std::is_same::value }; // The array_layout - typedef typename src_view_type::array_layout array_layout; + using array_layout = typename src_view_type::array_layout; // The data type (we probably want it non-const since otherwise we can't even // deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; + using data_type = typename src_view_type::non_const_data_type; // The destination view type if it is not the same memory space - typedef Kokkos::DynRankView view_type; + using view_type = Kokkos::DynRankView; }; } // namespace Impl @@ -2012,8 +1947,8 @@ inline typename DynRankView::HostMirror create_mirror( std::is_same::specialize, void>::value && !std::is_same::array_layout, Kokkos::LayoutStride>::value>::type* = nullptr) { - typedef DynRankView src_type; - typedef typename src_type::HostMirror dst_type; + using src_type = DynRankView; + using dst_type = typename src_type::HostMirror; return dst_type(std::string(src.label()).append("_mirror"), Impl::reconstructLayout(src.layout(), src.rank())); @@ -2026,8 +1961,8 @@ inline typename DynRankView::HostMirror create_mirror( std::is_same::specialize, void>::value && std::is_same::array_layout, Kokkos::LayoutStride>::value>::type* = 0) { - typedef DynRankView src_type; - typedef typename src_type::HostMirror dst_type; + using src_type = DynRankView; + using dst_type = typename src_type::HostMirror; return dst_type(std::string(src.label()).append("_mirror"), Impl::reconstructLayout(src.layout(), src.rank())); @@ -2066,7 +2001,7 @@ inline typename DynRankView::HostMirror create_mirror_view( typename DynRankView::HostMirror::memory_space>::value && std::is_same::data_type, typename DynRankView::HostMirror::data_type>:: - value)>::type* = 0) { + value)>::type* = nullptr) { return Kokkos::create_mirror(src); } @@ -2085,7 +2020,8 @@ template typename Impl::MirrorDRViewType::view_type create_mirror_view( const Space&, const Kokkos::DynRankView& src, typename std::enable_if< - !Impl::MirrorDRViewType::is_same_memspace>::type* = 0) { + !Impl::MirrorDRViewType::is_same_memspace>::type* = + nullptr) { return typename Impl::MirrorDRViewType::view_type( src.label(), Impl::reconstructLayout(src.layout(), src.rank())); } @@ -2112,7 +2048,8 @@ create_mirror_view_and_copy( const Space&, const Kokkos::DynRankView& src, std::string const& name = "", typename std::enable_if< - !Impl::MirrorDRViewType::is_same_memspace>::type* = 0) { + !Impl::MirrorDRViewType::is_same_memspace>::type* = + nullptr) { using Mirror = typename Impl::MirrorDRViewType::view_type; std::string label = name.empty() ? src.label() : name; auto mirror = Mirror(Kokkos::ViewAllocateWithoutInitializing(label), @@ -2139,7 +2076,7 @@ inline void resize(DynRankView& v, const size_t n5 = KOKKOS_INVALID_INDEX, const size_t n6 = KOKKOS_INVALID_INDEX, const size_t n7 = KOKKOS_INVALID_INDEX) { - typedef DynRankView drview_type; + using drview_type = DynRankView; static_assert(Kokkos::ViewTraits::is_managed, "Can only resize managed views"); @@ -2163,7 +2100,7 @@ inline void realloc(DynRankView& v, const size_t n5 = KOKKOS_INVALID_INDEX, const size_t n6 = KOKKOS_INVALID_INDEX, const size_t n7 = KOKKOS_INVALID_INDEX) { - typedef DynRankView drview_type; + using drview_type = DynRankView; static_assert(Kokkos::ViewTraits::is_managed, "Can only realloc managed views"); diff --git a/lib/kokkos/containers/src/Kokkos_DynamicView.hpp b/lib/kokkos/containers/src/Kokkos_DynamicView.hpp index ebbbcc5e8c..3662acee64 100644 --- a/lib/kokkos/containers/src/Kokkos_DynamicView.hpp +++ b/lib/kokkos/containers/src/Kokkos_DynamicView.hpp @@ -85,13 +85,13 @@ struct ChunkArraySpace { template class DynamicView : public Kokkos::ViewTraits { public: - typedef Kokkos::ViewTraits traits; + using traits = Kokkos::ViewTraits; private: template friend class DynamicView; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using track_type = Kokkos::Impl::SharedAllocationTracker; static_assert(traits::rank == 1 && traits::rank_dynamic == 1, "DynamicView must be rank-one"); @@ -118,8 +118,8 @@ class DynamicView : public Kokkos::ViewTraits { private: track_type m_track; - typename traits::value_type** - m_chunks; // array of pointers to 'chunks' of memory + typename traits::value_type** m_chunks = + nullptr; // array of pointers to 'chunks' of memory unsigned m_chunk_shift; // ceil(log2(m_chunk_size)) unsigned m_chunk_mask; // m_chunk_size - 1 unsigned m_chunk_max; // number of entries in the chunk array - each pointing @@ -130,38 +130,36 @@ class DynamicView : public Kokkos::ViewTraits { //---------------------------------------------------------------------- /** \brief Compatible view of array of scalar types */ - typedef DynamicView - array_type; + using array_type = + DynamicView; /** \brief Compatible view of const data type */ - typedef DynamicView - const_type; + using const_type = DynamicView; /** \brief Compatible view of non-const data type */ - typedef DynamicView - non_const_type; + using non_const_type = DynamicView; /** \brief Must be accessible everywhere */ - typedef DynamicView HostMirror; + using HostMirror = DynamicView; /** \brief Unified types */ - typedef Kokkos::Device - uniform_device; - typedef array_type uniform_type; - typedef const_type uniform_const_type; - typedef array_type uniform_runtime_type; - typedef const_type uniform_runtime_const_type; - typedef DynamicView - uniform_nomemspace_type; - typedef DynamicView - uniform_const_nomemspace_type; - typedef DynamicView - uniform_runtime_nomemspace_type; - typedef DynamicView - uniform_runtime_const_nomemspace_type; + using uniform_device = + Kokkos::Device; + using uniform_type = array_type; + using uniform_const_type = const_type; + using uniform_runtime_type = array_type; + using uniform_runtime_const_type = const_type; + using uniform_nomemspace_type = + DynamicView; + using uniform_const_nomemspace_type = + DynamicView; + using uniform_runtime_nomemspace_type = + DynamicView; + using uniform_runtime_const_nomemspace_type = + DynamicView; //---------------------------------------------------------------------- @@ -193,17 +191,6 @@ class DynamicView : public Kokkos::ViewTraits { return r == 0 ? size() : 1; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - KOKKOS_INLINE_FUNCTION size_t dimension_0() const { return size(); } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { return 1; } -#endif - KOKKOS_INLINE_FUNCTION constexpr size_t stride_0() const { return 0; } KOKKOS_INLINE_FUNCTION constexpr size_t stride_1() const { return 0; } KOKKOS_INLINE_FUNCTION constexpr size_t stride_2() const { return 0; } @@ -231,8 +218,8 @@ class DynamicView : public Kokkos::ViewTraits { //---------------------------------------------------------------------- // Range span is the span which contains all members. - typedef typename traits::value_type& reference_type; - typedef typename traits::value_type* pointer_type; + using reference_type = typename traits::value_type&; + using pointer_type = typename traits::value_type*; enum { reference_type_is_lvalue_reference = @@ -299,8 +286,8 @@ class DynamicView : public Kokkos::ViewTraits { typename Impl::ChunkArraySpace< typename traits::memory_space>::memory_space>::accessible>::type resize_serial(IntType const& n) { - typedef typename traits::value_type local_value_type; - typedef local_value_type* value_pointer_type; + using local_value_type = typename traits::value_type; + using value_pointer_type = local_value_type*; const uintptr_t NC = (n + m_chunk_mask) >> @@ -332,6 +319,17 @@ class DynamicView : public Kokkos::ViewTraits { *(pc + 1) = n; } + KOKKOS_INLINE_FUNCTION bool is_allocated() const { + if (m_chunks == nullptr) { + return false; + } else { + // *m_chunks[m_chunk_max] stores the current number of chunks being used + uintptr_t* const pc = + reinterpret_cast(m_chunks + m_chunk_max); + return (*(pc + 1) > 0); + } + } + //---------------------------------------------------------------------- ~DynamicView() = default; @@ -349,8 +347,8 @@ class DynamicView : public Kokkos::ViewTraits { m_chunk_mask(rhs.m_chunk_mask), m_chunk_max(rhs.m_chunk_max), m_chunk_size(rhs.m_chunk_size) { - typedef typename DynamicView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping Mapping; + using SrcTraits = typename DynamicView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible DynamicView copy construction"); } @@ -373,9 +371,7 @@ class DynamicView : public Kokkos::ViewTraits { } void execute(bool arg_destroy) { - typedef Kokkos::RangePolicy Range; - // typedef Kokkos::RangePolicy< typename Impl::ChunkArraySpace< typename - // traits::memory_space >::memory_space::execution_space > Range ; + using Range = Kokkos::RangePolicy; m_destroy = arg_destroy; @@ -431,12 +427,11 @@ class DynamicView : public Kokkos::ViewTraits { m_chunk_shift) // max num pointers-to-chunks in array , m_chunk_size(2 << (m_chunk_shift - 1)) { - typedef typename Impl::ChunkArraySpace< - typename traits::memory_space>::memory_space chunk_array_memory_space; + using chunk_array_memory_space = typename Impl::ChunkArraySpace< + typename traits::memory_space>::memory_space; // A functor to deallocate all of the chunks upon final destruction - typedef Kokkos::Impl::SharedAllocationRecord - record_type; + using record_type = + Kokkos::Impl::SharedAllocationRecord; // Allocate chunk pointers and allocation counter record_type* const record = @@ -471,11 +466,11 @@ create_mirror_view(const Kokkos::Experimental::DynamicView& src) { template inline void deep_copy(const View& dst, const Kokkos::Experimental::DynamicView& src) { - typedef View dst_type; - typedef Kokkos::Experimental::DynamicView src_type; + using dst_type = View; + using src_type = Kokkos::Experimental::DynamicView; - typedef typename ViewTraits::execution_space dst_execution_space; - typedef typename ViewTraits::memory_space src_memory_space; + using dst_execution_space = typename ViewTraits::execution_space; + using src_memory_space = typename ViewTraits::memory_space; enum { DstExecCanAccessSrc = @@ -496,11 +491,11 @@ inline void deep_copy(const View& dst, template inline void deep_copy(const Kokkos::Experimental::DynamicView& dst, const View& src) { - typedef Kokkos::Experimental::DynamicView dst_type; - typedef View src_type; + using dst_type = Kokkos::Experimental::DynamicView; + using src_type = View; - typedef typename ViewTraits::execution_space dst_execution_space; - typedef typename ViewTraits::memory_space src_memory_space; + using dst_execution_space = typename ViewTraits::execution_space; + using src_memory_space = typename ViewTraits::memory_space; enum { DstExecCanAccessSrc = @@ -522,10 +517,10 @@ namespace Impl { template struct CommonSubview, Kokkos::Experimental::DynamicView, 1, Arg0> { - typedef Kokkos::Experimental::DynamicView DstType; - typedef Kokkos::Experimental::DynamicView SrcType; - typedef DstType dst_subview_type; - typedef SrcType src_subview_type; + using DstType = Kokkos::Experimental::DynamicView; + using SrcType = Kokkos::Experimental::DynamicView; + using dst_subview_type = DstType; + using src_subview_type = SrcType; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& /*arg0*/) @@ -535,9 +530,9 @@ struct CommonSubview, template struct CommonSubview, SrcType, 1, Arg0> { - typedef Kokkos::Experimental::DynamicView DstType; - typedef DstType dst_subview_type; - typedef typename Kokkos::Subview src_subview_type; + using DstType = Kokkos::Experimental::DynamicView; + using dst_subview_type = DstType; + using src_subview_type = typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0) @@ -547,9 +542,9 @@ struct CommonSubview, SrcType, 1, template struct CommonSubview, 1, Arg0> { - typedef Kokkos::Experimental::DynamicView SrcType; - typedef typename Kokkos::Subview dst_subview_type; - typedef SrcType src_subview_type; + using SrcType = Kokkos::Experimental::DynamicView; + using dst_subview_type = typename Kokkos::Subview; + using src_subview_type = SrcType; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0) @@ -559,11 +554,11 @@ struct CommonSubview, 1, template struct ViewCopy, ViewTypeB, Layout, - ExecSpace, 1, iType, false> { + ExecSpace, 1, iType> { Kokkos::Experimental::DynamicView a; ViewTypeB b; - typedef Kokkos::RangePolicy> policy_type; + using policy_type = Kokkos::RangePolicy>; ViewCopy(const Kokkos::Experimental::DynamicView& a_, const ViewTypeB& b_) @@ -580,11 +575,11 @@ template struct ViewCopy, Kokkos::Experimental::DynamicView, Layout, ExecSpace, 1, - iType, false> { + iType> { Kokkos::Experimental::DynamicView a; Kokkos::Experimental::DynamicView b; - typedef Kokkos::RangePolicy> policy_type; + using policy_type = Kokkos::RangePolicy>; ViewCopy(const Kokkos::Experimental::DynamicView& a_, const Kokkos::Experimental::DynamicView& b_) diff --git a/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp b/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp index e07c386b7d..fbfaed9b1b 100644 --- a/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp +++ b/lib/kokkos/containers/src/Kokkos_ErrorReporter.hpp @@ -56,9 +56,9 @@ namespace Experimental { template class ErrorReporter { public: - typedef ReportType report_type; - typedef DeviceType device_type; - typedef typename device_type::execution_space execution_space; + using report_type = ReportType; + using device_type = DeviceType; + using execution_space = typename device_type::execution_space; ErrorReporter(int max_results) : m_numReportsAttempted(""), @@ -103,10 +103,10 @@ class ErrorReporter { } private: - typedef Kokkos::View reports_view_t; - typedef Kokkos::DualView reports_dualview_t; + using reports_view_t = Kokkos::View; + using reports_dualview_t = Kokkos::DualView; - typedef typename reports_dualview_t::host_mirror_space host_mirror_space; + using host_mirror_space = typename reports_dualview_t::host_mirror_space; Kokkos::View m_numReportsAttempted; reports_dualview_t m_reports; Kokkos::DualView m_reporters; diff --git a/lib/kokkos/containers/src/Kokkos_Functional.hpp b/lib/kokkos/containers/src/Kokkos_Functional.hpp index d908458518..2e1fa336f7 100644 --- a/lib/kokkos/containers/src/Kokkos_Functional.hpp +++ b/lib/kokkos/containers/src/Kokkos_Functional.hpp @@ -52,10 +52,10 @@ namespace Kokkos { template struct pod_hash { - typedef T argument_type; - typedef T first_argument_type; - typedef uint32_t second_argument_type; - typedef uint32_t result_type; + using argument_type = T; + using first_argument_type = T; + using second_argument_type = uint32_t; + using result_type = uint32_t; KOKKOS_FORCEINLINE_FUNCTION uint32_t operator()(T const& t) const { @@ -70,9 +70,9 @@ struct pod_hash { template struct pod_equal_to { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { @@ -82,9 +82,9 @@ struct pod_equal_to { template struct pod_not_equal_to { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { @@ -94,9 +94,9 @@ struct pod_not_equal_to { template struct equal_to { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a == b; } @@ -104,9 +104,9 @@ struct equal_to { template struct not_equal_to { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a != b; } @@ -114,9 +114,9 @@ struct not_equal_to { template struct greater { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a > b; } @@ -124,9 +124,9 @@ struct greater { template struct less { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a < b; } @@ -134,9 +134,9 @@ struct less { template struct greater_equal { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a >= b; } @@ -144,9 +144,9 @@ struct greater_equal { template struct less_equal { - typedef T first_argument_type; - typedef T second_argument_type; - typedef bool result_type; + using first_argument_type = T; + using second_argument_type = T; + using result_type = bool; KOKKOS_FORCEINLINE_FUNCTION bool operator()(T const& a, T const& b) const { return a <= b; } diff --git a/lib/kokkos/containers/src/Kokkos_OffsetView.hpp b/lib/kokkos/containers/src/Kokkos_OffsetView.hpp index c3c66f0d7f..9233499bf4 100644 --- a/lib/kokkos/containers/src/Kokkos_OffsetView.hpp +++ b/lib/kokkos/containers/src/Kokkos_OffsetView.hpp @@ -51,10 +51,10 @@ namespace Impl { template struct GetOffsetViewTypeFromViewType { - typedef OffsetView< - typename ViewType::data_type, typename ViewType::array_layout, - typename ViewType::device_type, typename ViewType::memory_traits> - type; + using type = + OffsetView; }; template @@ -180,7 +180,7 @@ void runtime_check_rank_device(const size_t rank_dynamic, const size_t rank, template class OffsetView : public ViewTraits { public: - typedef ViewTraits traits; + using traits = ViewTraits; private: template @@ -190,12 +190,12 @@ class OffsetView : public ViewTraits { template friend class Kokkos::Impl::ViewMapping; - typedef Kokkos::Impl::ViewMapping map_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using map_type = Kokkos::Impl::ViewMapping; + using track_type = Kokkos::Impl::SharedAllocationTracker; public: enum { Rank = map_type::Rank }; - typedef Kokkos::Array begins_type; + using begins_type = Kokkos::Array; template < typename iType, @@ -223,28 +223,27 @@ class OffsetView : public ViewTraits { public: //---------------------------------------- /** \brief Compatible view of array of scalar types */ - typedef OffsetView< - typename traits::scalar_array_type, typename traits::array_layout, - typename traits::device_type, typename traits::memory_traits> - array_type; + using array_type = + OffsetView; /** \brief Compatible view of const data type */ - typedef OffsetView< - typename traits::const_data_type, typename traits::array_layout, - typename traits::device_type, typename traits::memory_traits> - const_type; + using const_type = + OffsetView; /** \brief Compatible view of non-const data type */ - typedef OffsetView< - typename traits::non_const_data_type, typename traits::array_layout, - typename traits::device_type, typename traits::memory_traits> - non_const_type; + using non_const_type = + OffsetView; /** \brief Compatible HostMirror view */ - typedef OffsetView - HostMirror; + using HostMirror = OffsetView; //---------------------------------------- // Domain rank and extents @@ -335,8 +334,8 @@ class OffsetView : public ViewTraits { //---------------------------------------- // Range span is the span which contains all members. - typedef typename map_type::reference_type reference_type; - typedef typename map_type::pointer_type pointer_type; + using reference_type = typename map_type::reference_type; + using pointer_type = typename map_type::pointer_type; enum { reference_type_is_lvalue_reference = @@ -347,6 +346,9 @@ class OffsetView : public ViewTraits { KOKKOS_INLINE_FUNCTION bool span_is_contiguous() const { return m_map.span_is_contiguous(); } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return m_map.data() != nullptr; + } KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { return m_map.data(); } @@ -841,10 +843,9 @@ class OffsetView : public ViewTraits { // interoperability with View private: - typedef View - view_type; + using view_type = + View; public: KOKKOS_INLINE_FUNCTION @@ -856,8 +857,8 @@ class OffsetView : public ViewTraits { template KOKKOS_INLINE_FUNCTION OffsetView(const View& aview) : m_track(aview.impl_track()), m_map() { - typedef typename OffsetView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping Mapping; + using SrcTraits = typename OffsetView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible OffsetView copy construction"); Mapping::assign(m_map, aview.impl_map(), m_track); @@ -871,8 +872,8 @@ class OffsetView : public ViewTraits { KOKKOS_INLINE_FUNCTION OffsetView(const View& aview, const index_list_type& minIndices) : m_track(aview.impl_track()), m_map() { - typedef typename OffsetView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping Mapping; + using SrcTraits = typename OffsetView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible OffsetView copy construction"); Mapping::assign(m_map, aview.impl_map(), m_track); @@ -894,8 +895,8 @@ class OffsetView : public ViewTraits { KOKKOS_INLINE_FUNCTION OffsetView(const View& aview, const begins_type& beg) : m_track(aview.impl_track()), m_map(), m_begins(beg) { - typedef typename OffsetView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping Mapping; + using SrcTraits = typename OffsetView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible OffsetView copy construction"); Mapping::assign(m_map, aview.impl_map(), m_track); @@ -917,8 +918,8 @@ class OffsetView : public ViewTraits { : m_track(rhs.m_track, traits::is_managed), m_map(), m_begins(rhs.m_begins) { - typedef typename OffsetView::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping Mapping; + using SrcTraits = typename OffsetView::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible OffsetView copy construction"); Mapping::assign(m_map, rhs.m_map, rhs.m_track); // swb what about assign? @@ -1215,11 +1216,11 @@ class OffsetView : public ViewTraits { for (size_t i = 0; i < Rank; ++i) m_begins[i] = minIndices.begin()[i]; // Append layout and spaces if not input - typedef Kokkos::Impl::ViewCtorProp alloc_prop_input; + using alloc_prop_input = Kokkos::Impl::ViewCtorProp; // use 'std::integral_constant' for non-types // to avoid duplicate class error. - typedef Kokkos::Impl::ViewCtorProp< + using alloc_prop = Kokkos::Impl::ViewCtorProp< P..., typename std::conditional, @@ -1231,19 +1232,13 @@ class OffsetView : public ViewTraits { typename std::conditional< alloc_prop_input::has_execution_space, std::integral_constant, - typename traits::device_type::execution_space>::type> - alloc_prop; + typename traits::device_type::execution_space>::type>; static_assert(traits::is_managed, "OffsetView allocation constructor requires managed memory"); if (alloc_prop::initialize && -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - !alloc_prop::execution_space::is_initialized() -#else - !alloc_prop::execution_space::impl_is_initialized() -#endif - ) { + !alloc_prop::execution_space::impl_is_initialized()) { // If initializing view data then // the execution space must be initialized. Kokkos::Impl::throw_runtime_exception( @@ -1764,8 +1759,8 @@ template KOKKOS_INLINE_FUNCTION bool operator==(const OffsetView& lhs, const OffsetView& rhs) { // Same data, layout, dimensions - typedef ViewTraits lhs_traits; - typedef ViewTraits rhs_traits; + using lhs_traits = ViewTraits; + using rhs_traits = ViewTraits; return std::is_same::value && @@ -1795,8 +1790,8 @@ template KOKKOS_INLINE_FUNCTION bool operator==(const View& lhs, const OffsetView& rhs) { // Same data, layout, dimensions - typedef ViewTraits lhs_traits; - typedef ViewTraits rhs_traits; + using lhs_traits = ViewTraits; + using rhs_traits = ViewTraits; return std::is_same::value && @@ -1825,10 +1820,10 @@ KOKKOS_INLINE_FUNCTION bool operator==(const OffsetView& lhs, //---------------------------------------------------------------------------- namespace Kokkos { -namespace Experimental { + template inline void deep_copy( - const OffsetView& dst, + const Experimental::OffsetView& dst, typename ViewTraits::const_value_type& value, typename std::enable_if::specialize, void>::value>::type* = @@ -1844,7 +1839,8 @@ inline void deep_copy( template inline void deep_copy( - const OffsetView& dst, const OffsetView& value, + const Experimental::OffsetView& dst, + const Experimental::OffsetView& value, typename std::enable_if::specialize, void>::value>::type* = nullptr) { @@ -1858,7 +1854,8 @@ inline void deep_copy( } template inline void deep_copy( - const OffsetView& dst, const View& value, + const Experimental::OffsetView& dst, + const View& value, typename std::enable_if::specialize, void>::value>::type* = nullptr) { @@ -1873,7 +1870,8 @@ inline void deep_copy( template inline void deep_copy( - const View& dst, const OffsetView& value, + const View& dst, + const Experimental::OffsetView& value, typename std::enable_if::specialize, void>::value>::type* = nullptr) { @@ -1884,53 +1882,54 @@ inline void deep_copy( Kokkos::deep_copy(dst, value.view()); } + namespace Impl { // Deduce Mirror Types template struct MirrorOffsetViewType { // The incoming view_type - typedef typename Kokkos::Experimental::OffsetView src_view_type; + using src_view_type = typename Kokkos::Experimental::OffsetView; // The memory space for the mirror view - typedef typename Space::memory_space memory_space; + using memory_space = typename Space::memory_space; // Check whether it is the same memory space enum { is_same_memspace = std::is_same::value }; // The array_layout - typedef typename src_view_type::array_layout array_layout; + using array_layout = typename src_view_type::array_layout; // The data type (we probably want it non-const since otherwise we can't even // deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; + using data_type = typename src_view_type::non_const_data_type; // The destination view type if it is not the same memory space - typedef Kokkos::Experimental::OffsetView - dest_view_type; + using dest_view_type = + Kokkos::Experimental::OffsetView; // If it is the same memory_space return the existsing view_type // This will also keep the unmanaged trait if necessary - typedef typename std::conditional::type view_type; + using view_type = typename std::conditional::type; }; template struct MirrorOffsetType { // The incoming view_type - typedef typename Kokkos::Experimental::OffsetView src_view_type; + using src_view_type = typename Kokkos::Experimental::OffsetView; // The memory space for the mirror view - typedef typename Space::memory_space memory_space; + using memory_space = typename Space::memory_space; // Check whether it is the same memory space enum { is_same_memspace = std::is_same::value }; // The array_layout - typedef typename src_view_type::array_layout array_layout; + using array_layout = typename src_view_type::array_layout; // The data type (we probably want it non-const since otherwise we can't even // deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; + using data_type = typename src_view_type::non_const_data_type; // The destination view type if it is not the same memory space - typedef Kokkos::Experimental::OffsetView - view_type; + using view_type = + Kokkos::Experimental::OffsetView; }; } // namespace Impl @@ -1942,8 +1941,8 @@ create_mirror( typename std::enable_if< !std::is_same::array_layout, Kokkos::LayoutStride>::value>::type* = 0) { - typedef OffsetView src_type; - typedef typename src_type::HostMirror dst_type; + using src_type = Experimental::OffsetView; + using dst_type = typename src_type::HostMirror; return dst_type( Kokkos::Impl::ViewCtorProp( @@ -1962,8 +1961,8 @@ create_mirror( typename std::enable_if< std::is_same::array_layout, Kokkos::LayoutStride>::value>::type* = 0) { - typedef OffsetView src_type; - typedef typename src_type::HostMirror dst_type; + using src_type = Experimental::OffsetView; + using dst_type = typename src_type::HostMirror; Kokkos::LayoutStride layout; @@ -1992,14 +1991,13 @@ create_mirror( // Create a mirror in a new space (specialization for different space) template -typename Kokkos::Experimental::Impl::MirrorOffsetType::view_type +typename Kokkos::Impl::MirrorOffsetType::view_type create_mirror(const Space&, const Kokkos::Experimental::OffsetView& src) { - return typename Kokkos::Experimental::Impl::MirrorOffsetType< - Space, T, P...>::view_type(src.label(), src.layout(), - {src.begin(0), src.begin(1), src.begin(2), - src.begin(3), src.begin(4), src.begin(5), - src.begin(6), src.begin(7)}); + return typename Kokkos::Impl::MirrorOffsetType::view_type( + src.label(), src.layout(), + {src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + src.begin(5), src.begin(6), src.begin(7)}); } template @@ -2031,13 +2029,12 @@ create_mirror_view( typename Kokkos::Experimental::OffsetView::data_type, typename Kokkos::Experimental::OffsetView< T, P...>::HostMirror::data_type>::value)>::type* = 0) { - return Kokkos::Experimental::create_mirror(src); + return Kokkos::create_mirror(src); } // Create a mirror view in a new space (specialization for same space) template -typename Kokkos::Experimental::Impl::MirrorOffsetViewType::view_type +typename Kokkos::Impl::MirrorOffsetViewType::view_type create_mirror_view(const Space&, const Kokkos::Experimental::OffsetView& src, typename std::enable_if -typename Kokkos::Experimental::Impl::MirrorOffsetViewType::view_type +typename Kokkos::Impl::MirrorOffsetViewType::view_type create_mirror_view(const Space&, const Kokkos::Experimental::OffsetView& src, typename std::enable_if::is_same_memspace>::type* = 0) { - return typename Kokkos::Experimental::Impl::MirrorOffsetViewType< - Space, T, P...>::view_type(src.label(), src.layout(), - {src.begin(0), src.begin(1), src.begin(2), - src.begin(3), src.begin(4), src.begin(5), - src.begin(6), src.begin(7)}); + return typename Kokkos::Impl::MirrorOffsetViewType::view_type( + src.label(), src.layout(), + {src.begin(0), src.begin(1), src.begin(2), src.begin(3), src.begin(4), + src.begin(5), src.begin(6), src.begin(7)}); } // // // Create a mirror view and deep_copy in a new space (specialization for @@ -2093,7 +2088,6 @@ create_mirror_view(const Space&, // return mirror; // } -} // namespace Experimental } /* namespace Kokkos */ //---------------------------------------------------------------------------- diff --git a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp index eb3bc1f2bc..3df0dfcd3b 100644 --- a/lib/kokkos/containers/src/Kokkos_ScatterView.hpp +++ b/lib/kokkos/containers/src/Kokkos_ScatterView.hpp @@ -62,16 +62,16 @@ namespace Experimental { * - These corresponds to subset of the reducers in parallel_reduce * - See Implementations of ScatterValue for details. */ -enum : int { - ScatterSum, - ScatterProd, - ScatterMax, - ScatterMin, -}; +struct ScatterSum {}; +struct ScatterProd {}; +struct ScatterMax {}; +struct ScatterMin {}; -enum : int { ScatterNonDuplicated = 0, ScatterDuplicated = 1 }; +struct ScatterNonDuplicated {}; +struct ScatterDuplicated {}; -enum : int { ScatterNonAtomic = 0, ScatterAtomic = 1 }; +struct ScatterNonAtomic {}; +struct ScatterAtomic {}; } // namespace Experimental } // namespace Kokkos @@ -83,159 +83,199 @@ namespace Experimental { template struct DefaultDuplication; -template +template struct DefaultContribution; #ifdef KOKKOS_ENABLE_SERIAL template <> struct DefaultDuplication { - enum : int { value = Kokkos::Experimental::ScatterNonDuplicated }; + using type = Kokkos::Experimental::ScatterNonDuplicated; }; + template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterNonAtomic }; + using type = Kokkos::Experimental::ScatterNonAtomic; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterNonAtomic }; + using type = Kokkos::Experimental::ScatterNonAtomic; }; #endif #ifdef KOKKOS_ENABLE_OPENMP template <> struct DefaultDuplication { - enum : int { value = Kokkos::Experimental::ScatterDuplicated }; + using type = Kokkos::Experimental::ScatterDuplicated; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterNonAtomic }; + using type = Kokkos::Experimental::ScatterNonAtomic; +}; +#endif + +#ifdef KOKKOS_ENABLE_OPENMPTARGET +template <> +struct DefaultDuplication { + using type = Kokkos::Experimental::ScatterNonDuplicated; +}; +template <> +struct DefaultContribution { + using type = Kokkos::Experimental::ScatterAtomic; +}; +template <> +struct DefaultContribution { + using type = Kokkos::Experimental::ScatterNonAtomic; }; #endif #ifdef KOKKOS_ENABLE_HPX template <> struct DefaultDuplication { - enum : int { value = Kokkos::Experimental::ScatterDuplicated }; + using type = Kokkos::Experimental::ScatterDuplicated; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterNonAtomic }; + using type = Kokkos::Experimental::ScatterNonAtomic; }; #endif #ifdef KOKKOS_ENABLE_THREADS template <> struct DefaultDuplication { - enum : int { value = Kokkos::Experimental::ScatterDuplicated }; + using type = Kokkos::Experimental::ScatterDuplicated; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterNonAtomic }; + using type = Kokkos::Experimental::ScatterNonAtomic; }; #endif #ifdef KOKKOS_ENABLE_CUDA template <> struct DefaultDuplication { - enum : int { value = Kokkos::Experimental::ScatterNonDuplicated }; + using type = Kokkos::Experimental::ScatterNonDuplicated; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; #endif #ifdef KOKKOS_ENABLE_HIP template <> struct DefaultDuplication { - enum : int { value = Kokkos::Experimental::ScatterNonDuplicated }; + using type = Kokkos::Experimental::ScatterNonDuplicated; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; template <> struct DefaultContribution { - enum : int { value = Kokkos::Experimental::ScatterAtomic }; + using type = Kokkos::Experimental::ScatterAtomic; }; #endif -/* ScatterValue is the object - returned by the access operator() of ScatterAccess, This class inherits from - the Sum<> reducer and it wraps join(dest, src) with convenient operator+=, - etc. Note the addition of update(ValueType const& rhs) and reset() so that - all reducers can have common functions See ReduceDuplicates and - ResetDuplicates ) */ -template +// FIXME All these scatter values need overhaul: +// - like should they be copyable at all? +// - what is the internal handle type +// - remove join +// - consistently use the update function in operators +template struct ScatterValue; +/* ScatterValue is + the object returned by the access operator() of ScatterAccess. This class + inherits from the Sum<> reducer and it wraps join(dest, src) with convenient + operator+=, etc. Note the addition of update(ValueType const& rhs) and + reset() so that all reducers can have common functions See ReduceDuplicates + and ResetDuplicates ) */ template struct ScatterValue - : Sum { + Kokkos::Experimental::ScatterNonAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Sum(value_in) {} + : value(value_in) {} KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) - : Sum(other.reference()) {} + : value(other.value) {} KOKKOS_FORCEINLINE_FUNCTION void operator+=(ValueType const& rhs) { - this->join(this->reference(), rhs); + update(rhs); } + KOKKOS_FORCEINLINE_FUNCTION void operator++() { update(1); } + KOKKOS_FORCEINLINE_FUNCTION void operator++(int) { update(1); } KOKKOS_FORCEINLINE_FUNCTION void operator-=(ValueType const& rhs) { - this->join(this->reference(), -rhs); + update(ValueType(-rhs)); } + KOKKOS_FORCEINLINE_FUNCTION void operator--() { update(ValueType(-1)); } + KOKKOS_FORCEINLINE_FUNCTION void operator--(int) { update(ValueType(-1)); } KOKKOS_FORCEINLINE_FUNCTION void update(ValueType const& rhs) { - this->join(this->reference(), rhs); + value += rhs; + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::sum(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; -/* ScatterValue is the object - returned by the access operator() - * of ScatterAccess, similar to that returned by an Atomic View, it wraps - Kokkos::atomic_add with convenient operator+=, etc. This version also has the - update(rhs) and reset() functions. */ +/* ScatterValue is the + object returned by the access operator() of ScatterAccess. This class inherits + from the Sum<> reducer, and similar to that returned by an Atomic View, it + wraps Kokkos::atomic_add with convenient operator+=, etc. This version also has + the update(rhs) and reset() functions. */ template struct ScatterValue - : Sum { + Kokkos::Experimental::ScatterAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Sum(value_in) {} + : value(value_in) {} KOKKOS_FORCEINLINE_FUNCTION void operator+=(ValueType const& rhs) { - this->join(this->reference(), rhs); + this->join(value, rhs); } + KOKKOS_FORCEINLINE_FUNCTION void operator++() { this->join(value, 1); } + KOKKOS_FORCEINLINE_FUNCTION void operator++(int) { this->join(value, 1); } KOKKOS_FORCEINLINE_FUNCTION void operator-=(ValueType const& rhs) { - this->join(this->reference(), -rhs); + this->join(value, ValueType(-rhs)); + } + KOKKOS_FORCEINLINE_FUNCTION void operator--() { + this->join(value, ValueType(-1)); + } + KOKKOS_FORCEINLINE_FUNCTION void operator--(int) { + this->join(value, ValueType(-1)); } KOKKOS_INLINE_FUNCTION @@ -249,58 +289,67 @@ struct ScatterValuejoin(this->reference(), rhs); + this->join(value, rhs); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::sum(); + } }; -/* ScatterValue is the object - returned by the access operator() of ScatterAccess, This class inherits from - the Prod<> reducer and it wraps join(dest, src) with convenient operator*=, - etc. Note the addition of update(ValueType const& rhs) and reset() so that - all reducers can have common functions See ReduceDuplicates and - ResetDuplicates ) */ +/* ScatterValue is + the object returned by the access operator() of ScatterAccess. This class + inherits from the Prod<> reducer, and it wraps join(dest, src) with + convenient operator*=, etc. Note the addition of update(ValueType const& rhs) + and reset() so that all reducers can have common functions See + ReduceDuplicates and ResetDuplicates ) */ template struct ScatterValue - : Prod { + Kokkos::Experimental::ScatterNonAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Prod(value_in) {} + : value(value_in) {} KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) - : Prod(other.reference()) {} + : value(other.value) {} KOKKOS_FORCEINLINE_FUNCTION void operator*=(ValueType const& rhs) { - this->join(this->reference(), rhs); + value *= rhs; } KOKKOS_FORCEINLINE_FUNCTION void operator/=(ValueType const& rhs) { - this->join(this->reference(), static_cast(1) / rhs); + value /= rhs; } + KOKKOS_FORCEINLINE_FUNCTION void update(ValueType const& rhs) { - this->join(this->reference(), rhs); + value *= rhs; + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::prod(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; -/* ScatterValue is the object - returned by the access operator() - * of ScatterAccess, similar to that returned by an Atomic View, it wraps and - atomic_prod with convenient operator*=, etc. atomic_prod uses the - atomic_compare_exchange. This version also has the update(rhs) and reset() - functions. */ +/* ScatterValue is the + object returned by the access operator() of ScatterAccess. This class + inherits from the Prod<> reducer, and similar to that returned by an Atomic + View, it wraps and atomic_prod with convenient operator*=, etc. atomic_prod + uses the atomic_compare_exchange. This version also has the update(rhs) + and reset() functions. */ template struct ScatterValue - : Prod { + Kokkos::Experimental::ScatterAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Prod(value_in) {} + : value(value_in) {} + KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) + : value(other.value) {} KOKKOS_FORCEINLINE_FUNCTION void operator*=(ValueType const& rhs) { - this->join(this->reference(), rhs); + Kokkos::atomic_mul(&value, rhs); } KOKKOS_FORCEINLINE_FUNCTION void operator/=(ValueType const& rhs) { - this->join(this->reference(), static_cast(1) / rhs); + Kokkos::atomic_div(&value, rhs); } KOKKOS_FORCEINLINE_FUNCTION @@ -317,53 +366,62 @@ struct ScatterValuejoin(this->reference(), rhs); + atomic_prod(&value, rhs); + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::prod(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; -/* ScatterValue is the object - returned by the access operator() of ScatterAccess, This class inherits from - the Min<> reducer and it wraps join(dest, src) with convenient update(rhs). - Note the addition of update(ValueType const& rhs) and reset() are so that all - reducers can have a common update function See ReduceDuplicates and - ResetDuplicates ) */ +/* ScatterValue is + the object returned by the access operator() of ScatterAccess. This class + inherits from the Min<> reducer and it wraps join(dest, src) with convenient + update(rhs). Note the addition of update(ValueType const& rhs) and reset() + are so that all reducers can have a common update function See + ReduceDuplicates and ResetDuplicates ) */ template struct ScatterValue - : Min { - public: + Kokkos::Experimental::ScatterNonAtomic> { + ValueType& value; KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Min(value_in) {} + : value(value_in) {} KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) - : Min(other.reference()) {} + : value(other.value) {} + + public: KOKKOS_FORCEINLINE_FUNCTION void update(ValueType const& rhs) { - this->join(this->reference(), rhs); + value = rhs < value ? rhs : value; + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::min(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; -/* ScatterValue is the object - returned by the access operator() - * of ScatterAccess, similar to that returned by an Atomic View, it wraps and - atomic_min with the update(rhs) function. atomic_min uses the - atomic_compare_exchange. This version also has the reset() function */ +/* ScatterValue is the + object returned by the access operator() of ScatterAccess. This class + inherits from the Min<> reducer, and similar to that returned by an Atomic + View, it wraps atomic_min with join(), etc. atomic_min uses the + atomic_compare_exchange. This version also has the update(rhs) and reset() + functions. */ template struct ScatterValue - : Min { + Kokkos::Experimental::ScatterAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Min(value_in) {} + : value(value_in) {} + KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) + : value(other.value) {} KOKKOS_FORCEINLINE_FUNCTION void atomic_min(ValueType& dest, const ValueType& src) const { @@ -388,44 +446,53 @@ struct ScatterValuejoin(this->reference(), rhs); + this->join(value, rhs); + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::min(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; -/* ScatterValue is the object - returned by the access operataor() of ScatterAccess, This class inherits from - the Max<> reducer and it wraps join(dest, src) with convenient update(rhs). - Note the addition of update(ValueType const& rhs) and reset() are so that all - reducers can have a common update function See ReduceDuplicates and - ResetDuplicates ) */ +/* ScatterValue is + the object returned by the access operator() of ScatterAccess. This class + inherits from the Max<> reducer and it wraps join(dest, src) with convenient + update(rhs). Note the addition of update(ValueType const& rhs) and reset() + are so that all reducers can have a common update function See + ReduceDuplicates and ResetDuplicates ) */ template struct ScatterValue - : Max { + Kokkos::Experimental::ScatterNonAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Max(value_in) {} + : value(value_in) {} KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) - : Max(other.reference()) {} + : value(other.value) {} KOKKOS_FORCEINLINE_FUNCTION void update(ValueType const& rhs) { - this->join(this->reference(), rhs); + value = rhs > value ? rhs : value; + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::max(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; -/* ScatterValue is the object - returned by the access operator() - * of ScatterAccess, similar to that returned by an Atomic View, it wraps and - atomic_max with the update(rhs) function. atomic_max uses the - atomic_compare_exchange. This version also has the reset() function */ +/* ScatterValue is the + object returned by the access operator() of ScatterAccess. This class + inherits from the Max<> reducer, and similar to that returned by an Atomic + View, it wraps atomic_max with join(), etc. atomic_max uses the + atomic_compare_exchange. This version also has the update(rhs) and reset() + functions. */ template struct ScatterValue - : Max { + Kokkos::Experimental::ScatterAtomic> { + ValueType& value; + public: KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ValueType& value_in) - : Max(value_in) {} + : value(value_in) {} + KOKKOS_FORCEINLINE_FUNCTION ScatterValue(ScatterValue&& other) + : value(other.value) {} KOKKOS_FORCEINLINE_FUNCTION void atomic_max(ValueType& dest, const ValueType& src) const { @@ -450,9 +517,11 @@ struct ScatterValuejoin(this->reference(), rhs); + this->join(value, rhs); + } + KOKKOS_FORCEINLINE_FUNCTION void reset() { + value = reduction_identity::max(); } - KOKKOS_FORCEINLINE_FUNCTION void reset() { this->init(this->reference()); } }; /* DuplicatedDataType, given a View DataType, will create a new DataType @@ -465,48 +534,48 @@ struct DuplicatedDataType; template struct DuplicatedDataType { - typedef T* value_type; // For LayoutRight, add a star all the way on the left + using value_type = T*; // For LayoutRight, add a star all the way on the left }; template struct DuplicatedDataType { - typedef typename DuplicatedDataType::value_type - value_type[N]; + using value_type = + typename DuplicatedDataType::value_type[N]; }; template struct DuplicatedDataType { - typedef typename DuplicatedDataType::value_type - value_type[]; + using value_type = + typename DuplicatedDataType::value_type[]; }; template struct DuplicatedDataType { - typedef typename DuplicatedDataType::value_type* - value_type; + using value_type = + typename DuplicatedDataType::value_type*; }; template struct DuplicatedDataType { - typedef T* value_type; + using value_type = T*; }; template struct DuplicatedDataType { - typedef typename DuplicatedDataType::value_type* - value_type; + using value_type = + typename DuplicatedDataType::value_type*; }; template struct DuplicatedDataType { - typedef typename DuplicatedDataType::value_type* - value_type; + using value_type = + typename DuplicatedDataType::value_type*; }; template struct DuplicatedDataType { - typedef typename DuplicatedDataType::value_type* - value_type; + using value_type = + typename DuplicatedDataType::value_type*; }; /* Insert integer argument pack into array */ @@ -526,8 +595,8 @@ void args_to_array(size_t* array, int pos, T dim0, Dims... dims) { subview where the index specified is the largest-stride one. */ template struct Slice { - typedef Slice next; - typedef typename next::value_type value_type; + using next = Slice; + using value_type = typename next::value_type; static value_type get(V const& src, const size_t i, Args... args) { return next::get(src, i, Kokkos::ALL, args...); @@ -536,9 +605,8 @@ struct Slice { template struct Slice { - typedef - typename Kokkos::Impl::ViewMapping::type - value_type; + using value_type = + typename Kokkos::Impl::ViewMapping::type; static value_type get(V const& src, const size_t i, Args... args) { return Kokkos::subview(src, i, args...); } @@ -546,20 +614,19 @@ struct Slice { template struct Slice { - typedef - typename Kokkos::Impl::ViewMapping::type - value_type; + using value_type = + typename Kokkos::Impl::ViewMapping::type; static value_type get(V const& src, const size_t i, Args... args) { return Kokkos::subview(src, args..., i); } }; -template +template struct ReduceDuplicates; -template +template struct ReduceDuplicatesBase { - typedef ReduceDuplicates Derived; + using Derived = ReduceDuplicates; ValueType const* src; ValueType* dst; size_t stride; @@ -569,35 +636,29 @@ struct ReduceDuplicatesBase { size_t stride_in, size_t start_in, size_t n_in, std::string const& name) : src(src_in), dst(dest_in), stride(stride_in), start(start_in), n(n_in) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginParallelFor(std::string("reduce_") + name, 0, &kpID); } -#else - (void)name; -#endif - typedef RangePolicy policy_type; - typedef Kokkos::Impl::ParallelFor closure_type; + using policy_type = RangePolicy; + using closure_type = Kokkos::Impl::ParallelFor; const closure_type closure(*(static_cast(this)), policy_type(0, stride)); closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelFor(kpID); } -#endif } }; /* ReduceDuplicates -- Perform reduction on destination array using strided * source Use ScatterValue<> specific to operation to wrap destination array so * that the reduction operation can be accessed via the update(rhs) function */ -template +template struct ReduceDuplicates : public ReduceDuplicatesBase { - typedef ReduceDuplicatesBase Base; + using Base = ReduceDuplicatesBase; ReduceDuplicates(ValueType const* src_in, ValueType* dst_in, size_t stride_in, size_t start_in, size_t n_in, std::string const& name) : Base(src_in, dst_in, stride_in, start_in, n_in, name) {} @@ -611,44 +672,38 @@ struct ReduceDuplicates } }; -template +template struct ResetDuplicates; -template +template struct ResetDuplicatesBase { - typedef ResetDuplicates Derived; + using Derived = ResetDuplicates; ValueType* data; ResetDuplicatesBase(ValueType* data_in, size_t size_in, std::string const& name) : data(data_in) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginParallelFor(std::string("reduce_") + name, 0, &kpID); } -#else - (void)name; -#endif - typedef RangePolicy policy_type; - typedef Kokkos::Impl::ParallelFor closure_type; + using policy_type = RangePolicy; + using closure_type = Kokkos::Impl::ParallelFor; const closure_type closure(*(static_cast(this)), policy_type(0, size_in)); closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelFor(kpID); } -#endif } }; /* ResetDuplicates -- Perform reset on destination array * Use ScatterValue<> specific to operation to wrap destination array so that * the reset operation can be accessed via the reset() function */ -template +template struct ResetDuplicates : public ResetDuplicatesBase { - typedef ResetDuplicatesBase Base; + using Base = ResetDuplicatesBase; ResetDuplicates(ValueType* data_in, size_t size_in, std::string const& name) : Base(data_in, size_in, name) {} KOKKOS_FORCEINLINE_FUNCTION void operator()(size_t i) const { @@ -667,37 +722,39 @@ namespace Kokkos { namespace Experimental { template ::value, - int contribution = Kokkos::Impl::Experimental::DefaultContribution< - typename DeviceType::execution_space, duplication>::value> + typename Layout = Kokkos::DefaultExecutionSpace::array_layout, + typename DeviceType = Kokkos::DefaultExecutionSpace, + typename Op = Kokkos::Experimental::ScatterSum, + typename Duplication = typename Kokkos::Impl::Experimental:: + DefaultDuplication::type, + typename Contribution = + typename Kokkos::Impl::Experimental::DefaultContribution< + typename DeviceType::execution_space, Duplication>::type> class ScatterView; -template +template class ScatterAccess; // non-duplicated implementation -template +template class ScatterView { + Contribution> { public: - using execution_space = typename DeviceType::execution_space; - using memory_space = typename DeviceType::memory_space; - using device_type = Kokkos::Device; - typedef Kokkos::View original_view_type; - typedef typename original_view_type::value_type original_value_type; - typedef typename original_view_type::reference_type original_reference_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using device_type = Kokkos::Device; + using original_view_type = Kokkos::View; + using original_value_type = typename original_view_type::value_type; + using original_reference_type = typename original_view_type::reference_type; friend class ScatterAccess; friend class ScatterAccess; - template + ScatterNonDuplicated, Contribution, ScatterAtomic>; + template friend class ScatterView; ScatterView() = default; @@ -713,30 +770,34 @@ class ScatterView KOKKOS_FUNCTION ScatterView( const ScatterView& other_view) + ScatterNonDuplicated, Contribution>& other_view) : internal_view(other_view.internal_view) {} template KOKKOS_FUNCTION void operator=( const ScatterView& other_view) { + ScatterNonDuplicated, Contribution>& other_view) { internal_view = other_view.internal_view; } - template + template KOKKOS_FORCEINLINE_FUNCTION ScatterAccess + Contribution, OverrideContribution> access() const { return ScatterAccess(*this); + Contribution, OverrideContribution>(*this); } original_view_type subview() const { return internal_view; } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return internal_view.is_allocated(); + } + template void contribute_into(View const& dest) const { - typedef View dest_type; + using dest_type = View; static_assert(std::is_same::value, "ScatterView contribute destination has different layout"); static_assert( @@ -778,22 +839,20 @@ class ScatterView +template class ScatterAccess { + Contribution, OverrideContribution> { public: - typedef ScatterView - view_type; - typedef typename view_type::original_value_type original_value_type; - typedef Kokkos::Impl::Experimental::ScatterValue< - original_value_type, Op, DeviceType, override_contribution> - value_type; + using view_type = ScatterView; + using original_value_type = typename view_type::original_value_type; + using value_type = Kokkos::Impl::Experimental::ScatterValue< + original_value_type, Op, DeviceType, OverrideContribution>; KOKKOS_INLINE_FUNCTION ScatterAccess() : view(view_type()) {} @@ -825,44 +884,45 @@ class ScatterAccess +template class ScatterView { + ScatterDuplicated, Contribution> { public: using execution_space = typename DeviceType::execution_space; using memory_space = typename DeviceType::memory_space; using device_type = Kokkos::Device; - typedef Kokkos::View - original_view_type; - typedef typename original_view_type::value_type original_value_type; - typedef typename original_view_type::reference_type original_reference_type; + using original_view_type = + Kokkos::View; + using original_value_type = typename original_view_type::value_type; + using original_reference_type = typename original_view_type::reference_type; friend class ScatterAccess; + ScatterDuplicated, Contribution, ScatterNonAtomic>; friend class ScatterAccess; - template + ScatterDuplicated, Contribution, ScatterAtomic>; + template friend class ScatterView; - typedef typename Kokkos::Impl::Experimental::DuplicatedDataType< - DataType, Kokkos::LayoutRight> - data_type_info; - typedef typename data_type_info::value_type internal_data_type; - typedef Kokkos::View - internal_view_type; + using data_type_info = + typename Kokkos::Impl::Experimental::DuplicatedDataType< + DataType, Kokkos::LayoutRight>; + using internal_data_type = typename data_type_info::value_type; + using internal_view_type = + Kokkos::View; ScatterView() = default; template KOKKOS_FUNCTION ScatterView( const ScatterView& other_view) + ScatterDuplicated, Contribution>& other_view) : unique_token(other_view.unique_token), internal_view(other_view.internal_view) {} template KOKKOS_FUNCTION void operator=( const ScatterView& other_view) { + ScatterDuplicated, Contribution>& other_view) { unique_token = other_view.unique_token; internal_view = other_view.internal_view; } @@ -870,38 +930,25 @@ class ScatterView ScatterView(View const& original_view) : unique_token(), - internal_view(Kokkos::ViewAllocateWithoutInitializing( - std::string("duplicated_") + original_view.label()), - unique_token.size(), -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - original_view.extent(0), original_view.extent(1), - original_view.extent(2), original_view.extent(3), - original_view.extent(4), original_view.extent(5), - original_view.extent(6)) -#else - original_view.rank_dynamic > 0 - ? original_view.extent(0) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - original_view.rank_dynamic > 1 - ? original_view.extent(1) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - original_view.rank_dynamic > 2 - ? original_view.extent(2) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - original_view.rank_dynamic > 3 - ? original_view.extent(3) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - original_view.rank_dynamic > 4 - ? original_view.extent(4) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - original_view.rank_dynamic > 5 - ? original_view.extent(5) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - original_view.rank_dynamic > 6 - ? original_view.extent(6) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG) + internal_view( + Kokkos::ViewAllocateWithoutInitializing(std::string("duplicated_") + + original_view.label()), + unique_token.size(), + original_view.rank_dynamic > 0 ? original_view.extent(0) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + original_view.rank_dynamic > 1 ? original_view.extent(1) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + original_view.rank_dynamic > 2 ? original_view.extent(2) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + original_view.rank_dynamic > 3 ? original_view.extent(3) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + original_view.rank_dynamic > 4 ? original_view.extent(4) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + original_view.rank_dynamic > 5 ? original_view.extent(5) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + original_view.rank_dynamic > 6 ? original_view.extent(6) + : KOKKOS_IMPL_CTOR_DEFAULT_ARG) -#endif { reset(); } @@ -913,14 +960,14 @@ class ScatterView + template KOKKOS_FORCEINLINE_FUNCTION ScatterAccess + ScatterDuplicated, Contribution, OverrideContribution> access() const { return ScatterAccess(*this); + ScatterDuplicated, Contribution, OverrideContribution>( + *this); } typename Kokkos::Impl::Experimental::Slice::get(internal_view, 0); } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return internal_view.is_allocated(); + } + template void contribute_into(View const& dest) const { - typedef View dest_type; + using dest_type = View; static_assert(std::is_same::value, "ScatterView deep_copy destination has different layout"); @@ -989,38 +1040,38 @@ class ScatterView - unique_token_type; + using unique_token_type = Kokkos::Experimental::UniqueToken< + execution_space, Kokkos::Experimental::UniqueTokenScope::Global>; unique_token_type unique_token; internal_view_type internal_view; }; -template +template class ScatterView { + ScatterDuplicated, Contribution> { public: using execution_space = typename DeviceType::execution_space; using memory_space = typename DeviceType::memory_space; using device_type = Kokkos::Device; - typedef Kokkos::View - original_view_type; - typedef typename original_view_type::value_type original_value_type; - typedef typename original_view_type::reference_type original_reference_type; + using original_view_type = + Kokkos::View; + using original_value_type = typename original_view_type::value_type; + using original_reference_type = typename original_view_type::reference_type; friend class ScatterAccess; + ScatterDuplicated, Contribution, ScatterNonAtomic>; friend class ScatterAccess; - template + ScatterDuplicated, Contribution, ScatterAtomic>; + template friend class ScatterView; - typedef typename Kokkos::Impl::Experimental::DuplicatedDataType< - DataType, Kokkos::LayoutLeft> - data_type_info; - typedef typename data_type_info::value_type internal_data_type; - typedef Kokkos::View - internal_view_type; + using data_type_info = + typename Kokkos::Impl::Experimental::DuplicatedDataType< + DataType, Kokkos::LayoutLeft>; + using internal_data_type = typename data_type_info::value_type; + using internal_view_type = + Kokkos::View; ScatterView() = default; @@ -1079,26 +1130,26 @@ class ScatterView KOKKOS_FUNCTION ScatterView( const ScatterView& other_view) + ScatterDuplicated, Contribution>& other_view) : unique_token(other_view.unique_token), internal_view(other_view.internal_view) {} template KOKKOS_FUNCTION void operator=( const ScatterView& other_view) { + ScatterDuplicated, Contribution>& other_view) { unique_token = other_view.unique_token; internal_view = other_view.internal_view; } - template + template KOKKOS_FORCEINLINE_FUNCTION ScatterAccess + ScatterDuplicated, Contribution, OverrideContribution> access() const { return ScatterAccess(*this); + ScatterDuplicated, Contribution, OverrideContribution>( + *this); } typename Kokkos::Impl::Experimental::Slice::get(internal_view, 0); } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return internal_view.is_allocated(); + } + template void contribute_into(View const& dest) const { - typedef View dest_type; + using dest_type = View; static_assert( std::is_same::value, @@ -1181,9 +1236,8 @@ class ScatterView - unique_token_type; + using unique_token_type = Kokkos::Experimental::UniqueToken< + execution_space, Kokkos::Experimental::UniqueTokenScope::Global>; unique_token_type unique_token; internal_view_type internal_view; @@ -1199,18 +1253,16 @@ class ScatterView +template class ScatterAccess { + Contribution, OverrideContribution> { public: - typedef ScatterView - view_type; - typedef typename view_type::original_value_type original_value_type; - typedef Kokkos::Impl::Experimental::ScatterValue< - original_value_type, Op, DeviceType, override_contribution> - value_type; + using view_type = ScatterView; + using original_value_type = typename view_type::original_value_type; + using value_type = Kokkos::Impl::Experimental::ScatterValue< + original_value_type, Op, DeviceType, OverrideContribution>; KOKKOS_FORCEINLINE_FUNCTION ScatterAccess(view_type const& view_in) @@ -1254,45 +1306,68 @@ class ScatterAccess +template ScatterView< RT, typename ViewTraits::array_layout, - typename ViewTraits::device_type, - Op - /* just setting defaults if not specified... things got messy because the - view type does not come before the duplication/contribution settings in - the template parameter list */ - , - duplication == -1 - ? Kokkos::Impl::Experimental::DefaultDuplication< - typename ViewTraits::execution_space>::value - : duplication, - contribution == -1 - ? Kokkos::Impl::Experimental::DefaultContribution< - typename ViewTraits::execution_space, - (duplication == -1 - ? Kokkos::Impl::Experimental::DefaultDuplication< - typename ViewTraits::execution_space>::value - : duplication)>::value - : contribution> + typename ViewTraits::device_type, Op, + typename Kokkos::Impl::if_c< + std::is_same::value, + typename Kokkos::Impl::Experimental::DefaultDuplication< + typename ViewTraits::execution_space>::type, + Duplication>::type, + typename Kokkos::Impl::if_c< + std::is_same::value, + typename Kokkos::Impl::Experimental::DefaultContribution< + typename ViewTraits::execution_space, + typename Kokkos::Impl::if_c< + std::is_same::value, + typename Kokkos::Impl::Experimental::DefaultDuplication< + typename ViewTraits::execution_space>::type, + Duplication>::type>::type, + Contribution>::type> create_scatter_view(View const& original_view) { return original_view; // implicit ScatterView constructor call } +template +ScatterView< + RT, typename ViewTraits::array_layout, + typename ViewTraits::device_type, Op, + typename Kokkos::Impl::Experimental::DefaultDuplication< + typename ViewTraits::execution_space>::type, + typename Kokkos::Impl::Experimental::DefaultContribution< + typename ViewTraits::execution_space, + typename Kokkos::Impl::Experimental::DefaultDuplication< + typename ViewTraits::execution_space>::type>::type> +create_scatter_view(Op, View const& original_view) { + return original_view; // implicit ScatterView constructor call +} + +template +ScatterView::array_layout, + typename ViewTraits::device_type, Op, Duplication, + Contribution> +create_scatter_view(Op, Duplication, Contribution, + View const& original_view) { + return original_view; // implicit ScatterView constructor call +} + } // namespace Experimental } // namespace Kokkos namespace Kokkos { namespace Experimental { -template +template void contribute( View& dest, Kokkos::Experimental::ScatterView const& src) { @@ -1304,16 +1379,16 @@ void contribute( namespace Kokkos { -template +template void realloc( Kokkos::Experimental::ScatterView& scatter_view, IS... is) { scatter_view.realloc(is...); } -template +template void resize( Kokkos::Experimental::ScatterView& scatter_view, IS... is) { diff --git a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp index c11413d627..81be3ee2d3 100644 --- a/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp +++ b/lib/kokkos/containers/src/Kokkos_StaticCrsGraph.hpp @@ -57,7 +57,7 @@ namespace Kokkos { namespace Impl { template struct StaticCrsGraphBalancerFunctor { - typedef typename RowOffsetsType::non_const_value_type int_type; + using int_type = typename RowOffsetsType::non_const_value_type; RowOffsetsType row_offsets; RowBlockOffsetsType row_block_offsets; @@ -148,7 +148,7 @@ struct StaticCrsGraphBalancerFunctor { /// /// Here is an example loop over the entries in the row: /// \code -/// typedef typename GraphRowViewConst::ordinal_type ordinal_type; +/// using ordinal_type = typename GraphRowViewConst::ordinal_type; /// /// GraphRowView G_i = ...; /// const ordinal_type numEntries = G_i.length; @@ -159,7 +159,7 @@ struct StaticCrsGraphBalancerFunctor { /// \endcode /// /// GraphType must provide the \c data_type -/// typedefs. In addition, it must make sense to use GraphRowViewConst to +/// aliases. In addition, it must make sense to use GraphRowViewConst to /// view a row of GraphType. In particular, column /// indices of a row must be accessible using the entries /// resp. colidx arrays given to the constructor of this @@ -170,7 +170,7 @@ struct StaticCrsGraphBalancerFunctor { template struct GraphRowViewConst { //! The type of the column indices in the row. - typedef const typename GraphType::data_type ordinal_type; + using ordinal_type = const typename GraphType::data_type; private: //! Array of (local) column indices in the row. @@ -279,49 +279,33 @@ struct GraphRowViewConst { ///
  • entries( row_map[i0] + i1 , i2 , i3 , ... );
  • /// template ::size_type, - class Arg3Type = void> -#else class Arg3Type = void, typename SizeType = typename ViewTraits::size_type> -#endif class StaticCrsGraph { private: - typedef ViewTraits traits; + using traits = ViewTraits; public: - typedef DataType data_type; - typedef typename traits::array_layout array_layout; - typedef typename traits::execution_space execution_space; - typedef typename traits::device_type device_type; - typedef typename traits::memory_traits memory_traits; - typedef SizeType size_type; + using data_type = DataType; + using array_layout = typename traits::array_layout; + using execution_space = typename traits::execution_space; + using device_type = typename traits::device_type; + using memory_traits = typename traits::memory_traits; + using size_type = SizeType; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - typedef StaticCrsGraph - staticcrsgraph_type; - typedef StaticCrsGraph - HostMirror; -#else - typedef StaticCrsGraph - staticcrsgraph_type; - typedef StaticCrsGraph - HostMirror; -#endif + using staticcrsgraph_type = + StaticCrsGraph; + using HostMirror = StaticCrsGraph; - typedef View - row_map_type; - typedef View - entries_type; - typedef View - row_block_type; + using row_map_type = + View; + using entries_type = + View; + using row_block_type = + View; entries_type entries; row_map_type row_map; @@ -370,6 +354,10 @@ class StaticCrsGraph { : static_cast(0); } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return (row_map.is_allocated() && entries.is_allocated()); + } + /// \brief Return a const view of row i of the graph. /// /// If row i does not belong to the graph, return an empty view. @@ -436,35 +424,19 @@ typename StaticCrsGraphType::staticcrsgraph_type create_staticcrsgraph( //---------------------------------------------------------------------------- -template -typename StaticCrsGraph::HostMirror -create_mirror_view(const StaticCrsGraph& input); -#else - class Arg3Type, typename SizeType> +template typename StaticCrsGraph::HostMirror create_mirror_view(const StaticCrsGraph& input); -#endif -template -typename StaticCrsGraph::HostMirror -create_mirror_view(const StaticCrsGraph& input); -#else - class Arg3Type, typename SizeType> +template typename StaticCrsGraph::HostMirror create_mirror(const StaticCrsGraph& input); -#endif } // namespace Kokkos @@ -481,8 +453,8 @@ namespace Impl { template struct StaticCrsGraphMaximumEntry { - typedef typename GraphType::execution_space execution_space; - typedef typename GraphType::data_type value_type; + using execution_space = typename GraphType::execution_space; + using value_type = typename GraphType::data_type; const typename GraphType::entries_type entries; @@ -505,22 +477,13 @@ struct StaticCrsGraphMaximumEntry { } // namespace Impl -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -template -DataType maximum_entry(const StaticCrsGraph& graph) { - typedef StaticCrsGraph - GraphType; -#else template DataType maximum_entry(const StaticCrsGraph& graph) { - typedef StaticCrsGraph - GraphType; -#endif - typedef Impl::StaticCrsGraphMaximumEntry FunctorType; + using GraphType = + StaticCrsGraph; + using FunctorType = Impl::StaticCrsGraphMaximumEntry; DataType result = 0; Kokkos::parallel_reduce("Kokkos::maximum_entry", graph.entries.extent(0), diff --git a/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp b/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp index 6f0434dd04..e4e9b28914 100644 --- a/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp +++ b/lib/kokkos/containers/src/Kokkos_UnorderedMap.hpp @@ -66,7 +66,7 @@ namespace Kokkos { -enum { UnorderedMapInvalidIndex = ~0u }; +enum : unsigned { UnorderedMapInvalidIndex = ~0u }; /// \brief First element of the return value of UnorderedMap::insert(). /// @@ -84,7 +84,7 @@ enum { UnorderedMapInvalidIndex = ~0u }; class UnorderedMapInsertResult { private: - enum Status { + enum Status : uint32_t { SUCCESS = 1u << 31, EXISTING = 1u << 30, FREED_EXISTING = 1u << 29, @@ -206,42 +206,40 @@ template ::type> > class UnorderedMap { private: - typedef typename ViewTraits::host_mirror_space - host_mirror_space; + using host_mirror_space = + typename ViewTraits::host_mirror_space; public: //! \name Public types and constants //@{ // key_types - typedef Key declared_key_type; - typedef typename std::remove_const::type key_type; - typedef typename std::add_const::type const_key_type; + using declared_key_type = Key; + using key_type = typename std::remove_const::type; + using const_key_type = typename std::add_const::type; // value_types - typedef Value declared_value_type; - typedef typename std::remove_const::type value_type; - typedef typename std::add_const::type const_value_type; + using declared_value_type = Value; + using value_type = typename std::remove_const::type; + using const_value_type = typename std::add_const::type; - typedef Device device_type; - typedef typename Device::execution_space execution_space; - typedef Hasher hasher_type; - typedef EqualTo equal_to_type; - typedef uint32_t size_type; + using device_type = Device; + using execution_space = typename Device::execution_space; + using hasher_type = Hasher; + using equal_to_type = EqualTo; + using size_type = uint32_t; // map_types - typedef UnorderedMap - declared_map_type; - typedef UnorderedMap - insertable_map_type; - typedef UnorderedMap - modifiable_map_type; - typedef UnorderedMap - const_map_type; + using declared_map_type = + UnorderedMap; + using insertable_map_type = UnorderedMap; + using modifiable_map_type = + UnorderedMap; + using const_map_type = UnorderedMap; static const bool is_set = std::is_same::value; static const bool has_const_key = @@ -254,43 +252,42 @@ class UnorderedMap { static const bool is_modifiable_map = has_const_key && !has_const_value; static const bool is_const_map = has_const_key && has_const_value; - typedef UnorderedMapInsertResult insert_result; + using insert_result = UnorderedMapInsertResult; - typedef UnorderedMap - HostMirror; + using HostMirror = + UnorderedMap; - typedef Impl::UnorderedMapHistogram histogram_type; + using histogram_type = Impl::UnorderedMapHistogram; //@} private: - enum { invalid_index = ~static_cast(0) }; + enum : size_type { invalid_index = ~static_cast(0) }; - typedef typename Impl::if_c::type - impl_value_type; + using impl_value_type = + typename Impl::if_c::type; - typedef typename Impl::if_c< + using key_type_view = typename Impl::if_c< is_insertable_map, View, - View > >::type - key_type_view; + View > >::type; - typedef typename Impl::if_c, - View > >::type - value_type_view; + using value_type_view = + typename Impl::if_c, + View > >::type; - typedef typename Impl::if_c< + using size_type_view = typename Impl::if_c< is_insertable_map, View, - View > >::type - size_type_view; + View > >::type; - typedef typename Impl::if_c, - ConstBitset >::type bitset_type; + using bitset_type = + typename Impl::if_c, + ConstBitset >::type; enum { modified_idx = 0, erasable_idx = 1, failed_insert_idx = 2 }; enum { num_scalars = 3 }; - typedef View scalars_view; + using scalars_view = View; public: //! \name Public member functions @@ -353,6 +350,11 @@ class UnorderedMap { { Kokkos::deep_copy(m_scalars, 0); } } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return (m_keys.is_allocated() && m_values.is_allocated() && + m_scalars.is_allocated()); + } + /// \brief Change the capacity of the the map /// /// If there are no failed inserts the current size of the map will @@ -742,9 +744,9 @@ class UnorderedMap { Kokkos::deep_copy(tmp.m_available_indexes, src.m_available_indexes); - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; raw_deep_copy(tmp.m_hash_lists.data(), src.m_hash_lists.data(), sizeof(size_type) * src.m_hash_lists.extent(0)); @@ -768,25 +770,25 @@ class UnorderedMap { bool modified() const { return get_flag(modified_idx); } void set_flag(int flag) const { - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; const int true_ = true; raw_deep_copy(m_scalars.data() + flag, &true_, sizeof(int)); } void reset_flag(int flag) const { - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; const int false_ = false; raw_deep_copy(m_scalars.data() + flag, &false_, sizeof(int)); } bool get_flag(int flag) const { - typedef Kokkos::Impl::DeepCopy - raw_deep_copy; + using raw_deep_copy = + Kokkos::Impl::DeepCopy; int result = false; raw_deep_copy(&result, m_scalars.data() + flag, sizeof(int)); return result; diff --git a/lib/kokkos/containers/src/Kokkos_Vector.hpp b/lib/kokkos/containers/src/Kokkos_Vector.hpp index 02c3e44fc4..a1fbba6b21 100644 --- a/lib/kokkos/containers/src/Kokkos_Vector.hpp +++ b/lib/kokkos/containers/src/Kokkos_Vector.hpp @@ -58,19 +58,19 @@ namespace Kokkos { template class vector : public DualView { public: - typedef Scalar value_type; - typedef Scalar* pointer; - typedef const Scalar* const_pointer; - typedef Scalar& reference; - typedef const Scalar& const_reference; - typedef Scalar* iterator; - typedef const Scalar* const_iterator; - typedef size_t size_type; + using value_type = Scalar; + using pointer = Scalar*; + using const_pointer = const Scalar*; + using reference = Scalar&; + using const_reference = const Scalar&; + using iterator = Scalar*; + using const_iterator = const Scalar*; + using size_type = size_t; private: size_t _size; float _extra_storage; - typedef DualView DV; + using DV = DualView; public: #ifdef KOKKOS_ENABLE_CUDA_UVM @@ -212,14 +212,17 @@ class vector : public DualView { return begin() + start; } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return DV::is_allocated(); + } + size_type size() const { return _size; } size_type max_size() const { return 2000000000; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - size_type capacity() const { return DV::capacity(); } -#endif size_type span() const { return DV::span(); } bool empty() const { return _size == 0; } + pointer data() const { return DV::h_view.data(); } + iterator begin() const { return DV::h_view.data(); } iterator end() const { @@ -310,7 +313,7 @@ class vector : public DualView { public: struct set_functor { - typedef typename DV::t_dev::execution_space execution_space; + using execution_space = typename DV::t_dev::execution_space; typename DV::t_dev _data; Scalar _val; @@ -321,7 +324,7 @@ class vector : public DualView { }; struct set_functor_host { - typedef typename DV::t_host::execution_space execution_space; + using execution_space = typename DV::t_host::execution_space; typename DV::t_host _data; Scalar _val; diff --git a/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp index 6fd4319a82..6e450598d1 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Bitset_impl.hpp @@ -65,11 +65,11 @@ unsigned rotate_right(unsigned i, int r) { template struct BitsetCount { - typedef Bitset bitset_type; - typedef - typename bitset_type::execution_space::execution_space execution_space; - typedef typename bitset_type::size_type size_type; - typedef size_type value_type; + using bitset_type = Bitset; + using execution_space = + typename bitset_type::execution_space::execution_space; + using size_type = typename bitset_type::size_type; + using value_type = size_type; bitset_type m_bitset; diff --git a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp index 6ba67766aa..367ab33857 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_Functional_impl.hpp @@ -140,10 +140,10 @@ uint32_t MurmurHash3_x86_32(const void* key, int len, uint32_t seed) { template KOKKOS_FORCEINLINE_FUNCTION bool bitwise_equal(T const* const a_ptr, T const* const b_ptr) { - typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; - typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; - typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; - typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; // NOLINT(modernize-use-using) + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; // NOLINT(modernize-use-using) + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; // NOLINT(modernize-use-using) + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; // NOLINT(modernize-use-using) enum { NUM_8 = sizeof(T), diff --git a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp index a5fb9990f6..f22e5d1eca 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_StaticCrsGraph_factory.hpp @@ -50,19 +50,6 @@ namespace Kokkos { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -template -inline typename StaticCrsGraph::HostMirror -create_mirror_view( - const StaticCrsGraph& - view, - typename std::enable_if::is_hostspace>::type* = 0) { - return view; -} -#else template inline typename StaticCrsGraph::is_hostspace>::type* = 0) { return view; } -#endif -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -template -inline typename StaticCrsGraph::HostMirror -create_mirror(const StaticCrsGraph& view) { - // Force copy: - // typedef Impl::ViewAssignment< Impl::ViewDefault > alloc ; // unused - typedef StaticCrsGraph - staticcrsgraph_type; -#else template inline typename StaticCrsGraph& view) { // Force copy: - // typedef Impl::ViewAssignment< Impl::ViewDefault > alloc ; // unused - typedef StaticCrsGraph - staticcrsgraph_type; -#endif + // using alloc = Impl::ViewAssignment; // unused + using staticcrsgraph_type = + StaticCrsGraph; typename staticcrsgraph_type::HostMirror tmp; typename staticcrsgraph_type::row_map_type::HostMirror tmp_row_map = @@ -120,17 +93,6 @@ create_mirror(const StaticCrsGraph -inline typename StaticCrsGraph::HostMirror -create_mirror_view( - const StaticCrsGraph& - view, - typename std::enable_if::is_hostspace>::type* = 0) -#else template inline typename StaticCrsGraph& view, typename std::enable_if::is_hostspace>::type* = 0) -#endif -{ + Arg3Type>::is_hostspace>::type* = 0) { return create_mirror(view); } } // namespace Kokkos @@ -154,16 +114,15 @@ namespace Kokkos { template inline typename StaticCrsGraphType::staticcrsgraph_type create_staticcrsgraph( const std::string& label, const std::vector& input) { - typedef StaticCrsGraphType output_type; - // typedef std::vector< InputSizeType > input_type ; // unused + using output_type = StaticCrsGraphType; + // using input_type = std::vector; // unused - typedef typename output_type::entries_type entries_type; + using entries_type = typename output_type::entries_type; - typedef View - work_type; + using work_type = View; output_type output; @@ -197,16 +156,15 @@ template inline typename StaticCrsGraphType::staticcrsgraph_type create_staticcrsgraph( const std::string& label, const std::vector >& input) { - typedef StaticCrsGraphType output_type; - typedef typename output_type::entries_type entries_type; + using output_type = StaticCrsGraphType; + using entries_type = typename output_type::entries_type; static_assert(entries_type::rank == 1, "Graph entries view must be rank one"); - typedef View - work_type; + using work_type = View; output_type output; diff --git a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp index 813936575c..b06ab0846c 100644 --- a/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp +++ b/lib/kokkos/containers/src/impl/Kokkos_UnorderedMap_impl.hpp @@ -60,10 +60,10 @@ uint32_t find_hash_size(uint32_t size); template struct UnorderedMapRehash { - typedef Map map_type; - typedef typename map_type::const_map_type const_map_type; - typedef typename map_type::execution_space execution_space; - typedef typename map_type::size_type size_type; + using map_type = Map; + using const_map_type = typename map_type::const_map_type; + using execution_space = typename map_type::execution_space; + using size_type = typename map_type::size_type; map_type m_dst; const_map_type m_src; @@ -84,11 +84,11 @@ struct UnorderedMapRehash { template struct UnorderedMapErase { - typedef UMap map_type; - typedef typename map_type::execution_space execution_space; - typedef typename map_type::size_type size_type; - typedef typename map_type::key_type key_type; - typedef typename map_type::impl_value_type value_type; + using map_type = UMap; + using execution_space = typename map_type::execution_space; + using size_type = typename map_type::size_type; + using key_type = typename map_type::key_type; + using value_type = typename map_type::impl_value_type; map_type m_map; @@ -140,12 +140,12 @@ struct UnorderedMapErase { template struct UnorderedMapHistogram { - typedef UMap map_type; - typedef typename map_type::execution_space execution_space; - typedef typename map_type::size_type size_type; + using map_type = UMap; + using execution_space = typename map_type::execution_space; + using size_type = typename map_type::size_type; - typedef View histogram_view; - typedef typename histogram_view::HostMirror host_histogram_view; + using histogram_view = View; + using host_histogram_view = typename histogram_view::HostMirror; map_type m_map; histogram_view m_length; @@ -230,9 +230,9 @@ struct UnorderedMapHistogram { template struct UnorderedMapPrint { - typedef UMap map_type; - typedef typename map_type::execution_space execution_space; - typedef typename map_type::size_type size_type; + using map_type = UMap; + using execution_space = typename map_type::execution_space; + using size_type = typename map_type::size_type; map_type m_map; diff --git a/lib/kokkos/containers/unit_tests/TestBitset.hpp b/lib/kokkos/containers/unit_tests/TestBitset.hpp index 661a1365cb..6810ae101a 100644 --- a/lib/kokkos/containers/unit_tests/TestBitset.hpp +++ b/lib/kokkos/containers/unit_tests/TestBitset.hpp @@ -47,6 +47,7 @@ #include #include #include +#include namespace Test { @@ -54,9 +55,9 @@ namespace Impl { template struct TestBitset { - typedef Bitset bitset_type; - typedef typename bitset_type::execution_space execution_space; - typedef uint32_t value_type; + using bitset_type = Bitset; + using execution_space = typename bitset_type::execution_space; + using value_type = uint32_t; bitset_type m_bitset; @@ -95,9 +96,9 @@ struct TestBitset { template struct TestBitsetTest { - typedef Bitset bitset_type; - typedef typename bitset_type::execution_space execution_space; - typedef uint32_t value_type; + using bitset_type = Bitset; + using execution_space = typename bitset_type::execution_space; + using value_type = uint32_t; bitset_type m_bitset; @@ -127,9 +128,9 @@ struct TestBitsetTest { template struct TestBitsetAny { - typedef Bitset bitset_type; - typedef typename bitset_type::execution_space execution_space; - typedef uint32_t value_type; + using bitset_type = Bitset; + using execution_space = typename bitset_type::execution_space; + using value_type = uint32_t; bitset_type m_bitset; @@ -181,16 +182,30 @@ struct TestBitsetAny { template void test_bitset() { - typedef Kokkos::Bitset bitset_type; - typedef Kokkos::ConstBitset const_bitset_type; + using bitset_type = Kokkos::Bitset; + using const_bitset_type = Kokkos::ConstBitset; - // unsigned test_sizes[] = { 0u, 1000u, 1u<<14, 1u<<16, 10000001 }; - unsigned test_sizes[] = {1000u, 1u << 14, 1u << 16, 10000001}; + { + unsigned ts = 100u; + bitset_type b1; + ASSERT_TRUE(b1.is_allocated()); - for (int i = 0, end = sizeof(test_sizes) / sizeof(unsigned); i < end; ++i) { + b1 = bitset_type(ts); + bitset_type b2(b1); + bitset_type b3(ts); + + ASSERT_TRUE(b1.is_allocated()); + ASSERT_TRUE(b2.is_allocated()); + ASSERT_TRUE(b3.is_allocated()); + } + + std::array test_sizes = { + {0u, 10u, 100u, 1000u, 1u << 14, 1u << 16, 10000001}}; + + for (const auto test_size : test_sizes) { // std::cout << "Bitset " << test_sizes[i] << std::endl; - bitset_type bitset(test_sizes[i]); + bitset_type bitset(test_size); // std::cout << " Check initial count " << std::endl; // nothing should be set @@ -253,10 +268,7 @@ void test_bitset() { } } -// FIXME_HIP deadlock -#ifndef KOKKOS_ENABLE_HIP TEST(TEST_CATEGORY, bitset) { test_bitset(); } -#endif } // namespace Test #endif // KOKKOS_TEST_BITSET_HPP diff --git a/lib/kokkos/containers/unit_tests/TestDualView.hpp b/lib/kokkos/containers/unit_tests/TestDualView.hpp index 665f251158..ae5b746f94 100644 --- a/lib/kokkos/containers/unit_tests/TestDualView.hpp +++ b/lib/kokkos/containers/unit_tests/TestDualView.hpp @@ -55,13 +55,45 @@ namespace Test { namespace Impl { +template +struct test_dualview_alloc { + using scalar_type = Scalar; + using execution_space = Device; + + template + bool run_me(unsigned int n, unsigned int m) { + if (n < 10) n = 10; + if (m < 3) m = 3; + + { + ViewType b1; + if (b1.is_allocated() == true) return false; + + b1 = ViewType("B1", n, m); + ViewType b2(b1); + ViewType b3("B3", n, m); + + if (b1.is_allocated() == false) return false; + if (b2.is_allocated() == false) return false; + if (b3.is_allocated() == false) return false; + } + return true; + } + + bool result = false; + + test_dualview_alloc(unsigned int size) { + result = run_me >( + size, 3); + } +}; template struct test_dualview_combinations { - typedef test_dualview_combinations self_type; + using self_type = test_dualview_combinations; - typedef Scalar scalar_type; - typedef Device execution_space; + using scalar_type = Scalar; + using execution_space = Device; Scalar reference; Scalar result; @@ -110,7 +142,7 @@ struct test_dualview_combinations { template struct SumViewEntriesFunctor { - typedef Scalar value_type; + using value_type = Scalar; ViewType fv; @@ -126,8 +158,8 @@ struct SumViewEntriesFunctor { template struct test_dual_view_deep_copy { - typedef Scalar scalar_type; - typedef Device execution_space; + using scalar_type = Scalar; + using execution_space = Device; template void run_me(int n, const int m, const bool use_templ_sync) { @@ -153,8 +185,8 @@ struct test_dual_view_deep_copy { // Check device view is initialized as expected scalar_type a_d_sum = 0; // Execute on the execution_space associated with t_dev's memory space - typedef typename ViewType::t_dev::memory_space::execution_space - t_dev_exec_space; + using t_dev_exec_space = + typename ViewType::t_dev::memory_space::execution_space; Kokkos::parallel_reduce( Kokkos::RangePolicy(0, n), SumViewEntriesFunctor(a.d_view), @@ -220,8 +252,8 @@ struct test_dual_view_deep_copy { template struct test_dualview_resize { - typedef Scalar scalar_type; - typedef Device execution_space; + using scalar_type = Scalar; + using execution_space = Device; template void run_me() { @@ -244,8 +276,8 @@ struct test_dualview_resize { // Check device view is initialized as expected scalar_type a_d_sum = 0; // Execute on the execution_space associated with t_dev's memory space - typedef typename ViewType::t_dev::memory_space::execution_space - t_dev_exec_space; + using t_dev_exec_space = + typename ViewType::t_dev::memory_space::execution_space; Kokkos::parallel_reduce( Kokkos::RangePolicy(0, a.d_view.extent(0)), SumViewEntriesFunctor(a.d_view), @@ -274,8 +306,8 @@ struct test_dualview_resize { // Check device view is initialized as expected a_d_sum = 0; // Execute on the execution_space associated with t_dev's memory space - typedef typename ViewType::t_dev::memory_space::execution_space - t_dev_exec_space; + using t_dev_exec_space = + typename ViewType::t_dev::memory_space::execution_space; Kokkos::parallel_reduce( Kokkos::RangePolicy(0, a.d_view.extent(0)), SumViewEntriesFunctor(a.d_view), @@ -301,8 +333,8 @@ struct test_dualview_resize { template struct test_dualview_realloc { - typedef Scalar scalar_type; - typedef Device execution_space; + using scalar_type = Scalar; + using execution_space = Device; template void run_me() { @@ -319,8 +351,8 @@ struct test_dualview_realloc { // Check device view is initialized as expected scalar_type a_d_sum = 0; // Execute on the execution_space associated with t_dev's memory space - typedef typename ViewType::t_dev::memory_space::execution_space - t_dev_exec_space; + using t_dev_exec_space = + typename ViewType::t_dev::memory_space::execution_space; Kokkos::parallel_reduce( Kokkos::RangePolicy(0, a.d_view.extent(0)), SumViewEntriesFunctor(a.d_view), @@ -351,6 +383,12 @@ void test_dualview_combinations(unsigned int size, bool with_init) { ASSERT_EQ(test.result, 0); } +template +void test_dualview_alloc(unsigned int size) { + Impl::test_dualview_alloc test(size); + ASSERT_TRUE(test.result); +} + template void test_dualview_deep_copy() { Impl::test_dual_view_deep_copy(); @@ -370,6 +408,10 @@ TEST(TEST_CATEGORY, dualview_combination) { test_dualview_combinations(10, true); } +TEST(TEST_CATEGORY, dualview_alloc) { + test_dualview_alloc(10); +} + TEST(TEST_CATEGORY, dualview_combinations_without_init) { test_dualview_combinations(10, false); } diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp index 5c1d0229cb..97155d3047 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI.hpp @@ -68,12 +68,12 @@ size_t allocation_count(const Kokkos::DynRankView& view) { template struct TestViewOperator { - typedef DeviceType execution_space; + using execution_space = DeviceType; static const unsigned N = 100; static const unsigned D = 3; - typedef Kokkos::DynRankView view_type; + using view_type = Kokkos::DynRankView; const view_type v1; const view_type v2; @@ -101,11 +101,11 @@ struct TestViewOperator_LeftAndRight; template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -116,11 +116,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -186,11 +186,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -201,11 +201,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -268,11 +268,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -283,14 +283,14 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - stride_view; + using stride_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -363,11 +363,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -378,11 +378,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -438,11 +438,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -453,14 +453,14 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - stride_view; + using stride_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -536,11 +536,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -551,11 +551,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -616,11 +616,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef DeviceType execution_space; - typedef typename execution_space::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using memory_space = typename execution_space::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -631,14 +631,14 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::DynRankView - left_view; + using left_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - right_view; + using right_view = + Kokkos::DynRankView; - typedef Kokkos::DynRankView - stride_view; + using stride_view = + Kokkos::DynRankView; left_view left; right_view right; @@ -689,22 +689,22 @@ struct TestViewOperator_LeftAndRight { template class TestDynViewAPI { public: - typedef DeviceType device; + using device = DeviceType; enum { N0 = 1000, N1 = 3, N2 = 5, N3 = 7 }; - typedef Kokkos::DynRankView dView0; - typedef Kokkos::DynRankView const_dView0; + using dView0 = Kokkos::DynRankView; + using const_dView0 = Kokkos::DynRankView; - typedef Kokkos::DynRankView - dView0_unmanaged; - typedef typename dView0::host_mirror_space host_drv_space; + using dView0_unmanaged = + Kokkos::DynRankView; + using host_drv_space = typename dView0::host_mirror_space; - typedef Kokkos::View View0; - typedef Kokkos::View View1; - typedef Kokkos::View View7; + using View0 = Kokkos::View; + using View1 = Kokkos::View; + using View7 = Kokkos::View; - typedef typename View0::host_mirror_space host_view_space; + using host_view_space = typename View0::host_mirror_space; static void run_tests() { run_test_resize_realloc(); @@ -712,6 +712,7 @@ class TestDynViewAPI { run_test_mirror_and_copy(); run_test_scalar(); run_test(); + run_test_allocated(); run_test_const(); run_test_subview(); run_test_subview_strided(); @@ -750,8 +751,8 @@ class TestDynViewAPI { } static void run_test_mirror() { - typedef Kokkos::DynRankView view_type; - typedef typename view_type::HostMirror mirror_type; + using view_type = Kokkos::DynRankView; + using mirror_type = typename view_type::HostMirror; view_type a("a"); mirror_type am = Kokkos::create_mirror_view(a); mirror_type ax = Kokkos::create_mirror(a); @@ -851,8 +852,8 @@ class TestDynViewAPI { ASSERT_EQ(a_h.rank(), a_d.rank()); } { - typedef Kokkos::DynRankView - view_stride_type; + using view_stride_type = + Kokkos::DynRankView; unsigned order[] = {6, 5, 4, 3, 2, 1, 0}, dimen[] = {N0, N1, N2, 2, 2, 2, 2}; // LayoutRight equivalent view_stride_type a_h( @@ -956,8 +957,8 @@ class TestDynViewAPI { } static void run_test_scalar() { - typedef typename dView0::HostMirror - hView0; // HostMirror of DynRankView is a DynRankView + using hView0 = typename dView0::HostMirror; // HostMirror of DynRankView is + // a DynRankView dView0 dx, dy; hView0 hx, hy; @@ -1050,12 +1051,12 @@ class TestDynViewAPI { static void run_test() { // mfh 14 Feb 2014: This test doesn't actually create instances of - // these types. In order to avoid "declared but unused typedef" + // these types. In order to avoid "unused type alias" // warnings, we declare empty instances of these types, with the // usual "(void)" marker to avoid compiler warnings for unused // variables. - typedef typename dView0::HostMirror hView0; + using hView0 = typename dView0::HostMirror; { hView0 thing; @@ -1361,7 +1362,7 @@ class TestDynViewAPI { } } - typedef T DataType; + using DataType = T; static void check_auto_conversion_to_const( const Kokkos::DynRankView& arg_const, @@ -1369,12 +1370,28 @@ class TestDynViewAPI { ASSERT_TRUE(arg_const == arg); } + static void run_test_allocated() { + using device_type = Kokkos::DynRankView; + + const int N1 = 100; + const int N2 = 10; + + device_type d1; + ASSERT_FALSE(d1.is_allocated()); + + d1 = device_type("d1", N1, N2); + device_type d2(d1); + device_type d3("d3", N1); + ASSERT_TRUE(d1.is_allocated()); + ASSERT_TRUE(d2.is_allocated()); + ASSERT_TRUE(d3.is_allocated()); + } + static void run_test_const() { - typedef Kokkos::DynRankView typeX; - typedef Kokkos::DynRankView const_typeX; - typedef Kokkos::DynRankView - const_typeR; + using typeX = Kokkos::DynRankView; + using const_typeX = Kokkos::DynRankView; + using const_typeR = + Kokkos::DynRankView; typeX x("X", 2); const_typeX xc = x; const_typeR xr = x; @@ -1398,10 +1415,10 @@ class TestDynViewAPI { } static void run_test_subview() { - typedef Kokkos::DynRankView cdView; - typedef Kokkos::DynRankView dView; + using cdView = Kokkos::DynRankView; + using dView = Kokkos::DynRankView; // LayoutStride required for all returned DynRankView subdynrankview's - typedef Kokkos::DynRankView sdView; + using sdView = Kokkos::DynRankView; dView0 d0("d0"); cdView s0 = d0; @@ -1452,7 +1469,7 @@ class TestDynViewAPI { ASSERT_EQ(dv6.rank(), 6); // DynRankView with LayoutRight - typedef Kokkos::DynRankView drView; + using drView = Kokkos::DynRankView; drView dr5("dr5", N0, N1, N2, 2, 2); ASSERT_EQ(dr5.rank(), 5); @@ -1514,7 +1531,8 @@ class TestDynViewAPI { ASSERT_EQ(ds5.extent(4), ds5plus.extent(4)); ASSERT_EQ(ds5.extent(5), ds5plus.extent(5)); -#if !defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_CUDA_UVM) +#if (!defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_CUDA_UVM)) && \ + !defined(KOKKOS_ENABLE_HIP) ASSERT_EQ(&ds5(1, 1, 1, 1, 0) - &ds5plus(1, 1, 1, 1, 0), 0); ASSERT_EQ(&ds5(1, 1, 1, 1, 0, 0) - &ds5plus(1, 1, 1, 1, 0, 0), 0); // passing argument to rank beyond the view's rank is allowed @@ -1538,12 +1556,12 @@ class TestDynViewAPI { } static void run_test_subview_strided() { - typedef Kokkos::DynRankView - drview_left; - typedef Kokkos::DynRankView - drview_right; - typedef Kokkos::DynRankView - drview_stride; + using drview_left = + Kokkos::DynRankView; + using drview_right = + Kokkos::DynRankView; + using drview_stride = + Kokkos::DynRankView; drview_left xl2("xl2", 100, 200); drview_right xr2("xr2", 100, 200); @@ -1588,31 +1606,29 @@ class TestDynViewAPI { static void run_test_vector() { static const unsigned Length = 1000, Count = 8; - typedef typename Kokkos::DynRankView - multivector_type; + using multivector_type = + typename Kokkos::DynRankView; - typedef typename Kokkos::DynRankView - multivector_right_type; + using multivector_right_type = + typename Kokkos::DynRankView; multivector_type mv = multivector_type("mv", Length, Count); multivector_right_type mv_right = multivector_right_type("mv", Length, Count); - typedef - typename Kokkos::DynRankView - svector_type; - typedef - typename Kokkos::DynRankView - smultivector_type; - typedef typename Kokkos::DynRankView - const_svector_right_type; - typedef typename Kokkos::DynRankView - const_svector_type; - typedef typename Kokkos::DynRankView - const_smultivector_type; + using svector_type = + typename Kokkos::DynRankView; + using smultivector_type = + typename Kokkos::DynRankView; + using const_svector_right_type = + typename Kokkos::DynRankView; + using const_svector_type = + typename Kokkos::DynRankView; + using const_smultivector_type = + typename Kokkos::DynRankView; svector_type v1 = Kokkos::subdynrankview(mv, Kokkos::ALL(), 0); svector_type v2 = Kokkos::subdynrankview(mv, Kokkos::ALL(), 1); diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp index b3e2812b44..90ca5df194 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI_generic.hpp @@ -44,10 +44,7 @@ #include namespace Test { -// FIXME_HIP attempt to access inaccessible memory space -#ifndef KOKKOS_ENABLE_HIP TEST(TEST_CATEGORY, dyn_rank_view_api_generic) { TestDynViewAPI::run_tests(); } -#endif } // namespace Test diff --git a/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp b/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp index 86a2e4e954..050ebbe35c 100644 --- a/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynViewAPI_rank12345.hpp @@ -45,10 +45,7 @@ #include namespace Test { -// FIXME_HIP failing with wrong value -#ifndef KOKKOS_ENABLE_HIP TEST(TEST_CATEGORY, dyn_rank_view_api_operator_rank12345) { TestDynViewAPI::run_operator_test_rank12345(); } -#endif } // namespace Test diff --git a/lib/kokkos/containers/unit_tests/TestDynamicView.hpp b/lib/kokkos/containers/unit_tests/TestDynamicView.hpp index 8eabbcb371..f018793dd6 100644 --- a/lib/kokkos/containers/unit_tests/TestDynamicView.hpp +++ b/lib/kokkos/containers/unit_tests/TestDynamicView.hpp @@ -58,12 +58,12 @@ namespace Test { template struct TestDynamicView { - typedef typename Space::execution_space execution_space; - typedef typename Space::memory_space memory_space; + using execution_space = typename Space::execution_space; + using memory_space = typename Space::memory_space; - typedef Kokkos::Experimental::DynamicView view_type; + using view_type = Kokkos::Experimental::DynamicView; - typedef double value_type; + using value_type = double; static void run(unsigned arg_total_size) { // Test: Create DynamicView, initialize size (via resize), run through @@ -71,6 +71,27 @@ struct TestDynamicView { // values and repeat // Case 1: min_chunk_size is a power of 2 { + { + view_type d1; + ASSERT_FALSE(d1.is_allocated()); + + d1 = view_type("d1", 1024, arg_total_size); + view_type d2(d1); + view_type d3("d3", 1024, arg_total_size); + + ASSERT_FALSE(d1.is_allocated()); + ASSERT_FALSE(d2.is_allocated()); + ASSERT_FALSE(d3.is_allocated()); + + unsigned d_size = arg_total_size / 8; + d1.resize_serial(d_size); + d2.resize_serial(d_size); + d3.resize_serial(d_size); + + ASSERT_TRUE(d1.is_allocated()); + ASSERT_TRUE(d2.is_allocated()); + ASSERT_TRUE(d3.is_allocated()); + } view_type da("da", 1024, arg_total_size); ASSERT_EQ(da.size(), 0); // Init @@ -223,7 +244,7 @@ struct TestDynamicView { }; TEST(TEST_CATEGORY, dynamic_view) { - typedef TestDynamicView TestDynView; + using TestDynView = TestDynamicView; for (int i = 0; i < 10; ++i) { TestDynView::run(100000 + 100 * i); diff --git a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp index 318132500c..a90885bd33 100644 --- a/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp +++ b/lib/kokkos/containers/unit_tests/TestErrorReporter.hpp @@ -84,9 +84,9 @@ void checkReportersAndReportsAgree(const std::vector &reporters, template struct ErrorReporterDriverBase { - typedef ThreeValReport report_type; - typedef Kokkos::Experimental::ErrorReporter - error_reporter_type; + using report_type = ThreeValReport; + using error_reporter_type = + Kokkos::Experimental::ErrorReporter; error_reporter_type m_errorReporter; ErrorReporterDriverBase(int reporter_capacity, int /*test_size*/) @@ -97,10 +97,11 @@ struct ErrorReporterDriverBase { } void check_expectations(int reporter_capacity, int test_size) { + using namespace std; int num_reported = m_errorReporter.getNumReports(); int num_attempts = m_errorReporter.getNumReportAttempts(); - int expected_num_reports = std::min(reporter_capacity, test_size / 2); + int expected_num_reports = min(reporter_capacity, test_size / 2); EXPECT_EQ(expected_num_reports, num_reported); EXPECT_EQ(test_size / 2, num_attempts); @@ -112,7 +113,7 @@ struct ErrorReporterDriverBase { template void TestErrorReporter() { - typedef ErrorReporterDriverType tester_type; + using tester_type = ErrorReporterDriverType; std::vector reporters; std::vector reports; @@ -147,9 +148,9 @@ void TestErrorReporter() { template struct ErrorReporterDriver : public ErrorReporterDriverBase { - typedef ErrorReporterDriverBase driver_base; - typedef typename driver_base::error_reporter_type::execution_space - execution_space; + using driver_base = ErrorReporterDriverBase; + using execution_space = + typename driver_base::error_reporter_type::execution_space; ErrorReporterDriver(int reporter_capacity, int test_size) : driver_base(reporter_capacity, test_size) { @@ -185,12 +186,16 @@ struct ErrorReporterDriver : public ErrorReporterDriverBase { template struct ErrorReporterDriverUseLambda : public ErrorReporterDriverBase { - typedef ErrorReporterDriverBase driver_base; - typedef typename driver_base::error_reporter_type::execution_space - execution_space; + using driver_base = ErrorReporterDriverBase; + using execution_space = + typename driver_base::error_reporter_type::execution_space; ErrorReporterDriverUseLambda(int reporter_capacity, int test_size) : driver_base(reporter_capacity, test_size) { + execute(reporter_capacity, test_size); + } + + void execute(int reporter_capacity, int test_size) { Kokkos::parallel_for( Kokkos::RangePolicy(0, test_size), KOKKOS_CLASS_LAMBDA(const int work_idx) { @@ -210,9 +215,9 @@ struct ErrorReporterDriverUseLambda #ifdef KOKKOS_ENABLE_OPENMP struct ErrorReporterDriverNativeOpenMP : public ErrorReporterDriverBase { - typedef ErrorReporterDriverBase driver_base; - typedef typename driver_base::error_reporter_type::execution_space - execution_space; + using driver_base = ErrorReporterDriverBase; + using execution_space = + typename driver_base::error_reporter_type::execution_space; ErrorReporterDriverNativeOpenMP(int reporter_capacity, int test_size) : driver_base(reporter_capacity, test_size) { diff --git a/lib/kokkos/containers/unit_tests/TestOffsetView.hpp b/lib/kokkos/containers/unit_tests/TestOffsetView.hpp index 5114b8022f..e5186e3e1e 100644 --- a/lib/kokkos/containers/unit_tests/TestOffsetView.hpp +++ b/lib/kokkos/containers/unit_tests/TestOffsetView.hpp @@ -61,12 +61,25 @@ namespace Test { template void test_offsetview_construction() { - typedef Kokkos::Experimental::OffsetView offset_view_type; - typedef Kokkos::View view_type; + using offset_view_type = Kokkos::Experimental::OffsetView; + using view_type = Kokkos::View; Kokkos::Experimental::index_list_type range0 = {-1, 3}; Kokkos::Experimental::index_list_type range1 = {-2, 2}; + { + offset_view_type o1; + ASSERT_FALSE(o1.is_allocated()); + + o1 = offset_view_type("o1", range0, range1); + offset_view_type o2(o1); + offset_view_type o3("o3", range0, range1); + + ASSERT_TRUE(o1.is_allocated()); + ASSERT_TRUE(o2.is_allocated()); + ASSERT_TRUE(o3.is_allocated()); + } + offset_view_type ov("firstOV", range0, range1); ASSERT_EQ("firstOV", ov.label()); @@ -109,9 +122,9 @@ void test_offsetview_construction() { { // test deep copy of scalar const value into mirro const int constVal = 6; typename offset_view_type::HostMirror hostOffsetView = - Kokkos::Experimental::create_mirror_view(ov); + Kokkos::create_mirror_view(ov); - Kokkos::Experimental::deep_copy(hostOffsetView, constVal); + Kokkos::deep_copy(hostOffsetView, constVal); for (int i = hostOffsetView.begin(0); i < hostOffsetView.end(0); ++i) { for (int j = hostOffsetView.begin(1); j < hostOffsetView.end(1); ++j) { @@ -121,10 +134,9 @@ void test_offsetview_construction() { } } - typedef Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::point_type point_type; + using range_type = + Kokkos::MDRangePolicy, Kokkos::IndexType >; + using point_type = typename range_type::point_type; range_type rangePolicy2D(point_type{{ovmin0, ovmin1}}, point_type{{ovend0, ovend1}}); @@ -136,9 +148,9 @@ void test_offsetview_construction() { // test offsetview to offsetviewmirror deep copy typename offset_view_type::HostMirror hostOffsetView = - Kokkos::Experimental::create_mirror_view(ov); + Kokkos::create_mirror_view(ov); - Kokkos::Experimental::deep_copy(hostOffsetView, ov); + Kokkos::deep_copy(hostOffsetView, ov); for (int i = hostOffsetView.begin(0); i < hostOffsetView.end(0); ++i) { for (int j = hostOffsetView.begin(1); j < hostOffsetView.end(1); ++j) { @@ -185,10 +197,9 @@ void test_offsetview_construction() { Kokkos::deep_copy(view3D, 1); - typedef Kokkos::MDRangePolicy, - Kokkos::IndexType > - range3_type; - typedef typename range3_type::point_type point3_type; + using range3_type = Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using point3_type = typename range3_type::point_type; typename point3_type::value_type begins0 = -10, begins1 = -20, begins2 = -30; @@ -245,7 +256,7 @@ void test_offsetview_construction() { { // test offsetview to view deep copy view_type aView("aView", ov.extent(0), ov.extent(1)); - Kokkos::Experimental::deep_copy(aView, ov); + Kokkos::deep_copy(aView, ov); #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) int sum = 0; @@ -264,7 +275,7 @@ void test_offsetview_construction() { view_type aView("aView", ov.extent(0), ov.extent(1)); Kokkos::deep_copy(aView, 99); - Kokkos::Experimental::deep_copy(ov, aView); + Kokkos::deep_copy(ov, aView); #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) int sum = 0; @@ -447,10 +458,9 @@ void test_offsetview_subview() { ASSERT_EQ(offsetSubview.end(1), 9); #if defined(KOKKOS_ENABLE_CUDA_LAMBDA) || !defined(KOKKOS_ENABLE_CUDA) - typedef Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::point_type point_type; + using range_type = Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using point_type = typename range_type::point_type; const int b0 = offsetSubview.begin(0); const int b1 = offsetSubview.begin(1); diff --git a/lib/kokkos/containers/unit_tests/TestScatterView.hpp b/lib/kokkos/containers/unit_tests/TestScatterView.hpp index 915d96d321..4ec83baece 100644 --- a/lib/kokkos/containers/unit_tests/TestScatterView.hpp +++ b/lib/kokkos/containers/unit_tests/TestScatterView.hpp @@ -50,21 +50,22 @@ namespace Test { -template +template struct test_scatter_view_impl_cls; -template -struct test_scatter_view_impl_cls { +template +struct test_scatter_view_impl_cls { public: - typedef Kokkos::Experimental::ScatterView - scatter_view_type; + using scatter_view_type = + Kokkos::Experimental::ScatterView; - typedef Kokkos::View orig_view_type; + using orig_view_type = Kokkos::View; scatter_view_type scatter_view; int scatterSize; @@ -80,9 +81,18 @@ struct test_scatter_view_impl_cls(); for (int j = 0; j < 10; ++j) { auto k = (i + j) % scatterSize; - scatter_access(k, 0) += 4.2; - scatter_access_atomic(k, 1) += 2.0; - scatter_access(k, 2) += 1.0; + scatter_access(k, 0) += 4; + ++scatter_access(k, 1); + --scatter_access(k, 2); + scatter_access(k, 3)++; + scatter_access(k, 4)--; + scatter_access(k, 5) -= 5; + scatter_access_atomic(k, 6) += 2; + scatter_access_atomic(k, 7)++; + scatter_access_atomic(k, 8)--; + --scatter_access_atomic(k, 9); + ++scatter_access_atomic(k, 10); + scatter_access(k, 11) -= 3; } } @@ -114,27 +133,46 @@ struct test_scatter_view_impl_cls -struct test_scatter_view_impl_cls { +template +struct test_scatter_view_impl_cls { public: - typedef Kokkos::Experimental::ScatterView - scatter_view_type; + using scatter_view_type = + Kokkos::Experimental::ScatterView; - typedef Kokkos::View orig_view_type; + using orig_view_type = Kokkos::View; scatter_view_type scatter_view; int scatterSize; @@ -194,17 +232,18 @@ struct test_scatter_view_impl_cls -struct test_scatter_view_impl_cls { +template +struct test_scatter_view_impl_cls { public: - typedef Kokkos::Experimental::ScatterView - scatter_view_type; + using scatter_view_type = + Kokkos::Experimental::ScatterView; - typedef Kokkos::View orig_view_type; + using orig_view_type = Kokkos::View; scatter_view_type scatter_view; int scatterSize; @@ -242,9 +281,9 @@ struct test_scatter_view_impl_cls(); for (int j = 0; j < 4; ++j) { auto k = (i + j) % scatterSize; - scatter_access(k, 0).update((double)(j + 1) * 4); - scatter_access_atomic(k, 1).update((double)(j + 1) * 2.0); - scatter_access(k, 2).update((double)(j + 1) * 1.0); + scatter_access(k, 0).update((NumberType)(j + 1) * 4); + scatter_access_atomic(k, 1).update((NumberType)(j + 1) * 2.0); + scatter_access(k, 2).update((NumberType)(j + 1) * 1.0); } } @@ -264,17 +303,18 @@ struct test_scatter_view_impl_cls -struct test_scatter_view_impl_cls { +template +struct test_scatter_view_impl_cls { public: - typedef Kokkos::Experimental::ScatterView - scatter_view_type; + using scatter_view_type = + Kokkos::Experimental::ScatterView; - typedef Kokkos::View orig_view_type; + using orig_view_type = Kokkos::View; scatter_view_type scatter_view; int scatterSize; @@ -311,9 +351,9 @@ struct test_scatter_view_impl_cls(); for (int j = 0; j < 4; ++j) { auto k = (i + j) % scatterSize; - scatter_access(k, 0).update((double)(j + 1) * 4); - scatter_access_atomic(k, 1).update((double)(j + 1) * 2.0); - scatter_access(k, 2).update((double)(j + 1) * 1.0); + scatter_access(k, 0).update((NumberType)(j + 1) * 4); + scatter_access_atomic(k, 1).update((NumberType)(j + 1) * 2.0); + scatter_access(k, 2).update((NumberType)(j + 1) * 1.0); } } @@ -333,27 +373,126 @@ struct test_scatter_view_impl_cls -struct test_scatter_view_config { +template +struct test_default_scatter_view { public: - typedef - typename test_scatter_view_impl_cls::scatter_view_type - scatter_view_def; - typedef typename test_scatter_view_impl_cls::orig_view_type - orig_view_def; + using default_duplication = Kokkos::Impl::Experimental::DefaultDuplication< + typename DeviceType::execution_space>; + using Duplication = typename default_duplication::type; + using Contribution = typename Kokkos::Impl::Experimental::DefaultContribution< + typename DeviceType::execution_space, Duplication>::type; + using scatter_view_def = + typename test_scatter_view_impl_cls::scatter_view_type; + using orig_view_def = + typename test_scatter_view_impl_cls::orig_view_type; void run_test(int n) { + // Test creation via create_scatter_view overload 1 + { + orig_view_def original_view("original_view", n); + scatter_view_def scatter_view = + Kokkos::Experimental::create_scatter_view(Op{}, original_view); + + test_scatter_view_impl_cls + scatter_view_test_impl(scatter_view); + scatter_view_test_impl.initialize(original_view); + scatter_view_test_impl.run_parallel(n); + + Kokkos::Experimental::contribute(original_view, scatter_view); + scatter_view.reset_except(original_view); + + scatter_view_test_impl.run_parallel(n); + + Kokkos::Experimental::contribute(original_view, scatter_view); + Kokkos::fence(); + + scatter_view_test_impl.validateResults(original_view); + + { + scatter_view_def persistent_view("persistent", n); + auto result_view = persistent_view.subview(); + contribute(result_view, persistent_view); + Kokkos::fence(); + } + } + } +}; + +template +struct test_scatter_view_config { + public: + using scatter_view_def = + typename test_scatter_view_impl_cls::scatter_view_type; + using orig_view_def = + typename test_scatter_view_impl_cls::orig_view_type; + + void run_test(int n) { + // test allocation + { + orig_view_def ov1("ov1", n); + scatter_view_def sv1; + + ASSERT_FALSE(sv1.is_allocated()); + + sv1 = Kokkos::Experimental::create_scatter_view(ov1); + + scatter_view_def sv2(sv1); + scatter_view_def sv3("sv3", n); + + ASSERT_TRUE(sv1.is_allocated()); + ASSERT_TRUE(sv2.is_allocated()); + ASSERT_TRUE(sv3.is_allocated()); + } + // Test creation via create_scatter_view { orig_view_def original_view("original_view", n); scatter_view_def scatter_view = Kokkos::Experimental::create_scatter_view< - op, duplication, contribution>(original_view); + Op, Duplication, Contribution>(original_view); - test_scatter_view_impl_cls + test_scatter_view_impl_cls + scatter_view_test_impl(scatter_view); + scatter_view_test_impl.initialize(original_view); + scatter_view_test_impl.run_parallel(n); + + Kokkos::Experimental::contribute(original_view, scatter_view); + scatter_view.reset_except(original_view); + + scatter_view_test_impl.run_parallel(n); + + Kokkos::Experimental::contribute(original_view, scatter_view); + Kokkos::fence(); + + scatter_view_test_impl.validateResults(original_view); + + { + scatter_view_def persistent_view("persistent", n); + auto result_view = persistent_view.subview(); + contribute(result_view, persistent_view); + Kokkos::fence(); + } + } + // Test creation via create_scatter_view overload 2 + { + orig_view_def original_view("original_view", n); + scatter_view_def scatter_view = Kokkos::Experimental::create_scatter_view( + Op{}, Duplication{}, Contribution{}, original_view); + + test_scatter_view_impl_cls scatter_view_test_impl(scatter_view); scatter_view_test_impl.initialize(original_view); scatter_view_test_impl.run_parallel(n); @@ -380,8 +519,8 @@ struct test_scatter_view_config { orig_view_def original_view("original_view", n); scatter_view_def scatter_view(original_view); - test_scatter_view_impl_cls + test_scatter_view_impl_cls scatter_view_test_impl(scatter_view); scatter_view_test_impl.initialize(original_view); scatter_view_test_impl.run_parallel(n); @@ -406,19 +545,19 @@ struct test_scatter_view_config { } }; -template +template struct TestDuplicatedScatterView { TestDuplicatedScatterView(int n) { // ScatterSum test test_scatter_view_config + ScatterType, NumberType> test_sv_right_config; test_sv_right_config.run_test(n); test_scatter_view_config< DeviceType, Kokkos::LayoutLeft, Kokkos::Experimental::ScatterDuplicated, - Kokkos::Experimental::ScatterNonAtomic, ScatterType> + Kokkos::Experimental::ScatterNonAtomic, ScatterType, NumberType> test_sv_left_config; test_sv_left_config.run_test(n); } @@ -427,18 +566,19 @@ struct TestDuplicatedScatterView { #ifdef KOKKOS_ENABLE_CUDA // disable duplicated instantiation with CUDA until // UniqueToken can support it -template -struct TestDuplicatedScatterView { +template +struct TestDuplicatedScatterView { TestDuplicatedScatterView(int) {} }; -template +template struct TestDuplicatedScatterView< - Kokkos::Device, ScatterType> { + Kokkos::Device, ScatterType, NumberType> { TestDuplicatedScatterView(int) {} }; -template +template struct TestDuplicatedScatterView< - Kokkos::Device, ScatterType> { + Kokkos::Device, ScatterType, + NumberType> { TestDuplicatedScatterView(int) {} }; #endif @@ -446,13 +586,14 @@ struct TestDuplicatedScatterView< #ifdef KOKKOS_ENABLE_ROCM // disable duplicated instantiation with ROCm until // UniqueToken can support it -template +template struct TestDuplicatedScatterView { TestDuplicatedScatterView(int) {} }; #endif -template +template void test_scatter_view(int n) { using execution_space = typename DeviceType::execution_space; @@ -463,7 +604,7 @@ void test_scatter_view(int n) { test_scatter_view_config + ScatterType, NumberType> test_sv_config; test_sv_config.run_test(n); } @@ -472,30 +613,40 @@ void test_scatter_view(int n) { #endif test_scatter_view_config + Kokkos::Experimental::ScatterAtomic, ScatterType, + NumberType> test_sv_config; test_sv_config.run_test(n); #ifdef KOKKOS_ENABLE_SERIAL } #endif // with hundreds of threads we were running out of memory. - // limit (n) so that duplication doesn't exceed 8GB + // limit (n) so that duplication doesn't exceed 4GB constexpr std::size_t maximum_allowed_total_bytes = - 8ull * 1024ull * 1024ull * 1024ull; + 4ull * 1024ull * 1024ull * 1024ull; std::size_t const maximum_allowed_copy_bytes = maximum_allowed_total_bytes / std::size_t(execution_space().concurrency()); - constexpr std::size_t bytes_per_value = sizeof(double) * 3; + constexpr std::size_t bytes_per_value = sizeof(NumberType) * 12; std::size_t const maximum_allowed_copy_values = maximum_allowed_copy_bytes / bytes_per_value; n = std::min(n, int(maximum_allowed_copy_values)); - TestDuplicatedScatterView duptest(n); + + // if the default is duplicated, this needs to follow the limit + { + test_default_scatter_view + test_default_sv; + test_default_sv.run_test(n); + } + TestDuplicatedScatterView duptest(n); } -// FIXME_HIP ScatterView requires UniqueToken -#ifndef KOKKOS_ENABLE_HIP TEST(TEST_CATEGORY, scatterview) { - test_scatter_view(10); + test_scatter_view( + 10); + test_scatter_view(10); test_scatter_view(10); test_scatter_view(10); test_scatter_view(10); @@ -512,7 +663,10 @@ TEST(TEST_CATEGORY, scatterview) { #endif #endif - test_scatter_view(big_n); + test_scatter_view( + big_n); + test_scatter_view(big_n); test_scatter_view(big_n); test_scatter_view(big_n); test_scatter_view(big_n); @@ -522,7 +676,9 @@ TEST(TEST_CATEGORY, scatterview_devicetype) { using device_type = Kokkos::Device; - test_scatter_view(10); + test_scatter_view(10); + test_scatter_view(10); test_scatter_view(10); test_scatter_view(10); test_scatter_view(10); @@ -530,14 +686,19 @@ TEST(TEST_CATEGORY, scatterview_devicetype) { #ifdef KOKKOS_ENABLE_CUDA if (std::is_same::value) { using cuda_device_type = Kokkos::Device; - test_scatter_view(10); + test_scatter_view(10); + test_scatter_view(10); test_scatter_view(10); test_scatter_view(10); test_scatter_view(10); using cudauvm_device_type = Kokkos::Device; - test_scatter_view( - 10); + test_scatter_view(10); + test_scatter_view(10); test_scatter_view( 10); test_scatter_view( @@ -547,7 +708,6 @@ TEST(TEST_CATEGORY, scatterview_devicetype) { } #endif } -#endif } // namespace Test diff --git a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp index 15c190242c..89c69756d8 100644 --- a/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp +++ b/lib/kokkos/containers/unit_tests/TestStaticCrsGraph.hpp @@ -55,12 +55,10 @@ namespace TestStaticCrsGraph { template void run_test_graph() { - typedef Kokkos::StaticCrsGraph dView; - typedef typename dView::HostMirror hView; + using dView = Kokkos::StaticCrsGraph; + using hView = typename dView::HostMirror; const unsigned LENGTH = 1000; - dView dx; - hView hx; std::vector > graph(LENGTH); @@ -71,6 +69,23 @@ void run_test_graph() { } } + { + dView d1; + ASSERT_FALSE(d1.is_allocated()); + + d1 = Kokkos::create_staticcrsgraph("d1", graph); + + dView d2(d1); + dView d3(d1.entries, d1.row_map); + + ASSERT_TRUE(d1.is_allocated()); + ASSERT_TRUE(d2.is_allocated()); + ASSERT_TRUE(d3.is_allocated()); + } + + dView dx; + hView hx; + dx = Kokkos::create_staticcrsgraph("dx", graph); hx = Kokkos::create_mirror(dx); @@ -98,8 +113,8 @@ void run_test_graph() { template void run_test_graph2() { - typedef Kokkos::StaticCrsGraph dView; - typedef typename dView::HostMirror hView; + using dView = Kokkos::StaticCrsGraph; + using hView = typename dView::HostMirror; const unsigned LENGTH = 10; @@ -158,8 +173,8 @@ template void run_test_graph3(size_t B, size_t N) { srand(10310); - typedef Kokkos::StaticCrsGraph dView; - typedef typename dView::HostMirror hView; + using dView = Kokkos::StaticCrsGraph; + using hView = typename dView::HostMirror; const unsigned LENGTH = 2000; @@ -197,20 +212,13 @@ void run_test_graph3(size_t B, size_t N) { template void run_test_graph4() { - typedef unsigned ordinal_type; - typedef Kokkos::LayoutRight layout_type; - typedef Space space_type; - typedef Kokkos::MemoryUnmanaged memory_traits_type; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - typedef Kokkos::StaticCrsGraph - dView; -#else - typedef Kokkos::StaticCrsGraph - dView; -#endif - typedef typename dView::HostMirror hView; + using ordinal_type = unsigned; + using layout_type = Kokkos::LayoutRight; + using space_type = Space; + using memory_traits_type = Kokkos::MemoryUnmanaged; + using dView = Kokkos::StaticCrsGraph; + using hView = typename dView::HostMirror; dView dx; @@ -227,8 +235,8 @@ void run_test_graph4() { // of the unmanaged StaticCrsGraph // Data types for raw pointers storing StaticCrsGraph info - typedef typename dView::size_type ptr_row_map_type; - typedef typename dView::data_type ptr_entries_type; + using ptr_row_map_type = typename dView::size_type; + using ptr_entries_type = typename dView::data_type; const ordinal_type numRows = 8; const ordinal_type nnz = 24; @@ -237,8 +245,8 @@ void run_test_graph4() { 4, 5, 4, 5, 2, 3, 6, 7, 2, 3, 6, 7}; // Wrap pointers in unmanaged host views - typedef typename hView::row_map_type local_row_map_type; - typedef typename hView::entries_type local_entries_type; + using local_row_map_type = typename hView::row_map_type; + using local_entries_type = typename hView::entries_type; local_row_map_type unman_row_map(&(ptrRaw[0]), numRows + 1); local_entries_type unman_entries(&(indRaw[0]), nnz); @@ -248,10 +256,10 @@ void run_test_graph4() { // Create the device Views for copying the host arrays into // An allocation is needed on the device for the unmanaged StaticCrsGraph to // wrap the pointer - typedef typename Kokkos::View - d_row_map_view_type; - typedef typename Kokkos::View - d_entries_view_type; + using d_row_map_view_type = + typename Kokkos::View; + using d_entries_view_type = + typename Kokkos::View; d_row_map_view_type tmp_row_map("tmp_row_map", numRows + 1); d_entries_view_type tmp_entries("tmp_entries", nnz); diff --git a/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp b/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp index 3ec3a4e5ec..d39e0061c7 100644 --- a/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp +++ b/lib/kokkos/containers/unit_tests/TestUnorderedMap.hpp @@ -53,9 +53,9 @@ namespace Impl { template struct TestInsert { - typedef MapType map_type; - typedef typename map_type::execution_space execution_space; - typedef uint32_t value_type; + using map_type = MapType; + using execution_space = typename map_type::execution_space; + using value_type = uint32_t; map_type map; uint32_t inserts; @@ -101,10 +101,10 @@ struct TestInsert { template struct TestErase { - typedef TestErase self_type; + using self_type = TestErase; - typedef MapType map_type; - typedef typename MapType::execution_space execution_space; + using map_type = MapType; + using execution_space = typename MapType::execution_space; map_type m_map; uint32_t m_num_erase; @@ -131,9 +131,9 @@ struct TestErase { template struct TestFind { - typedef MapType map_type; - typedef typename MapType::execution_space::execution_space execution_space; - typedef uint32_t value_type; + using map_type = MapType; + using execution_space = typename MapType::execution_space::execution_space; + using value_type = uint32_t; map_type m_map; uint32_t m_num_insert; @@ -180,9 +180,9 @@ struct TestFind { template void test_insert(uint32_t num_nodes, uint32_t num_inserts, uint32_t num_duplicates, bool near) { - typedef Kokkos::UnorderedMap map_type; - typedef Kokkos::UnorderedMap - const_map_type; + using map_type = Kokkos::UnorderedMap; + using const_map_type = + Kokkos::UnorderedMap; const uint32_t expected_inserts = (num_inserts + num_duplicates - 1u) / num_duplicates; @@ -232,7 +232,7 @@ void test_insert(uint32_t num_nodes, uint32_t num_inserts, template void test_failed_insert(uint32_t num_nodes) { - typedef Kokkos::UnorderedMap map_type; + using map_type = Kokkos::UnorderedMap; map_type map(num_nodes); Impl::TestInsert test_insert(map, 2u * num_nodes, 1u); @@ -244,13 +244,11 @@ void test_failed_insert(uint32_t num_nodes) { template void test_deep_copy(uint32_t num_nodes) { - typedef Kokkos::UnorderedMap map_type; - typedef Kokkos::UnorderedMap - const_map_type; + using map_type = Kokkos::UnorderedMap; + using const_map_type = + Kokkos::UnorderedMap; - typedef typename map_type::HostMirror host_map_type; - // typedef Kokkos::UnorderedMap host_map_type; + using host_map_type = typename map_type::HostMirror; map_type map; map.rehash(num_nodes, false); @@ -295,7 +293,7 @@ void test_deep_copy(uint32_t num_nodes) { } } -// FIXME_HIP deadlock +// FIXME_HIP wrong result in CI but works locally #ifndef KOKKOS_ENABLE_HIP // WORKAROUND MSVC #ifndef _WIN32 @@ -306,6 +304,7 @@ TEST(TEST_CATEGORY, UnorderedMap_insert) { } } #endif +#endif TEST(TEST_CATEGORY, UnorderedMap_failed_insert) { for (int i = 0; i < 1000; ++i) test_failed_insert(10000); @@ -314,7 +313,6 @@ TEST(TEST_CATEGORY, UnorderedMap_failed_insert) { TEST(TEST_CATEGORY, UnorderedMap_deep_copy) { for (int i = 0; i < 2; ++i) test_deep_copy(10000); } -#endif TEST(TEST_CATEGORY, UnorderedMap_valid_empty) { using Key = int; @@ -326,6 +324,8 @@ TEST(TEST_CATEGORY, UnorderedMap_valid_empty) { n = Map{m.capacity()}; n.rehash(m.capacity()); Kokkos::deep_copy(n, m); + ASSERT_TRUE(m.is_allocated()); + ASSERT_TRUE(n.is_allocated()); } } // namespace Test diff --git a/lib/kokkos/containers/unit_tests/TestVector.hpp b/lib/kokkos/containers/unit_tests/TestVector.hpp index 4174a477c4..296b9a7e64 100644 --- a/lib/kokkos/containers/unit_tests/TestVector.hpp +++ b/lib/kokkos/containers/unit_tests/TestVector.hpp @@ -55,14 +55,17 @@ namespace Impl { template struct test_vector_insert { - typedef Scalar scalar_type; - typedef Device execution_space; + using scalar_type = Scalar; + using execution_space = Device; template void run_test(Vector& a) { int n = a.size(); auto it = a.begin(); + if (n > 0) { + ASSERT_EQ(a.data(), &a[0]); + } it += 15; ASSERT_EQ(*it, scalar_type(1)); @@ -173,11 +176,42 @@ struct test_vector_insert { }; template -struct test_vector_combinations { - typedef test_vector_combinations self_type; +struct test_vector_allocate { + using self_type = test_vector_allocate; - typedef Scalar scalar_type; - typedef Device execution_space; + using scalar_type = Scalar; + using execution_space = Device; + + bool result = false; + + template + Scalar run_me(unsigned int n) { + { + Vector v1; + if (v1.is_allocated() == true) return false; + + v1 = Vector(n, 1); + Vector v2(v1); + Vector v3(n, 1); + + if (v1.is_allocated() == false) return false; + if (v2.is_allocated() == false) return false; + if (v3.is_allocated() == false) return false; + } + return true; + } + + test_vector_allocate(unsigned int size) { + result = run_me >(size); + } +}; + +template +struct test_vector_combinations { + using self_type = test_vector_combinations; + + using scalar_type = Scalar; + using execution_space = Device; Scalar reference; Scalar result; @@ -231,7 +265,14 @@ void test_vector_combinations(unsigned int size) { ASSERT_EQ(test.reference, test.result); } +template +void test_vector_allocate(unsigned int size) { + Impl::test_vector_allocate test(size); + ASSERT_TRUE(test.result); +} + TEST(TEST_CATEGORY, vector_combination) { + test_vector_allocate(10); test_vector_combinations(10); test_vector_combinations(3057); } diff --git a/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp b/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp index 3f7d4101f7..d402160ef4 100644 --- a/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp +++ b/lib/kokkos/containers/unit_tests/TestViewCtorPropEmbeddedDim.hpp @@ -91,10 +91,10 @@ struct TestViewCtorProp_EmbeddedDim { { // Two views auto view_alloc_arg = Kokkos::common_view_alloc_prop(vi1, vd1); - typedef - typename decltype(view_alloc_arg)::value_type CommonViewValueType; - typedef typename Kokkos::View CVT; - typedef typename CVT::HostMirror HostCVT; + using CommonViewValueType = + typename decltype(view_alloc_arg)::value_type; + using CVT = typename Kokkos::View; + using HostCVT = typename CVT::HostMirror; // Construct View using the common type; for case of specialization, an // 'embedded_dim' would be stored by view_alloc_arg @@ -128,10 +128,10 @@ struct TestViewCtorProp_EmbeddedDim { { // Single view auto view_alloc_arg = Kokkos::common_view_alloc_prop(vi1); - typedef - typename decltype(view_alloc_arg)::value_type CommonViewValueType; - typedef typename Kokkos::View CVT; - typedef typename CVT::HostMirror HostCVT; + using CommonViewValueType = + typename decltype(view_alloc_arg)::value_type; + using CVT = typename Kokkos::View; + using HostCVT = typename CVT::HostMirror; // Construct View using the common type; for case of specialization, an // 'embedded_dim' would be stored by view_alloc_arg @@ -161,10 +161,10 @@ struct TestViewCtorProp_EmbeddedDim { { // Two views auto view_alloc_arg = Kokkos::common_view_alloc_prop(vi1, vd1); - typedef - typename decltype(view_alloc_arg)::value_type CommonViewValueType; - typedef typename Kokkos::View CVT; - typedef typename CVT::HostMirror HostCVT; + using CommonViewValueType = + typename decltype(view_alloc_arg)::value_type; + using CVT = typename Kokkos::View; + using HostCVT = typename CVT::HostMirror; // Construct View using the common type; for case of specialization, an // 'embedded_dim' would be stored by view_alloc_arg @@ -182,10 +182,10 @@ struct TestViewCtorProp_EmbeddedDim { { // Single views auto view_alloc_arg = Kokkos::common_view_alloc_prop(vi1); - typedef - typename decltype(view_alloc_arg)::value_type CommonViewValueType; - typedef typename Kokkos::View CVT; - typedef typename CVT::HostMirror HostCVT; + using CommonViewValueType = + typename decltype(view_alloc_arg)::value_type; + using CVT = typename Kokkos::View; + using HostCVT = typename CVT::HostMirror; // Construct View using the common type; for case of specialization, an // 'embedded_dim' would be stored by view_alloc_arg diff --git a/lib/kokkos/core/CMakeLists.txt b/lib/kokkos/core/CMakeLists.txt index 8df72dfc90..68d3f83319 100644 --- a/lib/kokkos/core/CMakeLists.txt +++ b/lib/kokkos/core/CMakeLists.txt @@ -2,7 +2,9 @@ KOKKOS_SUBPACKAGE(Core) -ADD_SUBDIRECTORY(src) +IF (NOT Kokkos_INSTALL_TESTING) + ADD_SUBDIRECTORY(src) +ENDIF() KOKKOS_ADD_TEST_DIRECTORIES(unit_test) KOKKOS_ADD_TEST_DIRECTORIES(perf_test) diff --git a/lib/kokkos/core/cmake/KokkosCore_config.h.in b/lib/kokkos/core/cmake/KokkosCore_config.h.in index 095c869a32..e930f6a05e 100644 --- a/lib/kokkos/core/cmake/KokkosCore_config.h.in +++ b/lib/kokkos/core/cmake/KokkosCore_config.h.in @@ -6,7 +6,8 @@ #if !defined(KOKKOS_FOR_SIERRA) #if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Don't include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." +#error \ + "Don't include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." #else #define KOKKOS_CORE_CONFIG_H #endif @@ -25,8 +26,8 @@ #cmakedefine KOKKOS_ENABLE_DEBUG #cmakedefine KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK #cmakedefine KOKKOS_ENABLE_DEBUG_DUALVIEW_MODIFY_CHECK -#cmakedefine KOKKOS_ENABLE_PROFILING #cmakedefine KOKKOS_ENABLE_PROFILING_LOAD_PRINT +#cmakedefine KOKKOS_ENABLE_TUNING #cmakedefine KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION @@ -38,7 +39,8 @@ // any value of KOKKOS_USE_CUDA_UVM here. Doing this should prevent build // warnings like this one: // -// packages/kokkos/core/src/KokkosCore_config.h:13:1: warning: "KOKKOS_USE_CUDA_UVM" redefined +// packages/kokkos/core/src/KokkosCore_config.h:13:1: warning: +// "KOKKOS_USE_CUDA_UVM" redefined // // At some point, we should edit the test-build scripts in // Trilinos/cmake/ctest/drivers/perseus/, and take @@ -100,4 +102,4 @@ #cmakedefine KOKKOS_USING_DEPRECATED_VIEW #cmakedefine KOKKOS_ENABLE_CXX11 -#endif // !defined(KOKKOS_FOR_SIERRA) +#endif // !defined(KOKKOS_FOR_SIERRA) diff --git a/lib/kokkos/core/perf_test/CMakeLists.txt b/lib/kokkos/core/perf_test/CMakeLists.txt index ca695e2700..f55721e04a 100644 --- a/lib/kokkos/core/perf_test/CMakeLists.txt +++ b/lib/kokkos/core/perf_test/CMakeLists.txt @@ -49,11 +49,19 @@ SET(SOURCES ) IF(Kokkos_ENABLE_HIP) -# FIXME requires TeamPolicy +# FIXME HIP requires TeamPolicy LIST(REMOVE_ITEM SOURCES PerfTest_CustomReduction.cpp PerfTest_ExecSpacePartitioning.cpp - ) + ) +ENDIF() + +IF(Kokkos_ENABLE_OPENMPTARGET) +# FIXME OPENMPTARGET requires TeamPolicy Reductions and Custom Reduction + LIST(REMOVE_ITEM SOURCES + PerfTest_CustomReduction.cpp + PerfTest_ExecSpacePartitioning.cpp + ) ENDIF() # Per #374, we always want to build this test, but we only want to run @@ -76,7 +84,22 @@ IF(NOT KOKKOS_CXX_COMPILER_ID STREQUAL "MSVC") ENDIF() KOKKOS_ADD_EXECUTABLE_AND_TEST( - PerformanceTest_TaskDag - SOURCES test_taskdag.cpp + PerformanceTest_Atomic + SOURCES test_atomic.cpp CATEGORIES PERFORMANCE ) + +KOKKOS_ADD_EXECUTABLE_AND_TEST( + PerformanceTest_Mempool + SOURCES test_mempool.cpp + CATEGORIES PERFORMANCE +) + +IF(NOT Kokkos_ENABLE_OPENMPTARGET) +# FIXME OPENMPTARGET needs tasking + KOKKOS_ADD_EXECUTABLE_AND_TEST( + PerformanceTest_TaskDag + SOURCES test_taskdag.cpp + CATEGORIES PERFORMANCE + ) +ENDIF() diff --git a/lib/kokkos/core/perf_test/Makefile b/lib/kokkos/core/perf_test/Makefile index ca98ca6dde..6d619dc573 100644 --- a/lib/kokkos/core/perf_test/Makefile +++ b/lib/kokkos/core/perf_test/Makefile @@ -53,7 +53,6 @@ TEST_TARGETS += test-atomic # -ifneq ($(KOKKOS_INTERNAL_USE_ROCM), 1) OBJ_MEMPOOL = test_mempool.o TARGETS += KokkosCore_PerformanceTest_Mempool TEST_TARGETS += test-mempool @@ -63,7 +62,6 @@ TEST_TARGETS += test-mempool OBJ_TASKDAG = test_taskdag.o TARGETS += KokkosCore_PerformanceTest_TaskDAG TEST_TARGETS += test-taskdag -endif # diff --git a/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp b/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp index 2717b133bd..e133dafa36 100644 --- a/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp +++ b/lib/kokkos/core/perf_test/PerfTestBlasKernels.hpp @@ -51,12 +51,12 @@ namespace Kokkos { template struct Dot { - typedef typename Type::execution_space execution_space; + using execution_space = typename Type::execution_space; static_assert(static_cast(Type::Rank) == static_cast(1), "Dot static_assert Fail: Rank != 1"); - typedef double value_type; + using value_type = double; #if 1 typename Type::const_type X; @@ -83,12 +83,12 @@ struct Dot { template struct DotSingle { - typedef typename Type::execution_space execution_space; + using execution_space = typename Type::execution_space; static_assert(static_cast(Type::Rank) == static_cast(1), "DotSingle static_assert Fail: Rank != 1"); - typedef double value_type; + using value_type = double; #if 1 typename Type::const_type X; @@ -116,7 +116,7 @@ struct DotSingle { template struct Scale { - typedef typename VectorType::execution_space execution_space; + using execution_space = typename VectorType::execution_space; static_assert(static_cast(ScalarType::Rank) == static_cast(0), @@ -143,7 +143,7 @@ struct Scale { template struct AXPBY { - typedef typename VectorType::execution_space execution_space; + using execution_space = typename VectorType::execution_space; static_assert(static_cast(ScalarType::Rank) == static_cast(0), @@ -185,7 +185,7 @@ namespace Kokkos { template void axpby(const ConstScalarType& alpha, const ConstVectorType& X, const ConstScalarType& beta, const VectorType& Y) { - typedef AXPBY functor; + using functor = AXPBY; parallel_for(Y.extent(0), functor(alpha, X, beta, Y)); } @@ -193,7 +193,7 @@ void axpby(const ConstScalarType& alpha, const ConstVectorType& X, /** \brief Y *= alpha */ template void scale(const ConstScalarType& alpha, const VectorType& Y) { - typedef Scale functor; + using functor = Scale; parallel_for(Y.extent(0), functor(alpha, Y)); } @@ -201,14 +201,14 @@ void scale(const ConstScalarType& alpha, const VectorType& Y) { template void dot(const ConstVectorType& X, const ConstVectorType& Y, const Finalize& finalize) { - typedef Dot functor; + using functor = Dot; parallel_reduce(X.extent(0), functor(X, Y), finalize); } template void dot(const ConstVectorType& X, const Finalize& finalize) { - typedef DotSingle functor; + using functor = DotSingle; parallel_reduce(X.extent(0), functor(X), finalize); } diff --git a/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp b/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp index 0916b230ec..70186283c1 100644 --- a/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp +++ b/lib/kokkos/core/perf_test/PerfTestGramSchmidt.cpp @@ -58,7 +58,7 @@ namespace Test { // PostProcess : R(j,j) = result ; inv = 1 / result ; template struct InvNorm2 : public Kokkos::DotSingle { - typedef typename Kokkos::DotSingle::value_type value_type; + using value_type = typename Kokkos::DotSingle::value_type; ValueView Rjj; ValueView inv; @@ -69,10 +69,7 @@ struct InvNorm2 : public Kokkos::DotSingle { KOKKOS_INLINE_FUNCTION void final(value_type& result) const { -#ifndef KOKKOS_ENABLE_HIP // FIXME_HIP - using std::sqrt; -#endif - result = sqrt(result); + result = std::sqrt(result); Rjj() = result; inv() = (0 < result) ? 1.0 / result : 0; } @@ -88,7 +85,7 @@ inline void invnorm2(const VectorView& x, const ValueView& r, // PostProcess : tmp = - ( R(j,k) = result ); template struct DotM : public Kokkos::Dot { - typedef typename Kokkos::Dot::value_type value_type; + using value_type = typename Kokkos::Dot::value_type; ValueView Rjk; ValueView tmp; @@ -113,16 +110,16 @@ inline void dot_neg(const VectorView& x, const VectorView& y, template struct ModifiedGramSchmidt { - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; - typedef Kokkos::View - multivector_type; + using multivector_type = + Kokkos::View; - typedef Kokkos::View - vector_type; + using vector_type = + Kokkos::View; - typedef Kokkos::View value_view; + using value_view = Kokkos::View; multivector_type Q; multivector_type R; @@ -243,9 +240,9 @@ TEST(default_exec, gramschmidt) { int exp_end = 20; int num_trials = 5; - if (command_line_num_args() > 1) exp_beg = atoi(command_line_arg(1)); - if (command_line_num_args() > 2) exp_end = atoi(command_line_arg(2)); - if (command_line_num_args() > 3) num_trials = atoi(command_line_arg(3)); + if (command_line_num_args() > 1) exp_beg = std::stoi(command_line_arg(1)); + if (command_line_num_args() > 2) exp_end = std::stoi(command_line_arg(2)); + if (command_line_num_args() > 3) num_trials = std::stoi(command_line_arg(3)); EXPECT_NO_THROW(run_test_gramschmidt( exp_beg, exp_end, num_trials, Kokkos::DefaultExecutionSpace::name())); diff --git a/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp b/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp index d879282867..c431c2b0c8 100644 --- a/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp +++ b/lib/kokkos/core/perf_test/PerfTestHexGrad.cpp @@ -51,20 +51,20 @@ namespace Test { template struct HexGrad { - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; - typedef HexGrad self_type; + using self_type = HexGrad; // 3D array : ( ParallelWork , Space , Node ) enum { NSpace = 3, NNode = 8 }; - typedef Kokkos::View - elem_coord_type; + using elem_coord_type = + Kokkos::View; - typedef Kokkos::View - elem_grad_type; + using elem_grad_type = + Kokkos::View; elem_coord_type coords; elem_grad_type grad_op; @@ -179,7 +179,7 @@ struct HexGrad { //-------------------------------------------------------------------------- struct Init { - typedef typename self_type::execution_space execution_space; + using execution_space = typename self_type::execution_space; elem_coord_type coords; @@ -289,9 +289,9 @@ TEST(default_exec, hexgrad) { int exp_end = 20; int num_trials = 5; - if (command_line_num_args() > 1) exp_beg = atoi(command_line_arg(1)); - if (command_line_num_args() > 2) exp_end = atoi(command_line_arg(2)); - if (command_line_num_args() > 3) num_trials = atoi(command_line_arg(3)); + if (command_line_num_args() > 1) exp_beg = std::stoi(command_line_arg(1)); + if (command_line_num_args() > 2) exp_end = std::stoi(command_line_arg(2)); + if (command_line_num_args() > 3) num_trials = std::stoi(command_line_arg(3)); EXPECT_NO_THROW(run_test_hexgrad( exp_beg, exp_end, num_trials, Kokkos::DefaultExecutionSpace::name())); diff --git a/lib/kokkos/core/perf_test/PerfTestMDRange.hpp b/lib/kokkos/core/perf_test/PerfTestMDRange.hpp index 3afff96ff3..ec0452d5f1 100644 --- a/lib/kokkos/core/perf_test/PerfTestMDRange.hpp +++ b/lib/kokkos/core/perf_test/PerfTestMDRange.hpp @@ -46,13 +46,13 @@ namespace Test { template struct MultiDimRangePerf3D { - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; using iterate_type = Kokkos::Iterate; - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; view_type A; view_type B; @@ -108,8 +108,8 @@ struct MultiDimRangePerf3D { // This test performs multidim range over all dims view_type Atest("Atest", icount, jcount, kcount); view_type Btest("Btest", icount + 2, jcount + 2, kcount + 2); - typedef MultiDimRangePerf3D - FunctorType; + using FunctorType = + MultiDimRangePerf3D; double dt_min = 0; @@ -125,10 +125,9 @@ struct MultiDimRangePerf3D { policy_initB({{0, 0, 0}}, {{icount + 2, jcount + 2, kcount + 2}}, {{Ti, Tj, Tk}}); - typedef typename Kokkos::MDRangePolicy< + using MDRangeType = typename Kokkos::MDRangePolicy< Kokkos::Rank<3, iterate_type::Right, iterate_type::Right>, - execution_space> - MDRangeType; + execution_space>; using tile_type = typename MDRangeType::tile_type; using point_type = typename MDRangeType::point_type; @@ -216,14 +215,15 @@ struct MultiDimRangePerf3D { policy_initB({{0, 0, 0}}, {{icount + 2, jcount + 2, kcount + 2}}, {{Ti, Tj, Tk}}); - // typedef typename Kokkos::MDRangePolicy, execution_space > MDRangeType; + // using MDRangeType = + // typename Kokkos::MDRangePolicy< + // Kokkos::Rank<3, iterate_type::Left, iterate_type::Left>, + // execution_space >; // using tile_type = typename MDRangeType::tile_type; // using point_type = typename MDRangeType::point_type; - // Kokkos::MDRangePolicy, execution_space > - // policy(point_type{{0,0,0}},point_type{{icount,jcount,kcount}},tile_type{{Ti,Tj,Tk}} - // ); + // MDRangeType policy(point_type{{0,0,0}}, + // point_type{{icount,jcount,kcount}}, + // tile_type{{Ti,Tj,Tk}}); Kokkos::MDRangePolicy< Kokkos::Rank<3, iterate_type::Left, iterate_type::Left>, execution_space> @@ -306,14 +306,14 @@ struct RangePolicyCollapseTwo { // RangePolicy for 3D range, but will collapse only 2 dims => like Rank<2> for // multi-dim; unroll 2 dims in one-dim - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; - typedef TestLayout layout; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; + using layout = TestLayout; using iterate_type = Kokkos::Iterate; - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; view_type A; view_type B; @@ -388,8 +388,8 @@ struct RangePolicyCollapseTwo { // This test refers to collapsing two dims while using the RangePolicy view_type Atest("Atest", icount, jcount, kcount); view_type Btest("Btest", icount + 2, jcount + 2, kcount + 2); - typedef RangePolicyCollapseTwo - FunctorType; + using FunctorType = + RangePolicyCollapseTwo; long collapse_index_rangeA = 0; long collapse_index_rangeB = 0; @@ -480,12 +480,12 @@ template view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; view_type A; view_type B; @@ -552,8 +552,8 @@ struct RangePolicyCollapseAll { // This test refers to collapsing all dims using the RangePolicy view_type Atest("Atest", icount, jcount, kcount); view_type Btest("Btest", icount + 2, jcount + 2, kcount + 2); - typedef RangePolicyCollapseAll - FunctorType; + using FunctorType = + RangePolicyCollapseAll; const long flat_index_range = icount * jcount * kcount; Kokkos::RangePolicy policy(0, flat_index_range); diff --git a/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp b/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp index 75ca4a0d5a..1ab76d6e54 100644 --- a/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_CustomReduction.cpp @@ -129,9 +129,9 @@ TEST(default_exec, custom_reduction) { int R = 1000; int num_trials = 1; - if (command_line_num_args() > 1) N = atoi(command_line_arg(1)); - if (command_line_num_args() > 2) R = atoi(command_line_arg(2)); - if (command_line_num_args() > 3) num_trials = atoi(command_line_arg(3)); + if (command_line_num_args() > 1) N = std::stoi(command_line_arg(1)); + if (command_line_num_args() > 2) R = std::stoi(command_line_arg(2)); + if (command_line_num_args() > 3) num_trials = std::stoi(command_line_arg(3)); custom_reduction_test(N, R, num_trials); } } // namespace Test diff --git a/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp b/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp index c6d5b2b8d6..50bbc78a6b 100644 --- a/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp +++ b/lib/kokkos/core/perf_test/PerfTest_ExecSpacePartitioning.cpp @@ -29,7 +29,7 @@ struct SpaceInstance { bool value = true; auto local_rank_str = std::getenv("CUDA_LAUNCH_BLOCKING"); if (local_rank_str) { - value = (std::atoi(local_rank_str) == 0); + value = (std::stoi(local_rank_str) == 0); } return value; } diff --git a/lib/kokkos/core/perf_test/test_atomic.cpp b/lib/kokkos/core/perf_test/test_atomic.cpp index 7699d7b91c..59820f3bdd 100644 --- a/lib/kokkos/core/perf_test/test_atomic.cpp +++ b/lib/kokkos/core/perf_test/test_atomic.cpp @@ -49,7 +49,7 @@ #include #include -typedef Kokkos::DefaultExecutionSpace exec_space; +using exec_space = Kokkos::DefaultExecutionSpace; #define RESET 0 #define BRIGHT 1 @@ -80,9 +80,9 @@ void textcolor_standard() { textcolor(RESET, BLACK, WHITE); } template struct ZeroFunctor { - typedef DEVICE_TYPE execution_space; - typedef typename Kokkos::View type; - typedef typename Kokkos::View::HostMirror h_type; + using execution_space = DEVICE_TYPE; + using type = typename Kokkos::View; + using h_type = typename Kokkos::View::HostMirror; type data; KOKKOS_INLINE_FUNCTION void operator()(int) const { data() = 0; } @@ -94,8 +94,8 @@ struct ZeroFunctor { template struct AddFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; KOKKOS_INLINE_FUNCTION @@ -123,8 +123,8 @@ T AddLoop(int loop) { template struct AddNonAtomicFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; KOKKOS_INLINE_FUNCTION @@ -166,8 +166,8 @@ T AddLoopSerial(int loop) { template struct CASFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; KOKKOS_INLINE_FUNCTION @@ -204,8 +204,8 @@ T CASLoop(int loop) { template struct CASNonAtomicFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; KOKKOS_INLINE_FUNCTION @@ -268,8 +268,8 @@ T CASLoopSerial(int loop) { template struct ExchFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data, data2; KOKKOS_INLINE_FUNCTION @@ -309,8 +309,8 @@ T ExchLoop(int loop) { template struct ExchNonAtomicFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data, data2; KOKKOS_INLINE_FUNCTION @@ -448,15 +448,15 @@ int main(int argc, char* argv[]) { for (int i = 0; i < argc; i++) { if ((strcmp(argv[i], "--test") == 0)) { - test = atoi(argv[++i]); + test = std::stoi(argv[++i]); continue; } if ((strcmp(argv[i], "--type") == 0)) { - type = atoi(argv[++i]); + type = std::stoi(argv[++i]); continue; } if ((strcmp(argv[i], "-l") == 0) || (strcmp(argv[i], "--loop") == 0)) { - loop = atoi(argv[++i]); + loop = std::stoi(argv[++i]); continue; } } diff --git a/lib/kokkos/core/perf_test/test_mempool.cpp b/lib/kokkos/core/perf_test/test_mempool.cpp index ad8622e7a6..9aab119774 100644 --- a/lib/kokkos/core/perf_test/test_mempool.cpp +++ b/lib/kokkos/core/perf_test/test_mempool.cpp @@ -56,7 +56,7 @@ using MemorySpace = Kokkos::DefaultExecutionSpace::memory_space; using MemoryPool = Kokkos::MemoryPool; struct TestFunctor { - typedef Kokkos::View ptrs_type; + using ptrs_type = Kokkos::View; enum : unsigned { chunk = 32 }; @@ -87,7 +87,7 @@ struct TestFunctor { //---------------------------------------- - typedef long value_type; + using value_type = long; //---------------------------------------- @@ -107,7 +107,7 @@ struct TestFunctor { } bool test_fill() { - typedef Kokkos::RangePolicy policy; + using policy = Kokkos::RangePolicy; long result = 0; @@ -134,7 +134,7 @@ struct TestFunctor { } void test_del() { - typedef Kokkos::RangePolicy policy; + using policy = Kokkos::RangePolicy; Kokkos::parallel_for(policy(0, range_iter), *this); Kokkos::fence(); @@ -164,7 +164,7 @@ struct TestFunctor { } bool test_alloc_dealloc() { - typedef Kokkos::RangePolicy policy; + using policy = Kokkos::RangePolicy; long error_count = 0; @@ -203,22 +203,22 @@ int main(int argc, char* argv[]) { total_alloc_size = atol(a + strlen(alloc_size_flag)); if (!strncmp(a, super_size_flag, strlen(super_size_flag))) - min_superblock_size = atoi(a + strlen(super_size_flag)); + min_superblock_size = std::stoi(a + strlen(super_size_flag)); if (!strncmp(a, fill_stride_flag, strlen(fill_stride_flag))) - fill_stride = atoi(a + strlen(fill_stride_flag)); + fill_stride = std::stoi(a + strlen(fill_stride_flag)); if (!strncmp(a, fill_level_flag, strlen(fill_level_flag))) - fill_level = atoi(a + strlen(fill_level_flag)); + fill_level = std::stoi(a + strlen(fill_level_flag)); if (!strncmp(a, chunk_span_flag, strlen(chunk_span_flag))) - chunk_span = atoi(a + strlen(chunk_span_flag)); + chunk_span = std::stoi(a + strlen(chunk_span_flag)); if (!strncmp(a, repeat_outer_flag, strlen(repeat_outer_flag))) - repeat_outer = atoi(a + strlen(repeat_outer_flag)); + repeat_outer = std::stoi(a + strlen(repeat_outer_flag)); if (!strncmp(a, repeat_inner_flag, strlen(repeat_inner_flag))) - repeat_inner = atoi(a + strlen(repeat_inner_flag)); + repeat_inner = std::stoi(a + strlen(repeat_inner_flag)); } int chunk_span_bytes = 0; diff --git a/lib/kokkos/core/perf_test/test_taskdag.cpp b/lib/kokkos/core/perf_test/test_taskdag.cpp index a97edc59e8..b2f936a955 100644 --- a/lib/kokkos/core/perf_test/test_taskdag.cpp +++ b/lib/kokkos/core/perf_test/test_taskdag.cpp @@ -91,7 +91,7 @@ struct TestFib { using MemberType = typename Scheduler::member_type; using FutureType = Kokkos::BasicFuture; - typedef long value_type; + using value_type = long; FutureType dep[2]; const value_type n; @@ -152,13 +152,13 @@ int main(int argc, char* argv[]) { total_alloc_size = atol(a + strlen(alloc_size)); if (!strncmp(a, super_size, strlen(super_size))) - min_superblock_size = atoi(a + strlen(super_size)); + min_superblock_size = std::stoi(a + strlen(super_size)); if (!strncmp(a, repeat_outer, strlen(repeat_outer))) - test_repeat_outer = atoi(a + strlen(repeat_outer)); + test_repeat_outer = std::stoi(a + strlen(repeat_outer)); if (!strncmp(a, input_value, strlen(input_value))) - fib_input = atoi(a + strlen(input_value)); + fib_input = std::stoi(a + strlen(input_value)); } const long fib_output = eval_fib(fib_input); @@ -182,7 +182,7 @@ int main(int argc, char* argv[]) { using Scheduler = Kokkos::TaskSchedulerMultiple; - typedef TestFib Functor; + using Functor = TestFib; Kokkos::initialize(argc, argv); diff --git a/lib/kokkos/core/src/CMakeLists.txt b/lib/kokkos/core/src/CMakeLists.txt index 5b91b30787..b4051dc57f 100644 --- a/lib/kokkos/core/src/CMakeLists.txt +++ b/lib/kokkos/core/src/CMakeLists.txt @@ -8,50 +8,49 @@ KOKKOS_INCLUDE_DIRECTORIES( INSTALL (DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}/" DESTINATION ${KOKKOS_HEADER_DIR} - FILES_MATCHING PATTERN "*.hpp" + FILES_MATCHING + PATTERN "*.hpp" + PATTERN "*.h" ) SET(KOKKOS_CORE_SRCS) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.cpp) +SET(KOKKOS_CORE_HEADERS) +APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/*.hpp) +APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/impl/*.hpp) IF (KOKKOS_ENABLE_ROCM) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/ROCm/*.cpp) - IF (KOKKOS_ENABLE_ETI) - APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/eti/ROCm/*.cpp) - ENDIF() ENDIF() IF (KOKKOS_ENABLE_CUDA) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/Cuda/*.cpp) - IF (KOKKOS_ENABLE_ETI) - APPEND_GLOB(KOKKOS_CORE_SRC ${CMAKE_CURRENT_SOURCE_DIR/eti/Cuda/*.cpp) - ENDIF() + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Cuda/*.hpp) ENDIF() IF (KOKKOS_ENABLE_OPENMP) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/OpenMP/*.cpp) - IF (KOKKOS_ENABLE_ETI) - APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/eti/OpenMP/*.cpp) - ENDIF() + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/OpenMP/*.hpp) ENDIF() IF (KOKKOS_ENABLE_OPENMPTARGET) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/OpenMPTarget/*.cpp) + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/OpenMPTarget/*.hpp) ENDIF() IF (KOKKOS_ENABLE_PTHREAD) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/Threads/*.cpp) - IF (KOKKOS_ENABLE_ETI) - APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/eti/Threads/*.cpp) - ENDIF() + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Threads/*.hpp) ENDIF() IF (KOKKOS_ENABLE_HIP) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/HIP/*.cpp) + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/HIP/*.hpp) ENDIF() IF (KOKKOS_ENABLE_HPX) APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/HPX/*.cpp) + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/HPX/*.hpp) ENDIF() IF (NOT KOKKOS_ENABLE_MEMKIND) @@ -59,9 +58,7 @@ IF (NOT KOKKOS_ENABLE_MEMKIND) ENDIF() IF (KOKKOS_ENABLE_SERIAL) - IF (KOKKOS_ENABLE_ETI) - APPEND_GLOB(KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/eti/Serial/*.cpp) - ENDIF() + APPEND_GLOB(KOKKOS_CORE_HEADERS ${CMAKE_CURRENT_SOURCE_DIR}/Serial/*.hpp) ELSE() LIST(REMOVE_ITEM KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/impl/Kokkos_Serial.cpp) LIST(REMOVE_ITEM KOKKOS_CORE_SRCS ${CMAKE_CURRENT_SOURCE_DIR}/impl/Kokkos_Serial_task.cpp) @@ -70,6 +67,8 @@ ENDIF() KOKKOS_ADD_LIBRARY( kokkoscore SOURCES ${KOKKOS_CORE_SRCS} + HEADERS ${KOKKOS_CORE_HEADERS} + ADD_BUILD_OPTIONS # core should be given all the necessary compiler/linker flags ) SET_TARGET_PROPERTIES(kokkoscore PROPERTIES VERSION ${Kokkos_VERSION}) diff --git a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp index 3706263921..6feaed80e1 100644 --- a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp +++ b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile.hpp @@ -48,7 +48,6 @@ #include #if defined(__CUDACC__) && defined(KOKKOS_ENABLE_CUDA) -#include #include #include @@ -60,10 +59,8 @@ // type is not allowed As a result, recreate cuda_parallel_launch and associated // code -#if defined(KOKKOS_ENABLE_PROFILING) -#include +#include #include -#endif namespace Kokkos { namespace Impl { @@ -1291,8 +1288,8 @@ struct DeviceIterateTile { using point_type = typename RP::point_type; struct VoidDummy {}; - typedef typename std::conditional::value, VoidDummy, - Tag>::type usable_tag; + using usable_tag = typename std::conditional::value, + VoidDummy, Tag>::type; DeviceIterateTile(const RP& rp, const Functor& func) : m_rp{rp}, m_func{func} {} @@ -1310,6 +1307,8 @@ struct DeviceIterateTile { 65535; // not true for blockIdx.x for newer archs if (RP::rank == 2) { const dim3 block(m_rp.m_tile[0], m_rp.m_tile[1], 1); + KOKKOS_ASSERT(block.x > 0); + KOKKOS_ASSERT(block.y > 0); const dim3 grid( std::min((m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1) / block.x, maxblocks), @@ -1319,6 +1318,9 @@ struct DeviceIterateTile { CudaLaunch(*this, grid, block); } else if (RP::rank == 3) { const dim3 block(m_rp.m_tile[0], m_rp.m_tile[1], m_rp.m_tile[2]); + KOKKOS_ASSERT(block.x > 0); + KOKKOS_ASSERT(block.y > 0); + KOKKOS_ASSERT(block.z > 0); const dim3 grid( std::min((m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1) / block.x, maxblocks), @@ -1332,6 +1334,8 @@ struct DeviceIterateTile { // threadIdx.z const dim3 block(m_rp.m_tile[0] * m_rp.m_tile[1], m_rp.m_tile[2], m_rp.m_tile[3]); + KOKKOS_ASSERT(block.y > 0); + KOKKOS_ASSERT(block.z > 0); const dim3 grid( std::min( static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), @@ -1346,6 +1350,7 @@ struct DeviceIterateTile { // threadIdx.z const dim3 block(m_rp.m_tile[0] * m_rp.m_tile[1], m_rp.m_tile[2] * m_rp.m_tile[3], m_rp.m_tile[4]); + KOKKOS_ASSERT(block.z > 0); const dim3 grid( std::min( static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), diff --git a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp index cb7f5971ae..0425fe6ed5 100644 --- a/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp +++ b/lib/kokkos/core/src/Cuda/KokkosExp_Cuda_IterateTile_Refactor.hpp @@ -48,9 +48,7 @@ #include #if defined(__CUDACC__) && defined(KOKKOS_ENABLE_CUDA) -#include #include -#include #include @@ -60,10 +58,8 @@ // type is not allowed use existing Kokkos functionality, e.g. max blocks, once // resolved -#if defined(KOKKOS_ENABLE_PROFILING) -#include +#include #include -#endif namespace Kokkos { namespace Impl { diff --git a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp index e11961d763..91feb8b727 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_CudaSpace.cpp @@ -60,9 +60,7 @@ #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include -#endif +#include /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ @@ -75,8 +73,8 @@ namespace { static std::atomic num_uvm_allocations(0); cudaStream_t get_deep_copy_stream() { - static cudaStream_t s = 0; - if (s == 0) { + static cudaStream_t s = nullptr; + if (s == nullptr) { cudaStreamCreate(&s); } return s; @@ -201,6 +199,10 @@ CudaHostPinnedSpace::CudaHostPinnedSpace() {} // {{{1 void *CudaSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void *CudaSpace::allocate(const char *arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size) const { void *ptr = nullptr; auto error_code = cudaMalloc(&ptr, arg_alloc_size); @@ -213,10 +215,22 @@ void *CudaSpace::allocate(const size_t arg_alloc_size) const { Experimental::RawMemoryAllocationFailure::AllocationMechanism:: CudaMalloc); } + + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::allocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, ptr, + reported_size); + } return ptr; } void *CudaUVMSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void *CudaUVMSpace::allocate(const char *arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size) const { void *ptr = nullptr; Cuda::impl_static_fence(); @@ -243,11 +257,22 @@ void *CudaUVMSpace::allocate(const size_t arg_alloc_size) const { } } Cuda::impl_static_fence(); - + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::allocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, ptr, + reported_size); + } return ptr; } void *CudaHostPinnedSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void *CudaHostPinnedSpace::allocate(const char *arg_label, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { void *ptr = nullptr; auto error_code = cudaHostAlloc(&ptr, arg_alloc_size, cudaHostAllocDefault); @@ -260,24 +285,56 @@ void *CudaHostPinnedSpace::allocate(const size_t arg_alloc_size) const { Experimental::RawMemoryAllocationFailure::AllocationMechanism:: CudaHostAlloc); } - + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::allocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, ptr, + reported_size); + } return ptr; } // end allocate() }}}1 //============================================================================== - void CudaSpace::deallocate(void *const arg_alloc_ptr, - const size_t /* arg_alloc_size */) const { + const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} +void CudaSpace::deallocate(const char *arg_label, void *const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::deallocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, arg_alloc_ptr, + reported_size); + } + try { CUDA_SAFE_CALL(cudaFree(arg_alloc_ptr)); } catch (...) { } } - void CudaUVMSpace::deallocate(void *const arg_alloc_ptr, - const size_t /* arg_alloc_size */) const { + const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} + +void CudaUVMSpace::deallocate(const char *arg_label, void *const arg_alloc_ptr, + const size_t arg_alloc_size + + , + const size_t arg_logical_size) const { Cuda::impl_static_fence(); + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::deallocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, arg_alloc_ptr, + reported_size); + } try { if (arg_alloc_ptr != nullptr) { Kokkos::Impl::num_uvm_allocations--; @@ -289,7 +346,21 @@ void CudaUVMSpace::deallocate(void *const arg_alloc_ptr, } void CudaHostPinnedSpace::deallocate(void *const arg_alloc_ptr, - const size_t /* arg_alloc_size */) const { + const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} + +void CudaHostPinnedSpace::deallocate(const char *arg_label, + void *const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::deallocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, arg_alloc_ptr, + reported_size); + } try { CUDA_SAFE_CALL(cudaFreeHost(arg_alloc_ptr)); } catch (...) { @@ -321,7 +392,8 @@ SharedAllocationRecord::attach_texture_object( size_t const alloc_size) { enum { TEXTURE_BOUND_1D = 1u << 27 }; - if ((alloc_ptr == 0) || (sizeof_alias * TEXTURE_BOUND_1D <= alloc_size)) { + if ((alloc_ptr == nullptr) || + (sizeof_alias * TEXTURE_BOUND_1D <= alloc_size)) { std::ostringstream msg; msg << "Kokkos::CudaSpace ERROR: Cannot attach texture object to" << " alloc_ptr(" << alloc_ptr << ")" @@ -434,48 +506,36 @@ void SharedAllocationRecord::deallocate( // {{{1 SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) + const char *label = nullptr; if (Kokkos::Profiling::profileLibraryLoaded()) { SharedAllocationHeader header; - Kokkos::Impl::DeepCopy( + Kokkos::Impl::DeepCopy( &header, RecordBase::m_alloc_ptr, sizeof(SharedAllocationHeader)); - - Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle(Kokkos::CudaSpace::name()), - header.m_label, data(), size()); + label = header.label(); } -#endif - - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); + auto alloc_size = SharedAllocationRecord::m_alloc_size; + m_space.deallocate(label, SharedAllocationRecord::m_alloc_ptr, + alloc_size, (alloc_size - sizeof(SharedAllocationHeader))); } SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) + const char *label = nullptr; if (Kokkos::Profiling::profileLibraryLoaded()) { - Cuda::impl_static_fence(); // Make sure I can access the label ... - Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle(Kokkos::CudaUVMSpace::name()), - RecordBase::m_alloc_ptr->m_label, data(), size()); + label = RecordBase::m_alloc_ptr->m_label; } -#endif - - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); + m_space.deallocate(label, SharedAllocationRecord::m_alloc_ptr, + SharedAllocationRecord::m_alloc_size, + (SharedAllocationRecord::m_alloc_size - + sizeof(SharedAllocationHeader))); } SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle(Kokkos::CudaHostPinnedSpace::name()), - RecordBase::m_alloc_ptr->m_label, data(), size()); - } -#endif - - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); + m_space.deallocate(RecordBase::m_alloc_ptr->m_label, + SharedAllocationRecord::m_alloc_ptr, + SharedAllocationRecord::m_alloc_size, + (SharedAllocationRecord::m_alloc_size - + sizeof(SharedAllocationHeader))); } // end SharedAllocationRecord destructors }}}1 @@ -499,13 +559,6 @@ SharedAllocationRecord::SharedAllocationRecord( sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_tex_obj(0), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif SharedAllocationHeader header; @@ -537,13 +590,6 @@ SharedAllocationRecord::SharedAllocationRecord( sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_tex_obj(0), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif // Fill in the Header information, directly accessible via UVM RecordBase::m_alloc_ptr->m_record = this; @@ -572,13 +618,6 @@ SharedAllocationRecord:: arg_alloc_size), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif // Fill in the Header information, directly accessible on the host RecordBase::m_alloc_ptr->m_record = this; @@ -599,7 +638,7 @@ SharedAllocationRecord:: void *SharedAllocationRecord::allocate_tracked( const Kokkos::CudaSpace &arg_space, const std::string &arg_alloc_label, const size_t arg_alloc_size) { - if (!arg_alloc_size) return (void *)0; + if (!arg_alloc_size) return nullptr; SharedAllocationRecord *const r = allocate(arg_space, arg_alloc_label, arg_alloc_size); @@ -611,7 +650,7 @@ void *SharedAllocationRecord::allocate_tracked( void SharedAllocationRecord::deallocate_tracked( void *const arg_alloc_ptr) { - if (arg_alloc_ptr != 0) { + if (arg_alloc_ptr != nullptr) { SharedAllocationRecord *const r = get_record(arg_alloc_ptr); RecordBase::decrement(r); @@ -636,7 +675,7 @@ void *SharedAllocationRecord::reallocate_tracked( void *SharedAllocationRecord::allocate_tracked( const Kokkos::CudaUVMSpace &arg_space, const std::string &arg_alloc_label, const size_t arg_alloc_size) { - if (!arg_alloc_size) return (void *)0; + if (!arg_alloc_size) return nullptr; SharedAllocationRecord *const r = allocate(arg_space, arg_alloc_label, arg_alloc_size); @@ -648,7 +687,7 @@ void *SharedAllocationRecord::allocate_tracked( void SharedAllocationRecord::deallocate_tracked( void *const arg_alloc_ptr) { - if (arg_alloc_ptr != 0) { + if (arg_alloc_ptr != nullptr) { SharedAllocationRecord *const r = get_record(arg_alloc_ptr); RecordBase::decrement(r); @@ -674,7 +713,7 @@ void * SharedAllocationRecord::allocate_tracked( const Kokkos::CudaHostPinnedSpace &arg_space, const std::string &arg_alloc_label, const size_t arg_alloc_size) { - if (!arg_alloc_size) return (void *)0; + if (!arg_alloc_size) return nullptr; SharedAllocationRecord *const r = allocate(arg_space, arg_alloc_label, arg_alloc_size); @@ -687,7 +726,7 @@ SharedAllocationRecord::allocate_tracked( void SharedAllocationRecord::deallocate_tracked(void *const arg_alloc_ptr) { - if (arg_alloc_ptr != 0) { + if (arg_alloc_ptr != nullptr) { SharedAllocationRecord *const r = get_record(arg_alloc_ptr); RecordBase::decrement(r); @@ -726,7 +765,7 @@ SharedAllocationRecord::get_record(void *alloc_ptr) { Header head; Header const *const head_cuda = - alloc_ptr ? Header::get_header(alloc_ptr) : (Header *)0; + alloc_ptr ? Header::get_header(alloc_ptr) : nullptr; if (alloc_ptr) { Kokkos::Impl::DeepCopy( @@ -734,7 +773,7 @@ SharedAllocationRecord::get_record(void *alloc_ptr) { } RecordCuda *const record = - alloc_ptr ? static_cast(head.m_record) : (RecordCuda *)0; + alloc_ptr ? static_cast(head.m_record) : nullptr; if (!alloc_ptr || record->m_alloc_ptr != head_cuda) { Kokkos::Impl::throw_runtime_exception( @@ -751,7 +790,7 @@ SharedAllocationRecord *SharedAllocationRecord< using RecordCuda = SharedAllocationRecord; Header *const h = - alloc_ptr ? reinterpret_cast
    (alloc_ptr) - 1 : (Header *)0; + alloc_ptr ? reinterpret_cast
    (alloc_ptr) - 1 : nullptr; if (!alloc_ptr || h->m_record->m_alloc_ptr != h) { Kokkos::Impl::throw_runtime_exception( @@ -769,7 +808,7 @@ SharedAllocationRecord using RecordCuda = SharedAllocationRecord; Header *const h = - alloc_ptr ? reinterpret_cast
    (alloc_ptr) - 1 : (Header *)0; + alloc_ptr ? reinterpret_cast
    (alloc_ptr) - 1 : nullptr; if (!alloc_ptr || h->m_record->m_alloc_ptr != h) { Kokkos::Impl::throw_runtime_exception( diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp index 34b681be15..5a143fd267 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_BlockSize_Deduction.hpp @@ -48,22 +48,102 @@ #include #ifdef KOKKOS_ENABLE_CUDA -#include #include namespace Kokkos { namespace Impl { -template -struct CudaGetMaxBlockSize; +inline int cuda_max_active_blocks_per_sm(cudaDeviceProp const& properties, + cudaFuncAttributes const& attributes, + int block_size, size_t dynamic_shmem) { + // Limits due do registers/SM + int const regs_per_sm = properties.regsPerMultiprocessor; + int const regs_per_thread = attributes.numRegs; + int const max_blocks_regs = regs_per_sm / (regs_per_thread * block_size); -template -int cuda_get_max_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - return CudaGetMaxBlockSize::get_block_size( - f, vector_length, shmem_extra_block, shmem_extra_thread); + // Limits due to shared memory/SM + size_t const shmem_per_sm = properties.sharedMemPerMultiprocessor; + size_t const shmem_per_block = properties.sharedMemPerBlock; + size_t const static_shmem = attributes.sharedSizeBytes; + size_t const dynamic_shmem_per_block = attributes.maxDynamicSharedSizeBytes; + size_t const total_shmem = static_shmem + dynamic_shmem; + + int const max_blocks_shmem = + total_shmem > shmem_per_block || dynamic_shmem > dynamic_shmem_per_block + ? 0 + : (total_shmem > 0 ? (int)shmem_per_sm / total_shmem + : max_blocks_regs); + + // Limits due to blocks/SM +#if CUDA_VERSION >= 11000 + int const max_blocks_per_sm = properties.maxBlocksPerMultiProcessor; +#else + int const max_blocks_per_sm = [&properties]() { + switch (properties.major) { + case 3: return 16; + case 5: + case 6: return 32; + case 7: { + int isTuring = properties.minor == 5; + return (isTuring) ? 16 : 32; + } + default: + throw_runtime_exception("Unknown device in cuda block size deduction"); + return 0; + } + }(); +#endif + + // Overall occupancy in blocks + return std::min({max_blocks_regs, max_blocks_shmem, max_blocks_per_sm}); +} + +template +inline int cuda_deduce_block_size(bool early_termination, + cudaDeviceProp const& properties, + cudaFuncAttributes const& attributes, + UnaryFunction block_size_to_dynamic_shmem, + LaunchBounds) { + // Limits + int const max_threads_per_sm = properties.maxThreadsPerMultiProcessor; + // unsure if I need to do that or if this is already accounted for in the + // functor attributes + int const max_threads_per_block = + std::min(LaunchBounds::maxTperB == 0 ? (int)properties.maxThreadsPerBlock + : (int)LaunchBounds::maxTperB, + attributes.maxThreadsPerBlock); + int const min_blocks_per_sm = + LaunchBounds::minBperSM == 0 ? 1 : LaunchBounds::minBperSM; + + // Recorded maximum + int opt_block_size = 0; + int opt_threads_per_sm = 0; + + for (int block_size = max_threads_per_block; block_size > 0; + block_size -= 32) { + size_t const dynamic_shmem = block_size_to_dynamic_shmem(block_size); + + int blocks_per_sm = cuda_max_active_blocks_per_sm( + properties, attributes, block_size, dynamic_shmem); + + int threads_per_sm = blocks_per_sm * block_size; + + if (threads_per_sm > max_threads_per_sm) { + blocks_per_sm = max_threads_per_sm / block_size; + threads_per_sm = blocks_per_sm * block_size; + } + + if (blocks_per_sm >= min_blocks_per_sm) { + if (threads_per_sm >= opt_threads_per_sm) { + opt_block_size = block_size; + opt_threads_per_sm = threads_per_sm; + } + } + + if (early_termination && blocks_per_sm != 0) break; + } + + return opt_block_size; } template @@ -72,295 +152,24 @@ int cuda_get_max_block_size(const CudaInternal* cuda_instance, const FunctorType& f, const size_t vector_length, const size_t shmem_block, const size_t shmem_thread) { - const int min_blocks_per_sm = - LaunchBounds::minBperSM == 0 ? 1 : LaunchBounds::minBperSM; - const int max_threads_per_block = LaunchBounds::maxTperB == 0 - ? cuda_instance->m_maxThreadsPerBlock - : LaunchBounds::maxTperB; + (void)cuda_instance; - const int regs_per_thread = attr.numRegs; - const int regs_per_sm = cuda_instance->m_regsPerSM; - const int shmem_per_sm = cuda_instance->m_shmemPerSM; - const int max_shmem_per_block = cuda_instance->m_maxShmemPerBlock; - const int max_blocks_per_sm = cuda_instance->m_maxBlocksPerSM; - const int max_threads_per_sm = cuda_instance->m_maxThreadsPerSM; + auto const& prop = Kokkos::Cuda().cuda_device_prop(); - int block_size = std::min(attr.maxThreadsPerBlock, max_threads_per_block); + auto const block_size_to_dynamic_shmem = [&f, vector_length, shmem_block, + shmem_thread](int block_size) { + size_t const functor_shmem = + Kokkos::Impl::FunctorTeamShmemSize::value( + f, block_size / vector_length); - int functor_shmem = - FunctorTeamShmemSize::value(f, block_size / vector_length); - int total_shmem = shmem_block + shmem_thread * (block_size / vector_length) + - functor_shmem + attr.sharedSizeBytes; - int max_blocks_regs = regs_per_sm / (regs_per_thread * block_size); - int max_blocks_shmem = - (total_shmem < max_shmem_per_block) - ? (total_shmem > 0 ? shmem_per_sm / total_shmem : max_blocks_regs) - : 0; - int blocks_per_sm = std::min(max_blocks_regs, max_blocks_shmem); - int threads_per_sm = blocks_per_sm * block_size; - if (threads_per_sm > max_threads_per_sm) { - blocks_per_sm = max_threads_per_sm / block_size; - threads_per_sm = blocks_per_sm * block_size; - } - int opt_block_size = (blocks_per_sm >= min_blocks_per_sm) ? block_size : 0; - int opt_threads_per_sm = threads_per_sm; - // printf("BlockSizeMax: %i Shmem: %i %i %i %i Regs: %i %i Blocks: %i %i - // Achieved: %i %i Opt: %i %i\n",block_size, - // shmem_per_sm,max_shmem_per_block,functor_shmem,total_shmem, - // regs_per_sm,regs_per_thread,max_blocks_shmem,max_blocks_regs,blocks_per_sm,threads_per_sm,opt_block_size,opt_threads_per_sm); - block_size -= 32; - while ((blocks_per_sm == 0) && (block_size >= 32)) { - functor_shmem = - FunctorTeamShmemSize::value(f, block_size / vector_length); - total_shmem = shmem_block + shmem_thread * (block_size / vector_length) + - functor_shmem + attr.sharedSizeBytes; - max_blocks_regs = regs_per_sm / (regs_per_thread * block_size); - max_blocks_shmem = - (total_shmem < max_shmem_per_block) - ? (total_shmem > 0 ? shmem_per_sm / total_shmem : max_blocks_regs) - : 0; - blocks_per_sm = std::min(max_blocks_regs, max_blocks_shmem); - threads_per_sm = blocks_per_sm * block_size; - if (threads_per_sm > max_threads_per_sm) { - blocks_per_sm = max_threads_per_sm / block_size; - threads_per_sm = blocks_per_sm * block_size; - } - if ((blocks_per_sm >= min_blocks_per_sm) && - (blocks_per_sm <= max_blocks_per_sm)) { - if (threads_per_sm >= opt_threads_per_sm) { - opt_block_size = block_size; - opt_threads_per_sm = threads_per_sm; - } - } - // printf("BlockSizeMax: %i Shmem: %i %i %i %i Regs: %i %i Blocks: %i %i - // Achieved: %i %i Opt: %i %i\n",block_size, - // shmem_per_sm,max_shmem_per_block,functor_shmem,total_shmem, - // regs_per_sm,regs_per_thread,max_blocks_shmem,max_blocks_regs,blocks_per_sm,threads_per_sm,opt_block_size,opt_threads_per_sm); - block_size -= 32; - } - return opt_block_size; -} + size_t const dynamic_shmem = shmem_block + + shmem_thread * (block_size / vector_length) + + functor_shmem; + return dynamic_shmem; + }; -template -struct CudaGetMaxBlockSize, true> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int numBlocks; - int blockSize = 1024; - int sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_constant_memory, blockSize, - sharedmem); - - if (numBlocks > 0) return blockSize; - while (blockSize > 32 && numBlocks == 0) { - blockSize /= 2; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - } - int blockSizeUpperBound = blockSize * 2; - while (blockSize < blockSizeUpperBound && numBlocks > 0) { - blockSize += 32; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - } - return blockSize - 32; - } -}; - -template -struct CudaGetMaxBlockSize, false> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int numBlocks; - - unsigned int blockSize = 1024; - unsigned int sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_local_memory, blockSize, - sharedmem); - - if (numBlocks > 0) return blockSize; - while (blockSize > 32 && numBlocks == 0) { - blockSize /= 2; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_local_memory, blockSize, - sharedmem); - } - unsigned int blockSizeUpperBound = blockSize * 2; - while (blockSize < blockSizeUpperBound && numBlocks > 0) { - blockSize += 32; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_local_memory, blockSize, - sharedmem); - } - return blockSize - 32; - } -}; - -template -struct CudaGetMaxBlockSize< - DriverType, Kokkos::LaunchBounds, - true> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int numBlocks = 0, oldNumBlocks = 0; - unsigned int blockSize = MaxThreadsPerBlock; - unsigned int sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, - cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - - if (static_cast(numBlocks) >= MinBlocksPerSM) - return blockSize; - - while (blockSize > 32 && - static_cast(numBlocks) < MinBlocksPerSM) { - blockSize /= 2; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - } - unsigned int blockSizeUpperBound = - (blockSize * 2 < MaxThreadsPerBlock ? blockSize * 2 - : MaxThreadsPerBlock); - while (blockSize(numBlocks)> - MinBlocksPerSM) { - blockSize += 32; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - oldNumBlocks = numBlocks; - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - } - if (static_cast(oldNumBlocks) >= MinBlocksPerSM) - return blockSize - 32; - return -1; - } -}; - -template -struct CudaGetMaxBlockSize< - DriverType, Kokkos::LaunchBounds, - false> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int numBlocks = 0, oldNumBlocks = 0; - unsigned int blockSize = MaxThreadsPerBlock; - int sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, - cuda_parallel_launch_local_memory, - blockSize, sharedmem); - if (static_cast(numBlocks) >= MinBlocksPerSM) - return blockSize; - - while (blockSize > 32 && - static_cast(numBlocks) < MinBlocksPerSM) { - blockSize /= 2; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_local_memory, blockSize, - sharedmem); - } - unsigned int blockSizeUpperBound = - (blockSize * 2 < MaxThreadsPerBlock ? blockSize * 2 - : MaxThreadsPerBlock); - while (blockSize < blockSizeUpperBound && - static_cast(numBlocks) >= MinBlocksPerSM) { - blockSize += 32; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - oldNumBlocks = numBlocks; - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_local_memory, blockSize, - sharedmem); - } - if (static_cast(oldNumBlocks) >= MinBlocksPerSM) - return blockSize - 32; - return -1; - } -}; - -template -struct CudaGetOptBlockSize; - -template -int cuda_get_opt_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - return CudaGetOptBlockSize< - DriverType, LaunchBounds, - // LaunchBounds::launch_mechanism == Kokkos::Experimental::LaunchDefault ? - // (( CudaTraits::ConstantMemoryUseThreshold < - // sizeof(DriverType) )? - // Kokkos::Experimental::CudaLaunchConstantMemory:Kokkos::Experimental::CudaLaunchLocalMemory): - // LaunchBounds::launch_mechanism - (CudaTraits::ConstantMemoryUseThreshold < - sizeof(DriverType))>::get_block_size(f, vector_length, shmem_extra_block, - shmem_extra_thread); + return cuda_deduce_block_size(true, prop, attr, block_size_to_dynamic_shmem, + LaunchBounds{}); } template @@ -369,221 +178,26 @@ int cuda_get_opt_block_size(const CudaInternal* cuda_instance, const FunctorType& f, const size_t vector_length, const size_t shmem_block, const size_t shmem_thread) { - const int min_blocks_per_sm = - LaunchBounds::minBperSM == 0 ? 1 : LaunchBounds::minBperSM; - const int max_threads_per_block = LaunchBounds::maxTperB == 0 - ? cuda_instance->m_maxThreadsPerBlock - : LaunchBounds::maxTperB; + (void)cuda_instance; - const int regs_per_thread = attr.numRegs; - const int regs_per_sm = cuda_instance->m_regsPerSM; - const int shmem_per_sm = cuda_instance->m_shmemPerSM; - const int max_shmem_per_block = cuda_instance->m_maxShmemPerBlock; - const int max_blocks_per_sm = cuda_instance->m_maxBlocksPerSM; - const int max_threads_per_sm = cuda_instance->m_maxThreadsPerSM; + auto const& prop = Kokkos::Cuda().cuda_device_prop(); - int block_size = std::min(attr.maxThreadsPerBlock, max_threads_per_block); + auto const block_size_to_dynamic_shmem = [&f, vector_length, shmem_block, + shmem_thread](int block_size) { + size_t const functor_shmem = + Kokkos::Impl::FunctorTeamShmemSize::value( + f, block_size / vector_length); - int functor_shmem = - FunctorTeamShmemSize::value(f, block_size / vector_length); - int total_shmem = shmem_block + shmem_thread * (block_size / vector_length) + - functor_shmem + attr.sharedSizeBytes; - int max_blocks_regs = regs_per_sm / (regs_per_thread * block_size); - int max_blocks_shmem = - (total_shmem < max_shmem_per_block) - ? (total_shmem > 0 ? shmem_per_sm / total_shmem : max_blocks_regs) - : 0; - int blocks_per_sm = std::min(max_blocks_regs, max_blocks_shmem); - int threads_per_sm = blocks_per_sm * block_size; - if (threads_per_sm > max_threads_per_sm) { - blocks_per_sm = max_threads_per_sm / block_size; - threads_per_sm = blocks_per_sm * block_size; - } - int opt_block_size = (blocks_per_sm >= min_blocks_per_sm) ? block_size : 0; - int opt_threads_per_sm = threads_per_sm; + size_t const dynamic_shmem = shmem_block + + shmem_thread * (block_size / vector_length) + + functor_shmem; + return dynamic_shmem; + }; - block_size -= 32; - while ((block_size >= 32)) { - functor_shmem = - FunctorTeamShmemSize::value(f, block_size / vector_length); - total_shmem = shmem_block + shmem_thread * (block_size / vector_length) + - functor_shmem + attr.sharedSizeBytes; - max_blocks_regs = regs_per_sm / (regs_per_thread * block_size); - max_blocks_shmem = - (total_shmem < max_shmem_per_block) - ? (total_shmem > 0 ? shmem_per_sm / total_shmem : max_blocks_regs) - : 0; - blocks_per_sm = std::min(max_blocks_regs, max_blocks_shmem); - threads_per_sm = blocks_per_sm * block_size; - if (threads_per_sm > max_threads_per_sm) { - blocks_per_sm = max_threads_per_sm / block_size; - threads_per_sm = blocks_per_sm * block_size; - } - if ((blocks_per_sm >= min_blocks_per_sm) && - (blocks_per_sm <= max_blocks_per_sm)) { - if (threads_per_sm >= opt_threads_per_sm) { - opt_block_size = block_size; - opt_threads_per_sm = threads_per_sm; - } - } - block_size -= 32; - } - return opt_block_size; + return cuda_deduce_block_size(false, prop, attr, block_size_to_dynamic_shmem, + LaunchBounds{}); } -template -struct CudaGetOptBlockSize, true> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int blockSize = 16; - int numBlocks; - int sharedmem; - int maxOccupancy = 0; - int bestBlockSize = 0; - - while (blockSize < 1024) { - blockSize *= 2; - - // calculate the occupancy with that optBlockSize and check whether its - // larger than the largest one found so far - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - if (maxOccupancy < numBlocks * blockSize) { - maxOccupancy = numBlocks * blockSize; - bestBlockSize = blockSize; - } - } - return bestBlockSize; - } -}; - -template -struct CudaGetOptBlockSize, false> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int blockSize = 16; - int numBlocks; - int sharedmem; - int maxOccupancy = 0; - int bestBlockSize = 0; - - while (blockSize < 1024) { - blockSize *= 2; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, cuda_parallel_launch_local_memory, blockSize, - sharedmem); - - if (maxOccupancy < numBlocks * blockSize) { - maxOccupancy = numBlocks * blockSize; - bestBlockSize = blockSize; - } - } - return bestBlockSize; - } -}; - -template -struct CudaGetOptBlockSize< - DriverType, Kokkos::LaunchBounds, - true> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int blockSize = 16; - int numBlocks; - int sharedmem; - int maxOccupancy = 0; - int bestBlockSize = 0; - int max_threads_per_block = - std::min(MaxThreadsPerBlock, - cuda_internal_maximum_warp_count() * CudaTraits::WarpSize); - - while (blockSize < max_threads_per_block) { - blockSize *= 2; - - // calculate the occupancy with that optBlockSize and check whether its - // larger than the largest one found so far - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, - cuda_parallel_launch_constant_memory, - blockSize, sharedmem); - if (numBlocks >= int(MinBlocksPerSM) && - blockSize <= int(MaxThreadsPerBlock)) { - if (maxOccupancy < numBlocks * blockSize) { - maxOccupancy = numBlocks * blockSize; - bestBlockSize = blockSize; - } - } - } - if (maxOccupancy > 0) return bestBlockSize; - return -1; - } -}; - -template -struct CudaGetOptBlockSize< - DriverType, Kokkos::LaunchBounds, - false> { - static int get_block_size(const typename DriverType::functor_type& f, - const size_t vector_length, - const size_t shmem_extra_block, - const size_t shmem_extra_thread) { - int blockSize = 16; - int numBlocks; - int sharedmem; - int maxOccupancy = 0; - int bestBlockSize = 0; - int max_threads_per_block = - std::min(MaxThreadsPerBlock, - cuda_internal_maximum_warp_count() * CudaTraits::WarpSize); - - while (blockSize < max_threads_per_block) { - blockSize *= 2; - sharedmem = - shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + - FunctorTeamShmemSize::value( - f, blockSize / vector_length); - - cudaOccupancyMaxActiveBlocksPerMultiprocessor( - &numBlocks, - cuda_parallel_launch_local_memory, - blockSize, sharedmem); - if (numBlocks >= int(MinBlocksPerSM) && - blockSize <= int(MaxThreadsPerBlock)) { - if (maxOccupancy < numBlocks * blockSize) { - maxOccupancy = numBlocks * blockSize; - bestBlockSize = blockSize; - } - } - } - if (maxOccupancy > 0) return bestBlockSize; - return -1; - } -}; - } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp index 01e60315ee..4759001d81 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Error.hpp @@ -50,7 +50,7 @@ #include -#include +#include namespace Kokkos { namespace Impl { @@ -113,12 +113,7 @@ class CudaRawMemoryAllocationFailure : public RawMemoryAllocationFailure { get_failure_mode(arg_error_code), arg_mechanism), m_error_code(arg_error_code) {} - void append_additional_error_information(std::ostream& o) const override { - if (m_error_code != cudaSuccess) { - o << " The Cuda allocation returned the error code \"\"" - << cudaGetErrorName(m_error_code) << "\"."; - } - } + void append_additional_error_information(std::ostream& o) const override; }; } // end namespace Experimental diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp index 37d0ffb687..e4bb7d3c52 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.cpp @@ -55,7 +55,7 @@ #include #include #include -#include +#include /*--------------------------------------------------------------------------*/ /* Standard 'C' libraries */ @@ -134,7 +134,7 @@ bool cuda_launch_blocking() { if (env == 0) return false; - return atoi(env); + return std::stoi(env); } #endif @@ -239,8 +239,9 @@ const CudaInternalDevices &CudaInternalDevices::singleton() { } // namespace -int CudaInternal::was_initialized = 0; -int CudaInternal::was_finalized = 0; +unsigned long *CudaInternal::constantMemHostStaging = nullptr; +cudaEvent_t CudaInternal::constantMemReusable = nullptr; + //---------------------------------------------------------------------------- void CudaInternal::print_configuration(std::ostream &s) const { @@ -288,11 +289,11 @@ CudaInternal::~CudaInternal() { m_scratchUnifiedCount = 0; m_scratchUnifiedSupported = 0; m_streamCount = 0; - m_scratchSpace = 0; - m_scratchFlags = 0; - m_scratchUnified = 0; - m_scratchConcurrentBitset = 0; - m_stream = 0; + m_scratchSpace = nullptr; + m_scratchFlags = nullptr; + m_scratchUnified = nullptr; + m_scratchConcurrentBitset = nullptr; + m_stream = nullptr; } int CudaInternal::verify_is_initialized(const char *const label) const { @@ -307,22 +308,20 @@ CudaInternal &CudaInternal::singleton() { static CudaInternal self; return self; } -void CudaInternal::fence() const { cudaStreamSynchronize(m_stream); } +void CudaInternal::fence() const { + CUDA_SAFE_CALL(cudaStreamSynchronize(m_stream)); +} void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream) { if (was_finalized) Kokkos::abort("Calling Cuda::initialize after Cuda::finalize is illegal\n"); - was_initialized = 1; + was_initialized = true; if (is_initialized()) return; enum { WordSize = sizeof(size_type) }; #ifndef KOKKOS_IMPL_TURN_OFF_CUDA_HOST_INIT_CHECK -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (!HostSpace::execution_space::is_initialized()) { -#else if (!HostSpace::execution_space::impl_is_initialized()) { -#endif const std::string msg( "Cuda::initialize ERROR : HostSpace::execution_space is not " "initialized"); @@ -332,7 +331,7 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream) { const CudaInternalDevices &dev_info = CudaInternalDevices::singleton(); - const bool ok_init = 0 == m_scratchSpace || 0 == m_scratchFlags; + const bool ok_init = nullptr == m_scratchSpace || nullptr == m_scratchFlags; const bool ok_id = 0 <= cuda_device_id && cuda_device_id < dev_info.m_cudaDevCount; @@ -366,7 +365,7 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream) { int compiled_major = m_cudaArch / 100; int compiled_minor = (m_cudaArch % 100) / 10; - if (compiled_major != cudaProp.major || compiled_minor < cudaProp.minor) { + if (compiled_major != cudaProp.major || compiled_minor > cudaProp.minor) { std::stringstream ss; ss << "Kokkos::Cuda::initialize ERROR: running kernels compiled for " "compute capability " @@ -453,8 +452,8 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream) { // Allocate and initialize uint32_t[ buffer_bound ] - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; Record *const r = Record::allocate(Kokkos::CudaSpace(), "InternalScratchBitset", @@ -511,7 +510,7 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream) { if (env_force_device_alloc == 0) force_device_alloc = false; else - force_device_alloc = atoi(env_force_device_alloc) != 0; + force_device_alloc = std::stoi(env_force_device_alloc) != 0; const char *env_visible_devices = getenv("CUDA_VISIBLE_DEVICES"); bool visible_devices_one = true; @@ -542,14 +541,23 @@ void CudaInternal::initialize(int cuda_device_id, cudaStream_t stream) { #endif // Init the array for used for arbitrarily sized atomics - if (stream == 0) Impl::initialize_host_cuda_lock_arrays(); + if (stream == nullptr) Impl::initialize_host_cuda_lock_arrays(); + + // Allocate a staging buffer for constant mem in pinned host memory + // and an event to avoid overwriting driver for previous kernel launches + if (stream == nullptr) { + CUDA_SAFE_CALL(cudaMallocHost((void **)&constantMemHostStaging, + CudaTraits::ConstantMemoryUsage)); + + CUDA_SAFE_CALL(cudaEventCreate(&constantMemReusable)); + } m_stream = stream; } //---------------------------------------------------------------------------- -typedef Cuda::size_type ScratchGrain[Impl::CudaTraits::WarpSize]; +using ScratchGrain = Cuda::size_type[Impl::CudaTraits::WarpSize]; enum { sizeScratchGrain = sizeof(ScratchGrain) }; Cuda::size_type *CudaInternal::scratch_flags(const Cuda::size_type size) const { @@ -557,8 +565,8 @@ Cuda::size_type *CudaInternal::scratch_flags(const Cuda::size_type size) const { m_scratchFlagsCount * sizeScratchGrain < size) { m_scratchFlagsCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; if (m_scratchFlags) Record::decrement(Record::get_record(m_scratchFlags)); @@ -582,8 +590,8 @@ Cuda::size_type *CudaInternal::scratch_space(const Cuda::size_type size) const { m_scratchSpaceCount * sizeScratchGrain < size) { m_scratchSpaceCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; if (m_scratchSpace) Record::decrement(Record::get_record(m_scratchSpace)); @@ -605,9 +613,8 @@ Cuda::size_type *CudaInternal::scratch_unified( m_scratchUnifiedCount * sizeScratchGrain < size) { m_scratchUnifiedCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; if (m_scratchUnified) Record::decrement(Record::get_record(m_scratchUnified)); @@ -629,8 +636,8 @@ Cuda::size_type *CudaInternal::scratch_functor( if (verify_is_initialized("scratch_functor") && m_scratchFunctorSize < size) { m_scratchFunctorSize = size; - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; if (m_scratchFunctor) Record::decrement(Record::get_record(m_scratchFunctor)); @@ -649,15 +656,13 @@ Cuda::size_type *CudaInternal::scratch_functor( //---------------------------------------------------------------------------- void CudaInternal::finalize() { - was_finalized = 1; - if (0 != m_scratchSpace || 0 != m_scratchFlags) { + was_finalized = true; + if (nullptr != m_scratchSpace || nullptr != m_scratchFlags) { Impl::finalize_host_cuda_lock_arrays(); - if (m_stream != 0) cudaStreamDestroy(m_stream); - - typedef Kokkos::Impl::SharedAllocationRecord RecordCuda; - typedef Kokkos::Impl::SharedAllocationRecord - RecordHost; + using RecordCuda = Kokkos::Impl::SharedAllocationRecord; + using RecordHost = + Kokkos::Impl::SharedAllocationRecord; RecordCuda::decrement(RecordCuda::get_record(m_scratchFlags)); RecordCuda::decrement(RecordCuda::get_record(m_scratchSpace)); @@ -675,11 +680,17 @@ void CudaInternal::finalize() { m_scratchFlagsCount = 0; m_scratchUnifiedCount = 0; m_streamCount = 0; - m_scratchSpace = 0; - m_scratchFlags = 0; - m_scratchUnified = 0; - m_scratchConcurrentBitset = 0; - m_stream = 0; + m_scratchSpace = nullptr; + m_scratchFlags = nullptr; + m_scratchUnified = nullptr; + m_scratchConcurrentBitset = nullptr; + m_stream = nullptr; + } + + // only destroy these if we're finalizing the singleton + if (this == &singleton()) { + cudaFreeHost(constantMemHostStaging); + cudaEventDestroy(constantMemReusable); } } @@ -743,27 +754,13 @@ int Cuda::concurrency() { return Impl::CudaInternal::singleton().m_maxConcurrency; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -int Cuda::is_initialized() -#else -int Cuda::impl_is_initialized() -#endif -{ +int Cuda::impl_is_initialized() { return Impl::CudaInternal::singleton().is_initialized(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void Cuda::initialize(const Cuda::SelectDevice config, size_t num_instances) -#else void Cuda::impl_initialize(const Cuda::SelectDevice config, - size_t /*num_instances*/) -#endif -{ - Impl::CudaInternal::singleton().initialize(config.cuda_device_id, 0); - -#if defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::initialize(); -#endif + size_t /*num_instances*/) { + Impl::CudaInternal::singleton().initialize(config.cuda_device_id, nullptr); } std::vector Cuda::detect_device_arch() { @@ -793,48 +790,72 @@ Cuda::size_type Cuda::device_arch() { return dev_arch; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void Cuda::finalize() -#else -void Cuda::impl_finalize() -#endif -{ - Impl::CudaInternal::singleton().finalize(); +void Cuda::impl_finalize() { Impl::CudaInternal::singleton().finalize(); } -#if defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::finalize(); -#endif -} - -Cuda::Cuda() : m_space_instance(&Impl::CudaInternal::singleton()) { +Cuda::Cuda() + : m_space_instance(&Impl::CudaInternal::singleton()), m_counter(nullptr) { Impl::CudaInternal::singleton().verify_is_initialized( "Cuda instance constructor"); } -Cuda::Cuda(cudaStream_t stream) : m_space_instance(new Impl::CudaInternal) { +Cuda::Cuda(cudaStream_t stream) + : m_space_instance(new Impl::CudaInternal), m_counter(new int(1)) { Impl::CudaInternal::singleton().verify_is_initialized( "Cuda instance constructor"); m_space_instance->initialize(Impl::CudaInternal::singleton().m_cudaDev, stream); } +KOKKOS_FUNCTION Cuda::Cuda(Cuda &&other) noexcept { + m_space_instance = other.m_space_instance; + other.m_space_instance = nullptr; + m_counter = other.m_counter; + other.m_counter = nullptr; +} + +KOKKOS_FUNCTION Cuda::Cuda(const Cuda &other) + : m_space_instance(other.m_space_instance), m_counter(other.m_counter) { +#ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA + if (m_counter) Kokkos::atomic_add(m_counter, 1); +#endif +} + +KOKKOS_FUNCTION Cuda &Cuda::operator=(Cuda &&other) noexcept { + m_space_instance = other.m_space_instance; + other.m_space_instance = nullptr; + m_counter = other.m_counter; + other.m_counter = nullptr; + return *this; +} + +KOKKOS_FUNCTION Cuda &Cuda::operator=(const Cuda &other) { + m_space_instance = other.m_space_instance; + m_counter = other.m_counter; +#ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA + if (m_counter) Kokkos::atomic_add(m_counter, 1); +#endif + return *this; +} + +KOKKOS_FUNCTION Cuda::~Cuda() noexcept { +#ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA + if (m_counter == nullptr) return; + int const count = Kokkos::atomic_fetch_sub(m_counter, 1); + if (count == 1) { + delete m_counter; + m_space_instance->finalize(); + delete m_space_instance; + } +#endif +} + void Cuda::print_configuration(std::ostream &s, const bool) { Impl::CudaInternal::singleton().print_configuration(s); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -bool Cuda::sleep() { return false; } - -bool Cuda::wake() { return true; } -#endif - void Cuda::impl_static_fence() { Kokkos::Impl::cuda_device_synchronize(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void Cuda::fence() { impl_static_fence(); } -#else void Cuda::fence() const { m_space_instance->fence(); } -#endif const char *Cuda::name() { return "Cuda"; } diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp index 2158f03dd5..6e9118e156 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Instance.hpp @@ -1,6 +1,8 @@ #ifndef KOKKOS_CUDA_INSTANCE_HPP_ #define KOKKOS_CUDA_INSTANCE_HPP_ +#include +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- // These functions fulfill the purpose of allowing to work around @@ -15,25 +17,28 @@ namespace Kokkos { namespace Impl { struct CudaTraits { - enum { WarpSize = 32 /* 0x0020 */ }; - enum { WarpIndexMask = 0x001f /* Mask for warpindex */ }; - enum { WarpIndexShift = 5 /* WarpSize == 1 << WarpShift */ }; - - enum { ConstantMemoryUsage = 0x008000 /* 32k bytes */ }; - enum { ConstantMemoryCache = 0x002000 /* 8k bytes */ }; - enum { KernelArgumentLimit = 0x001000 /* 4k bytes */ }; - - typedef unsigned long - ConstantGlobalBufferType[ConstantMemoryUsage / sizeof(unsigned long)]; - -#if defined(KOKKOS_ARCH_VOLTA) || defined(KOKKOS_ARCH_PASCAL) - enum { - ConstantMemoryUseThreshold = - 0x000200 /* 0 bytes -> always use constant (or global)*/ + enum : CudaSpace::size_type { WarpSize = 32 /* 0x0020 */ }; + enum : CudaSpace::size_type { + WarpIndexMask = 0x001f /* Mask for warpindex */ }; -#else + enum : CudaSpace::size_type { + WarpIndexShift = 5 /* WarpSize == 1 << WarpShift */ + }; + + enum : CudaSpace::size_type { + ConstantMemoryUsage = 0x008000 /* 32k bytes */ + }; + enum : CudaSpace::size_type { + ConstantMemoryCache = 0x002000 /* 8k bytes */ + }; + enum : CudaSpace::size_type { + KernelArgumentLimit = 0x001000 /* 4k bytes */ + }; + + using ConstantGlobalBufferType = + unsigned long[ConstantMemoryUsage / sizeof(unsigned long)]; + enum { ConstantMemoryUseThreshold = 0x000200 /* 512 bytes */ }; -#endif KOKKOS_INLINE_FUNCTION static CudaSpace::size_type warp_count( CudaSpace::size_type i) { @@ -42,7 +47,7 @@ struct CudaTraits { KOKKOS_INLINE_FUNCTION static CudaSpace::size_type warp_align( CudaSpace::size_type i) { - enum { Mask = ~CudaSpace::size_type(WarpIndexMask) }; + constexpr CudaSpace::size_type Mask = ~WarpIndexMask; return (i + WarpIndexMask) & Mask; } }; @@ -79,7 +84,7 @@ class CudaInternal { #endif public: - typedef Cuda::size_type size_type; + using size_type = Cuda::size_type; int m_cudaDev; @@ -112,18 +117,23 @@ class CudaInternal { uint32_t* m_scratchConcurrentBitset; cudaStream_t m_stream; - static int was_initialized; - static int was_finalized; + bool was_initialized = false; + bool was_finalized = false; + + // FIXME_CUDA: these want to be per-device, not per-stream... use of 'static' + // here will break once there are multiple devices though + static unsigned long* constantMemHostStaging; + static cudaEvent_t constantMemReusable; static CudaInternal& singleton(); int verify_is_initialized(const char* const label) const; int is_initialized() const { - return 0 != m_scratchSpace && 0 != m_scratchFlags; + return nullptr != m_scratchSpace && nullptr != m_scratchFlags; } - void initialize(int cuda_device_id, cudaStream_t stream = 0); + void initialize(int cuda_device_id, cudaStream_t stream = nullptr); void finalize(); void print_configuration(std::ostream&) const; @@ -157,12 +167,12 @@ class CudaInternal { m_scratchFunctorSize(0), m_scratchUnifiedSupported(0), m_streamCount(0), - m_scratchSpace(0), - m_scratchFlags(0), - m_scratchUnified(0), - m_scratchFunctor(0), - m_scratchConcurrentBitset(0), - m_stream(0) {} + m_scratchSpace(nullptr), + m_scratchFlags(nullptr), + m_scratchUnified(nullptr), + m_scratchFunctor(nullptr), + m_scratchConcurrentBitset(nullptr), + m_stream(nullptr) {} size_type* scratch_space(const size_type size) const; size_type* scratch_flags(const size_type size) const; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp index ca72b3b302..c30e142558 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_KernelLaunch.hpp @@ -244,9 +244,6 @@ struct CudaParallelLaunch< const CudaInternal* cuda_instance, const bool prefer_shmem) { if ((grid.x != 0) && ((block.x * block.y * block.z) != 0)) { - // Fence before changing settings and copying closure - Kokkos::Cuda().fence(); - if (cuda_instance->m_maxShmemPerBlock < shmem) { Kokkos::Impl::throw_runtime_exception(std::string( "CudaParallelLaunch FAILED: shared memory request is too large")); @@ -254,28 +251,43 @@ struct CudaParallelLaunch< #ifndef KOKKOS_ARCH_KEPLER // On Kepler the L1 has no benefit since it doesn't cache reads else { - CUDA_SAFE_CALL(cudaFuncSetCacheConfig( - cuda_parallel_launch_constant_memory, - (prefer_shmem ? cudaFuncCachePreferShared - : cudaFuncCachePreferL1))); + static bool cache_config_set = false; + if (!cache_config_set) { + CUDA_SAFE_CALL(cudaFuncSetCacheConfig( + cuda_parallel_launch_constant_memory< + DriverType, MaxThreadsPerBlock, MinBlocksPerSM>, + (prefer_shmem ? cudaFuncCachePreferShared + : cudaFuncCachePreferL1))); + cache_config_set = true; + } } #else (void)prefer_shmem; #endif - // Copy functor to constant memory on the device - cudaMemcpyToSymbolAsync(kokkos_impl_cuda_constant_memory_buffer, &driver, + KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE(); + + // Wait until the previous kernel that uses the constant buffer is done + CUDA_SAFE_CALL(cudaEventSynchronize(cuda_instance->constantMemReusable)); + + // Copy functor (synchronously) to staging buffer in pinned host memory + unsigned long* staging = cuda_instance->constantMemHostStaging; + memcpy(staging, &driver, sizeof(DriverType)); + + // Copy functor asynchronously from there to constant memory on the device + cudaMemcpyToSymbolAsync(kokkos_impl_cuda_constant_memory_buffer, staging, sizeof(DriverType), 0, cudaMemcpyHostToDevice, cudaStream_t(cuda_instance->m_stream)); - KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE(); - // Invoke the driver function on the device cuda_parallel_launch_constant_memory <<m_stream>>>(); + // Record an event that says when the constant buffer can be reused + CUDA_SAFE_CALL(cudaEventRecord(cuda_instance->constantMemReusable, + cudaStream_t(cuda_instance->m_stream))); + #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) CUDA_SAFE_CALL(cudaGetLastError()); Kokkos::Cuda().fence(); @@ -284,11 +296,15 @@ struct CudaParallelLaunch< } static cudaFuncAttributes get_cuda_func_attributes() { - cudaFuncAttributes attr; - CUDA_SAFE_CALL(cudaFuncGetAttributes( - &attr, - cuda_parallel_launch_constant_memory)); + static cudaFuncAttributes attr; + static bool attr_set = false; + if (!attr_set) { + CUDA_SAFE_CALL(cudaFuncGetAttributes( + &attr, + cuda_parallel_launch_constant_memory)); + attr_set = true; + } return attr; } }; @@ -304,9 +320,6 @@ struct CudaParallelLaunch, const CudaInternal* cuda_instance, const bool prefer_shmem) { if ((grid.x != 0) && ((block.x * block.y * block.z) != 0)) { - // Fence before changing settings and copying closure - Kokkos::Cuda().fence(); - if (cuda_instance->m_maxShmemPerBlock < shmem) { Kokkos::Impl::throw_runtime_exception(std::string( "CudaParallelLaunch FAILED: shared memory request is too large")); @@ -314,26 +327,41 @@ struct CudaParallelLaunch, #ifndef KOKKOS_ARCH_KEPLER // On Kepler the L1 has no benefit since it doesn't cache reads else { - CUDA_SAFE_CALL(cudaFuncSetCacheConfig( - cuda_parallel_launch_constant_memory, - (prefer_shmem ? cudaFuncCachePreferShared - : cudaFuncCachePreferL1))); + static bool cache_config_set = false; + if (!cache_config_set) { + CUDA_SAFE_CALL(cudaFuncSetCacheConfig( + cuda_parallel_launch_constant_memory, + (prefer_shmem ? cudaFuncCachePreferShared + : cudaFuncCachePreferL1))); + cache_config_set = true; + } } #else (void)prefer_shmem; #endif - // Copy functor to constant memory on the device - cudaMemcpyToSymbolAsync(kokkos_impl_cuda_constant_memory_buffer, &driver, + KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE(); + + // Wait until the previous kernel that uses the constant buffer is done + CUDA_SAFE_CALL(cudaEventSynchronize(cuda_instance->constantMemReusable)); + + // Copy functor (synchronously) to staging buffer in pinned host memory + unsigned long* staging = cuda_instance->constantMemHostStaging; + memcpy(staging, &driver, sizeof(DriverType)); + + // Copy functor asynchronously from there to constant memory on the device + cudaMemcpyToSymbolAsync(kokkos_impl_cuda_constant_memory_buffer, staging, sizeof(DriverType), 0, cudaMemcpyHostToDevice, cudaStream_t(cuda_instance->m_stream)); - KOKKOS_ENSURE_CUDA_LOCK_ARRAYS_ON_DEVICE(); - // Invoke the driver function on the device cuda_parallel_launch_constant_memory <<m_stream>>>(); + // Record an event that says when the constant buffer can be reused + CUDA_SAFE_CALL(cudaEventRecord(cuda_instance->constantMemReusable, + cudaStream_t(cuda_instance->m_stream))); + #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) CUDA_SAFE_CALL(cudaGetLastError()); Kokkos::Cuda().fence(); @@ -342,9 +370,13 @@ struct CudaParallelLaunch, } static cudaFuncAttributes get_cuda_func_attributes() { - cudaFuncAttributes attr; - CUDA_SAFE_CALL(cudaFuncGetAttributes( - &attr, cuda_parallel_launch_constant_memory)); + static cudaFuncAttributes attr; + static bool attr_set = false; + if (!attr_set) { + CUDA_SAFE_CALL(cudaFuncGetAttributes( + &attr, cuda_parallel_launch_constant_memory)); + attr_set = true; + } return attr; } }; @@ -369,11 +401,15 @@ struct CudaParallelLaunch< #ifndef KOKKOS_ARCH_KEPLER // On Kepler the L1 has no benefit since it doesn't cache reads else { - CUDA_SAFE_CALL(cudaFuncSetCacheConfig( - cuda_parallel_launch_local_memory, - (prefer_shmem ? cudaFuncCachePreferShared - : cudaFuncCachePreferL1))); + static bool cache_config_set = false; + if (!cache_config_set) { + CUDA_SAFE_CALL(cudaFuncSetCacheConfig( + cuda_parallel_launch_local_memory, + (prefer_shmem ? cudaFuncCachePreferShared + : cudaFuncCachePreferL1))); + cache_config_set = true; + } } #else (void)prefer_shmem; @@ -394,10 +430,15 @@ struct CudaParallelLaunch< } static cudaFuncAttributes get_cuda_func_attributes() { - cudaFuncAttributes attr; - CUDA_SAFE_CALL(cudaFuncGetAttributes( - &attr, cuda_parallel_launch_local_memory)); + static cudaFuncAttributes attr; + static bool attr_set = false; + if (!attr_set) { + CUDA_SAFE_CALL(cudaFuncGetAttributes( + &attr, + cuda_parallel_launch_local_memory)); + attr_set = true; + } return attr; } }; @@ -420,10 +461,14 @@ struct CudaParallelLaunch, #ifndef KOKKOS_ARCH_KEPLER // On Kepler the L1 has no benefit since it doesn't cache reads else { - CUDA_SAFE_CALL(cudaFuncSetCacheConfig( - cuda_parallel_launch_local_memory, - (prefer_shmem ? cudaFuncCachePreferShared - : cudaFuncCachePreferL1))); + static bool cache_config_set = false; + if (!cache_config_set) { + CUDA_SAFE_CALL(cudaFuncSetCacheConfig( + cuda_parallel_launch_local_memory, + (prefer_shmem ? cudaFuncCachePreferShared + : cudaFuncCachePreferL1))); + cache_config_set = true; + } } #else (void)prefer_shmem; @@ -443,9 +488,13 @@ struct CudaParallelLaunch, } static cudaFuncAttributes get_cuda_func_attributes() { - cudaFuncAttributes attr; - CUDA_SAFE_CALL(cudaFuncGetAttributes( - &attr, cuda_parallel_launch_local_memory)); + static cudaFuncAttributes attr; + static bool attr_set = false; + if (!attr_set) { + CUDA_SAFE_CALL(cudaFuncGetAttributes( + &attr, cuda_parallel_launch_local_memory)); + attr_set = true; + } return attr; } }; @@ -467,11 +516,15 @@ struct CudaParallelLaunch< #ifndef KOKKOS_ARCH_KEPLER // On Kepler the L1 has no benefit since it doesn't cache reads else { - CUDA_SAFE_CALL(cudaFuncSetCacheConfig( - cuda_parallel_launch_global_memory, - (prefer_shmem ? cudaFuncCachePreferShared - : cudaFuncCachePreferL1))); + static bool cache_config_set = false; + if (!cache_config_set) { + CUDA_SAFE_CALL(cudaFuncSetCacheConfig( + cuda_parallel_launch_global_memory, + (prefer_shmem ? cudaFuncCachePreferShared + : cudaFuncCachePreferL1))); + cache_config_set = true; + } } #else (void)prefer_shmem; @@ -497,11 +550,15 @@ struct CudaParallelLaunch< } } static cudaFuncAttributes get_cuda_func_attributes() { - cudaFuncAttributes attr; - CUDA_SAFE_CALL(cudaFuncGetAttributes( - &attr, - cuda_parallel_launch_global_memory)); + static cudaFuncAttributes attr; + static bool attr_set = false; + if (!attr_set) { + CUDA_SAFE_CALL(cudaFuncGetAttributes( + &attr, + cuda_parallel_launch_global_memory)); + attr_set = true; + } return attr; } }; @@ -521,10 +578,14 @@ struct CudaParallelLaunch, #ifndef KOKKOS_ARCH_KEPLER // On Kepler the L1 has no benefit since it doesn't cache reads else { - CUDA_SAFE_CALL(cudaFuncSetCacheConfig( - cuda_parallel_launch_global_memory, - (prefer_shmem ? cudaFuncCachePreferShared - : cudaFuncCachePreferL1))); + static bool cache_config_set = false; + if (!cache_config_set) { + CUDA_SAFE_CALL(cudaFuncSetCacheConfig( + cuda_parallel_launch_global_memory, + (prefer_shmem ? cudaFuncCachePreferShared + : cudaFuncCachePreferL1))); + cache_config_set = true; + } } #else (void)prefer_shmem; @@ -549,9 +610,13 @@ struct CudaParallelLaunch, } static cudaFuncAttributes get_cuda_func_attributes() { - cudaFuncAttributes attr; - CUDA_SAFE_CALL(cudaFuncGetAttributes( - &attr, cuda_parallel_launch_global_memory)); + static cudaFuncAttributes attr; + static bool attr_set = false; + if (!attr_set) { + CUDA_SAFE_CALL(cudaFuncGetAttributes( + &attr, cuda_parallel_launch_global_memory)); + attr_set = true; + } return attr; } }; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp index 71ddadf74e..c252fbfec3 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Parallel.hpp @@ -48,8 +48,8 @@ #include #if defined(__CUDACC__) && defined(KOKKOS_ENABLE_CUDA) -#include #include +#include #include #include @@ -63,10 +63,8 @@ #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include +#include #include -#endif #include @@ -84,9 +82,9 @@ class TeamPolicyInternal : public PolicyTraits { public: //! Tag this class as a kokkos execution policy - typedef TeamPolicyInternal execution_policy; + using execution_policy = TeamPolicyInternal; - typedef PolicyTraits traits; + using traits = PolicyTraits; template friend class TeamPolicyInternal; @@ -104,7 +102,7 @@ class TeamPolicyInternal public: //! Execution space of this execution policy - typedef Kokkos::Cuda execution_space; + using execution_space = Kokkos::Cuda; template TeamPolicyInternal(const TeamPolicyInternal& p) { @@ -119,50 +117,12 @@ class TeamPolicyInternal m_space = p.m_space; } - TeamPolicyInternal& operator=(const TeamPolicyInternal& p) { - m_league_size = p.m_league_size; - m_team_size = p.m_team_size; - m_vector_length = p.m_vector_length; - m_team_scratch_size[0] = p.m_team_scratch_size[0]; - m_team_scratch_size[1] = p.m_team_scratch_size[1]; - m_thread_scratch_size[0] = p.m_thread_scratch_size[0]; - m_thread_scratch_size[1] = p.m_thread_scratch_size[1]; - m_chunk_size = p.m_chunk_size; - m_space = p.m_space; - return *this; - } - //---------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - static inline int team_size_max(const FunctorType& functor) { - int n = MAX_WARP * Impl::CudaTraits::WarpSize; - - for (; n; n >>= 1) { - const int shmem_size = - /* for global reduce */ Impl:: - cuda_single_inter_block_reduce_scan_shmem< - false, FunctorType, typename traits::work_tag>(functor, n) - /* for team reduce */ - + (n + 2) * sizeof(double) - /* for team shared */ - + Impl::FunctorTeamShmemSize::value(functor, n); - - if (shmem_size < typename traits::execution_space() - .impl_internal_space_instance() - ->m_maxShmemPerBlock) - break; - } - - return n; - } -#endif - template int team_size_max(const FunctorType& f, const ParallelForTag&) const { - typedef Impl::ParallelFor> - closure_type; + using closure_type = + Impl::ParallelFor>; cudaFuncAttributes attr = CudaParallelLaunch:: get_cuda_func_attributes(); @@ -179,15 +139,15 @@ class TeamPolicyInternal template inline int team_size_max(const FunctorType& f, const ParallelReduceTag&) const { - typedef Impl::FunctorAnalysis - functor_analysis_type; - typedef typename Impl::ParallelReduceReturnValue< + using functor_analysis_type = + Impl::FunctorAnalysis; + using reducer_type = typename Impl::ParallelReduceReturnValue< void, typename functor_analysis_type::value_type, - FunctorType>::reducer_type reducer_type; - typedef Impl::ParallelReduce, - reducer_type> - closure_type; + FunctorType>::reducer_type; + using closure_type = + Impl::ParallelReduce, + reducer_type>; return internal_team_size_max(f); } @@ -200,25 +160,10 @@ class TeamPolicyInternal return internal_team_size_max(f); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - static int team_size_recommended(const FunctorType& functor) { - return team_size_max(functor); - } - - template - static int team_size_recommended(const FunctorType& functor, - const int vector_length) { - int max = team_size_max(functor) / vector_length; - if (max < 1) max = 1; - return max; - } -#endif - template int team_size_recommended(const FunctorType& f, const ParallelForTag&) const { - typedef Impl::ParallelFor> - closure_type; + using closure_type = + Impl::ParallelFor>; cudaFuncAttributes attr = CudaParallelLaunch:: get_cuda_func_attributes(); @@ -235,24 +180,24 @@ class TeamPolicyInternal template inline int team_size_recommended(const FunctorType& f, const ParallelReduceTag&) const { - typedef Impl::FunctorAnalysis - functor_analysis_type; - typedef typename Impl::ParallelReduceReturnValue< + using functor_analysis_type = + Impl::FunctorAnalysis; + using reducer_type = typename Impl::ParallelReduceReturnValue< void, typename functor_analysis_type::value_type, - FunctorType>::reducer_type reducer_type; - typedef Impl::ParallelReduce, - reducer_type> - closure_type; + FunctorType>::reducer_type; + using closure_type = + Impl::ParallelReduce, + reducer_type>; return internal_team_size_recommended(f); } template int team_size_recommended(const FunctorType& f, const ReducerType&, const ParallelReduceTag&) const { - typedef Impl::ParallelReduce, - ReducerType> - closure_type; + using closure_type = + Impl::ParallelReduce, + ReducerType>; return internal_team_size_recommended(f); } @@ -401,44 +346,6 @@ class TeamPolicyInternal inline int chunk_size() const { return m_chunk_size; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal set_chunk_size( - typename traits::index_type chunk_size_) const { - TeamPolicyInternal p = *this; - p.m_chunk_size = chunk_size_; - return p; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - return p; - }; - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - }; - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - }; -#else /** \brief set chunk_size to a discrete value*/ inline TeamPolicyInternal& set_chunk_size( typename traits::index_type chunk_size_) { @@ -471,46 +378,10 @@ class TeamPolicyInternal m_thread_scratch_size[level] = per_thread.value; return *this; } -#endif - typedef Kokkos::Impl::CudaTeamMember member_type; + using member_type = Kokkos::Impl::CudaTeamMember; protected: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal internal_set_chunk_size( - typename traits::index_type chunk_size_) { - m_chunk_size = chunk_size_; - return *this; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team) { - m_team_scratch_size[level] = per_team.value; - return *this; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerThreadValue& per_thread) { - m_thread_scratch_size[level] = per_thread.value; - return *this; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) { - m_team_scratch_size[level] = per_team.value; - m_thread_scratch_size[level] = per_thread.value; - return *this; - } -#endif - template int internal_team_size_common(const FunctorType& f, BlockSizeCallable&& block_size_callable) const { @@ -567,12 +438,12 @@ namespace Impl { template class ParallelFor, Kokkos::Cuda> { public: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; private: - typedef typename Policy::member_type Member; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::launch_bounds LaunchBounds; + using Member = typename Policy::member_type; + using WorkTag = typename Policy::work_tag; + using LaunchBounds = typename Policy::launch_bounds; const FunctorType m_functor; const Policy m_policy; @@ -595,7 +466,7 @@ class ParallelFor, Kokkos::Cuda> { } public: - typedef FunctorType functor_type; + using functor_type = FunctorType; inline __device__ void operator()(void) const { const Member work_stride = blockDim.y * gridDim.x; @@ -620,6 +491,7 @@ class ParallelFor, Kokkos::Cuda> { Kokkos::Impl::cuda_get_opt_block_size( m_policy.space().impl_internal_space_instance(), attr, m_functor, 1, 0, 0); + KOKKOS_ASSERT(block_size > 0); dim3 block(1, block_size, 1); dim3 grid( std::min( @@ -646,13 +518,13 @@ class ParallelFor, Kokkos::Cuda> { template class ParallelFor, Kokkos::Cuda> { public: - typedef Kokkos::MDRangePolicy Policy; + using Policy = Kokkos::MDRangePolicy; private: - using RP = Policy; - typedef typename Policy::array_index_type array_index_type; - typedef typename Policy::index_type index_type; - typedef typename Policy::launch_bounds LaunchBounds; + using RP = Policy; + using array_index_type = typename Policy::array_index_type; + using index_type = typename Policy::index_type; + using LaunchBounds = typename Policy::launch_bounds; const FunctorType m_functor; const Policy m_rp; @@ -666,29 +538,36 @@ class ParallelFor, Kokkos::Cuda> { } inline void execute() const { + using namespace std; + if (m_rp.m_num_tiles == 0) return; const array_index_type maxblocks = static_cast( m_rp.space().impl_internal_space_instance()->m_maxBlock); if (RP::rank == 2) { const dim3 block(m_rp.m_tile[0], m_rp.m_tile[1], 1); + KOKKOS_ASSERT(block.x > 0); + KOKKOS_ASSERT(block.y > 0); const dim3 grid( - std::min((m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1) / block.x, - maxblocks), - std::min((m_rp.m_upper[1] - m_rp.m_lower[1] + block.y - 1) / block.y, - maxblocks), + min((m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1) / block.x, + maxblocks), + min((m_rp.m_upper[1] - m_rp.m_lower[1] + block.y - 1) / block.y, + maxblocks), 1); CudaParallelLaunch( *this, grid, block, 0, m_rp.space().impl_internal_space_instance(), false); } else if (RP::rank == 3) { const dim3 block(m_rp.m_tile[0], m_rp.m_tile[1], m_rp.m_tile[2]); + KOKKOS_ASSERT(block.x > 0); + KOKKOS_ASSERT(block.y > 0); + KOKKOS_ASSERT(block.z > 0); const dim3 grid( - std::min((m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1) / block.x, - maxblocks), - std::min((m_rp.m_upper[1] - m_rp.m_lower[1] + block.y - 1) / block.y, - maxblocks), - std::min((m_rp.m_upper[2] - m_rp.m_lower[2] + block.z - 1) / block.z, - maxblocks)); + min((m_rp.m_upper[0] - m_rp.m_lower[0] + block.x - 1) / block.x, + maxblocks), + min((m_rp.m_upper[1] - m_rp.m_lower[1] + block.y - 1) / block.y, + maxblocks), + min((m_rp.m_upper[2] - m_rp.m_lower[2] + block.z - 1) / block.z, + maxblocks)); CudaParallelLaunch( *this, grid, block, 0, m_rp.space().impl_internal_space_instance(), false); @@ -697,14 +576,15 @@ class ParallelFor, Kokkos::Cuda> { // threadIdx.z const dim3 block(m_rp.m_tile[0] * m_rp.m_tile[1], m_rp.m_tile[2], m_rp.m_tile[3]); + KOKKOS_ASSERT(block.y > 0); + KOKKOS_ASSERT(block.z > 0); const dim3 grid( - std::min( - static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), + min(static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), static_cast(maxblocks)), - std::min((m_rp.m_upper[2] - m_rp.m_lower[2] + block.y - 1) / block.y, - maxblocks), - std::min((m_rp.m_upper[3] - m_rp.m_lower[3] + block.z - 1) / block.z, - maxblocks)); + min((m_rp.m_upper[2] - m_rp.m_lower[2] + block.y - 1) / block.y, + maxblocks), + min((m_rp.m_upper[3] - m_rp.m_lower[3] + block.z - 1) / block.z, + maxblocks)); CudaParallelLaunch( *this, grid, block, 0, m_rp.space().impl_internal_space_instance(), false); @@ -713,15 +593,14 @@ class ParallelFor, Kokkos::Cuda> { // threadIdx.z const dim3 block(m_rp.m_tile[0] * m_rp.m_tile[1], m_rp.m_tile[2] * m_rp.m_tile[3], m_rp.m_tile[4]); + KOKKOS_ASSERT(block.z > 0); const dim3 grid( - std::min( - static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), + min(static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), static_cast(maxblocks)), - std::min( - static_cast(m_rp.m_tile_end[2] * m_rp.m_tile_end[3]), + min(static_cast(m_rp.m_tile_end[2] * m_rp.m_tile_end[3]), static_cast(maxblocks)), - std::min((m_rp.m_upper[4] - m_rp.m_lower[4] + block.z - 1) / block.z, - maxblocks)); + min((m_rp.m_upper[4] - m_rp.m_lower[4] + block.z - 1) / block.z, + maxblocks)); CudaParallelLaunch( *this, grid, block, 0, m_rp.space().impl_internal_space_instance(), false); @@ -732,14 +611,11 @@ class ParallelFor, Kokkos::Cuda> { m_rp.m_tile[2] * m_rp.m_tile[3], m_rp.m_tile[4] * m_rp.m_tile[5]); const dim3 grid( - std::min( - static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), + min(static_cast(m_rp.m_tile_end[0] * m_rp.m_tile_end[1]), static_cast(maxblocks)), - std::min( - static_cast(m_rp.m_tile_end[2] * m_rp.m_tile_end[3]), + min(static_cast(m_rp.m_tile_end[2] * m_rp.m_tile_end[3]), static_cast(maxblocks)), - std::min( - static_cast(m_rp.m_tile_end[4] * m_rp.m_tile_end[5]), + min(static_cast(m_rp.m_tile_end[4] * m_rp.m_tile_end[5]), static_cast(maxblocks))); CudaParallelLaunch( *this, grid, block, 0, m_rp.space().impl_internal_space_instance(), @@ -760,16 +636,16 @@ template class ParallelFor, Kokkos::Cuda> { public: - typedef TeamPolicyInternal Policy; + using Policy = TeamPolicyInternal; private: - typedef typename Policy::member_type Member; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::launch_bounds LaunchBounds; + using Member = typename Policy::member_type; + using WorkTag = typename Policy::work_tag; + using LaunchBounds = typename Policy::launch_bounds; public: - typedef FunctorType functor_type; - typedef Cuda::size_type size_type; + using functor_type = FunctorType; + using size_type = Cuda::size_type; private: // Algorithmic constraints: blockDim.y is a power of two AND blockDim.y == @@ -941,34 +817,34 @@ template class ParallelReduce, ReducerType, Kokkos::Cuda> { public: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; private: - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; - typedef typename Policy::launch_bounds LaunchBounds; + using WorkRange = typename Policy::WorkRange; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; + using LaunchBounds = typename Policy::launch_bounds; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; public: - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::value_type value_type; - typedef typename ValueTraits::reference_type reference_type; - typedef FunctorType functor_type; - typedef Kokkos::Cuda::size_type size_type; - typedef typename Policy::index_type index_type; + using pointer_type = typename ValueTraits::pointer_type; + using value_type = typename ValueTraits::value_type; + using reference_type = typename ValueTraits::reference_type; + using functor_type = FunctorType; + using size_type = Kokkos::Cuda::size_type; + using index_type = typename Policy::index_type; // Algorithmic constraints: blockSize is a power of two AND blockDim.y == // blockDim.z == 1 @@ -990,8 +866,8 @@ class ParallelReduce, ReducerType, //}; // Some crutch to do function overloading private: - typedef double DummyShflReductionType; - typedef int DummySHMEMReductionType; + using DummyShflReductionType = double; + using DummySHMEMReductionType = int; public: // Make the exec_range calls call to Reduce::DeviceIterateTile @@ -1124,13 +1000,19 @@ class ParallelReduce, ReducerType, int shmem_size = cuda_single_inter_block_reduce_scan_shmem( f, n); + using closure_type = Impl::ParallelReduce; + cudaFuncAttributes attr = + CudaParallelLaunch::get_cuda_func_attributes(); while ( (n && (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < shmem_size)) || - (n > static_cast( - Kokkos::Impl::cuda_get_max_block_size< - ParallelReduce, LaunchBounds>(f, 1, shmem_size, 0)))) { + (n > + static_cast( + Kokkos::Impl::cuda_get_max_block_size( + m_policy.space().impl_internal_space_instance(), attr, f, 1, + shmem_size, 0)))) { n >>= 1; shmem_size = cuda_single_inter_block_reduce_scan_shmem(f, n); @@ -1142,6 +1024,7 @@ class ParallelReduce, ReducerType, const index_type nwork = m_policy.end() - m_policy.begin(); if (nwork) { const int block_size = local_block_size(m_functor); + KOKKOS_ASSERT(block_size > 0); m_scratch_space = cuda_internal_scratch_space( m_policy.space(), ValueTraits::value_size(ReducerConditional::select( @@ -1215,9 +1098,9 @@ class ParallelReduce, ReducerType, m_result_ptr_device_accessible( MemorySpaceAccess::accessible), - m_scratch_space(0), - m_scratch_flags(0), - m_unified_space(0) {} + m_scratch_space(nullptr), + m_scratch_flags(nullptr), + m_unified_space(nullptr) {} ParallelReduce(const FunctorType& arg_functor, const Policy& arg_policy, const ReducerType& reducer) @@ -1229,9 +1112,9 @@ class ParallelReduce, ReducerType, MemorySpaceAccess::accessible), - m_scratch_space(0), - m_scratch_flags(0), - m_unified_space(0) {} + m_scratch_space(nullptr), + m_scratch_flags(nullptr), + m_unified_space(nullptr) {} }; // MDRangePolicy impl @@ -1239,35 +1122,35 @@ template class ParallelReduce, ReducerType, Kokkos::Cuda> { public: - typedef Kokkos::MDRangePolicy Policy; + using Policy = Kokkos::MDRangePolicy; private: - typedef typename Policy::array_index_type array_index_type; - typedef typename Policy::index_type index_type; + using array_index_type = typename Policy::array_index_type; + using index_type = typename Policy::index_type; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; - typedef typename Policy::launch_bounds LaunchBounds; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; + using LaunchBounds = typename Policy::launch_bounds; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; public: - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::value_type value_type; - typedef typename ValueTraits::reference_type reference_type; - typedef FunctorType functor_type; - typedef Cuda::size_type size_type; + using pointer_type = typename ValueTraits::pointer_type; + using value_type = typename ValueTraits::value_type; + using reference_type = typename ValueTraits::reference_type; + using functor_type = FunctorType; + using size_type = Cuda::size_type; // Algorithmic constraints: blockSize is a power of two AND blockDim.y == // blockDim.z == 1 @@ -1281,10 +1164,9 @@ class ParallelReduce, ReducerType, size_type* m_scratch_flags; size_type* m_unified_space; - typedef typename Kokkos::Impl::Reduce::DeviceIterateTile< + using DeviceIteratePattern = typename Kokkos::Impl::Reduce::DeviceIterateTile< Policy::rank, Policy, FunctorType, typename Policy::work_tag, - reference_type> - DeviceIteratePattern; + reference_type>; // Shall we use the shfl based reduction or not (only use it for static sized // types of more than 128bit @@ -1294,8 +1176,8 @@ class ParallelReduce, ReducerType, }; // Some crutch to do function overloading private: - typedef double DummyShflReductionType; - typedef int DummySHMEMReductionType; + using DummyShflReductionType = double; + using DummySHMEMReductionType = int; public: inline __device__ void exec_range(reference_type update) const { @@ -1414,13 +1296,19 @@ class ParallelReduce, ReducerType, int shmem_size = cuda_single_inter_block_reduce_scan_shmem( f, n); + using closure_type = Impl::ParallelReduce; + cudaFuncAttributes attr = + CudaParallelLaunch::get_cuda_func_attributes(); while ( (n && (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < shmem_size)) || - (n > static_cast( - Kokkos::Impl::cuda_get_max_block_size< - ParallelReduce, LaunchBounds>(f, 1, shmem_size, 0)))) { + (n > + static_cast( + Kokkos::Impl::cuda_get_max_block_size( + m_policy.space().impl_internal_space_instance(), attr, f, 1, + shmem_size, 0)))) { n >>= 1; shmem_size = cuda_single_inter_block_reduce_scan_shmem(f, n); @@ -1507,9 +1395,9 @@ class ParallelReduce, ReducerType, m_result_ptr_device_accessible( MemorySpaceAccess::accessible), - m_scratch_space(0), - m_scratch_flags(0), - m_unified_space(0) {} + m_scratch_space(nullptr), + m_scratch_flags(nullptr), + m_unified_space(nullptr) {} ParallelReduce(const FunctorType& arg_functor, const Policy& arg_policy, const ReducerType& reducer) @@ -1521,9 +1409,9 @@ class ParallelReduce, ReducerType, MemorySpaceAccess::accessible), - m_scratch_space(0), - m_scratch_flags(0), - m_unified_space(0) {} + m_scratch_space(nullptr), + m_scratch_flags(nullptr), + m_unified_space(nullptr) {} }; //---------------------------------------------------------------------------- @@ -1532,39 +1420,39 @@ template class ParallelReduce, ReducerType, Kokkos::Cuda> { public: - typedef TeamPolicyInternal Policy; + using Policy = TeamPolicyInternal; private: - typedef typename Policy::member_type Member; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::launch_bounds LaunchBounds; + using Member = typename Policy::member_type; + using WorkTag = typename Policy::work_tag; + using LaunchBounds = typename Policy::launch_bounds; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; - typedef typename ValueTraits::value_type value_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; + using value_type = typename ValueTraits::value_type; public: - typedef FunctorType functor_type; - typedef Cuda::size_type size_type; + using functor_type = FunctorType; + using size_type = Cuda::size_type; enum { UseShflReduction = (true && (ValueTraits::StaticValueSize != 0)) }; private: - typedef double DummyShflReductionType; - typedef int DummySHMEMReductionType; + using DummyShflReductionType = double; + using DummySHMEMReductionType = int; // Algorithmic constraints: blockDim.y is a power of two AND blockDim.y == // blockDim.z == 1 shared memory utilization: @@ -1818,9 +1706,9 @@ class ParallelReduce, m_result_ptr_device_accessible( MemorySpaceAccess::accessible), - m_scratch_space(0), - m_scratch_flags(0), - m_unified_space(0), + m_scratch_space(nullptr), + m_scratch_flags(nullptr), + m_unified_space(nullptr), m_team_begin(0), m_shmem_begin(0), m_shmem_size(0), @@ -1917,9 +1805,9 @@ class ParallelReduce, MemorySpaceAccess::accessible), - m_scratch_space(0), - m_scratch_flags(0), - m_unified_space(0), + m_scratch_space(nullptr), + m_scratch_flags(nullptr), + m_unified_space(nullptr), m_team_begin(0), m_shmem_begin(0), m_shmem_size(0), @@ -2013,23 +1901,23 @@ namespace Impl { template class ParallelScan, Kokkos::Cuda> { public: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; private: - typedef typename Policy::member_type Member; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::launch_bounds LaunchBounds; + using Member = typename Policy::member_type; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using LaunchBounds = typename Policy::launch_bounds; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueOps = Kokkos::Impl::FunctorValueOps; public: - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; - typedef FunctorType functor_type; - typedef Cuda::size_type size_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; + using functor_type = FunctorType; + using size_type = Cuda::size_type; private: // Algorithmic constraints: @@ -2233,6 +2121,7 @@ class ParallelScan, Kokkos::Cuda> { enum { GridMaxComputeCapability_2x = 0x0ffff }; const int block_size = local_block_size(m_functor); + KOKKOS_ASSERT(block_size > 0); const int grid_max = (block_size * block_size) < GridMaxComputeCapability_2x @@ -2283,8 +2172,8 @@ class ParallelScan, Kokkos::Cuda> { ParallelScan(const FunctorType& arg_functor, const Policy& arg_policy) : m_functor(arg_functor), m_policy(arg_policy), - m_scratch_space(0), - m_scratch_flags(0), + m_scratch_space(nullptr), + m_scratch_flags(nullptr), m_final(false) #ifdef KOKKOS_IMPL_DEBUG_CUDA_SERIAL_EXECUTION , @@ -2299,23 +2188,23 @@ template class ParallelScanWithTotal, ReturnType, Kokkos::Cuda> { public: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; private: - typedef typename Policy::member_type Member; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::launch_bounds LaunchBounds; + using Member = typename Policy::member_type; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using LaunchBounds = typename Policy::launch_bounds; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueOps = Kokkos::Impl::FunctorValueOps; public: - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; - typedef FunctorType functor_type; - typedef Cuda::size_type size_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; + using functor_type = FunctorType; + using size_type = Cuda::size_type; private: // Algorithmic constraints: @@ -2523,6 +2412,7 @@ class ParallelScanWithTotal, enum { GridMaxComputeCapability_2x = 0x0ffff }; const int block_size = local_block_size(m_functor); + KOKKOS_ASSERT(block_size > 0); const int grid_max = (block_size * block_size) < GridMaxComputeCapability_2x @@ -2585,8 +2475,8 @@ class ParallelScanWithTotal, const Policy& arg_policy, ReturnType& arg_returnvalue) : m_functor(arg_functor), m_policy(arg_policy), - m_scratch_space(0), - m_scratch_flags(0), + m_scratch_space(nullptr), + m_scratch_flags(nullptr), m_final(false), m_returnvalue(arg_returnvalue) #ifdef KOKKOS_IMPL_DEBUG_CUDA_SERIAL_EXECUTION @@ -2610,7 +2500,7 @@ template struct CudaFunctorAdapter { const FunctorType f; - typedef ValueType value_type; + using value_type = ValueType; CudaFunctorAdapter(const FunctorType& f_) : f(f_) {} __device__ inline void operator()(typename ExecPolicy::work_tag, @@ -2680,7 +2570,7 @@ struct CudaFunctorAdapter { template struct CudaFunctorAdapter { const FunctorType f; - typedef ValueType value_type; + using value_type = ValueType; CudaFunctorAdapter(const FunctorType& f_) : f(f_) {} __device__ inline void operator()(const typename ExecPolicy::member_type& i, @@ -2801,13 +2691,14 @@ struct CudaFunctorAdapter { template ::value> struct FunctorReferenceType { - typedef ResultType& reference_type; + using reference_type = ResultType&; }; template struct FunctorReferenceType { - typedef typename Kokkos::Impl::FunctorValueTraits< - FunctorType, Tag>::reference_type reference_type; + using reference_type = + typename Kokkos::Impl::FunctorValueTraits::reference_type; }; template @@ -2815,10 +2706,9 @@ struct ParallelReduceFunctorType { enum { FunctorHasValueType = IsNonTrivialReduceFunctor::value }; - typedef typename Kokkos::Impl::if_c< + using functor_type = typename Kokkos::Impl::if_c< FunctorHasValueType, FunctorTypeIn, - Impl::CudaFunctorAdapter>::type - functor_type; + Impl::CudaFunctorAdapter>::type; static functor_type functor(const FunctorTypeIn& functor_in) { return Impl::if_c::select( functor_in, functor_type(functor_in)); diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp index 8795eb5a38..6989431907 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ReduceScan.hpp @@ -140,10 +140,10 @@ __device__ bool cuda_inter_block_reduction( Cuda::size_type* const m_scratch_flags, const int max_active_thread = blockDim.y) { #ifdef __CUDA_ARCH__ - typedef typename FunctorValueTraits::pointer_type - pointer_type; - typedef - typename FunctorValueTraits::value_type value_type; + using pointer_type = + typename FunctorValueTraits::pointer_type; + using value_type = + typename FunctorValueTraits::value_type; // Do the intra-block reduction with shfl operations and static shared memory cuda_intra_block_reduction(value, join, max_active_thread); @@ -255,7 +255,7 @@ __device__ inline cuda_intra_warp_reduction(const ReducerType& reducer, typename ReducerType::value_type& result, const uint32_t max_active_thread = blockDim.y) { - typedef typename ReducerType::value_type ValueType; + using ValueType = typename ReducerType::value_type; unsigned int shift = 1; @@ -278,7 +278,7 @@ __device__ inline cuda_inter_warp_reduction(const ReducerType& reducer, typename ReducerType::value_type value, const int max_active_thread = blockDim.y) { - typedef typename ReducerType::value_type ValueType; + using ValueType = typename ReducerType::value_type; #define STEP_WIDTH 4 // Depending on the ValueType _shared__ memory must be aligned up to 8byte @@ -336,8 +336,8 @@ __device__ inline Cuda::size_type* const m_scratch_flags, const int max_active_thread = blockDim.y) { #ifdef __CUDA_ARCH__ - typedef typename ReducerType::value_type* pointer_type; - typedef typename ReducerType::value_type value_type; + using pointer_type = typename ReducerType::value_type*; + using value_type = typename ReducerType::value_type; // Do the intra-block reduction with shfl operations and static shared memory cuda_intra_block_reduction(reducer, max_active_thread); @@ -450,12 +450,12 @@ struct CudaReductionsFunctor; template struct CudaReductionsFunctor { - typedef FunctorValueTraits ValueTraits; - typedef FunctorValueJoin ValueJoin; - typedef FunctorValueInit ValueInit; - typedef FunctorValueOps ValueOps; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::value_type Scalar; + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; + using ValueInit = FunctorValueInit; + using ValueOps = FunctorValueOps; + using pointer_type = typename ValueTraits::pointer_type; + using Scalar = typename ValueTraits::value_type; __device__ static inline void scalar_intra_warp_reduction( const FunctorType& functor, @@ -533,8 +533,12 @@ struct CudaReductionsFunctor { __threadfence(); __syncthreads(); unsigned int num_teams_done = 0; + // The cast in the atomic call is necessary to find matching call with + // MSVC/NVCC if (threadIdx.x + threadIdx.y == 0) { - num_teams_done = Kokkos::atomic_fetch_add(global_flags, 1) + 1; + num_teams_done = + Kokkos::atomic_fetch_add(global_flags, static_cast(1)) + + 1; } bool is_last_block = false; if (__syncthreads_or(num_teams_done == gridDim.x)) { @@ -555,12 +559,12 @@ struct CudaReductionsFunctor { template struct CudaReductionsFunctor { - typedef FunctorValueTraits ValueTraits; - typedef FunctorValueJoin ValueJoin; - typedef FunctorValueInit ValueInit; - typedef FunctorValueOps ValueOps; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::value_type Scalar; + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; + using ValueInit = FunctorValueInit; + using ValueOps = FunctorValueOps; + using pointer_type = typename ValueTraits::pointer_type; + using Scalar = typename ValueTraits::value_type; __device__ static inline void scalar_intra_warp_reduction( const FunctorType& functor, @@ -635,8 +639,12 @@ struct CudaReductionsFunctor { __syncthreads(); unsigned int num_teams_done = 0; + // The cast in the atomic call is necessary to find matching call with + // MSVC/NVCC if (threadIdx.x + threadIdx.y == 0) { - num_teams_done = Kokkos::atomic_fetch_add(global_flags, 1) + 1; + num_teams_done = + Kokkos::atomic_fetch_add(global_flags, static_cast(1)) + + 1; } bool is_last_block = false; if (__syncthreads_or(num_teams_done == gridDim.x)) { @@ -677,10 +685,10 @@ __device__ void cuda_intra_block_reduce_scan( const FunctorType& functor, const typename FunctorValueTraits::pointer_type base_data) { - typedef FunctorValueTraits ValueTraits; - typedef FunctorValueJoin ValueJoin; + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; - typedef typename ValueTraits::pointer_type pointer_type; + using pointer_type = typename ValueTraits::pointer_type; const unsigned value_count = ValueTraits::value_count(functor); const unsigned BlockSizeMask = blockDim.y - 1; @@ -855,13 +863,13 @@ __device__ bool cuda_single_inter_block_reduce_scan2( const FunctorType& functor, const Cuda::size_type block_id, const Cuda::size_type block_count, Cuda::size_type* const shared_data, Cuda::size_type* const global_data, Cuda::size_type* const global_flags) { - typedef Cuda::size_type size_type; - typedef FunctorValueTraits ValueTraits; - typedef FunctorValueJoin ValueJoin; - typedef FunctorValueInit ValueInit; - typedef FunctorValueOps ValueOps; + using size_type = Cuda::size_type; + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; + using ValueInit = FunctorValueInit; + using ValueOps = FunctorValueOps; - typedef typename ValueTraits::pointer_type pointer_type; + using pointer_type = typename ValueTraits::pointer_type; // '__ffs' = position of the least significant bit set to 1. // 'blockDim.y' is guaranteed to be a power of two so this @@ -950,8 +958,8 @@ __device__ bool cuda_single_inter_block_reduce_scan( const FunctorType& functor, const Cuda::size_type block_id, const Cuda::size_type block_count, Cuda::size_type* const shared_data, Cuda::size_type* const global_data, Cuda::size_type* const global_flags) { - typedef FunctorValueTraits ValueTraits; - if (!DoScan && ValueTraits::StaticValueSize) + using ValueTraits = FunctorValueTraits; + if (!DoScan && ValueTraits::StaticValueSize > 0) return Kokkos::Impl::CudaReductionsFunctor< FunctorType, ArgTag, false, (ValueTraits::StaticValueSize > 16)>:: scalar_inter_block_reduction(functor, block_id, block_count, diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp index decbecc5e6..6ead5197ee 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Task.hpp @@ -754,7 +754,7 @@ namespace Kokkos { // TeamThreadRange( const Impl::TaskExec< Kokkos::Cuda > & thread // , const iType1 & begin, const iType2 & end ) //{ -// typedef typename std::common_type< iType1, iType2 >::type iType; +// using iType = typename std::common_type< iType1, iType2 >::type; // return Impl::TeamThreadRangeBoundariesStruct< iType, Impl::TaskExec< // Kokkos::Cuda > >( // thread, iType(begin), iType(end) ); @@ -921,7 +921,7 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce( const Impl::TeamThreadRangeBoundariesStruct< iType, Impl::TaskExec>& loop_boundaries, const Lambda& lambda, const ReducerType& reducer) { - typedef typename ReducerType::value_type ValueType; + using ValueType = typename ReducerType::value_type; // TODO @internal_documentation what is the point of creating this temporary? ValueType result = ValueType(); reducer.init(result); @@ -1005,7 +1005,7 @@ KOKKOS_INLINE_FUNCTION void parallel_reduce( const Impl::ThreadVectorRangeBoundariesStruct< iType, Impl::TaskExec>& loop_boundaries, const Lambda& lambda, const ReducerType& reducer) { - typedef typename ReducerType::value_type ValueType; + using ValueType = typename ReducerType::value_type; ValueType result = ValueType(); reducer.init(result); diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp index d9d5ed0bf3..1160336519 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Team.hpp @@ -45,9 +45,7 @@ #ifndef KOKKOS_CUDA_TEAM_HPP #define KOKKOS_CUDA_TEAM_HPP -#include #include -#include #include @@ -62,10 +60,8 @@ #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include +#include #include -#endif //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -75,7 +71,7 @@ namespace Impl { template struct CudaJoinFunctor { - typedef Type value_type; + using value_type = Type; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -104,8 +100,8 @@ struct CudaJoinFunctor { */ class CudaTeamMember { public: - typedef Kokkos::Cuda execution_space; - typedef execution_space::scratch_memory_space scratch_memory_space; + using execution_space = Kokkos::Cuda; + using scratch_memory_space = execution_space::scratch_memory_space; private: mutable void* m_team_reduce; @@ -357,8 +353,8 @@ class CudaTeamMember { int const shmem_size) { #ifdef __CUDA_ARCH__ - typedef typename ReducerType::value_type value_type; - typedef value_type volatile* pointer_type; + using value_type = typename ReducerType::value_type; + using pointer_type = value_type volatile*; // Number of shared memory entries for the reduction: const int nsh = shmem_size / sizeof(value_type); @@ -563,7 +559,7 @@ namespace Impl { template struct TeamThreadRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const CudaTeamMember& member; const iType start; const iType end; @@ -580,7 +576,7 @@ struct TeamThreadRangeBoundariesStruct { template struct TeamVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const CudaTeamMember& member; const iType start; const iType end; @@ -598,7 +594,7 @@ struct TeamVectorRangeBoundariesStruct { template struct ThreadVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const index_type start; const index_type end; @@ -634,7 +630,7 @@ template KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< typename std::common_type::type, Impl::CudaTeamMember> TeamThreadRange(const Impl::CudaTeamMember& thread, iType1 begin, iType2 end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamThreadRangeBoundariesStruct( thread, iType(begin), iType(end)); } @@ -652,7 +648,7 @@ KOKKOS_INLINE_FUNCTION Impl::TeamVectorRangeBoundariesStruct< typename std::common_type::type, Impl::CudaTeamMember> TeamVectorRange(const Impl::CudaTeamMember& thread, const iType1& begin, const iType2& end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamVectorRangeBoundariesStruct( thread, iType(begin), iType(end)); } diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp index 3b470edbc3..f846c06ce5 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_UniqueToken.hpp @@ -59,7 +59,7 @@ namespace Experimental { // both global and instance Unique Tokens are implemented in the same way template <> class UniqueToken { - private: + protected: uint32_t volatile* m_buffer; uint32_t m_count; @@ -67,14 +67,7 @@ class UniqueToken { using execution_space = Cuda; using size_type = int32_t; -#if defined(KOKKOS_ENABLE_DEPRECATED_CODE) - explicit UniqueToken(execution_space const&); - - KOKKOS_INLINE_FUNCTION - UniqueToken() : m_buffer(0), m_count(0) {} -#else explicit UniqueToken(execution_space const& = execution_space()); -#endif KOKKOS_DEFAULTED_FUNCTION UniqueToken(const UniqueToken&) = default; @@ -101,7 +94,7 @@ class UniqueToken { if (result.first < 0) { Kokkos::abort( - "UniqueToken failure to release tokens, no tokens available"); + "UniqueToken failure to acquire tokens, no tokens available"); } return result.first; @@ -117,14 +110,20 @@ class UniqueToken { template <> class UniqueToken : public UniqueToken { + private: + Kokkos::View m_buffer_view; + public: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - explicit UniqueToken(execution_space const& arg) - : UniqueToken(arg) {} -#else explicit UniqueToken(execution_space const& arg = execution_space()) : UniqueToken(arg) {} -#endif + + UniqueToken(size_type max_size, execution_space const& = execution_space()) + : m_buffer_view( + "UniqueToken::m_buffer_view", + ::Kokkos::Impl::concurrent_bitset::buffer_bound(max_size)) { + m_buffer = m_buffer_view.data(); + m_count = max_size; + } }; } // namespace Experimental diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp index 62966f859d..7f7b7b6e78 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_Vectorization.hpp @@ -47,7 +47,7 @@ #include #ifdef KOKKOS_ENABLE_CUDA -#include +#include #include namespace Kokkos { diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp index 364f334a4c..f24abb377d 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_View.hpp @@ -257,8 +257,8 @@ class ViewDataHandle< // which can only occur on the host. In addition, 'get_record' is only // valid if called in a host execution space - typedef typename Traits::memory_space memory_space; - typedef typename Impl::SharedAllocationRecord record; + using memory_space = typename Traits::memory_space; + using record = typename Impl::SharedAllocationRecord; record* const r = arg_tracker.template get_record(); diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp index 0753e383a1..b7c81b92f8 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp @@ -45,6 +45,8 @@ #ifndef KOKKOS_CUDA_WORKGRAPHPOLICY_HPP #define KOKKOS_CUDA_WORKGRAPHPOLICY_HPP +#include + namespace Kokkos { namespace Impl { @@ -52,8 +54,8 @@ template class ParallelFor, Kokkos::Cuda> { public: - typedef Kokkos::WorkGraphPolicy Policy; - typedef ParallelFor Self; + using Policy = Kokkos::WorkGraphPolicy; + using Self = ParallelFor; private: Policy m_policy; diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp index 698695dbdb..f3cf25efef 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp +++ b/lib/kokkos/core/src/Cuda/Kokkos_Cuda_abort.hpp @@ -64,14 +64,34 @@ extern __device__ void __assertfail(const void *message, const void *file, namespace Kokkos { namespace Impl { +#if !defined(__APPLE__) +// required to workaround failures in random number generator unit tests with +// pre-volta architectures +#if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) __device__ inline void cuda_abort(const char *const message) { -#ifndef __APPLE__ +#else +[[noreturn]] __device__ inline void cuda_abort(const char *const message) { +#endif const char empty[] = ""; __assertfail((const void *)message, (const void *)empty, (unsigned int)0, (const void *)empty, sizeof(char)); + + // This loop is never executed. It's intended to suppress warnings that the + // function returns, even though it does not. This is necessary because + // __assertfail is not marked as [[noreturn]], even though it does not return. + // Disable with KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK to workaround failures + // in random number generator unit tests with pre-volta architectures +#if !defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) + while (true) + ; #endif } +#else +__device__ inline void cuda_abort(const char *const message) { + // __assertfail is not supported on MAC +} +#endif } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/KokkosExp_HIP_IterateTile.hpp b/lib/kokkos/core/src/HIP/KokkosExp_HIP_IterateTile.hpp index e2525d70c1..1e8a550313 100644 --- a/lib/kokkos/core/src/HIP/KokkosExp_HIP_IterateTile.hpp +++ b/lib/kokkos/core/src/HIP/KokkosExp_HIP_IterateTile.hpp @@ -48,16 +48,12 @@ #include #if defined(__HIPCC__) -#include #include -#include #include -#if defined(KOKKOS_ENABLE_PROFILING) #include #include -#endif namespace Kokkos { namespace Impl { @@ -80,22 +76,22 @@ struct DeviceIterateTile<2, PolicyType, Functor, void> { void exec_range() const { // LL if (PolicyType::inner_direction == PolicyType::Left) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; tile_id0 += hipGridDim_x) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < m_policy.m_tile[0]) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { m_func(offset_0, offset_1); } } @@ -104,22 +100,22 @@ struct DeviceIterateTile<2, PolicyType, Functor, void> { } // LR else { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; tile_id0 += hipGridDim_x) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < m_policy.m_tile[0]) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { m_func(offset_0, offset_1); } } @@ -146,44 +142,44 @@ struct DeviceIterateTile<2, PolicyType, Functor, Tag> { void exec_range() const { if (PolicyType::inner_direction == PolicyType::Left) { // Loop over size maxnumblocks until full range covered - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; tile_id0 += hipGridDim_x) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < m_policy.m_tile[0]) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { m_func(Tag(), offset_0, offset_1); } } } } } else { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; tile_id0 += hipGridDim_x) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < m_policy.m_tile[0]) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { m_func(Tag(), offset_0, offset_1); } } @@ -210,32 +206,30 @@ struct DeviceIterateTile<3, PolicyType, Functor, void> { void exec_range() const { // LL if (PolicyType::inner_direction == PolicyType::Left) { - for (index_type tile_id2 = static_cast(hipBlockIdx_z); - tile_id2 < m_policy.m_tile_end[2]; tile_id2 += hipGridDim_z) { + for (index_type tile_id2 = static_cast(blockIdx.z); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.z) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_z) < m_policy.m_tile[2]) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + static_cast(threadIdx.z) < m_policy.m_tile[2]) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; - tile_id0 += hipGridDim_x) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < - m_policy.m_tile[0]) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { m_func(offset_0, offset_1, offset_2); } } @@ -246,32 +240,30 @@ struct DeviceIterateTile<3, PolicyType, Functor, void> { } // LR else { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; tile_id0 += hipGridDim_x) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < m_policy.m_tile[0]) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { - for (index_type tile_id2 = static_cast(hipBlockIdx_z); - tile_id2 < m_policy.m_tile_end[2]; - tile_id2 += hipGridDim_z) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { + for (index_type tile_id2 = static_cast(blockIdx.z); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.z) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_z) < - m_policy.m_tile[2]) { + static_cast(threadIdx.z) < m_policy.m_tile[2]) { m_func(offset_0, offset_1, offset_2); } } @@ -299,32 +291,30 @@ struct DeviceIterateTile<3, PolicyType, Functor, Tag> { KOKKOS_INLINE_FUNCTION void exec_range() const { if (PolicyType::inner_direction == PolicyType::Left) { - for (index_type tile_id2 = static_cast(hipBlockIdx_z); - tile_id2 < m_policy.m_tile_end[2]; tile_id2 += hipGridDim_z) { + for (index_type tile_id2 = static_cast(blockIdx.z); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.z) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_z) < m_policy.m_tile[2]) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + static_cast(threadIdx.z) < m_policy.m_tile[2]) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; - tile_id0 += hipGridDim_x) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < - m_policy.m_tile[0]) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { m_func(Tag(), offset_0, offset_1, offset_2); } } @@ -333,32 +323,30 @@ struct DeviceIterateTile<3, PolicyType, Functor, Tag> { } } } else { - for (index_type tile_id0 = static_cast(hipBlockIdx_x); - tile_id0 < m_policy.m_tile_end[0]; tile_id0 += hipGridDim_x) { + for (index_type tile_id0 = static_cast(blockIdx.x); + tile_id0 < m_policy.m_tile_end[0]; tile_id0 += gridDim.x) { const index_type offset_0 = tile_id0 * m_policy.m_tile[0] + - static_cast(hipThreadIdx_x) + + static_cast(threadIdx.x) + static_cast(m_policy.m_lower[0]); if (offset_0 < m_policy.m_upper[0] && - static_cast(hipThreadIdx_x) < m_policy.m_tile[0]) { - for (index_type tile_id1 = static_cast(hipBlockIdx_y); - tile_id1 < m_policy.m_tile_end[1]; tile_id1 += hipGridDim_y) { + static_cast(threadIdx.x) < m_policy.m_tile[0]) { + for (index_type tile_id1 = static_cast(blockIdx.y); + tile_id1 < m_policy.m_tile_end[1]; tile_id1 += gridDim.y) { const index_type offset_1 = tile_id1 * m_policy.m_tile[1] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[1]) { - for (index_type tile_id2 = static_cast(hipBlockIdx_z); - tile_id2 < m_policy.m_tile_end[2]; - tile_id2 += hipGridDim_z) { + static_cast(threadIdx.y) < m_policy.m_tile[1]) { + for (index_type tile_id2 = static_cast(blockIdx.z); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.z) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_z) < - m_policy.m_tile[2]) { + static_cast(threadIdx.z) < m_policy.m_tile[2]) { m_func(Tag(), offset_0, offset_1, offset_2); } } @@ -397,31 +385,29 @@ struct DeviceIterateTile<4, PolicyType, Functor, void> { ? index_type(max_blocks / numbl0) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) % numbl0; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) / numbl0; + const index_type tile_id0 = static_cast(blockIdx.x) % numbl0; + const index_type tile_id1 = static_cast(blockIdx.x) / numbl0; const index_type thr_id0 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[0]; + static_cast(threadIdx.x) % m_policy.m_tile[0]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[0]; + static_cast(threadIdx.x) / m_policy.m_tile[0]; - for (index_type tile_id3 = static_cast(hipBlockIdx_z); - tile_id3 < m_policy.m_tile_end[3]; tile_id3 += hipGridDim_z) { + for (index_type tile_id3 = static_cast(blockIdx.z); + tile_id3 < m_policy.m_tile_end[3]; tile_id3 += gridDim.z) { const index_type offset_3 = tile_id3 * m_policy.m_tile[3] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[3]); if (offset_3 < m_policy.m_upper[3] && - static_cast(hipThreadIdx_z) < m_policy.m_tile[3]) { - for (index_type tile_id2 = static_cast(hipBlockIdx_y); - tile_id2 < m_policy.m_tile_end[2]; tile_id2 += hipGridDim_y) { + static_cast(threadIdx.z) < m_policy.m_tile[3]) { + for (index_type tile_id2 = static_cast(blockIdx.y); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.y) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[2]) { + static_cast(threadIdx.y) < m_policy.m_tile[2]) { for (index_type j = tile_id1; j < m_policy.m_tile_end[1]; j += numbl1) { const index_type offset_1 = @@ -456,14 +442,12 @@ struct DeviceIterateTile<4, PolicyType, Functor, void> { ? index_type(max_blocks / numbl1) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) / numbl1; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) % numbl1; + const index_type tile_id0 = static_cast(blockIdx.x) / numbl1; + const index_type tile_id1 = static_cast(blockIdx.x) % numbl1; const index_type thr_id0 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[1]; + static_cast(threadIdx.x) / m_policy.m_tile[1]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[1]; + static_cast(threadIdx.x) % m_policy.m_tile[1]; for (index_type i = tile_id0; i < m_policy.m_tile_end[0]; i += numbl0) { const index_type offset_0 = @@ -477,26 +461,24 @@ struct DeviceIterateTile<4, PolicyType, Functor, void> { static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && thr_id1 < m_policy.m_tile[1]) { - for (index_type tile_id2 = static_cast(hipBlockIdx_y); - tile_id2 < m_policy.m_tile_end[2]; - tile_id2 += hipGridDim_y) { + for (index_type tile_id2 = static_cast(blockIdx.y); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.y) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_y) < - m_policy.m_tile[2]) { + static_cast(threadIdx.y) < m_policy.m_tile[2]) { for (index_type tile_id3 = - static_cast(hipBlockIdx_z); + static_cast(blockIdx.z); tile_id3 < m_policy.m_tile_end[3]; - tile_id3 += hipGridDim_z) { + tile_id3 += gridDim.z) { const index_type offset_3 = tile_id3 * m_policy.m_tile[3] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[3]); if (offset_3 < m_policy.m_upper[3] && - static_cast(hipThreadIdx_z) < + static_cast(threadIdx.z) < m_policy.m_tile[3]) { m_func(offset_0, offset_1, offset_2, offset_3); } @@ -537,31 +519,29 @@ struct DeviceIterateTile<4, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl0) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) % numbl0; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) / numbl0; + const index_type tile_id0 = static_cast(blockIdx.x) % numbl0; + const index_type tile_id1 = static_cast(blockIdx.x) / numbl0; const index_type thr_id0 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[0]; + static_cast(threadIdx.x) % m_policy.m_tile[0]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[0]; + static_cast(threadIdx.x) / m_policy.m_tile[0]; - for (index_type tile_id3 = static_cast(hipBlockIdx_z); - tile_id3 < m_policy.m_tile_end[3]; tile_id3 += hipGridDim_z) { + for (index_type tile_id3 = static_cast(blockIdx.z); + tile_id3 < m_policy.m_tile_end[3]; tile_id3 += gridDim.z) { const index_type offset_3 = tile_id3 * m_policy.m_tile[3] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[3]); if (offset_3 < m_policy.m_upper[3] && - static_cast(hipThreadIdx_z) < m_policy.m_tile[3]) { - for (index_type tile_id2 = static_cast(hipBlockIdx_y); - tile_id2 < m_policy.m_tile_end[2]; tile_id2 += hipGridDim_y) { + static_cast(threadIdx.z) < m_policy.m_tile[3]) { + for (index_type tile_id2 = static_cast(blockIdx.y); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.y) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_y) < m_policy.m_tile[2]) { + static_cast(threadIdx.y) < m_policy.m_tile[2]) { for (index_type j = tile_id1; j < m_policy.m_tile_end[1]; j += numbl1) { const index_type offset_1 = @@ -594,14 +574,12 @@ struct DeviceIterateTile<4, PolicyType, Functor, Tag> { ? index_type(max_blocks / numbl1) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) / numbl1; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) % numbl1; + const index_type tile_id0 = static_cast(blockIdx.x) / numbl1; + const index_type tile_id1 = static_cast(blockIdx.x) % numbl1; const index_type thr_id0 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[1]; + static_cast(threadIdx.x) / m_policy.m_tile[1]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[1]; + static_cast(threadIdx.x) % m_policy.m_tile[1]; for (index_type i = tile_id0; i < m_policy.m_tile_end[0]; i += numbl0) { const index_type offset_0 = @@ -615,26 +593,24 @@ struct DeviceIterateTile<4, PolicyType, Functor, Tag> { static_cast(m_policy.m_lower[1]); if (offset_1 < m_policy.m_upper[1] && thr_id1 < m_policy.m_tile[1]) { - for (index_type tile_id2 = static_cast(hipBlockIdx_y); - tile_id2 < m_policy.m_tile_end[2]; - tile_id2 += hipGridDim_y) { + for (index_type tile_id2 = static_cast(blockIdx.y); + tile_id2 < m_policy.m_tile_end[2]; tile_id2 += gridDim.y) { const index_type offset_2 = tile_id2 * m_policy.m_tile[2] + - static_cast(hipThreadIdx_y) + + static_cast(threadIdx.y) + static_cast(m_policy.m_lower[2]); if (offset_2 < m_policy.m_upper[2] && - static_cast(hipThreadIdx_y) < - m_policy.m_tile[2]) { + static_cast(threadIdx.y) < m_policy.m_tile[2]) { for (index_type tile_id3 = - static_cast(hipBlockIdx_z); + static_cast(blockIdx.z); tile_id3 < m_policy.m_tile_end[3]; - tile_id3 += hipGridDim_z) { + tile_id3 += gridDim.z) { const index_type offset_3 = tile_id3 * m_policy.m_tile[3] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[3]); if (offset_3 < m_policy.m_upper[3] && - static_cast(hipThreadIdx_z) < + static_cast(threadIdx.z) < m_policy.m_tile[3]) { m_func(Tag(), offset_0, offset_1, offset_2, offset_3); } @@ -676,14 +652,12 @@ struct DeviceIterateTile<5, PolicyType, Functor, void> { ? index_type(max_blocks / numbl0) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) % numbl0; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) / numbl0; + const index_type tile_id0 = static_cast(blockIdx.x) % numbl0; + const index_type tile_id1 = static_cast(blockIdx.x) / numbl0; const index_type thr_id0 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[0]; + static_cast(threadIdx.x) % m_policy.m_tile[0]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[0]; + static_cast(threadIdx.x) / m_policy.m_tile[0]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -693,23 +667,21 @@ struct DeviceIterateTile<5, PolicyType, Functor, void> { ? index_type(max_blocks / numbl2) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) % numbl2; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) / numbl2; + const index_type tile_id2 = static_cast(blockIdx.y) % numbl2; + const index_type tile_id3 = static_cast(blockIdx.y) / numbl2; const index_type thr_id2 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[2]; + static_cast(threadIdx.y) % m_policy.m_tile[2]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[2]; + static_cast(threadIdx.y) / m_policy.m_tile[2]; - for (index_type tile_id4 = static_cast(hipBlockIdx_z); - tile_id4 < m_policy.m_tile_end[4]; tile_id4 += hipGridDim_z) { + for (index_type tile_id4 = static_cast(blockIdx.z); + tile_id4 < m_policy.m_tile_end[4]; tile_id4 += gridDim.z) { const index_type offset_4 = tile_id4 * m_policy.m_tile[4] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[4]); if (offset_4 < m_policy.m_upper[4] && - static_cast(hipThreadIdx_z) < m_policy.m_tile[4]) { + static_cast(threadIdx.z) < m_policy.m_tile[4]) { for (index_type l = tile_id3; l < m_policy.m_tile_end[3]; l += numbl3) { const index_type offset_3 = @@ -761,14 +733,12 @@ struct DeviceIterateTile<5, PolicyType, Functor, void> { ? index_type(max_blocks / numbl1) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) / numbl1; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) % numbl1; + const index_type tile_id0 = static_cast(blockIdx.x) / numbl1; + const index_type tile_id1 = static_cast(blockIdx.x) % numbl1; const index_type thr_id0 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[1]; + static_cast(threadIdx.x) / m_policy.m_tile[1]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[1]; + static_cast(threadIdx.x) % m_policy.m_tile[1]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -778,14 +748,12 @@ struct DeviceIterateTile<5, PolicyType, Functor, void> { ? index_type(max_blocks / numbl3) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) / numbl3; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) % numbl3; + const index_type tile_id2 = static_cast(blockIdx.y) / numbl3; + const index_type tile_id3 = static_cast(blockIdx.y) % numbl3; const index_type thr_id2 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[3]; + static_cast(threadIdx.y) / m_policy.m_tile[3]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[3]; + static_cast(threadIdx.y) % m_policy.m_tile[3]; for (index_type i = tile_id0; i < m_policy.m_tile_end[0]; i += numbl0) { const index_type offset_0 = @@ -814,15 +782,15 @@ struct DeviceIterateTile<5, PolicyType, Functor, void> { if (offset_3 < m_policy.m_upper[3] && thr_id3 < m_policy.m_tile[3]) { for (index_type tile_id4 = - static_cast(hipBlockIdx_z); + static_cast(blockIdx.z); tile_id4 < m_policy.m_tile_end[4]; - tile_id4 += hipGridDim_z) { + tile_id4 += gridDim.z) { const index_type offset_4 = tile_id4 * m_policy.m_tile[4] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[4]); if (offset_4 < m_policy.m_upper[4] && - static_cast(hipThreadIdx_z) < + static_cast(threadIdx.z) < m_policy.m_tile[4]) { m_func(offset_0, offset_1, offset_2, offset_3, offset_4); @@ -867,14 +835,12 @@ struct DeviceIterateTile<5, PolicyType, Functor, Tag> { ? index_type(max_blocks / numbl0) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) % numbl0; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) / numbl0; + const index_type tile_id0 = static_cast(blockIdx.x) % numbl0; + const index_type tile_id1 = static_cast(blockIdx.x) / numbl0; const index_type thr_id0 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[0]; + static_cast(threadIdx.x) % m_policy.m_tile[0]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[0]; + static_cast(threadIdx.x) / m_policy.m_tile[0]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -884,23 +850,21 @@ struct DeviceIterateTile<5, PolicyType, Functor, Tag> { ? index_type(max_blocks / numbl2) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) % numbl2; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) / numbl2; + const index_type tile_id2 = static_cast(blockIdx.y) % numbl2; + const index_type tile_id3 = static_cast(blockIdx.y) / numbl2; const index_type thr_id2 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[2]; + static_cast(threadIdx.y) % m_policy.m_tile[2]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[2]; + static_cast(threadIdx.y) / m_policy.m_tile[2]; - for (index_type tile_id4 = static_cast(hipBlockIdx_z); - tile_id4 < m_policy.m_tile_end[4]; tile_id4 += hipGridDim_z) { + for (index_type tile_id4 = static_cast(blockIdx.z); + tile_id4 < m_policy.m_tile_end[4]; tile_id4 += gridDim.z) { const index_type offset_4 = tile_id4 * m_policy.m_tile[4] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[4]); if (offset_4 < m_policy.m_upper[4] && - static_cast(hipThreadIdx_z) < m_policy.m_tile[4]) { + static_cast(threadIdx.z) < m_policy.m_tile[4]) { for (index_type l = tile_id3; l < m_policy.m_tile_end[3]; l += numbl3) { const index_type offset_3 = @@ -952,14 +916,12 @@ struct DeviceIterateTile<5, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl1) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) / numbl1; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) % numbl1; + const index_type tile_id0 = static_cast(blockIdx.x) / numbl1; + const index_type tile_id1 = static_cast(blockIdx.x) % numbl1; const index_type thr_id0 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[1]; + static_cast(threadIdx.x) / m_policy.m_tile[1]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[1]; + static_cast(threadIdx.x) % m_policy.m_tile[1]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -969,14 +931,12 @@ struct DeviceIterateTile<5, PolicyType, Functor, Tag> { ? index_type(max_blocks / numbl3) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) / numbl3; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) % numbl3; + const index_type tile_id2 = static_cast(blockIdx.y) / numbl3; + const index_type tile_id3 = static_cast(blockIdx.y) % numbl3; const index_type thr_id2 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[3]; + static_cast(threadIdx.y) / m_policy.m_tile[3]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[3]; + static_cast(threadIdx.y) % m_policy.m_tile[3]; for (index_type i = tile_id0; i < m_policy.m_tile_end[0]; i += numbl0) { const index_type offset_0 = @@ -1005,15 +965,15 @@ struct DeviceIterateTile<5, PolicyType, Functor, Tag> { if (offset_3 < m_policy.m_upper[3] && thr_id3 < m_policy.m_tile[3]) { for (index_type tile_id4 = - static_cast(hipBlockIdx_z); + static_cast(blockIdx.z); tile_id4 < m_policy.m_tile_end[4]; - tile_id4 += hipGridDim_z) { + tile_id4 += gridDim.z) { const index_type offset_4 = tile_id4 * m_policy.m_tile[4] + - static_cast(hipThreadIdx_z) + + static_cast(threadIdx.z) + static_cast(m_policy.m_lower[4]); if (offset_4 < m_policy.m_upper[4] && - static_cast(hipThreadIdx_z) < + static_cast(threadIdx.z) < m_policy.m_tile[4]) { m_func(Tag(), offset_0, offset_1, offset_2, offset_3, offset_4); @@ -1058,14 +1018,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, void> { ? static_cast(max_blocks / numbl0) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) % numbl0; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) / numbl0; + const index_type tile_id0 = static_cast(blockIdx.x) % numbl0; + const index_type tile_id1 = static_cast(blockIdx.x) / numbl0; const index_type thr_id0 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[0]; + static_cast(threadIdx.x) % m_policy.m_tile[0]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[0]; + static_cast(threadIdx.x) / m_policy.m_tile[0]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -1075,14 +1033,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, void> { ? index_type(max_blocks / numbl2) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) % numbl2; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) / numbl2; + const index_type tile_id2 = static_cast(blockIdx.y) % numbl2; + const index_type tile_id3 = static_cast(blockIdx.y) / numbl2; const index_type thr_id2 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[2]; + static_cast(threadIdx.y) % m_policy.m_tile[2]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[2]; + static_cast(threadIdx.y) / m_policy.m_tile[2]; temp0 = m_policy.m_tile_end[4]; temp1 = m_policy.m_tile_end[5]; @@ -1092,14 +1048,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, void> { ? static_cast(max_blocks / numbl4) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id4 = - static_cast(hipBlockIdx_z) % numbl4; - const index_type tile_id5 = - static_cast(hipBlockIdx_z) / numbl4; + const index_type tile_id4 = static_cast(blockIdx.z) % numbl4; + const index_type tile_id5 = static_cast(blockIdx.z) / numbl4; const index_type thr_id4 = - static_cast(hipThreadIdx_z) % m_policy.m_tile[4]; + static_cast(threadIdx.z) % m_policy.m_tile[4]; const index_type thr_id5 = - static_cast(hipThreadIdx_z) / m_policy.m_tile[4]; + static_cast(threadIdx.z) / m_policy.m_tile[4]; for (index_type n = tile_id5; n < m_policy.m_tile_end[5]; n += numbl5) { const index_type offset_5 = @@ -1166,14 +1120,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, void> { ? static_cast(max_blocks / numbl1) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) / numbl1; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) % numbl1; + const index_type tile_id0 = static_cast(blockIdx.x) / numbl1; + const index_type tile_id1 = static_cast(blockIdx.x) % numbl1; const index_type thr_id0 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[1]; + static_cast(threadIdx.x) / m_policy.m_tile[1]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[1]; + static_cast(threadIdx.x) % m_policy.m_tile[1]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -1183,14 +1135,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, void> { ? index_type(max_blocks / numbl3) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) / numbl3; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) % numbl3; + const index_type tile_id2 = static_cast(blockIdx.y) / numbl3; + const index_type tile_id3 = static_cast(blockIdx.y) % numbl3; const index_type thr_id2 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[3]; + static_cast(threadIdx.y) / m_policy.m_tile[3]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[3]; + static_cast(threadIdx.y) % m_policy.m_tile[3]; temp0 = m_policy.m_tile_end[4]; temp1 = m_policy.m_tile_end[5]; @@ -1200,14 +1150,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, void> { ? index_type(max_blocks / numbl5) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id4 = - static_cast(hipBlockIdx_z) / numbl5; - const index_type tile_id5 = - static_cast(hipBlockIdx_z) % numbl5; + const index_type tile_id4 = static_cast(blockIdx.z) / numbl5; + const index_type tile_id5 = static_cast(blockIdx.z) % numbl5; const index_type thr_id4 = - static_cast(hipThreadIdx_z) / m_policy.m_tile[5]; + static_cast(threadIdx.z) / m_policy.m_tile[5]; const index_type thr_id5 = - static_cast(hipThreadIdx_z) % m_policy.m_tile[5]; + static_cast(threadIdx.z) % m_policy.m_tile[5]; for (index_type i = tile_id0; i < m_policy.m_tile_end[0]; i += numbl0) { const index_type offset_0 = @@ -1294,14 +1242,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl0) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) % numbl0; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) / numbl0; + const index_type tile_id0 = static_cast(blockIdx.x) % numbl0; + const index_type tile_id1 = static_cast(blockIdx.x) / numbl0; const index_type thr_id0 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[0]; + static_cast(threadIdx.x) % m_policy.m_tile[0]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[0]; + static_cast(threadIdx.x) / m_policy.m_tile[0]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -1311,14 +1257,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl2) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) % numbl2; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) / numbl2; + const index_type tile_id2 = static_cast(blockIdx.y) % numbl2; + const index_type tile_id3 = static_cast(blockIdx.y) / numbl2; const index_type thr_id2 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[2]; + static_cast(threadIdx.y) % m_policy.m_tile[2]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[2]; + static_cast(threadIdx.y) / m_policy.m_tile[2]; temp0 = m_policy.m_tile_end[4]; temp1 = m_policy.m_tile_end[5]; @@ -1328,14 +1272,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl4) : (temp1 <= max_blocks ? temp1 : max_blocks)); - const index_type tile_id4 = - static_cast(hipBlockIdx_z) % numbl4; - const index_type tile_id5 = - static_cast(hipBlockIdx_z) / numbl4; + const index_type tile_id4 = static_cast(blockIdx.z) % numbl4; + const index_type tile_id5 = static_cast(blockIdx.z) / numbl4; const index_type thr_id4 = - static_cast(hipThreadIdx_z) % m_policy.m_tile[4]; + static_cast(threadIdx.z) % m_policy.m_tile[4]; const index_type thr_id5 = - static_cast(hipThreadIdx_z) / m_policy.m_tile[4]; + static_cast(threadIdx.z) / m_policy.m_tile[4]; for (index_type n = tile_id5; n < m_policy.m_tile_end[5]; n += numbl5) { const index_type offset_5 = @@ -1402,14 +1344,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl1) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id0 = - static_cast(hipBlockIdx_x) / numbl1; - const index_type tile_id1 = - static_cast(hipBlockIdx_x) % numbl1; + const index_type tile_id0 = static_cast(blockIdx.x) / numbl1; + const index_type tile_id1 = static_cast(blockIdx.x) % numbl1; const index_type thr_id0 = - static_cast(hipThreadIdx_x) / m_policy.m_tile[1]; + static_cast(threadIdx.x) / m_policy.m_tile[1]; const index_type thr_id1 = - static_cast(hipThreadIdx_x) % m_policy.m_tile[1]; + static_cast(threadIdx.x) % m_policy.m_tile[1]; temp0 = m_policy.m_tile_end[2]; temp1 = m_policy.m_tile_end[3]; @@ -1419,14 +1359,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl3) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id2 = - static_cast(hipBlockIdx_y) / numbl3; - const index_type tile_id3 = - static_cast(hipBlockIdx_y) % numbl3; + const index_type tile_id2 = static_cast(blockIdx.y) / numbl3; + const index_type tile_id3 = static_cast(blockIdx.y) % numbl3; const index_type thr_id2 = - static_cast(hipThreadIdx_y) / m_policy.m_tile[3]; + static_cast(threadIdx.y) / m_policy.m_tile[3]; const index_type thr_id3 = - static_cast(hipThreadIdx_y) % m_policy.m_tile[3]; + static_cast(threadIdx.y) % m_policy.m_tile[3]; temp0 = m_policy.m_tile_end[4]; temp1 = m_policy.m_tile_end[5]; @@ -1436,14 +1374,12 @@ struct DeviceIterateTile<6, PolicyType, Functor, Tag> { ? static_cast(max_blocks / numbl5) : (temp0 <= max_blocks ? temp0 : max_blocks)); - const index_type tile_id4 = - static_cast(hipBlockIdx_z) / numbl5; - const index_type tile_id5 = - static_cast(hipBlockIdx_z) % numbl5; + const index_type tile_id4 = static_cast(blockIdx.z) / numbl5; + const index_type tile_id5 = static_cast(blockIdx.z) % numbl5; const index_type thr_id4 = - static_cast(hipThreadIdx_z) / m_policy.m_tile[5]; + static_cast(threadIdx.z) / m_policy.m_tile[5]; const index_type thr_id5 = - static_cast(hipThreadIdx_z) % m_policy.m_tile[5]; + static_cast(threadIdx.z) % m_policy.m_tile[5]; for (index_type i = tile_id0; i < m_policy.m_tile_end[0]; i += numbl0) { const index_type offset_0 = @@ -1573,18 +1509,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -1656,18 +1592,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -1741,18 +1677,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -1827,18 +1763,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -1914,18 +1850,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -1936,7 +1872,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with (index_type)hipThreadIdx_y + // tile-local indices identified with (index_type)threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -1999,18 +1935,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2021,7 +1957,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2044,7 +1980,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2085,18 +2021,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2130,7 +2066,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2172,18 +2108,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2194,7 +2130,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2217,7 +2153,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2258,18 +2194,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2280,7 +2216,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2303,7 +2239,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2345,18 +2281,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2431,18 +2367,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2517,18 +2453,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2601,18 +2537,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2692,18 +2628,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2714,7 +2650,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2778,18 +2714,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2800,7 +2736,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2822,7 +2758,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2865,18 +2801,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2953,18 +2889,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -2975,7 +2911,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -2998,7 +2934,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -3042,18 +2978,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -3064,7 +3000,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -3087,7 +3023,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -3130,18 +3066,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -3152,7 +3088,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -3175,7 +3111,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -3219,18 +3155,18 @@ struct DeviceIterateTile< KOKKOS_INLINE_FUNCTION void exec_range() const { - if (static_cast(hipBlockIdx_x) < m_policy.m_num_tiles && - static_cast(hipThreadIdx_y) < m_policy.m_prod_tile_dims) { + if (static_cast(blockIdx.x) < m_policy.m_num_tiles && + static_cast(threadIdx.y) < m_policy.m_prod_tile_dims) { index_type m_offset[PolicyType::rank]; // tile starting global id offset index_type m_local_offset[PolicyType::rank]; // tile starting global id offset - for (index_type tileidx = static_cast(hipBlockIdx_x); - tileidx < m_policy.m_num_tiles; tileidx += hipGridDim_x) { + for (index_type tileidx = static_cast(blockIdx.x); + tileidx < m_policy.m_num_tiles; tileidx += gridDim.x) { index_type tile_idx = tileidx; // temp because tile_idx will be modified while // determining tile starting point offsets - index_type thrd_idx = static_cast(hipThreadIdx_y); + index_type thrd_idx = static_cast(threadIdx.y); bool in_bounds = true; // LL @@ -3241,7 +3177,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; @@ -3264,7 +3200,7 @@ struct DeviceIterateTile< m_policy.m_lower[i]; tile_idx /= m_policy.m_tile_end[i]; - // tile-local indices identified with hipThreadIdx_y + // tile-local indices identified with threadIdx.y m_local_offset[i] = (thrd_idx % m_policy.m_tile[i]); thrd_idx /= m_policy.m_tile[i]; diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp index 1eaae38302..98b457d8cf 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Abort.hpp @@ -53,12 +53,21 @@ namespace Kokkos { namespace Impl { -__device__ inline void hip_abort(char const *msg) { - printf("%s", msg); - // FIXME_HIP both abort and the __assertfail system call are currently - // implemented with __builtin_trap which causes the program to exit abnormally - // without printing the error message. - // abort(); +[[noreturn]] __device__ __attribute__((noinline)) void hip_abort( + char const *msg) { +#ifdef NDEBUG + (void)msg; +#else + // disable printf on release builds, as it has a non-trivial performance + // impact + printf("Aborting with message `%s'.\n", msg); +#endif + abort(); + // This loop is never executed. It's intended to suppress warnings that the + // function returns, even though it does not. This is necessary because + // abort() is not marked as [[noreturn]], even though it does not return. + while (true) + ; } } // namespace Impl diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp index c09e09f500..fea5a55f64 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Atomic.hpp @@ -45,8 +45,7 @@ #ifndef KOKKOS_HIP_ATOMIC_HPP #define KOKKOS_HIP_ATOMIC_HPP -#ifdef KOKKOS_ENABLE_HIP_ATOMICS - +#if defined(KOKKOS_ENABLE_HIP_ATOMICS) namespace Kokkos { // HIP can do: // Types int/unsigned int @@ -91,7 +90,7 @@ __inline__ __device__ T atomic_exchange( typename std::enable_if::type val) { - typedef unsigned long long int type; + using type = unsigned long long int; type tmp = atomicExch(reinterpret_cast(const_cast(dest)), *reinterpret_cast(const_cast(&val))); @@ -141,7 +140,7 @@ __inline__ __device__ void atomic_assign( typename std::enable_if::type val) { - typedef unsigned long long int type; + using type = unsigned long long int; atomicExch(reinterpret_cast(const_cast(dest)), *reinterpret_cast(const_cast(&val))); } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp index 8799d359ff..fc4716d2a8 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_BlockSize_Deduction.hpp @@ -67,34 +67,116 @@ int hip_get_max_block_size(typename DriverType::functor_type const &f, f, vector_length, shmem_extra_block, shmem_extra_thread); } -template -int hip_get_max_block_size(const HIPInternal * /*hip_instance*/, - const hipFuncAttributes &attr, - const FunctorType & /*f*/, - const size_t /*vector_length*/, - const size_t /*shmem_block*/, - const size_t /*shmem_thread*/) { - // FIXME_HIP find a better algorithm. Be aware that - // maxThreadsPerMultiProcessor, regsPerBlock, and l2CacheSize are bugged and - // always return zero - // https://github.com/ROCm-Developer-Tools/HIP/blob/6c5fa32815650cc20a4f783d09b013610348a4d5/include/hip/hcc_detail/hip_runtime_api.h#L438-L440 - // and we don't have access to the same information than we do for CUDA - - int const max_threads_per_block_mi60 = 1024; - int const max_threads_per_block = LaunchBounds::maxTperB == 0 - ? max_threads_per_block_mi60 +template +int hip_internal_get_block_size(const F &condition_check, + const HIPInternal *hip_instance, + const hipFuncAttributes &attr, + const FunctorType &f, + const size_t vector_length, + const size_t shmem_block, + const size_t shmem_thread) { + const int min_blocks_per_sm = + LaunchBounds::minBperSM == 0 ? 1 : LaunchBounds::minBperSM; + const int max_threads_per_block = LaunchBounds::maxTperB == 0 + ? hip_instance->m_maxThreadsPerBlock : LaunchBounds::maxTperB; - return std::min(attr.maxThreadsPerBlock, max_threads_per_block); + + const int regs_per_wavefront = attr.numRegs; + const int regs_per_sm = hip_instance->m_regsPerSM; + const int shmem_per_sm = hip_instance->m_shmemPerSM; + const int max_shmem_per_block = hip_instance->m_maxShmemPerBlock; + const int max_blocks_per_sm = hip_instance->m_maxBlocksPerSM; + const int max_threads_per_sm = hip_instance->m_maxThreadsPerSM; + +// FIXME_HIP this is broken in 3.5, but should be in 3.6 +#if (HIP_VERSION_MAJOR > 3 || HIP_VERSION_MINOR > 5 || \ + HIP_VERSION_PATCH >= 20226) + int block_size = std::min(attr.maxThreadsPerBlock, max_threads_per_block); +#else + int block_size = max_threads_per_block; +#endif + KOKKOS_ASSERT(block_size > 0); + + int functor_shmem = ::Kokkos::Impl::FunctorTeamShmemSize::value( + f, block_size / vector_length); + int total_shmem = shmem_block + shmem_thread * (block_size / vector_length) + + functor_shmem + attr.sharedSizeBytes; + int max_blocks_regs = + regs_per_sm / (regs_per_wavefront * (block_size / HIPTraits::WarpSize)); + int max_blocks_shmem = + (total_shmem < max_shmem_per_block) + ? (total_shmem > 0 ? shmem_per_sm / total_shmem : max_blocks_regs) + : 0; + int blocks_per_sm = std::min(max_blocks_regs, max_blocks_shmem); + int threads_per_sm = blocks_per_sm * block_size; + if (threads_per_sm > max_threads_per_sm) { + blocks_per_sm = max_threads_per_sm / block_size; + threads_per_sm = blocks_per_sm * block_size; + } + int opt_block_size = (blocks_per_sm >= min_blocks_per_sm) ? block_size : 0; + int opt_threads_per_sm = threads_per_sm; + // printf("BlockSizeMax: %i Shmem: %i %i %i %i Regs: %i %i Blocks: %i %i + // Achieved: %i %i Opt: %i %i\n",block_size, + // shmem_per_sm,max_shmem_per_block,functor_shmem,total_shmem, + // regs_per_sm,regs_per_wavefront,max_blocks_shmem,max_blocks_regs,blocks_per_sm,threads_per_sm,opt_block_size,opt_threads_per_sm); + block_size -= HIPTraits::WarpSize; + while (condition_check(blocks_per_sm) && + (block_size >= HIPTraits::WarpSize)) { + functor_shmem = ::Kokkos::Impl::FunctorTeamShmemSize::value( + f, block_size / vector_length); + total_shmem = shmem_block + shmem_thread * (block_size / vector_length) + + functor_shmem + attr.sharedSizeBytes; + max_blocks_regs = + regs_per_sm / (regs_per_wavefront * (block_size / HIPTraits::WarpSize)); + max_blocks_shmem = + (total_shmem < max_shmem_per_block) + ? (total_shmem > 0 ? shmem_per_sm / total_shmem : max_blocks_regs) + : 0; + blocks_per_sm = std::min(max_blocks_regs, max_blocks_shmem); + threads_per_sm = blocks_per_sm * block_size; + if (threads_per_sm > max_threads_per_sm) { + blocks_per_sm = max_threads_per_sm / block_size; + threads_per_sm = blocks_per_sm * block_size; + } + if ((blocks_per_sm >= min_blocks_per_sm) && + (blocks_per_sm <= max_blocks_per_sm)) { + if (threads_per_sm >= opt_threads_per_sm) { + opt_block_size = block_size; + opt_threads_per_sm = threads_per_sm; + } + } + // printf("BlockSizeMax: %i Shmem: %i %i %i %i Regs: %i %i Blocks: %i %i + // Achieved: %i %i Opt: %i %i\n",block_size, + // shmem_per_sm,max_shmem_per_block,functor_shmem,total_shmem, + // regs_per_sm,regs_per_wavefront,max_blocks_shmem,max_blocks_regs,blocks_per_sm,threads_per_sm,opt_block_size,opt_threads_per_sm); + block_size -= HIPTraits::WarpSize; + } + return opt_block_size; } +template +int hip_get_max_block_size(const HIPInternal *hip_instance, + const hipFuncAttributes &attr, const FunctorType &f, + const size_t vector_length, const size_t shmem_block, + const size_t shmem_thread) { + return hip_internal_get_block_size( + [](int x) { return x == 0; }, hip_instance, attr, f, vector_length, + shmem_block, shmem_thread); +} template struct HIPGetMaxBlockSize, true> { static int get_block_size(typename DriverType::functor_type const &f, size_t const vector_length, size_t const shmem_extra_block, size_t const shmem_extra_thread) { - unsigned int numBlocks = 0; - int blockSize = 1024; +// FIXME_HIP -- remove this once the API change becomes mature +#if !defined(__HIP__) + using blocktype = unsigned int; +#else + using blocktype = int; +#endif + blocktype numBlocks = 0; + int blockSize = 1024; int sharedmem = shmem_extra_block + shmem_extra_thread * (blockSize / vector_length) + ::Kokkos::Impl::FunctorTeamShmemSize< @@ -150,23 +232,13 @@ int hip_get_opt_block_size(typename DriverType::functor_type const &f, } template -int hip_get_opt_block_size(HIPInternal const * /*hip_instance*/, - hipFuncAttributes const &attr, - FunctorType const & /*f*/, - size_t const /*vector_length*/, - size_t const /*shmem_block*/, - size_t const /*shmem_thread*/) { - // FIXME_HIP find a better algorithm. Be aware that - // maxThreadsPerMultiProcessor, regsPerBlock, and l2CacheSize are bugged and - // always return zero - // https://github.com/ROCm-Developer-Tools/HIP/blob/6c5fa32815650cc20a4f783d09b013610348a4d5/include/hip/hcc_detail/hip_runtime_api.h#L438-L440 - // and we don't have access to the same information than we do for CUDA - - int const max_threads_per_block_mi60 = 1024; - int const max_threads_per_block = LaunchBounds::maxTperB == 0 - ? max_threads_per_block_mi60 - : LaunchBounds::maxTperB; - return std::min(attr.maxThreadsPerBlock, max_threads_per_block); +int hip_get_opt_block_size(HIPInternal const *hip_instance, + hipFuncAttributes const &attr, FunctorType const &f, + size_t const vector_length, size_t const shmem_block, + size_t const shmem_thread) { + return hip_internal_get_block_size( + [](int) { return true; }, hip_instance, attr, f, vector_length, + shmem_block, shmem_thread); } // FIXME_HIP the code is identical to the false struct except for diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp index 1dcba0ff3e..20af48bf6f 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.cpp @@ -97,56 +97,53 @@ const HIPInternalDevices &HIPInternalDevices::singleton() { namespace Impl { -int HIPInternal::was_initialized = 0; -int HIPInternal::was_finalized = 0; //---------------------------------------------------------------------------- -void HIPInternal::print_configuration(std::ostream & /*s*/) const { - // FIXME_HIP - Kokkos::abort("print_configuration not implemented!\n"); - /*const HIPInternalDevices & dev_info = HIPInternalDevices::singleton(); +void HIPInternal::print_configuration(std::ostream &s) const { + const HIPInternalDevices &dev_info = HIPInternalDevices::singleton(); -#if defined( KOKKOS_ENABLE_HIP ) - s << "macro KOKKOS_ENABLE_HIP : defined" << std::endl ; -#endif -#if defined( __hcc_version__ ) - s << "macro __hcc_version__ = " << __hcc_version__ - << std::endl ; + s << "macro KOKKOS_ENABLE_HIP : defined" << '\n'; +#if defined(HIP_VERSION) + s << "macro HIP_VERSION = " << HIP_VERSION << " = version " + << HIP_VERSION / 100 << "." << HIP_VERSION % 100 << '\n'; #endif - for ( int i = 0 ; i < dev_info.m_hipDevCount ; ++i ) { + for (int i = 0; i < dev_info.m_hipDevCount; ++i) { s << "Kokkos::Experimental::HIP[ " << i << " ] " - << dev_info.m_hipProp[i].name - << " version " << (dev_info.m_hipProp[i].major) << "." << -dev_info.m_hipProp[i].minor - << ", Total Global Memory: " << -human_memory_size(dev_info.m_hipProp[i].totalGlobalMem) - << ", Shared Memory per Wavefront: " << -human_memory_size(dev_info.m_hipProp[i].sharedMemPerWavefront); if ( m_hipDev == -i ) s << " : Selected" ; s << std::endl ; - }*/ + << dev_info.m_hipProp[i].name << " version " + << (dev_info.m_hipProp[i].major) << "." << dev_info.m_hipProp[i].minor + << ", Total Global Memory: " + << ::Kokkos::Impl::human_memory_size(dev_info.m_hipProp[i].totalGlobalMem) + << ", Shared Memory per Wavefront: " + << ::Kokkos::Impl::human_memory_size( + dev_info.m_hipProp[i].sharedMemPerBlock); + if (m_hipDev == i) s << " : Selected"; + s << '\n'; + } } //---------------------------------------------------------------------------- HIPInternal::~HIPInternal() { - if (m_scratchSpace || m_scratchFlags) { + if (m_scratchSpace || m_scratchFlags || m_scratchConcurrentBitset) { std::cerr << "Kokkos::Experimental::HIP ERROR: Failed to call " "Kokkos::Experimental::HIP::finalize()" << std::endl; std::cerr.flush(); } - m_hipDev = -1; - m_hipArch = -1; - m_multiProcCount = 0; - m_maxWarpCount = 0; - m_maxSharedWords = 0; - m_maxShmemPerBlock = 0; - m_scratchSpaceCount = 0; - m_scratchFlagsCount = 0; - m_scratchSpace = 0; - m_scratchFlags = 0; + m_hipDev = -1; + m_hipArch = -1; + m_multiProcCount = 0; + m_maxWarpCount = 0; + m_maxSharedWords = 0; + m_maxShmemPerBlock = 0; + m_scratchSpaceCount = 0; + m_scratchFlagsCount = 0; + m_scratchSpace = 0; + m_scratchFlags = 0; + m_scratchConcurrentBitset = nullptr; + m_stream = 0; } int HIPInternal::verify_is_initialized(const char *const label) const { @@ -165,13 +162,17 @@ HIPInternal &HIPInternal::singleton() { return *self; } -void HIPInternal::initialize(int hip_device_id) { +void HIPInternal::fence() const { + HIP_SAFE_CALL(hipStreamSynchronize(m_stream)); +} + +void HIPInternal::initialize(int hip_device_id, hipStream_t stream) { if (was_finalized) Kokkos::abort("Calling HIP::initialize after HIP::finalize is illegal\n"); if (is_initialized()) return; - enum { WordSize = sizeof(size_type) }; + int constexpr WordSize = sizeof(size_type); if (!HostSpace::execution_space::impl_is_initialized()) { const std::string msg( @@ -191,12 +192,12 @@ void HIPInternal::initialize(int hip_device_id) { if (ok_init && ok_id) { const struct hipDeviceProp_t &hipProp = dev_info.m_hipProp[hip_device_id]; - m_hipDev = hip_device_id; + m_hipDev = hip_device_id; + m_deviceProp = hipProp; hipSetDevice(m_hipDev); - // FIXME_HIP for now always uses default stream - m_stream = 0; + m_stream = stream; // number of multiprocessors m_multiProcCount = hipProp.multiProcessorCount; @@ -214,9 +215,13 @@ void HIPInternal::initialize(int hip_device_id) { // Maximum number of blocks m_maxBlock = hipProp.maxGridSize[0]; + // theoretically, we can get 40 WF's / CU, but only can sustain 32 + m_maxBlocksPerSM = 32; + // FIXME_HIP - Nick to implement this upstream + m_regsPerSM = 262144 / 32; m_shmemPerSM = hipProp.maxSharedMemoryPerMultiProcessor; m_maxShmemPerBlock = hipProp.sharedMemPerBlock; - m_maxThreadsPerSM = hipProp.maxThreadsPerMultiProcessor; + m_maxThreadsPerSM = m_maxBlocksPerSM * HIPTraits::WarpSize; m_maxThreadsPerBlock = hipProp.maxThreadsPerBlock; //---------------------------------- @@ -231,6 +236,31 @@ void HIPInternal::initialize(int hip_device_id) { (void)scratch_space(reduce_block_count * 16 * sizeof(size_type)); } //---------------------------------- + // Concurrent bitset for obtaining unique tokens from within + // an executing kernel. + { + const int32_t buffer_bound = + Kokkos::Impl::concurrent_bitset::buffer_bound(HIP::concurrency()); + + // Allocate and initialize uint32_t[ buffer_bound ] + + using Record = + Kokkos::Impl::SharedAllocationRecord; + + Record *const r = Record::allocate(Kokkos::Experimental::HIPSpace(), + "InternalScratchBitset", + sizeof(uint32_t) * buffer_bound); + + Record::increment(r); + + m_scratchConcurrentBitset = reinterpret_cast(r->data()); + + HIP_SAFE_CALL(hipMemset(m_scratchConcurrentBitset, 0, + sizeof(uint32_t) * buffer_bound)); + } + //---------------------------------- + } else { std::ostringstream msg; msg << "Kokkos::Experimental::HIP::initialize(" << hip_device_id @@ -253,8 +283,8 @@ void HIPInternal::initialize(int hip_device_id) { //---------------------------------------------------------------------------- -typedef Kokkos::Experimental::HIP::size_type - ScratchGrain[Impl::HIPTraits::WarpSize]; +using ScratchGrain = + Kokkos::Experimental::HIP::size_type[Impl::HIPTraits::WarpSize]; enum { sizeScratchGrain = sizeof(ScratchGrain) }; Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_space( @@ -263,9 +293,9 @@ Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_space( m_scratchSpaceCount * sizeScratchGrain < size) { m_scratchSpaceCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; static Record *const r = Record::allocate( Kokkos::Experimental::HIPSpace(), "InternalScratchSpace", @@ -285,9 +315,9 @@ Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_flags( m_scratchFlagsCount * sizeScratchGrain < size) { m_scratchFlagsCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; Record *const r = Record::allocate( Kokkos::Experimental::HIPSpace(), "InternalScratchFlags", @@ -307,30 +337,37 @@ Kokkos::Experimental::HIP::size_type *HIPInternal::scratch_flags( void HIPInternal::finalize() { HIP().fence(); - was_finalized = 1; + was_finalized = true; if (0 != m_scratchSpace || 0 != m_scratchFlags) { - typedef Kokkos::Impl::SharedAllocationRecord - RecordHIP; + using RecordHIP = + Kokkos::Impl::SharedAllocationRecord; RecordHIP::decrement(RecordHIP::get_record(m_scratchFlags)); RecordHIP::decrement(RecordHIP::get_record(m_scratchSpace)); + RecordHIP::decrement(RecordHIP::get_record(m_scratchConcurrentBitset)); - m_hipDev = -1; - m_hipArch = -1; - m_multiProcCount = 0; - m_maxWarpCount = 0; - m_maxBlock = 0; - m_maxSharedWords = 0; - m_maxShmemPerBlock = 0; - m_scratchSpaceCount = 0; - m_scratchFlagsCount = 0; - m_scratchSpace = 0; - m_scratchFlags = 0; + m_hipDev = -1; + m_hipArch = -1; + m_multiProcCount = 0; + m_maxWarpCount = 0; + m_maxBlock = 0; + m_maxSharedWords = 0; + m_maxShmemPerBlock = 0; + m_scratchSpaceCount = 0; + m_scratchFlagsCount = 0; + m_scratchSpace = 0; + m_scratchFlags = 0; + m_scratchConcurrentBitset = nullptr; + m_stream = 0; } } //---------------------------------------------------------------------------- +Kokkos::Experimental::HIP::size_type hip_internal_multiprocessor_count() { + return HIPInternal::singleton().m_multiProcCount; +} + Kokkos::Experimental::HIP::size_type hip_internal_maximum_warp_count() { return HIPInternal::singleton().m_maxWarpCount; } @@ -371,3 +408,13 @@ void hip_internal_error_throw(hipError_t e, const char *name, const char *file, } } // namespace Impl } // namespace Kokkos + +//---------------------------------------------------------------------------- + +namespace Kokkos { +namespace Experimental { +HIP::size_type HIP::detect_device_count() { + return HIPInternalDevices::singleton().m_hipDevCount; +} +} // namespace Experimental +} // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp index c66fb2776f..9688aef350 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Instance.hpp @@ -55,7 +55,8 @@ namespace Impl { struct HIPTraits { static int constexpr WarpSize = 64; - static int constexpr WarpIndexShift = 6; /* WarpSize == 1 << WarpShift*/ + static int constexpr WarpIndexMask = 0x003f; /* hexadecimal for 63 */ + static int constexpr WarpIndexShift = 6; /* WarpSize == 1 << WarpShift*/ static int constexpr ConstantMemoryUsage = 0x008000; /* 32k bytes */ static int constexpr ConstantMemoryUseThreshold = 0x000200; /* 512 bytes */ @@ -65,6 +66,7 @@ struct HIPTraits { HIP::size_type hip_internal_maximum_warp_count(); HIP::size_type hip_internal_maximum_grid_count(); +HIP::size_type hip_internal_multiprocessor_count(); HIP::size_type *hip_internal_scratch_space(const HIP::size_type size); HIP::size_type *hip_internal_scratch_flags(const HIP::size_type size); @@ -84,7 +86,9 @@ class HIPInternal { unsigned m_multiProcCount; unsigned m_maxWarpCount; unsigned m_maxBlock; + unsigned m_maxBlocksPerSM; unsigned m_maxSharedWords; + int m_regsPerSM; int m_shmemPerSM; int m_maxShmemPerBlock; int m_maxThreadsPerSM; @@ -93,11 +97,13 @@ class HIPInternal { size_type m_scratchFlagsCount; size_type *m_scratchSpace; size_type *m_scratchFlags; + uint32_t *m_scratchConcurrentBitset = nullptr; + + hipDeviceProp_t m_deviceProp; hipStream_t m_stream; - static int was_initialized; - static int was_finalized; + bool was_finalized = false; static HIPInternal &singleton(); @@ -107,11 +113,13 @@ class HIPInternal { return m_hipDev >= 0; } // 0 != m_scratchSpace && 0 != m_scratchFlags ; } - void initialize(int hip_device_id); + void initialize(int hip_device_id, hipStream_t stream = 0); void finalize(); void print_configuration(std::ostream &) const; + void fence() const; + ~HIPInternal(); HIPInternal() @@ -128,7 +136,8 @@ class HIPInternal { m_scratchSpaceCount(0), m_scratchFlagsCount(0), m_scratchSpace(0), - m_scratchFlags(0) {} + m_scratchFlags(0), + m_stream(0) {} size_type *scratch_space(const size_type size); size_type *scratch_flags(const size_type size); diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp index 5c19a3e0da..34ccd899c3 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_KernelLaunch.hpp @@ -53,10 +53,12 @@ #include #include -// FIXME_HIP cannot use global variable on the device with ROCm 2.9 -//__device__ __constant__ unsigned long kokkos_impl_hip_constant_memory_buffer -// [Kokkos::Experimental::Impl::HIPTraits::ConstantMemoryUsage / -// sizeof(unsigned long)]; +// Must use global variable on the device with HIP-Clang +#ifdef __HIP__ +__device__ __constant__ unsigned long kokkos_impl_hip_constant_memory_buffer + [Kokkos::Experimental::Impl::HIPTraits::ConstantMemoryUsage / + sizeof(unsigned long)]; +#endif namespace Kokkos { namespace Experimental { @@ -76,28 +78,31 @@ void *hip_resize_scratch_space(std::int64_t bytes, bool force_shrink = false); template __global__ static void hip_parallel_launch_constant_memory() { +// cannot use global constants in HCC +#ifdef __HCC__ __device__ __constant__ unsigned long kokkos_impl_hip_constant_memory_buffer [Kokkos::Experimental::Impl::HIPTraits::ConstantMemoryUsage / sizeof(unsigned long)]; +#endif - const DriverType &driver = *(reinterpret_cast( + const DriverType *const driver = (reinterpret_cast( kokkos_impl_hip_constant_memory_buffer)); - driver(); + driver->operator()(); } template __global__ static void hip_parallel_launch_local_memory( - const DriverType driver) { - driver(); + const DriverType *driver) { + driver->operator()(); } template __global__ __launch_bounds__( maxTperB, minBperSM) static void hip_parallel_launch_local_memory(const DriverType - driver) { - driver(); + *driver) { + driver->operator()(); } enum class HIPLaunchMechanism : unsigned { @@ -142,30 +147,34 @@ struct HIPParallelLaunch< "HIPParallelLaunch FAILED: shared memory request is too large"); } - // Invoke the driver function on the device - printf("%i %i %i | %i %i %i | %i\n", grid.x, grid.y, grid.z, block.x, - block.y, block.z, shmem); - printf("Pre Launch Error: %s\n", hipGetErrorName(hipGetLastError())); + // FIXME_HIP -- there is currently an error copying (some) structs + // by value to the device in HIP-Clang / VDI + // As a workaround, we can malloc the DriverType and explictly copy over. + // To remove once solved in HIP + DriverType *d_driver; + HIP_SAFE_CALL(hipMalloc(&d_driver, sizeof(DriverType))); + HIP_SAFE_CALL(hipMemcpyAsync(d_driver, &driver, sizeof(DriverType), + hipMemcpyHostToDevice, + hip_instance->m_stream)); + hip_parallel_launch_local_memory + <<m_stream>>>(d_driver); - hipLaunchKernelGGL( - (hip_parallel_launch_local_memory), - grid, block, shmem, hip_instance->m_stream, driver); - - Kokkos::Experimental::HIP().fence(); - printf("Post Launch Error: %s\n", hipGetErrorName(hipGetLastError())); #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) HIP_SAFE_CALL(hipGetLastError()); - Kokkos::Experimental::HIP().fence(); + hip_instance->fence(); #endif + HIP_SAFE_CALL(hipFree(d_driver)); } } static hipFuncAttributes get_hip_func_attributes() { hipFuncAttributes attr; hipFuncGetAttributes( - &attr, hip_parallel_launch_local_memory); + &attr, + reinterpret_cast( + hip_parallel_launch_local_memory)); return attr; } }; @@ -184,22 +193,29 @@ struct HIPParallelLaunch, } // Invoke the driver function on the device - hipLaunchKernelGGL(hip_parallel_launch_local_memory, grid, - block, shmem, hip_instance->m_stream, driver); - Kokkos::Experimental::HIP().fence(); + // FIXME_HIP -- see note about struct copy by value above + DriverType *d_driver; + HIP_SAFE_CALL(hipMalloc(&d_driver, sizeof(DriverType))); + HIP_SAFE_CALL(hipMemcpyAsync(d_driver, &driver, sizeof(DriverType), + hipMemcpyHostToDevice, + hip_instance->m_stream)); + hip_parallel_launch_local_memory + <<m_stream>>>(d_driver); + #if defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) HIP_SAFE_CALL(hipGetLastError()); - Kokkos::Experimental::HIP().fence(); + hip_instance->fence(); #endif + HIP_SAFE_CALL(hipFree(d_driver)); } } static hipFuncAttributes get_hip_func_attributes() { hipFuncAttributes attr; - hipFuncGetAttributes(&attr, - reinterpret_cast( - &hip_parallel_launch_local_memory)); + hipFuncGetAttributes( + &attr, reinterpret_cast( + &hip_parallel_launch_local_memory)); return attr; } }; diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp index 0a34ed505b..3426caafda 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Locks.cpp @@ -62,14 +62,14 @@ namespace Kokkos { namespace { __global__ void init_lock_array_kernel_atomic() { - unsigned i = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + unsigned i = blockIdx.x * blockDim.x + threadIdx.x; if (i < KOKKOS_IMPL_HIP_SPACE_ATOMIC_MASK + 1) { g_device_hip_lock_arrays.atomic[i] = 0; } } __global__ void init_lock_array_kernel_threadid(int N) { - unsigned i = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + unsigned i = blockIdx.x * blockDim.x + threadIdx.x; if (i < static_cast(N)) { g_device_hip_lock_arrays.scratch[i] = 0; } @@ -93,12 +93,11 @@ void initialize_host_hip_lock_arrays() { g_host_hip_lock_arrays.n = ::Kokkos::Experimental::HIP::concurrency(); KOKKOS_COPY_HIP_LOCK_ARRAYS_TO_DEVICE(); - hipLaunchKernelGGL(init_lock_array_kernel_atomic, - (KOKKOS_IMPL_HIP_SPACE_ATOMIC_MASK + 1 + 255) / 256, 256, - 0, 0); - hipLaunchKernelGGL(init_lock_array_kernel_threadid, - (::Kokkos::Experimental::HIP::concurrency() + 255) / 256, - 256, 0, 0, ::Kokkos::Experimental::HIP::concurrency()); + init_lock_array_kernel_atomic<<< + (KOKKOS_IMPL_HIP_SPACE_ATOMIC_MASK + 1 + 255) / 256, 256, 0, 0>>>(); + init_lock_array_kernel_threadid<<< + (::Kokkos::Experimental::HIP::concurrency() + 255) / 256, 256, 0, 0>>>( + ::Kokkos::Experimental::HIP::concurrency()); } void finalize_host_hip_lock_arrays() { diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp index 7a6161346c..c3acc0622d 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp @@ -113,8 +113,8 @@ class ParallelFor, *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 4) { - // id0,id1 encoded within hipThreadIdx_x; id2 to hipThreadIdx_y; id3 to - // hipThreadIdx_z + // id0,id1 encoded within threadIdx.x; id2 to threadIdx.y; id3 to + // threadIdx.z dim3 const block(m_policy.m_tile[0] * m_policy.m_tile[1], m_policy.m_tile[2], m_policy.m_tile[3]); dim3 const grid( @@ -131,8 +131,8 @@ class ParallelFor, *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 5) { - // id0,id1 encoded within hipThreadIdx_x; id2,id3 to hipThreadIdx_y; id4 - // to hipThreadIdx_z + // id0,id1 encoded within threadIdx.x; id2,id3 to threadIdx.y; id4 + // to threadIdx.z dim3 const block(m_policy.m_tile[0] * m_policy.m_tile[1], m_policy.m_tile[2] * m_policy.m_tile[3], m_policy.m_tile[4]); @@ -150,8 +150,8 @@ class ParallelFor, *this, grid, block, 0, m_policy.space().impl_internal_space_instance(), false); } else if (Policy::rank == 6) { - // id0,id1 encoded within hipThreadIdx_x; id2,id3 to hipThreadIdx_y; - // id4,id5 to hipThreadIdx_z + // id0,id1 encoded within threadIdx.x; id2,id3 to threadIdx.y; + // id4,id5 to threadIdx.z dim3 const block(m_policy.m_tile[0] * m_policy.m_tile[1], m_policy.m_tile[2] * m_policy.m_tile[3], m_policy.m_tile[4] * m_policy.m_tile[5]); @@ -213,8 +213,8 @@ class ParallelReduce, ReducerType, using functor_type = FunctorType; using size_type = Experimental::HIP::size_type; - // Algorithmic constraints: blockSize is a power of two AND hipBlockDim_y == - // hipBlockDim_z == 1 + // Algorithmic constraints: blockSize is a power of two AND blockDim.y == + // blockDim.z == 1 const FunctorType m_functor; const Policy m_policy; // used for workrange and nwork @@ -254,7 +254,7 @@ class ParallelReduce, ReducerType, reference_type value = ValueInit::init( ReducerConditional::select(m_functor, m_reducer), Experimental::kokkos_impl_hip_shared_memory() + - hipThreadIdx_y * word_count.value); + threadIdx.y * word_count.value); // Number of blocks is bounded so that the reduction can be limited to two // passes. Each thread block is given an approximately equal amount of @@ -265,24 +265,23 @@ class ParallelReduce, ReducerType, this->exec_range(value); } - // Reduce with final value at hipBlockDim_y - 1 location. + // Reduce with final value at blockDim.y - 1 location. // Problem: non power-of-two blockDim if (::Kokkos::Impl::hip_single_inter_block_reduce_scan< false, ReducerTypeFwd, WorkTagFwd>( - ReducerConditional::select(m_functor, m_reducer), hipBlockIdx_x, - hipGridDim_x, - Experimental::kokkos_impl_hip_shared_memory(), + ReducerConditional::select(m_functor, m_reducer), blockIdx.x, + gridDim.x, Experimental::kokkos_impl_hip_shared_memory(), m_scratch_space, m_scratch_flags)) { // This is the final block with the final result at the final threads' // location size_type* const shared = Experimental::kokkos_impl_hip_shared_memory() + - (hipBlockDim_y - 1) * word_count.value; + (blockDim.y - 1) * word_count.value; size_type* const global = m_result_ptr_device_accessible ? reinterpret_cast(m_result_ptr) : m_scratch_space; - if (hipThreadIdx_y == 0) { + if (threadIdx.y == 0) { Kokkos::Impl::FunctorFinal::final( ReducerConditional::select(m_functor, m_reducer), shared); } @@ -291,8 +290,7 @@ class ParallelReduce, ReducerType, __syncthreads(); } - for (unsigned i = hipThreadIdx_y; i < word_count.value; - i += hipBlockDim_y) { + for (unsigned i = threadIdx.y; i < word_count.value; i += blockDim.y) { global[i] = shared[i]; } } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp index a9c44606e4..11434a5b25 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Range.hpp @@ -52,6 +52,8 @@ #include #include #include +#include +#include namespace Kokkos { namespace Impl { @@ -91,11 +93,11 @@ class ParallelFor, using functor_type = FunctorType; inline __device__ void operator()(void) const { - const Member work_stride = hipBlockDim_y * hipGridDim_x; + const Member work_stride = blockDim.y * gridDim.x; const Member work_end = m_policy.end(); for (Member iwork = - m_policy.begin() + hipThreadIdx_y + hipBlockDim_y * hipBlockIdx_x; + m_policy.begin() + threadIdx.y + blockDim.y * blockIdx.x; iwork < work_end; iwork = iwork < work_end - work_stride ? iwork + work_stride : work_end) { @@ -156,8 +158,8 @@ class ParallelReduce, ReducerType, using size_type = Kokkos::Experimental::HIP::size_type; using index_type = typename Policy::index_type; - // Algorithmic constraints: blockSize is a power of two AND hipBlockDim_y == - // hipBlockDim_z == 1 + // Algorithmic constraints: blockSize is a power of two AND blockDim.y == + // blockDim.z == 1 const FunctorType m_functor; const Policy m_policy; @@ -167,18 +169,16 @@ class ParallelReduce, ReducerType, size_type* m_scratch_space = nullptr; size_type* m_scratch_flags = nullptr; - // Shall we use the shfl based reduction or not (only use it for static sized - // types of more than 128bit) - enum { - UseShflReduction = false - }; //((sizeof(value_type)>2*sizeof(double)) && ValueTraits::StaticValueSize) - //}; - // Some crutch to do function overloading - private: - using DummyShflReductionType = double; - using DummySHMEMReductionType = int; + // FIXME_HIP_PERFORMANCE Need a rule to choose when to use shared memory and + // when to use shuffle + static bool constexpr UseShflReduction = + ((sizeof(value_type) > 2 * sizeof(double)) && + static_cast(ValueTraits::StaticValueSize)); + + private: + struct ShflReductionTag {}; + struct SHMEMReductionTag {}; - public: // Make the exec_range calls call to Reduce::DeviceIterateTile template __device__ inline @@ -194,7 +194,15 @@ class ParallelReduce, ReducerType, m_functor(TagType(), i, update); } + public: __device__ inline void operator()() const { + using ReductionTag = + typename std::conditional::type; + run(ReductionTag{}); + } + + __device__ inline void run(SHMEMReductionTag) const { const integral_nonzero_constant word_count(ValueTraits::value_size( @@ -205,7 +213,7 @@ class ParallelReduce, ReducerType, reference_type value = ValueInit::init( ReducerConditional::select(m_functor, m_reducer), ::Kokkos::Experimental::kokkos_impl_hip_shared_memory() + - hipThreadIdx_y * word_count.value); + threadIdx.y * word_count.value); // Number of blocks is bounded so that the reduction can be limited to two // passes. Each thread block is given an approximately equal amount of @@ -213,19 +221,18 @@ class ParallelReduce, ReducerType, // ordering does not match the final pass, but is arithmetically // equivalent. - const WorkRange range(m_policy, hipBlockIdx_x, hipGridDim_x); + const WorkRange range(m_policy, blockIdx.x, gridDim.x); - for (Member iwork = range.begin() + hipThreadIdx_y, - iwork_end = range.end(); - iwork < iwork_end; iwork += hipBlockDim_y) { + for (Member iwork = range.begin() + threadIdx.y, iwork_end = range.end(); + iwork < iwork_end; iwork += blockDim.y) { this->template exec_range(iwork, value); } } - // Reduce with final value at hipBlockDim_y - 1 location. + // Reduce with final value at blockDim.y - 1 location. if (hip_single_inter_block_reduce_scan( - ReducerConditional::select(m_functor, m_reducer), hipBlockIdx_x, - hipGridDim_x, + ReducerConditional::select(m_functor, m_reducer), blockIdx.x, + gridDim.x, ::Kokkos::Experimental::kokkos_impl_hip_shared_memory(), m_scratch_space, m_scratch_flags)) { // This is the final block with the final result at the final threads' @@ -233,12 +240,12 @@ class ParallelReduce, ReducerType, size_type* const shared = ::Kokkos::Experimental::kokkos_impl_hip_shared_memory() + - (hipBlockDim_y - 1) * word_count.value; + (blockDim.y - 1) * word_count.value; size_type* const global = m_result_ptr_device_accessible ? reinterpret_cast(m_result_ptr) : m_scratch_space; - if (hipThreadIdx_y == 0) { + if (threadIdx.y == 0) { Kokkos::Impl::FunctorFinal::final( ReducerConditional::select(m_functor, m_reducer), shared); } @@ -248,13 +255,56 @@ class ParallelReduce, ReducerType, __syncthreads(); } - for (unsigned i = hipThreadIdx_y; i < word_count.value; - i += hipBlockDim_y) { + for (unsigned i = threadIdx.y; i < word_count.value; i += blockDim.y) { global[i] = shared[i]; } } } + __device__ inline void run(ShflReductionTag) const { + value_type value; + ValueInit::init(ReducerConditional::select(m_functor, m_reducer), &value); + // Number of blocks is bounded so that the reduction can be limited to two + // passes. Each thread block is given an approximately equal amount of work + // to perform. Accumulate the values for this block. The accumulation + // ordering does not match the final pass, but is arithmetically equivalent. + + WorkRange const range(m_policy, blockIdx.x, gridDim.x); + + for (Member iwork = range.begin() + threadIdx.y, iwork_end = range.end(); + iwork < iwork_end; iwork += blockDim.y) { + this->template exec_range(iwork, value); + } + + pointer_type const result = reinterpret_cast(m_scratch_space); + + int max_active_thread = static_cast(range.end() - range.begin()) < + static_cast(blockDim.y) + ? range.end() - range.begin() + : blockDim.y; + + max_active_thread = + (max_active_thread == 0) ? blockDim.y : max_active_thread; + + value_type init; + ValueInit::init(ReducerConditional::select(m_functor, m_reducer), &init); + if (Impl::hip_inter_block_shuffle_reduction( + value, init, + ValueJoin(ReducerConditional::select(m_functor, m_reducer)), + m_scratch_space, result, m_scratch_flags, max_active_thread)) { + unsigned int const id = threadIdx.y * blockDim.x + threadIdx.x; + if (id == 0) { + Kokkos::Impl::FunctorFinal::final( + ReducerConditional::select(m_functor, m_reducer), + reinterpret_cast(&value)); + pointer_type const final_result = + m_result_ptr_device_accessible ? m_result_ptr : result; + *final_result = value; + } + } + } + // Determine block size constrained by shared memory: inline unsigned local_block_size(const FunctorType& f) { // FIXME_HIP I don't know where 8 comes from @@ -281,6 +331,7 @@ class ParallelReduce, ReducerType, const index_type nwork = m_policy.end() - m_policy.begin(); if (nwork) { const int block_size = local_block_size(m_functor); + KOKKOS_ASSERT(block_size > 0); m_scratch_space = ::Kokkos::Experimental::Impl::hip_internal_scratch_space( @@ -294,8 +345,7 @@ class ParallelReduce, ReducerType, // REQUIRED ( 1 , N , 1 ) const dim3 block(1, block_size, 1); // Required grid.x <= block.y - const dim3 grid( - std::min(int(block.y), int((nwork + block.y - 1) / block.y)), 1, 1); + const dim3 grid(std::min(block.y, (nwork + block.y - 1) / block.y), 1, 1); const int shmem = UseShflReduction @@ -311,7 +361,7 @@ class ParallelReduce, ReducerType, false); // copy to device and execute if (!m_result_ptr_device_accessible) { - ::Kokkos::Experimental::HIP().fence(); + m_policy.space().impl_internal_space_instance()->fence(); if (m_result_ptr) { const int size = ValueTraits::value_size( @@ -377,10 +427,10 @@ class ParallelScanHIPBase { protected: // Algorithmic constraints: - // (a) hipBlockDim_y is a power of two - // (b) hipBlockDim_x == hipBlockDim_z == 1 - // (c) hipGridDim_x <= hipBlockDim_y * hipBlockDim_y - // (d) hipGridDim_y == hipGridDim_z == 1 + // (a) blockDim.y is a power of two + // (b) blockDim.x == blockDim.z == 1 + // (c) gridDim.x <= blockDim.y * blockDim.y + // (d) gridDim.y == gridDim.z == 1 const FunctorType m_functor; const Policy m_policy; @@ -415,7 +465,7 @@ class ParallelScanHIPBase { size_type* const shared_value = Kokkos::Experimental::kokkos_impl_hip_shared_memory() + - word_count.value * hipThreadIdx_y; + word_count.value * threadIdx.y; ValueInit::init(m_functor, shared_value); @@ -424,20 +474,20 @@ class ParallelScanHIPBase { // to perform. Accumulate the values for this block. The accumulation // ordering does not match the final pass, but is arithmetically equivalent. - const WorkRange range(m_policy, hipBlockIdx_x, hipGridDim_x); + const WorkRange range(m_policy, blockIdx.x, gridDim.x); - for (Member iwork = range.begin() + hipThreadIdx_y, iwork_end = range.end(); - iwork < iwork_end; iwork += hipBlockDim_y) { + for (Member iwork = range.begin() + threadIdx.y, iwork_end = range.end(); + iwork < iwork_end; iwork += blockDim.y) { this->template exec_range( iwork, ValueOps::reference(shared_value), false); } // Reduce and scan, writing out scan of blocks' totals and block-groups' - // totals. Blocks' scan values are written to 'hipBlockIdx_x' location. - // Block-groups' scan values are at: i = ( j * hipBlockDim_y - 1 ) for i < - // hipGridDim_x + // totals. Blocks' scan values are written to 'blockIdx.x' location. + // Block-groups' scan values are at: i = ( j * blockDim.y - 1 ) for i < + // gridDim.x hip_single_inter_block_reduce_scan( - m_functor, hipBlockIdx_x, hipGridDim_x, + m_functor, blockIdx.x, gridDim.x, Kokkos::Experimental::kokkos_impl_hip_shared_memory(), m_scratch_space, m_scratch_flags); } @@ -454,26 +504,26 @@ class ParallelScanHIPBase { size_type* const shared_data = Kokkos::Experimental::kokkos_impl_hip_shared_memory(); size_type* const shared_prefix = - shared_data + word_count.value * hipThreadIdx_y; + shared_data + word_count.value * threadIdx.y; size_type* const shared_accum = - shared_data + word_count.value * (hipBlockDim_y + 1); + shared_data + word_count.value * (blockDim.y + 1); // Starting value for this thread block is the previous block's total. - if (hipBlockIdx_x) { + if (blockIdx.x) { size_type* const block_total = - m_scratch_space + word_count.value * (hipBlockIdx_x - 1); - for (unsigned i = hipThreadIdx_y; i < word_count.value; ++i) { + m_scratch_space + word_count.value * (blockIdx.x - 1); + for (unsigned i = threadIdx.y; i < word_count.value; ++i) { shared_accum[i] = block_total[i]; } - } else if (0 == hipThreadIdx_y) { + } else if (0 == threadIdx.y) { ValueInit::init(m_functor, shared_accum); } - const WorkRange range(m_policy, hipBlockIdx_x, hipGridDim_x); + const WorkRange range(m_policy, blockIdx.x, gridDim.x); for (typename Policy::member_type iwork_base = range.begin(); - iwork_base < range.end(); iwork_base += hipBlockDim_y) { - const typename Policy::member_type iwork = iwork_base + hipThreadIdx_y; + iwork_base < range.end(); iwork_base += blockDim.y) { + const typename Policy::member_type iwork = iwork_base + threadIdx.y; __syncthreads(); // Don't overwrite previous iteration values until they // are used @@ -482,7 +532,7 @@ class ParallelScanHIPBase { // Copy previous block's accumulation total into thread[0] prefix and // inclusive scan value of this block - for (unsigned i = hipThreadIdx_y; i < word_count.value; ++i) { + for (unsigned i = threadIdx.y; i < word_count.value; ++i) { shared_data[i + word_count.value] = shared_data[i] = shared_accum[i]; } @@ -497,15 +547,15 @@ class ParallelScanHIPBase { false); } - // Scan block values into locations shared_data[1..hipBlockDim_y] + // Scan block values into locations shared_data[1..blockDim.y] hip_intra_block_reduce_scan( m_functor, typename ValueTraits::pointer_type(shared_data + word_count.value)); { size_type* const block_total = - shared_data + word_count.value * hipBlockDim_y; - for (unsigned i = hipThreadIdx_y; i < word_count.value; ++i) { + shared_data + word_count.value * blockDim.y; + for (unsigned i = threadIdx.y; i < word_count.value; ++i) { shared_accum[i] = block_total[i]; } } @@ -531,8 +581,8 @@ class ParallelScanHIPBase { // Determine block size constrained by shared memory: inline unsigned local_block_size(const FunctorType& f) { - // hipBlockDim_y must be power of two = 128 (2 warps) or 256 (4 warps) or - // 512 (8 warps) hipGridDim_x <= hipBlockDim_y * hipBlockDim_y + // blockDim.y must be power of two = 128 (2 warps) or 256 (4 warps) or + // 512 (8 warps) gridDim.x <= blockDim.y * blockDim.y // // TODO check best option @@ -554,10 +604,8 @@ class ParallelScanHIPBase { // correctly, the unit tests fail with wrong results const int gridMaxComputeCapability_2x = 0x01fff; - // FIXME_HIP block sizes greater than 256 don't work correctly, - // the unit tests fail with wrong results - const int block_size = - std::min(static_cast(local_block_size(m_functor)), 256); + const int block_size = static_cast(local_block_size(m_functor)); + KOKKOS_ASSERT(block_size > 0); const int grid_max = std::min(block_size * block_size, gridMaxComputeCapability_2x); diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp index 53097f3643..ed138dd951 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Parallel_Team.hpp @@ -94,19 +94,6 @@ class TeamPolicyInternal m_space = p.m_space; } - TeamPolicyInternal& operator=(TeamPolicyInternal const& p) { - m_league_size = p.m_league_size; - m_team_size = p.m_team_size; - m_vector_length = p.m_vector_length; - m_team_scratch_size[0] = p.m_team_scratch_size[0]; - m_team_scratch_size[1] = p.m_team_scratch_size[1]; - m_thread_scratch_size[0] = p.m_thread_scratch_size[0]; - m_thread_scratch_size[1] = p.m_thread_scratch_size[1]; - m_chunk_size = p.m_chunk_size; - m_space = p.m_space; - return *this; - } - template int team_size_max(FunctorType const& f, ParallelForTag const&) const { using closure_type = @@ -123,10 +110,34 @@ class TeamPolicyInternal return block_size / vector_length(); } + template + inline int team_size_max(const FunctorType& f, + const ParallelReduceTag&) const { + using functor_analysis_type = + Impl::FunctorAnalysis; + using reducer_type = typename Impl::ParallelReduceReturnValue< + void, typename functor_analysis_type::value_type, + FunctorType>::reducer_type; + using closure_type = + Impl::ParallelReduce, + reducer_type>; + return internal_team_size_max(f); + } + + template + inline int team_size_max(const FunctorType& f, const ReducerType& /*r*/, + const ParallelReduceTag&) const { + using closure_type = + Impl::ParallelReduce, + ReducerType>; + return internal_team_size_max(f); + } + template int team_size_recommended(FunctorType const& f, ParallelForTag const&) const { - typedef Impl::ParallelFor > - closure_type; + using closure_type = + Impl::ParallelFor >; hipFuncAttributes attr = ::Kokkos::Experimental::Impl::HIPParallelLaunch< closure_type, typename traits::launch_bounds>::get_hip_func_attributes(); @@ -139,6 +150,30 @@ class TeamPolicyInternal return block_size / vector_length(); } + template + inline int team_size_recommended(FunctorType const& f, + ParallelReduceTag const&) const { + using functor_analysis_type = + Impl::FunctorAnalysis; + using reducer_type = typename Impl::ParallelReduceReturnValue< + void, typename functor_analysis_type::value_type, + FunctorType>::reducer_type; + using closure_type = + Impl::ParallelReduce, + reducer_type>; + return internal_team_size_recommended(f); + } + + template + int team_size_recommended(FunctorType const& f, ReducerType const&, + ParallelReduceTag const&) const { + using closure_type = + Impl::ParallelReduce, + ReducerType>; + return internal_team_size_recommended(f); + } + static int vector_length_max() { return ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; } @@ -149,9 +184,10 @@ class TeamPolicyInternal // Allow only power-of-two vector_length if (!(is_integral_power_of_two(test_vector_length))) { - int test_pow2 = 1; - for (int i = 0; i < 5; i++) { - test_pow2 = test_pow2 << 1; + int test_pow2 = 1; + int constexpr warp_size = Experimental::Impl::HIPTraits::WarpSize; + while (test_pow2 < warp_size) { + test_pow2 <<= 1; if (test_pow2 > test_vector_length) { break; } @@ -379,12 +415,12 @@ class ParallelFor, using size_type = ::Kokkos::Experimental::HIP::size_type; private: - using Member = typename Policy::member_type; - using WorkTag = typename Policy::work_tag; - using LaunchBounds = typename Policy::launch_bounds; + using member_type = typename Policy::member_type; + using work_tag = typename Policy::work_tag; + using launch_bounds = typename Policy::launch_bounds; - // Algorithmic constraints: hipBlockDim_y is a power of two AND hipBlockDim_y - // == hipBlockDim_z == 1 shared memory utilization: + // Algorithmic constraints: blockDim.y is a power of two AND + // blockDim.y == blockDim.z == 1 shared memory utilization: // // [ team reduce space ] // [ team shared space ] @@ -403,14 +439,14 @@ class ParallelFor, template __device__ inline typename std::enable_if::value>::type - exec_team(const Member& member) const { + exec_team(const member_type& member) const { m_functor(member); } template __device__ inline typename std::enable_if::value>::type - exec_team(const Member& member) const { + exec_team(const member_type& member) const { m_functor(TagType(), member); } @@ -420,16 +456,16 @@ class ParallelFor, int64_t threadid = 0; if (m_scratch_size[1] > 0) { __shared__ int64_t base_thread_id; - if (hipThreadIdx_x == 0 && hipThreadIdx_y == 0) { - threadid = (hipBlockIdx_x * hipBlockDim_z + hipThreadIdx_z) % - (hip_lock_arrays.n / (hipBlockDim_x * hipBlockDim_y)); - threadid *= hipBlockDim_x * hipBlockDim_y; + if (threadIdx.x == 0 && threadIdx.y == 0) { + threadid = (blockIdx.x * blockDim.z + threadIdx.z) % + (hip_lock_arrays.n / (blockDim.x * blockDim.y)); + threadid *= blockDim.x * blockDim.y; int done = 0; while (!done) { done = (0 == atomicCAS(&hip_lock_arrays.scratch[threadid], 0, 1)); if (!done) { - threadid += hipBlockDim_x * hipBlockDim_y; - if (int64_t(threadid + hipBlockDim_x * hipBlockDim_y) >= + threadid += blockDim.x * blockDim.y; + if (int64_t(threadid + blockDim.x * blockDim.y) >= int64_t(hip_lock_arrays.n)) threadid = 0; } @@ -441,20 +477,19 @@ class ParallelFor, } int const int_league_size = static_cast(m_league_size); - for (int league_rank = hipBlockIdx_x; league_rank < int_league_size; - league_rank += hipGridDim_x) { - this->template exec_team(typename Policy::member_type( + for (int league_rank = blockIdx.x; league_rank < int_league_size; + league_rank += gridDim.x) { + this->template exec_team(typename Policy::member_type( ::Kokkos::Experimental::kokkos_impl_hip_shared_memory(), m_shmem_begin, m_shmem_size, - static_cast( - static_cast(m_scratch_ptr[1]) + - ptrdiff_t(threadid / (hipBlockDim_x * hipBlockDim_y)) * - m_scratch_size[1]), + static_cast(static_cast(m_scratch_ptr[1]) + + ptrdiff_t(threadid / (blockDim.x * blockDim.y)) * + m_scratch_size[1]), m_scratch_size[1], league_rank, m_league_size)); } if (m_scratch_size[1] > 0) { __syncthreads(); - if (hipThreadIdx_x == 0 && hipThreadIdx_y == 0) + if (threadIdx.x == 0 && threadIdx.y == 0) hip_lock_arrays.scratch[threadid] = 0; } } @@ -476,7 +511,7 @@ class ParallelFor, dim3 const block(static_cast(m_vector_size), static_cast(m_team_size), 1); - ::Kokkos::Experimental::Impl::HIPParallelLaunch( + ::Kokkos::Experimental::Impl::HIPParallelLaunch( *this, grid, block, shmem_size_total, m_policy.space().impl_internal_space_instance(), true); // copy to device and execute @@ -499,12 +534,12 @@ class ParallelFor, m_team_size(arg_policy.team_size()), m_vector_size(arg_policy.vector_length()) { hipFuncAttributes attr = ::Kokkos::Experimental::Impl::HIPParallelLaunch< - ParallelFor, LaunchBounds>::get_hip_func_attributes(); + ParallelFor, launch_bounds>::get_hip_func_attributes(); m_team_size = m_team_size >= 0 ? m_team_size : ::Kokkos::Experimental::Impl::hip_get_opt_block_size< - FunctorType, LaunchBounds>( + FunctorType, launch_bounds>( m_policy.space().impl_internal_space_instance(), attr, m_functor, m_vector_size, m_policy.team_scratch_size(0), m_policy.thread_scratch_size(0)) / @@ -543,7 +578,7 @@ class ParallelFor, if (static_cast(m_team_size) > static_cast( ::Kokkos::Experimental::Impl::hip_get_max_block_size( + launch_bounds>( m_policy.space().impl_internal_space_instance(), attr, arg_functor, arg_policy.vector_length(), arg_policy.team_scratch_size(0), @@ -554,6 +589,474 @@ class ParallelFor, } } }; + +//---------------------------------------------------------------------------- +//---------------------------------------------------------------------------- + +template +class ParallelReduce, + ReducerType, Kokkos::Experimental::HIP> { + public: + using Policy = TeamPolicyInternal; + + private: + using member_type = typename Policy::member_type; + using work_tag = typename Policy::work_tag; + using launch_bounds = typename Policy::launch_bounds; + + using reducer_conditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using reducer_type_fwd = typename reducer_conditional::type; + using work_tag_fwd = + typename Kokkos::Impl::if_c::value, + work_tag, void>::type; + + using value_traits = + Kokkos::Impl::FunctorValueTraits; + using value_init = + Kokkos::Impl::FunctorValueInit; + using value_join = + Kokkos::Impl::FunctorValueJoin; + + using pointer_type = typename value_traits::pointer_type; + using reference_type = typename value_traits::reference_type; + using value_type = typename value_traits::value_type; + + public: + using functor_type = FunctorType; + using size_type = Kokkos::Experimental::HIP::size_type; + + static int constexpr UseShflReduction = (value_traits::StaticValueSize != 0); + + private: + using DummyShflReductionType = double; + using DummySHMEMReductionType = int; + + // Algorithmic constraints: blockDim.y is a power of two AND + // blockDim.y == blockDim.z == 1 shared memory utilization: + // + // [ global reduce space ] + // [ team reduce space ] + // [ team shared space ] + // + + const FunctorType m_functor; + const Policy m_policy; + const ReducerType m_reducer; + const pointer_type m_result_ptr; + const bool m_result_ptr_device_accessible; + size_type* m_scratch_space; + size_type* m_scratch_flags; + size_type m_team_begin; + size_type m_shmem_begin; + size_type m_shmem_size; + void* m_scratch_ptr[2]; + int m_scratch_size[2]; + const size_type m_league_size; + int m_team_size; + const size_type m_vector_size; + + template + __device__ inline + typename std::enable_if::value>::type + exec_team(member_type const& member, reference_type update) const { + m_functor(member, update); + } + + template + __device__ inline + typename std::enable_if::value>::type + exec_team(member_type const& member, reference_type update) const { + m_functor(TagType(), member, update); + } + + public: + __device__ inline void operator()() const { + int64_t threadid = 0; + if (m_scratch_size[1] > 0) { + __shared__ int64_t base_thread_id; + // FIXME_HIP This uses g_device_hip_lock_arrays which is not working + if (threadIdx.x == 0 && threadIdx.y == 0) { + Impl::hip_abort("Error should not be here (not implemented yet)\n"); + threadid = (blockIdx.x * blockDim.z + threadIdx.z) % + (g_device_hip_lock_arrays.n / (blockDim.x * blockDim.y)); + threadid *= blockDim.x * blockDim.y; + int done = 0; + while (!done) { + done = (0 == + atomicCAS(&g_device_hip_lock_arrays.scratch[threadid], 0, 1)); + if (!done) { + threadid += blockDim.x * blockDim.y; + if (static_cast(threadid + blockDim.x * blockDim.y) >= + static_cast(g_device_hip_lock_arrays.n)) + threadid = 0; + } + } + base_thread_id = threadid; + } + __syncthreads(); + threadid = base_thread_id; + } + + run(Kokkos::Impl::if_c::select(1, 1.0), + threadid); + if (m_scratch_size[1] > 0) { + __syncthreads(); + if (threadIdx.x == 0 && threadIdx.y == 0) { + Impl::hip_abort("Error should not be here (not implemented yet)\n"); + g_device_hip_lock_arrays.scratch[threadid] = 0; + } + } + } + + __device__ inline void run(DummySHMEMReductionType const&, + int const& threadid) const { + integral_nonzero_constant const + word_count(value_traits::value_size( + reducer_conditional::select(m_functor, m_reducer)) / + sizeof(size_type)); + + reference_type value = value_init::init( + reducer_conditional::select(m_functor, m_reducer), + Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + threadIdx.y * word_count.value); + + // Iterate this block through the league + int const int_league_size = static_cast(m_league_size); + for (int league_rank = blockIdx.x; league_rank < int_league_size; + league_rank += gridDim.x) { + this->template exec_team( + member_type( + Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + m_team_begin, + m_shmem_begin, m_shmem_size, + reinterpret_cast( + reinterpret_cast(m_scratch_ptr[1]) + + static_cast(threadid / (blockDim.x * blockDim.y)) * + m_scratch_size[1]), + m_scratch_size[1], league_rank, m_league_size), + value); + } + + // Reduce with final value at blockDim.y - 1 location. + if (hip_single_inter_block_reduce_scan( + reducer_conditional::select(m_functor, m_reducer), blockIdx.x, + gridDim.x, + Kokkos::Experimental::kokkos_impl_hip_shared_memory(), + m_scratch_space, m_scratch_flags)) { + // This is the final block with the final result at the final threads' + // location + + size_type* const shared = + Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + (blockDim.y - 1) * word_count.value; + size_type* const global = m_result_ptr_device_accessible + ? reinterpret_cast(m_result_ptr) + : m_scratch_space; + + if (threadIdx.y == 0) { + Kokkos::Impl::FunctorFinal::final( + reducer_conditional::select(m_functor, m_reducer), shared); + } + + if (Kokkos::Experimental::Impl::HIPTraits::WarpSize < word_count.value) { + __syncthreads(); + } + + for (unsigned i = threadIdx.y; i < word_count.value; i += blockDim.y) { + global[i] = shared[i]; + } + } + } + + __device__ inline void run(DummyShflReductionType const&, + int const& threadid) const { + // FIXME_HIP implementation close to the function above + value_type value; + value_init::init(reducer_conditional::select(m_functor, m_reducer), &value); + + // Iterate this block through the league + int const int_league_size = static_cast(m_league_size); + for (int league_rank = blockIdx.x; league_rank < int_league_size; + league_rank += gridDim.x) { + this->template exec_team( + member_type( + Kokkos::Experimental::kokkos_impl_hip_shared_memory() + + m_team_begin, + m_shmem_begin, m_shmem_size, + reinterpret_cast( + reinterpret_cast(m_scratch_ptr[1]) + + static_cast(threadid / (blockDim.x * blockDim.y)) * + m_scratch_size[1]), + m_scratch_size[1], league_rank, m_league_size), + value); + } + + pointer_type const result = + m_result_ptr_device_accessible + ? m_result_ptr + : reinterpret_cast(m_scratch_space); + + value_type init; + value_init::init(reducer_conditional::select(m_functor, m_reducer), &init); + if (Impl::hip_inter_block_shuffle_reduction( + value, init, + value_join(reducer_conditional::select(m_functor, m_reducer)), + m_scratch_space, result, m_scratch_flags, blockDim.y)) { + unsigned int const id = threadIdx.y * blockDim.x + threadIdx.x; + if (id == 0) { + Kokkos::Impl::FunctorFinal::final( + reducer_conditional::select(m_functor, m_reducer), + reinterpret_cast(&value)); + *result = value; + } + } + } + + inline void execute() { + const int nwork = m_league_size * m_team_size; + if (nwork) { + const int block_count = + UseShflReduction + ? std::min( + m_league_size, + size_type(1024 * + Kokkos::Experimental::Impl::HIPTraits::WarpSize)) + : std::min(static_cast(m_league_size), m_team_size); + + m_scratch_space = Kokkos::Experimental::Impl::hip_internal_scratch_space( + value_traits::value_size( + reducer_conditional::select(m_functor, m_reducer)) * + block_count); + m_scratch_flags = Kokkos::Experimental::Impl::hip_internal_scratch_flags( + sizeof(size_type)); + + dim3 block(m_vector_size, m_team_size, 1); + dim3 grid(block_count, 1, 1); + const int shmem_size_total = m_team_begin + m_shmem_begin + m_shmem_size; + + Kokkos::Experimental::Impl::HIPParallelLaunch( + *this, grid, block, shmem_size_total, + m_policy.space().impl_internal_space_instance(), + true); // copy to device and execute + + if (!m_result_ptr_device_accessible) { + m_policy.space().impl_internal_space_instance()->fence(); + + if (m_result_ptr) { + const int size = value_traits::value_size( + reducer_conditional::select(m_functor, m_reducer)); + DeepCopy( + m_result_ptr, m_scratch_space, size); + } + } + } else { + if (m_result_ptr) { + value_init::init(reducer_conditional::select(m_functor, m_reducer), + m_result_ptr); + } + } + } + + template + ParallelReduce(FunctorType const& arg_functor, Policy const& arg_policy, + ViewType const& arg_result, + typename std::enable_if::value, + void*>::type = nullptr) + : m_functor(arg_functor), + m_policy(arg_policy), + m_reducer(InvalidType()), + m_result_ptr(arg_result.data()), + m_result_ptr_device_accessible( + MemorySpaceAccess::accessible), + m_scratch_space(0), + m_scratch_flags(0), + m_team_begin(0), + m_shmem_begin(0), + m_shmem_size(0), + m_scratch_ptr{nullptr, nullptr}, + m_league_size(arg_policy.league_size()), + m_team_size(arg_policy.team_size()), + m_vector_size(arg_policy.vector_length()) { + hipFuncAttributes attr = Kokkos::Experimental::Impl::HIPParallelLaunch< + ParallelReduce, launch_bounds>::get_hip_func_attributes(); + m_team_size = + m_team_size >= 0 + ? m_team_size + : Kokkos::Experimental::Impl::hip_get_opt_block_size( + m_policy.space().impl_internal_space_instance(), attr, + m_functor, m_vector_size, m_policy.team_scratch_size(0), + m_policy.thread_scratch_size(0)) / + m_vector_size; + + // Return Init value if the number of worksets is zero + if (m_league_size * m_team_size == 0) { + value_init::init(reducer_conditional::select(m_functor, m_reducer), + arg_result.data()); + return; + } + + m_team_begin = + UseShflReduction + ? 0 + : hip_single_inter_block_reduce_scan_shmem(arg_functor, + m_team_size); + m_shmem_begin = sizeof(double) * (m_team_size + 2); + m_shmem_size = + m_policy.scratch_size(0, m_team_size) + + FunctorTeamShmemSize::value(arg_functor, m_team_size); + m_scratch_size[0] = m_shmem_size; + m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); + m_scratch_ptr[1] = + m_team_size <= 0 ? nullptr + : Kokkos::Experimental::Impl::hip_resize_scratch_space( + static_cast(m_scratch_size[1]) * + (static_cast( + Kokkos::Experimental::HIP::concurrency() / + (m_team_size * m_vector_size)))); + + // The global parallel_reduce does not support vector_length other than 1 at + // the moment + if ((arg_policy.vector_length() > 1) && !UseShflReduction) + Impl::throw_runtime_exception( + "Kokkos::parallel_reduce with a TeamPolicy using a vector length of " + "greater than 1 is not currently supported for HIP for dynamic " + "sized reduction types."); + + if ((m_team_size < Kokkos::Experimental::Impl::HIPTraits::WarpSize) && + !UseShflReduction) + Impl::throw_runtime_exception( + "Kokkos::parallel_reduce with a TeamPolicy using a team_size smaller " + "than 64 is not currently supported with HIP for dynamic sized " + "reduction types."); + + // Functor's reduce memory, team scan memory, and team shared memory depend + // upon team size. + + const int shmem_size_total = m_team_begin + m_shmem_begin + m_shmem_size; + + if (!Kokkos::Impl::is_integral_power_of_two(m_team_size) && + !UseShflReduction) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelReduce< HIP > bad team size")); + } + + if (m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < + shmem_size_total) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelReduce< HIP > requested too much " + "L0 scratch memory")); + } + + if (static_cast(m_team_size) > + arg_policy.team_size_max(m_functor, m_reducer, ParallelReduceTag())) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelReduce< HIP > requested too " + "large team size.")); + } + } + + ParallelReduce(FunctorType const& arg_functor, Policy const& arg_policy, + ReducerType const& reducer) + : m_functor(arg_functor), + m_policy(arg_policy), + m_reducer(reducer), + m_result_ptr(reducer.view().data()), + m_result_ptr_device_accessible( + MemorySpaceAccess::accessible), + m_scratch_space(0), + m_scratch_flags(0), + m_team_begin(0), + m_shmem_begin(0), + m_shmem_size(0), + m_scratch_ptr{nullptr, nullptr}, + m_league_size(arg_policy.league_size()), + m_team_size(arg_policy.team_size()), + m_vector_size(arg_policy.vector_length()) { + hipFuncAttributes attr = Kokkos::Experimental::Impl::HIPParallelLaunch< + ParallelReduce, launch_bounds>::get_hip_func_attributes(); + m_team_size = + m_team_size >= 0 + ? m_team_size + : Kokkos::Experimental::Impl::hip_get_opt_block_size( + m_policy.space().impl_internal_space_instance(), attr, + m_functor, m_vector_size, m_policy.team_scratch_size(0), + m_policy.thread_scratch_size(0)) / + m_vector_size; + + // Return Init value if the number of worksets is zero + if (arg_policy.league_size() == 0) { + value_init::init(reducer_conditional::select(m_functor, m_reducer), + m_result_ptr); + return; + } + + m_team_begin = + UseShflReduction + ? 0 + : hip_single_inter_block_reduce_scan_shmem(arg_functor, + m_team_size); + m_shmem_begin = sizeof(double) * (m_team_size + 2); + m_shmem_size = + m_policy.scratch_size(0, m_team_size) + + FunctorTeamShmemSize::value(arg_functor, m_team_size); + m_scratch_size[0] = m_shmem_size; + m_scratch_size[1] = m_policy.scratch_size(1, m_team_size); + m_scratch_ptr[1] = + m_team_size <= 0 ? nullptr + : Kokkos::Experimental::Impl::hip_resize_scratch_space( + static_cast(m_scratch_size[1]) * + static_cast( + Kokkos::Experimental::HIP::concurrency() / + (m_team_size * m_vector_size))); + + // The global parallel_reduce does not support vector_length other than 1 at + // the moment + if ((arg_policy.vector_length() > 1) && !UseShflReduction) + Impl::throw_runtime_exception( + "Kokkos::parallel_reduce with a TeamPolicy using a vector length of " + "greater than 1 is not currently supported for HIP for dynamic " + "sized reduction types."); + + if ((m_team_size < Kokkos::Experimental::Impl::HIPTraits::WarpSize) && + !UseShflReduction) + Impl::throw_runtime_exception( + "Kokkos::parallel_reduce with a TeamPolicy using a team_size smaller " + "than 64 is not currently supported with HIP for dynamic sized " + "reduction types."); + + // Functor's reduce memory, team scan memory, and team shared memory depend + // upon team size. + + const int shmem_size_total = m_team_begin + m_shmem_begin + m_shmem_size; + + if ((!Kokkos::Impl::is_integral_power_of_two(m_team_size) && + !UseShflReduction) || + m_policy.space().impl_internal_space_instance()->m_maxShmemPerBlock < + shmem_size_total) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelReduce< HIP > bad team size")); + } + if (static_cast(m_team_size) > + arg_policy.team_size_max(m_functor, m_reducer, ParallelReduceTag())) { + Kokkos::Impl::throw_runtime_exception( + std::string("Kokkos::Impl::ParallelReduce< HIP > requested too " + "large team size.")); + } + } +}; } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp index 362128c411..98dab9a0fb 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_ReduceScan.hpp @@ -49,13 +49,138 @@ #if defined(__HIPCC__) +#include + namespace Kokkos { namespace Impl { -template + +//---------------------------------------------------------------------------- +// Reduction-only implementation +//---------------------------------------------------------------------------- + +template struct HIPReductionsFunctor; template -struct HIPReductionsFunctor { +struct HIPReductionsFunctor { + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; + using ValueInit = FunctorValueInit; + using ValueOps = FunctorValueOps; + using pointer_type = typename ValueTraits::pointer_type; + using Scalar = typename ValueTraits::value_type; + + __device__ static inline void scalar_intra_warp_reduction( + FunctorType const& functor, + Scalar value, // Contribution + bool const skip_vector, // Skip threads if Kokkos vector lanes are not + // part of the reduction + int const width, // How much of the warp participates + Scalar& result) { + for (int delta = skip_vector ? blockDim.x : 1; delta < width; delta *= 2) { + Scalar tmp = Kokkos::Experimental::shfl_down(value, delta, width); + ValueJoin::join(functor, &value, &tmp); + } + + Experimental::Impl::in_place_shfl(result, value, 0, width); + } + + __device__ static inline void scalar_intra_block_reduction( + FunctorType const& functor, Scalar value, bool const skip, + Scalar* my_global_team_buffer_element, int const shared_elements, + Scalar* shared_team_buffer_element) { + unsigned int constexpr warp_size = + Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int const warp_id = (threadIdx.y * blockDim.x) / warp_size; + Scalar* const my_shared_team_buffer_element = + shared_team_buffer_element + warp_id % shared_elements; + + // Warp Level Reduction, ignoring Kokkos vector entries + scalar_intra_warp_reduction(functor, value, skip, warp_size, value); + + if (warp_id < shared_elements) { + *my_shared_team_buffer_element = value; + } + // Wait for every warp to be done before using one warp to do the final + // cross warp reduction + __syncthreads(); + + int const num_warps = blockDim.x * blockDim.y / warp_size; + for (int w = shared_elements; w < num_warps; w += shared_elements) { + if (warp_id >= w && warp_id < w + shared_elements) { + if ((threadIdx.y * blockDim.x + threadIdx.x) % warp_size == 0) + ValueJoin::join(functor, my_shared_team_buffer_element, &value); + } + __syncthreads(); + } + + if (warp_id == 0) { + ValueInit::init(functor, &value); + for (unsigned int i = threadIdx.y * blockDim.x + threadIdx.x; + i < blockDim.y * blockDim.x / warp_size; i += warp_size) { + ValueJoin::join(functor, &value, &shared_team_buffer_element[i]); + } + scalar_intra_warp_reduction(functor, value, false, warp_size, + *my_global_team_buffer_element); + } + } + + __device__ static inline bool scalar_inter_block_reduction( + FunctorType const& functor, + ::Kokkos::Experimental::HIP::size_type const block_count, + ::Kokkos::Experimental::HIP::size_type* const shared_data, + ::Kokkos::Experimental::HIP::size_type* const global_data, + ::Kokkos::Experimental::HIP::size_type* const global_flags) { + Scalar* const global_team_buffer_element = + reinterpret_cast(global_data); + Scalar* const my_global_team_buffer_element = + global_team_buffer_element + blockIdx.x; + Scalar* shared_team_buffer_elements = + reinterpret_cast(shared_data); + Scalar value = shared_team_buffer_elements[threadIdx.y]; + unsigned int constexpr warp_size = + Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int shared_elements = blockDim.x * blockDim.y / warp_size; + int global_elements = block_count; + __syncthreads(); + + scalar_intra_block_reduction(functor, value, true, + my_global_team_buffer_element, shared_elements, + shared_team_buffer_elements); + __threadfence(); + __syncthreads(); + + // Use the last block that is done to do the do the reduction across the + // block + __shared__ unsigned int num_teams_done; + if (threadIdx.x + threadIdx.y == 0) { + __threadfence(); + num_teams_done = Kokkos::atomic_fetch_add(global_flags, 1) + 1; + } + bool is_last_block = false; + // FIXME_HIP HIP does not support syncthreads_or. That's why we need to make + // num_teams_done __shared__ + // if (__syncthreads_or(num_teams_done == gridDim.x)) {*/ + __syncthreads(); + if (num_teams_done == gridDim.x) { + is_last_block = true; + *global_flags = 0; + ValueInit::init(functor, &value); + for (int i = threadIdx.y * blockDim.x + threadIdx.x; i < global_elements; + i += blockDim.x * blockDim.y) { + ValueJoin::join(functor, &value, &global_team_buffer_element[i]); + } + scalar_intra_block_reduction( + functor, value, false, shared_team_buffer_elements + blockDim.y - 1, + shared_elements, shared_team_buffer_elements); + } + + return is_last_block; + } +}; + +template +struct HIPReductionsFunctor { using ValueTraits = FunctorValueTraits; using ValueJoin = FunctorValueJoin; using ValueInit = FunctorValueInit; @@ -70,10 +195,9 @@ struct HIPReductionsFunctor { // part of the reduction int const width) // How much of the warp participates { - int const lane_id = (hipThreadIdx_y * hipBlockDim_x + hipThreadIdx_x) % + int const lane_id = (threadIdx.y * blockDim.x + threadIdx.x) % ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - for (int delta = skip_vector ? hipBlockDim_x : 1; delta < width; - delta *= 2) { + for (int delta = skip_vector ? blockDim.x : 1; delta < width; delta *= 2) { if (lane_id + delta < ::Kokkos::Experimental::Impl::HIPTraits::WarpSize) { ValueJoin::join(functor, value, value + delta); } @@ -84,11 +208,10 @@ struct HIPReductionsFunctor { __device__ static inline void scalar_intra_block_reduction( FunctorType const& functor, Scalar value, bool const skip, Scalar* result, int const /*shared_elements*/, Scalar* shared_team_buffer_element) { - int const warp_id = (hipThreadIdx_y * hipBlockDim_x) / + int const warp_id = (threadIdx.y * blockDim.x) / ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; Scalar* const my_shared_team_buffer_element = - shared_team_buffer_element + hipThreadIdx_y * hipBlockDim_x + - hipThreadIdx_x; + shared_team_buffer_element + threadIdx.y * blockDim.x + threadIdx.x; *my_shared_team_buffer_element = value; // Warp Level Reduction, ignoring Kokkos vector entries scalar_intra_warp_reduction( @@ -100,22 +223,20 @@ struct HIPReductionsFunctor { if (warp_id == 0) { const unsigned int delta = - (hipThreadIdx_y * hipBlockDim_x + hipThreadIdx_x) * + (threadIdx.y * blockDim.x + threadIdx.x) * ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - if (delta < hipBlockDim_x * hipBlockDim_y) + if (delta < blockDim.x * blockDim.y) *my_shared_team_buffer_element = shared_team_buffer_element[delta]; scalar_intra_warp_reduction( functor, my_shared_team_buffer_element, false, - hipBlockDim_x * hipBlockDim_y / + blockDim.x * blockDim.y / ::Kokkos::Experimental::Impl::HIPTraits::WarpSize); - if (hipThreadIdx_x + hipThreadIdx_y == 0) - *result = *shared_team_buffer_element; + if (threadIdx.x + threadIdx.y == 0) *result = *shared_team_buffer_element; } } __device__ static inline bool scalar_inter_block_reduction( FunctorType const& functor, - ::Kokkos::Experimental::HIP::size_type const /*block_id*/, ::Kokkos::Experimental::HIP::size_type const block_count, ::Kokkos::Experimental::HIP::size_type* const shared_data, ::Kokkos::Experimental::HIP::size_type* const global_data, @@ -123,11 +244,11 @@ struct HIPReductionsFunctor { Scalar* const global_team_buffer_element = reinterpret_cast(global_data); Scalar* const my_global_team_buffer_element = - global_team_buffer_element + hipBlockIdx_x; + global_team_buffer_element + blockIdx.x; Scalar* shared_team_buffer_elements = reinterpret_cast(shared_data); - Scalar value = shared_team_buffer_elements[hipThreadIdx_y]; - int shared_elements = (hipBlockDim_x * hipBlockDim_y) / + Scalar value = shared_team_buffer_elements[threadIdx.y]; + int shared_elements = (blockDim.x * blockDim.y) / ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; int global_elements = block_count; __syncthreads(); @@ -141,39 +262,40 @@ struct HIPReductionsFunctor { // Use the last block that is done to do the do the reduction across the // block __shared__ unsigned int num_teams_done; - if (hipThreadIdx_x + hipThreadIdx_y == 0) { + if (threadIdx.x + threadIdx.y == 0) { __threadfence(); num_teams_done = Kokkos::atomic_fetch_add(global_flags, 1) + 1; } bool is_last_block = false; // FIXME_HIP HIP does not support syncthreads_or. That's why we need to make // num_teams_done __shared__ - // if (__syncthreads_or(num_teams_done == hipGridDim_x)) {*/ + // if (__syncthreads_or(num_teams_done == gridDim.x)) {*/ __syncthreads(); - if (num_teams_done == hipGridDim_x) { + if (num_teams_done == gridDim.x) { is_last_block = true; *global_flags = 0; ValueInit::init(functor, &value); - for (int i = hipThreadIdx_y * hipBlockDim_x + hipThreadIdx_x; - i < global_elements; i += hipBlockDim_x * hipBlockDim_y) { + for (int i = threadIdx.y * blockDim.x + threadIdx.x; i < global_elements; + i += blockDim.x * blockDim.y) { ValueJoin::join(functor, &value, &global_team_buffer_element[i]); } scalar_intra_block_reduction( - functor, value, false, - shared_team_buffer_elements + (hipBlockDim_y - 1), shared_elements, - shared_team_buffer_elements); + functor, value, false, shared_team_buffer_elements + (blockDim.y - 1), + shared_elements, shared_team_buffer_elements); } return is_last_block; } }; +//---------------------------------------------------------------------------- +// Fused reduction and scan implementation //---------------------------------------------------------------------------- /* * Algorithmic constraints: - * (a) hipBlockDim_y is a power of two - * (b) hipBlockDim_y <= 1024 - * (c) hipBlockDim_x == hipBlockDim_z == 1 + * (a) blockDim.y is a power of two + * (b) blockDim.y <= 1024 + * (c) blockDim.x == blockDim.z == 1 */ template @@ -187,14 +309,14 @@ __device__ void hip_intra_block_reduce_scan( using pointer_type = typename ValueTraits::pointer_type; unsigned int const value_count = ValueTraits::value_count(functor); - unsigned int const BlockSizeMask = hipBlockDim_y - 1; + unsigned int const BlockSizeMask = blockDim.y - 1; int const WarpMask = Experimental::Impl::HIPTraits::WarpSize - 1; // Must have power of two thread count - if ((hipBlockDim_y - 1) & hipBlockDim_y) { + if ((blockDim.y - 1) & blockDim.y) { Kokkos::abort( "HIP::hip_intra_block_reduce_scan requires power-of-two " - "hipBlockDim_y\n"); + "blockDim.y\n"); } auto block_reduce_step = @@ -205,8 +327,8 @@ __device__ void hip_intra_block_reduce_scan( }; { // Intra-warp reduction: - const unsigned rtid_intra = hipThreadIdx_y & WarpMask; - const pointer_type tdata_intra = base_data + value_count * hipThreadIdx_y; + const unsigned rtid_intra = threadIdx.y & WarpMask; + const pointer_type tdata_intra = base_data + value_count * threadIdx.y; block_reduce_step(rtid_intra, tdata_intra, 0); block_reduce_step(rtid_intra, tdata_intra, 1); @@ -220,11 +342,10 @@ __device__ void hip_intra_block_reduce_scan( { // Inter-warp reduce-scan by a single warp to avoid extra synchronizations unsigned int const rtid_inter = - ((hipThreadIdx_y + 1) - << Experimental::Impl::HIPTraits::WarpIndexShift) - + ((threadIdx.y + 1) << Experimental::Impl::HIPTraits::WarpIndexShift) - 1; - if (rtid_inter < hipBlockDim_y) { + if (rtid_inter < blockDim.y) { pointer_type const tdata_inter = base_data + value_count * rtid_inter; if ((1 << 6) < BlockSizeMask) { @@ -250,12 +371,11 @@ __device__ void hip_intra_block_reduce_scan( if (DoScan) { // Update all the values for the respective warps (except for the last one) // by adding from the last value of the previous warp. - if (hipThreadIdx_y >= Experimental::Impl::HIPTraits::WarpSize && - (hipThreadIdx_y & WarpMask) != + if (threadIdx.y >= Experimental::Impl::HIPTraits::WarpSize && + (threadIdx.y & WarpMask) != Experimental::Impl::HIPTraits::WarpSize - 1) { - const int offset_to_previous_warp_total = - (hipThreadIdx_y & (~WarpMask)) - 1; - ValueJoin::join(functor, base_data + value_count * hipThreadIdx_y, + const int offset_to_previous_warp_total = (threadIdx.y & (~WarpMask)) - 1; + ValueJoin::join(functor, base_data + value_count * threadIdx.y, base_data + value_count * offset_to_previous_warp_total); } } @@ -271,7 +391,7 @@ __device__ void hip_intra_block_reduce_scan( */ template -__device__ bool hip_single_inter_block_reduce_scan2( +__device__ bool hip_single_inter_block_reduce_scan_impl( FunctorType const& functor, ::Kokkos::Experimental::HIP::size_type const block_id, ::Kokkos::Experimental::HIP::size_type const block_count, @@ -287,13 +407,13 @@ __device__ bool hip_single_inter_block_reduce_scan2( using pointer_type = typename ValueTraits::pointer_type; // '__ffs' = position of the least significant bit set to 1. - // 'hipBlockDim_y' is guaranteed to be a power of two so this + // 'blockDim.y' is guaranteed to be a power of two so this // is the integral shift value that can replace an integral divide. - unsigned int const BlockSizeShift = __ffs(hipBlockDim_y) - 1; - unsigned int const BlockSizeMask = hipBlockDim_y - 1; + unsigned int const BlockSizeShift = __ffs(blockDim.y) - 1; + unsigned int const BlockSizeMask = blockDim.y - 1; // Must have power of two thread count - if (BlockSizeMask & hipBlockDim_y) { + if (BlockSizeMask & blockDim.y) { Kokkos::abort( "HIP::hip_single_inter_block_reduce_scan requires power-of-two " "blockDim"); @@ -313,7 +433,7 @@ __device__ bool hip_single_inter_block_reduce_scan2( size_type* const shared = shared_data + word_count.value * BlockSizeMask; size_type* const global = global_data + word_count.value * block_id; - for (size_t i = hipThreadIdx_y; i < word_count.value; i += hipBlockDim_y) { + for (size_t i = threadIdx.y; i < word_count.value; i += blockDim.y) { global[i] = shared[i]; } } @@ -329,7 +449,7 @@ __device__ bool hip_single_inter_block_reduce_scan2( __shared__ int n_done; n_done = 0; __syncthreads(); - if (hipThreadIdx_y == 0) { + if (threadIdx.y == 0) { __threadfence(); n_done = 1 + atomicInc(global_flags, block_count - 1); } @@ -338,14 +458,14 @@ __device__ bool hip_single_inter_block_reduce_scan2( if (is_last_block) { size_type const b = (static_cast(block_count) * - static_cast(hipThreadIdx_y)) >> + static_cast(threadIdx.y)) >> BlockSizeShift; size_type const e = (static_cast(block_count) * - static_cast(hipThreadIdx_y + 1)) >> + static_cast(threadIdx.y + 1)) >> BlockSizeShift; { - void* const shared_ptr = shared_data + word_count.value * hipThreadIdx_y; + void* const shared_ptr = shared_data + word_count.value * threadIdx.y; /* reference_type shared_value = */ ValueInit::init(functor, shared_ptr); for (size_type i = b; i < e; ++i) { @@ -359,10 +479,10 @@ __device__ bool hip_single_inter_block_reduce_scan2( if (DoScan) { size_type* const shared_value = - shared_data + word_count.value * (hipThreadIdx_y ? hipThreadIdx_y - 1 - : hipBlockDim_y); + shared_data + + word_count.value * (threadIdx.y ? threadIdx.y - 1 : blockDim.y); - if (!hipThreadIdx_y) { + if (!threadIdx.y) { ValueInit::init(functor, shared_value); } @@ -387,19 +507,18 @@ __device__ bool hip_single_inter_block_reduce_scan( ::Kokkos::Experimental::HIP::size_type* const global_data, ::Kokkos::Experimental::HIP::size_type* const global_flags) { using ValueTraits = FunctorValueTraits; - if (!DoScan && /*FIXME*/ (bool)ValueTraits::StaticValueSize) - // FIXME_HIP For now we don't use shuffle - // return Kokkos::Impl::HIPReductionsFunctor< - // FunctorType, ArgTag, false, (ValueTraits::StaticValueSize > 16)>:: - // scalar_inter_block_reduction(functor, block_id, block_count, - // shared_data, global_data, global_flags); + // If we are doing a reduction and StaticValueSize is true, we use the + // reduction-only path. Otherwise, we use the common path between reduction + // and scan. + if (!DoScan && static_cast(ValueTraits::StaticValueSize)) + // FIXME_HIP_PERFORMANCE I don't know where 16 comes from. This inequality + // determines if we use shared memory (false) or shuffle (true) return Kokkos::Impl::HIPReductionsFunctor< - FunctorType, ArgTag, false, - false>::scalar_inter_block_reduction(functor, block_id, block_count, - shared_data, global_data, - global_flags); + FunctorType, ArgTag, (ValueTraits::StaticValueSize > 16)>:: + scalar_inter_block_reduction(functor, block_count, shared_data, + global_data, global_flags); else { - return hip_single_inter_block_reduce_scan2( + return hip_single_inter_block_reduce_scan_impl( functor, block_id, block_count, shared_data, global_data, global_flags); } } diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp new file mode 100644 index 0000000000..cdf9cac30d --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Shuffle_Reduce.hpp @@ -0,0 +1,345 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_HIP_SHUFFLE_REDUCE_HPP +#define KOKKOS_HIP_SHUFFLE_REDUCE_HPP + +#include + +#if defined(__HIPCC__) + +#include + +#include + +namespace Kokkos { +namespace Impl { + +/* Algorithmic constraints: + * (a) threads with the same threadIdx.x have same value + * (b) blockDim.x == power of two + * (x) blockDim.z == 1 + */ +template ::value, + int>::type = 0> +__device__ inline void hip_intra_warp_shuffle_reduction( + ValueType& result, JoinOp const& join, + uint32_t const max_active_thread = blockDim.y) { + unsigned int shift = 1; + + // Reduce over values from threads with different threadIdx.y + unsigned int constexpr warp_size = + Kokkos::Experimental::Impl::HIPTraits::WarpSize; + while (blockDim.x * shift < warp_size) { + ValueType const tmp = + Kokkos::Experimental::shfl_down(result, blockDim.x * shift, warp_size); + // Only join if upper thread is active (this allows non power of two for + // blockDim.y) + if (threadIdx.y + shift < max_active_thread) { + join(result, tmp); + } + shift *= 2; + // Not sure why there is a race condition here but we need to wait for the + // join operation to be finished to perform the next shuffle. Note that the + // problem was also found in the CUDA backend with CUDA clang + // (https://github.com/kokkos/kokkos/issues/941) + __syncthreads(); + } + + // Broadcast the result to all the threads in the warp + result = Kokkos::Experimental::shfl(result, 0, warp_size); +} + +template ::value, + int>::type = 0> +__device__ inline void hip_inter_warp_shuffle_reduction( + ValueType& value, const JoinOp& join, + const int max_active_thread = blockDim.y) { + unsigned int constexpr warp_size = + Kokkos::Experimental::Impl::HIPTraits::WarpSize; + int constexpr step_width = 8; + // Depending on the ValueType __shared__ memory must be aligned up to 8 byte + // boundaries. The reason not to use ValueType directly is that for types with + // constructors it could lead to race conditions. + __shared__ double sh_result[(sizeof(ValueType) + 7) / 8 * step_width]; + ValueType* result = reinterpret_cast(&sh_result); + int const step = warp_size / blockDim.x; + int shift = step_width; + // Skip the code below if threadIdx.y % step != 0 + int const id = threadIdx.y % step == 0 ? threadIdx.y / step : INT_MAX; + if (id < step_width) { + result[id] = value; + } + __syncthreads(); + while (shift <= max_active_thread / step) { + if (shift <= id && shift + step_width > id && threadIdx.x == 0) { + join(result[id % step_width], value); + } + __syncthreads(); + shift += step_width; + } + + value = result[0]; + for (int i = 1; (i * step < max_active_thread) && (i < step_width); ++i) + join(value, result[i]); +} + +template ::value, + int>::type = 0> +__device__ inline void hip_intra_block_shuffle_reduction( + ValueType& value, JoinOp const& join, + int const max_active_thread = blockDim.y) { + hip_intra_warp_shuffle_reduction(value, join, max_active_thread); + hip_inter_warp_shuffle_reduction(value, join, max_active_thread); +} + +template +__device__ inline bool hip_inter_block_shuffle_reduction( + typename FunctorValueTraits::reference_type value, + typename FunctorValueTraits::reference_type neutral, + JoinOp const& join, + Kokkos::Experimental::HIP::size_type* const m_scratch_space, + typename FunctorValueTraits::pointer_type const /*result*/, + Kokkos::Experimental::HIP::size_type* const m_scratch_flags, + int const max_active_thread = blockDim.y) { + using pointer_type = + typename FunctorValueTraits::pointer_type; + using value_type = + typename FunctorValueTraits::value_type; + + // Do the intra-block reduction with shfl operations for the intra warp + // reduction and static shared memory for the inter warp reduction + hip_intra_block_shuffle_reduction(value, join, max_active_thread); + + int const id = threadIdx.y * blockDim.x + threadIdx.x; + + // One thread in the block writes block result to global scratch_memory + if (id == 0) { + pointer_type global = + reinterpret_cast(m_scratch_space) + blockIdx.x; + *global = value; + } + + // One warp of last block performs inter block reduction through loading the + // block values from global scratch_memory + bool last_block = false; + __threadfence(); + __syncthreads(); + int constexpr warp_size = Kokkos::Experimental::Impl::HIPTraits::WarpSize; + if (id < warp_size) { + Kokkos::Experimental::HIP::size_type count; + + // Figure out whether this is the last block + if (id == 0) count = Kokkos::atomic_fetch_add(m_scratch_flags, 1); + count = Kokkos::Experimental::shfl(count, 0, warp_size); + + // Last block does the inter block reduction + if (count == gridDim.x - 1) { + // set flag back to zero + if (id == 0) *m_scratch_flags = 0; + last_block = true; + value = neutral; + + pointer_type const volatile global = + reinterpret_cast(m_scratch_space); + + // Reduce all global values with splitting work over threads in one warp + const int step_size = blockDim.x * blockDim.y < warp_size + ? blockDim.x * blockDim.y + : warp_size; + for (int i = id; i < static_cast(gridDim.x); i += step_size) { + value_type tmp = global[i]; + join(value, tmp); + } + + // Perform shfl reductions within the warp only join if contribution is + // valid (allows gridDim.x non power of two and i) { + value_type tmp = Kokkos::Experimental::shfl_down(value, i, warp_size); + if (id + i < gridDim.x) join(value, tmp); + } + __syncthreads(); + } + } + } + // The last block has in its thread=0 the global reduction value through + // "value" + return last_block; +} + +// We implemente the same functions as above but the user provide a Reducer +// instead of JoinOP +template ::value, + int>::type = 0> +__device__ inline void hip_intra_warp_shuffle_reduction( + const ReducerType& reducer, typename ReducerType::value_type& result, + const uint32_t max_active_thread = blockDim.y) { + using ValueType = typename ReducerType::value_type; + auto join_op = [&](ValueType& result, ValueType const& tmp) { + reducer.join(result, tmp); + }; + hip_intra_warp_shuffle_reduction(result, join_op, max_active_thread); + + reducer.reference() = result; +} + +template ::value, + int>::type = 0> +__device__ inline void hip_inter_warp_shuffle_reduction( + ReducerType const& reducer, typename ReducerType::value_type value, + int const max_active_thread = blockDim.y) { + using ValueType = typename ReducerType::value_type; + auto join_op = [&](ValueType& a, ValueType& b) { reducer.join(a, b); }; + hip_inter_warp_shuffle_reduction(value, join_op, max_active_thread); + + reducer.reference() = value; +} + +template ::value, + int>::type = 0> +__device__ inline void hip_intra_block_shuffle_reduction( + ReducerType const& reducer, typename ReducerType::value_type value, + int const max_active_thread = blockDim.y) { + hip_intra_warp_shuffle_reduction(reducer, value, max_active_thread); + hip_inter_warp_shuffle_reduction(reducer, value, max_active_thread); +} + +template ::value, + int>::type = 0> +__device__ inline void hip_intra_block_shuffle_reduction( + ReducerType const& reducer, int const max_active_thread = blockDim.y) { + hip_intra_block_shuffle_reduction(reducer, reducer.reference(), + max_active_thread); +} + +template ::value, + int>::type = 0> +__device__ inline bool hip_inter_block_shuffle_reduction( + ReducerType const& reducer, + Kokkos::Experimental::HIP::size_type* const m_scratch_space, + Kokkos::Experimental::HIP::size_type* const m_scratch_flags, + int const max_active_thread = blockDim.y) { + using pointer_type = typename ReducerType::value_type*; + using value_type = typename ReducerType::value_type; + + // Do the intra-block reduction with shfl operations for the intra warp + // reduction and static shared memory for the inter warp reduction + hip_intra_block_shuffle_reduction(reducer, max_active_thread); + + value_type value = reducer.reference(); + + int const id = threadIdx.y * blockDim.x + threadIdx.x; + + // One thread in the block writes block result to global scratch_memory + if (id == 0) { + pointer_type global = + reinterpret_cast(m_scratch_space) + blockIdx.x; + *global = value; + } + + // One warp of last block performs inter block reduction through loading the + // block values from global scratch_memory + bool last_block = false; + + __threadfence(); + __syncthreads(); + int constexpr warp_size = Kokkos::Experimental::Impl::HIPTraits::WarpSize; + if (id < warp_size) { + Kokkos::Experimental::HIP::size_type count; + + // Figure out whether this is the last block + if (id == 0) count = Kokkos::atomic_fetch_add(m_scratch_flags, 1); + count = Kokkos::Experimental::shfl(count, 0, warp_size); + + // Last block does the inter block reduction + if (count == gridDim.x - 1) { + // Set flag back to zero + if (id == 0) *m_scratch_flags = 0; + last_block = true; + reducer.init(value); + + pointer_type const volatile global = + reinterpret_cast(m_scratch_space); + + // Reduce all global values with splitting work over threads in one warp + int const step_size = blockDim.x * blockDim.y < warp_size + ? blockDim.x * blockDim.y + : warp_size; + for (int i = id; i < static_cast(gridDim.x); i += step_size) { + value_type tmp = global[i]; + reducer.join(value, tmp); + } + + // Perform shfl reductions within the warp only join if contribution is + // valid (allows gridDim.x non power of two and i) { + value_type tmp = Kokkos::Experimental::shfl_down(value, i, warp_size); + if (id + i < gridDim.x) reducer.join(value, tmp); + } + __syncthreads(); + } + } + } + + // The last block has in its thread = 0 the global reduction value through + // "value" + return last_block; +} +} // namespace Impl +} // namespace Kokkos + +#endif + +#endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp index 2dca7f13c9..a97fb2f7cc 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Space.cpp @@ -92,25 +92,25 @@ DeepCopy::DeepCopy(const Kokkos::Experimental::HIP& - /*instance*/, + instance, void* dst, const void* src, size_t n) { - // FIXME_HIP use instance - HIP_SAFE_CALL(hipMemcpy(dst, src, n, hipMemcpyDefault)); + HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); } DeepCopy:: - DeepCopy(const Kokkos::Experimental::HIP& /*instance*/, void* dst, + DeepCopy(const Kokkos::Experimental::HIP& instance, void* dst, const void* src, size_t n) { - // FIXME_HIP use instance - HIP_SAFE_CALL(hipMemcpy(dst, src, n, hipMemcpyDefault)); + HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); } DeepCopy:: - DeepCopy(const Kokkos::Experimental::HIP& /*instance*/, void* dst, + DeepCopy(const Kokkos::Experimental::HIP& instance, void* dst, const void* src, size_t n) { - // FIXME_HIP use instance - HIP_SAFE_CALL(hipMemcpy(dst, src, n, hipMemcpyDefault)); + HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); } DeepCopy:: - DeepCopy(const Kokkos::Experimental::HIP& /*instance*/, void* dst, + DeepCopy(const Kokkos::Experimental::HIP& instance, void* dst, const void* src, size_t n) { - // FIXME_HIP use instance - HIP_SAFE_CALL(hipMemcpy(dst, src, n, hipMemcpyDefault)); + HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); } DeepCopy::DeepCopy(const Kokkos::Experimental::HIP& - /*instance*/, + instance, void* dst, const void* src, size_t n) { - // FIXME_HIP use instance - HIP_SAFE_CALL(hipMemcpy(dst, src, n, hipMemcpyDefault)); + HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); } DeepCopy::DeepCopy(const Kokkos::Experimental::HIP& - /*instance*/, + instance, void* dst, const void* src, size_t n) { - // FIXME_HIP use instance - HIP_SAFE_CALL(hipMemcpy(dst, src, n, hipMemcpyDefault)); + HIP_SAFE_CALL( + hipMemcpyAsync(dst, src, n, hipMemcpyDefault, instance.hip_stream())); } void DeepCopyAsyncHIP(void* dst, void const* src, size_t n) { @@ -199,6 +199,12 @@ HIPSpace::HIPSpace() : m_device(HIP().hip_device()) {} HIPHostPinnedSpace::HIPHostPinnedSpace() {} void* HIPSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void* HIPSpace::allocate( + + const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size) const { void* ptr = nullptr; auto const error_code = hipMalloc(&ptr, arg_alloc_size); @@ -210,11 +216,23 @@ void* HIPSpace::allocate(const size_t arg_alloc_size) const { arg_alloc_size, error_code, RawMemoryAllocationFailure::AllocationMechanism::HIPMalloc); } + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::allocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, ptr, + reported_size); + } return ptr; } void* HIPHostPinnedSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void* HIPHostPinnedSpace::allocate(const char* arg_label, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { void* ptr = nullptr; auto const error_code = hipHostMalloc(&ptr, arg_alloc_size); @@ -226,17 +244,49 @@ void* HIPHostPinnedSpace::allocate(const size_t arg_alloc_size) const { arg_alloc_size, error_code, RawMemoryAllocationFailure::AllocationMechanism::HIPHostMalloc); } + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::allocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, ptr, + reported_size); + } return ptr; } - void HIPSpace::deallocate(void* const arg_alloc_ptr, - const size_t /* arg_alloc_size */) const { + const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} +void HIPSpace::deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::deallocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, arg_alloc_ptr, + reported_size); + } HIP_SAFE_CALL(hipFree(arg_alloc_ptr)); } void HIPHostPinnedSpace::deallocate(void* const arg_alloc_ptr, - const size_t /* arg_alloc_size */) const { + const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} + +void HIPHostPinnedSpace::deallocate(const char* arg_label, + void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::deallocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, arg_alloc_ptr, + reported_size); + } HIP_SAFE_CALL(hipHostFree(arg_alloc_ptr)); } @@ -298,34 +348,22 @@ void SharedAllocationRecord:: SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) + const char* label = nullptr; if (Kokkos::Profiling::profileLibraryLoaded()) { SharedAllocationHeader header; Kokkos::Impl::DeepCopy( &header, RecordBase::m_alloc_ptr, sizeof(SharedAllocationHeader)); - - Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle(Kokkos::Experimental::HIPSpace::name()), - header.m_label, data(), size()); + label = header.label(); } -#endif - - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); + auto alloc_size = SharedAllocationRecord::m_alloc_size; + m_space.deallocate(label, SharedAllocationRecord::m_alloc_ptr, + alloc_size, (alloc_size - sizeof(SharedAllocationHeader))); } SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle( - Kokkos::Experimental::HIPHostPinnedSpace::name()), - RecordBase::m_alloc_ptr->m_label, data(), size()); - } -#endif - - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, + m_space.deallocate(RecordBase::m_alloc_ptr->m_label, + SharedAllocationRecord::m_alloc_ptr, SharedAllocationRecord::m_alloc_size); } @@ -345,13 +383,6 @@ SharedAllocationRecord:: arg_alloc_size), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif SharedAllocationHeader header; @@ -384,13 +415,6 @@ SharedAllocationRecord:: arg_alloc_size), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif // Fill in the Header information, directly accessible via host pinned memory RecordBase::m_alloc_ptr->m_record = this; @@ -408,7 +432,7 @@ void* SharedAllocationRecord:: allocate_tracked(const Kokkos::Experimental::HIPSpace& arg_space, const std::string& arg_alloc_label, const size_t arg_alloc_size) { - if (!arg_alloc_size) return (void*)0; + if (!arg_alloc_size) return nullptr; SharedAllocationRecord* const r = allocate(arg_space, arg_alloc_label, arg_alloc_size); @@ -444,6 +468,46 @@ void* SharedAllocationRecord:: return r_new->data(); } +void* SharedAllocationRecord:: + allocate_tracked(const Kokkos::Experimental::HIPHostPinnedSpace& arg_space, + const std::string& arg_alloc_label, + const size_t arg_alloc_size) { + if (!arg_alloc_size) return nullptr; + + SharedAllocationRecord* const r = + allocate(arg_space, arg_alloc_label, arg_alloc_size); + + RecordBase::increment(r); + + return r->data(); +} + +void SharedAllocationRecord::deallocate_tracked(void* const + arg_alloc_ptr) { + if (arg_alloc_ptr) { + SharedAllocationRecord* const r = get_record(arg_alloc_ptr); + + RecordBase::decrement(r); + } +} + +void* SharedAllocationRecord:: + reallocate_tracked(void* const arg_alloc_ptr, const size_t arg_alloc_size) { + SharedAllocationRecord* const r_old = get_record(arg_alloc_ptr); + SharedAllocationRecord* const r_new = + allocate(r_old->m_space, r_old->get_label(), arg_alloc_size); + + using HIPHostPinnedSpace = Kokkos::Experimental::HIPHostPinnedSpace; + Kokkos::Impl::DeepCopy( + r_new->data(), r_old->data(), std::min(r_old->size(), r_new->size())); + + RecordBase::increment(r_new); + RecordBase::decrement(r_old); + + return r_new->data(); +} + //---------------------------------------------------------------------------- SharedAllocationRecord* @@ -476,6 +540,25 @@ SharedAllocationRecord::get_record( return record; } +SharedAllocationRecord* +SharedAllocationRecord::get_record(void* alloc_ptr) { + using Header = SharedAllocationHeader; + using RecordHIP = + SharedAllocationRecord; + + Header* const h = + alloc_ptr ? reinterpret_cast(alloc_ptr) - 1 : nullptr; + + if (!alloc_ptr || h->m_record->m_alloc_ptr != h) { + Kokkos::Impl::throw_runtime_exception(std::string( + "Kokkos::Impl::SharedAllocationRecord< " + "Kokkos::Experimental::HIPHostPinnedSpace , void >::get_record ERROR")); + } + + return static_cast(h->m_record); +} + // Iterate records to print orphaned memory ... void SharedAllocationRecord:: print_records(std::ostream& s, const Kokkos::Experimental::HIPSpace& space, @@ -586,13 +669,9 @@ void* hip_resize_scratch_space(size_t bytes, bool force_shrink) { namespace Kokkos { namespace Experimental { -// HIP::size_type HIP::detect_device_count() -//{ return Impl::HIPInternalDevices::singleton().m_hipDevCount ; } - int HIP::concurrency() { - // FIXME_HIP - // MI60: ThreadsPerComputeUnit*ComputeUnits/ShaderEngine*ShaderEngines) - return 2536 * 16 * 4; + auto const& prop = hip_device_prop(); + return prop.maxThreadsPerMultiProcessor * prop.multiProcessorCount; } int HIP::impl_is_initialized() { return Impl::HIPInternal::singleton().is_initialized(); @@ -600,36 +679,84 @@ int HIP::impl_is_initialized() { void HIP::impl_initialize(const HIP::SelectDevice config) { Impl::HIPInternal::singleton().initialize(config.hip_device_id); - -#if defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::initialize(); -#endif } -void HIP::impl_finalize() { - Impl::HIPInternal::singleton().finalize(); +void HIP::impl_finalize() { Impl::HIPInternal::singleton().finalize(); } -#if defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::finalize(); -#endif -} - -HIP::HIP() : m_space_instance(&Impl::HIPInternal::singleton()) { +HIP::HIP() + : m_space_instance(&Impl::HIPInternal::singleton()), m_counter(nullptr) { Impl::HIPInternal::singleton().verify_is_initialized( "HIP instance constructor"); } -// HIP::HIP( const int instance_id ) -// : m_device( Impl::HIPInternal::singleton().m_hipDev ) -//{} +HIP::HIP(hipStream_t const stream) + : m_space_instance(new Impl::HIPInternal), m_counter(new int(1)) { + Impl::HIPInternal::singleton().verify_is_initialized( + "HIP instance constructor"); + m_space_instance->initialize(Impl::HIPInternal::singleton().m_hipDev, stream); +} + +KOKKOS_FUNCTION HIP::HIP(HIP&& other) noexcept { + m_space_instance = other.m_space_instance; + other.m_space_instance = nullptr; + m_counter = other.m_counter; + other.m_counter = nullptr; +} + +KOKKOS_FUNCTION HIP::HIP(HIP const& other) + : m_space_instance(other.m_space_instance), m_counter(other.m_counter) { +#ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU + if (m_counter) Kokkos::atomic_add(m_counter, 1); +#endif +} + +KOKKOS_FUNCTION HIP& HIP::operator=(HIP&& other) noexcept { + m_space_instance = other.m_space_instance; + other.m_space_instance = nullptr; + m_counter = other.m_counter; + other.m_counter = nullptr; + + return *this; +} + +KOKKOS_FUNCTION HIP& HIP::operator=(HIP const& other) { + m_space_instance = other.m_space_instance; + m_counter = other.m_counter; +#ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU + if (m_counter) Kokkos::atomic_add(m_counter, 1); +#endif + + return *this; +} + +KOKKOS_FUNCTION HIP::~HIP() noexcept { +#ifndef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU + if (m_counter == nullptr) return; + int const count = Kokkos::atomic_fetch_sub(m_counter, 1); + if (count == 1) { + delete m_counter; + m_space_instance->finalize(); + delete m_space_instance; + } +#endif +} void HIP::print_configuration(std::ostream& s, const bool) { Impl::HIPInternal::singleton().print_configuration(s); } -void HIP::fence() const { HIP_SAFE_CALL(hipDeviceSynchronize()); } +void HIP::impl_static_fence() { HIP_SAFE_CALL(hipDeviceSynchronize()); } + +void HIP::fence() const { m_space_instance->fence(); } + +hipStream_t HIP::hip_stream() const { return m_space_instance->m_stream; } int HIP::hip_device() const { return impl_internal_space_instance()->m_hipDev; } + +hipDeviceProp_t const& HIP::hip_device_prop() { + return Impl::HIPInternal::singleton().m_deviceProp; +} + const char* HIP::name() { return "HIP"; } } // namespace Experimental diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp index b3c4f4609b..577c392a0a 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Team.hpp @@ -54,6 +54,7 @@ #include #include +#include #include #include @@ -65,7 +66,7 @@ namespace Impl { template struct HIPJoinFunctor { - typedef Type value_type; + using value_type = Type; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -77,16 +78,16 @@ struct HIPJoinFunctor { /**\brief Team member_type passed to TeamPolicy or TeamTask closures. * * HIP thread blocks for team closures are dimensioned as: - * hipBlockDim_x == number of "vector lanes" per "thread" - * hipBlockDim_y == number of "threads" per team - * hipBlockDim_z == number of teams in a block + * blockDim.x == number of "vector lanes" per "thread" + * blockDim.y == number of "threads" per team + * blockDim.z == number of teams in a block * where * A set of teams exactly fill a warp OR a team is the whole block - * ( 0 == WarpSize % ( hipBlockDim_x * hipBlockDim_y ) ) + * ( 0 == WarpSize % ( blockDim.x * blockDim.y ) ) * OR - * ( 1 == hipBlockDim_z ) + * ( 1 == blockDim.z ) - * Thus when 1 < hipBlockDim_z the team is warp-synchronous + * Thus when 1 < blockDim.z the team is warp-synchronous * and __syncthreads should not be called in team collectives. * * When multiple teams are mapped onto a single block then the @@ -126,7 +127,7 @@ class HIPTeamMember { KOKKOS_INLINE_FUNCTION int league_size() const { return m_league_size; } KOKKOS_INLINE_FUNCTION int team_rank() const { #ifdef __HIP_DEVICE_COMPILE__ - return hipThreadIdx_y; + return threadIdx.y; #else return 0; #endif @@ -134,15 +135,15 @@ class HIPTeamMember { KOKKOS_INLINE_FUNCTION int team_size() const { #ifdef __HIP_DEVICE_COMPILE__ - return hipBlockDim_y; + return blockDim.y; #else - return 1; + return 0; #endif } KOKKOS_INLINE_FUNCTION void team_barrier() const { #ifdef __HIP_DEVICE_COMPILE__ - if (1 == hipBlockDim_z) + if (1 == blockDim.z) __syncthreads(); // team == block else __threadfence_block(); // team <= warp @@ -155,11 +156,11 @@ class HIPTeamMember { KOKKOS_INLINE_FUNCTION void team_broadcast(ValueType& val, const int& thread_id) const { #ifdef __HIP_DEVICE_COMPILE__ - if (1 == hipBlockDim_z) { // team == block + if (blockDim.z == 1) { // team == block __syncthreads(); // Wait for shared data write until all threads arrive here - if (hipThreadIdx_x == 0u && - hipThreadIdx_y == static_cast(thread_id)) { + if (threadIdx.x == 0u && + threadIdx.y == static_cast(thread_id)) { *(reinterpret_cast(m_team_reduce)) = val; } __syncthreads(); // Wait for shared data read until root thread writes @@ -167,7 +168,7 @@ class HIPTeamMember { } else { // team <= warp ValueType tmp(val); // input might not be a register variable ::Kokkos::Experimental::Impl::in_place_shfl( - val, tmp, hipBlockDim_x * thread_id, hipBlockDim_x * hipBlockDim_y); + val, tmp, blockDim.x * thread_id, blockDim.x * blockDim.y); } #else (void)val; @@ -178,44 +179,24 @@ class HIPTeamMember { template KOKKOS_INLINE_FUNCTION void team_broadcast(Closure const& f, ValueType& val, const int& thread_id) const { -#ifdef __HIP_DEVICE_COMPILE__ f(val); - - if (1 == hipBlockDim_z) { // team == block - __syncthreads(); - // Wait for shared data write until all threads arrive here - if (hipThreadIdx_x == 0u && - hipThreadIdx_y == static_cast(thread_id)) { - *(reinterpret_cast(m_team_reduce)) = val; - } - __syncthreads(); // Wait for shared data read until root thread writes - val = *(reinterpret_cast(m_team_reduce)); - } else { // team <= warp - ValueType tmp(val); // input might not be a register variable - ::Kokkos::Experimental::Impl::in_place_shfl( - val, tmp, hipBlockDim_x * thread_id, hipBlockDim_x * hipBlockDim_y); - } -#else - (void)f; - (void)val; - (void)thread_id; -#endif + team_broadcast(val, thread_id); } //-------------------------------------------------------------------------- /**\brief Reduction across a team * * Mapping of teams onto blocks: - * hipBlockDim_x is "vector lanes" - * hipBlockDim_y is team "threads" - * hipBlockDim_z is number of teams per block + * blockDim.x is "vector lanes" + * blockDim.y is team "threads" + * blockDim.z is number of teams per block * * Requires: - * hipBlockDim_x is power two - * hipBlockDim_x <= HIPTraits::WarpSize - * ( 0 == HIPTraits::WarpSize % ( hipBlockDim_x * hipBlockDim_y ) + * blockDim.x is power two + * blockDim.x <= HIPTraits::WarpSize + * ( 0 == HIPTraits::WarpSize % ( blockDim.x * blockDim.y ) * OR - * ( 1 == hipBlockDim_z ) + * ( 1 == blockDim.z ) */ template KOKKOS_INLINE_FUNCTION @@ -230,7 +211,7 @@ class HIPTeamMember { team_reduce(ReducerType const& reducer, typename ReducerType::value_type& value) const noexcept { #ifdef __HIP_DEVICE_COMPILE__ - hip_intra_block_reduction(reducer, value, hipBlockDim_y); + hip_intra_block_shuffle_reduction(reducer, value, blockDim.y); #else (void)reducer; (void)value; @@ -256,25 +237,25 @@ class HIPTeamMember { __syncthreads(); // Don't write in to shared data until all threads have // entered this function - if (0 == hipThreadIdx_y) { + if (0 == threadIdx.y) { base_data[0] = 0; } - base_data[hipThreadIdx_y + 1] = value; + base_data[threadIdx.y + 1] = value; Impl::hip_intra_block_reduce_scan, void>( Impl::HIPJoinFunctor(), base_data + 1); if (global_accum) { - if (hipBlockDim_y == hipThreadIdx_y + 1) { - base_data[hipBlockDim_y] = - atomic_fetch_add(global_accum, base_data[hipBlockDim_y]); + if (blockDim.y == threadIdx.y + 1) { + base_data[blockDim.y] = + atomic_fetch_add(global_accum, base_data[blockDim.y]); } __syncthreads(); // Wait for atomic - base_data[hipThreadIdx_y] += base_data[hipBlockDim_y]; + base_data[threadIdx.y] += base_data[blockDim.y]; } - return base_data[hipThreadIdx_y]; + return base_data[threadIdx.y]; #else (void)value; (void)global_accum; @@ -307,24 +288,16 @@ class HIPTeamMember { vector_reduce(ReducerType const& reducer, typename ReducerType::value_type& value) { #ifdef __HIP_DEVICE_COMPILE__ - if (hipBlockDim_x == 1) return; + if (blockDim.x == 1) return; // Intra vector lane shuffle reduction: typename ReducerType::value_type tmp(value); typename ReducerType::value_type tmp2 = tmp; - int constexpr warp_size = ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - unsigned mask = - hipBlockDim_x == warp_size - ? 0xffffffff - : ((1 << hipBlockDim_x) - 1) - << ((hipThreadIdx_y % (warp_size / hipBlockDim_x)) * - hipBlockDim_x); - - for (int i = hipBlockDim_x; (i >>= 1);) { + for (int i = blockDim.x; (i >>= 1);) { ::Kokkos::Experimental::Impl::in_place_shfl_down(tmp2, tmp, i, - hipBlockDim_x, mask); - if (static_cast(hipThreadIdx_x) < i) { + blockDim.x); + if (static_cast(threadIdx.x) < i) { reducer.join(tmp, tmp2); } } @@ -334,8 +307,7 @@ class HIPTeamMember { // because floating point summation is not associative // and thus different threads could have different results. - ::Kokkos::Experimental::Impl::in_place_shfl(tmp2, tmp, 0, hipBlockDim_x, - mask); + ::Kokkos::Experimental::Impl::in_place_shfl(tmp2, tmp, 0, blockDim.x); value = tmp2; reducer.reference() = tmp2; #else @@ -355,19 +327,17 @@ class HIPTeamMember { global_reduce(ReducerType const& reducer, int* const global_scratch_flags, void* const global_scratch_space, void* const shmem, int const shmem_size) { -#ifdef __HIP_COMPILE_DEVICE__ - - typedef typename ReducerType::value_type value_type; - typedef value_type volatile* pointer_type; +#ifdef __HIP_DEVICE_COMPILE__ + using value_type = typename ReducerType::value_type; + using pointer_type = value_type volatile*; // Number of shared memory entries for the reduction: const int nsh = shmem_size / sizeof(value_type); // Number of HIP threads in the block, rank within the block - const int nid = hipBlockDim_x * hipBlockDim_y * hipBlockDim_z; + const int nid = blockDim.x * blockDim.y * blockDim.z; const int tid = - hipThreadIdx_x + - hipBlockDim_x * (hipThreadIdx_y + hipBlockDim_y * hipThreadIdx_z); + threadIdx.x + blockDim.x * (threadIdx.y + blockDim.y * threadIdx.z); // Reduces within block using all available shared memory // Contributes if it is the root "vector lane" @@ -376,23 +346,24 @@ class HIPTeamMember { // wx == which lane within the warp // wy == which warp within the block - const int wn = - (nid + HIPTraits::WarpIndexMask) >> HIPTraits::WarpIndexShift; - const int wx = tid & HIPTraits::WarpIndexMask; - const int wy = tid >> HIPTraits::WarpIndexShift; + const int wn = (nid + Experimental::Impl::HIPTraits::WarpIndexMask) >> + Experimental::Impl::HIPTraits::WarpIndexShift; + const int wx = tid & Experimental::Impl::HIPTraits::WarpIndexMask; + const int wy = tid >> Experimental::Impl::HIPTraits::WarpIndexShift; //------------------------ - { // Intra warp shuffle reduction from contributing CUDA threads + { // Intra warp shuffle reduction from contributing HIP threads value_type tmp(reducer.reference()); int constexpr warp_size = ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - for (int i = warp_size; static_cast(hipBlockDim_x) <= (i >>= 1);) { - Impl::in_place_shfl_down(reducer.reference(), tmp, i, warp_size); + for (int i = warp_size; static_cast(blockDim.x) <= (i >>= 1);) { + Experimental::Impl::in_place_shfl_down(reducer.reference(), tmp, i, + warp_size); // Root of each vector lane reduces "thread" contribution - if (0 == hipThreadIdx_x && wx < i) { + if (0 == threadIdx.x && wx < i) { reducer.join(&tmp, reducer.data()); } } @@ -432,7 +403,7 @@ class HIPTeamMember { if (0 == wy) { // Start fan-in at power of two covering nentry - for (int i = (1 << (32 - __clz(nentry - 1))); (i >>= 1);) { + for (int i = (1 << (warp_size - __clz(nentry - 1))); (i >>= 1);) { const int k = wx + i; if (wx < i && k < nentry) { reducer.join((reinterpret_cast(shmem)) + wx, @@ -449,12 +420,12 @@ class HIPTeamMember { if (0 == wx) { reducer.copy((reinterpret_cast(global_scratch_space)) + - hipBlockIdx_x * reducer.length(), + blockIdx.x * reducer.length(), reducer.data()); __threadfence(); // Wait until global write is visible. - last_block = static_cast(hipGridDim_x) == + last_block = static_cast(gridDim.x) == 1 + Kokkos::atomic_fetch_add(global_scratch_flags, 1); // If last block then reset count @@ -473,9 +444,8 @@ class HIPTeamMember { //------------------------ // Last block reads global_scratch_memory into shared memory. - const int nentry = nid < hipGridDim_x - ? (nid < nsh ? nid : nsh) - : (hipGridDim_x < nsh ? hipGridDim_x : nsh); + const int nentry = nid < gridDim.x ? (nid < nsh ? nid : nsh) + : (gridDim.x < nsh ? gridDim.x : nsh); // nentry = min( nid , nsh , gridDim.x ) @@ -488,8 +458,7 @@ class HIPTeamMember { (reinterpret_cast(shmem)) + offset, (reinterpret_cast(global_scratch_space)) + offset); - for (int i = nentry + tid; i < static_cast(hipGridDim_x); - i += nentry) { + for (int i = nentry + tid; i < static_cast(gridDim.x); i += nentry) { reducer.join((reinterpret_cast(shmem)) + offset, (reinterpret_cast(global_scratch_space)) + i * reducer.length()); @@ -529,12 +498,11 @@ class HIPTeamMember { } } return 0; - #else (void)reducer; (void)global_scratch_flags; - (void)shmem; (void)global_scratch_space; + (void)shmem; (void)shmem_size; return 0; #endif @@ -574,7 +542,7 @@ namespace Impl { template struct TeamThreadRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const HIPTeamMember& member; const iType start; const iType end; @@ -591,7 +559,7 @@ struct TeamThreadRangeBoundariesStruct { template struct TeamVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const HIPTeamMember& member; const iType start; const iType end; @@ -609,7 +577,7 @@ struct TeamVectorRangeBoundariesStruct { template struct ThreadVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const index_type start; const index_type end; @@ -645,7 +613,7 @@ template KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< typename std::common_type::type, Impl::HIPTeamMember> TeamThreadRange(const Impl::HIPTeamMember& thread, iType1 begin, iType2 end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamThreadRangeBoundariesStruct( thread, iType(begin), iType(end)); } @@ -663,7 +631,7 @@ KOKKOS_INLINE_FUNCTION Impl::TeamVectorRangeBoundariesStruct< typename std::common_type::type, Impl::HIPTeamMember> TeamVectorRange(const Impl::HIPTeamMember& thread, const iType1& begin, const iType2& end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamVectorRangeBoundariesStruct( thread, iType(begin), iType(end)); } @@ -711,8 +679,8 @@ KOKKOS_INLINE_FUNCTION void parallel_for( loop_boundaries, const Closure& closure) { #ifdef __HIP_DEVICE_COMPILE__ - for (iType i = loop_boundaries.start + hipThreadIdx_y; - i < loop_boundaries.end; i += hipBlockDim_y) + for (iType i = loop_boundaries.start + threadIdx.y; i < loop_boundaries.end; + i += blockDim.y) closure(i); #else (void)loop_boundaries; @@ -740,8 +708,8 @@ KOKKOS_INLINE_FUNCTION typename ReducerType::value_type value; reducer.init(value); - for (iType i = loop_boundaries.start + hipThreadIdx_y; - i < loop_boundaries.end; i += hipBlockDim_y) { + for (iType i = loop_boundaries.start + threadIdx.y; i < loop_boundaries.end; + i += blockDim.y) { closure(i, value); } @@ -773,8 +741,8 @@ KOKKOS_INLINE_FUNCTION reducer.init(reducer.reference()); - for (iType i = loop_boundaries.start + hipThreadIdx_y; - i < loop_boundaries.end; i += hipBlockDim_y) { + for (iType i = loop_boundaries.start + threadIdx.y; i < loop_boundaries.end; + i += blockDim.y) { closure(i, val); } @@ -793,9 +761,8 @@ KOKKOS_INLINE_FUNCTION void parallel_for( loop_boundaries, const Closure& closure) { #ifdef __HIP_DEVICE_COMPILE__ - for (iType i = loop_boundaries.start + hipThreadIdx_y * hipBlockDim_x + - hipThreadIdx_x; - i < loop_boundaries.end; i += hipBlockDim_y * hipBlockDim_x) + for (iType i = loop_boundaries.start + threadIdx.y * blockDim.x + threadIdx.x; + i < loop_boundaries.end; i += blockDim.y * blockDim.x) closure(i); #else (void)loop_boundaries; @@ -813,9 +780,8 @@ KOKKOS_INLINE_FUNCTION typename ReducerType::value_type value; reducer.init(value); - for (iType i = loop_boundaries.start + hipThreadIdx_y * hipBlockDim_x + - hipThreadIdx_x; - i < loop_boundaries.end; i += hipBlockDim_y * hipBlockDim_x) { + for (iType i = loop_boundaries.start + threadIdx.y * blockDim.x + threadIdx.x; + i < loop_boundaries.end; i += blockDim.y * blockDim.x) { closure(i, value); } @@ -840,9 +806,8 @@ KOKKOS_INLINE_FUNCTION reducer.init(reducer.reference()); - for (iType i = loop_boundaries.start + hipThreadIdx_y * hipBlockDim_x + - hipThreadIdx_x; - i < loop_boundaries.end; i += hipBlockDim_y * hipBlockDim_x) { + for (iType i = loop_boundaries.start + threadIdx.y * blockDim.x + threadIdx.x; + i < loop_boundaries.end; i += blockDim.y * blockDim.x) { closure(i, val); } @@ -870,8 +835,8 @@ KOKKOS_INLINE_FUNCTION void parallel_for( loop_boundaries, const Closure& closure) { #ifdef __HIP_DEVICE_COMPILE__ - for (iType i = loop_boundaries.start + hipThreadIdx_x; - i < loop_boundaries.end; i += hipBlockDim_x) { + for (iType i = loop_boundaries.start + threadIdx.x; i < loop_boundaries.end; + i += blockDim.x) { closure(i); } #else @@ -902,8 +867,8 @@ KOKKOS_INLINE_FUNCTION #ifdef __HIP_DEVICE_COMPILE__ reducer.init(reducer.reference()); - for (iType i = loop_boundaries.start + hipThreadIdx_x; - i < loop_boundaries.end; i += hipBlockDim_x) { + for (iType i = loop_boundaries.start + threadIdx.x; i < loop_boundaries.end; + i += blockDim.x) { closure(i, reducer.reference()); } @@ -935,8 +900,8 @@ KOKKOS_INLINE_FUNCTION #ifdef __HIP_DEVICE_COMPILE__ result = ValueType(); - for (iType i = loop_boundaries.start + hipThreadIdx_x; - i < loop_boundaries.end; i += hipBlockDim_x) { + for (iType i = loop_boundaries.start + threadIdx.x; i < loop_boundaries.end; + i += blockDim.x) { closure(i, result); } @@ -977,22 +942,15 @@ KOKKOS_INLINE_FUNCTION void parallel_scan( // All thread "lanes" must loop the same number of times. // Determine an loop end for all thread "lanes." // Requires: - // hipBlockDim_x is power of two and thus - // ( end % hipBlockDim_x ) == ( end & ( hipBlockDim_x - 1 ) ) - // 1 <= hipBlockDim_x <= HIPTraits::WarpSize + // blockDim.x is power of two and thus + // ( end % blockDim.x ) == ( end & ( blockDim.x - 1 ) ) + // 1 <= blockDim.x <= HIPTraits::WarpSize - int constexpr warp_size = ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - const int mask = hipBlockDim_x - 1; - const unsigned active_mask = - blockDim.x == warp_size - ? 0xffffffff - : ((1 << hipBlockDim_x) - 1) - << (hipThreadIdx_y % (warp_size / hipBlockDim_x)) * - hipBlockDim_x; - const int rem = loop_boundaries.end & mask; // == end % hipBlockDim_x - const int end = loop_boundaries.end + (rem ? hipBlockDim_x - rem : 0); + const int mask = blockDim.x - 1; + const int rem = loop_boundaries.end & mask; // == end % blockDim.x + const int end = loop_boundaries.end + (rem ? blockDim.x - rem : 0); - for (int i = hipThreadIdx_x; i < end; i += hipBlockDim_x) { + for (int i = threadIdx.x; i < end; i += blockDim.x) { value_type val = 0; // First acquire per-lane contributions: @@ -1008,11 +966,10 @@ KOKKOS_INLINE_FUNCTION void parallel_scan( // [t] += [t-4] if t >= 4 // ... - for (int j = 1; j < static_cast(hipBlockDim_x); j <<= 1) { + for (int j = 1; j < static_cast(blockDim.x); j <<= 1) { value_type tmp = 0; - ::Kokkos::Experimental::Impl::in_place_shfl_up( - tmp, sval, j, hipBlockDim_x, active_mask); - if (j <= static_cast(hipThreadIdx_x)) { + ::Kokkos::Experimental::Impl::in_place_shfl_up(tmp, sval, j, blockDim.x); + if (j <= static_cast(threadIdx.x)) { sval += tmp; } } @@ -1024,8 +981,8 @@ KOKKOS_INLINE_FUNCTION void parallel_scan( if (i < loop_boundaries.end) closure(i, val, true); // Accumulate the last value in the inclusive scan: - ::Kokkos::Experimental::Impl::in_place_shfl(sval, sval, mask, blockDim.x, - active_mask); + ::Kokkos::Experimental::Impl::in_place_shfl(sval, sval, blockDim.x - 1, + blockDim.x); accum += sval; } @@ -1044,7 +1001,7 @@ KOKKOS_INLINE_FUNCTION void single( const Impl::VectorSingleStruct&, const FunctorType& lambda) { #ifdef __HIP_DEVICE_COMPILE__ - if (hipThreadIdx_x == 0) lambda(); + if (threadIdx.x == 0) lambda(); #else (void)lambda; #endif @@ -1055,7 +1012,7 @@ KOKKOS_INLINE_FUNCTION void single( const Impl::ThreadSingleStruct&, const FunctorType& lambda) { #ifdef __HIP_DEVICE_COMPILE__ - if (hipThreadIdx_x == 0 && hipThreadIdx_y == 0) lambda(); + if (threadIdx.x == 0 && threadIdx.y == 0) lambda(); #else (void)lambda; #endif @@ -1066,14 +1023,8 @@ KOKKOS_INLINE_FUNCTION void single( const Impl::VectorSingleStruct&, const FunctorType& lambda, ValueType& val) { #ifdef __HIP_DEVICE_COMPILE__ - int constexpr warp_size = ::Kokkos::Experimental::Impl::HIPTraits::WarpSize; - if (hipThreadIdx_x == 0) lambda(val); - unsigned mask = hipBlockDim_x == warp_size - ? 0xffffffff - : ((1 << hipBlockDim_x) - 1) - << ((hipThreadIdx_y % (warp_size / hipBlockDim_x)) * - hipBlockDim_x); - ::Kokkos::Experimental::Impl::in_place_shfl(val, val, 0, hipBlockDim_x, mask); + if (threadIdx.x == 0) lambda(val); + ::Kokkos::Experimental::Impl::in_place_shfl(val, val, 0, blockDim.x); #else (void)lambda; (void)val; @@ -1084,11 +1035,8 @@ template KOKKOS_INLINE_FUNCTION void single( const Impl::ThreadSingleStruct& single_struct, const FunctorType& lambda, ValueType& val) { - (void)single_struct; - (void)lambda; - (void)val; #ifdef __HIP_DEVICE_COMPILE__ - if (hipThreadIdx_x == 0 && hipThreadIdx_y == 0) { + if (threadIdx.x == 0 && threadIdx.y == 0) { lambda(val); } single_struct.team_member.team_broadcast(val, 0); @@ -1103,4 +1051,4 @@ KOKKOS_INLINE_FUNCTION void single( #endif /* defined( __HIPCC__ ) */ -#endif /* #ifndef KOKKOS_CUDA_TEAM_HPP */ +#endif /* #ifndef KOKKOS_HIP_TEAM_HPP */ diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp new file mode 100644 index 0000000000..f7e38a508b --- /dev/null +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_UniqueToken.hpp @@ -0,0 +1,129 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_HIP_UNIQUE_TOKEN_HPP +#define KOKKOS_HIP_UNIQUE_TOKEN_HPP + +#include +#include +#include + +namespace Kokkos { +namespace Experimental { + +// both global and instance Unique Tokens are implemented in the same way +template <> +class UniqueToken { + protected: + uint32_t volatile* m_buffer; + uint32_t m_count; + + public: + using execution_space = HIP; + using size_type = int32_t; + + explicit UniqueToken(execution_space const& = execution_space()) + : m_buffer(Impl::HIPInternal::singleton().m_scratchConcurrentBitset), + m_count(HIP::concurrency()) {} + + KOKKOS_DEFAULTED_FUNCTION + UniqueToken(const UniqueToken&) = default; + + KOKKOS_DEFAULTED_FUNCTION + UniqueToken(UniqueToken&&) = default; + + KOKKOS_DEFAULTED_FUNCTION + UniqueToken& operator=(const UniqueToken&) = default; + + KOKKOS_DEFAULTED_FUNCTION + UniqueToken& operator=(UniqueToken&&) = default; + + /// \brief upper bound for acquired values, i.e. 0 <= value < size() + KOKKOS_INLINE_FUNCTION + size_type size() const noexcept { return m_count; } + + /// \brief acquire value such that 0 <= value < size() + KOKKOS_INLINE_FUNCTION + size_type acquire() const { + const Kokkos::pair result = + Kokkos::Impl::concurrent_bitset::acquire_bounded( + m_buffer, m_count, Kokkos::Impl::clock_tic() % m_count); + + if (result.first < 0) { + Kokkos::abort( + "UniqueToken failure to acquire tokens, no tokens available"); + } + + return result.first; + } + + /// \brief release an acquired value + KOKKOS_INLINE_FUNCTION + void release(size_type i) const noexcept { + Kokkos::Impl::concurrent_bitset::release(m_buffer, i); + } +}; + +template <> +class UniqueToken + : public UniqueToken { + View m_buffer_view; + + public: + explicit UniqueToken(execution_space const& arg = execution_space()) + : UniqueToken(arg) {} + + UniqueToken(size_type max_size, execution_space const& = execution_space()) + : m_buffer_view( + "UniqueToken::m_buffer_view", + ::Kokkos::Impl::concurrent_bitset::buffer_bound(max_size)) { + m_buffer = m_buffer_view.data(); + m_count = max_size; + } +}; + +} // namespace Experimental +} // namespace Kokkos + +#endif diff --git a/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp index 58b5abb2ee..045892bb99 100644 --- a/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_Vectorization.hpp @@ -46,20 +46,16 @@ #define KOKKOS_HIP_VECTORIZATION_HPP #include -#include namespace Kokkos { namespace Experimental { namespace Impl { -// Include all lanes -constexpr unsigned shfl_all_mask = 0xffffffff; - //---------------------------------------------------------------------------- // Shuffle operations require input to be a register (stack) variable -// Derived implements do_shfl_op(unsigned mask, T& in, int lane, int width), -// which turns in to one of KOKKOS_IMPL_HIP_SHFL(_UP_|_DOWN_|_)MASK +// Derived implements do_shfl_op( T& in, int lane, int width), +// which turns in to one of __shfl_XXX // Since the logic with respect to value sizes, etc., is the same everywhere, // put it all in one place. template @@ -69,52 +65,70 @@ struct in_place_shfl_op { return *static_cast(this); } + // FIXME_HIP depends on UB + // sizeof(Scalar) < sizeof(int) case + template + // requires _assignable_from_bits + __device__ inline typename std::enable_if::type + operator()(Scalar& out, Scalar const& in, int lane_or_delta, int width) const + noexcept { + using shfl_type = int; + union conv_type { + Scalar orig; + shfl_type conv; + }; + conv_type tmp_in; + tmp_in.orig = in; + conv_type tmp_out; + tmp_out.conv = tmp_in.conv; + conv_type res; + //------------------------------------------------ + res.conv = self().do_shfl_op( + reinterpret_cast(tmp_out.conv), lane_or_delta, width); + //------------------------------------------------ + out = res.orig; + } + // sizeof(Scalar) == sizeof(int) case template // requires _assignable_from_bits __device__ inline typename std::enable_if::type - operator()(Scalar& out, Scalar const& in, int lane_or_delta, int width, - unsigned mask = shfl_all_mask) const noexcept { - //------------------------------------------------ + operator()(Scalar& out, Scalar const& in, int lane_or_delta, int width) const + noexcept { reinterpret_cast(out) = self().do_shfl_op( - mask, reinterpret_cast(in), lane_or_delta, width); - //------------------------------------------------ + reinterpret_cast(in), lane_or_delta, width); } template __device__ inline typename std::enable_if::type - operator()(Scalar& out, Scalar const& in, int lane_or_delta, int width, - unsigned mask = shfl_all_mask) const noexcept { - //------------------------------------------------ + operator()(Scalar& out, Scalar const& in, int lane_or_delta, + int width) const noexcept { reinterpret_cast(out) = self().do_shfl_op( - mask, *reinterpret_cast(&in), lane_or_delta, width); - //------------------------------------------------ + *reinterpret_cast(&in), lane_or_delta, width); } // sizeof(Scalar) > sizeof(double) case template __device__ inline typename std::enable_if<(sizeof(Scalar) > sizeof(double))>::type - operator()(Scalar& out, const Scalar& val, int lane_or_delta, int width, - unsigned mask = shfl_all_mask) const noexcept { + operator()(Scalar& out, const Scalar& val, int lane_or_delta, + int width) const noexcept { using shuffle_as_t = int; - enum : int { N = sizeof(Scalar) / sizeof(shuffle_as_t) }; + int constexpr N = sizeof(Scalar) / sizeof(shuffle_as_t); for (int i = 0; i < N; ++i) { reinterpret_cast(&out)[i] = self().do_shfl_op( - mask, reinterpret_cast(&val)[i], lane_or_delta, - width); + reinterpret_cast(&val)[i], lane_or_delta, width); } } }; struct in_place_shfl_fn : in_place_shfl_op { template - __device__ KOKKOS_IMPL_FORCEINLINE T do_shfl_op(unsigned mask, T& val, - int lane, int width) const - noexcept { - return KOKKOS_IMPL_HIP_SHFL_MASK(mask, val, lane, width); + __device__ KOKKOS_IMPL_FORCEINLINE T do_shfl_op(T& val, int lane, + int width) const noexcept { + return __shfl(val, lane, width); } }; @@ -125,10 +139,9 @@ __device__ KOKKOS_IMPL_FORCEINLINE void in_place_shfl(Args&&... args) noexcept { struct in_place_shfl_up_fn : in_place_shfl_op { template - __device__ KOKKOS_IMPL_FORCEINLINE T do_shfl_op(unsigned mask, T& val, - int lane, int width) const - noexcept { - return KOKKOS_IMPL_HIP_SHFL_UP_MASK(mask, val, lane, width); + __device__ KOKKOS_IMPL_FORCEINLINE T do_shfl_op(T& val, int lane, + int width) const noexcept { + return __shfl_up(val, lane, width); } }; @@ -140,10 +153,9 @@ __device__ KOKKOS_IMPL_FORCEINLINE void in_place_shfl_up( struct in_place_shfl_down_fn : in_place_shfl_op { template - __device__ KOKKOS_IMPL_FORCEINLINE T do_shfl_op(unsigned mask, T& val, - int lane, int width) const - noexcept { - return KOKKOS_IMPL_HIP_SHFL_DOWN_MASK(mask, val, lane, width); + __device__ KOKKOS_IMPL_FORCEINLINE T do_shfl_op(T& val, int lane, + int width) const noexcept { + return __shfl_down(val, lane, width); } }; @@ -154,6 +166,31 @@ __device__ KOKKOS_IMPL_FORCEINLINE void in_place_shfl_down( } } // namespace Impl + +template +// requires default_constructible && _assignable_from_bits +__device__ inline T shfl(const T& val, const int& srcLane, const int& width) { + T rv = {}; + Impl::in_place_shfl(rv, val, srcLane, width); + return rv; +} + +template +// requires default_constructible && _assignable_from_bits +__device__ inline T shfl_down(const T& val, int delta, int width) { + T rv = {}; + Impl::in_place_shfl_down(rv, val, delta, width); + return rv; +} + +template +// requires default_constructible && _assignable_from_bits +__device__ inline T shfl_up(const T& val, int delta, int width) { + T rv = {}; + Impl::in_place_shfl_up(rv, val, delta, width); + return rv; +} + } // namespace Experimental } // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp similarity index 52% rename from lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp rename to lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp index 0c6fbd75bc..3e053d8f14 100644 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +++ b/lib/kokkos/core/src/HIP/Kokkos_HIP_WorkGraphPolicy.hpp @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,18 +40,73 @@ // // ************************************************************************ //@HEADER +*/ + +#ifndef KOKKOS_HIP_WORKGRAPHPOLICY_HPP +#define KOKKOS_HIP_WORKGRAPHPOLICY_HPP + +#include -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include namespace Kokkos { namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Experimental::HPX, int64_t) + +template +class ParallelFor, + Kokkos::Experimental::HIP> { + public: + using Policy = Kokkos::WorkGraphPolicy; + using Self = ParallelFor; + + private: + Policy m_policy; + FunctorType m_functor; + + template + __device__ inline + typename std::enable_if::value>::type + exec_one(const std::int32_t w) const noexcept { + m_functor(w); + } + + template + __device__ inline + typename std::enable_if::value>::type + exec_one(const std::int32_t w) const noexcept { + const TagType t{}; + m_functor(t, w); + } + + public: + __device__ inline void operator()() const noexcept { + // Spin until COMPLETED_TOKEN. + // END_TOKEN indicates no work is currently available. + for (std::int32_t w = Policy::END_TOKEN; + Policy::COMPLETED_TOKEN != (w = m_policy.pop_work());) { + if (Policy::END_TOKEN != w) { + exec_one(w); + m_policy.completed_work(w); + } + } + } + + inline void execute() { + const int warps_per_block = 4; + const dim3 grid( + Kokkos::Experimental::Impl::hip_internal_multiprocessor_count(), 1, 1); + const dim3 block(1, Kokkos::Experimental::Impl::HIPTraits::WarpSize, + warps_per_block); + const int shared = 0; + + Kokkos::Experimental::Impl::HIPParallelLaunch( + *this, grid, block, shared, + Experimental::HIP().impl_internal_space_instance(), false); + } + + inline ParallelFor(const FunctorType& arg_functor, const Policy& arg_policy) + : m_policy(arg_policy), m_functor(arg_functor) {} +}; } // namespace Impl } // namespace Kokkos + +#endif /* #define KOKKOS_HIP_WORKGRAPHPOLICY_HPP */ diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp b/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp index acbd1074fd..c7512ff35b 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX.cpp @@ -53,9 +53,12 @@ namespace Kokkos { namespace Experimental { bool HPX::m_hpx_initialized = false; -Kokkos::Impl::thread_buffer HPX::m_buffer; +std::atomic HPX::m_next_instance_id{1}; #if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) -hpx::future HPX::m_future = hpx::make_ready_future(); +std::atomic HPX::m_active_parallel_region_count{0}; +HPX::instance_data HPX::m_global_instance_data; +#else +Kokkos::Impl::thread_buffer HPX::m_global_buffer; #endif int HPX::concurrency() { diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp index 803d955914..df09e026fd 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX_Task.hpp @@ -80,7 +80,8 @@ class TaskQueueSpecialization< // This is not necessarily the most efficient, but can be improved later. TaskQueueSpecialization task_queue; task_queue.scheduler = &scheduler; - Kokkos::Impl::dispatch_execute_task(&task_queue); + Kokkos::Impl::dispatch_execute_task(&task_queue, + Kokkos::Experimental::HPX()); Kokkos::Experimental::HPX().fence(); } @@ -92,7 +93,7 @@ class TaskQueueSpecialization< const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = Kokkos::Experimental::HPX().impl_get_buffer(); buffer.resize(num_worker_threads, 512); auto &queue = scheduler->queue(); @@ -138,6 +139,10 @@ class TaskQueueSpecialization< } num_tasks_remaining.wait(); + +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::impl_decrement_active_parallel_region_count(); +#endif } static uint32_t get_max_team_count(execution_space const &espace) { @@ -207,7 +212,8 @@ class TaskQueueSpecializationConstrained< // This is not necessarily the most efficient, but can be improved later. TaskQueueSpecializationConstrained task_queue; task_queue.scheduler = &scheduler; - Kokkos::Impl::dispatch_execute_task(&task_queue); + Kokkos::Impl::dispatch_execute_task(&task_queue, + Kokkos::Experimental::HPX()); Kokkos::Experimental::HPX().fence(); } @@ -222,7 +228,7 @@ class TaskQueueSpecializationConstrained< static task_base_type *const end = (task_base_type *)task_base_type::EndTag; constexpr task_base_type *no_more_tasks_sentinel = nullptr; - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = Kokkos::Experimental::HPX().impl_get_buffer(); buffer.resize(num_worker_threads, 512); auto &queue = scheduler->queue(); @@ -276,6 +282,10 @@ class TaskQueueSpecializationConstrained< } num_tasks_remaining.wait(); + +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::impl_decrement_active_parallel_region_count(); +#endif } template diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_ViewCopyETIAvail.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_ViewCopyETIAvail.hpp deleted file mode 100644 index 99020a3e0d..0000000000 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_ViewCopyETIAvail.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_HPX_VIEWETIAVAIL_HPP -#define KOKKOS_HPX_VIEWETIAVAIL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Experimental::HPX - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_ViewCopyETIDecl.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_ViewCopyETIDecl.hpp deleted file mode 100644 index fae486f4b0..0000000000 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_ViewCopyETIDecl.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_HPX_VIEWETIDECL_HPP -#define KOKKOS_HPX_VIEWETIDECL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Experimental::HPX - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif diff --git a/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp b/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp index 6705005c1b..527fe12ad9 100644 --- a/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/HPX/Kokkos_HPX_WorkGraphPolicy.hpp @@ -45,7 +45,7 @@ #ifndef KOKKOS_HPX_WORKGRAPHPOLICY_HPP #define KOKKOS_HPX_WORKGRAPHPOLICY_HPP -#include +#include #include #include @@ -78,8 +78,8 @@ class ParallelFor, public: void execute() const { - dispatch_execute_task(this); - Kokkos::Experimental::HPX().fence(); + dispatch_execute_task(this, m_policy.space()); + m_policy.space().fence(); } void execute_task() const { diff --git a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp index 3195dbdedf..d3ec64368f 100644 --- a/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp +++ b/lib/kokkos/core/src/KokkosExp_MDRangePolicy.hpp @@ -130,8 +130,9 @@ struct MDRangePolicy : public Kokkos::Impl::PolicyTraits { RangePolicy; - typedef MDRangePolicy - execution_policy; // needed for is_execution_space interrogation + using execution_policy = + MDRangePolicy; // needed for is_execution_space + // interrogation template friend struct MDRangePolicy; @@ -551,148 +552,6 @@ using Kokkos::Rank; } // namespace Kokkos // ------------------------------------------------------------------ // -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -// ------------------------------------------------------------------ // -// md_parallel_for - deprecated use parallel_for -// ------------------------------------------------------------------ // - -namespace Kokkos { -namespace Experimental { - -template -void md_parallel_for( - MDRange const& range, Functor const& f, const std::string& str = "", - typename std::enable_if< - (true -#if defined(KOKKOS_ENABLE_CUDA) - && !std::is_same::value -#endif -#if defined(KOKKOS_ENABLE_ROCM) - && !std::is_same::value -#endif - )>::type* = 0) { - Kokkos::Impl::Experimental::MDFunctor g(range, f); - - using range_policy = typename MDRange::impl_range_policy; - - Kokkos::parallel_for(range_policy(0, range.m_num_tiles).set_chunk_size(1), g, - str); -} - -template -void md_parallel_for( - const std::string& str, MDRange const& range, Functor const& f, - typename std::enable_if< - (true -#if defined(KOKKOS_ENABLE_CUDA) - && !std::is_same::value -#endif -#if defined(KOKKOS_ENABLE_ROCM) - && !std::is_same::value -#endif - )>::type* = 0) { - Kokkos::Impl::Experimental::MDFunctor g(range, f); - - using range_policy = typename MDRange::impl_range_policy; - - Kokkos::parallel_for(range_policy(0, range.m_num_tiles).set_chunk_size(1), g, - str); -} - -// Cuda specialization -#if defined(__CUDACC__) && defined(KOKKOS_ENABLE_CUDA) -template -void md_parallel_for( - const std::string& str, MDRange const& range, Functor const& f, - typename std::enable_if< - (true -#if defined(KOKKOS_ENABLE_CUDA) - && std::is_same::value -#endif - )>::type* = 0) { - Kokkos::Impl::DeviceIterateTile - closure(range, f); - closure.execute(); -} - -template -void md_parallel_for( - MDRange const& range, Functor const& f, const std::string& str = "", - typename std::enable_if< - (true -#if defined(KOKKOS_ENABLE_CUDA) - && std::is_same::value -#endif - )>::type* = 0) { - Kokkos::Impl::DeviceIterateTile - closure(range, f); - closure.execute(); -} -#endif -// ------------------------------------------------------------------ // - -// ------------------------------------------------------------------ // -// md_parallel_reduce - deprecated use parallel_reduce -// ------------------------------------------------------------------ // -template -void md_parallel_reduce( - MDRange const& range, Functor const& f, ValueType& v, - const std::string& str = "", - typename std::enable_if< - (true -#if defined(KOKKOS_ENABLE_CUDA) - && !std::is_same::value -#endif -#if defined(KOKKOS_ENABLE_ROCM) - && !std::is_same::value -#endif - )>::type* = 0) { - Kokkos::Impl::Experimental::MDFunctor g(range, - f); - - using range_policy = typename MDRange::impl_range_policy; - Kokkos::parallel_reduce( - str, range_policy(0, range.m_num_tiles).set_chunk_size(1), g, v); -} - -template -void md_parallel_reduce( - const std::string& str, MDRange const& range, Functor const& f, - ValueType& v, - typename std::enable_if< - (true -#if defined(KOKKOS_ENABLE_CUDA) - && !std::is_same::value -#endif -#if defined(KOKKOS_ENABLE_ROCM) - && !std::is_same::value -#endif - )>::type* = 0) { - Kokkos::Impl::Experimental::MDFunctor g(range, - f); - - using range_policy = typename MDRange::impl_range_policy; - - Kokkos::parallel_reduce( - str, range_policy(0, range.m_num_tiles).set_chunk_size(1), g, v); -} - -// Cuda - md_parallel_reduce not implemented - use parallel_reduce - -} // namespace Experimental -} // namespace Kokkos -#endif - namespace Kokkos { namespace Experimental { namespace Impl { @@ -700,15 +559,15 @@ namespace Impl { template struct PolicyPropertyAdaptor, MDRangePolicy> { - typedef MDRangePolicy policy_in_t; - typedef MDRangePolicy> - policy_out_t; + using policy_in_t = MDRangePolicy; + using policy_out_t = + MDRangePolicy>; }; } // namespace Impl diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp similarity index 68% rename from lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp rename to lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp index c4a52c2dea..d6227b7bcf 100644 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +++ b/lib/kokkos/core/src/Kokkos_AcquireUniqueTokenImpl.hpp @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,15 +40,36 @@ // // ************************************************************************ //@HEADER +*/ + +#ifndef KOKKOS_ACQUIRE_UNIQUE_TOKEN_IMPL_HPP +#define KOKKOS_ACQUIRE_UNIQUE_TOKEN_IMPL_HPP -#define KOKKOS_IMPL_COMPILING_LIBRARY true #include +#include namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Cuda, int64_t) +namespace Experimental { -} // namespace Impl +template +KOKKOS_FUNCTION AcquireTeamUniqueToken::AcquireTeamUniqueToken( + AcquireTeamUniqueToken::token_type t, team_member_type team) + : my_token(t), my_team_acquired_val(team.team_scratch(0)), my_team(team) { + Kokkos::single(Kokkos::PerTeam(my_team), + [&]() { my_team_acquired_val() = my_token.acquire(); }); + my_team.team_barrier(); + + my_acquired_val = my_team_acquired_val(); +} + +template +KOKKOS_FUNCTION AcquireTeamUniqueToken::~AcquireTeamUniqueToken() { + my_team.team_barrier(); + Kokkos::single(Kokkos::PerTeam(my_team), + [&]() { my_token.release(my_acquired_val); }); + my_team.team_barrier(); +} + +} // namespace Experimental } // namespace Kokkos + +#endif // KOKKOS_UNIQUE_TOKEN_HPP diff --git a/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp b/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp index a4e887668f..d4632596c8 100644 --- a/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_AnonymousSpace.hpp @@ -56,12 +56,12 @@ namespace Kokkos { class AnonymousSpace { public: //! Tag this class as a kokkos memory space - typedef AnonymousSpace memory_space; - typedef Kokkos::DefaultExecutionSpace execution_space; - typedef size_t size_type; + using memory_space = AnonymousSpace; + using execution_space = Kokkos::DefaultExecutionSpace; + using size_type = size_t; //! This memory space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; /**\brief Default memory space instance */ AnonymousSpace() = default; diff --git a/lib/kokkos/core/src/Kokkos_Array.hpp b/lib/kokkos/core/src/Kokkos_Array.hpp index d830616bd6..0d1408df1d 100644 --- a/lib/kokkos/core/src/Kokkos_Array.hpp +++ b/lib/kokkos/core/src/Kokkos_Array.hpp @@ -122,13 +122,13 @@ struct Array { T m_internal_implementation_private_member_data[N]; public: - typedef T& reference; - typedef typename std::add_const::type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef typename std::add_const::type* const_pointer; + using reference = T&; + using const_reference = typename std::add_const::type&; + using size_type = size_t; + using difference_type = ptrdiff_t; + using value_type = T; + using pointer = T*; + using const_pointer = typename std::add_const::type*; KOKKOS_INLINE_FUNCTION static constexpr size_type size() { return N; } KOKKOS_INLINE_FUNCTION static constexpr bool empty() { return false; } @@ -158,38 +158,18 @@ struct Array { KOKKOS_INLINE_FUNCTION const_pointer data() const { return &m_internal_implementation_private_member_data[0]; } - -#ifdef KOKKOS_IMPL_HIP_CLANG_WORKAROUND - // Do not default unless move and move-assignment are also defined - KOKKOS_DEFAULTED_FUNCTION ~Array() = default; - KOKKOS_DEFAULTED_FUNCTION Array() = default; - KOKKOS_DEFAULTED_FUNCTION Array(const Array&) = default; - KOKKOS_DEFAULTED_FUNCTION Array& operator=(const Array&) = default; - - // Some supported compilers are not sufficiently C++11 compliant - // for default move constructor and move assignment operator. - KOKKOS_DEFAULTED_FUNCTION Array(Array&&) = default; - KOKKOS_DEFAULTED_FUNCTION Array& operator=(Array&&) = default; - - KOKKOS_INLINE_FUNCTION - Array(const std::initializer_list& vals) { - for (size_t i = 0; i < N; i++) { - m_internal_implementation_private_member_data[i] = vals.begin()[i]; - } - } -#endif }; template struct Array { public: - typedef T& reference; - typedef typename std::add_const::type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef typename std::add_const::type* const_pointer; + using reference = T&; + using const_reference = typename std::add_const::type&; + using size_type = size_t; + using difference_type = ptrdiff_t; + using value_type = T; + using pointer = T*; + using const_pointer = typename std::add_const::type*; KOKKOS_INLINE_FUNCTION static constexpr size_type size() { return 0; } KOKKOS_INLINE_FUNCTION static constexpr bool empty() { return true; } @@ -240,13 +220,13 @@ struct Array::contiguous> { size_t m_size; public: - typedef T& reference; - typedef typename std::add_const::type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef typename std::add_const::type* const_pointer; + using reference = T&; + using const_reference = typename std::add_const::type&; + using size_type = size_t; + using difference_type = ptrdiff_t; + using value_type = T; + using pointer = T*; + using const_pointer = typename std::add_const::type*; KOKKOS_INLINE_FUNCTION constexpr size_type size() const { return m_size; } KOKKOS_INLINE_FUNCTION constexpr bool empty() const { return 0 != m_size; } @@ -309,13 +289,13 @@ struct Array::strided> { size_t m_stride; public: - typedef T& reference; - typedef typename std::add_const::type& const_reference; - typedef size_t size_type; - typedef ptrdiff_t difference_type; - typedef T value_type; - typedef T* pointer; - typedef typename std::add_const::type* const_pointer; + using reference = T&; + using const_reference = typename std::add_const::type&; + using size_type = size_t; + using difference_type = ptrdiff_t; + using value_type = T; + using pointer = T*; + using const_pointer = typename std::add_const::type*; KOKKOS_INLINE_FUNCTION constexpr size_type size() const { return m_size; } KOKKOS_INLINE_FUNCTION constexpr bool empty() const { return 0 != m_size; } diff --git a/lib/kokkos/core/src/Kokkos_Atomic.hpp b/lib/kokkos/core/src/Kokkos_Atomic.hpp index 55139d07b9..89f84ae7ce 100644 --- a/lib/kokkos/core/src/Kokkos_Atomic.hpp +++ b/lib/kokkos/core/src/Kokkos_Atomic.hpp @@ -75,6 +75,9 @@ //---------------------------------------------------------------------------- #if defined(_WIN32) #define KOKKOS_ENABLE_WINDOWS_ATOMICS +#if defined(KOKKOS_ENABLE_CUDA) +#define KOKKOS_ENABLE_CUDA_ATOMICS +#endif #else #if defined(KOKKOS_ENABLE_CUDA) @@ -86,7 +89,8 @@ #define KOKKOS_ENABLE_ROCM_ATOMICS -#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU) +#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU) || \ + defined(KOKKOS_IMPL_ENABLE_OVERLOAD_HOST_DEVICE) #define KOKKOS_ENABLE_HIP_ATOMICS @@ -188,7 +192,7 @@ extern KOKKOS_INLINE_FUNCTION void unlock_address_rocm_space(void* ptr); #ifdef _WIN32 #include "impl/Kokkos_Atomic_Windows.hpp" -#else +#endif //---------------------------------------------------------------------------- // Atomic Assembly // @@ -196,6 +200,15 @@ extern KOKKOS_INLINE_FUNCTION void unlock_address_rocm_space(void* ptr); #include "impl/Kokkos_Atomic_Assembly.hpp" +//---------------------------------------------------------------------------- +// Memory fence +// +// All loads and stores from this thread will be globally consistent before +// continuing +// +// void memory_fence() {...}; +#include "impl/Kokkos_Memory_Fence.hpp" + //---------------------------------------------------------------------------- // Atomic exchange // @@ -215,11 +228,8 @@ extern KOKKOS_INLINE_FUNCTION void unlock_address_rocm_space(void* ptr); #include "impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp" -#endif //_WIN32 - #include "impl/Kokkos_Atomic_Generic.hpp" -#ifndef _WIN32 //---------------------------------------------------------------------------- // Atomic fetch and add // @@ -285,16 +295,6 @@ extern KOKKOS_INLINE_FUNCTION void unlock_address_rocm_space(void* ptr); // { T tmp = *dest ; *dest = max(*dest, val); return tmp ; } #include "impl/Kokkos_Atomic_MinMax.hpp" -#endif /*Not _WIN32*/ - -//---------------------------------------------------------------------------- -// Memory fence -// -// All loads and stores from this thread will be globally consistent before -// continuing -// -// void memory_fence() {...}; -#include "impl/Kokkos_Memory_Fence.hpp" //---------------------------------------------------------------------------- // Provide volatile_load and safe_load diff --git a/lib/kokkos/core/src/Kokkos_Complex.hpp b/lib/kokkos/core/src/Kokkos_Complex.hpp index fec5d62c3d..5303b85beb 100644 --- a/lib/kokkos/core/src/Kokkos_Complex.hpp +++ b/lib/kokkos/core/src/Kokkos_Complex.hpp @@ -47,7 +47,7 @@ #include #include #include -#include +#include namespace Kokkos { @@ -219,10 +219,7 @@ class // Scale (by the "1-norm" of y) to avoid unwarranted overflow. // If the real part is +/-Inf and the imaginary part is -/+Inf, // this won't change the result. -#if !defined(__HIP_DEVICE_COMPILE__) // FIXME_HIP - using std::fabs; -#endif - const RealType s = fabs(y.real()) + fabs(y.imag()); + const RealType s = std::fabs(y.real()) + std::fabs(y.imag()); // If s is 0, then y is zero, so x/y == real(x)/0 + i*imag(x)/0. // In that case, the relation x/y == (x/s) / (y/s) doesn't hold, @@ -250,10 +247,7 @@ class // Scale (by the "1-norm" of y) to avoid unwarranted overflow. // If the real part is +/-Inf and the imaginary part is -/+Inf, // this won't change the result. -#if !defined(__HIP_DEVICE_COMPILE__) // FIXME_HIP - using std::fabs; -#endif - const RealType s = fabs(y.real()) + fabs(y.imag()); + const RealType s = std::fabs(y.real()) + std::fabs(y.imag()); // If s is 0, then y is zero, so x/y == real(x)/0 + i*imag(x)/0. // In that case, the relation x/y == (x/s) / (y/s) doesn't hold, @@ -698,43 +692,27 @@ KOKKOS_INLINE_FUNCTION RealType real(const complex& x) noexcept { //! Absolute value (magnitude) of a complex number. template KOKKOS_INLINE_FUNCTION RealType abs(const complex& x) { -#if !defined(__CUDA_ARCH__) && \ - !defined(__HIP_DEVICE_COMPILE__) // FIXME_CUDA FIXME_HIP - using std::hypot; -#endif - return hypot(x.real(), x.imag()); + return std::hypot(x.real(), x.imag()); } //! Power of a complex number template KOKKOS_INLINE_FUNCTION Kokkos::complex pow(const complex& x, const RealType& e) { - RealType r = abs(x); -#if !defined(__HIP_DEVICE_COMPILE__) // FIXME_HIP - using std::atan; - using std::cos; - using std::pow; - using std::sin; -#endif - using ::pow; - RealType phi = atan(x.imag() / x.real()); - return pow(r, e) * Kokkos::complex(cos(phi * e), sin(phi * e)); + RealType r = abs(x); + RealType phi = std::atan(x.imag() / x.real()); + return std::pow(r, e) * + Kokkos::complex(std::cos(phi * e), std::sin(phi * e)); } //! Square root of a complex number. template KOKKOS_INLINE_FUNCTION Kokkos::complex sqrt( const complex& x) { - RealType r = abs(x); -#if !defined(__HIP_DEVICE_COMPILE__) // FIXME_HIP - using std::atan; - using std::cos; - using std::sin; - using std::sqrt; -#endif - using ::sqrt; - RealType phi = atan(x.imag() / x.real()); - return sqrt(r) * Kokkos::complex(cos(phi * 0.5), sin(phi * 0.5)); + RealType r = abs(x); + RealType phi = std::atan(x.imag() / x.real()); + return std::sqrt(r) * + Kokkos::complex(std::cos(phi * 0.5), std::sin(phi * 0.5)); } //! Conjugate of a complex number. @@ -747,14 +725,8 @@ KOKKOS_INLINE_FUNCTION complex conj( //! Exponential of a complex number. template KOKKOS_INLINE_FUNCTION complex exp(const complex& x) { -#if !defined(__HIP_DEVICE_COMPILE__) // FIXME_HIP - using std::cos; - using std::exp; - using std::sin; -#else - using ::exp; -#endif - return exp(x.real()) * complex(cos(x.imag()), sin(x.imag())); + return std::exp(x.real()) * + complex(std::cos(x.imag()), std::sin(x.imag())); } /// This function cannot be called in a CUDA device function, @@ -787,12 +759,9 @@ KOKKOS_INLINE_FUNCTION // Scale (by the "1-norm" of y) to avoid unwarranted overflow. // If the real part is +/-Inf and the imaginary part is -/+Inf, // this won't change the result. -#if !defined(__HIP_DEVICE_COMPILE__) // FIXME_HIP - using std::fabs; -#endif - typedef - typename std::common_type::type common_real_type; - const common_real_type s = fabs(real(y)) + fabs(imag(y)); + using common_real_type = + typename std::common_type::type; + const common_real_type s = std::fabs(real(y)) + std::fabs(imag(y)); // If s is 0, then y is zero, so x/y == real(x)/0 + i*imag(x)/0. // In that case, the relation x/y == (x/s) / (y/s) doesn't hold, @@ -838,7 +807,7 @@ std::istream& operator>>(std::istream& is, complex& x) { template struct reduction_identity > { - typedef reduction_identity t_red_ident; + using t_red_ident = reduction_identity; KOKKOS_FORCEINLINE_FUNCTION constexpr static Kokkos::complex sum() noexcept { return Kokkos::complex(t_red_ident::sum(), t_red_ident::sum()); diff --git a/lib/kokkos/core/src/Kokkos_Concepts.hpp b/lib/kokkos/core/src/Kokkos_Concepts.hpp index 13d7925c12..4989f2701c 100644 --- a/lib/kokkos/core/src/Kokkos_Concepts.hpp +++ b/lib/kokkos/core/src/Kokkos_Concepts.hpp @@ -95,11 +95,11 @@ struct WorkItemProperty { ImplWorkItemProperty<4>(); constexpr static const ImplWorkItemProperty<8> HintIrregular = ImplWorkItemProperty<8>(); - typedef ImplWorkItemProperty<0> None_t; - typedef ImplWorkItemProperty<1> HintLightWeight_t; - typedef ImplWorkItemProperty<2> HintHeavyWeight_t; - typedef ImplWorkItemProperty<4> HintRegular_t; - typedef ImplWorkItemProperty<8> HintIrregular_t; + using None_t = ImplWorkItemProperty<0>; + using HintLightWeight_t = ImplWorkItemProperty<1>; + using HintHeavyWeight_t = ImplWorkItemProperty<2>; + using HintRegular_t = ImplWorkItemProperty<4>; + using HintIrregular_t = ImplWorkItemProperty<8>; }; template @@ -219,7 +219,7 @@ class has_member_team_shmem_size { public: constexpr static bool value = - sizeof(test_for_member(0)) == sizeof(int32_t); + sizeof(test_for_member(nullptr)) == sizeof(int32_t); }; template @@ -250,9 +250,9 @@ struct Device { "Execution space is not valid"); static_assert(Kokkos::is_memory_space::value, "Memory space is not valid"); - typedef ExecutionSpace execution_space; - typedef MemorySpace memory_space; - typedef Device device_type; + using execution_space = ExecutionSpace; + using memory_space = MemorySpace; + using device_type = Device; }; namespace Impl { @@ -277,88 +277,85 @@ struct is_space { private: template struct exe : std::false_type { - typedef void space; + using space = void; }; template struct mem : std::false_type { - typedef void space; + using space = void; }; template struct dev : std::false_type { - typedef void space; + using space = void; }; template struct exe::type> : std::is_same::type { - typedef typename U::execution_space space; + using space = typename U::execution_space; }; template struct mem< U, typename std::conditional::type> : std::is_same::type { - typedef typename U::memory_space space; + using space = typename U::memory_space; }; template struct dev< U, typename std::conditional::type> : std::is_same::type { - typedef typename U::device_type space; + using space = typename U::device_type; }; - typedef typename is_space::template exe::type> - is_exe; - typedef typename is_space::template mem::type> - is_mem; - typedef typename is_space::template dev::type> - is_dev; + using is_exe = + typename is_space::template exe::type>; + using is_mem = + typename is_space::template mem::type>; + using is_dev = + typename is_space::template dev::type>; public: static constexpr bool value = is_exe::value || is_mem::value || is_dev::value; constexpr operator bool() const noexcept { return value; } - typedef typename is_exe::space execution_space; - typedef typename is_mem::space memory_space; + using execution_space = typename is_exe::space; + using memory_space = typename is_mem::space; // For backward compatibility, deprecated in favor of // Kokkos::Impl::HostMirror::host_mirror_space - typedef typename std::conditional< + using host_memory_space = typename std::conditional< std::is_same::value #if defined(KOKKOS_ENABLE_CUDA) || std::is_same::value || std::is_same::value #endif /* #if defined( KOKKOS_ENABLE_CUDA ) */ , - memory_space, Kokkos::HostSpace>::type host_memory_space; + memory_space, Kokkos::HostSpace>::type; #if defined(KOKKOS_ENABLE_CUDA) - typedef typename std::conditional< + using host_execution_space = typename std::conditional< std::is_same::value, - Kokkos::DefaultHostExecutionSpace, execution_space>::type - host_execution_space; + Kokkos::DefaultHostExecutionSpace, execution_space>::type; #else #if defined(KOKKOS_ENABLE_OPENMPTARGET) - typedef typename std::conditional< + using host_execution_space = typename std::conditional< std::is_same::value, - Kokkos::DefaultHostExecutionSpace, execution_space>::type - host_execution_space; + Kokkos::DefaultHostExecutionSpace, execution_space>::type; #else - typedef execution_space host_execution_space; + using host_execution_space = execution_space; #endif #endif - typedef typename std::conditional< + using host_mirror_space = typename std::conditional< std::is_same::value && std::is_same::value, - T, Kokkos::Device>::type - host_mirror_space; + T, Kokkos::Device>::type; }; // For backward compatibility @@ -447,13 +444,12 @@ struct SpaceAccessibility { typename AccessSpace::memory_space>::accessible, "template argument #1 is an invalid space"); - typedef Kokkos::Impl::MemorySpaceAccess< - typename AccessSpace::execution_space::memory_space, MemorySpace> - exe_access; + using exe_access = Kokkos::Impl::MemorySpaceAccess< + typename AccessSpace::execution_space::memory_space, MemorySpace>; - typedef Kokkos::Impl::MemorySpaceAccess - mem_access; + using mem_access = + Kokkos::Impl::MemorySpaceAccess; public: /**\brief Can AccessSpace::execution_space access MemorySpace ? @@ -479,12 +475,11 @@ struct SpaceAccessibility { // to be able to access MemorySpace? // If same memory space or not accessible use the AccessSpace // else construct a device with execution space and memory space. - typedef typename std::conditional< + using space = typename std::conditional< std::is_same::value || !exe_access::accessible, AccessSpace, - Kokkos::Device>::type - space; + Kokkos::Device>::type; }; } // namespace Kokkos diff --git a/lib/kokkos/core/src/Kokkos_CopyViews.hpp b/lib/kokkos/core/src/Kokkos_CopyViews.hpp index 810b712733..78538dc7df 100644 --- a/lib/kokkos/core/src/Kokkos_CopyViews.hpp +++ b/lib/kokkos/core/src/Kokkos_CopyViews.hpp @@ -45,14 +45,12 @@ #ifndef KOKKOS_COPYVIEWS_HPP_ #define KOKKOS_COPYVIEWS_HPP_ #include +#include +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- -#ifndef KOKKOS_IMPL_COMPILING_LIBRARY -#define KOKKOS_IMPL_COMPILING_LIBRARY false -#endif - namespace Kokkos { namespace Impl { @@ -73,116 +71,12 @@ struct ViewFillLayoutSelector { } // namespace Impl } // namespace Kokkos -#include - namespace Kokkos { namespace Impl { -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&, const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&, const iType&, const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&, const iType&, const iType&, - const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&, const iType&, const iType&, - const iType&, const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&, const iType&, const iType&, - const iType&, const iType&, const iType&) const; -}; - -template -struct ViewFill { - ViewType a; - typename ViewType::const_value_type val; - typedef typename ViewType::non_const_value_type ST; - ViewFill(const ViewType&, const ST&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType&, const iType&, const iType&, const iType&, - const iType&, const iType&, const iType&, const iType&) const; -}; - template -struct ViewFill { - typedef typename ViewType::non_const_value_type ST; +struct ViewFill { + using ST = typename ViewType::non_const_value_type; ViewFill(const ViewType& a, const ST& val, const ExecSpace& space) { Kokkos::Impl::DeepCopy(space, a.data(), &val, sizeof(ST)); @@ -190,11 +84,10 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::RangePolicy> policy_type; + using policy_type = Kokkos::RangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -208,17 +101,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<2, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<2, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -233,17 +123,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<3, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<3, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -261,17 +148,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<4, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<4, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -291,17 +175,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<5, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<5, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -321,17 +202,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<6, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<6, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -351,17 +229,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<6, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<6, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -382,17 +257,14 @@ struct ViewFill -struct ViewFill { +struct ViewFill { ViewType a; typename ViewType::const_value_type val; - typedef Kokkos::Rank<6, ViewFillLayoutSelector::iterate, - ViewFillLayoutSelector::iterate> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = Kokkos::Rank<6, ViewFillLayoutSelector::iterate, + ViewFillLayoutSelector::iterate>; + using policy_type = + Kokkos::MDRangePolicy>; ViewFill(const ViewType& a_, typename ViewType::const_value_type& val_, const ExecSpace& space) @@ -413,101 +285,13 @@ struct ViewFill -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1, const iType& i2) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1, const iType& i2, - const iType& i3) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1, const iType& i2, - const iType& i3, const iType& i4) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1, const iType& i2, - const iType& i3, const iType& i4, const iType& i5) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1, const iType& i2, - const iType& i3, const iType& i4, const iType& i5, - const iType& i6) const; -}; - -template -struct ViewCopy { - ViewTypeA a; - ViewTypeB b; - ViewCopy(const ViewTypeA&, const ViewTypeB&, const ExecSpace&); - KOKKOS_INLINE_FUNCTION - void operator()(const iType& i0, const iType& i1, const iType& i2, - const iType& i3, const iType& i4, const iType& i5, - const iType& i6, const iType& i7) const; -}; - template -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; - typedef Kokkos::RangePolicy> policy_type; + using policy_type = Kokkos::RangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -522,19 +306,17 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; static const Kokkos::Iterate outer_iteration_pattern = Kokkos::layout_iterate_type_selector::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<2, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<2, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -552,8 +334,7 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; @@ -561,11 +342,10 @@ struct ViewCopy::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<3, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<3, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -584,8 +364,7 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; @@ -593,11 +372,10 @@ struct ViewCopy::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<4, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<4, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -618,8 +396,7 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; @@ -627,11 +404,10 @@ struct ViewCopy::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<5, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<5, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -652,8 +428,7 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; @@ -661,11 +436,10 @@ struct ViewCopy::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<6, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<6, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -686,8 +460,7 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; @@ -695,11 +468,10 @@ struct ViewCopy::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<6, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<6, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -721,8 +493,7 @@ struct ViewCopy -struct ViewCopy { +struct ViewCopy { ViewTypeA a; ViewTypeB b; @@ -730,11 +501,10 @@ struct ViewCopy::outer_iteration_pattern; static const Kokkos::Iterate inner_iteration_pattern = Kokkos::layout_iterate_type_selector::inner_iteration_pattern; - typedef Kokkos::Rank<6, outer_iteration_pattern, inner_iteration_pattern> - iterate_type; - typedef Kokkos::MDRangePolicy> - policy_type; + using iterate_type = + Kokkos::Rank<6, outer_iteration_pattern, inner_iteration_pattern>; + using policy_type = + Kokkos::MDRangePolicy>; ViewCopy(const ViewTypeA& a_, const ViewTypeB& b_, const ExecSpace space = ExecSpace()) @@ -758,16 +528,14 @@ struct ViewCopy - namespace Kokkos { namespace Impl { template void view_copy(const ExecutionSpace& space, const DstType& dst, const SrcType& src) { - typedef typename DstType::memory_space dst_memory_space; - typedef typename SrcType::memory_space src_memory_space; + using dst_memory_space = typename DstType::memory_space; + using src_memory_space = typename SrcType::memory_space; enum { ExecCanAccessSrc = @@ -844,10 +612,10 @@ void view_copy(const ExecutionSpace& space, const DstType& dst, template void view_copy(const DstType& dst, const SrcType& src) { - typedef typename DstType::execution_space dst_execution_space; - typedef typename SrcType::execution_space src_execution_space; - typedef typename DstType::memory_space dst_memory_space; - typedef typename SrcType::memory_space src_memory_space; + using dst_execution_space = typename DstType::execution_space; + using src_execution_space = typename SrcType::execution_space; + using dst_memory_space = typename DstType::memory_space; + using src_memory_space = typename SrcType::memory_space; enum { DstExecCanAccessSrc = @@ -962,8 +730,8 @@ struct CommonSubview; template struct CommonSubview { - typedef typename Kokkos::Subview dst_subview_type; - typedef typename Kokkos::Subview src_subview_type; + using dst_subview_type = typename Kokkos::Subview; + using src_subview_type = typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -973,8 +741,8 @@ struct CommonSubview { template struct CommonSubview { - typedef typename Kokkos::Subview dst_subview_type; - typedef typename Kokkos::Subview src_subview_type; + using dst_subview_type = typename Kokkos::Subview; + using src_subview_type = typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -985,8 +753,8 @@ struct CommonSubview { template struct CommonSubview { - typedef typename Kokkos::Subview dst_subview_type; - typedef typename Kokkos::Subview src_subview_type; + using dst_subview_type = typename Kokkos::Subview; + using src_subview_type = typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -997,10 +765,10 @@ struct CommonSubview { template struct CommonSubview { - typedef typename Kokkos::Subview - dst_subview_type; - typedef typename Kokkos::Subview - src_subview_type; + using dst_subview_type = + typename Kokkos::Subview; + using src_subview_type = + typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -1014,10 +782,10 @@ template struct CommonSubview { - typedef typename Kokkos::Subview - dst_subview_type; - typedef typename Kokkos::Subview - src_subview_type; + using dst_subview_type = + typename Kokkos::Subview; + using src_subview_type = + typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -1031,10 +799,10 @@ template struct CommonSubview { - typedef typename Kokkos::Subview - dst_subview_type; - typedef typename Kokkos::Subview - src_subview_type; + using dst_subview_type = + typename Kokkos::Subview; + using src_subview_type = + typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -1048,12 +816,10 @@ template struct CommonSubview { - typedef typename Kokkos::Subview - dst_subview_type; - typedef typename Kokkos::Subview - src_subview_type; + using dst_subview_type = typename Kokkos::Subview; + using src_subview_type = typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -1067,12 +833,12 @@ template struct CommonSubview { - typedef typename Kokkos::Subview - dst_subview_type; - typedef typename Kokkos::Subview - src_subview_type; + using dst_subview_type = + typename Kokkos::Subview; + using src_subview_type = + typename Kokkos::Subview; dst_subview_type dst_sub; src_subview_type src_sub; CommonSubview(const DstType& dst, const SrcType& src, const Arg0& arg0, @@ -1090,14 +856,14 @@ struct ViewRemap; template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { view_copy(dst, src); } else { p_type ext0(0, std::min(dst.extent(0), src.extent(0))); - typedef CommonSubview sv_adapter_type; + using sv_adapter_type = CommonSubview; sv_adapter_type common_subview(dst, src, ext0); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1106,7 +872,7 @@ struct ViewRemap { template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { @@ -1114,23 +880,23 @@ struct ViewRemap { view_copy(dst, src); } else { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1); view_copy(common_subview.dst_sub, common_subview.src_sub); } } else { if (dst.extent(1) == src.extent(1)) { p_type ext0(0, std::min(dst.extent(0), src.extent(0))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); } else { p_type ext0(0, std::min(dst.extent(0), src.extent(0))); p_type ext1(0, std::min(dst.extent(1), src.extent(1))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1140,24 +906,24 @@ struct ViewRemap { template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { if (dst.extent(2) == src.extent(2)) { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); } else { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1165,17 +931,16 @@ struct ViewRemap { if (dst.extent(2) == src.extent(2)) { p_type ext0(0, std::min(dst.extent(0), src.extent(0))); p_type ext1(0, std::min(dst.extent(1), src.extent(1))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); } else { p_type ext0(0, std::min(dst.extent(0), src.extent(0))); p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1185,16 +950,16 @@ struct ViewRemap { template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { if (dst.extent(3) == src.extent(3)) { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1202,9 +967,9 @@ struct ViewRemap { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1213,9 +978,9 @@ struct ViewRemap { p_type ext0(0, std::min(dst.extent(0), src.extent(0))); p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); } else { @@ -1223,9 +988,8 @@ struct ViewRemap { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1235,7 +999,7 @@ struct ViewRemap { template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { @@ -1243,9 +1007,9 @@ struct ViewRemap { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1254,9 +1018,9 @@ struct ViewRemap { p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1267,9 +1031,9 @@ struct ViewRemap { p_type ext1(0, std::min(dst.extent(1), src.extent(1))); p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1279,9 +1043,8 @@ struct ViewRemap { p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4); view_copy(common_subview.dst_sub, common_subview.src_sub); } @@ -1290,7 +1053,7 @@ struct ViewRemap { }; template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { @@ -1299,9 +1062,9 @@ struct ViewRemap { p_type ext2(0, std::min(dst.extent(2), src.extent(2))); p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1311,9 +1074,9 @@ struct ViewRemap { p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4, ext5); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1326,9 +1089,9 @@ struct ViewRemap { p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1340,9 +1103,9 @@ struct ViewRemap { p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4, ext5); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1353,7 +1116,7 @@ struct ViewRemap { template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { @@ -1363,10 +1126,9 @@ struct ViewRemap { p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4, ext5, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1377,9 +1139,9 @@ struct ViewRemap { p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); p_type ext6(0, std::min(dst.extent(6), src.extent(6))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4, ext5, ext6); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1392,9 +1154,9 @@ struct ViewRemap { p_type ext3(0, std::min(dst.extent(3), src.extent(3))); p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4, ext5, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1406,9 +1168,9 @@ struct ViewRemap { p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); p_type ext6(0, std::min(dst.extent(6), src.extent(6))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4, ext5, ext6); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1419,7 +1181,7 @@ struct ViewRemap { template struct ViewRemap { - typedef Kokkos::pair p_type; + using p_type = Kokkos::pair; ViewRemap(const DstType& dst, const SrcType& src) { if (dst.extent(0) == src.extent(0)) { @@ -1430,10 +1192,10 @@ struct ViewRemap { p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); p_type ext6(0, std::min(dst.extent(6), src.extent(6))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4, ext5, ext6, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1445,9 +1207,9 @@ struct ViewRemap { p_type ext5(0, std::min(dst.extent(5), src.extent(5))); p_type ext6(0, std::min(dst.extent(6), src.extent(6))); p_type ext7(0, std::min(dst.extent(7), src.extent(7))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, Kokkos::ALL, ext1, ext2, ext3, ext4, ext5, ext6, ext7); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1461,10 +1223,9 @@ struct ViewRemap { p_type ext4(0, std::min(dst.extent(4), src.extent(4))); p_type ext5(0, std::min(dst.extent(5), src.extent(5))); p_type ext6(0, std::min(dst.extent(6), src.extent(6))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4, ext5, ext6, Kokkos::ALL); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1477,9 +1238,9 @@ struct ViewRemap { p_type ext5(0, std::min(dst.extent(5), src.extent(5))); p_type ext6(0, std::min(dst.extent(6), src.extent(6))); p_type ext7(0, std::min(dst.extent(7), src.extent(7))); - typedef CommonSubview - sv_adapter_type; + using sv_adapter_type = + CommonSubview; sv_adapter_type common_subview(dst, src, ext0, ext1, ext2, ext3, ext4, ext5, ext6, ext7); view_copy(common_subview.dst_sub, common_subview.src_sub); @@ -1498,26 +1259,22 @@ inline void deep_copy( typename std::enable_if::specialize, void>::value>::type* = nullptr) { - typedef View ViewType; + using ViewType = View; using exec_space_type = typename ViewType::execution_space; -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(ViewType::memory_space::name()), + Kokkos::Profiling::make_space_handle(ViewType::memory_space::name()), dst.label(), dst.data(), - Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), "Scalar", - &value, dst.span() * sizeof(typename ViewType::value_type)); + Kokkos::Profiling::make_space_handle(Kokkos::HostSpace::name()), + "Scalar", &value, dst.span() * sizeof(typename ViewType::value_type)); } -#endif if (dst.data() == nullptr) { Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -1528,14 +1285,13 @@ inline void deep_copy( // If contiguous we can simply do a 1D flat loop if (dst.span_is_contiguous()) { - typedef Kokkos::View< + using ViewTypeFlat = Kokkos::View< typename ViewType::value_type*, Kokkos::LayoutRight, Kokkos::Device::type>, - Kokkos::MemoryTraits<0>> - ViewTypeFlat; + Kokkos::MemoryTraits<0>>; ViewTypeFlat dst_flat(dst.data(), dst.size()); if (dst.span() < static_cast(std::numeric_limits::max())) { @@ -1547,11 +1303,9 @@ inline void deep_copy( ViewTypeFlat::Rank, int64_t>(dst_flat, value, exec_space_type()); Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -1581,9 +1335,9 @@ inline void deep_copy( // Lets call the right ViewFill functor based on integer space needed and // iteration type - typedef typename std::conditional< + using ViewTypeUniform = typename std::conditional< ViewType::Rank == 0, typename ViewType::uniform_runtime_type, - typename ViewType::uniform_runtime_nomemspace_type>::type ViewTypeUniform; + typename ViewType::uniform_runtime_nomemspace_type>::type; if (dst.span() > static_cast(std::numeric_limits::max())) { if (iterate == Kokkos::Iterate::Right) Kokkos::Impl::ViewFill::specialize, void>::value>::type* = nullptr) { - typedef ViewTraits src_traits; - typedef typename src_traits::memory_space src_memory_space; + using src_traits = ViewTraits; + using src_memory_space = typename src_traits::memory_space; static_assert(src_traits::rank == 0, "ERROR: Non-rank-zero view in deep_copy( value , View )"); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), "Scalar", - &dst, Kokkos::Profiling::SpaceHandle(src_memory_space::name()), + Kokkos::Profiling::make_space_handle(Kokkos::HostSpace::name()), + "Scalar", &dst, + Kokkos::Profiling::make_space_handle(src_memory_space::name()), src.label(), src.data(), src.span() * sizeof(typename src_traits::value_type)); } -#endif if (src.data() == nullptr) { Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } Kokkos::Impl::DeepCopy(&dst, src.data(), sizeof(ST)); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } //---------------------------------------------------------------------------- @@ -1666,34 +1413,31 @@ inline void deep_copy( (unsigned(ViewTraits::rank) == unsigned(0) && unsigned(ViewTraits::rank) == unsigned(0)))>::type* = nullptr) { - typedef View dst_type; - typedef View src_type; + using dst_type = View; + using src_type = View; - typedef typename dst_type::value_type value_type; - typedef typename dst_type::memory_space dst_memory_space; - typedef typename src_type::memory_space src_memory_space; + using value_type = typename dst_type::value_type; + using dst_memory_space = typename dst_type::memory_space; + using src_memory_space = typename src_type::memory_space; static_assert(std::is_same::value, "deep_copy requires matching non-const destination type"); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), dst.label(), - dst.data(), Kokkos::Profiling::SpaceHandle(src_memory_space::name()), + Kokkos::Profiling::make_space_handle(dst_memory_space::name()), + dst.label(), dst.data(), + Kokkos::Profiling::make_space_handle(src_memory_space::name()), src.label(), src.data(), src.span() * sizeof(typename dst_type::value_type)); } -#endif if (dst.data() == nullptr && src.data() == nullptr) { Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -1703,11 +1447,9 @@ inline void deep_copy( dst.data(), src.data(), sizeof(value_type)); Kokkos::fence(); } -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } //---------------------------------------------------------------------------- @@ -1722,14 +1464,14 @@ inline void deep_copy( std::is_same::specialize, void>::value && (unsigned(ViewTraits::rank) != 0 || unsigned(ViewTraits::rank) != 0))>::type* = nullptr) { - typedef View dst_type; - typedef View src_type; - typedef typename dst_type::execution_space dst_execution_space; - typedef typename src_type::execution_space src_execution_space; - typedef typename dst_type::memory_space dst_memory_space; - typedef typename src_type::memory_space src_memory_space; - typedef typename dst_type::value_type dst_value_type; - typedef typename src_type::value_type src_value_type; + using dst_type = View; + using src_type = View; + using dst_execution_space = typename dst_type::execution_space; + using src_execution_space = typename src_type::execution_space; + using dst_memory_space = typename dst_type::memory_space; + using src_memory_space = typename src_type::memory_space; + using dst_value_type = typename dst_type::value_type; + using src_value_type = typename src_type::value_type; static_assert(std::is_same::value, @@ -1738,20 +1480,16 @@ inline void deep_copy( static_assert((unsigned(dst_type::rank) == unsigned(src_type::rank)), "deep_copy requires Views of equal rank"); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), dst.label(), - dst.data(), Kokkos::Profiling::SpaceHandle(src_memory_space::name()), + Kokkos::Profiling::make_space_handle(dst_memory_space::name()), + dst.label(), dst.data(), + Kokkos::Profiling::make_space_handle(src_memory_space::name()), src.label(), src.data(), src.span() * sizeof(typename dst_type::value_type)); } -#endif if (dst.data() == nullptr || src.data() == nullptr) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // do nothing -#else // throw if dimension mismatch if ((src.extent(0) != dst.extent(0)) || (src.extent(1) != dst.extent(1)) || (src.extent(2) != dst.extent(2)) || (src.extent(3) != dst.extent(3)) || @@ -1779,13 +1517,10 @@ inline void deep_copy( Kokkos::Impl::throw_runtime_exception(message); } -#endif Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -1810,11 +1545,9 @@ inline void deep_copy( ((std::ptrdiff_t)dst_end == (std::ptrdiff_t)src_end) && (dst.span_is_contiguous() && src.span_is_contiguous())) { Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -1842,29 +1575,6 @@ inline void deep_copy( (src.extent(2) != dst.extent(2)) || (src.extent(3) != dst.extent(3)) || (src.extent(4) != dst.extent(4)) || (src.extent(5) != dst.extent(5)) || (src.extent(6) != dst.extent(6)) || (src.extent(7) != dst.extent(7))) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - Kokkos::fence(); - if (DstExecCanAccessSrc) { - // Copying data between views in accessible memory spaces and either - // non-contiguous or incompatible shape. - Kokkos::Impl::ViewRemap(dst, src); - } else if (SrcExecCanAccessDst) { - // Copying data between views in accessible memory spaces and either - // non-contiguous or incompatible shape. - Kokkos::Impl::ViewRemap(dst, - src); - } else { - Kokkos::Impl::throw_runtime_exception( - "deep_copy given views that would require a temporary allocation"); - } - Kokkos::fence(); -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::endDeepCopy(); - } -#endif - return; -#else std::string message( "Deprecation Error: Kokkos::deep_copy extents of views don't match: "); message += dst.label(); @@ -1885,7 +1595,6 @@ inline void deep_copy( message += ") "; Kokkos::Impl::throw_runtime_exception(message); -#endif } // If same type, equal layout, equal dimensions, equal span, and contiguous @@ -1910,18 +1619,16 @@ inline void deep_copy( if ((void*)dst.data() != (void*)src.data()) { Kokkos::Impl::DeepCopy( dst.data(), src.data(), nbytes); + Kokkos::fence(); } - Kokkos::fence(); } else { Kokkos::fence(); Impl::view_copy(dst, src); Kokkos::fence(); } -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } //---------------------------------------------------------------------------- @@ -2712,19 +2419,18 @@ inline void deep_copy( ExecSpace, typename ViewTraits::memory_space>::accessible>::type* = nullptr) { - typedef ViewTraits dst_traits; + using dst_traits = ViewTraits; static_assert(std::is_same::value, "deep_copy requires non-const type"); -#if defined(KOKKOS_ENABLE_PROFILING) - typedef typename dst_traits::memory_space dst_memory_space; + using dst_memory_space = typename dst_traits::memory_space; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), dst.label(), - dst.data(), Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), + Kokkos::Profiling::make_space_handle(dst_memory_space::name()), + dst.label(), dst.data(), + Kokkos::Profiling::make_space_handle(Kokkos::HostSpace::name()), "(none)", &value, dst.span() * sizeof(typename dst_traits::value_type)); } -#endif if (dst.data() == nullptr) { space.fence(); } else { @@ -2735,11 +2441,9 @@ inline void deep_copy( Kokkos::Impl::ViewFill(dst, value, space); } -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } /** \brief Deep copy a value from Host memory into a view. ExecSpace can not @@ -2755,19 +2459,18 @@ inline void deep_copy( ExecSpace, typename ViewTraits::memory_space>::accessible>::type* = nullptr) { - typedef ViewTraits dst_traits; + using dst_traits = ViewTraits; static_assert(std::is_same::value, "deep_copy requires non-const type"); -#if defined(KOKKOS_ENABLE_PROFILING) - typedef typename dst_traits::memory_space dst_memory_space; + using dst_memory_space = typename dst_traits::memory_space; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), dst.label(), - dst.data(), Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), + Kokkos::Profiling::make_space_handle(dst_memory_space::name()), + dst.label(), dst.data(), + Kokkos::Profiling::make_space_handle(Kokkos::HostSpace::name()), "(none)", &value, dst.span() * sizeof(typename dst_traits::value_type)); } -#endif if (dst.data() == nullptr) { space.fence(); } else { @@ -2781,11 +2484,9 @@ inline void deep_copy( fill_exec_space>(dst, value, fill_exec_space()); fill_exec_space().fence(); } -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } /** \brief Deep copy into a value in Host memory from a view. */ @@ -2798,36 +2499,31 @@ inline void deep_copy( Kokkos::Impl::is_execution_space::value && std::is_same::specialize, void>::value>::type* = 0) { - typedef ViewTraits src_traits; - typedef typename src_traits::memory_space src_memory_space; + using src_traits = ViewTraits; + using src_memory_space = typename src_traits::memory_space; static_assert(src_traits::rank == 0, "ERROR: Non-rank-zero view in deep_copy( value , View )"); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), "(none)", - &dst, Kokkos::Profiling::SpaceHandle(src_memory_space::name()), + Kokkos::Profiling::make_space_handle(Kokkos::HostSpace::name()), + "(none)", &dst, + Kokkos::Profiling::make_space_handle(src_memory_space::name()), src.label(), src.data(), sizeof(ST)); } -#endif if (src.data() == nullptr) { exec_space.fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } Kokkos::Impl::DeepCopy( exec_space, &dst, src.data(), sizeof(ST)); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } //---------------------------------------------------------------------------- @@ -2841,32 +2537,30 @@ inline void deep_copy( std::is_same::specialize, void>::value && std::is_same::specialize, void>::value && (unsigned(ViewTraits::rank) == unsigned(0) && - unsigned(ViewTraits::rank) == unsigned(0)))>::type* = 0) { - typedef ViewTraits src_traits; - typedef ViewTraits dst_traits; + unsigned(ViewTraits::rank) == unsigned(0)))>::type* = + nullptr) { + using src_traits = ViewTraits; + using dst_traits = ViewTraits; - typedef typename src_traits::memory_space src_memory_space; - typedef typename dst_traits::memory_space dst_memory_space; + using src_memory_space = typename src_traits::memory_space; + using dst_memory_space = typename dst_traits::memory_space; static_assert(std::is_same::value, "deep_copy requires matching non-const destination type"); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), dst.label(), - dst.data(), Kokkos::Profiling::SpaceHandle(src_memory_space::name()), + Kokkos::Profiling::make_space_handle(dst_memory_space::name()), + dst.label(), dst.data(), + Kokkos::Profiling::make_space_handle(src_memory_space::name()), src.label(), src.data(), sizeof(DT)); } -#endif if (dst.data() == nullptr && src.data() == nullptr) { exec_space.fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -2875,11 +2569,9 @@ inline void deep_copy( exec_space, dst.data(), src.data(), sizeof(typename dst_traits::value_type)); } -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } //---------------------------------------------------------------------------- @@ -2896,8 +2588,8 @@ inline void deep_copy( std::is_same::specialize, void>::value && (unsigned(ViewTraits::rank) != 0 || unsigned(ViewTraits::rank) != 0))>::type* = nullptr) { - typedef View dst_type; - typedef View src_type; + using dst_type = View; + using src_type = View; static_assert(std::is_same::value, @@ -2906,21 +2598,20 @@ inline void deep_copy( static_assert((unsigned(dst_type::rank) == unsigned(src_type::rank)), "deep_copy requires Views of equal rank"); - typedef typename dst_type::execution_space dst_execution_space; - typedef typename src_type::execution_space src_execution_space; - typedef typename dst_type::memory_space dst_memory_space; - typedef typename src_type::memory_space src_memory_space; - typedef typename dst_type::value_type dst_value_type; - typedef typename src_type::value_type src_value_type; + using dst_execution_space = typename dst_type::execution_space; + using src_execution_space = typename src_type::execution_space; + using dst_memory_space = typename dst_type::memory_space; + using src_memory_space = typename src_type::memory_space; + using dst_value_type = typename dst_type::value_type; + using src_value_type = typename src_type::value_type; -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::beginDeepCopy( - Kokkos::Profiling::SpaceHandle(dst_memory_space::name()), dst.label(), - dst.data(), Kokkos::Profiling::SpaceHandle(src_memory_space::name()), + Kokkos::Profiling::make_space_handle(dst_memory_space::name()), + dst.label(), dst.data(), + Kokkos::Profiling::make_space_handle(src_memory_space::name()), src.label(), src.data(), dst.span() * sizeof(dst_value_type)); } -#endif dst_value_type* dst_start = dst.data(); dst_value_type* dst_end = dst.data() + dst.span(); @@ -2931,9 +2622,6 @@ inline void deep_copy( if ((dst_start == nullptr || src_start == nullptr) || ((std::ptrdiff_t(dst_start) == std::ptrdiff_t(src_start)) && (std::ptrdiff_t(dst_end) == std::ptrdiff_t(src_end)))) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // do nothing -#else // throw if dimension mismatch if ((src.extent(0) != dst.extent(0)) || (src.extent(1) != dst.extent(1)) || (src.extent(2) != dst.extent(2)) || (src.extent(3) != dst.extent(3)) || @@ -2961,12 +2649,9 @@ inline void deep_copy( Kokkos::Impl::throw_runtime_exception(message); } -#endif -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif return; } @@ -3014,35 +2699,6 @@ inline void deep_copy( (src.extent(2) != dst.extent(2)) || (src.extent(3) != dst.extent(3)) || (src.extent(4) != dst.extent(4)) || (src.extent(5) != dst.extent(5)) || (src.extent(6) != dst.extent(6)) || (src.extent(7) != dst.extent(7))) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (ExecCanAccessSrcDst) { - Kokkos::Impl::ViewRemap(dst, src); - exec_space.fence(); - } else if (DstExecCanAccessSrc) { - // Copying data between views in accessible memory spaces and either - // non-contiguous or incompatible shape. - exec_space.fence(); - Kokkos::Impl::ViewRemap(dst, - src); - dst_execution_space().fence(); - } else if (SrcExecCanAccessDst) { - // Copying data between views in accessible memory spaces and either - // non-contiguous or incompatible shape. - exec_space.fence(); - Kokkos::Impl::ViewRemap(dst, - src); - src_execution_space().fence(); - } else { - Kokkos::Impl::throw_runtime_exception( - "deep_copy given views that would require a temporary allocation"); - } -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::endDeepCopy(); - } -#endif - return; -#else std::string message( "Deprecation Error: Kokkos::deep_copy extents of views don't match: "); message += dst.label(); @@ -3063,7 +2719,6 @@ inline void deep_copy( message += ") "; Kokkos::Impl::throw_runtime_exception(message); -#endif } // If same type, equal layout, equal dimensions, equal span, and contiguous @@ -3105,11 +2760,9 @@ inline void deep_copy( "deep_copy given views that would require a temporary allocation"); } } -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endDeepCopy(); } -#endif } } /* namespace Kokkos */ @@ -3135,7 +2788,7 @@ resize(Kokkos::View& v, const size_t n0 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG) { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; static_assert(Kokkos::ViewTraits::is_managed, "Can only resize managed views"); @@ -3232,7 +2885,7 @@ resize(const I& arg_prop, Kokkos::View& v, const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG) { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; static_assert(Kokkos::ViewTraits::is_managed, "Can only resize managed views"); @@ -3318,7 +2971,7 @@ resize(const I& arg_prop, Kokkos::View& v, template inline void resize(Kokkos::View& v, const typename Kokkos::View::array_layout& layout) { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; static_assert(Kokkos::ViewTraits::is_managed, "Can only resize managed views"); @@ -3346,7 +2999,7 @@ realloc(Kokkos::View& v, const size_t n5 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n6 = KOKKOS_IMPL_CTOR_DEFAULT_ARG, const size_t n7 = KOKKOS_IMPL_CTOR_DEFAULT_ARG) { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; static_assert(Kokkos::ViewTraits::is_managed, "Can only realloc managed views"); @@ -3362,7 +3015,7 @@ template inline void realloc( Kokkos::View& v, const typename Kokkos::View::array_layout& layout) { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; static_assert(Kokkos::ViewTraits::is_managed, "Can only realloc managed views"); @@ -3384,45 +3037,45 @@ namespace Impl { template struct MirrorViewType { // The incoming view_type - typedef typename Kokkos::View src_view_type; + using src_view_type = typename Kokkos::View; // The memory space for the mirror view - typedef typename Space::memory_space memory_space; + using memory_space = typename Space::memory_space; // Check whether it is the same memory space enum { is_same_memspace = std::is_same::value }; // The array_layout - typedef typename src_view_type::array_layout array_layout; + using array_layout = typename src_view_type::array_layout; // The data type (we probably want it non-const since otherwise we can't even // deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; + using data_type = typename src_view_type::non_const_data_type; // The destination view type if it is not the same memory space - typedef Kokkos::View dest_view_type; + using dest_view_type = Kokkos::View; // If it is the same memory_space return the existsing view_type // This will also keep the unmanaged trait if necessary - typedef typename std::conditional::type view_type; + using view_type = typename std::conditional::type; }; template struct MirrorType { // The incoming view_type - typedef typename Kokkos::View src_view_type; + using src_view_type = typename Kokkos::View; // The memory space for the mirror view - typedef typename Space::memory_space memory_space; + using memory_space = typename Space::memory_space; // Check whether it is the same memory space enum { is_same_memspace = std::is_same::value }; // The array_layout - typedef typename src_view_type::array_layout array_layout; + using array_layout = typename src_view_type::array_layout; // The data type (we probably want it non-const since otherwise we can't even // deep_copy to it. - typedef typename src_view_type::non_const_data_type data_type; + using data_type = typename src_view_type::non_const_data_type; // The destination view type if it is not the same memory space - typedef Kokkos::View view_type; + using view_type = Kokkos::View; }; } // namespace Impl @@ -3434,33 +3087,19 @@ inline typename Kokkos::View::HostMirror create_mirror( std::is_same::specialize, void>::value && !std::is_same::array_layout, Kokkos::LayoutStride>::value>::type* = nullptr) { - typedef View src_type; - typedef typename src_type::HostMirror dst_type; + using src_type = View; + using dst_type = typename src_type::HostMirror; - return dst_type(std::string(src.label()).append("_mirror") -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - , - src.extent(0), src.extent(1), src.extent(2), src.extent(3), - src.extent(4), src.extent(5), src.extent(6), src.extent(7)); -#else - , - src.rank_dynamic > 0 ? src.extent(0) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 1 ? src.extent(1) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 2 ? src.extent(2) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 3 ? src.extent(3) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 4 ? src.extent(4) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 5 ? src.extent(5) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 6 ? src.extent(6) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG, - src.rank_dynamic > 7 ? src.extent(7) - : KOKKOS_IMPL_CTOR_DEFAULT_ARG); -#endif + return dst_type( + std::string(src.label()).append("_mirror"), + src.rank_dynamic > 0 ? src.extent(0) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 1 ? src.extent(1) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 2 ? src.extent(2) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 3 ? src.extent(3) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 4 ? src.extent(4) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 5 ? src.extent(5) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 6 ? src.extent(6) : KOKKOS_IMPL_CTOR_DEFAULT_ARG, + src.rank_dynamic > 7 ? src.extent(7) : KOKKOS_IMPL_CTOR_DEFAULT_ARG); } template @@ -3470,8 +3109,8 @@ inline typename Kokkos::View::HostMirror create_mirror( std::is_same::specialize, void>::value && std::is_same::array_layout, Kokkos::LayoutStride>::value>::type* = nullptr) { - typedef View src_type; - typedef typename src_type::HostMirror dst_type; + using src_type = View; + using dst_type = typename src_type::HostMirror; Kokkos::LayoutStride layout; @@ -3529,7 +3168,7 @@ inline typename Kokkos::View::HostMirror create_mirror_view( typename Kokkos::View::HostMirror::memory_space>::value && std::is_same::data_type, typename Kokkos::View::HostMirror::data_type>:: - value)>::type* = 0) { + value)>::type* = nullptr) { return Kokkos::create_mirror(src); } @@ -3548,7 +3187,8 @@ template typename Impl::MirrorViewType::view_type create_mirror_view( const Space&, const Kokkos::View& src, typename std::enable_if< - !Impl::MirrorViewType::is_same_memspace>::type* = 0) { + !Impl::MirrorViewType::is_same_memspace>::type* = + nullptr) { return typename Impl::MirrorViewType::view_type(src.label(), src.layout()); } @@ -3576,7 +3216,8 @@ create_mirror_view_and_copy( const Space&, const Kokkos::View& src, std::string const& name = "", typename std::enable_if< - !Impl::MirrorViewType::is_same_memspace>::type* = 0) { + !Impl::MirrorViewType::is_same_memspace>::type* = + nullptr) { using Mirror = typename Impl::MirrorViewType::view_type; std::string label = name.empty() ? src.label() : name; auto mirror = typename Mirror::non_const_type{ @@ -3604,7 +3245,8 @@ typename Impl::MirrorViewType::view_type create_mirror_view( const Space&, const Kokkos::View& src, Kokkos::Impl::WithoutInitializing_t, typename std::enable_if< - !Impl::MirrorViewType::is_same_memspace>::type* = 0) { + !Impl::MirrorViewType::is_same_memspace>::type* = + nullptr) { using Mirror = typename Impl::MirrorViewType::view_type; return Mirror(Kokkos::ViewAllocateWithoutInitializing(src.label()), src.layout()); diff --git a/lib/kokkos/core/src/Kokkos_Core.hpp b/lib/kokkos/core/src/Kokkos_Core.hpp index 8392f0f3e5..a1669addd6 100644 --- a/lib/kokkos/core/src/Kokkos_Core.hpp +++ b/lib/kokkos/core/src/Kokkos_Core.hpp @@ -181,28 +181,28 @@ namespace Kokkos { template inline void* kokkos_malloc(const std::string& arg_alloc_label, const size_t arg_alloc_size) { - typedef typename Space::memory_space MemorySpace; + using MemorySpace = typename Space::memory_space; return Impl::SharedAllocationRecord::allocate_tracked( MemorySpace(), arg_alloc_label, arg_alloc_size); } template inline void* kokkos_malloc(const size_t arg_alloc_size) { - typedef typename Space::memory_space MemorySpace; + using MemorySpace = typename Space::memory_space; return Impl::SharedAllocationRecord::allocate_tracked( MemorySpace(), "no-label", arg_alloc_size); } template inline void kokkos_free(void* arg_alloc) { - typedef typename Space::memory_space MemorySpace; + using MemorySpace = typename Space::memory_space; return Impl::SharedAllocationRecord::deallocate_tracked( arg_alloc); } template inline void* kokkos_realloc(void* arg_alloc, const size_t arg_alloc_size) { - typedef typename Space::memory_space MemorySpace; + using MemorySpace = typename Space::memory_space; return Impl::SharedAllocationRecord::reallocate_tracked( arg_alloc, arg_alloc_size); } @@ -255,6 +255,14 @@ class ScopeGuard { #include #include +// Including this in Kokkos_Parallel_Reduce.hpp led to a circular dependency +// because Kokkos::Sum is used in Kokkos_Combined_Reducer.hpp and the default. +// The real answer is to finally break up Kokkos_Parallel_Reduce.hpp into +// smaller parts... +#include +// Yet another workaround to deal with circular dependency issues because the +// implementation of the RAII wrapper is using Kokkos::single. +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp index 4828a95775..7667dde4e6 100644 --- a/lib/kokkos/core/src/Kokkos_Core_fwd.hpp +++ b/lib/kokkos/core/src/Kokkos_Core_fwd.hpp @@ -52,7 +52,6 @@ #include #include -#include #include //---------------------------------------------------------------------------- @@ -149,45 +148,67 @@ struct Device; /// Kokkos::Cuda, Kokkos::Experimental::OpenMPTarget, Kokkos::OpenMP, /// Kokkos::Threads, Kokkos::Serial +#if defined(__clang_analyzer__) +#define KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION \ + [[clang::annotate("DefaultExecutionSpace")]] +#define KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION \ + [[clang::annotate("DefaultHostExecutionSpace")]] +#else +#define KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION +#define KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION +#endif + namespace Kokkos { #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA) -typedef Cuda DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Cuda; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMPTARGET) -typedef Experimental::OpenMPTarget DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = + Experimental::OpenMPTarget; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HIP) -typedef Experimental::HIP DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = + Experimental::HIP; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_ROCM) -typedef Experimental::ROCm DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = + Experimental::ROCm; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) -typedef OpenMP DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = OpenMP; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS) -typedef Threads DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Threads; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HPX) -typedef Kokkos::Experimental::HPX DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = + Kokkos::Experimental::HPX; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL) -typedef Serial DefaultExecutionSpace; +using DefaultExecutionSpace KOKKOS_IMPL_DEFAULT_EXEC_SPACE_ANNOTATION = Serial; #else #error \ "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::Cuda, Kokkos::Experimental::HIP, Kokkos::Experimental::OpenMPTarget, Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." #endif #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) -typedef OpenMP DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + OpenMP; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS) -typedef Threads DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + Threads; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HPX) -typedef Kokkos::Experimental::HPX DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + Kokkos::Experimental::HPX; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL) -typedef Serial DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + Serial; #elif defined(KOKKOS_ENABLE_OPENMP) -typedef OpenMP DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + OpenMP; #elif defined(KOKKOS_ENABLE_THREADS) -typedef Threads DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + Threads; #elif defined(KOKKOS_ENABLE_HPX) -typedef Kokkos::Experimental::HPX DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + Kokkos::Experimental::HPX; #elif defined(KOKKOS_ENABLE_SERIAL) -typedef Serial DefaultHostExecutionSpace; +using DefaultHostExecutionSpace KOKKOS_IMPL_DEFAULT_HOST_EXEC_SPACE_ANNOTATION = + Serial; #else #error \ "At least one of the following execution spaces must be defined in order to use Kokkos: Kokkos::OpenMP, Kokkos::Threads, Kokkos::Experimental::HPX, or Kokkos::Serial." @@ -206,15 +227,15 @@ namespace Impl { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA) && \ defined(KOKKOS_ENABLE_CUDA) -typedef Kokkos::CudaSpace ActiveExecutionMemorySpace; +using ActiveExecutionMemorySpace = Kokkos::CudaSpace; #elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_ROCM_GPU) -typedef Kokkos::HostSpace ActiveExecutionMemorySpace; +using ActiveExecutionMemorySpace = Kokkos::HostSpace; #elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU) -typedef Kokkos::Experimental::HIPSpace ActiveExecutionMemorySpace; +using ActiveExecutionMemorySpace = Kokkos::Experimental::HIPSpace; #elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) -typedef Kokkos::HostSpace ActiveExecutionMemorySpace; +using ActiveExecutionMemorySpace = Kokkos::HostSpace; #else -typedef void ActiveExecutionMemorySpace; +using ActiveExecutionMemorySpace = void; #endif template @@ -250,31 +271,22 @@ void fence(); namespace Kokkos { +template +class View; + namespace Impl { template struct DeepCopy; -template -struct ViewFillETIAvail; - template ::value> + int Rank = ViewType::Rank, typename iType = int64_t> struct ViewFill; template -struct ViewCopyETIAvail; - -template ::value> struct ViewCopy; template struct LOr; } // namespace Kokkos -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -namespace Kokkos { -template -struct MinMaxScalar; -template -struct MinMaxLocScalar; -template -struct ValLocScalar; - -namespace Experimental { -using Kokkos::BAnd; -using Kokkos::BOr; -using Kokkos::LAnd; -using Kokkos::LOr; -using Kokkos::Max; -using Kokkos::MaxLoc; -using Kokkos::Min; -using Kokkos::MinLoc; -using Kokkos::MinMax; -using Kokkos::MinMaxLoc; -using Kokkos::MinMaxLocScalar; -using Kokkos::MinMaxScalar; -using Kokkos::Prod; -using Kokkos::Sum; -using Kokkos::ValLocScalar; -} // namespace Experimental -} // namespace Kokkos -#endif #endif /* #ifndef KOKKOS_CORE_FWD_HPP */ diff --git a/lib/kokkos/core/src/Kokkos_Crs.hpp b/lib/kokkos/core/src/Kokkos_Crs.hpp index 3725ba2604..dfb884e514 100644 --- a/lib/kokkos/core/src/Kokkos_Crs.hpp +++ b/lib/kokkos/core/src/Kokkos_Crs.hpp @@ -45,6 +45,9 @@ #ifndef KOKKOS_CRS_HPP #define KOKKOS_CRS_HPP +#include +#include + namespace Kokkos { /// \class Crs @@ -82,22 +85,21 @@ template ::size_type> class Crs { protected: - typedef ViewTraits traits; + using traits = ViewTraits; public: - typedef DataType data_type; - typedef typename traits::array_layout array_layout; - typedef typename traits::execution_space execution_space; - typedef typename traits::memory_space memory_space; - typedef typename traits::device_type device_type; - typedef SizeType size_type; + using data_type = DataType; + using array_layout = typename traits::array_layout; + using execution_space = typename traits::execution_space; + using memory_space = typename traits::memory_space; + using device_type = typename traits::device_type; + using size_type = SizeType; - typedef Crs staticcrsgraph_type; - typedef Crs - HostMirror; - typedef View row_map_type; - typedef View entries_type; + using staticcrsgraph_type = Crs; + using HostMirror = + Crs; + using row_map_type = View; + using entries_type = View; row_map_type row_map; entries_type entries; @@ -293,9 +295,9 @@ typename OutRowMap::value_type get_crs_row_map_from_counts( template void transpose_crs(Crs& out, Crs const& in) { - typedef Crs crs_type; - typedef typename crs_type::memory_space memory_space; - typedef View counts_type; + using crs_type = Crs; + using memory_space = typename crs_type::memory_space; + using counts_type = View; { counts_type counts; Kokkos::get_crs_transpose_counts(counts, in); @@ -340,9 +342,14 @@ struct CountAndFillBase { CountAndFillBase(CrsType& crs, Functor const& f) : m_crs(crs), m_functor(f) {} }; +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_HIP) #if defined(KOKKOS_ENABLE_CUDA) +#define EXEC_SPACE Kokkos::Cuda +#elif defined(KOKKOS_ENABLE_HIP) +#define EXEC_SPACE Kokkos::Experimental::HIP +#endif template -struct CountAndFillBase { +struct CountAndFillBase { using data_type = typename CrsType::data_type; using size_type = typename CrsType::size_type; using row_map_type = typename CrsType::row_map_type; diff --git a/lib/kokkos/core/src/Kokkos_Cuda.hpp b/lib/kokkos/core/src/Kokkos_Cuda.hpp index ed51e95778..a5b2182469 100644 --- a/lib/kokkos/core/src/Kokkos_Cuda.hpp +++ b/lib/kokkos/core/src/Kokkos_Cuda.hpp @@ -118,27 +118,27 @@ class Cuda { //@{ //! Tag this class as a kokkos execution space - typedef Cuda execution_space; + using execution_space = Cuda; #if defined(KOKKOS_ENABLE_CUDA_UVM) //! This execution space's preferred memory space. - typedef CudaUVMSpace memory_space; + using memory_space = CudaUVMSpace; #else //! This execution space's preferred memory space. - typedef CudaSpace memory_space; + using memory_space = CudaSpace; #endif //! This execution space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; //! The size_type best suited for this execution space. - typedef memory_space::size_type size_type; + using size_type = memory_space::size_type; //! This execution space's preferred array layout. - typedef LayoutLeft array_layout; + using array_layout = LayoutLeft; //! - typedef ScratchMemorySpace scratch_memory_space; + using scratch_memory_space = ScratchMemorySpace; //@} //-------------------------------------------------- @@ -183,11 +183,7 @@ class Cuda { /// device have completed. static void impl_static_fence(); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static void fence(); -#else void fence() const; -#endif /** \brief Return the maximum amount of concurrency. */ static int concurrency(); @@ -199,14 +195,17 @@ class Cuda { //-------------------------------------------------- //! \name Cuda space instances - ~Cuda() = default; - Cuda(); - Cuda(Cuda&&) = default; - Cuda(const Cuda&) = default; - Cuda& operator=(Cuda&&) = default; - Cuda& operator=(const Cuda&) = default; + KOKKOS_FUNCTION Cuda(Cuda&& other) noexcept; + + KOKKOS_FUNCTION Cuda(const Cuda& other); + + KOKKOS_FUNCTION Cuda& operator=(Cuda&& other) noexcept; + + KOKKOS_FUNCTION Cuda& operator=(const Cuda& other); + + KOKKOS_FUNCTION ~Cuda() noexcept; Cuda(cudaStream_t stream); @@ -220,17 +219,6 @@ class Cuda { explicit SelectDevice(int id) : cuda_device_id(id) {} }; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - //! Free any resources being consumed by the device. - static void finalize(); - - //! Has been initialized - static int is_initialized(); - - //! Initialize, telling the CUDA run-time library which device to use. - static void initialize(const SelectDevice = SelectDevice(), - const size_t num_instances = 1); -#else //! Free any resources being consumed by the device. static void impl_finalize(); @@ -240,7 +228,6 @@ class Cuda { //! Initialize, telling the CUDA run-time library which device to use. static void impl_initialize(const SelectDevice = SelectDevice(), const size_t num_instances = 1); -#endif /// \brief Cuda device architecture of the selected device. /// @@ -271,9 +258,10 @@ class Cuda { private: Impl::CudaInternal* m_space_instance; + int* m_counter; }; -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits { @@ -281,7 +269,7 @@ struct DeviceTypeTraits { static constexpr DeviceType id = DeviceType::Cuda; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // namespace Kokkos /*--------------------------------------------------------------------------*/ diff --git a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp index 7db5dd9561..0fb7841889 100644 --- a/lib/kokkos/core/src/Kokkos_CudaSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_CudaSpace.hpp @@ -74,11 +74,11 @@ namespace Kokkos { class CudaSpace { public: //! Tag this class as a kokkos memory space - typedef CudaSpace memory_space; - typedef Kokkos::Cuda execution_space; - typedef Kokkos::Device device_type; + using memory_space = CudaSpace; + using execution_space = Kokkos::Cuda; + using device_type = Kokkos::Device; - typedef unsigned int size_type; + using size_type = unsigned int; /*--------------------------------*/ @@ -91,9 +91,14 @@ class CudaSpace { /**\brief Allocate untracked memory in the cuda space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the cuda space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return m_name; } @@ -158,10 +163,10 @@ namespace Kokkos { class CudaUVMSpace { public: //! Tag this class as a kokkos memory space - typedef CudaUVMSpace memory_space; - typedef Cuda execution_space; - typedef Kokkos::Device device_type; - typedef unsigned int size_type; + using memory_space = CudaUVMSpace; + using execution_space = Cuda; + using device_type = Kokkos::Device; + using size_type = unsigned int; /** \brief If UVM capability is available */ static bool available(); @@ -183,9 +188,14 @@ class CudaUVMSpace { /**\brief Allocate untracked memory in the cuda space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the cuda space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return m_name; } @@ -219,10 +229,10 @@ class CudaHostPinnedSpace { public: //! Tag this class as a kokkos memory space /** \brief Memory is in HostSpace so use the HostSpace::execution_space */ - typedef HostSpace::execution_space execution_space; - typedef CudaHostPinnedSpace memory_space; - typedef Kokkos::Device device_type; - typedef unsigned int size_type; + using execution_space = HostSpace::execution_space; + using memory_space = CudaHostPinnedSpace; + using device_type = Kokkos::Device; + using size_type = unsigned int; /*--------------------------------*/ @@ -235,9 +245,14 @@ class CudaHostPinnedSpace { /**\brief Allocate untracked memory in the space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return m_name; } @@ -818,7 +833,7 @@ class SharedAllocationRecord private: friend class SharedAllocationRecord; - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; @@ -897,7 +912,7 @@ template <> class SharedAllocationRecord : public SharedAllocationRecord { private: - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; @@ -971,7 +986,7 @@ template <> class SharedAllocationRecord : public SharedAllocationRecord { private: - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; diff --git a/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp b/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp index 11910138d3..17eef76038 100644 --- a/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp +++ b/lib/kokkos/core/src/Kokkos_ExecPolicy.hpp @@ -51,10 +51,7 @@ #include #include #include -#include -#if defined(KOKKOS_ENABLE_PROFILING) #include -#endif // KOKKOS_ENABLE_PROFILING //---------------------------------------------------------------------------- @@ -93,7 +90,7 @@ struct ChunkSize { template class RangePolicy : public Impl::PolicyTraits { public: - typedef Impl::PolicyTraits traits; + using traits = Impl::PolicyTraits; private: typename traits::execution_space m_space; @@ -107,9 +104,9 @@ class RangePolicy : public Impl::PolicyTraits { public: //! Tag this class as an execution policy - typedef RangePolicy execution_policy; - typedef typename traits::index_type member_type; - typedef typename traits::index_type index_type; + using execution_policy = RangePolicy; + using member_type = typename traits::index_type; + using index_type = typename traits::index_type; KOKKOS_INLINE_FUNCTION const typename traits::execution_space& space() const { return m_space; @@ -124,17 +121,13 @@ class RangePolicy : public Impl::PolicyTraits { // doesn't match. void operator()(const int&) const {} - RangePolicy(const RangePolicy&) = default; - RangePolicy(RangePolicy&&) = default; - template - RangePolicy(const RangePolicy p) { - m_space = p.m_space; - m_begin = p.m_begin; - m_end = p.m_end; - m_granularity = p.m_granularity; - m_granularity_mask = p.m_granularity_mask; - } + RangePolicy(const RangePolicy& p) + : m_space(p.m_space), + m_begin(p.m_begin), + m_end(p.m_end), + m_granularity(p.m_granularity), + m_granularity_mask(p.m_granularity_mask) {} inline RangePolicy() : m_space(), m_begin(0), m_end(0) {} @@ -241,8 +234,8 @@ class RangePolicy : public Impl::PolicyTraits { * Typically used to partition a range over a group of threads. */ struct WorkRange { - typedef typename RangePolicy::work_tag work_tag; - typedef typename RangePolicy::member_type member_type; + using work_tag = typename RangePolicy::work_tag; + using member_type = typename RangePolicy::member_type; KOKKOS_INLINE_FUNCTION member_type begin() const { return m_begin; } KOKKOS_INLINE_FUNCTION member_type end() const { return m_end; } @@ -290,10 +283,10 @@ namespace Impl { template class TeamPolicyInternal : public Impl::PolicyTraits { private: - typedef Impl::PolicyTraits traits; + using traits = Impl::PolicyTraits; public: - typedef typename traits::index_type index_type; + using index_type = typename traits::index_type; //---------------------------------------- /** \brief Query maximum team size for a given functor. @@ -367,11 +360,7 @@ class TeamPolicyInternal : public Impl::PolicyTraits { inline typename traits::index_type chunk_size() const; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - inline TeamPolicyInternal set_chunk_size(int chunk_size) const; -#else inline TeamPolicyInternal& set_chunk_size(int chunk_size); -#endif /** \brief Parallel execution of a functor calls the functor once with * each member of the execution policy. @@ -504,6 +493,9 @@ struct ScratchRequest { } }; +// Throws a runtime exception if level is not `0` or `1` +void team_policy_check_valid_storage_level_argument(int level); + /** \brief Execution policy for parallel work over a league of teams of * threads. * @@ -535,214 +527,52 @@ class TeamPolicy : public Impl::TeamPolicyInternal< typename Impl::PolicyTraits::execution_space, Properties...> { - typedef Impl::TeamPolicyInternal< + using internal_policy = Impl::TeamPolicyInternal< typename Impl::PolicyTraits::execution_space, - Properties...> - internal_policy; + Properties...>; template friend class TeamPolicy; public: - typedef Impl::PolicyTraits traits; + using traits = Impl::PolicyTraits; - typedef TeamPolicy execution_policy; + using execution_policy = TeamPolicy; - TeamPolicy& operator=(const TeamPolicy&) = default; + TeamPolicy() : internal_policy(0, AUTO) {} /** \brief Construct policy with the given instance of the execution space */ TeamPolicy(const typename traits::execution_space& space_, int league_size_request, int team_size_request, int vector_length_request = 1) : internal_policy(space_, league_size_request, team_size_request, - vector_length_request) { - first_arg = false; - } + vector_length_request) {} TeamPolicy(const typename traits::execution_space& space_, int league_size_request, const Kokkos::AUTO_t&, int vector_length_request = 1) : internal_policy(space_, league_size_request, Kokkos::AUTO(), - vector_length_request) { - first_arg = false; - } + vector_length_request) {} /** \brief Construct policy with the default instance of the execution space */ TeamPolicy(int league_size_request, int team_size_request, int vector_length_request = 1) : internal_policy(league_size_request, team_size_request, - vector_length_request) { - first_arg = false; - } + vector_length_request) {} TeamPolicy(int league_size_request, const Kokkos::AUTO_t&, int vector_length_request = 1) : internal_policy(league_size_request, Kokkos::AUTO(), - vector_length_request) { - first_arg = false; - } - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief Construct policy with the given instance of the execution space */ - template - TeamPolicy(const typename traits::execution_space&, int league_size_request, - int team_size_request, int vector_length_request, Args... args) - : internal_policy(typename traits::execution_space(), league_size_request, - team_size_request, vector_length_request) { - first_arg = false; - set(args...); - } - - template - TeamPolicy(const typename traits::execution_space&, int league_size_request, - const Kokkos::AUTO_t&, int vector_length_request, Args... args) - : internal_policy(typename traits::execution_space(), league_size_request, - Kokkos::AUTO(), vector_length_request) { - first_arg = false; - set(args...); - } - - /** \brief Construct policy with the default instance of the execution space - */ - template - TeamPolicy(int league_size_request, int team_size_request, - int vector_length_request, Args... args) - : internal_policy(league_size_request, team_size_request, - vector_length_request) { - first_arg = false; - set(args...); - } - - template - TeamPolicy(int league_size_request, const Kokkos::AUTO_t&, - int vector_length_request, Args... args) - : internal_policy(league_size_request, Kokkos::AUTO(), - vector_length_request) { - first_arg = false; - set(args...); - } - - /** \brief Construct policy with the given instance of the execution space */ - template - TeamPolicy(const typename traits::execution_space&, int league_size_request, - int team_size_request, Args... args) - : internal_policy(typename traits::execution_space(), league_size_request, - team_size_request, - Kokkos::Impl::extract_vector_length(args...)) { - first_arg = true; - set(args...); - } - - template - TeamPolicy(const typename traits::execution_space&, int league_size_request, - const Kokkos::AUTO_t&, Args... args) - : internal_policy(typename traits::execution_space(), league_size_request, - Kokkos::AUTO(), - Kokkos::Impl::extract_vector_length(args...)) { - first_arg = true; - set(args...); - } - - /** \brief Construct policy with the default instance of the execution space - */ - template - TeamPolicy(int league_size_request, int team_size_request, Args... args) - : internal_policy(league_size_request, team_size_request, - Kokkos::Impl::extract_vector_length(args...)) { - first_arg = true; - set(args...); - } - - template - TeamPolicy(int league_size_request, const Kokkos::AUTO_t&, Args... args) - : internal_policy(league_size_request, Kokkos::AUTO(), - Kokkos::Impl::extract_vector_length(args...)) { - first_arg = true; - set(args...); - } -#endif + vector_length_request) {} template - TeamPolicy(const TeamPolicy p) : internal_policy(p) { - first_arg = p.first_arg; - } + TeamPolicy(const TeamPolicy p) : internal_policy(p) {} private: - bool first_arg; - TeamPolicy(const internal_policy& p) : internal_policy(p) { - first_arg = false; - } - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - inline void set() {} -#endif + TeamPolicy(const internal_policy& p) : internal_policy(p) {} public: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - inline void set(Args...) { - static_assert( - 0 == sizeof...(Args), - "Kokkos::TeamPolicy: unhandled constructor arguments encountered."); - } - - template - inline typename std::enable_if::value>::type set( - iType, Args... args) { - if (first_arg) { - first_arg = false; - set(args...); - } else { - first_arg = false; - Kokkos::Impl::throw_runtime_exception( - "Kokkos::TeamPolicy: integer argument to constructor in illegal " - "place."); - } - } - - template - inline void set(const ChunkSize& chunksize, Args... args) { - first_arg = false; - internal_policy::internal_set_chunk_size(chunksize.value); - set(args...); - } - - template - inline void set(const ScratchRequest& scr_request, Args... args) { - first_arg = false; - internal_policy::internal_set_scratch_size( - scr_request.level, Impl::PerTeamValue(scr_request.per_team), - Impl::PerThreadValue(scr_request.per_thread)); - set(args...); - } - - inline TeamPolicy set_chunk_size(int chunk) const { - return TeamPolicy(internal_policy::set_chunk_size(chunk)); - } - - inline TeamPolicy set_scratch_size(const int& level, - const Impl::PerTeamValue& per_team) const { - return TeamPolicy(internal_policy::set_scratch_size(level, per_team)); - } - inline TeamPolicy set_scratch_size( - const int& level, const Impl::PerThreadValue& per_thread) const { - return TeamPolicy(internal_policy::set_scratch_size(level, per_thread)); - } - inline TeamPolicy set_scratch_size( - const int& level, const Impl::PerTeamValue& per_team, - const Impl::PerThreadValue& per_thread) const { - return TeamPolicy( - internal_policy::set_scratch_size(level, per_team, per_thread)); - } - inline TeamPolicy set_scratch_size(const int& level, - const Impl::PerThreadValue& per_thread, - const Impl::PerTeamValue& per_team) const { - return TeamPolicy( - internal_policy::set_scratch_size(level, per_team, per_thread)); - } - -#else inline TeamPolicy& set_chunk_size(int chunk) { static_assert(std::is_same::value, @@ -756,27 +586,31 @@ class TeamPolicy level, per_team)), internal_policy&>::value, "internal set_chunk_size should return a reference"); + + team_policy_check_valid_storage_level_argument(level); return static_cast( internal_policy::set_scratch_size(level, per_team)); } inline TeamPolicy& set_scratch_size(const int& level, const Impl::PerThreadValue& per_thread) { + team_policy_check_valid_storage_level_argument(level); return static_cast( internal_policy::set_scratch_size(level, per_thread)); } inline TeamPolicy& set_scratch_size(const int& level, const Impl::PerTeamValue& per_team, const Impl::PerThreadValue& per_thread) { + team_policy_check_valid_storage_level_argument(level); return static_cast( internal_policy::set_scratch_size(level, per_team, per_thread)); } inline TeamPolicy& set_scratch_size(const int& level, const Impl::PerThreadValue& per_thread, const Impl::PerTeamValue& per_team) { + team_policy_check_valid_storage_level_argument(level); return static_cast( internal_policy::set_scratch_size(level, per_team, per_thread)); } -#endif }; namespace Impl { @@ -803,7 +637,7 @@ struct TeamThreadRangeBoundariesStruct { } public: - typedef iType index_type; + using index_type = iType; const iType start; const iType end; enum { increment = 1 }; @@ -849,7 +683,7 @@ struct TeamVectorRangeBoundariesStruct { } public: - typedef iType index_type; + using index_type = iType; const iType start; const iType end; enum { increment = 1 }; @@ -875,7 +709,7 @@ struct TeamVectorRangeBoundariesStruct { template struct ThreadVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const index_type start; const index_type end; enum { increment = 1 }; @@ -989,7 +823,6 @@ KOKKOS_INLINE_FUNCTION_DELETED ThreadVectorRange(const TeamMemberType&, const iType& arg_begin, const iType& arg_end) = delete; -#if defined(KOKKOS_ENABLE_PROFILING) namespace Impl { template { }; } // namespace Impl -#endif /* defined KOKKOS_ENABLE_PROFILING */ } // namespace Kokkos @@ -1040,29 +872,29 @@ struct PolicyPropertyAdaptor; template struct PolicyPropertyAdaptor, RangePolicy> { - typedef RangePolicy policy_in_t; - typedef RangePolicy> - policy_out_t; + using policy_in_t = RangePolicy; + using policy_out_t = + RangePolicy>; }; template struct PolicyPropertyAdaptor, TeamPolicy> { - typedef TeamPolicy policy_in_t; - typedef TeamPolicy> - policy_out_t; + using policy_in_t = TeamPolicy; + using policy_out_t = + TeamPolicy>; }; } // namespace Impl diff --git a/lib/kokkos/core/src/Kokkos_Extents.hpp b/lib/kokkos/core/src/Kokkos_Extents.hpp index 856adf9cf9..683b76e1f9 100644 --- a/lib/kokkos/core/src/Kokkos_Extents.hpp +++ b/lib/kokkos/core/src/Kokkos_Extents.hpp @@ -45,6 +45,8 @@ #define KOKKOS_KOKKOS_EXTENTS_HPP #include +#include +#include namespace Kokkos { namespace Experimental { diff --git a/lib/kokkos/core/src/Kokkos_HBWSpace.hpp b/lib/kokkos/core/src/Kokkos_HBWSpace.hpp index ce36b018cf..0bf63ec20d 100644 --- a/lib/kokkos/core/src/Kokkos_HBWSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_HBWSpace.hpp @@ -97,8 +97,8 @@ namespace Experimental { class HBWSpace { public: //! Tag this class as a kokkos memory space - typedef HBWSpace memory_space; - typedef size_t size_type; + using memory_space = HBWSpace; + using size_type = size_t; /// \typedef execution_space /// \brief Default execution space for this memory space. @@ -107,22 +107,22 @@ class HBWSpace { /// useful for things like initializing a View (which happens in /// parallel using the View's default execution space). #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) - typedef Kokkos::OpenMP execution_space; + using execution_space = Kokkos::OpenMP; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS) - typedef Kokkos::Threads execution_space; + using execution_space = Kokkos::Threads; #elif defined(KOKKOS_ENABLE_OPENMP) - typedef Kokkos::OpenMP execution_space; + using execution_space = Kokkos::OpenMP; #elif defined(KOKKOS_ENABLE_THREADS) - typedef Kokkos::Threads execution_space; + using execution_space = Kokkos::Threads; #elif defined(KOKKOS_ENABLE_SERIAL) - typedef Kokkos::Serial execution_space; + using execution_space = Kokkos::Serial; #else #error \ "At least one of the following host execution spaces must be defined: Kokkos::OpenMP, Kokkos::Threads, or Kokkos::Serial. You might be seeing this message if you disabled the Kokkos::Serial device explicitly using the Kokkos_ENABLE_Serial:BOOL=OFF CMake option, but did not enable any of the other host execution space devices." #endif //! This memory space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; /**\brief Default memory space instance */ HBWSpace(); @@ -144,9 +144,14 @@ class HBWSpace { /**\brief Allocate untracked memory in the space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return "HBW"; } @@ -173,7 +178,7 @@ class SharedAllocationRecord private: friend Kokkos::Experimental::HBWSpace; - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; diff --git a/lib/kokkos/core/src/Kokkos_HIP.hpp b/lib/kokkos/core/src/Kokkos_HIP.hpp index 4e9325c2d2..7afda3b43e 100644 --- a/lib/kokkos/core/src/Kokkos_HIP.hpp +++ b/lib/kokkos/core/src/Kokkos_HIP.hpp @@ -60,6 +60,7 @@ #include #include #include +#include #endif #endif diff --git a/lib/kokkos/core/src/Kokkos_HIP_Space.hpp b/lib/kokkos/core/src/Kokkos_HIP_Space.hpp index 90bdb7b913..3a6b0186a3 100644 --- a/lib/kokkos/core/src/Kokkos_HIP_Space.hpp +++ b/lib/kokkos/core/src/Kokkos_HIP_Space.hpp @@ -88,9 +88,14 @@ class HIPSpace { /**\brief Allocate untracked memory in the hip space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the hip space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return "HIP"; } @@ -175,9 +180,14 @@ class HIPHostPinnedSpace { /**\brief Allocate untracked memory in the space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return "HIPHostPinned"; } @@ -519,7 +529,7 @@ template <> class SharedAllocationRecord : public SharedAllocationRecord { private: - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; @@ -570,7 +580,7 @@ template <> class SharedAllocationRecord : public SharedAllocationRecord { private: - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; @@ -645,14 +655,15 @@ class HIP { using scratch_memory_space = ScratchMemorySpace; - ~HIP() = default; HIP(); - // explicit HIP( const int instance_id ); + HIP(hipStream_t stream); - HIP(HIP&&) = default; - HIP(const HIP&) = default; - HIP& operator=(HIP&&) = default; - HIP& operator=(const HIP&) = default; + KOKKOS_FUNCTION HIP(HIP&& other) noexcept; + KOKKOS_FUNCTION HIP(HIP const& other); + KOKKOS_FUNCTION HIP& operator=(HIP&&) noexcept; + KOKKOS_FUNCTION HIP& operator=(HIP const&); + + KOKKOS_FUNCTION ~HIP() noexcept; //@} //------------------------------------ @@ -667,10 +678,18 @@ class HIP { #endif } - /** \brief Wait until all dispatched functors complete. A noop for OpenMP. */ + /** \brief Wait until all dispatched functors complete. + * + * The parallel_for or parallel_reduce dispatch of a functor may return + * asynchronously, before the functor completes. This method does not return + * until all dispatched functors on this device have completed. + */ static void impl_static_fence(); + void fence() const; + hipStream_t hip_stream() const; + /// \brief Print configuration information to the given output stream. static void print_configuration(std::ostream&, const bool detail = false); @@ -687,6 +706,7 @@ class HIP { }; int hip_device() const; + static hipDeviceProp_t const& hip_device_prop(); static void impl_initialize(const SelectDevice = SelectDevice()); @@ -694,7 +714,7 @@ class HIP { // static size_type device_arch(); - // static size_type detect_device_count(); + static size_type detect_device_count(); static int concurrency(); static const char* name(); @@ -707,16 +727,17 @@ class HIP { private: Impl::HIPInternal* m_space_instance; + int* m_counter; }; } // namespace Experimental -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits { static constexpr DeviceType id = DeviceType::HIP; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // namespace Kokkos namespace Kokkos { diff --git a/lib/kokkos/core/src/Kokkos_HPX.hpp b/lib/kokkos/core/src/Kokkos_HPX.hpp index 10354635c5..1e01764f97 100644 --- a/lib/kokkos/core/src/Kokkos_HPX.hpp +++ b/lib/kokkos/core/src/Kokkos_HPX.hpp @@ -67,7 +67,7 @@ #include #include #include -#include +#include #include #include @@ -75,6 +75,7 @@ #include #include +#include #include #include #include @@ -85,6 +86,9 @@ #include #include +#include + +#include #include #include #include @@ -112,6 +116,28 @@ #error "You have chosen an invalid value for KOKKOS_HPX_IMPLEMENTATION" #endif +// [note 1] +// +// When using the asynchronous backend and independent instances, we explicitly +// reset the shared data at the end of a parallel task (execute_task). We do +// this to avoid circular references with shared pointers that would otherwise +// never be released. +// +// The HPX instance holds shared data for the instance in a shared_ptr. One of +// the pieces of shared data is the future that we use to sequence parallel +// dispatches. When a parallel task is launched, a copy of the closure +// (ParallelFor, ParallelReduce, etc.) is captured in the task. The closure +// also holds the policy, the policy holds the HPX instance, the instance holds +// the shared data (for use of buffers in the parallel task). When attaching a +// continuation to a future, the continuation is stored in the future (shared +// state). This means that there is a cycle future -> continuation -> closure +// -> policy -> HPX -> shared data -> future. We break this by releasing the +// shared data early, as (the pointer to) the shared data will not be used +// anymore by the closure at the end of execute_task. +// +// We also mark the shared instance data as mutable so that we can reset it +// from the const execute_task member function. + namespace Kokkos { namespace Impl { class thread_buffer { @@ -177,9 +203,31 @@ namespace Experimental { class HPX { private: static bool m_hpx_initialized; - static Kokkos::Impl::thread_buffer m_buffer; + static std::atomic m_next_instance_id; + uint32_t m_instance_id = 0; + #if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) - static hpx::future m_future; + public: + enum class instance_mode { global, independent }; + instance_mode m_mode; + + private: + static std::atomic m_active_parallel_region_count; + + struct instance_data { + instance_data() = default; + instance_data(hpx::shared_future future) : m_future(future) {} + Kokkos::Impl::thread_buffer m_buffer; + hpx::shared_future m_future = hpx::make_ready_future(); + }; + + mutable std::shared_ptr m_independent_instance_data; + static instance_data m_global_instance_data; + + std::reference_wrapper m_buffer; + std::reference_wrapper> m_future; +#else + static Kokkos::Impl::thread_buffer m_global_buffer; #endif public: @@ -190,29 +238,106 @@ class HPX { using size_type = memory_space::size_type; using scratch_memory_space = ScratchMemorySpace; +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + HPX() + noexcept + : m_instance_id(0), + m_mode(instance_mode::global), + m_buffer(m_global_instance_data.m_buffer), + m_future(m_global_instance_data.m_future) {} + + HPX(instance_mode mode) + : m_instance_id(mode == instance_mode::independent ? m_next_instance_id++ + : 0), + m_mode(mode), + m_independent_instance_data(mode == instance_mode::independent + ? (new instance_data()) + : nullptr), + m_buffer(mode == instance_mode::independent + ? m_independent_instance_data->m_buffer + : m_global_instance_data.m_buffer), + m_future(mode == instance_mode::independent + ? m_independent_instance_data->m_future + : m_global_instance_data.m_future) {} + + HPX(hpx::shared_future future) + : m_instance_id(m_next_instance_id++), + m_mode(instance_mode::independent), + + m_independent_instance_data(new instance_data(future)), + m_buffer(m_independent_instance_data->m_buffer), + m_future(m_independent_instance_data->m_future) {} + + HPX(const HPX &other) + : m_instance_id(other.m_instance_id), + m_mode(other.m_mode), + m_independent_instance_data(other.m_independent_instance_data), + m_buffer(other.m_buffer), + m_future(other.m_future) {} + + HPX &operator=(const HPX &other) { + m_instance_id = + other.m_mode == instance_mode::independent ? m_next_instance_id++ : 0; + m_mode = other.m_mode; + m_independent_instance_data = other.m_independent_instance_data; + m_buffer = m_mode == instance_mode::independent + ? m_independent_instance_data->m_buffer + : m_global_instance_data.m_buffer; + m_future = m_mode == instance_mode::independent + ? m_independent_instance_data->m_future + : m_global_instance_data.m_future; + return *this; + } +#else HPX() noexcept {} +#endif + static void print_configuration(std::ostream &, const bool /* verbose */ = false) { std::cout << "HPX backend" << std::endl; } - uint32_t impl_instance_id() const noexcept { return 0; } + uint32_t impl_instance_id() const noexcept { return m_instance_id; } - static bool in_parallel(HPX const & = HPX()) noexcept { return false; } - static void impl_static_fence(HPX const & = HPX()) #if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) - { + static bool in_parallel(HPX const &instance = HPX()) noexcept { + return !instance.impl_get_future().is_ready(); + } +#else + static bool in_parallel(HPX const & = HPX()) noexcept { return false; } +#endif + +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + static void impl_decrement_active_parallel_region_count() { + --m_active_parallel_region_count; + } + + static void impl_increment_active_parallel_region_count() { + ++m_active_parallel_region_count; + } + + void impl_fence_instance() const { if (hpx::threads::get_self_ptr() == nullptr) { - hpx::threads::run_as_hpx_thread([]() { impl_get_future().wait(); }); + hpx::threads::run_as_hpx_thread([this]() { impl_get_future().wait(); }); } else { impl_get_future().wait(); } } -#else - noexcept { + + void impl_fence_all_instances() const { + hpx::util::yield_while( + []() { return m_active_parallel_region_count.load() != 0; }); } #endif - void fence() const { impl_static_fence(); } + void fence() const { +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + if (m_mode == instance_mode::global) { + impl_fence_all_instances(); + } else { + impl_fence_instance(); + } +#endif + } static bool is_asynchronous(HPX const & = HPX()) noexcept { #if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) @@ -287,53 +412,91 @@ class HPX { return hpx::get_worker_thread_num(); } - static Kokkos::Impl::thread_buffer &impl_get_buffer() noexcept { - return m_buffer; + Kokkos::Impl::thread_buffer &impl_get_buffer() const noexcept { +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + return m_buffer.get(); +#else + return m_global_buffer; +#endif } #if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) - static hpx::future &impl_get_future() noexcept { return m_future; } + hpx::shared_future &impl_get_future() const noexcept { + return m_future; + } +#endif + +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + struct KOKKOS_ATTRIBUTE_NODISCARD reset_on_exit_parallel { + HPX const &m_space; + reset_on_exit_parallel(HPX const &space) : m_space(space) {} + ~reset_on_exit_parallel() { + // See [note 1] for an explanation. m_independent_instance_data is + // marked mutable. + m_space.m_independent_instance_data.reset(); + + HPX::impl_decrement_active_parallel_region_count(); + } + }; #endif static constexpr const char *name() noexcept { return "HPX"; } }; } // namespace Experimental -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits { - constexpr static DeviceType id = DeviceType::HPX; + static constexpr DeviceType id = DeviceType::HPX; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools namespace Impl { -template -inline void dispatch_execute_task(Closure *closure) { #if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) +template +inline void dispatch_execute_task(Closure *closure, + Kokkos::Experimental::HPX const &instance, + bool force_synchronous = false) { + Kokkos::Experimental::HPX::impl_increment_active_parallel_region_count(); + if (hpx::threads::get_self_ptr() == nullptr) { - hpx::threads::run_as_hpx_thread([closure]() { - hpx::future &fut = Kokkos::Experimental::HPX::impl_get_future(); - Closure closure_copy = *closure; - fut = fut.then([closure_copy](hpx::future &&) { + hpx::threads::run_as_hpx_thread([closure, &instance]() { + hpx::shared_future &fut = instance.impl_get_future(); + Closure closure_copy = *closure; + fut = fut.then([closure_copy](hpx::shared_future &&) { closure_copy.execute_task(); }); }); } else { - hpx::future &fut = Kokkos::Experimental::HPX::impl_get_future(); - Closure closure_copy = *closure; - fut = fut.then( - [closure_copy](hpx::future &&) { closure_copy.execute_task(); }); + hpx::shared_future &fut = instance.impl_get_future(); + Closure closure_copy = *closure; + fut = fut.then([closure_copy](hpx::shared_future &&) { + closure_copy.execute_task(); + }); } + + if (force_synchronous) { + instance.fence(); + } +} #else +template +inline void dispatch_execute_task(Closure *closure, + Kokkos::Experimental::HPX const &, + bool = false) { +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::impl_increment_active_parallel_region_count(); +#endif + if (hpx::threads::get_self_ptr() == nullptr) { hpx::threads::run_as_hpx_thread([closure]() { closure->execute_task(); }); } else { closure->execute_task(); } -#endif } +#endif } // namespace Impl } // namespace Kokkos @@ -362,17 +525,74 @@ namespace Kokkos { namespace Experimental { template <> class UniqueToken { + private: + using buffer_type = Kokkos::View; + int m_count; + buffer_type m_buffer_view; + uint32_t volatile *m_buffer; + public: using execution_space = HPX; using size_type = int; - UniqueToken(execution_space const & = execution_space()) noexcept {} - // NOTE: Currently this assumes that there is no oversubscription. - // hpx::get_num_worker_threads can't be used directly because it may yield - // it's task (problematic if called after hpx::get_worker_thread_num). - int size() const noexcept { return HPX::impl_max_hardware_threads(); } - int acquire() const noexcept { return HPX::impl_hardware_thread_id(); } - void release(int) const noexcept {} + /// \brief create object size for concurrency on the given instance + /// + /// This object should not be shared between instances + UniqueToken(execution_space const & = execution_space()) noexcept + : m_count(execution_space::impl_max_hardware_threads()), + m_buffer_view(buffer_type()), + m_buffer(nullptr) {} + + UniqueToken(size_type max_size, execution_space const & = execution_space()) + : m_count(max_size > execution_space::impl_max_hardware_threads() + ? execution_space::impl_max_hardware_threads() + : max_size), + m_buffer_view( + max_size > execution_space::impl_max_hardware_threads() + ? buffer_type() + : buffer_type("UniqueToken::m_buffer_view", + ::Kokkos::Impl::concurrent_bitset::buffer_bound( + m_count))), + m_buffer(m_buffer_view.data()) {} + + /// \brief upper bound for acquired values, i.e. 0 <= value < size() + KOKKOS_INLINE_FUNCTION + int size() const noexcept { return m_count; } + + /// \brief acquire value such that 0 <= value < size() + KOKKOS_INLINE_FUNCTION + int acquire() const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (m_buffer == nullptr) { + return execution_space::impl_hardware_thread_id(); + } else { + const ::Kokkos::pair result = + ::Kokkos::Impl::concurrent_bitset::acquire_bounded( + m_buffer, m_count, ::Kokkos::Impl::clock_tic() % m_count); + + if (result.first < 0) { + ::Kokkos::abort( + "UniqueToken failure to acquire tokens, no tokens " + "available"); + } + return result.first; + } +#else + return 0; +#endif + } + + /// \brief release a value acquired by generate + KOKKOS_INLINE_FUNCTION + void release(int i) const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (m_buffer != nullptr) { + ::Kokkos::Impl::concurrent_bitset::release(m_buffer, i); + } +#else + (void)i; +#endif + } }; template <> @@ -731,9 +951,17 @@ class ParallelFor, } public: - void execute() const { Kokkos::Impl::dispatch_execute_task(this); } + void execute() const { + Kokkos::Impl::dispatch_execute_task(this, m_policy.space()); + } void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_policy.space()); +#endif + #if KOKKOS_HPX_IMPLEMENTATION == 0 using hpx::parallel::for_loop; using hpx::parallel::execution::par; @@ -809,9 +1037,15 @@ class ParallelFor, const Policy m_policy; public: - void execute() const { dispatch_execute_task(this); } + void execute() const { dispatch_execute_task(this, m_mdr_policy.space()); } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_mdr_policy.space()); +#endif + #if KOKKOS_HPX_IMPLEMENTATION == 0 using hpx::parallel::for_loop; using hpx::parallel::execution::par; @@ -1019,9 +1253,17 @@ class ParallelReduce, ReducerType, }; public: - void execute() const { dispatch_execute_task(this); } + void execute() const { + dispatch_execute_task(this, m_policy.space(), m_force_synchronous); + } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_policy.space()); +#endif + const std::size_t value_size = Analysis::value_size(ReducerConditional::select(m_functor, m_reducer)); @@ -1062,7 +1304,7 @@ class ParallelReduce, ReducerType, #elif KOKKOS_HPX_IMPLEMENTATION == 1 const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, value_size); using hpx::apply; @@ -1118,7 +1360,7 @@ class ParallelReduce, ReducerType, #elif KOKKOS_HPX_IMPLEMENTATION == 2 const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, value_size); using hpx::parallel::for_loop; @@ -1236,14 +1478,22 @@ class ParallelReduce, ReducerType, bool m_force_synchronous; public: - void execute() const { dispatch_execute_task(this); } + void execute() const { + dispatch_execute_task(this, m_mdr_policy.space(), m_force_synchronous); + } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_mdr_policy.space()); +#endif + const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); const std::size_t value_size = Analysis::value_size(ReducerConditional::select(m_functor, m_reducer)); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_mdr_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, value_size); #if KOKKOS_HPX_IMPLEMENTATION == 0 @@ -1440,14 +1690,20 @@ class ParallelScan, } public: - void execute() const { dispatch_execute_task(this); } + void execute() const { dispatch_execute_task(this, m_policy.space()); } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_policy.space()); +#endif + const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); const int value_count = Analysis::value_count(m_functor); const std::size_t value_size = Analysis::value_size(m_functor); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, 2 * value_size); using hpx::apply; @@ -1554,14 +1810,20 @@ class ParallelScanWithTotal, } public: - void execute() const { dispatch_execute_task(this); } + void execute() const { dispatch_execute_task(this, m_policy.space()); } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_policy.space()); +#endif + const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); const int value_count = Analysis::value_count(m_functor); const std::size_t value_size = Analysis::value_size(m_functor); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, 2 * value_size); using hpx::apply; @@ -1697,12 +1959,18 @@ class ParallelFor, } public: - void execute() const { dispatch_execute_task(this); } + void execute() const { dispatch_execute_task(this, m_policy.space()); } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_policy.space()); +#endif + const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, m_shared); #if KOKKOS_HPX_IMPLEMENTATION == 0 @@ -1864,14 +2132,20 @@ class ParallelReduce, } public: - void execute() const { dispatch_execute_task(this); } + void execute() const { dispatch_execute_task(this, m_policy.space()); } inline void execute_task() const { + // See [note 1] for an explanation. +#if defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH) + Kokkos::Experimental::HPX::reset_on_exit_parallel reset_on_exit( + m_policy.space()); +#endif + const int num_worker_threads = Kokkos::Experimental::HPX::concurrency(); const std::size_t value_size = Analysis::value_size(ReducerConditional::select(m_functor, m_reducer)); - thread_buffer &buffer = Kokkos::Experimental::HPX::impl_get_buffer(); + thread_buffer &buffer = m_policy.space().impl_get_buffer(); buffer.resize(num_worker_threads, value_size + m_shared); #if KOKKOS_HPX_IMPLEMENTATION == 0 diff --git a/lib/kokkos/core/src/Kokkos_HostSpace.hpp b/lib/kokkos/core/src/Kokkos_HostSpace.hpp index 5bc50c7ff0..ebbc6950d2 100644 --- a/lib/kokkos/core/src/Kokkos_HostSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_HostSpace.hpp @@ -103,8 +103,8 @@ namespace Kokkos { class HostSpace { public: //! Tag this class as a kokkos memory space - typedef HostSpace memory_space; - typedef size_t size_type; + using memory_space = HostSpace; + using size_type = size_t; /// \typedef execution_space /// \brief Default execution space for this memory space. @@ -113,26 +113,26 @@ class HostSpace { /// useful for things like initializing a View (which happens in /// parallel using the View's default execution space). #if defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP) - typedef Kokkos::OpenMP execution_space; + using execution_space = Kokkos::OpenMP; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS) - typedef Kokkos::Threads execution_space; + using execution_space = Kokkos::Threads; #elif defined(KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HPX) - typedef Kokkos::Experimental::HPX execution_space; + using execution_space = Kokkos::Experimental::HPX; #elif defined(KOKKOS_ENABLE_OPENMP) - typedef Kokkos::OpenMP execution_space; + using execution_space = Kokkos::OpenMP; #elif defined(KOKKOS_ENABLE_THREADS) - typedef Kokkos::Threads execution_space; + using execution_space = Kokkos::Threads; #elif defined(KOKKOS_ENABLE_HPX) - typedef Kokkos::Experimental::HPX execution_space; + using execution_space = Kokkos::Experimental::HPX; #elif defined(KOKKOS_ENABLE_SERIAL) - typedef Kokkos::Serial execution_space; + using execution_space = Kokkos::Serial; #else #error \ "At least one of the following host execution spaces must be defined: Kokkos::OpenMP, Kokkos::Threads, or Kokkos::Serial. You might be seeing this message if you disabled the Kokkos::Serial device explicitly using the Kokkos_ENABLE_Serial:BOOL=OFF CMake option, but did not enable any of the other host execution space devices." #endif //! This memory space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; /**\brief Default memory space instance */ HostSpace(); @@ -156,9 +156,14 @@ class HostSpace { /**\brief Allocate untracked memory in the space */ void* allocate(const size_t arg_alloc_size) const; + void* allocate(const char* arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Deallocate untracked memory in the space */ void deallocate(void* const arg_alloc_ptr, const size_t arg_alloc_size) const; + void deallocate(const char* arg_label, void* const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size = 0) const; /**\brief Return Name of the MemorySpace */ static constexpr const char* name() { return m_name; } @@ -201,16 +206,13 @@ struct HostMirror { }; public: - typedef typename std::conditional< - keep_exe && keep_mem /* Can keep whole space */ - , - S, + using Space = typename std::conditional< + keep_exe && keep_mem, S, typename std::conditional< - keep_mem /* Can keep memory space, use default Host execution space */ - , + keep_mem, Kokkos::Device, - Kokkos::HostSpace>::type>::type Space; + Kokkos::HostSpace>::type>::type; }; } // namespace Impl @@ -229,7 +231,7 @@ class SharedAllocationRecord private: friend Kokkos::HostSpace; - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; diff --git a/lib/kokkos/core/src/Kokkos_Layout.hpp b/lib/kokkos/core/src/Kokkos_Layout.hpp index d34bdb9150..aa9d999294 100644 --- a/lib/kokkos/core/src/Kokkos_Layout.hpp +++ b/lib/kokkos/core/src/Kokkos_Layout.hpp @@ -73,7 +73,7 @@ enum { ARRAY_LAYOUT_MAX_RANK = 8 }; /// major." struct LayoutLeft { //! Tag this class as a kokkos array layout - typedef LayoutLeft array_layout; + using array_layout = LayoutLeft; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; @@ -107,7 +107,7 @@ struct LayoutLeft { /// two-dimensional array, "layout right" is also called "row major." struct LayoutRight { //! Tag this class as a kokkos array layout - typedef LayoutRight array_layout; + using array_layout = LayoutRight; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; @@ -131,7 +131,7 @@ struct LayoutRight { /// multi-index mapping into contiguous memory. struct LayoutStride { //! Tag this class as a kokkos array layout - typedef LayoutStride array_layout; + using array_layout = LayoutStride; size_t dimension[ARRAY_LAYOUT_MAX_RANK]; size_t stride[ARRAY_LAYOUT_MAX_RANK]; @@ -186,58 +186,6 @@ struct LayoutStride { S4, S5, S6, S7} {} }; -// ========================================================================== -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - -//---------------------------------------------------------------------------- -/// \struct LayoutTileLeft -/// \brief Memory layout tag indicating left-to-right (Fortran scheme) -/// striding of multi-indices by tiles. -/// -/// This is an example of a \c MemoryLayout template parameter of -/// View. The memory layout describes how View maps from a -/// multi-index (i0, i1, ..., ik) to a memory location. -/// -/// "Tiled layout" indicates a mapping to contiguously stored -/// ArgN0 by ArgN1 tiles for the rightmost two -/// dimensions. Indices are LayoutLeft within each tile, and the -/// tiles themselves are arranged using LayoutLeft. Note that the -/// dimensions ArgN0 and ArgN1 of the tiles must be -/// compile-time constants. This speeds up index calculations. If -/// both tile dimensions are powers of two, Kokkos can optimize -/// further. -template -struct LayoutTileLeft { - static_assert(Impl::is_integral_power_of_two(ArgN0) && - Impl::is_integral_power_of_two(ArgN1), - "LayoutTileLeft must be given power-of-two tile dimensions"); - - //! Tag this class as a kokkos array layout - typedef LayoutTileLeft array_layout; - - enum { N0 = ArgN0 }; - enum { N1 = ArgN1 }; - - size_t dimension[ARRAY_LAYOUT_MAX_RANK]; - - enum { is_extent_constructible = true }; - - LayoutTileLeft(LayoutTileLeft const&) = default; - LayoutTileLeft(LayoutTileLeft&&) = default; - LayoutTileLeft& operator=(LayoutTileLeft const&) = default; - LayoutTileLeft& operator=(LayoutTileLeft&&) = default; - - KOKKOS_INLINE_FUNCTION - explicit constexpr LayoutTileLeft(size_t argN0 = 0, size_t argN1 = 0, - size_t argN2 = 0, size_t argN3 = 0, - size_t argN4 = 0, size_t argN5 = 0, - size_t argN6 = 0, size_t argN7 = 0) - : dimension{argN0, argN1, argN2, argN3, argN4, argN5, argN6, argN7} {} -}; - -#endif // KOKKOS_ENABLE_DEPRECATED_CODE // =================================================================================== ////////////////////////////////////////////////////////////////////////////////////// @@ -254,7 +202,6 @@ enum class Iterate { template struct is_layouttiled : std::false_type {}; -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE template struct is_layouttiled< LayoutTiledCheck, @@ -294,9 +241,8 @@ struct LayoutTiled { , "LayoutTiled must be given power-of-two tile dimensions" ); #endif - typedef LayoutTiled - array_layout; + using array_layout = LayoutTiled; static constexpr Iterate outer_pattern = OuterP; static constexpr Iterate inner_pattern = InnerP; @@ -327,7 +273,6 @@ struct LayoutTiled { }; } // namespace Experimental -#endif // For use with view_copy template @@ -358,7 +303,6 @@ struct layout_iterate_type_selector { Kokkos::Iterate::Default; }; -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE template struct layout_iterate_type_selector #endif -#include - //---------------------------------------------------------------------------- /** Pick up compiler specific #define macros: * @@ -99,13 +97,6 @@ //---------------------------------------------------------------------------- -#if defined(KOKKOS_ENABLE_SERIAL) || defined(KOKKOS_ENABLE_THREADS) || \ - defined(KOKKOS_ENABLE_OPENMP) || defined(KOKKOS_ENABLE_HPX) || \ - defined(KOKKOS_ENABLE_ROCM) || defined(KOKKOS_ENABLE_OPENMPTARGET) || \ - defined(KOKKOS_ENABLE_HIP) -#define KOKKOS_INTERNAL_ENABLE_NON_CUDA_BACKEND -#endif - #if !defined(KOKKOS_ENABLE_THREADS) && !defined(KOKKOS_ENABLE_CUDA) && \ !defined(KOKKOS_ENABLE_OPENMP) && !defined(KOKKOS_ENABLE_HPX) && \ !defined(KOKKOS_ENABLE_ROCM) && !defined(KOKKOS_ENABLE_OPENMPTARGET) && \ @@ -127,6 +118,10 @@ #include #include +#if defined(_WIN32) +#define KOKKOS_IMPL_WINDOWS_CUDA +#endif + #if !defined(CUDA_VERSION) #error "#include did not define CUDA_VERSION." #endif @@ -154,7 +149,8 @@ #define KOKKOS_ENABLE_PRE_CUDA_10_DEPRECATION_API #endif -#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700) +#if defined(__CUDA_ARCH__) && (__CUDA_ARCH__ >= 700) && \ + !defined(KOKKOS_IMPL_WINDOWS_CUDA) // PTX atomics with memory order semantics are only available on volta and later #if !defined(KOKKOS_DISABLE_CUDA_ASM) #if !defined(KOKKOS_ENABLE_CUDA_ASM) @@ -170,8 +166,6 @@ #if defined(KOKKOS_ENABLE_HIP) -#define KOKKOS_IMPL_HIP_CLANG_WORKAROUND - #define HIP_ENABLE_PRINTF #include #include @@ -205,6 +199,8 @@ #if defined(__INTEL_COMPILER) #define KOKKOS_COMPILER_INTEL __INTEL_COMPILER +#elif defined(__INTEL_LLVM_COMPILER) +#define KOKKOS_COMPILER_INTEL __INTEL_LLVM_COMPILER #elif defined(__ICC) // Old define #define KOKKOS_COMPILER_INTEL __ICC @@ -263,10 +259,12 @@ #if defined(KOKKOS_ENABLE_CUDA) // Compiling Cuda code to 'ptx' -#define KOKKOS_FORCEINLINE_FUNCTION __device__ __host__ __forceinline__ +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION __device__ __host__ __forceinline__ #define KOKKOS_IMPL_FORCEINLINE __forceinline__ -#define KOKKOS_INLINE_FUNCTION __device__ __host__ inline -#define KOKKOS_FUNCTION __device__ __host__ +#define KOKKOS_IMPL_INLINE_FUNCTION __device__ __host__ inline +#define KOKKOS_IMPL_FUNCTION __device__ __host__ +#define KOKKOS_IMPL_HOST_FUNCTION __host__ +#define KOKKOS_IMPL_DEVICE_FUNCTION __device__ #if defined(KOKKOS_COMPILER_NVCC) #define KOKKOS_INLINE_FUNCTION_DELETED inline #else @@ -277,15 +275,19 @@ #else #define KOKKOS_DEFAULTED_FUNCTION inline #endif +#define KOKKOS_IMPL_HOST_FUNCTION __host__ +#define KOKKOS_IMPL_DEVICE_FUNCTION __device__ #endif #if defined(KOKKOS_ENABLE_HIP) -#define KOKKOS_FORCEINLINE_FUNCTION __device__ __host__ __forceinline__ -#define KOKKOS_INLINE_FUNCTION __device__ __host__ inline +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION __device__ __host__ __forceinline__ +#define KOKKOS_IMPL_INLINE_FUNCTION __device__ __host__ inline #define KOKKOS_DEFAULTED_FUNCTION __device__ __host__ inline #define KOKKOS_INLINE_FUNCTION_DELETED __device__ __host__ inline -#define KOKKOS_FUNCTION __device__ __host__ +#define KOKKOS_IMPL_FUNCTION __device__ __host__ +#define KOKKOS_IMPL_HOST_FUNCTION __host__ +#define KOKKOS_IMPL_DEVICE_FUNCTION __device__ #if defined(KOKKOS_ENABLE_CXX17) || defined(KOKKOS_ENABLE_CXX20) #define KOKKOS_CLASS_LAMBDA [ =, *this ] __host__ __device__ #endif @@ -293,9 +295,9 @@ #if defined(KOKKOS_ENABLE_ROCM) && defined(__HCC__) -#define KOKKOS_FORCEINLINE_FUNCTION __attribute__((amp, cpu)) inline -#define KOKKOS_INLINE_FUNCTION __attribute__((amp, cpu)) inline -#define KOKKOS_FUNCTION __attribute__((amp, cpu)) +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION __attribute__((amp, cpu)) inline +#define KOKKOS_IMPL_INLINE_FUNCTION __attribute__((amp, cpu)) inline +#define KOKKOS_IMPL_FUNCTION __attribute__((amp, cpu)) #define KOKKOS_LAMBDA [=] __attribute__((amp, cpu)) #define KOKKOS_DEFAULTED_FUNCTION __attribute__((amp, cpu)) inline #endif @@ -346,12 +348,12 @@ #define KOKKOS_ENABLE_ASM 1 #endif -#if !defined(KOKKOS_FORCEINLINE_FUNCTION) +#if !defined(KOKKOS_IMPL_FORCEINLINE_FUNCTION) #if !defined(_WIN32) -#define KOKKOS_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) #define KOKKOS_IMPL_FORCEINLINE __attribute__((always_inline)) #else -#define KOKKOS_FORCEINLINE_FUNCTION inline +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION inline #endif #endif @@ -402,8 +404,8 @@ //#define KOKKOS_ENABLE_PRAGMA_VECTOR 1 //#define KOKKOS_ENABLE_PRAGMA_SIMD 1 -#if !defined(KOKKOS_FORCEINLINE_FUNCTION) -#define KOKKOS_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) +#if !defined(KOKKOS_IMPL_FORCEINLINE_FUNCTION) +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) #define KOKKOS_IMPL_FORCEINLINE __attribute__((always_inline)) #endif @@ -427,8 +429,8 @@ #define KOKKOS_ENABLE_RFO_PREFETCH 1 #endif -#if !defined(KOKKOS_FORCEINLINE_FUNCTION) -#define KOKKOS_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) +#if !defined(KOKKOS_IMPL_FORCEINLINE_FUNCTION) +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION inline __attribute__((always_inline)) #define KOKKOS_IMPL_FORCEINLINE __attribute__((always_inline)) #endif @@ -462,20 +464,20 @@ //---------------------------------------------------------------------------- // Define function marking macros if compiler specific macros are undefined: -#if !defined(KOKKOS_FORCEINLINE_FUNCTION) -#define KOKKOS_FORCEINLINE_FUNCTION inline +#if !defined(KOKKOS_IMPL_FORCEINLINE_FUNCTION) +#define KOKKOS_IMPL_FORCEINLINE_FUNCTION inline #endif #if !defined(KOKKOS_IMPL_FORCEINLINE) #define KOKKOS_IMPL_FORCEINLINE inline #endif -#if !defined(KOKKOS_INLINE_FUNCTION) -#define KOKKOS_INLINE_FUNCTION inline +#if !defined(KOKKOS_IMPL_INLINE_FUNCTION) +#define KOKKOS_IMPL_INLINE_FUNCTION inline #endif -#if !defined(KOKKOS_FUNCTION) -#define KOKKOS_FUNCTION /**/ +#if !defined(KOKKOS_IMPL_FUNCTION) +#define KOKKOS_IMPL_FUNCTION /**/ #endif #if !defined(KOKKOS_INLINE_FUNCTION_DELETED) @@ -485,6 +487,33 @@ #if !defined(KOKKOS_DEFAULTED_FUNCTION) #define KOKKOS_DEFAULTED_FUNCTION inline #endif + +#if !defined(KOKKOS_IMPL_HOST_FUNCTION) +#define KOKKOS_IMPL_HOST_FUNCTION +#endif + +#if !defined(KOKKOS_IMPL_DEVICE_FUNCTION) +#define KOKKOS_IMPL_DEVICE_FUNCTION +#endif + +//---------------------------------------------------------------------------- +// Define final version of functions. This is so that clang tidy can find these +// macros more easily +#if defined(__clang_analyzer__) +#define KOKKOS_FUNCTION \ + KOKKOS_IMPL_FUNCTION __attribute__((annotate("KOKKOS_FUNCTION"))) +#define KOKKOS_INLINE_FUNCTION \ + KOKKOS_IMPL_INLINE_FUNCTION \ + __attribute__((annotate("KOKKOS_INLINE_FUNCTION"))) +#define KOKKOS_FORCEINLINE_FUNCTION \ + KOKKOS_IMPL_FORCEINLINE_FUNCTION \ + __attribute__((annotate("KOKKOS_FORCEINLINE_FUNCTION"))) +#else +#define KOKKOS_FUNCTION KOKKOS_IMPL_FUNCTION +#define KOKKOS_INLINE_FUNCTION KOKKOS_IMPL_INLINE_FUNCTION +#define KOKKOS_FORCEINLINE_FUNCTION KOKKOS_IMPL_FORCEINLINE_FUNCTION +#endif + //---------------------------------------------------------------------------- // Define empty macro for restrict if necessary: @@ -536,6 +565,11 @@ #define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA #elif defined(KOKKOS_ENABLE_HIP) #define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_HIP +#if defined(__HIP__) +// mark that HIP-clang can use __host__ and __device__ +// as valid overload criteria +#define KOKKOS_IMPL_ENABLE_OVERLOAD_HOST_DEVICE +#endif #elif defined(KOKKOS_ENABLE_ROCM) #define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_ROCM #elif defined(KOKKOS_ENABLE_OPENMPTARGET) @@ -558,8 +592,7 @@ #elif defined(__HCC__) && defined(__HCC_ACCELERATOR__) && \ defined(KOKKOS_ENABLE_ROCM) #define KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_ROCM_GPU -#elif defined(__HIPCC__) && \ - (defined(__HCC_ACCELERATOR__) || defined(__CUDA_ARCH__)) && \ +#elif defined(__HIPCC__) && defined(__HIP_DEVICE_COMPILE__) && \ defined(KOKKOS_ENABLE_HIP) #define KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HIP_GPU #else @@ -598,11 +631,7 @@ #define KOKKOS_INVALID_INDEX (~std::size_t(0)) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#define KOKKOS_IMPL_CTOR_DEFAULT_ARG 0 -#else #define KOKKOS_IMPL_CTOR_DEFAULT_ARG KOKKOS_INVALID_INDEX -#endif #if (defined(KOKKOS_ENABLE_CXX14) || defined(KOKKOS_ENABLE_CXX17) || \ defined(KOKKOS_ENABLE_CXX20)) @@ -633,8 +662,9 @@ #define KOKKOS_ATTRIBUTE_NODISCARD #endif -#if defined(KOKKOS_COMPILER_GNU) || defined(KOKKOS_COMPILER_CLANG) || \ - defined(KOKKOS_COMPILER_INTEL) || defined(KOKKOS_COMPILER_PGI) +#if (defined(KOKKOS_COMPILER_GNU) || defined(KOKKOS_COMPILER_CLANG) || \ + defined(KOKKOS_COMPILER_INTEL) || defined(KOKKOS_COMPILER_PGI)) && \ + !defined(KOKKOS_COMPILER_MSVC) #define KOKKOS_IMPL_ENABLE_STACKTRACE #define KOKKOS_IMPL_ENABLE_CXXABI #endif @@ -652,4 +682,13 @@ #define KOKKOS_THREAD_LOCAL __thread #endif +#if defined(KOKKOS_IMPL_WINDOWS_CUDA) || defined(KOKKOS_COMPILER_MSVC) +// MSVC (as of 16.5.5 at least) does not do empty base class optimization by +// default when there are multiple bases, even though the standard requires it +// for standard layout types. +#define KOKKOS_IMPL_ENFORCE_EMPTY_BASE_OPTIMIZATION __declspec(empty_bases) +#else +#define KOKKOS_IMPL_ENFORCE_EMPTY_BASE_OPTIMIZATION +#endif + #endif // #ifndef KOKKOS_MACROS_HPP diff --git a/lib/kokkos/core/src/Kokkos_MemoryPool.hpp b/lib/kokkos/core/src/Kokkos_MemoryPool.hpp index da07544701..042ad6d902 100644 --- a/lib/kokkos/core/src/Kokkos_MemoryPool.hpp +++ b/lib/kokkos/core/src/Kokkos_MemoryPool.hpp @@ -52,6 +52,8 @@ #include #include +#include + namespace Kokkos { namespace Impl { /* Report violation of size constraints: @@ -73,10 +75,19 @@ void memory_pool_bounds_verification(size_t min_block_alloc_size, namespace Kokkos { +namespace Impl { + +void _print_memory_pool_state(std::ostream &s, uint32_t const *sb_state_ptr, + int32_t sb_count, uint32_t sb_size_lg2, + uint32_t sb_state_size, uint32_t state_shift, + uint32_t state_used_mask); + +} // end namespace Impl + template class MemoryPool { private: - typedef typename Kokkos::Impl::concurrent_bitset CB; + using CB = Kokkos::Impl::concurrent_bitset; enum : uint32_t { bits_per_int_lg2 = CB::bits_per_int_lg2 }; enum : uint32_t { state_shift = CB::state_shift }; @@ -107,15 +118,15 @@ class MemoryPool { * Thus A_block_size < B_block_size <=> A_block_state > B_block_state */ - typedef typename DeviceType::memory_space base_memory_space; + using base_memory_space = typename DeviceType::memory_space; enum { accessible = Kokkos::Impl::MemorySpaceAccess::accessible }; - typedef Kokkos::Impl::SharedAllocationTracker Tracker; - typedef Kokkos::Impl::SharedAllocationRecord Record; + using Tracker = Kokkos::Impl::SharedAllocationTracker; + using Record = Kokkos::Impl::SharedAllocationRecord; Tracker m_tracker; uint32_t *m_sb_state_array; @@ -231,24 +242,9 @@ class MemoryPool { sb_state_array, m_sb_state_array, alloc_size); } - const uint32_t *sb_state_ptr = sb_state_array; - - s << "pool_size(" << (size_t(m_sb_count) << m_sb_size_lg2) << ")" - << " superblock_size(" << (1LU << m_sb_size_lg2) << ")" << std::endl; - - for (int32_t i = 0; i < m_sb_count; ++i, sb_state_ptr += m_sb_state_size) { - if (*sb_state_ptr) { - const uint32_t block_count_lg2 = (*sb_state_ptr) >> state_shift; - const uint32_t block_size_lg2 = m_sb_size_lg2 - block_count_lg2; - const uint32_t block_count = 1u << block_count_lg2; - const uint32_t block_used = (*sb_state_ptr) & state_used_mask; - - s << "Superblock[ " << i << " / " << m_sb_count << " ] {" - << " block_size(" << (1 << block_size_lg2) << ")" - << " block_count( " << block_used << " / " << block_count << " )" - << std::endl; - } - } + Impl::_print_memory_pool_state(s, sb_state_array, m_sb_count, m_sb_size_lg2, + m_sb_state_size, state_shift, + state_used_mask); if (!accessible) { host.deallocate(sb_state_array, alloc_size); diff --git a/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp b/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp index 75d3d40144..f23442b793 100644 --- a/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp +++ b/lib/kokkos/core/src/Kokkos_MemoryTraits.hpp @@ -71,18 +71,7 @@ enum MemoryTraitsFlags { template struct MemoryTraits { //! Tag this class as a kokkos memory traits: - typedef MemoryTraits memory_traits; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - enum : bool { - Unmanaged = (unsigned(0) != (T & unsigned(Kokkos::Unmanaged))) - }; - enum : bool { - RandomAccess = (unsigned(0) != (T & unsigned(Kokkos::RandomAccess))) - }; - enum : bool { Atomic = (unsigned(0) != (T & unsigned(Kokkos::Atomic))) }; - enum : bool { Restrict = (unsigned(0) != (T & unsigned(Kokkos::Restrict))) }; - enum : bool { Aligned = (unsigned(0) != (T & unsigned(Kokkos::Aligned))) }; -#endif + using memory_traits = MemoryTraits; enum : bool { is_unmanaged = (unsigned(0) != (T & unsigned(Kokkos::Unmanaged))) }; @@ -102,10 +91,10 @@ struct MemoryTraits { namespace Kokkos { -typedef Kokkos::MemoryTraits<0> MemoryManaged; -typedef Kokkos::MemoryTraits MemoryUnmanaged; -typedef Kokkos::MemoryTraits - MemoryRandomAccess; +using MemoryManaged = Kokkos::MemoryTraits<0>; +using MemoryUnmanaged = Kokkos::MemoryTraits; +using MemoryRandomAccess = + Kokkos::MemoryTraits; } // namespace Kokkos diff --git a/lib/kokkos/core/src/Kokkos_NumericTraits.hpp b/lib/kokkos/core/src/Kokkos_NumericTraits.hpp index 88040bcbaa..7d55a96523 100644 --- a/lib/kokkos/core/src/Kokkos_NumericTraits.hpp +++ b/lib/kokkos/core/src/Kokkos_NumericTraits.hpp @@ -45,6 +45,7 @@ #ifndef KOKKOS_NUMERICTRAITS_HPP #define KOKKOS_NUMERICTRAITS_HPP +#include #include #include diff --git a/lib/kokkos/core/src/Kokkos_OpenMP.hpp b/lib/kokkos/core/src/Kokkos_OpenMP.hpp index d9b9077c6d..f5200e1e21 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMP.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMP.hpp @@ -63,6 +63,7 @@ #include #include #include +#include #include @@ -105,11 +106,7 @@ class OpenMP { /// This is a no-op on OpenMP static void impl_static_fence(OpenMP const& = OpenMP()) noexcept; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static void fence(OpenMP const& = OpenMP()) noexcept; -#else void fence() const; -#endif /// \brief Does the given instance return immediately after launching /// a parallel algorithm @@ -142,58 +139,6 @@ class OpenMP { // use UniqueToken static int concurrency(); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /// \brief Initialize the default execution space - static void initialize(int thread_count, int use_numa_count, - int use_cores_per_numa = 0); - - /// \brief Initialize the default execution space - /// - /// if ( thread_count == -1 ) - /// then use the number of threads that openmp defaults to - /// if ( thread_count == 0 && Kokkos::hwlow_available() ) - /// then use hwloc to choose the number of threads and change - /// the default number of threads - /// if ( thread_count > 0 ) - /// then force openmp to use the given number of threads and change - /// the default number of threads - static void initialize(int thread_count = -1); - - /// \brief is the default execution space initialized for current 'master' - /// thread - static bool is_initialized() noexcept; - - /// \brief Free any resources being consumed by the default execution space - static void finalize(); - - inline static int thread_pool_size() noexcept; - - /** \brief The rank of the executing thread in this thread pool */ - KOKKOS_INLINE_FUNCTION - static int thread_pool_rank() noexcept; - - inline static int thread_pool_size(int depth); - - static void sleep(){}; - static void wake(){}; - - // Using omp_get_max_threads(); is problematic - // On Intel (essentially an initial call to the OpenMP runtime - // without a parallel region before will set a process mask for a single core - // The runtime will than bind threads for a parallel region to other cores on - // the entering the first parallel region and make the process mask the - // aggregate of the thread masks. The intend seems to be to make serial code - // run fast, if you compile with OpenMP enabled but don't actually use - // parallel regions or so static int omp_max_threads = omp_get_max_threads(); - static int get_current_max_threads() noexcept; - - // use UniqueToken - inline static int max_hardware_threads() noexcept; - - // use UniqueToken - KOKKOS_INLINE_FUNCTION - static int hardware_thread_id() noexcept; -#else static void impl_initialize(int thread_count = -1); /// \brief is the default execution space initialized for current 'master' @@ -219,20 +164,19 @@ class OpenMP { static int impl_hardware_thread_id() noexcept; static int impl_get_current_max_threads() noexcept; -#endif static constexpr const char* name() noexcept { return "OpenMP"; } uint32_t impl_instance_id() const noexcept { return 0; } }; -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits { static constexpr DeviceType id = DeviceType::OpenMP; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // namespace Kokkos /*--------------------------------------------------------------------------*/ diff --git a/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp b/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp index e853b8228d..78f7831cea 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMPTarget.hpp @@ -78,15 +78,15 @@ class OpenMPTarget { //@{ //! Tag this class as a kokkos execution space - typedef OpenMPTarget execution_space; - typedef OpenMPTargetSpace memory_space; + using execution_space = OpenMPTarget; + using memory_space = OpenMPTargetSpace; //! This execution space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; - typedef LayoutLeft array_layout; - typedef memory_space::size_type size_type; + using array_layout = LayoutLeft; + using size_type = memory_space::size_type; - typedef ScratchMemorySpace scratch_memory_space; + using scratch_memory_space = ScratchMemorySpace; inline static bool in_parallel() { return omp_in_parallel(); } @@ -121,7 +121,7 @@ class OpenMPTarget { }; } // namespace Experimental -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits<::Kokkos::Experimental::OpenMPTarget> { @@ -129,7 +129,7 @@ struct DeviceTypeTraits<::Kokkos::Experimental::OpenMPTarget> { ::Kokkos::Profiling::Experimental::DeviceType::OpenMPTarget; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // namespace Kokkos /*--------------------------------------------------------------------------*/ diff --git a/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp b/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp index 9d24a342e7..15ac8c1903 100644 --- a/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_OpenMPTargetSpace.hpp @@ -98,8 +98,8 @@ namespace Experimental { class OpenMPTargetSpace { public: //! Tag this class as a kokkos memory space - typedef OpenMPTargetSpace memory_space; - typedef size_t size_type; + using memory_space = OpenMPTargetSpace; + using size_type = size_t; /// \typedef execution_space /// \brief Default execution space for this memory space. @@ -107,10 +107,10 @@ class OpenMPTargetSpace { /// Every memory space has a default execution space. This is /// useful for things like initializing a View (which happens in /// parallel using the View's default execution space). - typedef Kokkos::Experimental::OpenMPTarget execution_space; + using execution_space = Kokkos::Experimental::OpenMPTarget; //! This memory space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; /*--------------------------------*/ @@ -149,7 +149,7 @@ class SharedAllocationRecord private: friend Kokkos::Experimental::OpenMPTargetSpace; - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; diff --git a/lib/kokkos/core/src/Kokkos_Pair.hpp b/lib/kokkos/core/src/Kokkos_Pair.hpp index 23bb755e33..d7512eb086 100644 --- a/lib/kokkos/core/src/Kokkos_Pair.hpp +++ b/lib/kokkos/core/src/Kokkos_Pair.hpp @@ -64,9 +64,9 @@ namespace Kokkos { template struct pair { //! The first template parameter of this class. - typedef T1 first_type; + using first_type = T1; //! The second template parameter of this class. - typedef T2 second_type; + using second_type = T2; //! The first element of the pair. first_type first; @@ -156,9 +156,9 @@ struct pair { template struct pair { //! The first template parameter of this class. - typedef T1& first_type; + using first_type = T1&; //! The second template parameter of this class. - typedef T2& second_type; + using second_type = T2&; //! The first element of the pair. first_type first; @@ -213,9 +213,9 @@ struct pair { template struct pair { //! The first template parameter of this class. - typedef T1 first_type; + using first_type = T1; //! The second template parameter of this class. - typedef T2& second_type; + using second_type = T2&; //! The first element of the pair. first_type first; @@ -270,9 +270,9 @@ struct pair { template struct pair { //! The first template parameter of this class. - typedef T1& first_type; + using first_type = T1&; //! The second template parameter of this class. - typedef T2 second_type; + using second_type = T2; //! The first element of the pair. first_type first; @@ -426,8 +426,8 @@ KOKKOS_FORCEINLINE_FUNCTION pair tie(T1& x, T2& y) { // template struct pair { - typedef T1 first_type; - typedef void second_type; + using first_type = T1; + using second_type = void; first_type first; enum { second = 0 }; diff --git a/lib/kokkos/core/src/Kokkos_Parallel.hpp b/lib/kokkos/core/src/Kokkos_Parallel.hpp index 775ab9203c..9086b19efe 100644 --- a/lib/kokkos/core/src/Kokkos_Parallel.hpp +++ b/lib/kokkos/core/src/Kokkos_Parallel.hpp @@ -53,17 +53,15 @@ #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include +#include #include -#endif #include #include #include #include -#ifdef KOKKOS_DEBUG +#ifdef KOKKOS_ENABLE_DEBUG_PRINT_KERNEL_NAMES #include #endif @@ -83,7 +81,7 @@ namespace Impl { */ template struct FunctorPolicyExecutionSpace { - typedef Kokkos::DefaultExecutionSpace execution_space; + using execution_space = Kokkos::DefaultExecutionSpace; }; template @@ -91,7 +89,7 @@ struct FunctorPolicyExecutionSpace< Functor, Policy, typename enable_if_type::type, typename enable_if_type::type> { - typedef typename Policy ::execution_space execution_space; + using execution_space = typename Policy::execution_space; }; template @@ -99,14 +97,14 @@ struct FunctorPolicyExecutionSpace< Functor, Policy, typename enable_if_type::type, typename enable_if_type::type> { - typedef typename Policy ::execution_space execution_space; + using execution_space = typename Policy::execution_space; }; template struct FunctorPolicyExecutionSpace< Functor, Policy, EnableFunctor, typename enable_if_type::type> { - typedef typename Policy ::execution_space execution_space; + using execution_space = typename Policy::execution_space; }; template @@ -114,7 +112,7 @@ struct FunctorPolicyExecutionSpace< Functor, Policy, typename enable_if_type::type, EnablePolicy> { - typedef typename Functor::device_type::execution_space execution_space; + using execution_space = typename Functor::device_type::execution_space; }; template @@ -122,7 +120,7 @@ struct FunctorPolicyExecutionSpace< Functor, Policy, typename enable_if_type::type, EnablePolicy> { - typedef typename Functor::execution_space execution_space; + using execution_space = typename Functor::execution_space; }; } // namespace Impl @@ -137,12 +135,12 @@ namespace Kokkos { * * A "functor" is a class containing the function to execute in parallel, * data needed for that execution, and an optional \c execution_space - * typedef. Here is an example functor for parallel_for: + * alias. Here is an example functor for parallel_for: * * \code * class FunctorType { * public: - * typedef ... execution_space ; + * using execution_space = ...; * void operator() ( WorkType iwork ) const ; * }; * \endcode @@ -161,7 +159,6 @@ inline void parallel_for( typename std::enable_if< Kokkos::Impl::is_execution_policy::value>::type* = nullptr) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName closure(functor, policy); @@ -181,21 +175,19 @@ inline void parallel_for( closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelFor(kpID); } -#endif } template inline void parallel_for(const size_t work_count, const FunctorType& functor, const std::string& str = "") { - typedef typename Impl::FunctorPolicyExecutionSpace< - FunctorType, void>::execution_space execution_space; - typedef RangePolicy policy; + using execution_space = + typename Impl::FunctorPolicyExecutionSpace::execution_space; + using policy = RangePolicy; -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName name(str); @@ -203,9 +195,6 @@ inline void parallel_for(const size_t work_count, const FunctorType& functor, name.get(), Kokkos::Profiling::Experimental::device_id(policy().space()), &kpID); } -#else - (void)str; -#endif Kokkos::Impl::shared_allocation_tracking_disable(); Impl::ParallelFor closure(functor, @@ -214,11 +203,9 @@ inline void parallel_for(const size_t work_count, const FunctorType& functor, closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelFor(kpID); } -#endif } template @@ -273,11 +260,11 @@ namespace Kokkos { /// class ScanFunctor { /// public: /// // The Kokkos device type -/// typedef ... execution_space; +/// using execution_space = ...; /// // Type of an entry of the array containing the result; /// // also the type of each of the entries combined using /// // operator() or join(). -/// typedef PodType value_type; +/// using value_type = PodType; /// /// void operator () (const ExecPolicy::member_type & i, value_type& update, /// const bool final_pass) const; void init (value_type& update) const; void @@ -293,9 +280,9 @@ namespace Kokkos { /// template /// class InclScanFunctor { /// public: -/// typedef SpaceType execution_space; -/// typedef int value_type; -/// typedef typename SpaceType::size_type size_type; +/// using execution_space = SpaceType; +/// using value_type = int; +/// using size_type = typename SpaceType::size_type; /// /// InclScanFunctor( Kokkos::View x /// , Kokkos::View y ) : m_x(x), @@ -332,9 +319,9 @@ namespace Kokkos { /// template /// class ExclScanFunctor { /// public: -/// typedef SpaceType execution_space; -/// typedef int value_type; -/// typedef typename SpaceType::size_type size_type; +/// using execution_space = SpaceType; +/// using value_type = int; +/// using size_type = typename SpaceType::size_type; /// /// ExclScanFunctor (Kokkos::View x) : x_ (x) {} /// @@ -370,9 +357,9 @@ namespace Kokkos { /// template /// class OffsetScanFunctor { /// public: -/// typedef SpaceType execution_space; -/// typedef int value_type; -/// typedef typename SpaceType::size_type size_type; +/// using execution_space = SpaceType; +/// using value_type = int; +/// using size_type = typename SpaceType::size_type; /// /// // lastIndex_ is the last valid index (zero-based) of x. /// // If x has length zero, then lastIndex_ won't be used anyway. @@ -415,7 +402,6 @@ inline void parallel_scan( typename std::enable_if< Kokkos::Impl::is_execution_policy::value>::type* = nullptr) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName closure(functor, policy); @@ -435,22 +418,20 @@ inline void parallel_scan( closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelScan(kpID); } -#endif } template inline void parallel_scan(const size_t work_count, const FunctorType& functor, const std::string& str = "") { - typedef typename Kokkos::Impl::FunctorPolicyExecutionSpace< - FunctorType, void>::execution_space execution_space; + using execution_space = + typename Kokkos::Impl::FunctorPolicyExecutionSpace::execution_space; - typedef Kokkos::RangePolicy policy; + using policy = Kokkos::RangePolicy; -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName name(str); @@ -458,9 +439,6 @@ inline void parallel_scan(const size_t work_count, const FunctorType& functor, name.get(), Kokkos::Profiling::Experimental::device_id(policy().space()), &kpID); } -#else - (void)str; -#endif Kokkos::Impl::shared_allocation_tracking_disable(); Impl::ParallelScan closure(functor, @@ -469,11 +447,9 @@ inline void parallel_scan(const size_t work_count, const FunctorType& functor, closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelScan(kpID); } -#endif } template @@ -500,7 +476,6 @@ inline void parallel_scan( typename std::enable_if< Kokkos::Impl::is_execution_policy::value>::type* = nullptr) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName closure( @@ -521,11 +493,9 @@ inline void parallel_scan( closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelScan(kpID); } -#endif policy.space().fence(); } @@ -533,12 +503,12 @@ template inline void parallel_scan(const size_t work_count, const FunctorType& functor, ReturnType& return_value, const std::string& str = "") { - typedef typename Kokkos::Impl::FunctorPolicyExecutionSpace< - FunctorType, void>::execution_space execution_space; + using execution_space = + typename Kokkos::Impl::FunctorPolicyExecutionSpace::execution_space; - typedef Kokkos::RangePolicy policy; + using policy = Kokkos::RangePolicy; -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName name(str); @@ -546,9 +516,6 @@ inline void parallel_scan(const size_t work_count, const FunctorType& functor, name.get(), Kokkos::Profiling::Experimental::device_id(policy().space()), &kpID); } -#else - (void)str; -#endif Kokkos::Impl::shared_allocation_tracking_disable(); Impl::ParallelScanWithTotal closure( @@ -557,11 +524,9 @@ inline void parallel_scan(const size_t work_count, const FunctorType& functor, closure.execute(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelScan(kpID); } -#endif execution_space().fence(); } diff --git a/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp b/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp index 4ef2dbdf0d..dbebb6ecbd 100644 --- a/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp +++ b/lib/kokkos/core/src/Kokkos_Parallel_Reduce.hpp @@ -46,6 +46,10 @@ #define KOKKOS_PARALLEL_REDUCE_HPP #include +#include +#include +#include +#include namespace Kokkos { @@ -66,10 +70,10 @@ template struct Sum { public: // Required - typedef Sum reducer; - typedef typename std::remove_cv::type value_type; + using reducer = Sum; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -111,10 +115,10 @@ template struct Prod { public: // Required - typedef Prod reducer; - typedef typename std::remove_cv::type value_type; + using reducer = Prod; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -156,10 +160,10 @@ template struct Min { public: // Required - typedef Min reducer; - typedef typename std::remove_cv::type value_type; + using reducer = Min; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -203,10 +207,10 @@ template struct Max { public: // Required - typedef Max reducer; - typedef typename std::remove_cv::type value_type; + using reducer = Max; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -251,10 +255,10 @@ template struct LAnd { public: // Required - typedef LAnd reducer; - typedef typename std::remove_cv::type value_type; + using reducer = LAnd; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -297,10 +301,10 @@ template struct LOr { public: // Required - typedef LOr reducer; - typedef typename std::remove_cv::type value_type; + using reducer = LOr; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -344,10 +348,10 @@ template struct BAnd { public: // Required - typedef BAnd reducer; - typedef typename std::remove_cv::type value_type; + using reducer = BAnd; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -391,10 +395,10 @@ template struct BOr { public: // Required - typedef BOr reducer; - typedef typename std::remove_cv::type value_type; + using reducer = BOr; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -455,15 +459,15 @@ struct ValLocScalar { template struct MinLoc { private: - typedef typename std::remove_cv::type scalar_type; - typedef typename std::remove_cv::type index_type; + using scalar_type = typename std::remove_cv::type; + using index_type = typename std::remove_cv::type; public: // Required - typedef MinLoc reducer; - typedef ValLocScalar value_type; + using reducer = MinLoc; + using value_type = ValLocScalar; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -507,15 +511,15 @@ struct MinLoc { template struct MaxLoc { private: - typedef typename std::remove_cv::type scalar_type; - typedef typename std::remove_cv::type index_type; + using scalar_type = typename std::remove_cv::type; + using index_type = typename std::remove_cv::type; public: // Required - typedef MaxLoc reducer; - typedef ValLocScalar value_type; + using reducer = MaxLoc; + using value_type = ValLocScalar; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -576,14 +580,14 @@ struct MinMaxScalar { template struct MinMax { private: - typedef typename std::remove_cv::type scalar_type; + using scalar_type = typename std::remove_cv::type; public: // Required - typedef MinMax reducer; - typedef MinMaxScalar value_type; + using reducer = MinMax; + using value_type = MinMaxScalar; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -659,15 +663,15 @@ struct MinMaxLocScalar { template struct MinMaxLoc { private: - typedef typename std::remove_cv::type scalar_type; - typedef typename std::remove_cv::type index_type; + using scalar_type = typename std::remove_cv::type; + using index_type = typename std::remove_cv::type; public: // Required - typedef MinMaxLoc reducer; - typedef MinMaxLocScalar value_type; + using reducer = MinMaxLoc; + using value_type = MinMaxLocScalar; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; private: result_view_type value; @@ -734,14 +738,14 @@ template struct ParallelReduceReturnValue< typename std::enable_if::value>::type, ReturnType, FunctorType> { - typedef ReturnType return_type; - typedef InvalidType reducer_type; + using return_type = ReturnType; + using reducer_type = InvalidType; - typedef typename return_type::value_type value_type_scalar; - typedef typename return_type::value_type* const value_type_array; + using value_type_scalar = typename return_type::value_type; + using value_type_array = typename return_type::value_type* const; - typedef typename if_c::type value_type; + using value_type = typename if_c::type; static return_type& return_value(ReturnType& return_val, const FunctorType&) { return return_val; @@ -755,12 +759,12 @@ struct ParallelReduceReturnValue< !std::is_pointer::value) && !Kokkos::is_reducer_type::value>::type, ReturnType, FunctorType> { - typedef Kokkos::View - return_type; + using return_type = + Kokkos::View; - typedef InvalidType reducer_type; + using reducer_type = InvalidType; - typedef typename return_type::value_type value_type; + using value_type = typename return_type::value_type; static return_type return_value(ReturnType& return_val, const FunctorType&) { return return_type(&return_val); @@ -772,24 +776,19 @@ struct ParallelReduceReturnValue< typename std::enable_if<(std::is_array::value || std::is_pointer::value)>::type, ReturnType, FunctorType> { - typedef Kokkos::View::type, - Kokkos::HostSpace, Kokkos::MemoryUnmanaged> - return_type; + using return_type = Kokkos::View::type, + Kokkos::HostSpace, Kokkos::MemoryUnmanaged>; - typedef InvalidType reducer_type; + using reducer_type = InvalidType; - typedef typename return_type::value_type value_type[]; + using value_type = typename return_type::value_type[]; static return_type return_value(ReturnType& return_val, const FunctorType& functor) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return return_type(return_val, functor.value_count); -#else if (std::is_array::value) return return_type(return_val); else return return_type(return_val, functor.value_count); -#endif } }; @@ -797,9 +796,9 @@ template struct ParallelReduceReturnValue< typename std::enable_if::value>::type, ReturnType, FunctorType> { - typedef ReturnType return_type; - typedef ReturnType reducer_type; - typedef typename return_type::value_type value_type; + using return_type = ReturnType; + using reducer_type = ReturnType; + using value_type = typename return_type::value_type; static return_type return_value(ReturnType& return_val, const FunctorType&) { return return_val; @@ -814,7 +813,7 @@ struct ParallelReducePolicyType< typename std::enable_if< Kokkos::Impl::is_execution_policy::value>::type, PolicyType, FunctorType> { - typedef PolicyType policy_type; + using policy_type = PolicyType; static PolicyType policy(const PolicyType& policy_) { return policy_; } }; @@ -822,10 +821,11 @@ template struct ParallelReducePolicyType< typename std::enable_if::value>::type, PolicyType, FunctorType> { - typedef typename Impl::FunctorPolicyExecutionSpace< - FunctorType, void>::execution_space execution_space; + using execution_space = + typename Impl::FunctorPolicyExecutionSpace::execution_space; - typedef Kokkos::RangePolicy policy_type; + using policy_type = Kokkos::RangePolicy; static policy_type policy(const PolicyType& policy_) { return policy_type(0, policy_); @@ -835,7 +835,7 @@ struct ParallelReducePolicyType< template struct ParallelReduceFunctorType { - typedef FunctorType functor_type; + using functor_type = FunctorType; static const functor_type& functor(const functor_type& functor) { return functor; } @@ -843,18 +843,17 @@ struct ParallelReduceFunctorType { template struct ParallelReduceAdaptor { - typedef Impl::ParallelReduceReturnValue - return_value_adapter; + using return_value_adapter = + Impl::ParallelReduceReturnValue; #ifdef KOKKOS_IMPL_NEED_FUNCTOR_WRAPPER - typedef Impl::ParallelReduceFunctorType< - FunctorType, PolicyType, typename return_value_adapter::value_type, - typename PolicyType::execution_space> - functor_adaptor; + using functor_adaptor = + Impl::ParallelReduceFunctorType; #endif static inline void execute(const std::string& label, const PolicyType& policy, const FunctorType& functor, ReturnType& return_value) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Impl::ParallelConstructName { * \code * class FunctorType { // For POD value type * public: - * typedef ... execution_space ; - * typedef value_type ; + * using execution_space = ...; + * using value_type = ; * void operator()( iwork , & update ) const ; * void init( & update ) const ; * void join( volatile & update , * volatile const & input ) const ; * - * typedef true_type has_final ; + * using has_final = true_type; * void final( & update ) const ; * }; * \endcode * * Example of a parallel_reduce functor for an array of POD (plain old data) - * values: \code class FunctorType { // For array of POD value public: typedef - * ... execution_space ; typedef value_type[] ; void operator()( - * , update[] ) const ; void init( update[] ) - * const ; void join( volatile update[] , volatile const - * input[] ) const ; + * values: + * \code + * class FunctorType { // For array of POD value + * public: + * using execution_space = ...; + * using value_type = []; + * void operator()( , update[] ) const ; + * void init( update[] ) const ; + * void join( volatile update[] , + * volatile const input[] ) const ; * - * typedef true_type has_final ; + * using has_final = true_type; * void final( update[] ) const ; * }; * \endcode @@ -975,12 +974,10 @@ struct ParallelReduceFence { // ReturnValue is scalar or array: take by reference template -inline void parallel_reduce( - const std::string& label, const PolicyType& policy, - const FunctorType& functor, ReturnType& return_value, - typename std::enable_if< - Kokkos::Impl::is_execution_policy::value>::type* = - nullptr) { +inline typename std::enable_if< + Kokkos::Impl::is_execution_policy::value>::type +parallel_reduce(const std::string& label, const PolicyType& policy, + const FunctorType& functor, ReturnType& return_value) { Impl::ParallelReduceAdaptor::execute( label, policy, functor, return_value); Impl::ParallelReduceFence -inline void parallel_reduce( - const PolicyType& policy, const FunctorType& functor, - ReturnType& return_value, - typename std::enable_if< - Kokkos::Impl::is_execution_policy::value>::type* = - nullptr) { +inline typename std::enable_if< + Kokkos::Impl::is_execution_policy::value>::type +parallel_reduce(const PolicyType& policy, const FunctorType& functor, + ReturnType& return_value) { Impl::ParallelReduceAdaptor::execute( "", policy, functor, return_value); Impl::ParallelReduceFence inline void parallel_reduce(const size_t& policy, const FunctorType& functor, ReturnType& return_value) { - typedef typename Impl::ParallelReducePolicyType< - void, size_t, FunctorType>::policy_type policy_type; + using policy_type = + typename Impl::ParallelReducePolicyType::policy_type; Impl::ParallelReduceAdaptor::execute( "", policy_type(0, policy), functor, return_value); Impl::ParallelReduceFence:: @@ -1015,8 +1011,9 @@ template inline void parallel_reduce(const std::string& label, const size_t& policy, const FunctorType& functor, ReturnType& return_value) { - typedef typename Impl::ParallelReducePolicyType< - void, size_t, FunctorType>::policy_type policy_type; + using policy_type = + typename Impl::ParallelReducePolicyType::policy_type; Impl::ParallelReduceAdaptor::execute( label, policy_type(0, policy), functor, return_value); Impl::ParallelReduceFence:: @@ -1026,12 +1023,10 @@ inline void parallel_reduce(const std::string& label, const size_t& policy, // ReturnValue as View or Reducer: take by copy to allow for inline construction template -inline void parallel_reduce( - const std::string& label, const PolicyType& policy, - const FunctorType& functor, const ReturnType& return_value, - typename std::enable_if< - Kokkos::Impl::is_execution_policy::value>::type* = - nullptr) { +inline typename std::enable_if< + Kokkos::Impl::is_execution_policy::value>::type +parallel_reduce(const std::string& label, const PolicyType& policy, + const FunctorType& functor, const ReturnType& return_value) { ReturnType return_value_impl = return_value; Impl::ParallelReduceAdaptor::execute( label, policy, functor, return_value_impl); @@ -1040,12 +1035,10 @@ inline void parallel_reduce( } template -inline void parallel_reduce( - const PolicyType& policy, const FunctorType& functor, - const ReturnType& return_value, - typename std::enable_if< - Kokkos::Impl::is_execution_policy::value>::type* = - nullptr) { +inline typename std::enable_if< + Kokkos::Impl::is_execution_policy::value>::type +parallel_reduce(const PolicyType& policy, const FunctorType& functor, + const ReturnType& return_value) { ReturnType return_value_impl = return_value; Impl::ParallelReduceAdaptor::execute( "", policy, functor, return_value_impl); @@ -1056,8 +1049,9 @@ inline void parallel_reduce( template inline void parallel_reduce(const size_t& policy, const FunctorType& functor, const ReturnType& return_value) { - typedef typename Impl::ParallelReducePolicyType< - void, size_t, FunctorType>::policy_type policy_type; + using policy_type = + typename Impl::ParallelReducePolicyType::policy_type; ReturnType return_value_impl = return_value; Impl::ParallelReduceAdaptor::execute( "", policy_type(0, policy), functor, return_value_impl); @@ -1069,8 +1063,9 @@ template inline void parallel_reduce(const std::string& label, const size_t& policy, const FunctorType& functor, const ReturnType& return_value) { - typedef typename Impl::ParallelReducePolicyType< - void, size_t, FunctorType>::policy_type policy_type; + using policy_type = + typename Impl::ParallelReducePolicyType::policy_type; ReturnType return_value_impl = return_value; Impl::ParallelReduceAdaptor::execute( label, policy_type(0, policy), functor, return_value_impl); @@ -1087,18 +1082,19 @@ inline void parallel_reduce( typename std::enable_if< Kokkos::Impl::is_execution_policy::value>::type* = nullptr) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename Kokkos::Impl::if_c< - (ValueTraits::StaticValueSize != 0), typename ValueTraits::value_type, - typename ValueTraits::pointer_type>::type value_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = + typename Kokkos::Impl::if_c<(ValueTraits::StaticValueSize != 0), + typename ValueTraits::value_type, + typename ValueTraits::pointer_type>::type; static_assert( Impl::FunctorAnalysis::has_final_member_function, "Calling parallel_reduce without either return value or final function."); - typedef Kokkos::View - result_view_type; + using result_view_type = + Kokkos::View; result_view_type result_view; Impl::ParallelReduceAdaptor::value>::type* = nullptr) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename Kokkos::Impl::if_c< - (ValueTraits::StaticValueSize != 0), typename ValueTraits::value_type, - typename ValueTraits::pointer_type>::type value_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = + typename Kokkos::Impl::if_c<(ValueTraits::StaticValueSize != 0), + typename ValueTraits::value_type, + typename ValueTraits::pointer_type>::type; static_assert( Impl::FunctorAnalysis::has_final_member_function, "Calling parallel_reduce without either return value or final function."); - typedef Kokkos::View - result_view_type; + using result_view_type = + Kokkos::View; result_view_type result_view; Impl::ParallelReduceAdaptor inline void parallel_reduce(const size_t& policy, const FunctorType& functor) { - typedef typename Impl::ParallelReducePolicyType< - void, size_t, FunctorType>::policy_type policy_type; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename Kokkos::Impl::if_c< - (ValueTraits::StaticValueSize != 0), typename ValueTraits::value_type, - typename ValueTraits::pointer_type>::type value_type; + using policy_type = + typename Impl::ParallelReducePolicyType::policy_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = + typename Kokkos::Impl::if_c<(ValueTraits::StaticValueSize != 0), + typename ValueTraits::value_type, + typename ValueTraits::pointer_type>::type; static_assert( Impl::FunctorAnalysis::has_final_member_function, "Calling parallel_reduce without either return value or final function."); - typedef Kokkos::View - result_view_type; + using result_view_type = + Kokkos::View; result_view_type result_view; Impl::ParallelReduceAdaptor inline void parallel_reduce(const std::string& label, const size_t& policy, const FunctorType& functor) { - typedef typename Impl::ParallelReducePolicyType< - void, size_t, FunctorType>::policy_type policy_type; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename Kokkos::Impl::if_c< - (ValueTraits::StaticValueSize != 0), typename ValueTraits::value_type, - typename ValueTraits::pointer_type>::type value_type; + using policy_type = + typename Impl::ParallelReducePolicyType::policy_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = + typename Kokkos::Impl::if_c<(ValueTraits::StaticValueSize != 0), + typename ValueTraits::value_type, + typename ValueTraits::pointer_type>::type; static_assert( Impl::FunctorAnalysis::has_final_member_function, "Calling parallel_reduce without either return value or final function."); - typedef Kokkos::View - result_view_type; + using result_view_type = + Kokkos::View; result_view_type result_view; Impl::ParallelReduceAdaptor #include +#include #include @@ -56,37 +57,27 @@ namespace Profiling { class ProfilingSection { public: ProfilingSection(const std::string& sectionName) : secName(sectionName) { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::createProfileSection(secName, &secID); } -#else - secID = 0; -#endif } void start() { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::startSection(secID); } -#endif } void stop() { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::stopSection(secID); } -#endif } ~ProfilingSection() { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::destroyProfileSection(secID); } -#endif } std::string getName() { return secName; } diff --git a/lib/kokkos/core/src/Kokkos_ROCm.hpp b/lib/kokkos/core/src/Kokkos_ROCm.hpp index 57113452b8..5572b2434c 100644 --- a/lib/kokkos/core/src/Kokkos_ROCm.hpp +++ b/lib/kokkos/core/src/Kokkos_ROCm.hpp @@ -102,14 +102,14 @@ class ROCm { //@{ //! Tag this class as a kokkos execution space - typedef ROCm execution_space; - typedef ROCmSpace memory_space; - typedef Kokkos::Device device_type; + using execution_space = ROCm; + using memory_space = ROCmSpace; + using device_type = Kokkos::Device; - typedef LayoutLeft array_layout; - typedef HostSpace::size_type size_type; + using array_layout = LayoutLeft; + using size_type = HostSpace::size_type; - typedef ScratchMemorySpace scratch_memory_space; + using scratch_memory_space = ScratchMemorySpace; ~ROCm() {} ROCm(); @@ -142,11 +142,7 @@ class ROCm { /** \brief Wait until all dispatched functors complete. A noop for OpenMP. */ static void impl_static_fence(); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static void fence(); -#else void fence() const; -#endif /// \brief Print configuration information to the given output stream. static void print_configuration(std::ostream&, const bool detail = false); diff --git a/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp b/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp index 56a1a93b9d..bc63470461 100644 --- a/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_ROCmSpace.hpp @@ -64,11 +64,11 @@ namespace Experimental { class ROCmSpace { public: //! Tag this class as a kokkos memory space - typedef ROCmSpace memory_space; - typedef Kokkos::Experimental::ROCm execution_space; - typedef Kokkos::Device device_type; + using memory_space = ROCmSpace; + using execution_space = Kokkos::Experimental::ROCm; + using device_type = Kokkos::Device; - typedef unsigned int size_type; + using size_type = unsigned int; /*--------------------------------*/ @@ -157,10 +157,10 @@ class ROCmHostPinnedSpace { public: //! Tag this class as a kokkos memory space /** \brief Memory is in HostSpace so use the HostSpace::execution_space */ - typedef HostSpace::execution_space execution_space; - typedef ROCmHostPinnedSpace memory_space; - typedef Kokkos::Device device_type; - typedef unsigned int size_type; + using execution_space = HostSpace::execution_space; + using memory_space = ROCmHostPinnedSpace; + using device_type = Kokkos::Device; + using size_type = unsigned int; /*--------------------------------*/ @@ -530,7 +530,7 @@ template <> class SharedAllocationRecord : public SharedAllocationRecord { private: - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; @@ -581,7 +581,7 @@ template <> class SharedAllocationRecord : public SharedAllocationRecord { private: - typedef SharedAllocationRecord RecordBase; + using RecordBase = SharedAllocationRecord; SharedAllocationRecord(const SharedAllocationRecord&) = delete; SharedAllocationRecord& operator=(const SharedAllocationRecord&) = delete; diff --git a/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp b/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp index 708e0218b7..4e1c267aa0 100644 --- a/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp +++ b/lib/kokkos/core/src/Kokkos_ScratchSpace.hpp @@ -46,6 +46,7 @@ #define KOKKOS_SCRATCHSPACE_HPP #include +#include #include #include @@ -84,13 +85,13 @@ class ScratchMemorySpace { public: //! Tag this class as a memory space - typedef ScratchMemorySpace memory_space; - typedef ExecSpace execution_space; + using memory_space = ScratchMemorySpace; + using execution_space = ExecSpace; //! This execution space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; - typedef typename ExecSpace::array_layout array_layout; - typedef typename ExecSpace::size_type size_type; + using array_layout = typename ExecSpace::array_layout; + using size_type = typename ExecSpace::size_type; static constexpr const char* name() { return "ScratchMemorySpace"; } diff --git a/lib/kokkos/core/src/Kokkos_Serial.hpp b/lib/kokkos/core/src/Kokkos_Serial.hpp index 1f97998ea5..fefd3f7d91 100644 --- a/lib/kokkos/core/src/Kokkos_Serial.hpp +++ b/lib/kokkos/core/src/Kokkos_Serial.hpp @@ -63,7 +63,7 @@ #include #include #include -#include +#include #include @@ -89,19 +89,19 @@ class Serial { //@{ //! Tag this class as an execution space: - typedef Serial execution_space; - //! The size_type typedef best suited for this device. - typedef HostSpace::size_type size_type; + using execution_space = Serial; + //! The size_type alias best suited for this device. + using size_type = HostSpace::size_type; //! This device's preferred memory space. - typedef HostSpace memory_space; + using memory_space = HostSpace; //! This execution space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; //! This device's preferred array layout. - typedef LayoutRight array_layout; + using array_layout = LayoutRight; /// \brief Scratch memory space - typedef ScratchMemorySpace scratch_memory_space; + using scratch_memory_space = ScratchMemorySpace; //@} @@ -121,11 +121,7 @@ class Serial { /// device have completed. static void impl_static_fence() {} -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static void fence() {} -#else void fence() const {} -#endif /** \brief Return the maximum amount of concurrency. */ static int concurrency() { return 1; } @@ -134,32 +130,6 @@ class Serial { static void print_configuration(std::ostream&, const bool /* detail */ = false) {} -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static bool sleep(); - static bool wake(); - - static void initialize(unsigned threads_count = 1, - unsigned use_numa_count = 0, - unsigned use_cores_per_numa = 0, - bool allow_asynchronous_threadpool = false); - - static bool is_initialized(); - - //! Free any resources being consumed by the device. - static void finalize(); - - //-------------------------------------------------------------------------- - - inline static int thread_pool_size(int = 0) { return 1; } - KOKKOS_INLINE_FUNCTION static int thread_pool_rank() { return 0; } - - //-------------------------------------------------------------------------- - - KOKKOS_INLINE_FUNCTION static unsigned hardware_thread_id() { - return thread_pool_rank(); - } - inline static unsigned max_hardware_threads() { return thread_pool_size(0); } -#else static void impl_initialize(); static bool impl_is_initialized(); @@ -180,21 +150,21 @@ class Serial { inline static unsigned impl_max_hardware_threads() { return impl_thread_pool_size(0); } -#endif + uint32_t impl_instance_id() const noexcept { return 0; } static const char* name(); //-------------------------------------------------------------------------- }; -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits { static constexpr DeviceType id = DeviceType::Serial; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // namespace Kokkos /*--------------------------------------------------------------------------*/ @@ -259,28 +229,18 @@ class TeamPolicyInternal public: //! Tag this class as a kokkos execution policy - typedef TeamPolicyInternal execution_policy; + using execution_policy = TeamPolicyInternal; - typedef PolicyTraits traits; + using traits = PolicyTraits; //! Execution space of this execution policy: - typedef Kokkos::Serial execution_space; + using execution_space = Kokkos::Serial; const typename traits::execution_space& space() const { static typename traits::execution_space m_space; return m_space; } - TeamPolicyInternal& operator=(const TeamPolicyInternal& p) { - m_league_size = p.m_league_size; - m_team_scratch_size[0] = p.m_team_scratch_size[0]; - m_thread_scratch_size[0] = p.m_thread_scratch_size[0]; - m_team_scratch_size[1] = p.m_team_scratch_size[1]; - m_thread_scratch_size[1] = p.m_thread_scratch_size[1]; - m_chunk_size = p.m_chunk_size; - return *this; - } - template friend class TeamPolicyInternal; @@ -296,22 +256,6 @@ class TeamPolicyInternal } //---------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - static int team_size_max(const FunctorType&) { - return 1; - } - - template - static int team_size_recommended(const FunctorType&) { - return 1; - } - - template - static int team_size_recommended(const FunctorType&, const int&) { - return 1; - } -#endif template int team_size_max(const FunctorType&, const ParallelForTag&) const { @@ -357,24 +301,14 @@ class TeamPolicyInternal return (level == 0 ? 1024 * 32 : 20 * 1024 * 1024); } /** \brief Specify league size, request team size */ - TeamPolicyInternal(const execution_space&, int league_size_request -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE - , - int team_size_request -#else - , - int /* team_size_request */ -#endif - , - int /* vector_length_request */ = 1) + TeamPolicyInternal(const execution_space&, int league_size_request, + int team_size_request, int /* vector_length_request */ = 1) : m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, m_league_size(league_size_request), m_chunk_size(32) { -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE if (team_size_request > 1) Kokkos::abort("Kokkos::abort: Requested Team Size is too large!"); -#endif } TeamPolicyInternal(const execution_space&, int league_size_request, @@ -386,24 +320,14 @@ class TeamPolicyInternal m_league_size(league_size_request), m_chunk_size(32) {} - TeamPolicyInternal(int league_size_request -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE - , - int team_size_request -#else - , - int /* team_size_request */ -#endif - , + TeamPolicyInternal(int league_size_request, int team_size_request, int /* vector_length_request */ = 1) : m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, m_league_size(league_size_request), m_chunk_size(32) { -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE if (team_size_request > 1) Kokkos::abort("Kokkos::abort: Requested Team Size is too large!"); -#endif } TeamPolicyInternal(int league_size_request, @@ -417,44 +341,6 @@ class TeamPolicyInternal inline int chunk_size() const { return m_chunk_size; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal set_chunk_size( - typename traits::index_type chunk_size_) const { - TeamPolicyInternal p = *this; - p.m_chunk_size = chunk_size_; - return p; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - return p; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } -#else /** \brief set chunk_size to a discrete value*/ inline TeamPolicyInternal& set_chunk_size( typename traits::index_type chunk_size_) { @@ -487,45 +373,8 @@ class TeamPolicyInternal m_thread_scratch_size[level] = per_thread.value; return *this; } -#endif - typedef Impl::HostThreadTeamMember member_type; - - protected: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal internal_set_chunk_size( - typename traits::index_type chunk_size_) { - m_chunk_size = chunk_size_; - return *this; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team) { - m_team_scratch_size[level] = per_team.value; - return *this; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerThreadValue& per_thread) { - m_thread_scratch_size[level] = per_thread.value; - return *this; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) { - m_team_scratch_size[level] = per_team.value; - m_thread_scratch_size[level] = per_thread.value; - return *this; - } -#endif + using member_type = Impl::HostThreadTeamMember; }; } /* namespace Impl */ } /* namespace Kokkos */ @@ -540,7 +389,7 @@ namespace Impl { template class ParallelFor, Kokkos::Serial> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; const FunctorType m_functor; const Policy m_policy; @@ -579,25 +428,25 @@ template class ParallelReduce, ReducerType, Kokkos::Serial> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag WorkTag; + using Policy = Kokkos::RangePolicy; + using WorkTag = typename Policy::work_tag; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -687,16 +536,16 @@ template class ParallelScan, Kokkos::Serial> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag WorkTag; + using Policy = Kokkos::RangePolicy; + using WorkTag = typename Policy::work_tag; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -747,16 +596,16 @@ template class ParallelScanWithTotal, ReturnType, Kokkos::Serial> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag WorkTag; + using Policy = Kokkos::RangePolicy; + using WorkTag = typename Policy::work_tag; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -823,12 +672,11 @@ template class ParallelFor, Kokkos::Serial> { private: - typedef Kokkos::MDRangePolicy MDRangePolicy; - typedef typename MDRangePolicy::impl_range_policy Policy; + using MDRangePolicy = Kokkos::MDRangePolicy; + using Policy = typename MDRangePolicy::impl_range_policy; - typedef typename Kokkos::Impl::HostIterateTile< - MDRangePolicy, FunctorType, typename MDRangePolicy::work_tag, void> - iterate_type; + using iterate_type = typename Kokkos::Impl::HostIterateTile< + MDRangePolicy, FunctorType, typename MDRangePolicy::work_tag, void>; const FunctorType m_functor; const MDRangePolicy m_mdr_policy; @@ -855,28 +703,27 @@ template class ParallelReduce, ReducerType, Kokkos::Serial> { private: - typedef Kokkos::MDRangePolicy MDRangePolicy; - typedef typename MDRangePolicy::impl_range_policy Policy; + using MDRangePolicy = Kokkos::MDRangePolicy; + using Policy = typename MDRangePolicy::impl_range_policy; - typedef typename MDRangePolicy::work_tag WorkTag; + using WorkTag = typename MDRangePolicy::work_tag; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef FunctorAnalysis - Analysis; + using Analysis = FunctorAnalysis; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::value_type value_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using value_type = typename Analysis::value_type; + using reference_type = typename Analysis::reference_type; using iterate_type = typename Kokkos::Impl::HostIterateTile, private: enum { TEAM_REDUCE_SIZE = 512 }; - typedef TeamPolicyInternal Policy; - typedef typename Policy::member_type Member; + using Policy = TeamPolicyInternal; + using Member = typename Policy::member_type; const FunctorType m_functor; const int m_league; @@ -1024,26 +871,26 @@ class ParallelReduce, private: enum { TEAM_REDUCE_SIZE = 512 }; - typedef TeamPolicyInternal Policy; + using Policy = TeamPolicyInternal; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef typename Policy::member_type Member; - typedef typename Policy::work_tag WorkTag; + using Member = typename Policy::member_type; + using WorkTag = typename Policy::work_tag; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; const FunctorType m_functor; const int m_league; @@ -1152,6 +999,11 @@ class UniqueToken { /// This object should not be shared between instances UniqueToken(execution_space const& = execution_space()) noexcept {} + /// \brief create object size for requested size on given instance + /// + /// It is the users responsibility to only acquire size tokens concurrently + UniqueToken(size_type, execution_space const& = execution_space()) {} + /// \brief upper bound for acquired values, i.e. 0 <= value < size() KOKKOS_INLINE_FUNCTION int size() const noexcept { return 1; } diff --git a/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp b/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp index 6b9608d629..b2b2cb4473 100644 --- a/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp +++ b/lib/kokkos/core/src/Kokkos_TaskScheduler.hpp @@ -232,9 +232,9 @@ class BasicTaskScheduler : public Impl::TaskSchedulerBase { explicit BasicTaskScheduler(memory_pool const& arg_memory_pool) noexcept : m_track(), m_queue(nullptr) { - typedef Kokkos::Impl::SharedAllocationRecord - record_type; + using record_type = + Kokkos::Impl::SharedAllocationRecord; record_type* record = record_type::allocate(memory_space(), "TaskQueue", sizeof(queue_type)); diff --git a/lib/kokkos/core/src/Kokkos_TaskScheduler_fwd.hpp b/lib/kokkos/core/src/Kokkos_TaskScheduler_fwd.hpp index c5f880775d..28af6345d1 100644 --- a/lib/kokkos/core/src/Kokkos_TaskScheduler_fwd.hpp +++ b/lib/kokkos/core/src/Kokkos_TaskScheduler_fwd.hpp @@ -47,6 +47,7 @@ //---------------------------------------------------------------------------- +#include #include #if defined(KOKKOS_ENABLE_TASKDAG) diff --git a/lib/kokkos/core/src/Kokkos_Threads.hpp b/lib/kokkos/core/src/Kokkos_Threads.hpp index 9dd644df2e..a99c40f97c 100644 --- a/lib/kokkos/core/src/Kokkos_Threads.hpp +++ b/lib/kokkos/core/src/Kokkos_Threads.hpp @@ -77,16 +77,16 @@ class Threads { //! \name Type declarations that all Kokkos devices must provide. //@{ //! Tag this class as a kokkos execution space - typedef Threads execution_space; - typedef Kokkos::HostSpace memory_space; + using execution_space = Threads; + using memory_space = Kokkos::HostSpace; //! This execution space preferred device_type - typedef Kokkos::Device device_type; + using device_type = Kokkos::Device; - typedef Kokkos::LayoutRight array_layout; - typedef memory_space::size_type size_type; + using array_layout = Kokkos::LayoutRight; + using size_type = memory_space::size_type; - typedef ScratchMemorySpace scratch_memory_space; + using scratch_memory_space = ScratchMemorySpace; //@} /*------------------------------------------------------------------------*/ @@ -108,45 +108,11 @@ class Threads { /// device have completed. static void impl_static_fence(); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static void fence(); -#else void fence() const; -#endif /** \brief Return the maximum amount of concurrency. */ static int concurrency(); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - static bool sleep(); - - static bool wake(); - - static void finalize(); - - static void initialize(unsigned threads_count = 0, - unsigned use_numa_count = 0, - unsigned use_cores_per_numa = 0, - bool allow_asynchronous_threadpool = false); - - static int is_initialized(); - - static Threads& instance(int = 0); - - //---------------------------------------- - - static int thread_pool_size(int depth = 0); -#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) - static int thread_pool_rank(); -#else - KOKKOS_INLINE_FUNCTION static int thread_pool_rank() { return 0; } -#endif - - inline static unsigned max_hardware_threads() { return thread_pool_size(0); } - KOKKOS_INLINE_FUNCTION static unsigned hardware_thread_id() { - return thread_pool_rank(); - } -#else /// \brief Free any resources being consumed by the device. /// /// For the Threads device, this terminates spawned worker threads. @@ -199,7 +165,6 @@ class Threads { KOKKOS_INLINE_FUNCTION static unsigned impl_hardware_thread_id() { return impl_thread_pool_rank(); } -#endif uint32_t impl_instance_id() const noexcept { return 0; } @@ -208,14 +173,14 @@ class Threads { //---------------------------------------- }; -namespace Profiling { +namespace Tools { namespace Experimental { template <> struct DeviceTypeTraits { static constexpr DeviceType id = DeviceType::Threads; }; } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // namespace Kokkos /*--------------------------------------------------------------------------*/ diff --git a/lib/kokkos/core/src/Kokkos_Timer.hpp b/lib/kokkos/core/src/Kokkos_Timer.hpp index 1dab73b44c..4fda4ec4d4 100644 --- a/lib/kokkos/core/src/Kokkos_Timer.hpp +++ b/lib/kokkos/core/src/Kokkos_Timer.hpp @@ -45,6 +45,7 @@ #ifndef KOKKOS_TIMER_HPP #define KOKKOS_TIMER_HPP +#include #include namespace Kokkos { diff --git a/lib/kokkos/core/src/Kokkos_UniqueToken.hpp b/lib/kokkos/core/src/Kokkos_UniqueToken.hpp index 523ccad948..bce7e703f0 100644 --- a/lib/kokkos/core/src/Kokkos_UniqueToken.hpp +++ b/lib/kokkos/core/src/Kokkos_UniqueToken.hpp @@ -46,6 +46,8 @@ #define KOKKOS_UNIQUE_TOKEN_HPP #include +#include +#include namespace Kokkos { namespace Experimental { @@ -82,6 +84,95 @@ class UniqueToken { void release(size_type) const; }; +/// \brief Instance scope UniqueToken allows for a max size other than +/// execution_space::concurrency() +/// +/// This object should behave like a ref-counted object, so that when the last +/// instance is destroyed, resources are free if needed +template +class UniqueToken + : public UniqueToken { + public: + using execution_space = ExecutionSpace; + using size_type = typename execution_space::size_type; + + /// \brief Create object with specified size + /// + /// It is required that max_size is >= the maximum number of concurrent + /// threads that will attempt to acquire the UniqueToken. This constructor is + /// most commonly useful when you: + /// 1) Have a loop bound that may be smaller than + /// execution_space::concurrency(). + /// 2) Want a per-team unique token in the range [0, + /// execution_space::concurrency() / team_size) + UniqueToken(size_type max_size, execution_space const& = execution_space()); +}; + +// NOTE There was an agreement amongst developers that "AcquireUniqueToken" is a +// bad name but at this time no one has suggested a better alternative. + +/// \brief RAII helper for per-thread unique token values. +/// +/// The token value will be acquired at construction and automatically +/// released at destruction. +template +class AcquireUniqueToken { + public: + using exec_space = ExecutionSpace; + using size_type = typename exec_space::size_type; + using token_type = UniqueToken; + + private: + token_type my_token; + size_type my_acquired_val; + + public: + KOKKOS_FUNCTION AcquireUniqueToken(token_type t) + : my_token(t), my_acquired_val(my_token.acquire()) {} + + KOKKOS_FUNCTION ~AcquireUniqueToken() { my_token.release(my_acquired_val); } + + KOKKOS_FUNCTION size_type value() const { return my_acquired_val; } +}; + +/// \brief RAII helper for per-team unique token values. +/// +/// The token value will be acquired at construction and automatically +/// released at destruction. All threads in a team will share the same +/// token value. +template +class AcquireTeamUniqueToken { + public: + using exec_space = typename TeamPolicy::execution_space; + using token_type = UniqueToken; + using size_type = typename token_type::size_type; + using team_member_type = typename TeamPolicy::member_type; + using scratch_view = + Kokkos::View; + + private: + token_type my_token; + size_type my_acquired_val; + scratch_view my_team_acquired_val; + team_member_type my_team; + + public: + // NOTE The implementations of the constructor and destructor use + // `Kokkos::single()` which is an inline function defined in each backend. + // This creates circular dependency issues. Moving them to a separate header + // is less than ideal and should be revisited later. Having a `UniqueToken` + // forward declaration was considered but the non-type template parameter + // makes things complicated because it would require moving the definition of + // `UniqueTokenScope` enumeration type and its enumerators away which would + // hurt readability. + KOKKOS_FUNCTION AcquireTeamUniqueToken(token_type t, team_member_type team); + KOKKOS_FUNCTION ~AcquireTeamUniqueToken(); + KOKKOS_FUNCTION size_type value() const { return my_acquired_val; } + static std::size_t shmem_size() { return scratch_view::shmem_size(); } +}; + } // namespace Experimental } // namespace Kokkos diff --git a/lib/kokkos/core/src/Kokkos_Vectorization.hpp b/lib/kokkos/core/src/Kokkos_Vectorization.hpp index cd24734100..a232e5b3ab 100644 --- a/lib/kokkos/core/src/Kokkos_Vectorization.hpp +++ b/lib/kokkos/core/src/Kokkos_Vectorization.hpp @@ -47,6 +47,8 @@ #ifndef KOKKOS_VECTORIZATION_HPP #define KOKKOS_VECTORIZATION_HPP +#include + #if defined(KOKKOS_ENABLE_CUDA) #include #elif defined(KOKKOS_ENABLE_HIP) diff --git a/lib/kokkos/core/src/Kokkos_View.hpp b/lib/kokkos/core/src/Kokkos_View.hpp index 3d68d780a2..8e6f38163a 100644 --- a/lib/kokkos/core/src/Kokkos_View.hpp +++ b/lib/kokkos/core/src/Kokkos_View.hpp @@ -55,9 +55,7 @@ #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include -#endif +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -93,7 +91,6 @@ KOKKOS_INLINE_FUNCTION std::size_t count_valid_integers( (i6 != KOKKOS_INVALID_INDEX) + (i7 != KOKKOS_INVALID_INDEX); } -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE KOKKOS_INLINE_FUNCTION void runtime_check_rank_device(const size_t dyn_rank, const bool is_void_spec, const size_t i0, const size_t i1, @@ -111,16 +108,8 @@ void runtime_check_rank_device(const size_t dyn_rank, const bool is_void_spec, } } } -#else -KOKKOS_INLINE_FUNCTION -void runtime_check_rank_device(const size_t, const bool, const size_t, - const size_t, const size_t, const size_t, - const size_t, const size_t, const size_t, - const size_t) {} -#endif #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE KOKKOS_INLINE_FUNCTION void runtime_check_rank_host(const size_t dyn_rank, const bool is_void_spec, const size_t i0, const size_t i1, const size_t i2, @@ -141,13 +130,6 @@ void runtime_check_rank_host(const size_t dyn_rank, const bool is_void_spec, } } } -#else -KOKKOS_INLINE_FUNCTION -void runtime_check_rank_host(const size_t, const bool, const size_t, - const size_t, const size_t, const size_t, - const size_t, const size_t, const size_t, - const size_t, const std::string&) {} -#endif #endif } /* namespace Impl */ @@ -188,23 +170,23 @@ struct ViewTraits; template <> struct ViewTraits { - typedef void execution_space; - typedef void memory_space; - typedef void HostMirrorSpace; - typedef void array_layout; - typedef void memory_traits; - typedef void specialize; + using execution_space = void; + using memory_space = void; + using HostMirrorSpace = void; + using array_layout = void; + using memory_traits = void; + using specialize = void; }; template struct ViewTraits { // Ignore an extraneous 'void' - typedef typename ViewTraits::execution_space execution_space; - typedef typename ViewTraits::memory_space memory_space; - typedef typename ViewTraits::HostMirrorSpace HostMirrorSpace; - typedef typename ViewTraits::array_layout array_layout; - typedef typename ViewTraits::memory_traits memory_traits; - typedef typename ViewTraits::specialize specialize; + using execution_space = typename ViewTraits::execution_space; + using memory_space = typename ViewTraits::memory_space; + using HostMirrorSpace = typename ViewTraits::HostMirrorSpace; + using array_layout = typename ViewTraits::array_layout; + using memory_traits = typename ViewTraits::memory_traits; + using specialize = typename ViewTraits::specialize; }; template @@ -213,12 +195,12 @@ struct ViewTraits { // Specify layout, keep subsequent space and memory traits arguments - typedef typename ViewTraits::execution_space execution_space; - typedef typename ViewTraits::memory_space memory_space; - typedef typename ViewTraits::HostMirrorSpace HostMirrorSpace; - typedef ArrayLayout array_layout; - typedef typename ViewTraits::memory_traits memory_traits; - typedef typename ViewTraits::specialize specialize; + using execution_space = typename ViewTraits::execution_space; + using memory_space = typename ViewTraits::memory_space; + using HostMirrorSpace = typename ViewTraits::HostMirrorSpace; + using array_layout = ArrayLayout; + using memory_traits = typename ViewTraits::memory_traits; + using specialize = typename ViewTraits::specialize; }; template @@ -238,13 +220,13 @@ struct ViewTraits< void>::value, "Only one View Execution or Memory Space template argument"); - typedef typename Space::execution_space execution_space; - typedef typename Space::memory_space memory_space; - typedef typename Kokkos::Impl::HostMirror::Space::memory_space - HostMirrorSpace; - typedef typename execution_space::array_layout array_layout; - typedef typename ViewTraits::memory_traits memory_traits; - typedef typename ViewTraits::specialize specialize; + using execution_space = typename Space::execution_space; + using memory_space = typename Space::memory_space; + using HostMirrorSpace = + typename Kokkos::Impl::HostMirror::Space::memory_space; + using array_layout = typename execution_space::array_layout; + using memory_traits = typename ViewTraits::memory_traits; + using specialize = typename ViewTraits::specialize; }; template @@ -264,84 +246,79 @@ struct ViewTraits::value, "MemoryTrait is the final optional template argument for a View"); - typedef void execution_space; - typedef void memory_space; - typedef void HostMirrorSpace; - typedef void array_layout; - typedef MemoryTraits memory_traits; - typedef void specialize; + using execution_space = void; + using memory_space = void; + using HostMirrorSpace = void; + using array_layout = void; + using memory_traits = MemoryTraits; + using specialize = void; }; template struct ViewTraits { private: // Unpack the properties arguments - typedef ViewTraits prop; + using prop = ViewTraits; - typedef typename std::conditional< + using ExecutionSpace = typename std::conditional< !std::is_same::value, - typename prop::execution_space, Kokkos::DefaultExecutionSpace>::type - ExecutionSpace; + typename prop::execution_space, Kokkos::DefaultExecutionSpace>::type; - typedef typename std::conditional< + using MemorySpace = typename std::conditional< !std::is_same::value, - typename prop::memory_space, typename ExecutionSpace::memory_space>::type - MemorySpace; + typename prop::memory_space, typename ExecutionSpace::memory_space>::type; - typedef typename std::conditional< + using ArrayLayout = typename std::conditional< !std::is_same::value, - typename prop::array_layout, typename ExecutionSpace::array_layout>::type - ArrayLayout; + typename prop::array_layout, typename ExecutionSpace::array_layout>::type; - typedef typename std::conditional< + using HostMirrorSpace = typename std::conditional< !std::is_same::value, typename prop::HostMirrorSpace, - typename Kokkos::Impl::HostMirror::Space>::type - HostMirrorSpace; + typename Kokkos::Impl::HostMirror::Space>::type; - typedef typename std::conditional< + using MemoryTraits = typename std::conditional< !std::is_same::value, - typename prop::memory_traits, typename Kokkos::MemoryManaged>::type - MemoryTraits; + typename prop::memory_traits, typename Kokkos::MemoryManaged>::type; // Analyze data type's properties, // May be specialized based upon the layout and value type - typedef Kokkos::Impl::ViewDataAnalysis data_analysis; + using data_analysis = Kokkos::Impl::ViewDataAnalysis; public: //------------------------------------ // Data type traits: - typedef typename data_analysis::type data_type; - typedef typename data_analysis::const_type const_data_type; - typedef typename data_analysis::non_const_type non_const_data_type; + using data_type = typename data_analysis::type; + using const_data_type = typename data_analysis::const_type; + using non_const_data_type = typename data_analysis::non_const_type; //------------------------------------ // Compatible array of trivial type traits: - typedef typename data_analysis::scalar_array_type scalar_array_type; - typedef - typename data_analysis::const_scalar_array_type const_scalar_array_type; - typedef typename data_analysis::non_const_scalar_array_type - non_const_scalar_array_type; + using scalar_array_type = typename data_analysis::scalar_array_type; + using const_scalar_array_type = + typename data_analysis::const_scalar_array_type; + using non_const_scalar_array_type = + typename data_analysis::non_const_scalar_array_type; //------------------------------------ // Value type traits: - typedef typename data_analysis::value_type value_type; - typedef typename data_analysis::const_value_type const_value_type; - typedef typename data_analysis::non_const_value_type non_const_value_type; + using value_type = typename data_analysis::value_type; + using const_value_type = typename data_analysis::const_value_type; + using non_const_value_type = typename data_analysis::non_const_value_type; //------------------------------------ // Mapping traits: - typedef ArrayLayout array_layout; - typedef typename data_analysis::dimension dimension; + using array_layout = ArrayLayout; + using dimension = typename data_analysis::dimension; - typedef typename std::conditional< + using specialize = typename std::conditional< std::is_same::value, - typename prop::specialize, typename data_analysis::specialize>::type - specialize; /* mapping specialization tag */ + typename prop::specialize, typename data_analysis::specialize>:: + type; /* mapping specialization tag */ enum { rank = dimension::rank }; enum { rank_dynamic = dimension::rank_dynamic }; @@ -349,13 +326,13 @@ struct ViewTraits { //------------------------------------ // Execution space, memory space, memory access traits, and host mirror space. - typedef ExecutionSpace execution_space; - typedef MemorySpace memory_space; - typedef Kokkos::Device device_type; - typedef MemoryTraits memory_traits; - typedef HostMirrorSpace host_mirror_space; + using execution_space = ExecutionSpace; + using memory_space = MemorySpace; + using device_type = Kokkos::Device; + using memory_traits = MemoryTraits; + using host_mirror_space = HostMirrorSpace; - typedef typename MemorySpace::size_type size_type; + using size_type = typename MemorySpace::size_type; enum { is_hostspace = std::is_same::value }; enum { is_managed = MemoryTraits::is_unmanaged == 0 }; @@ -447,8 +424,10 @@ struct ViewTraits { * } * \endcode */ -template -class View; + +} // namespace Kokkos + +namespace Kokkos { template struct is_always_assignable_impl; @@ -552,8 +531,8 @@ constexpr Kokkos::Impl::AllowPadding_t AllowPadding = template inline Impl::ViewCtorProp::type...> view_alloc(Args const&... args) { - typedef Impl::ViewCtorProp::type...> - return_type; + using return_type = + Impl::ViewCtorProp::type...>; static_assert(!return_type::has_pointer, "Cannot give pointer-to-memory for view allocation"); @@ -565,8 +544,8 @@ template KOKKOS_INLINE_FUNCTION Impl::ViewCtorProp::type...> view_wrap(Args const&... args) { - typedef Impl::ViewCtorProp::type...> - return_type; + using return_type = + Impl::ViewCtorProp::type...>; static_assert(!return_type::has_memory_space && !return_type::has_execution_space && @@ -603,65 +582,64 @@ class View : public ViewTraits { template friend class Kokkos::Impl::ViewMapping; + using view_tracker_type = Kokkos::Impl::ViewTracker; + public: - typedef ViewTraits traits; + using traits = ViewTraits; private: - typedef Kokkos::Impl::ViewMapping - map_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using map_type = + Kokkos::Impl::ViewMapping; + template + friend struct Kokkos::Impl::ViewTracker; - track_type m_track; + view_tracker_type m_track; map_type m_map; public: //---------------------------------------- /** \brief Compatible view of array of scalar types */ - typedef View - array_type; + using array_type = + View; /** \brief Compatible view of const data type */ - typedef View - const_type; + using const_type = + View; /** \brief Compatible view of non-const data type */ - typedef View - non_const_type; + using non_const_type = + View; /** \brief Compatible HostMirror view */ - typedef View> - HostMirror; + using HostMirror = + View>; /** \brief Compatible HostMirror view */ - typedef View - host_mirror_type; + using host_mirror_type = + View; /** \brief Unified types */ - typedef typename Impl::ViewUniformType::type uniform_type; - typedef - typename Impl::ViewUniformType::const_type uniform_const_type; - typedef typename Impl::ViewUniformType::runtime_type - uniform_runtime_type; - typedef typename Impl::ViewUniformType::runtime_const_type - uniform_runtime_const_type; - typedef typename Impl::ViewUniformType::nomemspace_type - uniform_nomemspace_type; - typedef typename Impl::ViewUniformType::const_nomemspace_type - uniform_const_nomemspace_type; - typedef typename Impl::ViewUniformType::runtime_nomemspace_type - uniform_runtime_nomemspace_type; - typedef typename Impl::ViewUniformType::runtime_const_nomemspace_type - uniform_runtime_const_nomemspace_type; + using uniform_type = typename Impl::ViewUniformType::type; + using uniform_const_type = + typename Impl::ViewUniformType::const_type; + using uniform_runtime_type = + typename Impl::ViewUniformType::runtime_type; + using uniform_runtime_const_type = + typename Impl::ViewUniformType::runtime_const_type; + using uniform_nomemspace_type = + typename Impl::ViewUniformType::nomemspace_type; + using uniform_const_nomemspace_type = + typename Impl::ViewUniformType::const_nomemspace_type; + using uniform_runtime_nomemspace_type = + typename Impl::ViewUniformType::runtime_nomemspace_type; + using uniform_runtime_const_nomemspace_type = + typename Impl::ViewUniformType::runtime_const_nomemspace_type; //---------------------------------------- // Domain rank and extents @@ -703,44 +681,6 @@ class View : public ViewTraits { * ISO/C++ vocabulary 'extent'. */ -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - - template - KOKKOS_INLINE_FUNCTION constexpr - typename std::enable_if::value, size_t>::type - dimension(const iType& r) const { - return extent(r); - } - - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_0() const { - return m_map.dimension_0(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_1() const { - return m_map.dimension_1(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_2() const { - return m_map.dimension_2(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_3() const { - return m_map.dimension_3(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_4() const { - return m_map.dimension_4(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_5() const { - return m_map.dimension_5(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_6() const { - return m_map.dimension_6(); - } - KOKKOS_INLINE_FUNCTION constexpr size_t dimension_7() const { - return m_map.dimension_7(); - } - -#endif - - //---------------------------------------- - KOKKOS_INLINE_FUNCTION constexpr size_t size() const { return m_map.dimension_0() * m_map.dimension_1() * m_map.dimension_2() * m_map.dimension_3() * m_map.dimension_4() * m_map.dimension_5() * @@ -802,8 +742,8 @@ class View : public ViewTraits { //---------------------------------------- // Range span is the span which contains all members. - typedef typename map_type::reference_type reference_type; - typedef typename map_type::pointer_type pointer_type; + using reference_type = typename map_type::reference_type; + using pointer_type = typename map_type::pointer_type; enum { reference_type_is_lvalue_reference = @@ -811,40 +751,19 @@ class View : public ViewTraits { }; KOKKOS_INLINE_FUNCTION constexpr size_t span() const { return m_map.span(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // Deprecated, use 'span()' instead - KOKKOS_INLINE_FUNCTION constexpr size_t capacity() const { - return m_map.span(); - } -#endif KOKKOS_INLINE_FUNCTION bool span_is_contiguous() const { return m_map.span_is_contiguous(); } + KOKKOS_INLINE_FUNCTION constexpr bool is_allocated() const { + return m_map.data() != nullptr; + } KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { return m_map.data(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // Deprecated, use 'span_is_contigous()' instead - KOKKOS_INLINE_FUNCTION constexpr bool is_contiguous() const { - return m_map.span_is_contiguous(); - } - // Deprecated, use 'data()' instead - KOKKOS_INLINE_FUNCTION constexpr pointer_type ptr_on_device() const { - return m_map.data(); - } -#endif - //---------------------------------------- // Allow specializations to query their specialized map -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - KOKKOS_INLINE_FUNCTION - const Kokkos::Impl::ViewMapping& - implementation_map() const { - return m_map; - } -#endif KOKKOS_INLINE_FUNCTION const Kokkos::Impl::ViewMapping& impl_map() const { @@ -852,7 +771,7 @@ class View : public ViewTraits { } KOKKOS_INLINE_FUNCTION const Kokkos::Impl::SharedAllocationTracker& impl_track() const { - return m_track; + return m_track.m_tracker; } //---------------------------------------- @@ -904,315 +823,6 @@ class View : public ViewTraits { #endif public: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (0 == Rank)), - reference_type>::type - operator()(Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, args...)) - return m_map.reference(); - } - - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (1 == Rank) && !is_default_map), - reference_type>::type - operator()(const I0& i0, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, args...)) - return m_map.reference(i0); - } - - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (1 == Rank) && is_default_map && - !is_layout_stride), - reference_type>::type - operator()(const I0& i0, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, args...)) - return m_map.m_impl_handle[i0]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (1 == Rank) && is_default_map && - is_layout_stride), - reference_type>::type - operator()(const I0& i0, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, args...)) - return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0]; - } - - //------------------------------ - // Rank 1 operator[] - - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (1 == Rank) && !is_default_map), - reference_type>::type - operator[](const I0& i0) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0)) - return m_map.reference(i0); - } - - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (1 == Rank) && is_default_map && - !is_layout_stride), - reference_type>::type - operator[](const I0& i0) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0)) - return m_map.m_impl_handle[i0]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if<(Kokkos::Impl::are_integral::value && - (1 == Rank) && is_default_map && - is_layout_stride), - reference_type>::type - operator[](const I0& i0) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0)) - return m_map.m_impl_handle[m_map.m_impl_offset.m_stride.S0 * i0]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (2 == Rank) && - !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...)) - return m_map.reference(i0, i1); - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (2 == Rank) && - is_default_map && is_layout_left && (traits::rank_dynamic == 0)), - reference_type>::type - operator()(const I0& i0, const I1& i1, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...)) - return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_dim.N0 * i1]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (2 == Rank) && - is_default_map && is_layout_left && (traits::rank_dynamic != 0)), - reference_type>::type - operator()(const I0& i0, const I1& i1, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...)) - return m_map.m_impl_handle[i0 + m_map.m_impl_offset.m_stride * i1]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (2 == Rank) && - is_default_map && is_layout_right && (traits::rank_dynamic == 0)), - reference_type>::type - operator()(const I0& i0, const I1& i1, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...)) - return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_dim.N1 * i0]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (2 == Rank) && - is_default_map && is_layout_right && (traits::rank_dynamic != 0)), - reference_type>::type - operator()(const I0& i0, const I1& i1, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...)) - return m_map.m_impl_handle[i1 + m_map.m_impl_offset.m_stride * i0]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (2 == Rank) && - is_default_map && is_layout_stride), - reference_type>::type - operator()(const I0& i0, const I1& i1, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, args...)) - return m_map.m_impl_handle[i0 * m_map.m_impl_offset.m_stride.S0 + - i1 * m_map.m_impl_offset.m_stride.S1]; - } - - //------------------------------ - // Rank 3 - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (3 == Rank) && - is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, args...)) - return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2)]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && (3 == Rank) && - !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, args...)) - return m_map.reference(i0, i1, i2); - } - - //------------------------------ - // Rank 4 - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (4 == Rank) && is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, args...)) - return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3)]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (4 == Rank) && !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY((m_track, m_map, i0, i1, i2, i3, args...)) - return m_map.reference(i0, i1, i2, i3); - } - - //------------------------------ - // Rank 5 - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (5 == Rank) && is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, args...)) - return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4)]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (5 == Rank) && !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, args...)) - return m_map.reference(i0, i1, i2, i3, i4); - } - - //------------------------------ - // Rank 6 - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (6 == Rank) && is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, const I5& i5, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, i5, args...)) - return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5)]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (6 == Rank) && !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, const I5& i5, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, i5, args...)) - return m_map.reference(i0, i1, i2, i3, i4, i5); - } - - //------------------------------ - // Rank 7 - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (7 == Rank) && is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, const I5& i5, const I6& i6, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, args...)) - return m_map.m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6)]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (7 == Rank) && !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, const I5& i5, const I6& i6, Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, args...)) - return m_map.reference(i0, i1, i2, i3, i4, i5, i6); - } - - //------------------------------ - // Rank 8 - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (8 == Rank) && is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, const I5& i5, const I6& i6, const I7& i7, - Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7, args...)) - return m_map - .m_impl_handle[m_map.m_impl_offset(i0, i1, i2, i3, i4, i5, i6, i7)]; - } - - template - KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if< - (Kokkos::Impl::are_integral::value && - (8 == Rank) && !is_default_map), - reference_type>::type - operator()(const I0& i0, const I1& i1, const I2& i2, const I3& i3, - const I4& i4, const I5& i5, const I6& i6, const I7& i7, - Args... args) const { - KOKKOS_IMPL_VIEW_OPERATOR_VERIFY( - (m_track, m_map, i0, i1, i2, i3, i4, i5, i6, i7, args...)) - return m_map.reference(i0, i1, i2, i3, i4, i5, i6, i7); - } - -#else //------------------------------ // Rank 0 operator() @@ -1513,7 +1123,6 @@ class View : public ViewTraits { return m_map.reference(i0, i1, i2, i3, i4, i5, i6, i7); } -#endif template KOKKOS_FORCEINLINE_FUNCTION typename std::enable_if<(Kokkos::Impl::are_integral::value && @@ -1810,30 +1419,20 @@ class View : public ViewTraits { KOKKOS_DEFAULTED_FUNCTION ~View() = default; - KOKKOS_INLINE_FUNCTION - View() : m_track(), m_map() {} + KOKKOS_DEFAULTED_FUNCTION + View() = default; - KOKKOS_INLINE_FUNCTION - View(const View& rhs) - : m_track(rhs.m_track, traits::is_managed), m_map(rhs.m_map) {} + KOKKOS_DEFAULTED_FUNCTION + View(const View&) = default; - KOKKOS_INLINE_FUNCTION - View(View&& rhs) - : m_track(std::move(rhs.m_track)), m_map(std::move(rhs.m_map)) {} + KOKKOS_DEFAULTED_FUNCTION + View(View&&) = default; - KOKKOS_INLINE_FUNCTION - View& operator=(const View& rhs) { - m_track = rhs.m_track; - m_map = rhs.m_map; - return *this; - } + KOKKOS_DEFAULTED_FUNCTION + View& operator=(const View&) = default; - KOKKOS_INLINE_FUNCTION - View& operator=(View&& rhs) { - m_track = std::move(rhs.m_track); - m_map = std::move(rhs.m_map); - return *this; - } + KOKKOS_DEFAULTED_FUNCTION + View& operator=(View&&) = default; //---------------------------------------- // Compatible view copy constructor and assignment @@ -1846,14 +1445,13 @@ class View : public ViewTraits { traits, typename View::traits, typename traits::specialize>::is_assignable_data_type>::type* = nullptr) - : m_track(rhs.m_track, traits::is_managed), m_map() { - typedef typename View::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping - Mapping; + : m_track(rhs), m_map() { + using SrcTraits = typename View::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible View copy construction"); - Mapping::assign(m_map, rhs.m_map, rhs.m_track); + Mapping::assign(m_map, rhs.m_map, rhs.m_track.m_tracker); } template @@ -1863,13 +1461,12 @@ class View : public ViewTraits { typename traits::specialize>::is_assignable_data_type, View>::type& operator=(const View& rhs) { - typedef typename View::traits SrcTraits; - typedef Kokkos::Impl::ViewMapping - Mapping; + using SrcTraits = typename View::traits; + using Mapping = Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible View copy assignment"); - Mapping::assign(m_map, rhs.m_map, rhs.m_track); - m_track.assign(rhs.m_track, traits::is_managed); + Mapping::assign(m_map, rhs.m_map, rhs.m_track.m_tracker); + m_track.assign(rhs); return *this; } @@ -1880,16 +1477,13 @@ class View : public ViewTraits { template KOKKOS_INLINE_FUNCTION View(const View& src_view, const Arg0 arg0, Args... args) - : m_track(src_view.m_track, traits::is_managed), m_map() { - typedef View SrcType; + : m_track(src_view), m_map() { + using SrcType = View; - typedef Kokkos::Impl::ViewMapping - Mapping; + using Mapping = Kokkos::Impl::ViewMapping; - typedef typename Mapping::type DstType; + using DstType = typename Mapping::type; static_assert( Kokkos::Impl::ViewMapping { // Allocation tracking properties KOKKOS_INLINE_FUNCTION - int use_count() const { return m_track.use_count(); } + int use_count() const { return m_track.m_tracker.use_count(); } inline const std::string label() const { - return m_track.template get_label(); + return m_track.m_tracker + .template get_label(); } //---------------------------------------- @@ -1920,35 +1515,29 @@ class View : public ViewTraits { arg_layout) : m_track(), m_map() { // Append layout and spaces if not input - typedef Impl::ViewCtorProp alloc_prop_input; + using alloc_prop_input = Impl::ViewCtorProp; // use 'std::integral_constant' for non-types // to avoid duplicate class error. - typedef Impl::ViewCtorProp< + using alloc_prop = Impl::ViewCtorProp< P..., typename std::conditional, + std::integral_constant, typename std::string>::type, typename std::conditional< alloc_prop_input::has_memory_space, - std::integral_constant, + std::integral_constant, typename traits::device_type::memory_space>::type, typename std::conditional< alloc_prop_input::has_execution_space, - std::integral_constant, - typename traits::device_type::execution_space>::type> - alloc_prop; + std::integral_constant, + typename traits::device_type::execution_space>::type>; static_assert(traits::is_managed, "View allocation constructor requires managed memory"); if (alloc_prop::initialize && -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - !alloc_prop::execution_space::is_initialized() -#else - !alloc_prop::execution_space::impl_is_initialized() -#endif - ) { + !alloc_prop::execution_space::impl_is_initialized()) { // If initializing view data then // the execution space must be initialized. Kokkos::Impl::throw_runtime_exception( @@ -1986,12 +1575,12 @@ class View : public ViewTraits { //------------------------------------------------------------ // Setup and initialization complete, start tracking - m_track.assign_allocated_record_to_uninitialized(record); + m_track.m_tracker.assign_allocated_record_to_uninitialized(record); } KOKKOS_INLINE_FUNCTION void assign_data(pointer_type arg_data) { - m_track.clear(); + m_track.m_tracker.clear(); m_map.assign_data(arg_data); } @@ -2152,14 +1741,31 @@ class View : public ViewTraits { #endif } + // Construct view from ViewTracker and map + // This should be the preferred method because future extensions may need to + // use the ViewTracker class. template KOKKOS_INLINE_FUNCTION View( - const track_type& track, + const view_tracker_type& track, const Kokkos::Impl::ViewMapping& map) : m_track(track), m_map() { - typedef Kokkos::Impl::ViewMapping - Mapping; + using Mapping = + Kokkos::Impl::ViewMapping; + static_assert(Mapping::is_assignable, + "Incompatible View copy construction"); + Mapping::assign(m_map, map, track.m_tracker); + } + + // Construct View from internal shared allocation tracker object and map + // This is here for backwards compatibility for classes that derive from + // Kokkos::View + template + KOKKOS_INLINE_FUNCTION View( + const typename view_tracker_type::track_type& track, + const Kokkos::Impl::ViewMapping& map) + : m_track(track), m_map() { + using Mapping = + Kokkos::Impl::ViewMapping; static_assert(Mapping::is_assignable, "Incompatible View copy construction"); Mapping::assign(m_map, map, track); @@ -2344,8 +1950,8 @@ template KOKKOS_INLINE_FUNCTION bool operator==(const View& lhs, const View& rhs) { // Same data, layout, dimensions - typedef ViewTraits lhs_traits; - typedef ViewTraits rhs_traits; + using lhs_traits = ViewTraits; + using rhs_traits = ViewTraits; return std::is_same::value && diff --git a/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp index 6ff2f0d4b7..bdc8993c39 100644 --- a/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Kokkos_WorkGraphPolicy.hpp @@ -45,6 +45,9 @@ #ifndef KOKKOS_WORKGRAPHPOLICY_HPP #define KOKKOS_WORKGRAPHPOLICY_HPP +#include +#include + namespace Kokkos { namespace Impl { @@ -245,6 +248,10 @@ class WorkGraphPolicy : public Kokkos::Impl::PolicyTraits { #include "Cuda/Kokkos_Cuda_WorkGraphPolicy.hpp" #endif +#ifdef KOKKOS_ENABLE_HIP +#include "HIP/Kokkos_HIP_WorkGraphPolicy.hpp" +#endif + #ifdef KOKKOS_ENABLE_THREADS #include "Threads/Kokkos_Threads_WorkGraphPolicy.hpp" #endif diff --git a/lib/kokkos/core/src/Kokkos_hwloc.hpp b/lib/kokkos/core/src/Kokkos_hwloc.hpp index f343ef80b4..23fa0a0c67 100644 --- a/lib/kokkos/core/src/Kokkos_hwloc.hpp +++ b/lib/kokkos/core/src/Kokkos_hwloc.hpp @@ -45,6 +45,8 @@ #ifndef KOKKOS_HWLOC_HPP #define KOKKOS_HWLOC_HPP +#include + #include namespace Kokkos { diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp index 21151156e3..117a7e7345 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.cpp @@ -56,7 +56,7 @@ #include #include -#include +#include namespace Kokkos { namespace Impl { @@ -250,12 +250,7 @@ namespace Kokkos { //---------------------------------------------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -int OpenMP::get_current_max_threads() noexcept -#else -int OpenMP::impl_get_current_max_threads() noexcept -#endif -{ +int OpenMP::impl_get_current_max_threads() noexcept { // Using omp_get_max_threads(); is problematic in conjunction with // Hwloc on Intel (essentially an initial call to the OpenMP runtime // without a parallel region before will set a process mask for a single core @@ -274,12 +269,7 @@ int OpenMP::impl_get_current_max_threads() noexcept return count; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void OpenMP::initialize(int thread_count) -#else -void OpenMP::impl_initialize(int thread_count) -#endif -{ +void OpenMP::impl_initialize(int thread_count) { if (omp_in_parallel()) { std::string msg("Kokkos::OpenMP::initialize ERROR : in parallel"); Kokkos::Impl::throw_runtime_exception(msg); @@ -306,11 +296,7 @@ void OpenMP::impl_initialize(int thread_count) // Before any other call to OMP query the maximum number of threads // and save the value for re-initialization unit testing. -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - Impl::g_openmp_hardware_max_threads = get_current_max_threads(); -#else Impl::g_openmp_hardware_max_threads = impl_get_current_max_threads(); -#endif int process_num_threads = Impl::g_openmp_hardware_max_threads; @@ -391,20 +377,11 @@ void OpenMP::impl_initialize(int thread_count) } // Init the array for used for arbitrarily sized atomics Impl::init_lock_array_host_space(); - -#if defined(KOKKOS_ENABLE_DEPRECATED_CODE) && defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::initialize(); -#endif } //---------------------------------------------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void OpenMP::finalize() -#else -void OpenMP::impl_finalize() -#endif -{ +void OpenMP::impl_finalize() { if (omp_in_parallel()) { std::string msg("Kokkos::OpenMP::finalize ERROR "); if (!Impl::t_openmp_instance) msg.append(": not initialized"); @@ -440,9 +417,7 @@ void OpenMP::impl_finalize() Impl::g_openmp_hardware_max_threads = 1; } -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::finalize(); -#endif } //---------------------------------------------------------------------------- @@ -472,18 +447,7 @@ OpenMP OpenMP::create_instance(...) { return OpenMP(); } int OpenMP::concurrency() { return Impl::g_openmp_hardware_max_threads; } -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE void OpenMP::fence() const {} -#endif - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - -void OpenMP::initialize(int thread_count, int, int) { - initialize(thread_count); -} - -#endif - } // namespace Kokkos #else diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp index 6614050f02..f51a7e7ce0 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Exec.hpp @@ -61,10 +61,7 @@ #include #include - -#include -#include -#include +#include #include @@ -129,15 +126,7 @@ class OpenMPExec { namespace Kokkos { -inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - bool - OpenMP::is_initialized() noexcept -#else - bool - OpenMP::impl_is_initialized() noexcept -#endif -{ +inline bool OpenMP::impl_is_initialized() noexcept { return Impl::t_openmp_instance != nullptr; } @@ -147,26 +136,13 @@ inline bool OpenMP::in_parallel(OpenMP const&) noexcept { Impl::t_openmp_instance->m_level < omp_get_level(); } -inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - OpenMP::thread_pool_size() noexcept -#else - int - OpenMP::impl_thread_pool_size() noexcept -#endif -{ +inline int OpenMP::impl_thread_pool_size() noexcept { return OpenMP::in_parallel() ? omp_get_num_threads() : Impl::t_openmp_instance->m_pool_size; } KOKKOS_INLINE_FUNCTION -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -int OpenMP::thread_pool_rank() noexcept -#else -int OpenMP::impl_thread_pool_rank() noexcept -#endif -{ +int OpenMP::impl_thread_pool_rank() noexcept { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) return Impl::t_openmp_instance ? 0 : omp_get_thread_num(); #else @@ -176,10 +152,6 @@ int OpenMP::impl_thread_pool_rank() noexcept inline void OpenMP::impl_static_fence(OpenMP const& /*instance*/) noexcept {} -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -inline void OpenMP::fence(OpenMP const& instance) noexcept {} -#endif - inline bool OpenMP::is_asynchronous(OpenMP const& /*instance*/) noexcept { return false; } @@ -190,7 +162,7 @@ void OpenMP::partition_master(F const& f, int num_partitions, #if _OPENMP >= 201811 if (omp_get_max_active_levels() > 1) { #else - if (omp_get_nested() > 1) { + if (omp_get_nested()) { #endif using Exec = Impl::OpenMPExec; @@ -261,6 +233,12 @@ class MasterLock { template <> class UniqueToken { + private: + using buffer_type = Kokkos::View; + int m_count; + buffer_type m_buffer_view; + uint32_t volatile* m_buffer; + public: using execution_space = OpenMP; using size_type = int; @@ -268,17 +246,22 @@ class UniqueToken { /// \brief create object size for concurrency on the given instance /// /// This object should not be shared between instances - UniqueToken(execution_space const& = execution_space()) noexcept {} + UniqueToken(execution_space const& = execution_space()) noexcept + : m_count(::Kokkos::OpenMP::impl_thread_pool_size()), + m_buffer_view(buffer_type()), + m_buffer(nullptr) {} + + UniqueToken(size_type max_size, execution_space const& = execution_space()) + : m_count(max_size), + m_buffer_view("UniqueToken::m_buffer_view", + ::Kokkos::Impl::concurrent_bitset::buffer_bound(m_count)), + m_buffer(m_buffer_view.data()) {} /// \brief upper bound for acquired values, i.e. 0 <= value < size() KOKKOS_INLINE_FUNCTION int size() const noexcept { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) -#if defined(KOKKOS_ENABLE_DEPRECATED_CODE) - return Kokkos::OpenMP::thread_pool_size(); -#else - return Kokkos::OpenMP::impl_thread_pool_size(); -#endif + return m_count; #else return 0; #endif @@ -288,11 +271,18 @@ class UniqueToken { KOKKOS_INLINE_FUNCTION int acquire() const noexcept { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) -#if defined(KOKKOS_ENABLE_DEPRECATED_CODE) - return Kokkos::OpenMP::thread_pool_rank(); -#else - return Kokkos::OpenMP::impl_thread_pool_rank(); -#endif + if (m_count >= ::Kokkos::OpenMP::impl_thread_pool_size()) + return ::Kokkos::OpenMP::impl_thread_pool_rank(); + const ::Kokkos::pair result = + ::Kokkos::Impl::concurrent_bitset::acquire_bounded( + m_buffer, m_count, ::Kokkos::Impl::clock_tic() % m_count); + + if (result.first < 0) { + ::Kokkos::abort( + "UniqueToken failure to acquire tokens, no tokens available"); + } + + return result.first; #else return 0; #endif @@ -300,7 +290,14 @@ class UniqueToken { /// \brief release a value acquired by generate KOKKOS_INLINE_FUNCTION - void release(int) const noexcept {} + void release(int i) const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (m_count < ::Kokkos::OpenMP::impl_thread_pool_size()) + ::Kokkos::Impl::concurrent_bitset::release(m_buffer, i); +#else + (void)i; +#endif + } }; template <> @@ -341,31 +338,12 @@ class UniqueToken { } // namespace Experimental -inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - OpenMP::thread_pool_size(int depth) -#else - int - OpenMP::impl_thread_pool_size(int depth) -#endif -{ - return depth < 2 -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ? thread_pool_size() -#else - ? impl_thread_pool_size() -#endif - : 1; +inline int OpenMP::impl_thread_pool_size(int depth) { + return depth < 2 ? impl_thread_pool_size() : 1; } KOKKOS_INLINE_FUNCTION -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -int OpenMP::hardware_thread_id() noexcept -#else -int OpenMP::impl_hardware_thread_id() noexcept -#endif -{ +int OpenMP::impl_hardware_thread_id() noexcept { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) return Impl::t_openmp_hardware_id; #else @@ -373,15 +351,7 @@ int OpenMP::impl_hardware_thread_id() noexcept #endif } -inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - OpenMP::max_hardware_threads() noexcept -#else - int - OpenMP::impl_max_hardware_threads() noexcept -#endif -{ +inline int OpenMP::impl_max_hardware_threads() noexcept { return Impl::g_openmp_hardware_max_threads; } diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp index 83773ac305..7c05fb2f29 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Parallel.hpp @@ -49,7 +49,6 @@ #if defined(KOKKOS_ENABLE_OPENMP) #include -#include #include #include @@ -64,10 +63,10 @@ namespace Impl { template class ParallelFor, Kokkos::OpenMP> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using Policy = Kokkos::RangePolicy; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; OpenMPExec* m_instance; const FunctorType m_functor; @@ -116,11 +115,7 @@ class ParallelFor, Kokkos::OpenMP> { } else { OpenMPExec::verify_is_master("Kokkos::OpenMP parallel_for"); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#pragma omp parallel num_threads(OpenMP::thread_pool_size()) -#else #pragma omp parallel num_threads(OpenMP::impl_thread_pool_size()) -#endif { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -158,16 +153,15 @@ template class ParallelFor, Kokkos::OpenMP> { private: - typedef Kokkos::MDRangePolicy MDRangePolicy; - typedef typename MDRangePolicy::impl_range_policy Policy; - typedef typename MDRangePolicy::work_tag WorkTag; + using MDRangePolicy = Kokkos::MDRangePolicy; + using Policy = typename MDRangePolicy::impl_range_policy; + using WorkTag = typename MDRangePolicy::work_tag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef typename Kokkos::Impl::HostIterateTile< - MDRangePolicy, FunctorType, typename MDRangePolicy::work_tag, void> - iterate_type; + using iterate_type = typename Kokkos::Impl::HostIterateTile< + MDRangePolicy, FunctorType, typename MDRangePolicy::work_tag, void>; OpenMPExec* m_instance; const FunctorType m_functor; @@ -201,11 +195,7 @@ class ParallelFor, } else { OpenMPExec::verify_is_master("Kokkos::OpenMP parallel_for"); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#pragma omp parallel num_threads(OpenMP::thread_pool_size()) -#else #pragma omp parallel num_threads(OpenMP::impl_thread_pool_size()) -#endif { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -253,30 +243,30 @@ template class ParallelReduce, ReducerType, Kokkos::OpenMP> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; // Static Assert WorkTag void if ReducerType not InvalidType - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; OpenMPExec* m_instance; const FunctorType m_functor; @@ -324,11 +314,7 @@ class ParallelReduce, ReducerType, 0 // thread_local_bytes ); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = OpenMP::thread_pool_size(); -#else const int pool_size = OpenMP::impl_thread_pool_size(); -#endif #pragma omp parallel num_threads(pool_size) { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -420,31 +406,30 @@ template class ParallelReduce, ReducerType, Kokkos::OpenMP> { private: - typedef Kokkos::MDRangePolicy MDRangePolicy; - typedef typename MDRangePolicy::impl_range_policy Policy; + using MDRangePolicy = Kokkos::MDRangePolicy; + using Policy = typename MDRangePolicy::impl_range_policy; - typedef typename MDRangePolicy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename MDRangePolicy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef FunctorAnalysis - Analysis; + using Analysis = FunctorAnalysis; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::value_type value_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using value_type = typename Analysis::value_type; + using reference_type = typename Analysis::reference_type; using iterate_type = typename Kokkos::Impl::HostIterateTile, ReducerType, 0 // thread_local_bytes ); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = OpenMP::thread_pool_size(); -#else const int pool_size = OpenMP::impl_thread_pool_size(); -#endif #pragma omp parallel num_threads(pool_size) { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -592,21 +573,21 @@ template class ParallelScan, Kokkos::OpenMP> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; + using ValueOps = Kokkos::Impl::FunctorValueOps; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; OpenMPExec* m_instance; const FunctorType m_functor; @@ -647,11 +628,7 @@ class ParallelScan, 0 // thread_local_bytes ); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#pragma omp parallel num_threads(OpenMP::thread_pool_size()) -#else #pragma omp parallel num_threads(OpenMP::impl_thread_pool_size()) -#endif { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -665,7 +642,7 @@ class ParallelScan, m_functor, range.begin(), range.end(), update_sum, false); if (data.pool_rendezvous()) { - pointer_type ptr_prev = 0; + pointer_type ptr_prev = nullptr; const int n = omp_get_num_threads(); @@ -710,21 +687,21 @@ template class ParallelScanWithTotal, ReturnType, Kokkos::OpenMP> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; + using ValueOps = Kokkos::Impl::FunctorValueOps; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; OpenMPExec* m_instance; const FunctorType m_functor; @@ -766,11 +743,7 @@ class ParallelScanWithTotal, 0 // thread_local_bytes ); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#pragma omp parallel num_threads(OpenMP::thread_pool_size()) -#else #pragma omp parallel num_threads(OpenMP::impl_thread_pool_size()) -#endif { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -783,7 +756,7 @@ class ParallelScanWithTotal, m_functor, range.begin(), range.end(), update_sum, false); if (data.pool_rendezvous()) { - pointer_type ptr_prev = 0; + pointer_type ptr_prev = nullptr; const int n = omp_get_num_threads(); @@ -846,11 +819,11 @@ class ParallelFor, private: enum { TEAM_REDUCE_SIZE = 512 }; - typedef Kokkos::Impl::TeamPolicyInternal - Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::schedule_type::type SchedTag; - typedef typename Policy::member_type Member; + using Policy = + Kokkos::Impl::TeamPolicyInternal; + using WorkTag = typename Policy::work_tag; + using SchedTag = typename Policy::schedule_type::type; + using Member = typename Policy::member_type; OpenMPExec* m_instance; const FunctorType m_functor; @@ -911,11 +884,7 @@ class ParallelFor, m_instance->resize_thread_data(pool_reduce_size, team_reduce_size, team_shared_size, thread_local_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#pragma omp parallel num_threads(OpenMP::thread_pool_size()) -#else #pragma omp parallel num_threads(OpenMP::impl_thread_pool_size()) -#endif { HostThreadTeamData& data = *(m_instance->get_thread_data()); @@ -969,30 +938,30 @@ class ParallelReduce, private: enum { TEAM_REDUCE_SIZE = 512 }; - typedef Kokkos::Impl::TeamPolicyInternal - Policy; + using Policy = + Kokkos::Impl::TeamPolicyInternal; - typedef FunctorAnalysis - Analysis; + using Analysis = + FunctorAnalysis; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::schedule_type::type SchedTag; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using SchedTag = typename Policy::schedule_type::type; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; - typedef typename Analysis::pointer_type pointer_type; - typedef typename Analysis::reference_type reference_type; + using pointer_type = typename Analysis::pointer_type; + using reference_type = typename Analysis::reference_type; OpenMPExec* m_instance; const FunctorType m_functor; @@ -1057,11 +1026,7 @@ class ParallelReduce, m_instance->resize_thread_data(pool_reduce_size, team_reduce_size, team_shared_size, thread_local_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = OpenMP::thread_pool_size(); -#else const int pool_size = OpenMP::impl_thread_pool_size(); -#endif #pragma omp parallel num_threads(pool_size) { HostThreadTeamData& data = *(m_instance->get_thread_data()); diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp index 62f0a77d0e..2a4a7b1d53 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Task.hpp @@ -182,11 +182,7 @@ class TaskQueueSpecialization > { } static uint32_t get_max_team_count(execution_space const& espace) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return static_cast(espace.thread_pool_size()); -#else return static_cast(espace.impl_thread_pool_size()); -#endif } // TODO @tasking @optimization DSH specialize this for trivially destructible @@ -219,13 +215,7 @@ class TaskQueueSpecializationConstrained< using task_base_type = typename scheduler_type::task_base; using queue_type = typename scheduler_type::queue_type; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (1 == OpenMP::thread_pool_size()) -#else - if (1 == OpenMP::impl_thread_pool_size()) -#endif - { - + if (1 == OpenMP::impl_thread_pool_size()) { task_base_type* const end = (task_base_type*)task_base_type::EndTag; HostThreadTeamData& team_data_single = @@ -269,11 +259,7 @@ class TaskQueueSpecializationConstrained< HostThreadTeamDataSingleton::singleton(); Impl::OpenMPExec* instance = t_openmp_instance; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = OpenMP::thread_pool_size(); -#else - const int pool_size = OpenMP::impl_thread_pool_size(); -#endif + const int pool_size = OpenMP::impl_thread_pool_size(); const int team_size = 1; // Threads per core instance->resize_thread_data(0 /* global reduce buffer */ diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp index f54b6e2d51..80903e7a7a 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_Team.hpp @@ -58,28 +58,15 @@ class TeamPolicyInternal : public PolicyTraits { public: //! Tag this class as a kokkos execution policy - typedef TeamPolicyInternal execution_policy; + using execution_policy = TeamPolicyInternal; - typedef PolicyTraits traits; + using traits = PolicyTraits; const typename traits::execution_space& space() const { static typename traits::execution_space m_space; return m_space; } - TeamPolicyInternal& operator=(const TeamPolicyInternal& p) { - m_league_size = p.m_league_size; - m_team_size = p.m_team_size; - m_team_alloc = p.m_team_alloc; - m_team_iter = p.m_team_iter; - m_team_scratch_size[0] = p.m_team_scratch_size[0]; - m_thread_scratch_size[0] = p.m_thread_scratch_size[0]; - m_team_scratch_size[1] = p.m_team_scratch_size[1]; - m_thread_scratch_size[1] = p.m_thread_scratch_size[1]; - m_chunk_size = p.m_chunk_size; - return *this; - } - template friend class TeamPolicyInternal; @@ -98,42 +85,15 @@ class TeamPolicyInternal } //---------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - inline static int team_size_max(const FunctorType&) { - int pool_size = traits::execution_space::thread_pool_size(1); - int max_host_team_size = Impl::HostThreadTeamData::max_team_members; - return pool_size < max_host_team_size ? pool_size : max_host_team_size; - } - - template - inline static int team_size_recommended(const FunctorType&) { - return traits::execution_space::thread_pool_size(2); - } - - template - inline static int team_size_recommended(const FunctorType&, const int&) { - return traits::execution_space::thread_pool_size(2); - } -#endif - template int team_size_max(const FunctorType&, const ParallelForTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int pool_size = traits::execution_space::thread_pool_size(1); -#else - int pool_size = traits::execution_space::impl_thread_pool_size(1); -#endif + int pool_size = traits::execution_space::impl_thread_pool_size(1); int max_host_team_size = Impl::HostThreadTeamData::max_team_members; return pool_size < max_host_team_size ? pool_size : max_host_team_size; } template int team_size_max(const FunctorType&, const ParallelReduceTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int pool_size = traits::execution_space::thread_pool_size(1); -#else - int pool_size = traits::execution_space::impl_thread_pool_size(1); -#endif + int pool_size = traits::execution_space::impl_thread_pool_size(1); int max_host_team_size = Impl::HostThreadTeamData::max_team_members; return pool_size < max_host_team_size ? pool_size : max_host_team_size; } @@ -144,20 +104,12 @@ class TeamPolicyInternal } template int team_size_recommended(const FunctorType&, const ParallelForTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return traits::execution_space::thread_pool_size(2); -#else return traits::execution_space::impl_thread_pool_size(2); -#endif } template int team_size_recommended(const FunctorType&, const ParallelReduceTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return traits::execution_space::thread_pool_size(2); -#else return traits::execution_space::impl_thread_pool_size(2); -#endif } template inline int team_size_recommended(const FunctorType& f, const ReducerType&, @@ -188,23 +140,16 @@ class TeamPolicyInternal int m_chunk_size; inline void init(const int league_size_request, const int team_size_request) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = traits::execution_space::thread_pool_size(0); - const int team_grain = traits::execution_space::thread_pool_size(2); -#else const int pool_size = traits::execution_space::impl_thread_pool_size(0); const int team_grain = traits::execution_space::impl_thread_pool_size(2); -#endif const int max_host_team_size = Impl::HostThreadTeamData::max_team_members; const int team_max = ((pool_size < max_host_team_size) ? pool_size : max_host_team_size); m_league_size = league_size_request; -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE if (team_size_request > team_max) Kokkos::abort("Kokkos::abort: Requested Team Size is too large!"); -#endif m_team_size = team_size_request < team_max ? team_size_request : team_max; // Round team size up to a multiple of 'team_gain' @@ -248,17 +193,10 @@ class TeamPolicyInternal int /* vector_length_request */ = 1) : m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, - m_chunk_size(0) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - { - init(league_size_request, traits::execution_space::thread_pool_size(2)); - } -#else - { + m_chunk_size(0) { init(league_size_request, traits::execution_space::impl_thread_pool_size(2)); } -#endif TeamPolicyInternal(int league_size_request, int team_size_request, int /* vector_length_request */ = 1) @@ -276,12 +214,7 @@ class TeamPolicyInternal m_thread_scratch_size{0, 0}, m_chunk_size(0) { init(league_size_request, -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - traits::execution_space::thread_pool_size(2) -#else - traits::execution_space::impl_thread_pool_size(2) -#endif - ); + traits::execution_space::impl_thread_pool_size(2)); } inline int team_alloc() const { return m_team_alloc; } @@ -289,38 +222,6 @@ class TeamPolicyInternal inline int chunk_size() const { return m_chunk_size; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal set_chunk_size( - typename traits::index_type chunk_size_) const { - TeamPolicyInternal p = *this; - p.m_chunk_size = chunk_size_; - return p; - } - - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - return p; - } - - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } - - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } -#else /** \brief set chunk_size to a discrete value*/ inline TeamPolicyInternal& set_chunk_size( typename traits::index_type chunk_size_) { @@ -349,58 +250,16 @@ class TeamPolicyInternal inline TeamPolicyInternal& set_scratch_size( const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { - m_team_scratch_size[level] = per_team.value; - m_thread_scratch_size[level] = per_thread.value; - return *this; - } -#endif - - protected: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal internal_set_chunk_size( - typename traits::index_type chunk_size_) { - m_chunk_size = chunk_size_; - return *this; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team) { - m_team_scratch_size[level] = per_team.value; - return *this; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerThreadValue& per_thread) { - m_thread_scratch_size[level] = per_thread.value; - return *this; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) { m_team_scratch_size[level] = per_team.value; m_thread_scratch_size[level] = per_thread.value; return *this; } -#endif private: /** \brief finalize chunk_size if it was set to AUTO*/ inline void set_auto_chunk_size() { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int concurrency = - traits::execution_space::thread_pool_size(0) / m_team_alloc; -#else int concurrency = traits::execution_space::impl_thread_pool_size(0) / m_team_alloc; -#endif if (concurrency == 0) concurrency = 1; if (m_chunk_size > 0) { @@ -421,7 +280,7 @@ class TeamPolicyInternal } public: - typedef Impl::HostThreadTeamMember member_type; + using member_type = Impl::HostThreadTeamMember; }; } // namespace Impl diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_ViewCopyETIAvail.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_ViewCopyETIAvail.hpp deleted file mode 100644 index 7bcd515f4c..0000000000 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_ViewCopyETIAvail.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_OPENMP_VIEWETIAVAIL_HPP -#define KOKKOS_OPENMP_VIEWETIAVAIL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::OpenMP - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_ViewCopyETIDecl.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_ViewCopyETIDecl.hpp deleted file mode 100644 index b5254e1275..0000000000 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_ViewCopyETIDecl.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_OPENMP_VIEWETIDECL_HPP -#define KOKKOS_OPENMP_VIEWETIDECL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::OpenMP - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif diff --git a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp index 4ff1486c68..92e4ee636a 100644 --- a/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/OpenMP/Kokkos_OpenMP_WorkGraphPolicy.hpp @@ -45,6 +45,8 @@ #ifndef KOKKOS_OPENMP_WORKGRAPHPOLICY_HPP #define KOKKOS_OPENMP_WORKGRAPHPOLICY_HPP +#include + namespace Kokkos { namespace Impl { @@ -52,7 +54,7 @@ template class ParallelFor, Kokkos::OpenMP> { private: - typedef Kokkos::WorkGraphPolicy Policy; + using Policy = Kokkos::WorkGraphPolicy; Policy m_policy; FunctorType m_functor; @@ -72,11 +74,7 @@ class ParallelFor, public: inline void execute() { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -#pragma omp parallel num_threads(OpenMP::thread_pool_size()) -#else #pragma omp parallel num_threads(OpenMP::impl_thread_pool_size()) -#endif { // Spin until COMPLETED_TOKEN. // END_TOKEN indicates no work is currently available. diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp index ab833b0363..ba67e66898 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTargetSpace.cpp @@ -193,9 +193,9 @@ void *SharedAllocationRecord:: SharedAllocationRecord *SharedAllocationRecord::get_record(void *alloc_ptr) { - typedef SharedAllocationHeader Header; - typedef SharedAllocationRecord - RecordHost; + using Header = SharedAllocationHeader; + using RecordHost = + SharedAllocationRecord; if (alloc_ptr) { Header head; diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp index b09dbeba3a..8bd04811c6 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.cpp @@ -50,7 +50,7 @@ #include #include #include -#include +#include #ifdef KOKKOS_ENABLE_OPENMPTARGET diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp index be6ddb5ed4..9ef3a752a8 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Exec.hpp @@ -49,9 +49,7 @@ #include #include -#include -#include -#include + namespace Kokkos { namespace Impl { @@ -96,8 +94,8 @@ class OpenMPTargetExecTeamMember { /** \brief Thread states for team synchronization */ enum { Active = 0, Rendezvous = 1 }; - typedef Kokkos::Experimental::OpenMPTarget execution_space; - typedef execution_space::scratch_memory_space scratch_memory_space; + using execution_space = Kokkos::Experimental::OpenMPTarget; + using scratch_memory_space = execution_space::scratch_memory_space; scratch_memory_space m_team_shared; int m_team_scratch_size[2]; @@ -172,8 +170,8 @@ class OpenMPTargetExecTeamMember { { } #else // Make sure there is enough scratch space: - typedef typename if_c< sizeof(ValueType) < TEAM_REDUCE_SIZE - , ValueType , void >::type type ; + using type = typename if_c< sizeof(ValueType) < TEAM_REDUCE_SIZE + , ValueType , void >::type; type * const local_value = ((type*) m_exec.scratch_thread()); if(team_rank() == thread_id) @@ -189,12 +187,12 @@ class OpenMPTargetExecTeamMember { const JoinOp& op_in) const { #pragma omp barrier - typedef ValueType value_type; + using value_type = ValueType; const JoinLambdaAdapter op(op_in); // Make sure there is enough scratch space: - typedef typename if_c::type type; + using type = typename if_c::type; const int n_values = TEAM_REDUCE_SIZE / sizeof(value_type); type* team_scratch = @@ -232,8 +230,8 @@ class OpenMPTargetExecTeamMember { KOKKOS_INLINE_FUNCTION ArgType team_scan(const ArgType& value, ArgType* const global_accum) const { /* // Make sure there is enough scratch space: - typedef typename if_c< sizeof(ArgType) < TEAM_REDUCE_SIZE , ArgType , void - >::type type ; + using type = + typename if_c::type; volatile type * const work_value = ((type*) m_exec.scratch_thread()); @@ -289,7 +287,7 @@ class OpenMPTargetExecTeamMember { // Private for the driver private: - typedef execution_space::scratch_memory_space space; + using space = execution_space::scratch_memory_space; public: inline OpenMPTargetExecTeamMember( @@ -320,23 +318,9 @@ class TeamPolicyInternal : public PolicyTraits { public: //! Tag this class as a kokkos execution policy - typedef TeamPolicyInternal execution_policy; + using execution_policy = TeamPolicyInternal; - typedef PolicyTraits traits; - - TeamPolicyInternal& operator=(const TeamPolicyInternal& p) { - m_league_size = p.m_league_size; - m_team_size = p.m_team_size; - m_vector_length = p.m_vector_length; - m_team_alloc = p.m_team_alloc; - m_team_iter = p.m_team_iter; - m_team_scratch_size[0] = p.m_team_scratch_size[0]; - m_thread_scratch_size[0] = p.m_thread_scratch_size[0]; - m_team_scratch_size[1] = p.m_team_scratch_size[1]; - m_thread_scratch_size[1] = p.m_thread_scratch_size[1]; - m_chunk_size = p.m_chunk_size; - return *this; - } + using traits = PolicyTraits; //---------------------------------------- @@ -459,38 +443,6 @@ class TeamPolicyInternal inline int chunk_size() const { return m_chunk_size; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal set_chunk_size( - typename traits::index_type chunk_size_) const { - TeamPolicyInternal p = *this; - p.m_chunk_size = chunk_size_; - return p; - } - - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - return p; - } - - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } - - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } -#else /** \brief set chunk_size to a discrete value*/ inline TeamPolicyInternal& set_chunk_size( typename traits::index_type chunk_size_) { @@ -523,43 +475,6 @@ class TeamPolicyInternal m_thread_scratch_size[level] = per_thread.value; return *this; } -#endif - - protected: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal internal_set_chunk_size( - typename traits::index_type chunk_size_) { - m_chunk_size = chunk_size_; - return *this; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team) { - m_team_scratch_size[level] = per_team.value; - return *this; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerThreadValue& per_thread) { - m_thread_scratch_size[level] = per_thread.value; - return *this; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) { - m_team_scratch_size[level] = per_team.value; - m_thread_scratch_size[level] = per_thread.value; - return *this; - } -#endif private: /** \brief finalize chunk_size if it was set to AUTO*/ @@ -586,7 +501,7 @@ class TeamPolicyInternal } public: - typedef Impl::OpenMPTargetExecTeamMember member_type; + using member_type = Impl::OpenMPTargetExecTeamMember; }; } // namespace Impl @@ -791,8 +706,8 @@ KOKKOS_INLINE_FUNCTION void parallel_scan( const Impl::ThreadVectorRangeBoundariesStruct< iType, Impl::OpenMPTargetExecTeamMember>& loop_boundaries, const FunctorType& lambda) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename ValueTraits::value_type value_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = typename ValueTraits::value_type; value_type scan_val = value_type(); diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp index d5b62f60b8..ee4549a78e 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel.hpp @@ -46,7 +46,7 @@ #define KOKKOS_OPENMPTARGET_PARALLEL_HPP #include -#include +#include // printf #include #include #include @@ -59,8 +59,12 @@ namespace Impl { template struct OpenMPTargetReducerWrapper { - typedef typename Reducer::value_type value_type; + using value_type = typename Reducer::value_type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target KOKKOS_INLINE_FUNCTION static void join(value_type&, const value_type&) { printf( @@ -81,14 +85,19 @@ struct OpenMPTargetReducerWrapper { "Using a generic unknown Reducer for the OpenMPTarget backend is not " "implemented."); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { dest += src; } @@ -102,14 +111,19 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::sum(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { dest *= src; } @@ -123,14 +137,19 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::prod(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -146,14 +165,19 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::min(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -170,14 +194,19 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::max(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { dest = dest && src; @@ -192,16 +221,21 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::land(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; - typedef Kokkos::View result_view_type; + using result_view_type = Kokkos::View; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -217,14 +251,19 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::lor(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -240,14 +279,19 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::band(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { public: // Required - typedef typename std::remove_cv::type value_type; + using value_type = typename std::remove_cv::type; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -263,18 +307,23 @@ struct OpenMPTargetReducerWrapper> { static void init(value_type& val) { val = reduction_identity::bor(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { private: - typedef typename std::remove_cv::type scalar_type; - typedef typename std::remove_cv::type index_type; + using scalar_type = typename std::remove_cv::type; + using index_type = typename std::remove_cv::type; public: // Required - typedef ValLocScalar value_type; + using value_type = ValLocScalar; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -291,18 +340,23 @@ struct OpenMPTargetReducerWrapper> { val.val = reduction_identity::min(); val.loc = reduction_identity::min(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { private: - typedef typename std::remove_cv::type scalar_type; - typedef typename std::remove_cv::type index_type; + using scalar_type = typename std::remove_cv::type; + using index_type = typename std::remove_cv::type; public: // Required - typedef ValLocScalar value_type; + using value_type = ValLocScalar; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { if (src.val > dest.val) dest = src; @@ -318,17 +372,22 @@ struct OpenMPTargetReducerWrapper> { val.val = reduction_identity::max(); val.loc = reduction_identity::min(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { private: - typedef typename std::remove_cv::type scalar_type; + using scalar_type = typename std::remove_cv::type; public: // Required - typedef MinMaxScalar value_type; + using value_type = MinMaxScalar; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -355,18 +414,23 @@ struct OpenMPTargetReducerWrapper> { val.max_val = reduction_identity::max(); val.min_val = reduction_identity::min(); } +#pragma omp end declare target }; template struct OpenMPTargetReducerWrapper> { private: - typedef typename std::remove_cv::type scalar_type; - typedef typename std::remove_cv::type index_type; + using scalar_type = typename std::remove_cv::type; + using index_type = typename std::remove_cv::type; public: // Required - typedef MinMaxLocScalar value_type; + using value_type = MinMaxLocScalar; +// WORKAROUND OPENMPTARGET +// This pragma omp declare target should not be necessary, but Intel compiler +// fails without it +#pragma omp declare target // Required KOKKOS_INLINE_FUNCTION static void join(value_type& dest, const value_type& src) { @@ -399,13 +463,14 @@ struct OpenMPTargetReducerWrapper> { val.max_loc = reduction_identity::min(); val.min_loc = reduction_identity::min(); } +#pragma omp end declare target }; /* template class OpenMPTargetReducerWrapper { public: const ReducerType& reducer; - typedef typename ReducerType::value_type value_type; + using value_type = typename ReducerType::value_type; value_type& value; KOKKOS_INLINE_FUNCTION @@ -429,10 +494,10 @@ template class ParallelFor, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using Policy = Kokkos::RangePolicy; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; const FunctorType m_functor; const Policy m_policy; @@ -519,7 +584,7 @@ template struct ParallelReduceSpecialize, ReducerType, PointerType, ValueType, 0, 0> { - typedef Kokkos::RangePolicy PolicyType; + using PolicyType = Kokkos::RangePolicy; template inline static typename std::enable_if::value>::type @@ -602,7 +667,6 @@ struct ParallelReduceSpecialize class ParallelReduce, ReducerType, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef - typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + using ReducerConditional = Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, + WorkTag, void>::type; // Static Assert WorkTag void if ReducerType not InvalidType - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; enum { HasJoin = ReduceFunctorHasJoin::value }; enum { UseReducer = is_reducer_type::value }; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; - typedef ParallelReduceSpecialize< + using ParReduceSpecialize = ParallelReduceSpecialize< FunctorType, Policy, ReducerType, pointer_type, - typename ValueTraits::value_type, HasJoin, UseReducer> - ParReduceSpecialize; + typename ValueTraits::value_type, HasJoin, UseReducer>; const FunctorType m_functor; const Policy m_policy; @@ -717,19 +777,19 @@ template class ParallelScan, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; + using ValueOps = Kokkos::Impl::FunctorValueOps; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -847,11 +907,10 @@ template class ParallelFor, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::Impl::TeamPolicyInternal - Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; + using Policy = Kokkos::Impl::TeamPolicyInternal; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; const FunctorType m_functor; const Policy m_policy; @@ -941,7 +1000,7 @@ template struct ParallelReduceSpecialize, ReducerType, PointerType, ValueType, 0, 0> { - typedef TeamPolicyInternal PolicyType; + using PolicyType = TeamPolicyInternal; template inline static @@ -1022,37 +1081,32 @@ template class ParallelReduce, ReducerType, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::Impl::TeamPolicyInternal - Policy; + using Policy = Kokkos::Impl::TeamPolicyInternal; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef - typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + using ReducerConditional = Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; - typedef typename ValueTraits::value_type value_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; + using value_type = typename ValueTraits::value_type; enum { HasJoin = ReduceFunctorHasJoin::value }; enum { UseReducer = is_reducer_type::value }; - typedef ParallelReduceSpecialize< + using ParForSpecialize = ParallelReduceSpecialize< FunctorType, Policy, ReducerType, pointer_type, - typename ValueTraits::value_type, HasJoin, UseReducer> - ParForSpecialize; + typename ValueTraits::value_type, HasJoin, UseReducer>; const FunctorType m_functor; const Policy m_policy; @@ -1104,7 +1158,7 @@ namespace Impl { template struct TeamThreadRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const iType start; const iType end; const iType increment; @@ -1123,7 +1177,7 @@ struct TeamThreadRangeBoundariesStruct { template struct ThreadVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const index_type start; const index_type end; const index_type increment; diff --git a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel_MDRange.hpp b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel_MDRange.hpp index 4ce2dee122..4e5d7b08c4 100644 --- a/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel_MDRange.hpp +++ b/lib/kokkos/core/src/OpenMPTarget/Kokkos_OpenMPTarget_Parallel_MDRange.hpp @@ -46,11 +46,15 @@ #define KOKKOS_OPENMPTARGET_PARALLEL_MDRANGE_HPP #include -#include #include #include #include +// WORKAROUND OPENMPTARGET: sometimes tile sizes don't make it correctly, +// this was tracked down to a bug in clang with regards of mapping structs +// with arrays of long in it. Arrays of int might be fine though ... +#define KOKKOS_IMPL_MDRANGE_USE_NO_TILES // undef EOF + //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -61,9 +65,9 @@ template class ParallelFor, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::MDRangePolicy Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; + using Policy = Kokkos::MDRangePolicy; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; const FunctorType m_functor; const Policy m_policy; @@ -78,9 +82,16 @@ class ParallelFor, const int64_t end = m_policy.m_num_tiles; FunctorType functor(m_functor); Policy policy = m_policy; + +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + typename Policy::point_type unused; + + execute_tile(unused, functor, policy); +#else #pragma omp target teams distribute map(to : functor) num_teams(end - begin) { for (ptrdiff_t tile_idx = begin; tile_idx < end; tile_idx++) { + #pragma omp parallel { typename Policy::point_type offset; @@ -101,12 +112,23 @@ class ParallelFor, } } } +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + + const int end_0 = policy.m_upper[0]; + +#pragma omp target teams distribute parallel for map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + functor(i0); + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -114,12 +136,27 @@ class ParallelFor, for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { functor(i0); } +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + +#pragma omp target teams distribute parallel for collapse(2) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + functor(i0, i1); + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -131,12 +168,31 @@ class ParallelFor, #pragma omp for collapse(2) for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) functor(i0, i1); +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + const int begin_2 = policy.m_lower[2]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + const int end_2 = policy.m_upper[2]; + +#pragma omp target teams distribute parallel for collapse(3) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) { + functor(i0, i1, i2); + } + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -153,12 +209,35 @@ class ParallelFor, for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) functor(i0, i1, i2); +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + const int begin_2 = policy.m_lower[2]; + const int begin_3 = policy.m_lower[3]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + const int end_2 = policy.m_upper[2]; + const int end_3 = policy.m_upper[3]; + +#pragma omp target teams distribute parallel for collapse(4) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) { + for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) { + functor(i0, i1, i2, i3); + } + } + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -181,12 +260,39 @@ class ParallelFor, for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) functor(i0, i1, i2, i3); +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + const int begin_2 = policy.m_lower[2]; + const int begin_3 = policy.m_lower[3]; + const int begin_4 = policy.m_lower[4]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + const int end_2 = policy.m_upper[2]; + const int end_3 = policy.m_upper[3]; + const int end_4 = policy.m_upper[4]; + +#pragma omp target teams distribute parallel for collapse(5) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) { + for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) { + for (ptrdiff_t i4 = begin_4; i4 < end_4; i4++) { + functor(i0, i1, i2, i3, i4); + } + } + } + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -214,12 +320,43 @@ class ParallelFor, for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) for (ptrdiff_t i4 = begin_4; i4 < end_4; i4++) functor(i0, i1, i2, i3, i4); +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + const int begin_2 = policy.m_lower[2]; + const int begin_3 = policy.m_lower[3]; + const int begin_4 = policy.m_lower[4]; + const int begin_5 = policy.m_lower[5]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + const int end_2 = policy.m_upper[2]; + const int end_3 = policy.m_upper[3]; + const int end_4 = policy.m_upper[4]; + const int end_5 = policy.m_upper[5]; + +#pragma omp target teams distribute parallel for collapse(6) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) { + for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) { + for (ptrdiff_t i4 = begin_4; i4 < end_4; i4++) { + for (ptrdiff_t i5 = begin_5; i5 < end_5; i5++) { + functor(i0, i1, i2, i3, i4, i5); + } + } + } + } + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -252,12 +389,47 @@ class ParallelFor, for (ptrdiff_t i4 = begin_4; i4 < end_4; i4++) for (ptrdiff_t i5 = begin_5; i5 < end_5; i5++) functor(i0, i1, i2, i3, i4, i5); +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + const int begin_2 = policy.m_lower[2]; + const int begin_3 = policy.m_lower[3]; + const int begin_4 = policy.m_lower[4]; + const int begin_5 = policy.m_lower[5]; + const int begin_6 = policy.m_lower[6]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + const int end_2 = policy.m_upper[2]; + const int end_3 = policy.m_upper[3]; + const int end_4 = policy.m_upper[4]; + const int end_5 = policy.m_upper[5]; + const int end_6 = policy.m_upper[6]; + +#pragma omp target teams distribute parallel for collapse(7) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) { + for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) { + for (ptrdiff_t i4 = begin_4; i4 < end_4; i4++) { + for (ptrdiff_t i5 = begin_5; i5 < end_5; i5++) { + for (ptrdiff_t i6 = begin_6; i6 < end_6; i6++) { + functor(i0, i1, i2, i3, i4, i5, i6); + } + } + } + } + } + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -295,12 +467,51 @@ class ParallelFor, for (ptrdiff_t i5 = begin_5; i5 < end_5; i5++) for (ptrdiff_t i6 = begin_6; i6 < end_6; i6++) functor(i0, i1, i2, i3, i4, i5, i6); +#endif } template inline typename std::enable_if::type execute_tile( typename Policy::point_type offset, const FunctorType& functor, const Policy& policy) const { +#ifdef KOKKOS_IMPL_MDRANGE_USE_NO_TILES + const int begin_0 = policy.m_lower[0]; + const int begin_1 = policy.m_lower[1]; + const int begin_2 = policy.m_lower[2]; + const int begin_3 = policy.m_lower[3]; + const int begin_4 = policy.m_lower[4]; + const int begin_5 = policy.m_lower[5]; + const int begin_6 = policy.m_lower[6]; + const int begin_7 = policy.m_lower[7]; + + const int end_0 = policy.m_upper[0]; + const int end_1 = policy.m_upper[1]; + const int end_2 = policy.m_upper[2]; + const int end_3 = policy.m_upper[3]; + const int end_4 = policy.m_upper[4]; + const int end_5 = policy.m_upper[5]; + const int end_6 = policy.m_upper[6]; + const int end_7 = policy.m_upper[7]; + +#pragma omp target teams distribute parallel for collapse(8) map(to : functor) + for (ptrdiff_t i0 = begin_0; i0 < end_0; i0++) { + for (ptrdiff_t i1 = begin_1; i1 < end_1; i1++) { + for (ptrdiff_t i2 = begin_2; i2 < end_2; i2++) { + for (ptrdiff_t i3 = begin_3; i3 < end_3; i3++) { + for (ptrdiff_t i4 = begin_4; i4 < end_4; i4++) { + for (ptrdiff_t i5 = begin_5; i5 < end_5; i5++) { + for (ptrdiff_t i6 = begin_6; i6 < end_6; i6++) { + for (ptrdiff_t i7 = begin_7; i7 < end_7; i7++) { + functor(i0, i1, i2, i3, i4, i5, i6, i7); + } + } + } + } + } + } + } + } +#else const ptrdiff_t begin_0 = offset[0]; ptrdiff_t end_0 = begin_0 + policy.m_tile[0]; end_0 = end_0 < policy.m_upper[0] ? end_0 : policy.m_upper[0]; @@ -343,6 +554,7 @@ class ParallelFor, for (ptrdiff_t i6 = begin_6; i6 < end_6; i6++) for (ptrdiff_t i7 = begin_7; i7 < end_7; i7++) functor(i0, i1, i2, i3, i4, i5, i6, i7); +#endif } inline ParallelFor(const FunctorType& arg_functor, Policy arg_policy) @@ -363,7 +575,7 @@ template , ReducerType, PointerType, ValueType, 0, 0> { - typedef Kokkos::RangePolicy PolicyType; + using PolicyType = Kokkos::RangePolicy; template inline static typename std::enable_if::value>::type @@ -468,37 +680,36 @@ template class ParallelReduce, ReducerType, Kokkos::Experimental::OpenMPTarget> { private: - typedef Kokkos::MDRangePolicy Policy; + using Policy = Kokkos::MDRangePolicy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; // Static Assert WorkTag void if ReducerType not InvalidType - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; enum { HasJoin = ReduceFunctorHasJoin::value }; enum { UseReducer = is_reducer_type::value }; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; - typedef ParallelReduceSpecialize< + using ParForSpecialize = ParallelReduceSpecialize< FunctorType, Policy, ReducerType, pointer_type, - typename ValueTraits::value_type, HasJoin, UseReducer> - ParForSpecialize; + typename ValueTraits::value_type, HasJoin, UseReducer>; const FunctorType m_functor; const Policy m_policy; @@ -545,5 +756,5 @@ class ParallelReduce, ReducerType, //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- - +#undef KOKKOS_IMPL_MDRANGE_USE_NO_TILES #endif /* KOKKOS_OPENMPTARGET_PARALLEL_HPP */ diff --git a/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp b/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp index 608c2ea9f7..fe844ae90c 100644 --- a/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp +++ b/lib/kokkos/core/src/ROCm/KokkosExp_ROCm_IterateTile_Refactor.hpp @@ -48,9 +48,7 @@ #include #if defined(__HCC__) && defined(KOKKOS_ENABLE_ROCM) -#include #include -#include #include @@ -60,10 +58,8 @@ // type is not allowed use existing Kokkos functionality, e.g. max blocks, once // resolved -#if defined(KOKKOS_ENABLE_PROFILING) -#include +#include #include -#endif #define threadIdx_x (hc_get_workitem_id(0)) #define threadIdx_y (hc_get_workitem_id(1)) diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp index aedde5b80a..a5903fc833 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Impl.cpp @@ -101,7 +101,7 @@ bool rocm_launch_blocking() if (env == 0) return false; - return atoi(env); + return std::stoi(env); } } @@ -295,7 +295,7 @@ class ROCmInternal { ROCmInternal& operator=(const ROCmInternal&); public: - typedef Kokkos::Experimental::ROCm::size_type size_type; + using size_type = Kokkos::Experimental::ROCm::size_type; int m_rocmDev; int m_rocmArch; @@ -516,8 +516,8 @@ void ROCmInternal::initialize(int rocm_device_id) { //---------------------------------------------------------------------------- -typedef Kokkos::Experimental::ROCm::size_type - ScratchGrain[Impl::ROCmTraits::WorkgroupSize]; +using ScratchGrain = + Kokkos::Experimental::ROCm::size_type[Impl::ROCmTraits::WorkgroupSize]; enum { sizeScratchGrain = sizeof(ScratchGrain) }; void rocmMemset(Kokkos::Experimental::ROCm::size_type* ptr, @@ -539,9 +539,9 @@ Kokkos::Experimental::ROCm::size_type* ROCmInternal::scratch_flags( m_scratchFlagsCount * sizeScratchGrain < size) { m_scratchFlagsCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord< - Kokkos::Experimental::ROCmSpace, void> - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; Record* const r = Record::allocate( Kokkos::Experimental::ROCmSpace(), "InternalScratchFlags", @@ -563,9 +563,9 @@ Kokkos::Experimental::ROCm::size_type* ROCmInternal::scratch_space( m_scratchSpaceCount * sizeScratchGrain < size) { m_scratchSpaceCount = (size + sizeScratchGrain - 1) / sizeScratchGrain; - typedef Kokkos::Impl::SharedAllocationRecord< - Kokkos::Experimental::ROCmSpace, void> - Record; + using Record = + Kokkos::Impl::SharedAllocationRecord; static Record* const r = Record::allocate( Kokkos::Experimental::ROCmSpace(), "InternalScratchSpace", @@ -589,12 +589,10 @@ void ROCmInternal::finalize() { // scratch_lock_array_rocm_space_ptr(false); // threadid_lock_array_rocm_space_ptr(false); - typedef Kokkos::Impl::SharedAllocationRecord< - Kokkos::Experimental::ROCmSpace> - RecordROCm; - typedef Kokkos::Impl::SharedAllocationRecord< - Kokkos::Experimental::ROCmHostPinnedSpace> - RecordHost; + using RecordROCm = + Kokkos::Impl::SharedAllocationRecord; + using RecordHost = Kokkos::Impl::SharedAllocationRecord< + Kokkos::Experimental::ROCmHostPinnedSpace>; RecordROCm::decrement(RecordROCm::get_record(m_scratchFlags)); RecordROCm::decrement(RecordROCm::get_record(m_scratchSpace)); @@ -659,9 +657,7 @@ int ROCm::is_initialized() { void ROCm::initialize(const ROCm::SelectDevice config) { Kokkos::Impl::ROCmInternal::singleton().initialize(config.rocm_device_id); -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::initialize(); -#endif } #if 0 @@ -688,9 +684,7 @@ ROCm::size_type ROCm::device_arch() void ROCm::finalize() { Kokkos::Impl::ROCmInternal::singleton().finalize(); -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::finalize(); -#endif } ROCm::ROCm() : m_device(Kokkos::Impl::ROCmInternal::singleton().m_rocmDev) { diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp index 8a4d8c07d0..bf87e80f85 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Parallel.hpp @@ -71,7 +71,7 @@ class TeamPolicyInternal public: using execution_policy = TeamPolicyInternal; using execution_space = Kokkos::Experimental::ROCm; - typedef PolicyTraits traits; + using traits = PolicyTraits; TeamPolicyInternal& operator=(const TeamPolicyInternal& p) { m_league_size = p.m_league_size; @@ -143,44 +143,6 @@ class TeamPolicyInternal inline int chunk_size() const { return m_chunk_size; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - KOKKOS_INLINE_FUNCTION TeamPolicyInternal - set_chunk_size(typename traits::index_type chunk_size_) const { - TeamPolicyInternal p = *this; - p.m_chunk_size = chunk_size_; - return p; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - return p; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } -#else /** \brief set chunk_size to a discrete value*/ inline TeamPolicyInternal& set_chunk_size( typename traits::index_type chunk_size_) { @@ -213,50 +175,13 @@ class TeamPolicyInternal m_thread_scratch_size[level] = per_thread.value; return *this; } -#endif - - protected: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal internal_set_chunk_size( - typename traits::index_type chunk_size_) { - m_chunk_size = chunk_size_; - return *this; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team) { - m_team_scratch_size[level] = per_team.value; - return *this; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerThreadValue& per_thread) { - m_thread_scratch_size[level] = per_thread.value; - return *this; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) { - m_team_scratch_size[level] = per_team.value; - m_thread_scratch_size[level] = per_thread.value; - return *this; - } -#endif public: // TODO: evaluate proper team_size_max requirements template KOKKOS_INLINE_FUNCTION static int team_size_max(const Functor_Type& functor) { - typedef typename Kokkos::Impl::FunctorValueTraits< - Functor_Type, typename traits::work_tag>::value_type value_type; + using value_type = typename Kokkos::Impl::FunctorValueTraits< + Functor_Type, typename traits::work_tag>::value_type; return team_size_recommended(functor); // return std::min(Kokkos::Impl::get_max_tile_size() / sizeof(value_type), // Kokkos::Impl::get_max_tile_thread()); @@ -313,13 +238,13 @@ class TeamPolicyInternal return level == 0 ? 1024 * 40 : 1024 * 1204 * 20; } - typedef Impl::ROCmTeamMember member_type; + using member_type = Impl::ROCmTeamMember; }; struct ROCmTeamMember { - typedef Kokkos::Experimental::ROCm execution_space; - typedef Kokkos::ScratchMemorySpace - scratch_memory_space; + using execution_space = Kokkos::Experimental::ROCm; + using scratch_memory_space = + Kokkos::ScratchMemorySpace; KOKKOS_INLINE_FUNCTION const scratch_memory_space& team_shmem() const { @@ -406,7 +331,7 @@ struct ROCmTeamMember { template KOKKOS_INLINE_FUNCTION ValueType team_reduce(const ValueType& value, const JoinOp& op_in) const { - typedef JoinLambdaAdapter JoinOpFunctor; + using JoinOpFunctor = JoinLambdaAdapter; const JoinOpFunctor op(op_in); tile_static ValueType buffer[512]; @@ -471,7 +396,7 @@ struct ROCmTeamMember { KOKKOS_INLINE_FUNCTION typename std::enable_if::value>::type team_reduce(const ReducerType& reducer) const { - typedef typename ReducerType::value_type value_type; + using value_type = typename ReducerType::value_type; tile_static value_type buffer[512]; const auto local = lindex(); @@ -533,7 +458,7 @@ struct ROCmTeamMember { template KOKKOS_INLINE_FUNCTION ValueType thread_reduce(const ValueType& value, const JoinOp& op_in) const { - typedef JoinLambdaAdapter JoinOpFunctor; + using JoinOpFunctor = JoinLambdaAdapter; const JoinOpFunctor op(op_in); const auto local = m_idx.local[0]; @@ -693,7 +618,7 @@ template class ParallelFor, Kokkos::Experimental::ROCm> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; public: inline ParallelFor(const FunctorType& f, const Policy& policy) { @@ -729,11 +654,11 @@ template class ParallelFor, Kokkos::Experimental::ROCm> { private: - typedef Kokkos::MDRangePolicy Policy; - using RP = Policy; - typedef typename Policy::array_index_type array_index_type; - typedef typename Policy::index_type index_type; - typedef typename Policy::launch_bounds LaunchBounds; + using Policy = Kokkos::MDRangePolicy; + using RP = Policy; + using array_index_type = typename Policy::array_index_type; + using index_type = typename Policy::index_type; + using LaunchBounds = typename Policy::launch_bounds; const FunctorType m_functor; const Policy m_rp; @@ -821,8 +746,8 @@ class ParallelFor, Kokkos::Experimental::ROCm> { using Policy = Kokkos::Impl::TeamPolicyInternal; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; public: inline ParallelFor(const F& f, const Policy& policy) { @@ -870,7 +795,7 @@ template class ParallelReduce, ReducerType, Kokkos::Experimental::ROCm> { public: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; // TODO: Use generic lambdas instead struct invoke_fn { @@ -889,10 +814,10 @@ class ParallelReduce, ReducerType, typename std::enable_if::value && !Kokkos::is_reducer_type::value, void*>::type = nullptr) { - typedef typename Policy::work_tag Tag; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef typename ValueTraits::reference_type reference_type; + using Tag = typename Policy::work_tag; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using reference_type = typename ValueTraits::reference_type; const auto total_size = policy.end() - policy.begin(); @@ -910,16 +835,16 @@ class ParallelReduce, ReducerType, inline ParallelReduce(const FunctorType& f, Policy policy, const ReducerType& reducer) { - typedef typename Policy::work_tag Tag; + using Tag = typename Policy::work_tag; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename ValueTraits::reference_type reference_type; + using reference_type = typename ValueTraits::reference_type; const auto total_size = policy.end() - policy.begin(); @@ -946,33 +871,33 @@ template class ParallelReduce, ReducerType, Kokkos::Experimental::ROCm> { private: - typedef Kokkos::MDRangePolicy Policy; - using RP = Policy; - typedef typename Policy::array_index_type array_index_type; - typedef typename Policy::index_type index_type; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; - typedef typename Policy::launch_bounds LaunchBounds; + using Policy = Kokkos::MDRangePolicy; + using RP = Policy; + using array_index_type = typename Policy::array_index_type; + using index_type = typename Policy::index_type; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; + using LaunchBounds = typename Policy::launch_bounds; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; public: - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::value_type value_type; - typedef typename ValueTraits::reference_type reference_type; - typedef FunctorType functor_type; - typedef Kokkos::Experimental::ROCm::size_type size_type; + using pointer_type = typename ValueTraits::pointer_type; + using value_type = typename ValueTraits::value_type; + using reference_type = typename ValueTraits::reference_type; + using functor_type = FunctorType; + using size_type = Kokkos::Experimental::ROCm::size_type; // Algorithmic constraints: blockSize is a power of two AND blockDim.y == // blockDim.z == 1 @@ -984,10 +909,9 @@ class ParallelReduce, ReducerType, value_type* m_scratch_space; size_type* m_scratch_flags; - typedef typename Kokkos::Impl::Reduce::DeviceIterateTile< + using DeviceIteratePattern = typename Kokkos::Impl::Reduce::DeviceIterateTile< Policy::rank, Policy, FunctorType, typename Policy::work_tag, - reference_type> - DeviceIteratePattern; + reference_type>; KOKKOS_INLINE_FUNCTION void exec_range(reference_type update) const { @@ -1129,9 +1053,8 @@ class ParallelReduce, ReducerType, Kokkos::Experimental::ROCm> { using Policy = Kokkos::Impl::TeamPolicyInternal; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; public: struct invoke_fn { @@ -1156,9 +1079,8 @@ class ParallelReduce, ReducerType, const int scratch_size1 = policy.scratch_size(1, team_size); const int total_size = league_size * team_size; - typedef Kokkos::Impl::FunctorValueInit - ValueInit; + using ValueInit = + Kokkos::Impl::FunctorValueInit; if (total_size == 0) { if (result_view.data()) { ValueInit::init(f, result_view.data()); @@ -1201,12 +1123,11 @@ class ParallelReduce, ReducerType, const int vector_length = policy.vector_length(); const int total_size = league_size * team_size; - typedef Kokkos::Impl::FunctorValueInit - ValueInit; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; + using ValueInit = + Kokkos::Impl::FunctorValueInit; + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; if (total_size == 0) { if (reducer.view().data()) { ValueInit::init(ReducerConditional::select(f, reducer), @@ -1251,9 +1172,9 @@ template class ParallelScan, Kokkos::Experimental::ROCm> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag Tag; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; + using Policy = Kokkos::RangePolicy; + using Tag = typename Policy::work_tag; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; public: //---------------------------------------- @@ -1277,9 +1198,9 @@ template class ParallelScanWithTotal, ReturnType, Kokkos::Experimental::ROCm> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag Tag; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; + using Policy = Kokkos::RangePolicy; + using Tag = typename Policy::work_tag; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; public: //---------------------------------------- @@ -1307,8 +1228,8 @@ class ParallelScan, private: using Policy = Kokkos::Impl::TeamPolicyInternal; - typedef typename Policy::work_tag Tag; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; + using Tag = typename Policy::work_tag; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; public: //---------------------------------------- @@ -1339,7 +1260,7 @@ namespace Kokkos { namespace Impl { template struct TeamThreadRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const iType start; const iType end; const iType increment; @@ -1374,7 +1295,7 @@ struct TeamThreadRangeBoundariesStruct { template struct ThreadVectorRangeBoundariesStruct { - typedef iType index_type; + using index_type = iType; const index_type start; const index_type end; const index_type increment; @@ -1450,7 +1371,7 @@ template KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< typename std::common_type::type, Impl::ROCmTeamMember> TeamThreadRange(const Impl::ROCmTeamMember& thread, iType1 begin, iType2 end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamThreadRangeBoundariesStruct( thread, begin, end); } @@ -1743,8 +1664,8 @@ KOKKOS_INLINE_FUNCTION void parallel_scan( const Impl::ThreadVectorRangeBoundariesStruct& loop_boundaries, const FunctorType& lambda) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename ValueTraits::value_type value_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = typename ValueTraits::value_type; value_type val = value_type(); const int vector_length = loop_boundaries.thread.vector_length(); diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp index 59a6a0433c..c5a16b80df 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Reduce.hpp @@ -49,8 +49,6 @@ #if !defined(KOKKOS_ROCM_AMP_REDUCE_INL) #define KOKKOS_ROCM_AMP_REDUCE_INL -#include - #include #include #include @@ -90,21 +88,21 @@ void reduce_enqueue(const int szElements, // size of the extent int const shared_size = 0) { using namespace hc; - typedef Kokkos::Impl::if_c::value, F, - ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, F, + ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using TagFwd = typename Kokkos::Impl::if_c::value, - Tag, void>::type TagFwd; + Tag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; - typedef Kokkos::Impl::FunctorFinal ValueFinal; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; + using ValueFinal = Kokkos::Impl::FunctorFinal; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; if (output_length < 1) return; diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp index 29694a012c..d2ad68aeef 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ReduceScan.hpp @@ -349,8 +349,8 @@ bool rocm_inter_block_reduction( ROCmTeamMember& team, ROCm::size_type * const m_scratch_flags, const int max_active_thread) { #ifdef __ROCM_ARCH__ - typedef typename FunctorValueTraits< FunctorType , ArgTag >::pointer_type pointer_type; - typedef typename FunctorValueTraits< FunctorType , ArgTag >::value_type value_type; + using pointer_type = typename FunctorValueTraits< FunctorType , ArgTag >::pointer_type; + using value_type = typename FunctorValueTraits< FunctorType , ArgTag >::value_type; //Do the intra-block reduction with shfl operations and static shared memory rocm_intra_block_reduction(value,join,max_active_thread); @@ -442,10 +442,10 @@ KOKKOS_INLINE_FUNCTION void rocm_intra_block_reduce_scan( const FunctorType &functor, const typename FunctorValueTraits::pointer_type base_data) { - typedef FunctorValueTraits ValueTraits; - typedef FunctorValueJoin ValueJoin; + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; - typedef typename ValueTraits::pointer_type pointer_type; + using pointer_type = typename ValueTraits::pointer_type; const unsigned value_count = ValueTraits::value_count(functor); const unsigned BlockSizeMask = blockDim_y - 1; @@ -582,15 +582,15 @@ KOKKOS_INLINE_FUNCTION bool rocm_single_inter_block_reduce_scan( typename FunctorValueTraits::value_type *const global_data, ROCM::size_type *const global_flags) { - typedef ROCM::size_type size_type; - typedef FunctorValueTraits ValueTraits; - typedef FunctorValueJoin ValueJoin; - typedef FunctorValueInit ValueInit; - typedef FunctorValueOps ValueOps; + using size_type = ROCM::size_type; + using ValueTraits = FunctorValueTraits; + using ValueJoin = FunctorValueJoin; + using ValueInit = FunctorValueInit; + using ValueOps = FunctorValueOps; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; - typedef typename ValueTraits::value_type value_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; + using value_type = typename ValueTraits::value_type; // '__ffs' = position of the least significant bit set to 1. // blockDim_y is guaranteed to be a power of two so this diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp index 337550b9f8..47ca6bc1e3 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Scan.hpp @@ -50,14 +50,14 @@ namespace Impl { template void scan_enqueue(const int len, const F& f, TransformIndex transform_index) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; + using ValueOps = Kokkos::Impl::FunctorValueOps; - typedef typename ValueTraits::value_type value_type; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using value_type = typename ValueTraits::value_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const auto td = get_tile_desc(len); std::vector result_cpu(td.num_tiles); @@ -148,14 +148,14 @@ void scan_enqueue(const int len, const F& f, TransformIndex transform_index) { template void scan_enqueue(const int len, const F& f, ReturnType& return_val, TransformIndex transform_index) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; - typedef Kokkos::Impl::FunctorValueJoin ValueJoin; - typedef Kokkos::Impl::FunctorValueOps ValueOps; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; + using ValueJoin = Kokkos::Impl::FunctorValueJoin; + using ValueOps = Kokkos::Impl::FunctorValueOps; - typedef typename ValueTraits::value_type value_type; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using value_type = typename ValueTraits::value_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const auto td = get_tile_desc(len); std::vector result_cpu(td.num_tiles); diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp index 1a79425f49..095aecf795 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Space.cpp @@ -59,9 +59,7 @@ #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include -#endif +#include /*--------------------------------------------------------------------------*/ /*--------------------------------------------------------------------------*/ @@ -299,17 +297,16 @@ void SharedAllocationRecord:: SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { SharedAllocationHeader header; Kokkos::Impl::DeepCopy( &header, RecordBase::m_alloc_ptr, sizeof(SharedAllocationHeader)); Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle(Kokkos::Experimental::ROCmSpace::name()), + Kokkos::Profiling::make_space_handle( + Kokkos::Experimental::ROCmSpace::name()), header.m_label, data(), size()); } -#endif m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, SharedAllocationRecord::m_alloc_size); @@ -317,14 +314,12 @@ SharedAllocationRecord::~SharedAllocationRecord() { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle( + Kokkos::Profiling::make_space_handle( Kokkos::Experimental::ROCmHostPinnedSpace::name()), RecordBase::m_alloc_ptr->m_label, data(), size()); } -#endif m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, SharedAllocationRecord::m_alloc_size); @@ -346,13 +341,11 @@ SharedAllocationRecord:: sizeof(SharedAllocationHeader) + arg_alloc_size)), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); + Kokkos::Profiling::make_space_handle(arg_space.name()), arg_label, + data(), arg_alloc_size); } -#endif SharedAllocationHeader header; @@ -385,13 +378,11 @@ SharedAllocationRecord:: sizeof(SharedAllocationHeader) + arg_alloc_size)), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); + Kokkos::Profiling::make_space_handle(arg_space.name()), arg_label, + data(), arg_alloc_size); } -#endif // Fill in the Header information, directly accessible via host pinned memory RecordBase::m_alloc_ptr->m_record = this; diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp index 5b04e95513..f7c66ae518 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Task.hpp @@ -182,7 +182,7 @@ KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< Impl::TaskExec > TeamThreadRange(Impl::TaskExec& thread, const iType1& begin, const iType2& end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamThreadRangeBoundariesStruct< iType, Impl::TaskExec >(thread, begin, end); } diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp index 3d80b4d440..58950fe3f6 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp +++ b/lib/kokkos/core/src/ROCm/Kokkos_ROCm_Tile.hpp @@ -213,9 +213,9 @@ void rocm_assign(T& x, const U& y) restrict(cpu, amp) { template struct tile_type { #if defined(ROCM15) - typedef T type; + using type = T; #else - typedef __attribute__((address_space(3))) T type; + using type = __attribute__((address_space(3))) T; #endif }; @@ -260,8 +260,8 @@ struct single_action { template struct tile_buffer : array_view::type>, single_action, T> { - typedef typename tile_type::type element_type; - typedef array_view base; + using element_type = typename tile_type::type; + using base = array_view; using base::base; @@ -273,8 +273,8 @@ struct tile_buffer : array_view::type>, template struct tile_buffer { - typedef typename tile_type::type element_type; - typedef typename tile_type::type tchar_type; + using element_type = typename tile_type::type; + using tchar_type = typename tile_type::type; element_type* element_data; std::size_t n, m; @@ -434,9 +434,9 @@ hc::completion_future tile_for(tile_desc td, F f) { return parallel_for_each( grid, [=](hc::tiled_index<1> t_idx) [[hc]] { #if defined(ROCM15) - typedef T group_t; + using group_t = T; #else - typedef __attribute__((address_space(3))) T group_t; + using group_t = __attribute__((address_space(3))) T; #endif group_t* buffer = (group_t*)hc::get_dynamic_group_segment_base_pointer(); diff --git a/lib/kokkos/core/src/Serial/Kokkos_Serial_ViewCopyETIAvail.hpp b/lib/kokkos/core/src/Serial/Kokkos_Serial_ViewCopyETIAvail.hpp deleted file mode 100644 index f7d18854dc..0000000000 --- a/lib/kokkos/core/src/Serial/Kokkos_Serial_ViewCopyETIAvail.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_SERIAL_VIEWETIAVAIL_HPP -#define KOKKOS_SERIAL_VIEWETIAVAIL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Serial - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif diff --git a/lib/kokkos/core/src/Serial/Kokkos_Serial_ViewCopyETIDecl.hpp b/lib/kokkos/core/src/Serial/Kokkos_Serial_ViewCopyETIDecl.hpp deleted file mode 100644 index 1410a7eeac..0000000000 --- a/lib/kokkos/core/src/Serial/Kokkos_Serial_ViewCopyETIDecl.hpp +++ /dev/null @@ -1,57 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_SERIAL_VIEWETIDECL_HPP -#define KOKKOS_SERIAL_VIEWETIDECL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Serial - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp index 7adfd127de..dba35ec521 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.cpp @@ -55,7 +55,7 @@ #include #include -#include +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -185,7 +185,7 @@ ThreadsExec::ThreadsExec() ThreadsExec::~ThreadsExec() { const unsigned entry = m_pool_size - (m_pool_rank + 1); - typedef Kokkos::Impl::SharedAllocationRecord Record; + using Record = Kokkos::Impl::SharedAllocationRecord; if (m_scratch) { Record *const r = Record::get_record(m_scratch); @@ -410,7 +410,7 @@ void *ThreadsExec::root_reduce_scratch() { } void ThreadsExec::execute_resize_scratch(ThreadsExec &exec, const void *) { - typedef Kokkos::Impl::SharedAllocationRecord Record; + using Record = Kokkos::Impl::SharedAllocationRecord; if (exec.m_scratch) { Record *const r = Record::get_record(exec.m_scratch); @@ -708,10 +708,6 @@ void ThreadsExec::initialize(unsigned thread_count, unsigned use_numa_count, Impl::init_lock_array_host_space(); Impl::SharedAllocationRecord::tracking_enable(); - -#if defined(KOKKOS_ENABLE_DEPRECATED_CODE) && defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::initialize(); -#endif } //---------------------------------------------------------------------------- @@ -759,9 +755,7 @@ void ThreadsExec::finalize() { s_threads_process.m_pool_fan_size = 0; s_threads_process.m_pool_state = ThreadsExec::Inactive; -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::finalize(); -#endif } //---------------------------------------------------------------------------- @@ -774,43 +768,20 @@ void ThreadsExec::finalize() { namespace Kokkos { -int Threads::concurrency() { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return thread_pool_size(0); -#else - return impl_thread_pool_size(0); -#endif -} -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE +int Threads::concurrency() { return impl_thread_pool_size(0); } void Threads::fence() const { Impl::ThreadsExec::fence(); } -#endif -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -Threads &Threads::instance(int) -#else -Threads &Threads::impl_instance(int) -#endif -{ +Threads &Threads::impl_instance(int) { static Threads t; return t; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -int Threads::thread_pool_size(int depth) -#else -int Threads::impl_thread_pool_size(int depth) -#endif -{ +int Threads::impl_thread_pool_size(int depth) { return Impl::s_thread_pool_size[depth]; } #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -int Threads::thread_pool_rank() -#else -int Threads::impl_thread_pool_rank() -#endif -{ +int Threads::impl_thread_pool_rank() { const pthread_t pid = pthread_self(); int i = 0; while ((i < Impl::s_thread_pool_size[0]) && (pid != Impl::s_threads_pid[i])) { diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp index 1b11f45b72..1c8b3ac5f6 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsExec.hpp @@ -57,6 +57,8 @@ #include #include +#include + //---------------------------------------------------------------------------- namespace Kokkos { @@ -258,8 +260,8 @@ class ThreadsExec { template inline void fan_in_reduce(const FunctorType &f) const { - typedef Kokkos::Impl::FunctorValueJoin Join; - typedef Kokkos::Impl::FunctorFinal Final; + using Join = Kokkos::Impl::FunctorValueJoin; + using Final = Kokkos::Impl::FunctorFinal; const int rev_rank = m_pool_size - (m_pool_rank + 1); @@ -305,11 +307,11 @@ class ThreadsExec { // 3) Rendezvous : All threads inclusive scan value are available // 4) ScanCompleted : exclusive scan value copied - typedef Kokkos::Impl::FunctorValueTraits Traits; - typedef Kokkos::Impl::FunctorValueJoin Join; - typedef Kokkos::Impl::FunctorValueInit Init; + using Traits = Kokkos::Impl::FunctorValueTraits; + using Join = Kokkos::Impl::FunctorValueJoin; + using Init = Kokkos::Impl::FunctorValueInit; - typedef typename Traits::value_type scalar_type; + using scalar_type = typename Traits::value_type; const int rev_rank = m_pool_size - (m_pool_rank + 1); const unsigned count = Traits::value_count(f); @@ -411,11 +413,11 @@ class ThreadsExec { template inline void scan_small(const FunctorType &f) { - typedef Kokkos::Impl::FunctorValueTraits Traits; - typedef Kokkos::Impl::FunctorValueJoin Join; - typedef Kokkos::Impl::FunctorValueInit Init; + using Traits = Kokkos::Impl::FunctorValueTraits; + using Join = Kokkos::Impl::FunctorValueJoin; + using Init = Kokkos::Impl::FunctorValueInit; - typedef typename Traits::value_type scalar_type; + using scalar_type = typename Traits::value_type; const int rev_rank = m_pool_size - (m_pool_rank + 1); const unsigned count = Traits::value_count(f); @@ -441,7 +443,7 @@ class ThreadsExec { } else { // Root thread does the thread-scan before releasing threads - scalar_type *ptr_prev = 0; + scalar_type *ptr_prev = nullptr; for (int rank = 0; rank < m_pool_size; ++rank) { scalar_type *const ptr = @@ -614,52 +616,26 @@ namespace Kokkos { inline int Threads::in_parallel() { return Impl::ThreadsExec::in_parallel(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -inline int Threads::is_initialized() { - return Impl::ThreadsExec::is_initialized(); -} -#else inline int Threads::impl_is_initialized() { return Impl::ThreadsExec::is_initialized(); } -#endif -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -inline void Threads::initialize( -#else -inline void Threads::impl_initialize( -#endif - unsigned threads_count, unsigned use_numa_count, - unsigned use_cores_per_numa, bool allow_asynchronous_threadpool) { +inline void Threads::impl_initialize(unsigned threads_count, + unsigned use_numa_count, + unsigned use_cores_per_numa, + bool allow_asynchronous_threadpool) { Impl::ThreadsExec::initialize(threads_count, use_numa_count, use_cores_per_numa, allow_asynchronous_threadpool); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -inline void Threads::finalize() -#else -inline void Threads::impl_finalize() -#endif -{ - Impl::ThreadsExec::finalize(); -} +inline void Threads::impl_finalize() { Impl::ThreadsExec::finalize(); } inline void Threads::print_configuration(std::ostream &s, const bool detail) { Impl::ThreadsExec::print_configuration(s, detail); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -inline bool Threads::sleep() { return Impl::ThreadsExec::sleep(); } - -inline bool Threads::wake() { return Impl::ThreadsExec::wake(); } -#endif - inline void Threads::impl_static_fence() { Impl::ThreadsExec::fence(); } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -inline void Threads::fence() { Impl::ThreadsExec::fence(); } -#endif - } /* namespace Kokkos */ //---------------------------------------------------------------------------- @@ -670,6 +646,12 @@ namespace Experimental { template <> class UniqueToken { + private: + using buffer_type = Kokkos::View; + int m_count; + buffer_type m_buffer_view; + uint32_t volatile *m_buffer; + public: using execution_space = Threads; using size_type = int; @@ -677,38 +659,61 @@ class UniqueToken { /// \brief create object size for concurrency on the given instance /// /// This object should not be shared between instances - UniqueToken(execution_space const & = execution_space()) noexcept {} + UniqueToken(execution_space const & = execution_space()) noexcept + : m_count(::Kokkos::Threads::impl_thread_pool_size()), + m_buffer_view(buffer_type()), + m_buffer(nullptr) {} + + UniqueToken(size_type max_size, execution_space const & = execution_space()) + : m_count(max_size > ::Kokkos::Threads::impl_thread_pool_size() + ? ::Kokkos::Threads::impl_thread_pool_size() + : max_size), + m_buffer_view( + max_size > ::Kokkos::Threads::impl_thread_pool_size() + ? buffer_type() + : buffer_type("UniqueToken::m_buffer_view", + ::Kokkos::Impl::concurrent_bitset::buffer_bound( + m_count))), + m_buffer(m_buffer_view.data()) {} /// \brief upper bound for acquired values, i.e. 0 <= value < size() - inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - size() const noexcept { - return Threads::thread_pool_size(); - } -#else - int - size() const noexcept { - return Threads::impl_thread_pool_size(); - } -#endif + KOKKOS_INLINE_FUNCTION + int size() const noexcept { return m_count; } /// \brief acquire value such that 0 <= value < size() - inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - acquire() const noexcept { - return Threads::thread_pool_rank(); - } + KOKKOS_INLINE_FUNCTION + int acquire() const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (m_buffer == nullptr) { + return Threads::impl_thread_pool_rank(); + } else { + const ::Kokkos::pair result = + ::Kokkos::Impl::concurrent_bitset::acquire_bounded( + m_buffer, m_count, ::Kokkos::Impl::clock_tic() % m_count); + + if (result.first < 0) { + ::Kokkos::abort( + "UniqueToken failure to acquire tokens, no tokens " + "available"); + } + return result.first; + } #else - int - acquire() const noexcept { - return Threads::impl_thread_pool_rank(); - } + return 0; #endif + } /// \brief release a value acquired by generate - inline void release(int) const noexcept {} + KOKKOS_INLINE_FUNCTION + void release(int i) const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (m_buffer != nullptr) { + ::Kokkos::Impl::concurrent_bitset::release(m_buffer, i); + } +#else + (void)i; +#endif + } }; template <> @@ -723,34 +728,28 @@ class UniqueToken { UniqueToken(execution_space const & = execution_space()) noexcept {} /// \brief upper bound for acquired values, i.e. 0 <= value < size() - inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - size() const noexcept { - return Threads::thread_pool_size(); - } -#else - int - size() const noexcept { + KOKKOS_INLINE_FUNCTION + int size() const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) return Threads::impl_thread_pool_size(); - } +#else + return 0; #endif + } /// \brief acquire value such that 0 <= value < size() - inline -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int - acquire() const noexcept { - return Threads::thread_pool_rank(); - } -#else - int - acquire() const noexcept { + KOKKOS_INLINE_FUNCTION + int acquire() const noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) return Threads::impl_thread_pool_rank(); - } +#else + return 0; #endif + } + /// \brief release a value acquired by generate - inline void release(int) const noexcept {} + KOKKOS_INLINE_FUNCTION + void release(int) const noexcept {} }; } // namespace Experimental diff --git a/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp b/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp index fe1a1e8b08..dafd2c68c9 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_ThreadsTeam.hpp @@ -74,11 +74,11 @@ class ThreadsExecTeamMember { enum { TEAM_REDUCE_SIZE = 512 }; public: - typedef Kokkos::Threads execution_space; - typedef execution_space::scratch_memory_space scratch_memory_space; + using execution_space = Kokkos::Threads; + using scratch_memory_space = execution_space::scratch_memory_space; private: - typedef execution_space::scratch_memory_space space; + using space = execution_space::scratch_memory_space; ThreadsExec* const m_exec; ThreadsExec* const* m_team_base; ///< Base for team fan-in space m_team_shared; @@ -175,8 +175,8 @@ class ThreadsExecTeamMember { } #else // Make sure there is enough scratch space: - typedef typename if_c::type type; + using type = typename if_c::type; if (m_team_base) { type* const local_value = ((type*)m_team_base[0]->scratch_memory()); @@ -201,8 +201,8 @@ class ThreadsExecTeamMember { } #else // Make sure there is enough scratch space: - typedef typename if_c::type type; + using type = typename if_c::type; f(value); if (m_team_base) { type* const local_value = ((type*)m_team_base[0]->scratch_memory()); @@ -227,10 +227,10 @@ class ThreadsExecTeamMember { #else { // Make sure there is enough scratch space: - typedef - typename if_c::type type; + using type = + typename if_c::type; - if (0 == m_exec) return value; + if (nullptr == m_exec) return value; if (team_rank() != team_size() - 1) *((volatile type*)m_exec->scratch_memory()) = value; @@ -270,12 +270,12 @@ class ThreadsExecTeamMember { #else team_reduce(const ReducerType& reducer, const typename ReducerType::value_type contribution) const { - typedef typename ReducerType::value_type value_type; + using value_type = typename ReducerType::value_type; // Make sure there is enough scratch space: - typedef typename if_c::type type; + using type = typename if_c::type; - if (0 == m_exec) return; + if (nullptr == m_exec) return; type* const local_value = ((type*)m_exec->scratch_memory()); @@ -333,11 +333,10 @@ class ThreadsExecTeamMember { #else { // Make sure there is enough scratch space: - typedef - typename if_c::type - type; + using type = + typename if_c::type; - if (0 == m_exec) return type(0); + if (nullptr == m_exec) return type(0); volatile type* const work_value = ((type*)m_exec->scratch_memory()); @@ -386,7 +385,7 @@ class ThreadsExecTeamMember { */ template KOKKOS_INLINE_FUNCTION ArgType team_scan(const ArgType& value) const { - return this->template team_scan(value, 0); + return this->template team_scan(value, nullptr); } //---------------------------------------- @@ -398,8 +397,8 @@ class ThreadsExecTeamMember { const TeamPolicyInternal& team, const int shared_size) : m_exec(exec), - m_team_base(0), - m_team_shared(0, 0), + m_team_base(nullptr), + m_team_shared(nullptr, 0), m_team_shared_size(shared_size), m_team_size(team.team_size()), m_team_rank(0), @@ -479,9 +478,9 @@ class ThreadsExecTeamMember { } ThreadsExecTeamMember() - : m_exec(0), - m_team_base(0), - m_team_shared(0, 0), + : m_exec(nullptr), + m_team_base(nullptr), + m_team_shared(nullptr, 0), m_team_shared_size(0), m_team_size(1), m_team_rank(0), @@ -578,26 +577,16 @@ class TeamPolicyInternal int m_chunk_size; inline void init(const int league_size_request, const int team_size_request) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = traits::execution_space::thread_pool_size(0); -#else const int pool_size = traits::execution_space::impl_thread_pool_size(0); -#endif const int max_host_team_size = Impl::HostThreadTeamData::max_team_members; const int team_max = pool_size < max_host_team_size ? pool_size : max_host_team_size; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int team_grain = traits::execution_space::thread_pool_size(2); -#else const int team_grain = traits::execution_space::impl_thread_pool_size(2); -#endif m_league_size = league_size_request; -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE if (team_size_request > team_max) Kokkos::abort("Kokkos::abort: Requested Team Size is too large!"); -#endif m_team_size = team_size_request < team_max ? team_size_request : team_max; @@ -618,28 +607,15 @@ class TeamPolicyInternal public: //! Tag this class as a kokkos execution policy //! Tag this class as a kokkos execution policy - typedef TeamPolicyInternal execution_policy; + using execution_policy = TeamPolicyInternal; - typedef PolicyTraits traits; + using traits = PolicyTraits; const typename traits::execution_space& space() const { static typename traits::execution_space m_space; return m_space; } - TeamPolicyInternal& operator=(const TeamPolicyInternal& p) { - m_league_size = p.m_league_size; - m_team_size = p.m_team_size; - m_team_alloc = p.m_team_alloc; - m_team_iter = p.m_team_iter; - m_team_scratch_size[0] = p.m_team_scratch_size[0]; - m_thread_scratch_size[0] = p.m_thread_scratch_size[0]; - m_team_scratch_size[1] = p.m_team_scratch_size[1]; - m_thread_scratch_size[1] = p.m_thread_scratch_size[1]; - m_chunk_size = p.m_chunk_size; - return *this; - } - template friend class TeamPolicyInternal; @@ -659,42 +635,15 @@ class TeamPolicyInternal //---------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - template - inline static int team_size_max(const FunctorType&) { - int pool_size = traits::execution_space::thread_pool_size(1); - int max_host_team_size = Impl::HostThreadTeamData::max_team_members; - return pool_size < max_host_team_size ? pool_size : max_host_team_size; - } - - template - inline static int team_size_recommended(const FunctorType&) { - return traits::execution_space::thread_pool_size(2); - } - - template - inline static int team_size_recommended(const FunctorType&, const int&) { - return traits::execution_space::thread_pool_size(2); - } -#endif - template int team_size_max(const FunctorType&, const ParallelForTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int pool_size = traits::execution_space::thread_pool_size(1); -#else - int pool_size = traits::execution_space::impl_thread_pool_size(1); -#endif + int pool_size = traits::execution_space::impl_thread_pool_size(1); int max_host_team_size = Impl::HostThreadTeamData::max_team_members; return pool_size < max_host_team_size ? pool_size : max_host_team_size; } template int team_size_max(const FunctorType&, const ParallelReduceTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int pool_size = traits::execution_space::thread_pool_size(1); -#else - int pool_size = traits::execution_space::impl_thread_pool_size(1); -#endif + int pool_size = traits::execution_space::impl_thread_pool_size(1); int max_host_team_size = Impl::HostThreadTeamData::max_team_members; return pool_size < max_host_team_size ? pool_size : max_host_team_size; } @@ -705,20 +654,12 @@ class TeamPolicyInternal } template int team_size_recommended(const FunctorType&, const ParallelForTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return traits::execution_space::thread_pool_size(2); -#else return traits::execution_space::impl_thread_pool_size(2); -#endif } template int team_size_recommended(const FunctorType&, const ParallelReduceTag&) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - return traits::execution_space::thread_pool_size(2); -#else return traits::execution_space::impl_thread_pool_size(2); -#endif } template inline int team_size_recommended(const FunctorType& f, const ReducerType&, @@ -773,17 +714,10 @@ class TeamPolicyInternal m_team_alloc(0), m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, - m_chunk_size(0) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - { - init(league_size_request, traits::execution_space::thread_pool_size(2)); - } -#else - { + m_chunk_size(0) { init(league_size_request, traits::execution_space::impl_thread_pool_size(2)); } -#endif TeamPolicyInternal(int league_size_request, int team_size_request, int /* vector_length_request */ = 1) @@ -805,57 +739,13 @@ class TeamPolicyInternal m_team_alloc(0), m_team_scratch_size{0, 0}, m_thread_scratch_size{0, 0}, - m_chunk_size(0) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - { - init(league_size_request, traits::execution_space::thread_pool_size(2)); - } -#else - { + m_chunk_size(0) { init(league_size_request, traits::execution_space::impl_thread_pool_size(2)); } -#endif + inline int chunk_size() const { return m_chunk_size; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal set_chunk_size( - typename traits::index_type chunk_size_) const { - TeamPolicyInternal p = *this; - p.m_chunk_size = chunk_size_; - return p; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - return p; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) const { - TeamPolicyInternal p = *this; - p.m_team_scratch_size[level] = per_team.value; - p.m_thread_scratch_size[level] = per_thread.value; - return p; - } -#else /** \brief set chunk_size to a discrete value*/ inline TeamPolicyInternal& set_chunk_size( typename traits::index_type chunk_size_) { @@ -884,47 +774,10 @@ class TeamPolicyInternal inline TeamPolicyInternal& set_scratch_size( const int& level, const PerTeamValue& per_team, const PerThreadValue& per_thread) { - m_team_scratch_size[level] = per_team.value; - m_thread_scratch_size[level] = per_thread.value; - return *this; - } -#endif - - protected: -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - /** \brief set chunk_size to a discrete value*/ - inline TeamPolicyInternal internal_set_chunk_size( - typename traits::index_type chunk_size_) { - m_chunk_size = chunk_size_; - return *this; - } - - /** \brief set per team scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team) { - m_team_scratch_size[level] = per_team.value; - return *this; - } - - /** \brief set per thread scratch size for a specific level of the scratch - * hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerThreadValue& per_thread) { - m_thread_scratch_size[level] = per_thread.value; - return *this; - } - - /** \brief set per thread and per team scratch size for a specific level of - * the scratch hierarchy */ - inline TeamPolicyInternal internal_set_scratch_size( - const int& level, const PerTeamValue& per_team, - const PerThreadValue& per_thread) { m_team_scratch_size[level] = per_team.value; m_thread_scratch_size[level] = per_thread.value; return *this; } -#endif private: /** \brief finalize chunk_size if it was set to AUTO*/ @@ -950,7 +803,7 @@ class TeamPolicyInternal } public: - typedef Impl::ThreadsExecTeamMember member_type; + using member_type = Impl::ThreadsExecTeamMember; friend class Impl::ThreadsExecTeamMember; }; @@ -976,7 +829,7 @@ KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< Impl::ThreadsExecTeamMember> TeamThreadRange(const Impl::ThreadsExecTeamMember& thread, const iType1& begin, const iType2& end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamThreadRangeBoundariesStruct( thread, iType(begin), iType(end)); @@ -998,7 +851,7 @@ KOKKOS_INLINE_FUNCTION Impl::TeamThreadRangeBoundariesStruct< Impl::ThreadsExecTeamMember> TeamVectorRange(const Impl::ThreadsExecTeamMember& thread, const iType1& begin, const iType2& end) { - typedef typename std::common_type::type iType; + using iType = typename std::common_type::type; return Impl::TeamThreadRangeBoundariesStruct( thread, iType(begin), iType(end)); @@ -1167,8 +1020,8 @@ KOKKOS_INLINE_FUNCTION void parallel_scan( const Impl::ThreadVectorRangeBoundariesStruct< iType, Impl::ThreadsExecTeamMember>& loop_boundaries, const FunctorType& lambda) { - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef typename ValueTraits::value_type value_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using value_type = typename ValueTraits::value_type; value_type scan_val = value_type(); diff --git a/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp b/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp index fbc83e9a55..e36c1ea664 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_Threads_Parallel.hpp @@ -48,9 +48,6 @@ #include #if defined(KOKKOS_ENABLE_THREADS) -#include -#include - #include #include @@ -70,10 +67,10 @@ template class ParallelFor, Kokkos::Threads> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using Policy = Kokkos::RangePolicy; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; const FunctorType m_functor; const Policy m_policy; @@ -171,17 +168,16 @@ template class ParallelFor, Kokkos::Threads> { private: - typedef Kokkos::MDRangePolicy MDRangePolicy; - typedef typename MDRangePolicy::impl_range_policy Policy; + using MDRangePolicy = Kokkos::MDRangePolicy; + using Policy = typename MDRangePolicy::impl_range_policy; - typedef typename MDRangePolicy::work_tag WorkTag; + using WorkTag = typename MDRangePolicy::work_tag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef typename Kokkos::Impl::HostIterateTile< - MDRangePolicy, FunctorType, typename MDRangePolicy::work_tag, void> - iterate_type; + using iterate_type = typename Kokkos::Impl::HostIterateTile< + MDRangePolicy, FunctorType, typename MDRangePolicy::work_tag, void>; const FunctorType m_functor; const MDRangePolicy m_mdr_policy; @@ -266,10 +262,10 @@ template class ParallelFor, Kokkos::Threads> { private: - typedef Kokkos::Impl::TeamPolicyInternal - Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; + using Policy = + Kokkos::Impl::TeamPolicyInternal; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; const FunctorType m_functor; const Policy m_policy; @@ -353,26 +349,26 @@ template class ParallelReduce, ReducerType, Kokkos::Threads> { private: - typedef Kokkos::RangePolicy Policy; + using Policy = Kokkos::RangePolicy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename Policy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -523,28 +519,28 @@ template class ParallelReduce, ReducerType, Kokkos::Threads> { private: - typedef Kokkos::MDRangePolicy MDRangePolicy; - typedef typename MDRangePolicy::impl_range_policy Policy; + using MDRangePolicy = Kokkos::MDRangePolicy; + using Policy = typename MDRangePolicy::impl_range_policy; - typedef typename MDRangePolicy::work_tag WorkTag; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::member_type Member; + using WorkTag = typename MDRangePolicy::work_tag; + using WorkRange = typename Policy::WorkRange; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::value_type value_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using value_type = typename ValueTraits::value_type; + using reference_type = typename ValueTraits::reference_type; using iterate_type = typename Kokkos::Impl::HostIterateTile class ParallelReduce, ReducerType, Kokkos::Threads> { private: - typedef Kokkos::Impl::TeamPolicyInternal - Policy; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; + using Policy = + Kokkos::Impl::TeamPolicyInternal; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; - typedef Kokkos::Impl::if_c::value, - FunctorType, ReducerType> - ReducerConditional; - typedef typename ReducerConditional::type ReducerTypeFwd; - typedef + using ReducerConditional = + Kokkos::Impl::if_c::value, + FunctorType, ReducerType>; + using ReducerTypeFwd = typename ReducerConditional::type; + using WorkTagFwd = typename Kokkos::Impl::if_c::value, - WorkTag, void>::type WorkTagFwd; + WorkTag, void>::type; - typedef Kokkos::Impl::FunctorValueTraits - ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using ValueTraits = + Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -807,15 +803,15 @@ template class ParallelScan, Kokkos::Threads> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using Policy = Kokkos::RangePolicy; + using WorkRange = typename Policy::WorkRange; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const FunctorType m_functor; const Policy m_policy; @@ -884,15 +880,15 @@ template class ParallelScanWithTotal, ReturnType, Kokkos::Threads> { private: - typedef Kokkos::RangePolicy Policy; - typedef typename Policy::WorkRange WorkRange; - typedef typename Policy::work_tag WorkTag; - typedef typename Policy::member_type Member; - typedef Kokkos::Impl::FunctorValueTraits ValueTraits; - typedef Kokkos::Impl::FunctorValueInit ValueInit; + using Policy = Kokkos::RangePolicy; + using WorkRange = typename Policy::WorkRange; + using WorkTag = typename Policy::work_tag; + using Member = typename Policy::member_type; + using ValueTraits = Kokkos::Impl::FunctorValueTraits; + using ValueInit = Kokkos::Impl::FunctorValueInit; - typedef typename ValueTraits::pointer_type pointer_type; - typedef typename ValueTraits::reference_type reference_type; + using pointer_type = typename ValueTraits::pointer_type; + using reference_type = typename ValueTraits::reference_type; const FunctorType m_functor; const Policy m_policy; diff --git a/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp b/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp index 7bcd9aaee0..401f3c0b1a 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/Threads/Kokkos_Threads_WorkGraphPolicy.hpp @@ -45,6 +45,9 @@ #ifndef KOKKOS_THREADS_WORKGRAPHPOLICY_HPP #define KOKKOS_THREADS_WORKGRAPHPOLICY_HPP +#include +#include + namespace Kokkos { namespace Impl { @@ -52,11 +55,10 @@ template class ParallelFor, Kokkos::Threads> { private: - typedef Kokkos::WorkGraphPolicy Policy; + using Policy = Kokkos::WorkGraphPolicy; - typedef ParallelFor, - Kokkos::Threads> - Self; + using Self = ParallelFor, + Kokkos::Threads>; Policy m_policy; FunctorType m_functor; diff --git a/lib/kokkos/core/src/eti/CMakeLists.txt b/lib/kokkos/core/src/eti/CMakeLists.txt deleted file mode 100644 index a7e7717a6e..0000000000 --- a/lib/kokkos/core/src/eti/CMakeLists.txt +++ /dev/null @@ -1,25 +0,0 @@ -if (KOKKOS_ENABLE_CUDA) - add_subdirectory(Cuda) -endif() -if (KOKKOS_ENABLE_OPENMP) - add_subdirectory(OpenMP) -endif() -if (KOKKOS_ENABLE_HPX) - add_subdirectory(HPX) -endif() -if (KOKKOS_ENABLE_ROCM) - add_subdirectory(ROCm) -endif() -if (KOKKOS_ENABLE_SERIAL) - add_subdirectory(Serial) -endif() -if (KOKKOS_ENABLE_THREADS) - add_subdirectory(Threads) -endif() - -set(ETI_SOURCES "${ETI_SOURCES}" PARENT_SCOPE) - -install(FILES -common/Kokkos_ViewFillCopyETIAvail_Macros.hpp -common/Kokkos_ViewFillCopyETIDecl_Macros.hpp -DESTINATION include/eti/common) diff --git a/lib/kokkos/core/src/eti/Cuda/CMakeLists.txt b/lib/kokkos/core/src/eti/Cuda/CMakeLists.txt deleted file mode 100644 index 8d635ba36f..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/CMakeLists.txt +++ /dev/null @@ -1,148 +0,0 @@ -set(D "${CMAKE_CURRENT_SOURCE_DIR}") -set(ETI_SOURCES -${ETI_SOURCES} -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -${D}/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -PARENT_SCOPE) diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index a72781d8a0..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 86600a2d38..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 1f4e93ec2b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index e6d965eb48..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index 5bb1ce76e6..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index cad6e9b671..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 5c31da459e..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp deleted file mode 100644 index 7ef6acb4b1..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 5680b8581c..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp deleted file mode 100644 index bae1ee8827..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 9ad5912c0b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp deleted file mode 100644 index 12806d1c5b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 0330b205db..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp deleted file mode 100644 index 10e894125d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 7cec352662..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 5bb6913cce..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp deleted file mode 100644 index f138a2049a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp deleted file mode 100644 index e1901422d1..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index dab83bfb18..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index 522303b447..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 608b4d4c27..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 2c33f7facd..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 3ad16222e4..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 47f39d7ae2..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp deleted file mode 100644 index bca253b756..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 20fadbd5d8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 4d4716510e..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 42fa2c7b4e..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp deleted file mode 100644 index a3cd8cc994..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 9efcc720c3..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp deleted file mode 100644 index c34c6a391f..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 6d7cf16fa5..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp deleted file mode 100644 index ddd65c01a8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp deleted file mode 100644 index ae41d19395..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 5d349b6990..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index c60df37674..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index cfce1b7916..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 659ef18377..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index 84eb991853..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 7f98cebd64..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index f26ae1e4e1..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index a5167f6fa8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 60658f0bd7..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index f74d41f902..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 0345966748..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index bfbaaaec7a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 1be20a18fc..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 51394ca352..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index df4ef48e33..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 83671a7caa..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index e652e268be..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 2b6b50a890..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 072569f7ec..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index b2bb00cb89..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 39615042ee..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index e557600c6c..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 0e31670af8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 873bcb274e..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 0cb8e8f22f..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 120fbd4278..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 181c8df8df..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 0e7254d25b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp deleted file mode 100644 index e0a383743a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 4bcab3263f..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 4fc3ffeac8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp deleted file mode 100644 index cf63d330b1..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp deleted file mode 100644 index e3ec8d7a0e..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp deleted file mode 100644 index 9e8739ba3d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 30a6e366f3..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp deleted file mode 100644 index 1d7eedd9ff..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, Cuda, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, Cuda, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Cuda, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 372bc02c3f..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 9c9328f21d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 86a85d220a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 251bf7dd18..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index f0c0d79391..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index 1b094259f8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 82b8f87fa4..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp deleted file mode 100644 index daf8a4d1e7..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp deleted file mode 100644 index bbdd48bfd5..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 093c250d57..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp deleted file mode 100644 index c8472757c7..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp deleted file mode 100644 index f8a9291132..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp deleted file mode 100644 index f47423fc1b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp deleted file mode 100644 index f9b8d6dba3..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 8dd503b5a8..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp deleted file mode 100644 index f931713455..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp deleted file mode 100644 index 9105b908b3..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 6f92bf8f50..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index 6538490fe3..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index c7a793b3d1..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index 7e5c7b56f0..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index dcf7043698..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 3bd6920f41..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index d75d3f9241..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 640fd04e96..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp deleted file mode 100644 index b17601cf0a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp deleted file mode 100644 index a039d13f19..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 0f4ac7de1d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 892f51c218..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp deleted file mode 100644 index ab96396e6a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 762c1f8f6b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 63c6bdc8a0..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 5f0dc1f6e2..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp deleted file mode 100644 index d3eab4fe88..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 36d34aaff2..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 1d9022f380..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 89172d0ef2..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index c14394738b..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 395dae627a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index 8c192533f5..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 22153b1158..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 0e5d276872..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index d8b91a00f5..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 08798db548..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index f371b9535d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 6b29dcd945..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 8deb69b612..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index fbd4a498c9..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index b3c31de32d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index 6fab291061..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 7be7b46627..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 9f0f83ba2d..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 7fcc5db031..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 1a7b9933ab..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, Cuda, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index c89e60595e..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 1be8bd0281..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index 0c61d411bb..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index c46bc82680..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 3f430147ad..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 482bf3a6c1..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp deleted file mode 100644 index eec32bbc80..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 9d95e5f9d5..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp deleted file mode 100644 index ca86e10ddd..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 3047e380da..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 3096ab6d3a..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 88eacdfe85..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp deleted file mode 100644 index c800698d36..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp deleted file mode 100644 index b2e2cdad44..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp deleted file mode 100644 index 0dcabb6626..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp deleted file mode 100644 index fd2f9e8589..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp deleted file mode 100644 index c7b4b9ff80..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, Cuda, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp deleted file mode 100644 index c389a15f72..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, Cuda, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, Cuda, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Cuda, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Cuda/Makefile.eti_Cuda b/lib/kokkos/core/src/eti/Cuda/Makefile.eti_Cuda deleted file mode 100644 index 9531c4fff6..0000000000 --- a/lib/kokkos/core/src/eti/Cuda/Makefile.eti_Cuda +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/lib/kokkos/core/src/eti/HPX/CMakeLists.txt b/lib/kokkos/core/src/eti/HPX/CMakeLists.txt deleted file mode 100644 index 131a2d2e6e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/CMakeLists.txt +++ /dev/null @@ -1,148 +0,0 @@ -set(D "${CMAKE_CURRENT_SOURCE_DIR}") -set(ETI_SOURCES -${ETI_SOURCES} -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -${D}/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -PARENT_SCOPE) diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 1a9a9bf4f8..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 0996ffda1a..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 08f2651c45..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 8f5ca31850..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index 7e50c2d58b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index 5caa76cd55..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 5427e9f274..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp deleted file mode 100644 index 4748550943..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp deleted file mode 100644 index db65f31221..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp deleted file mode 100644 index da598b4e55..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 8a60373f4a..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp deleted file mode 100644 index a9531ab8e3..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 66c0506137..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp deleted file mode 100644 index 885b2cc04d..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 90b19bb66e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp deleted file mode 100644 index d62dbf0b43..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp deleted file mode 100644 index 2b614aabfc..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 7a1db773e9..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index d6a697d60e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index 4fe8d07b9f..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index c0d5b19de5..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 379e7e6b77..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 6c62abcd70..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp deleted file mode 100644 index e5b3c38234..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp deleted file mode 100644 index f90485b60d..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 7b4ebf21c8..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 35de800a9b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 7aa6a05d34..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp deleted file mode 100644 index f1b95bbc0e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 884570ac64..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp deleted file mode 100644 index ae73c5dd3c..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp deleted file mode 100644 index f529807167..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp deleted file mode 100644 index b3ab97ad7f..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp deleted file mode 100644 index e5e934e8bf..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp deleted file mode 100644 index aa1f24ce43..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 891aaaa577..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index d5fc488231..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index baa863a40f..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index b8936f1bcb..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index b5c3138759..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 0c12c5b477..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 8934c4a6e4..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 9c30460367..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index ae2b1e609f..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 6f721ca789..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 4cca974fb6..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 747250c590..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 2bcc9dcaa2..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index cf424725b3..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 7c5163c537..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 275703c221..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 0b8b6690b6..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index dd7cb725e4..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index 05694106cf..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index ce5e6a2917..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index baf95fb1f2..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index 3638c01003..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 1f964cbddf..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index bc498b3509..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 0e97cd97c2..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp deleted file mode 100644 index e21f05bf55..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 1ccdc6a361..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp deleted file mode 100644 index ef1c1f970f..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 2c993914c6..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp deleted file mode 100644 index c4d120b33b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 520013db6a..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Experimental::HPX, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 663110f450..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp deleted file mode 100644 index ab18fdebdb..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp deleted file mode 100644 index 232f088e81..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Experimental::HPX, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 5a6331b76b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp deleted file mode 100644 index c3223ee4dc..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, - Experimental::HPX, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Experimental::HPX, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 50584929ae..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 281784c6a7..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 8a8220baeb..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 7c5567b049..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index f2716fef3e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index db1797304a..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 5c46468170..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp deleted file mode 100644 index be4e90ccc4..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 17200db10b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 89794ad1b9..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 1771edc874..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp deleted file mode 100644 index b118550ac2..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 8879247640..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp deleted file mode 100644 index 7b078639c7..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 2dc3d8b7c3..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp deleted file mode 100644 index c3ff0b2127..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp deleted file mode 100644 index 737fe0d634..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 176a8a5768..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index e967e8d2b3..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index 80323d7aa2..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index f68b9720ba..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 2dd7bf7843..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index c240157692..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 008eea27c9..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp deleted file mode 100644 index ba10fddcb5..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 0bc5851c11..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 14c359c093..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 6672b85ce5..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 1ec2162048..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp deleted file mode 100644 index 1a6f0631b7..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 5b90d4c7a7..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 3e0e011b0a..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 912cfe66ff..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp deleted file mode 100644 index a2cc70ffac..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 58772e42df..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp deleted file mode 100644 index ce52b3fcfc..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 9baf307d8b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index ffc8e2c520..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 16aec37096..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index a2b5e8dff4..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index f5b7347d38..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 7646c53722..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index e225e99c56..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 441e8b63ed..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 8e3bdecf1e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 7662c5a390..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index db8625bd9f..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 5992b136b0..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index f862aa4df9..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index 788c411d33..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 0646c93ac4..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 88299a88ba..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index aaec87e40c..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index f650c7e4a2..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Experimental::HPX, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index 1cf32f3f52..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index a53f5b304b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index a679f816b3..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index dc2efe8526..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index f532d1917b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 067d7c3415..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp deleted file mode 100644 index fdee4a6f35..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 4ee5059611..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 280fd0113e..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 84525a0043..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 7ba740043c..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 4a47549480..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 14773de5db..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Experimental::HPX, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 0f57ae5cb5..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp deleted file mode 100644 index 905bb918fc..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp deleted file mode 100644 index 30563fe13a..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp deleted file mode 100644 index ed0c45b36b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp deleted file mode 100644 index 1ff4404c9b..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, - Experimental::HPX, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Experimental::HPX, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/HPX/Makefile.eti_HPX b/lib/kokkos/core/src/eti/HPX/Makefile.eti_HPX deleted file mode 100644 index 904f32fb82..0000000000 --- a/lib/kokkos/core/src/eti/HPX/Makefile.eti_HPX +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/HPX/Kokkos_HPX_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/lib/kokkos/core/src/eti/OpenMP/CMakeLists.txt b/lib/kokkos/core/src/eti/OpenMP/CMakeLists.txt deleted file mode 100644 index 73c419f3c4..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/CMakeLists.txt +++ /dev/null @@ -1,148 +0,0 @@ -set(D "${CMAKE_CURRENT_SOURCE_DIR}") -set(ETI_SOURCES -${ETI_SOURCES} -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -${D}/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -PARENT_SCOPE) diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 37d812f989..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index c4ac098abc..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index fc7cc30555..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index f543baf688..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index 6cff58e360..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index 30ae7d650b..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 343c09f220..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp deleted file mode 100644 index ffe2971e59..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 0e9a519c15..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp deleted file mode 100644 index cca76dac37..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 22a6f0492f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp deleted file mode 100644 index 32f9b4ec98..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 9753469e51..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp deleted file mode 100644 index b0d5a3a7c7..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp deleted file mode 100644 index f1b981eac1..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 07ebe686a4..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp deleted file mode 100644 index 1eefbc9b01..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 87a81639eb..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index 401069942e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index 4e774bec23..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index 1b3343dd23..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index ad5421bb5e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index fde4689980..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 9c1db701cc..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 2536abbed4..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 8ab48a4f7b..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp deleted file mode 100644 index e4f8d40443..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp deleted file mode 100644 index cd482972a7..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp deleted file mode 100644 index fa7b6211fd..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp deleted file mode 100644 index aeb191e8ca..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 94ce1eba0a..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 01c96b436f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 3067883b2d..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp deleted file mode 100644 index 27ecf522ac..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 2925cbe447..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 72672c5bb3..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index d301592daa..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index dca8eeb026..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 832bbc0fef..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index 45f9c22bc1..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 7c8c5d80b7..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 2fae74f591..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 0523a6e286..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 24d667d7da..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 599d8fc04d..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 2583f8d6e9..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index d9e1f774bc..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 8376f1dd38..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 2b21554c08..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index 985e0be47c..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index f1e37a5c41..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index ea071ac108..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index bac3515894..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index 515812fb99..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 28ebc3505b..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index 3bc9254b0e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index dcba7deea3..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 9aba49991b..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 98d7304444..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 2179ba6558..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp deleted file mode 100644 index b7eed148d8..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 58a2783218..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 7ed2bd0bd7..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 0ba5edbc7c..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp deleted file mode 100644 index acce37b794..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 83878113da..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, OpenMP, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp deleted file mode 100644 index fbbd5edd28..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp deleted file mode 100644 index f4b2364f64..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, OpenMP, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp deleted file mode 100644 index df6db05a88..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 14acf8fb29..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp deleted file mode 100644 index 1984598a27..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, OpenMP, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, OpenMP, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 9879802650..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 1283f14a69..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 3addc9913f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 25336a754a..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index b4cca86620..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index ffe81fbff7..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 7bb38884bc..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp deleted file mode 100644 index f99f79e4fc..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp deleted file mode 100644 index cedc1d9014..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 2e101591d1..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 6451611b6f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp deleted file mode 100644 index 0898be20e1..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 5dc7d5cdde..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp deleted file mode 100644 index dc3c00d42f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 52b94e91e4..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 3d1359bbfa..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp deleted file mode 100644 index 54ac13a756..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 8a1e508923..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index f585a68331..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index f3943c7c63..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index ab16463a37..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 3adbfa6aae..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 32e317e02c..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 9a6bf70c92..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp deleted file mode 100644 index a081f46d43..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 7175be7bf9..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 6ad8503302..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 6af17f7c3e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 269785fa7e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp deleted file mode 100644 index a3469972de..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp deleted file mode 100644 index d3064fd97f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 5ae8d47620..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp deleted file mode 100644 index f7b3a5db87..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp deleted file mode 100644 index d36d2d27c6..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 6a88b0b8ea..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp deleted file mode 100644 index ec459f1bbf..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 6e606008d6..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index 086e1effe1..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 8824774867..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index e32f7504fe..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index d36a5c1be5..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 3389fed4fa..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index c68d3ed810..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 9fc1b47afd..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index ed9ed4d63e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 954f9eff6b..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 46c19786fa..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 0fc871882e..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 13739b99b2..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index 9dec2fe8b9..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 334da5277f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 05b1921525..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 0e57e83f85..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 89d7c45414..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index 12ad031ee6..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 1b7286cdcd..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index 3197555593..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index b5f1ddcc57..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index bb490af704..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 483d0ce3cf..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 4f1ae60f42..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 5420e3a449..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 46269afc22..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 425220e27f..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 6bc2ed733d..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 91cc8c2af2..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 46b97b3133..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 1c6c071e36..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp deleted file mode 100644 index adb9f1e947..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp deleted file mode 100644 index 5c7fc99179..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp deleted file mode 100644 index f8605287e2..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, OpenMP, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, OpenMP, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp deleted file mode 100644 index b47b23c0df..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, OpenMP, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, OpenMP, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, OpenMP, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/OpenMP/Makefile.eti_OpenMP b/lib/kokkos/core/src/eti/OpenMP/Makefile.eti_OpenMP deleted file mode 100644 index 1aa98e665b..0000000000 --- a/lib/kokkos/core/src/eti/OpenMP/Makefile.eti_OpenMP +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/OpenMP/Kokkos_OpenMP_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/lib/kokkos/core/src/eti/ROCm/CMakeLists.txt b/lib/kokkos/core/src/eti/ROCm/CMakeLists.txt deleted file mode 100644 index a5e6c6250d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/CMakeLists.txt +++ /dev/null @@ -1,148 +0,0 @@ -set(D "${CMAKE_CURRENT_SOURCE_DIR}") -set(ETI_SOURCES -${ETI_SOURCES} -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -${D}/Kokkos_Experimental::ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -PARENT_SCOPE) diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 936b24983f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 7d83d02279..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 50b160c452..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index fa4dccf30b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index 5ed0812c35..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index 9bc2faefe9..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 35a198cb26..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp deleted file mode 100644 index a79082c7a6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp deleted file mode 100644 index e344f94247..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 92e4281baa..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp deleted file mode 100644 index c25262075a..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp deleted file mode 100644 index c3ce63ccb0..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 443aaa1172..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp deleted file mode 100644 index 65d137d62b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 50c66d9315..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 78464445e9..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp deleted file mode 100644 index f1085851dd..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 090e77d63b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index b82e770ee6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index 6fbd24842d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index a434fc069f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index cf7972a445..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 724fa978be..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 1910a2024f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 9e5bf0fa3e..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 55b67d2999..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 1e7cfd2545..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp deleted file mode 100644 index d374edbd4a..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 7eb20ccaba..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp deleted file mode 100644 index cd13711178..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp deleted file mode 100644 index f36b5353ac..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp deleted file mode 100644 index afeeae9b3f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 1786596001..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp deleted file mode 100644 index 2db4dd794d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 85ec8fc2d1..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 7b9ef4eedb..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 0e37d90d7b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index aa484fcff0..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 94b5ba4707..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index f5f88d999e..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 056fccd673..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 00dfe959c5..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 9d975b184c..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index c01f76e9e6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 5fc0e1cbac..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 2124318ad8..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 1dc1ece2cb..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 2b49fe1931..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 3cc1154673..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index 56cb22173e..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 96b4198e07..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 3bf36b1c82..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 689270a64b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 995b499425..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index e6f2970a64..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Experimental::ROCm, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Experimental::ROCm, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index c4602070eb..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Experimental::ROCm, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index 9fe37b2577..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 81dd98a95f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 1f487edd27..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 0fe78ecbbb..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Experimental::ROCm, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 710bfc182a..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 8f4cf975c6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp deleted file mode 100644 index fcf444ca88..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 480c135297..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp deleted file mode 100644 index f09cb89a32..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp deleted file mode 100644 index ef36faebd6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 3e35101505..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp deleted file mode 100644 index b12b8bc9fa..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Experimental::ROCm, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp deleted file mode 100644 index 1e2e042763..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 4539a40871..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp deleted file mode 100644 index 5af78387da..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Experimental::ROCm, - int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 96f5489054..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 957741e776..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index d1c2254dac..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 87b95b9434..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index fba1027fc4..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index bbd762f1d4..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp deleted file mode 100644 index ad31e2c030..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp deleted file mode 100644 index bc14bbcee3..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 736781d696..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 6b16fbe952..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 95ce9c9521..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp deleted file mode 100644 index 34888c4e4a..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp deleted file mode 100644 index eba5f4acd2..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp deleted file mode 100644 index bc3ed4dcab..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp deleted file mode 100644 index f7a669c820..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 084a97323b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp deleted file mode 100644 index d5e1538ca1..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp deleted file mode 100644 index c2ffd740af..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index c7560e2eba..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index 650e368469..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index 19636e8bf7..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 2d15ad10e8..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 477b8e44b7..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 6f4234e708..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 4697b8285d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 4e15f36512..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 4336ff9ed3..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp deleted file mode 100644 index a93494cb0c..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 0d4303e974..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp deleted file mode 100644 index 02b7f479f5..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 8af29e6d0f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 49787220cb..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp deleted file mode 100644 index a48d561c93..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp deleted file mode 100644 index f5414d25e7..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp deleted file mode 100644 index aa2e44a1c5..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 02401e5ec0..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index dc48d2350c..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index 28be03b8a7..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 2974698b45..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index bf9678b7d2..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 7df511d71d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 8eec6cae19..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 5422bacac4..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index dbb856b8da..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 3944a4671d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 5f490e1a8e..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 5c2cf9d561..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 6ca32499b1..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 9c5d40e18a..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index ae111b312b..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index ce6c8a9fc6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index d56e9e776e..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index e1ab19f5ff..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 083cecc074..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index b345f2ac43..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Experimental::ROCm, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Experimental::ROCm, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 7370f284cf..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Experimental::ROCm, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index e6892ca01a..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index 1560af198f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index a7322631a2..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 2b5d8178c4..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp deleted file mode 100644 index ed476241ff..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Experimental::ROCm, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp deleted file mode 100644 index ee2b6739e0..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp deleted file mode 100644 index a8b7a8ef15..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp deleted file mode 100644 index e11f9b4433..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 0e17bc8c5d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp deleted file mode 100644 index a7c9b8585d..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 88c9569a9f..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 62ec94f718..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp deleted file mode 100644 index 9f86f52008..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp deleted file mode 100644 index a0762ad585..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp deleted file mode 100644 index a3ffd62644..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Experimental::ROCm, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp deleted file mode 100644 index fbd2fca225..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,59 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, - Experimental::ROCm, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Experimental::ROCm, - int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Makefile.eti_ROCm b/lib/kokkos/core/src/eti/ROCm/Makefile.eti_ROCm deleted file mode 100644 index 0423c6feb6..0000000000 --- a/lib/kokkos/core/src/eti/ROCm/Makefile.eti_ROCm +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/lib/kokkos/core/src/eti/Serial/CMakeLists.txt b/lib/kokkos/core/src/eti/Serial/CMakeLists.txt deleted file mode 100644 index eb076db79c..0000000000 --- a/lib/kokkos/core/src/eti/Serial/CMakeLists.txt +++ /dev/null @@ -1,148 +0,0 @@ -set(D "${CMAKE_CURRENT_SOURCE_DIR}") -set(ETI_SOURCES -${ETI_SOURCES} -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -${D}/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -PARENT_SCOPE) diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index a749ec859b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 7a95f39755..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 961b788a85..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 57dbaaf95e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index 33b0b87208..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index 6ec8b5f294..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp deleted file mode 100644 index e4660ae4dc..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp deleted file mode 100644 index d77fb3eb13..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp deleted file mode 100644 index c7ae12e854..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 7a6ad9b578..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp deleted file mode 100644 index bfe375c6b4..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp deleted file mode 100644 index 11c0c4a813..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 8a73236995..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp deleted file mode 100644 index e2c48e8bb0..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp deleted file mode 100644 index b6a7f488d7..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 2e3313b6eb..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp deleted file mode 100644 index dcb760fbf4..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 9bd7e80e7e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index dedbd50d8e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index 441d4774cc..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index b9013da90a..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 0b19e47184..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index f901648517..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index b8ad2e78bd..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 7bf4b7e77f..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 39e4d3bb6e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 4d845c8e1a..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp deleted file mode 100644 index b0d8e00fef..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp deleted file mode 100644 index a8972610c9..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp deleted file mode 100644 index c0db2a928b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 44ef5f0bab..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 39d0b58af3..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 1d6eb2fd34..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp deleted file mode 100644 index b38d19b999..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 360c6b4117..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp deleted file mode 100644 index f1f1dcde17..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 6cfb563e75..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index abe7810be8..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 1b6b81e8e4..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index 7e50ce7cbc..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index ea944ba15f..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index d00dd6a335..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index b7cf7d7fce..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 343dfc9658..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 44050f1421..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 4ab602bc3b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 077314b85e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 009d5afcf6..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 24a1e61eb3..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index bcf66fb161..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 65c075948f..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index e301766022..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 4ccabe6b3d..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 161cf27c49..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index 0a0bb54bfd..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 745e67b5bf..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index 40a9d2fe0f..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index 9436c1d9f7..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index a52db28973..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 66e8b8f332..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 9a32d30e2a..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 1ec25b63b5..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 0c96adece5..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 5771fcf55e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp deleted file mode 100644 index b0b918d782..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp deleted file mode 100644 index eae13261e9..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 7efc50d457..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, Serial, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp deleted file mode 100644 index f6b63e9896..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp deleted file mode 100644 index 148ed99027..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, Serial, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 30a20055a1..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp deleted file mode 100644 index fa42ed37b1..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Serial, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 07d809a290..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index e03f4f7966..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 92deaa8a3e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index ec97ca8c53..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index 2693928bd8..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index 968a400798..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 4d7b8bc724..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp deleted file mode 100644 index 7a97d75c1d..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 25d9ee82b9..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp deleted file mode 100644 index b830d1a017..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 40f690b782..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp deleted file mode 100644 index bf46af97d1..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 8abd7cc80b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp deleted file mode 100644 index e5472cda7a..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp deleted file mode 100644 index a0c1b4efcd..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp deleted file mode 100644 index a599845812..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp deleted file mode 100644 index b750ca88ca..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp deleted file mode 100644 index c1223916b1..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index 453960b508..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index a1c599c765..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index a8f280cf23..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index e9a6a979c3..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 0cbac14fb6..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 98e182506b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 0afd110876..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp deleted file mode 100644 index 76516c1927..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 3769ea0aac..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 106f1b9c67..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp deleted file mode 100644 index 44a362d82c..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp deleted file mode 100644 index 5184be6070..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 50117e94bf..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 4ddc4a3e40..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp deleted file mode 100644 index cf48e0caab..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp deleted file mode 100644 index b1ab7b6667..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 02104cfa37..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 81eab82b04..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index d5e45a194d..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 7cc00391ac..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index 70df317f3e..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 4c6018db78..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 4d48bb32cc..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 61b6682ba6..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index dd80db3e20..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index bec7b5d952..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 162915fb2b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 5fe93924d8..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 284b7c7c03..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index aea7515480..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index 310d949ebc..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 2caeee72ae..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index b914f59ed6..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 601716c99b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 2c101a3552..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index b69c4263ed..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index ae58660227..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index 1c66b58446..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index 330dc037d0..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 001a67f146..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index 247f5a3116..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp deleted file mode 100644 index 3fffcddae5..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp deleted file mode 100644 index 0df3ae643a..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 64440939ac..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 9e5ec83642..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp deleted file mode 100644 index f5731068c8..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 4f04907c08..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp deleted file mode 100644 index b0b2b83a33..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp deleted file mode 100644 index a10911f330..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp deleted file mode 100644 index 566f8e4f9b..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp deleted file mode 100644 index e299d3ab7a..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 9a191bf546..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp deleted file mode 100644 index d07e1e8d74..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, Serial, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, Serial, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Serial, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Serial/Makefile.eti_Serial b/lib/kokkos/core/src/eti/Serial/Makefile.eti_Serial deleted file mode 100644 index 74b80f98cd..0000000000 --- a/lib/kokkos/core/src/eti/Serial/Makefile.eti_Serial +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/lib/kokkos/core/src/eti/Threads/CMakeLists.txt b/lib/kokkos/core/src/eti/Threads/CMakeLists.txt deleted file mode 100644 index 27e8e35841..0000000000 --- a/lib/kokkos/core/src/eti/Threads/CMakeLists.txt +++ /dev/null @@ -1,148 +0,0 @@ -set(D "${CMAKE_CURRENT_SOURCE_DIR}") -set(ETI_SOURCES -${ETI_SOURCES} -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -PARENT_SCOPE) diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 7c84605ed9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index 3d7313a54f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 72895035bb..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 69673d51e0..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index d1aff7b82f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index e617e19b44..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 855e99e06b..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp deleted file mode 100644 index b9ffb82a5d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 85a4683974..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp deleted file mode 100644 index ba658e7b71..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 8d413bcb39..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp deleted file mode 100644 index 8a2a06649f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, - Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp deleted file mode 100644 index 3a376b91a9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp deleted file mode 100644 index 7a3ca29f43..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp deleted file mode 100644 index 44bf3df6a6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 943a00325f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp deleted file mode 100644 index b12da7c5b9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp deleted file mode 100644 index a859379df6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, - Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index b11ec7758d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index e7fee1b9e3..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index f82b4a92ba..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 3904c4cb03..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 77d46acfdd..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 006fce3cfc..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp deleted file mode 100644 index 91256cd69b..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp deleted file mode 100644 index d29fbfe795..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp deleted file mode 100644 index bdf866f3ba..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp deleted file mode 100644 index aaa00a6f6d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp deleted file mode 100644 index db2ab88d28..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp deleted file mode 100644 index 3024e4e004..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp deleted file mode 100644 index e6e66d7bb8..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 28ed80254f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 4863866aa7..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp deleted file mode 100644 index e24e9e022a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 047c078bce..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp deleted file mode 100644 index 78c7496b7c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, - Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index 33ee500813..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index 4c1d4bb58c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index 75e4bc4e3e..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index 3007a4db6f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 198e54631b..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index c12fa4e7bd..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, - Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 82f782ce57..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index d11bf3dd27..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 53bd8056d0..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 44e78041be..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index 6f54702d24..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 141b79110e..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, - Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index e23e6092eb..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index f5db8f744e..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 44ce223183..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 55fca11183..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 31b952913e..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 887bfb4c09..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, - Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index 71625e0d81..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index cd045703ff..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index abbd0f8429..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index 5ac12d8648..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 50ed4f48c3..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index f83f5faa20..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp deleted file mode 100644 index c99684ef90..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, Threads, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp deleted file mode 100644 index c0c1bb9c81..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp deleted file mode 100644 index cfef96b18a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp deleted file mode 100644 index c16e189352..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 3b404d2411..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 21148463c7..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp deleted file mode 100644 index 8d5eed4f8e..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 7a590129d5..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, Threads, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp deleted file mode 100644 index 7ad5bfa4dc..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp deleted file mode 100644 index be7a7cb21c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp deleted file mode 100644 index df2d4b1767..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp deleted file mode 100644 index 29b3cc8ee9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, Threads, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, Threads, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Threads, int64_t) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp deleted file mode 100644 index 1bbc8c414c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp deleted file mode 100644 index e04cee2c2a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp deleted file mode 100644 index 0849086c3a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp deleted file mode 100644 index 6b50b7ca7d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp deleted file mode 100644 index a3592cabac..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp deleted file mode 100644 index ce16f2a705..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp deleted file mode 100644 index 29c6670a87..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp deleted file mode 100644 index aa343fcb8d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp deleted file mode 100644 index 1043a55fd6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp deleted file mode 100644 index 9f2d095653..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp deleted file mode 100644 index 02b4d10874..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp deleted file mode 100644 index c83fe0bfb9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutRight, LayoutStride, - Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp deleted file mode 100644 index d97cb633f9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp deleted file mode 100644 index 988dd30917..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double**, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double**, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp deleted file mode 100644 index b537f31ec2..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double***, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double***, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp deleted file mode 100644 index 4163489a31..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp deleted file mode 100644 index e954a0b037..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double*****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double*****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp deleted file mode 100644 index 7f56eb8d21..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutRight, - Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(double********, LayoutStride, LayoutStride, - Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(double********, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp deleted file mode 100644 index be9a665fb9..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp deleted file mode 100644 index c82e8d12a2..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp deleted file mode 100644 index 0789ace2e2..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp deleted file mode 100644 index 1b9f8a6159..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp deleted file mode 100644 index 92ae8f9a98..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp deleted file mode 100644 index 1cf105fe53..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp deleted file mode 100644 index 7e66193302..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp deleted file mode 100644 index c347f77004..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp deleted file mode 100644 index 607eeed51c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp deleted file mode 100644 index 86ce1f81ad..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp deleted file mode 100644 index 38edea565b..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp deleted file mode 100644 index c11ba480b6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp deleted file mode 100644 index 12973de44d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp deleted file mode 100644 index 57f00f62bf..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float***, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float***, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp deleted file mode 100644 index 5a73ab7e96..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp deleted file mode 100644 index 1b928f18f4..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp deleted file mode 100644 index c3b3949d82..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float********, LayoutStride, LayoutStride, - Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float********, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp deleted file mode 100644 index c9736ad22a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp deleted file mode 100644 index 93d7a16c98..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp deleted file mode 100644 index ad9546fa67..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp deleted file mode 100644 index a62946d97a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp deleted file mode 100644 index 20826a0378..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp deleted file mode 100644 index 9d629f9ff6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutLeft, LayoutStride, - Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp deleted file mode 100644 index 39a7dbef81..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp deleted file mode 100644 index 33bb9f577c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp deleted file mode 100644 index 1d052babb4..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp deleted file mode 100644 index 6533f33f56..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp deleted file mode 100644 index a8b7a9615c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp deleted file mode 100644 index 33517ed85c..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutRight, - Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutRight, LayoutStride, - Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp deleted file mode 100644 index 2bd62e5607..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp deleted file mode 100644 index fd1bb8862f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t**, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t**, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp deleted file mode 100644 index 33a23913e6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t***, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t***, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp deleted file mode 100644 index 1bcab4c130..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp deleted file mode 100644 index 0a8d0676d4..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t*****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t*****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp deleted file mode 100644 index 47ccf94a8a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutRight, - Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutLeft, - Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int64_t********, LayoutStride, LayoutStride, - Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int64_t********, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp deleted file mode 100644 index acc4187d91..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp deleted file mode 100644 index 01a0fd28e4..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp deleted file mode 100644 index b31813ca3d..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp deleted file mode 100644 index bf52b9f938..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp deleted file mode 100644 index 61e5dc06a6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutLeft, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp deleted file mode 100644 index cb6906991e..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp +++ /dev/null @@ -1,57 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutLeft, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutLeft, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp deleted file mode 100644 index b3afb8f5a4..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp deleted file mode 100644 index f742ae330b..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp deleted file mode 100644 index 44b7724186..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp deleted file mode 100644 index 2a08a72d8a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp deleted file mode 100644 index 5e9bd50d16..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp deleted file mode 100644 index 9d3ebb948a..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutRight, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutRight, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp deleted file mode 100644 index f77e685c77..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp deleted file mode 100644 index 57ae0a1fd5..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int**, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int**, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp deleted file mode 100644 index d86407b2c6..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp deleted file mode 100644 index 0abf26b478..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp +++ /dev/null @@ -1,55 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp deleted file mode 100644 index 6e8cd9f288..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp +++ /dev/null @@ -1,56 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int*****, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int*****, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp b/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp deleted file mode 100644 index ff91ded36f..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp +++ /dev/null @@ -1,58 +0,0 @@ -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Kokkos is licensed under 3-clause BSD terms of use: -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER - -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutRight, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutLeft, Threads, - int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int********, LayoutStride, LayoutStride, Threads, - int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int********, LayoutStride, Threads, int) - -} // namespace Impl -} // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/Threads/Makefile.eti_Threads b/lib/kokkos/core/src/eti/Threads/Makefile.eti_Threads deleted file mode 100644 index 26d0ce2809..0000000000 --- a/lib/kokkos/core/src/eti/Threads/Makefile.eti_Threads +++ /dev/null @@ -1,288 +0,0 @@ -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_int64_t_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_int64_t_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_float_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int_double_LayoutStride_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutLeft_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutRight_Rank8.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank1.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank2.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank3.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank4.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank5.cpp -Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.o: $(KOKKOS_CPP_DEPENDS) $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp - $(CXX) $(KOKKOS_CPPFLAGS) $(KOKKOS_CXXFLAGS) $(CXXFLAGS) -c $(KOKKOS_ETI_PATH)/Threads/Kokkos_Threads_ViewCopyETIInst_int64_t_double_LayoutStride_Rank8.cpp diff --git a/lib/kokkos/core/src/eti/common/Kokkos_ViewFillCopyETIAvail_Macros.hpp b/lib/kokkos/core/src/eti/common/Kokkos_ViewFillCopyETIAvail_Macros.hpp deleted file mode 100644 index 6196dbf355..0000000000 --- a/lib/kokkos/core/src/eti/common/Kokkos_ViewFillCopyETIAvail_Macros.hpp +++ /dev/null @@ -1,1440 +0,0 @@ -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(int64_t********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(int64_t********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(float********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(float********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(double********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(double********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, - int64_t) diff --git a/lib/kokkos/core/src/eti/common/Kokkos_ViewFillCopyETIDecl_Macros.hpp b/lib/kokkos/core/src/eti/common/Kokkos_ViewFillCopyETIDecl_Macros.hpp deleted file mode 100644 index 98d9791eeb..0000000000 --- a/lib/kokkos/core/src/eti/common/Kokkos_ViewFillCopyETIDecl_Macros.hpp +++ /dev/null @@ -1,1152 +0,0 @@ -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(int64_t********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(int64_t********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(float********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(float********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double**, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double***, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*****, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutLeft, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutLeft, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutLeft, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double********, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double**, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double***, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*****, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutRight, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutRight, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutRight, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double********, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double**, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double**, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double***, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double***, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double*****, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double*****, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutStride, LayoutRight, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutStride, LayoutLeft, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_DECL(double********, LayoutStride, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_DECL(double********, LayoutStride, - KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE, int64_t) diff --git a/lib/kokkos/core/src/impl/CMakeLists.txt b/lib/kokkos/core/src/impl/CMakeLists.txt index 361a85b738..9ff02a2eae 100644 --- a/lib/kokkos/core/src/impl/CMakeLists.txt +++ b/lib/kokkos/core/src/impl/CMakeLists.txt @@ -2,7 +2,7 @@ SET(HEADERS "") SET(SOURCES "") -FILE(GLOB HEADERS *.hpp) +FILE(GLOB HEADERS *.hpp *.h) FILE(GLOB SOURCES *.cpp) TRIBITS_ADD_LIBRARY( diff --git a/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp b/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp index 09ed79a5fd..d9f02b47ac 100644 --- a/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp +++ b/lib/kokkos/core/src/impl/KokkosExp_Host_IterateTile.hpp @@ -57,9 +57,7 @@ #define KOKKOS_ENABLE_IVDEP_MDRANGE #endif -#include #include -#include namespace Kokkos { namespace Impl { @@ -1574,7 +1572,7 @@ struct HostIterateTile< template struct RankTag { - typedef RankTag type; + using type = RankTag; enum { value = (int)Rank }; }; @@ -1995,7 +1993,7 @@ struct HostIterateTile< template struct RankTag { - typedef RankTag type; + using type = RankTag; enum { value = (int)Rank }; }; @@ -2418,7 +2416,7 @@ struct HostIterateTile< template struct RankTag { - typedef RankTag type; + using type = RankTag; enum { value = (int)Rank }; }; @@ -2793,111 +2791,6 @@ struct HostIterateTile< // ------------------------------------------------------------------ // -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -// MDFunctor - wraps the range_policy and functor to pass to IterateTile -// Used for md_parallel_{for,reduce} with Serial, Threads, OpenMP -// Cuda uses DeviceIterateTile directly within md_parallel_for -// TODO Once md_parallel_{for,reduce} removed, this can be removed - -namespace Experimental { - -// ParallelReduce - scalar reductions -template -struct MDFunctor { - using range_policy = MDRange; - using functor_type = Functor; - using value_type = ValueType; - using work_tag = typename range_policy::work_tag; - using index_type = typename range_policy::index_type; - using iterate_type = - typename Kokkos::Impl::HostIterateTile; - - inline MDFunctor(MDRange const& range, Functor const& f) - : m_range(range), m_func(f) {} - - inline MDFunctor(MDFunctor const&) = default; - - inline MDFunctor& operator=(MDFunctor const&) = default; - - inline MDFunctor(MDFunctor&&) = default; - - inline MDFunctor& operator=(MDFunctor&&) = default; - - inline void operator()(index_type t, value_type& v) const { - iterate_type(m_range, m_func, v)(t); - } - - MDRange m_range; - Functor m_func; -}; - -// ParallelReduce - array reductions -template -struct MDFunctor { - using range_policy = MDRange; - using functor_type = Functor; - using value_type = ValueType[]; - using work_tag = typename range_policy::work_tag; - using index_type = typename range_policy::index_type; - using iterate_type = - typename Kokkos::Impl::HostIterateTile; - - inline MDFunctor(MDRange const& range, Functor const& f) - : m_range(range), m_func(f), value_count(f.value_count) {} - - inline MDFunctor(MDFunctor const&) = default; - - inline MDFunctor& operator=(MDFunctor const&) = default; - - inline MDFunctor(MDFunctor&&) = default; - - inline MDFunctor& operator=(MDFunctor&&) = default; - - // FIXME Init and Join, as defined in m_func, are not working through the - // MDFunctor Best path forward is to eliminate need for MDFunctor, directly - // use MDRangePolicy within Parallel{For,Reduce} ?? - inline void operator()(index_type t, value_type v) const { - iterate_type(m_range, m_func, v)(t); - } - - MDRange m_range; - Functor m_func; - size_t value_count; -}; - -// ParallelFor -template -struct MDFunctor { - using range_policy = MDRange; - using functor_type = Functor; - using work_tag = typename range_policy::work_tag; - using index_type = typename range_policy::index_type; - using iterate_type = - typename Kokkos::Impl::HostIterateTile; - - inline MDFunctor(MDRange const& range, Functor const& f) - : m_range(range), m_func(f) {} - - inline MDFunctor(MDFunctor const&) = default; - - inline MDFunctor& operator=(MDFunctor const&) = default; - - inline MDFunctor(MDFunctor&&) = default; - - inline MDFunctor& operator=(MDFunctor&&) = default; - - inline void operator()(index_type t) const { - iterate_type(m_range, m_func)(t); - } - - MDRange m_range; - Functor m_func; -}; - -} // end namespace Experimental -#endif #undef KOKKOS_ENABLE_NEW_LOOP_MACROS } // namespace Impl diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp index c25b80a825..c61aa3be32 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Strong.hpp @@ -103,7 +103,7 @@ __inline__ __device__ T atomic_compare_exchange( typename std::enable_if::type val) { - typedef unsigned long long int type; + using type = unsigned long long int; const type tmp = atomicCAS((type*)dest, *((type*)&compare), *((type*)&val)); return *((T*)&tmp); } @@ -126,8 +126,10 @@ __inline__ __device__ T atomic_compare_exchange( while (active != done_active) { if (!done) { if (Impl::lock_address_cuda_space((void*)dest)) { + Kokkos::memory_fence(); return_val = *dest; if (return_val == compare) *dest = val; + Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } @@ -263,6 +265,7 @@ inline T atomic_compare_exchange( while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = *dest; if (return_val == compare) { // Don't use the following line of code here: @@ -279,6 +282,7 @@ inline T atomic_compare_exchange( #ifndef KOKKOS_COMPILER_CLANG (void)tmp; #endif + Kokkos::memory_fence(); } Impl::unlock_address_host_space((void*)dest); return return_val; diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Weak.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Weak.hpp index e3fd1c53db..638b8e573e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Weak.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Compare_Exchange_Weak.hpp @@ -343,6 +343,7 @@ inline T atomic_compare_exchange( while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = *dest; if (return_val == compare) { // Don't use the following line of code here: @@ -359,6 +360,7 @@ inline T atomic_compare_exchange( #ifndef KOKKOS_COMPILER_CLANG (void)tmp; #endif + Kokkos::memory_fence(); } Impl::unlock_address_host_space((void*)dest); return return_val; diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp index 4a9a786df4..8ed130d15f 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Exchange.hpp @@ -100,7 +100,7 @@ __inline__ __device__ T atomic_exchange( typename std::enable_if::type val) { - typedef unsigned long long int type; + using type = unsigned long long int; #if defined(KOKKOS_ENABLE_RFO_PREFETCH) _mm_prefetch((const char*)dest, _MM_HINT_ET0); @@ -133,8 +133,10 @@ atomic_exchange(volatile T* const dest, while (active != done_active) { if (!done) { if (Impl::lock_address_cuda_space((void*)dest)) { + Kokkos::memory_fence(); return_val = *dest; *dest = val; + Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } @@ -162,7 +164,7 @@ __inline__ __device__ void atomic_assign( typename std::enable_if::type val) { - typedef unsigned long long int type; + using type = unsigned long long int; // (void) __ullAtomicExch( (type*) dest , *((type*)&val) ); (void)atomicExch(((type*)dest), *((type*)&val)); } @@ -189,8 +191,8 @@ inline T atomic_exchange(volatile T* const dest, typename std::enable_if::type val) { - typedef typename Kokkos::Impl::if_c::type - type; + using type = + typename Kokkos::Impl::if_c::type; #if defined(KOKKOS_ENABLE_RFO_PREFETCH) _mm_prefetch((const char*)dest, _MM_HINT_ET0); #endif @@ -257,6 +259,7 @@ inline T atomic_exchange( const T>::type& val) { while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = *dest; // Don't use the following line of code here: // @@ -272,6 +275,7 @@ inline T atomic_exchange( #ifndef KOKKOS_COMPILER_CLANG (void)tmp; #endif + Kokkos::memory_fence(); Impl::unlock_address_host_space((void*)dest); return return_val; } @@ -281,8 +285,8 @@ inline void atomic_assign(volatile T* const dest, typename std::enable_if::type val) { - typedef typename Kokkos::Impl::if_c::type - type; + using type = + typename Kokkos::Impl::if_c::type; #if defined(KOKKOS_ENABLE_RFO_PREFETCH) _mm_prefetch((const char*)dest, _MM_HINT_ET0); @@ -343,6 +347,7 @@ inline void atomic_assign( const T>::type& val) { while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); // This is likely an aggregate type with a defined // 'volatile T & operator = ( const T & ) volatile' // member. The volatile return value implicitly defines a @@ -350,7 +355,7 @@ inline void atomic_assign( // Suppress warning by casting return to void. //(void)( *dest = val ); *dest = val; - + Kokkos::memory_fence(); Impl::unlock_address_host_space((void*)dest); } //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp index 0a6900f840..131beb94f0 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Add.hpp @@ -160,8 +160,10 @@ atomic_fetch_add(volatile T* const dest, if (!done) { bool locked = Impl::lock_address_cuda_space((void*)dest); if (locked) { + Kokkos::memory_fence(); return_val = *dest; *dest = return_val + val; + Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } @@ -329,6 +331,7 @@ inline T atomic_fetch_add( const T>::type& val) { while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = *dest; // Don't use the following line of code here: @@ -343,6 +346,7 @@ inline T atomic_fetch_add( *dest = return_val + val; const T tmp = *dest; (void)tmp; + Kokkos::memory_fence(); Impl::unlock_address_host_space((void*)dest); return return_val; diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp index c14749f1b7..1acdfa4483 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Fetch_Sub.hpp @@ -154,8 +154,10 @@ atomic_fetch_sub(volatile T* const dest, while (active != done_active) { if (!done) { if (Impl::lock_address_cuda_space((void*)dest)) { + Kokkos::memory_fence(); return_val = *dest; *dest = return_val - val; + Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } @@ -274,8 +276,10 @@ inline T atomic_fetch_sub( while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = *dest; *dest = return_val - val; + Kokkos::memory_fence(); Impl::unlock_address_host_space((void*)dest); return return_val; } diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp index 49ee86b2c4..8092c5de18 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic.hpp @@ -250,8 +250,10 @@ KOKKOS_INLINE_FUNCTION T atomic_fetch_oper( #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = *dest; *dest = op.apply(return_val, val); + Kokkos::memory_fence(); Impl::unlock_address_host_space((void*)dest); return return_val; #elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA) @@ -268,8 +270,10 @@ KOKKOS_INLINE_FUNCTION T atomic_fetch_oper( while (active != done_active) { if (!done) { if (Impl::lock_address_cuda_space((void*)dest)) { + Kokkos::memory_fence(); return_val = *dest; *dest = op.apply(return_val, val); + Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } @@ -318,8 +322,10 @@ atomic_oper_fetch(const Oper& op, volatile T* const dest, #ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST while (!Impl::lock_address_host_space((void*)dest)) ; + Kokkos::memory_fence(); T return_val = op.apply(*dest, val); *dest = return_val; + Kokkos::memory_fence(); Impl::unlock_address_host_space((void*)dest); return return_val; #elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_CUDA) @@ -336,8 +342,10 @@ atomic_oper_fetch(const Oper& op, volatile T* const dest, while (active != done_active) { if (!done) { if (Impl::lock_address_cuda_space((void*)dest)) { + Kokkos::memory_fence(); return_val = op.apply(*dest, val); *dest = return_val; + Kokkos::memory_fence(); Impl::unlock_address_cuda_space((void*)dest); done = 1; } diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic_Secondary.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic_Secondary.hpp index 9d0172b653..7ab6358434 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic_Secondary.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Generic_Secondary.hpp @@ -72,5 +72,15 @@ KOKKOS_INLINE_FUNCTION void atomic_sub(volatile T* const dest, const T val) { (void)atomic_fetch_sub(dest, val); } +template +KOKKOS_INLINE_FUNCTION void atomic_mul(volatile T* const dest, const T val) { + (void)atomic_fetch_mul(dest, val); +} + +template +KOKKOS_INLINE_FUNCTION void atomic_div(volatile T* const dest, const T val) { + (void)atomic_fetch_div(dest, val); +} + } // namespace Kokkos #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp index c3719bed22..3916a1b03d 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_View.hpp @@ -57,9 +57,9 @@ struct AtomicViewConstTag {}; template class AtomicDataElement { public: - typedef typename ViewTraits::value_type value_type; - typedef typename ViewTraits::const_value_type const_value_type; - typedef typename ViewTraits::non_const_value_type non_const_value_type; + using value_type = typename ViewTraits::value_type; + using const_value_type = typename ViewTraits::const_value_type; + using non_const_value_type = typename ViewTraits::non_const_value_type; volatile value_type* const ptr; KOKKOS_INLINE_FUNCTION @@ -367,12 +367,12 @@ struct Kokkos_Atomic_is_only_allowed_with_32bit_and_64bit_scalars; template <> struct Kokkos_Atomic_is_only_allowed_with_32bit_and_64bit_scalars<4> { - typedef int type; + using type = int; }; template <> struct Kokkos_Atomic_is_only_allowed_with_32bit_and_64bit_scalars<8> { - typedef int64_t type; + using type = int64_t; }; } // namespace Impl diff --git a/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp b/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp index c5d3466c6c..9be58a3edc 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Atomic_Windows.hpp @@ -73,8 +73,9 @@ __attribute__((aligned(16))) ; } // namespace Impl +#ifndef __CUDA_ARCH__ template -KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( +inline T atomic_compare_exchange( volatile T* const dest, const T& compare, typename std::enable_if::type val) { union U { @@ -89,7 +90,7 @@ KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( } template -KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( +inline T atomic_compare_exchange( volatile T* const dest, const T& compare, typename std::enable_if::type val) { union U { @@ -104,7 +105,7 @@ KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( } template -KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( +inline T atomic_compare_exchange( volatile T* const dest, const T& compare, typename std::enable_if::type val) { union U { @@ -119,7 +120,7 @@ KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( } template -KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( +inline T atomic_compare_exchange( volatile T* const dest, const T& compare, typename std::enable_if::type val) { @@ -135,7 +136,7 @@ KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( } template -KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( +inline T atomic_compare_exchange( volatile T* const dest, const T& compare, typename std::enable_if::type val) { @@ -153,12 +154,11 @@ KOKKOS_INLINE_FUNCTION T atomic_compare_exchange( } template -KOKKOS_INLINE_FUNCTION T atomic_compare_exchange_strong(volatile T* const dest, - const T& compare, - const T& val) { +inline T atomic_compare_exchange_strong(volatile T* const dest, + const T& compare, const T& val) { return atomic_compare_exchange(dest, compare, val); } - +#endif } // namespace Kokkos #endif #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp b/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp index 7d2cdf0d4a..59011e6675 100644 --- a/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_BitOps.hpp @@ -53,19 +53,13 @@ #include #endif -#if defined(__HCC_ACCELERATOR__) -#include -#endif - namespace Kokkos { KOKKOS_FORCEINLINE_FUNCTION int log2(unsigned i) { enum : int { shift = sizeof(unsigned) * CHAR_BIT - 1 }; -#if defined(__CUDA_ARCH__) +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) return shift - __clz(i); -#elif defined(__HCC_ACCELERATOR__) - return (int)hc::__firstbit_u32_u32(i); #elif defined(KOKKOS_COMPILER_INTEL) return _bit_scan_reverse(i); #elif defined(KOKKOS_COMPILER_IBM) @@ -94,10 +88,8 @@ KOKKOS_FORCEINLINE_FUNCTION int bit_first_zero(unsigned i) noexcept { enum : unsigned { full = ~0u }; -#if defined(__CUDA_ARCH__) +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) return full != i ? __ffs(~i) - 1 : -1; -#elif defined(__HCC_ACCELERATOR__) - return full != i ? (int)hc::__firstbit_u32_u32(~i) : -1; #elif defined(KOKKOS_COMPILER_INTEL) return full != i ? _bit_scan_forward(~i) : -1; #elif defined(KOKKOS_COMPILER_IBM) @@ -118,10 +110,8 @@ int bit_first_zero(unsigned i) noexcept { KOKKOS_FORCEINLINE_FUNCTION int bit_scan_forward(unsigned i) { -#if defined(__CUDA_ARCH__) +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) return __ffs(i) - 1; -#elif defined(__HCC_ACCELERATOR__) - return (int)hc::__firstbit_u32_u32(i); #elif defined(KOKKOS_COMPILER_INTEL) return _bit_scan_forward(i); #elif defined(KOKKOS_COMPILER_IBM) @@ -143,10 +133,8 @@ int bit_scan_forward(unsigned i) { /// Count the number of bits set. KOKKOS_FORCEINLINE_FUNCTION int bit_count(unsigned i) { -#if defined(__CUDA_ARCH__) +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) return __popc(i); -#elif defined(__HCC_ACCELERATOR__) - return (int)hc::__popcount_u32_b32(i); #elif defined(__INTEL_COMPILER) return _popcnt32(i); #elif defined(KOKKOS_COMPILER_IBM) diff --git a/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp b/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp index 3b003f84eb..3251cb0f5c 100644 --- a/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_CPUDiscovery.cpp @@ -45,13 +45,17 @@ #ifdef _WIN32 #define WIN32_LEAN_AND_MEAN #include -#elif !defined(__APPLE__) +#elif defined(__APPLE__) +#include +#include +#else #include #endif #include #include #include #include +#include namespace Kokkos { namespace Impl { @@ -64,6 +68,16 @@ int processors_per_node() { return -1; } return num_procs; +#elif defined(__APPLE__) + int ncpu; + int activecpu; + size_t size = sizeof(int); + sysctlbyname("hw.ncpu", &ncpu, &size, nullptr, 0); + sysctlbyname("hw.activecpu", &activecpu, &size, nullptr, 0); + if (ncpu < 1 || activecpu < 1) + return -1; + else + return activecpu; #else return -1; #endif @@ -73,15 +87,15 @@ int mpi_ranks_per_node() { char *str; int ppn = 1; // if ((str = getenv("SLURM_TASKS_PER_NODE"))) { - // ppn = atoi(str); + // ppn = std::stoi(str); // if(ppn<=0) ppn = 1; //} if ((str = getenv("MV2_COMM_WORLD_LOCAL_SIZE"))) { - ppn = atoi(str); + ppn = std::stoi(str); if (ppn <= 0) ppn = 1; } if ((str = getenv("OMPI_COMM_WORLD_LOCAL_SIZE"))) { - ppn = atoi(str); + ppn = std::stoi(str); if (ppn <= 0) ppn = 1; } return ppn; @@ -91,13 +105,13 @@ int mpi_local_rank_on_node() { char *str; int local_rank = 0; // if ((str = getenv("SLURM_LOCALID"))) { - // local_rank = atoi(str); + // local_rank = std::stoi(str); //} if ((str = getenv("MV2_COMM_WORLD_LOCAL_RANK"))) { - local_rank = atoi(str); + local_rank = std::stoi(str); } if ((str = getenv("OMPI_COMM_WORLD_LOCAL_RANK"))) { - local_rank = atoi(str); + local_rank = std::stoi(str); } return local_rank; } diff --git a/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp b/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp index 386b5918d0..ab83f0aabd 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ClockTic.hpp @@ -48,6 +48,9 @@ #include #include #include +#ifdef KOKKOS_ENABLE_OPENMPTARGET +#include +#endif namespace Kokkos { namespace Impl { @@ -64,9 +67,10 @@ namespace Impl { * concurrent threads will have high likelihood of * having different index-seed values. */ + KOKKOS_FORCEINLINE_FUNCTION uint64_t clock_tic(void) noexcept { -#if defined(__CUDA_ARCH__) +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) // Return value of 64-bit hi-res clock register. @@ -76,9 +80,7 @@ uint64_t clock_tic(void) noexcept { // Get clock register return hc::__clock_u64(); #elif defined(KOKKOS_ENABLE_OPENMPTARGET) - return (uint64_t)std::chrono::high_resolution_clock::now() - .time_since_epoch() - .count(); + return uint64_t(omp_get_wtime() * 1.e9); #elif defined(__i386__) || defined(__x86_64) // Return value of 64-bit hi-res clock register. diff --git a/lib/kokkos/core/src/impl/Kokkos_Combined_Reducer.hpp b/lib/kokkos/core/src/impl/Kokkos_Combined_Reducer.hpp new file mode 100644 index 0000000000..093ce70d88 --- /dev/null +++ b/lib/kokkos/core/src/impl/Kokkos_Combined_Reducer.hpp @@ -0,0 +1,689 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_COMBINED_REDUCER_HPP +#define KOKKOS_COMBINED_REDUCER_HPP + +#include +#include + +#include +#include +#include + +namespace Kokkos { +namespace Impl { + +// TODO move this to a more general backporting facilities file + +// acts like void for comma fold emulation +struct _fold_comma_emulation_return {}; + +template +KOKKOS_INLINE_FUNCTION void emulate_fold_comma_operator(Ts&&...) noexcept {} + +//============================================================================== +// {{{1 + +// Note: the index is only to avoid repeating the same base class multiple times +template +struct CombinedReducerValueItemImpl { + public: + using value_type = ValueType; + + private: + value_type m_value; + + public: + KOKKOS_DEFAULTED_FUNCTION constexpr CombinedReducerValueItemImpl() = default; + KOKKOS_DEFAULTED_FUNCTION constexpr CombinedReducerValueItemImpl( + CombinedReducerValueItemImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION constexpr CombinedReducerValueItemImpl( + CombinedReducerValueItemImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION KOKKOS_CONSTEXPR_14 CombinedReducerValueItemImpl& + operator=(CombinedReducerValueItemImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION KOKKOS_CONSTEXPR_14 CombinedReducerValueItemImpl& + operator=(CombinedReducerValueItemImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION + ~CombinedReducerValueItemImpl() = default; + explicit KOKKOS_FUNCTION CombinedReducerValueItemImpl(value_type arg_value) + : m_value(std::move(arg_value)) {} + + KOKKOS_FORCEINLINE_FUNCTION + KOKKOS_CONSTEXPR_14 value_type& ref() & noexcept { return m_value; } + KOKKOS_FORCEINLINE_FUNCTION + constexpr value_type const& ref() const& noexcept { return m_value; } + KOKKOS_FORCEINLINE_FUNCTION + value_type volatile& ref() volatile& noexcept { return m_value; } + KOKKOS_FORCEINLINE_FUNCTION + value_type const volatile& ref() const volatile& noexcept { return m_value; } +}; + +//============================================================================== + +template +struct CombinedReducerValueImpl; + +template +struct CombinedReducerValueImpl, + ValueTypes...> + : CombinedReducerValueItemImpl... { + public: + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReducerValueImpl() = default; + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReducerValueImpl(CombinedReducerValueImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReducerValueImpl(CombinedReducerValueImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION + KOKKOS_CONSTEXPR_14 CombinedReducerValueImpl& operator=( + CombinedReducerValueImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION + KOKKOS_CONSTEXPR_14 CombinedReducerValueImpl& operator=( + CombinedReducerValueImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION + ~CombinedReducerValueImpl() = default; + + KOKKOS_FUNCTION + explicit CombinedReducerValueImpl(ValueTypes... arg_values) + : CombinedReducerValueItemImpl( + std::move(arg_values))... {} + + template + KOKKOS_INLINE_FUNCTION ValueType& get() & noexcept { + return this->CombinedReducerValueItemImpl::ref(); + } + template + KOKKOS_INLINE_FUNCTION ValueType const& get() const& noexcept { + return this->CombinedReducerValueItemImpl::ref(); + } + template + KOKKOS_INLINE_FUNCTION ValueType volatile& get() volatile& noexcept { + return this->CombinedReducerValueItemImpl::ref(); + } + template + KOKKOS_INLINE_FUNCTION ValueType const volatile& get() const + volatile& noexcept { + return this->CombinedReducerValueItemImpl::ref(); + } +}; + +//============================================================================== + +// TODO Empty base optmization? +template +// requires Kokkos::is_reducer +struct CombinedReducerStorageImpl { + public: + using value_type = typename Reducer::value_type; + + private: + Reducer m_reducer; + + public: + KOKKOS_INLINE_FUNCTION + explicit constexpr CombinedReducerStorageImpl(Reducer arg_reducer) + : m_reducer(std::move(arg_reducer)) {} + + // Leading underscores to make it clear that this class is not intended to + // model Reducer + + KOKKOS_INLINE_FUNCTION + KOKKOS_CONSTEXPR_14 _fold_comma_emulation_return + _init(value_type& val) const { + m_reducer.init(val); + return _fold_comma_emulation_return{}; + } + + KOKKOS_INLINE_FUNCTION KOKKOS_CONSTEXPR_14 _fold_comma_emulation_return + _join(value_type& dest, value_type const& src) const { + m_reducer.join(dest, src); + return _fold_comma_emulation_return{}; + } + + KOKKOS_INLINE_FUNCTION KOKKOS_CONSTEXPR_14 _fold_comma_emulation_return + _join(value_type volatile& dest, value_type const volatile& src) const { + m_reducer.join(dest, src); + return _fold_comma_emulation_return{}; + } +}; + +// end CombinedReducerStorage }}}1 +//============================================================================== + +//============================================================================== +// {{{1 + +struct _construct_combined_reducer_from_args_tag {}; + +template +KOKKOS_INLINE_FUNCTION auto _get_value_from_combined_reducer_ctor_arg( + T&& arg) noexcept -> + typename std::enable_if< + !is_view::type>::value && + !is_reducer::type>::value, + typename std::decay::type>::type { + return arg; +} + +template +KOKKOS_INLINE_FUNCTION auto _get_value_from_combined_reducer_ctor_arg( + T&& arg) noexcept -> + typename std::enable_if::type>::value, + typename std::decay::type>::type::value_type { + return arg(); +} + +template +KOKKOS_INLINE_FUNCTION auto _get_value_from_combined_reducer_ctor_arg( + T&& arg) noexcept -> + typename std::enable_if::type>::value, + typename std::decay::type>::type::value_type { + return arg.reference(); +} + +template +struct CombinedReducerImpl; + +template +struct CombinedReducerImpl, Space, + Reducers...> + : private CombinedReducerStorageImpl... { + public: + using reducer = CombinedReducerImpl, Space, + Reducers...>; + using value_type = CombinedReducerValueImpl, + typename Reducers::value_type...>; + using result_view_type = + Kokkos::View; + + private: + result_view_type m_value_view; + + public: + KOKKOS_DEFAULTED_FUNCTION constexpr CombinedReducerImpl() = default; + KOKKOS_DEFAULTED_FUNCTION constexpr CombinedReducerImpl( + CombinedReducerImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION constexpr CombinedReducerImpl( + CombinedReducerImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION KOKKOS_CONSTEXPR_14 CombinedReducerImpl& operator=( + CombinedReducerImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION KOKKOS_CONSTEXPR_14 CombinedReducerImpl& operator=( + CombinedReducerImpl&&) = default; + + KOKKOS_DEFAULTED_FUNCTION ~CombinedReducerImpl() = default; + + template + KOKKOS_FUNCTION constexpr explicit CombinedReducerImpl( + value_type& value, ReducersDeduced&&... reducers) noexcept + : CombinedReducerStorageImpl((ReducersDeduced &&) + reducers)..., + m_value_view(&value) {} + + KOKKOS_FUNCTION KOKKOS_CONSTEXPR_14 void join(value_type& dest, + value_type const& src) const + noexcept { + emulate_fold_comma_operator( + this->CombinedReducerStorageImpl::_join( + dest.template get(), + src.template get())...); + } + + KOKKOS_FUNCTION void join(value_type volatile& dest, + value_type const volatile& src) const noexcept { + emulate_fold_comma_operator( + this->CombinedReducerStorageImpl::_join( + dest.template get(), + src.template get())...); + } + + KOKKOS_FUNCTION KOKKOS_CONSTEXPR_14 void init(value_type& dest) const + noexcept { + emulate_fold_comma_operator( + this->CombinedReducerStorageImpl::_init( + dest.template get())...); + } + + // TODO figure out if we also need to call through to final + + KOKKOS_FUNCTION + constexpr bool references_scalar() const noexcept { + // For now, always pretend that we reference a scalar since we need to + // block to do the write-back because the references may not be contiguous + // in memory and the backends currently assume this and just do a single + // deep copy back to a chunk of memory associated with the output argument + return true; + } + + KOKKOS_FUNCTION + constexpr result_view_type const& view() const noexcept { + return m_value_view; + } + + KOKKOS_FUNCTION + KOKKOS_CONSTEXPR_14 static void write_value_back_to_original_references( + value_type const& value, + Reducers const&... reducers_that_reference_original_values) noexcept { + emulate_fold_comma_operator( + (reducers_that_reference_original_values.view()() = + value.template get())...); + } +}; + +// Apparently this can't be an alias template because of a bug/unimplemented +// feature in GCC's name mangler. But in this case, this amounts to the same +// thing. +template +struct CombinedReducer + : CombinedReducerImpl, Space, + Reducers...> { + using base_t = CombinedReducerImpl, + Space, Reducers...>; + using base_t::base_t; + using reducer = CombinedReducer; +}; + +// end CombinedReducer }}}1 +//============================================================================== + +//============================================================================== +// {{{1 + +template +struct CombinedReductionFunctorWrapperImpl; + +template +struct CombinedReductionFunctorWrapperImpl, + Functor, Space, Reducers...> { + private: + Functor m_functor; + + public: + //------------------------------------------------------------------------------ + // {{{2 + + using reducer_type = CombinedReducer; + + // Prevent Kokkos from attempting to deduce value_type + using value_type = typename reducer_type::value_type; + + // end type aliases }}}2 + //------------------------------------------------------------------------------ + + //---------------------------------------------------------------------------- + // {{{2 + + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReductionFunctorWrapperImpl() noexcept = default; + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReductionFunctorWrapperImpl( + CombinedReductionFunctorWrapperImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReductionFunctorWrapperImpl( + CombinedReductionFunctorWrapperImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION + KOKKOS_CONSTEXPR_14 CombinedReductionFunctorWrapperImpl& operator=( + CombinedReductionFunctorWrapperImpl const&) = default; + KOKKOS_DEFAULTED_FUNCTION + KOKKOS_CONSTEXPR_14 CombinedReductionFunctorWrapperImpl& operator=( + CombinedReductionFunctorWrapperImpl&&) = default; + KOKKOS_DEFAULTED_FUNCTION + ~CombinedReductionFunctorWrapperImpl() = default; + + KOKKOS_INLINE_FUNCTION + constexpr explicit CombinedReductionFunctorWrapperImpl(Functor arg_functor) + : m_functor(std::move(arg_functor)) {} + + // end Ctors, destructor, and assignment }}}2 + //---------------------------------------------------------------------------- + + //---------------------------------------------------------------------------- + // {{{2 + + template + KOKKOS_FUNCTION void operator()(IndexOrMemberType&& arg_first, + value_type& out) const { + m_functor((IndexOrMemberType &&) arg_first, + out.template get()...); + } + + // Tagged version + template + KOKKOS_FUNCTION void operator()(Tag&& arg_tag, IndexOrMemberType&& arg_first, + value_type& out) const { + m_functor((Tag &&) arg_tag, (IndexOrMemberType &&) arg_first, + out.template get()...); + } + + // end call operator }}}2 + //---------------------------------------------------------------------------- + + // These are things that need to be done if we decide to ever support + // functor-customized join/init/final hooks with combined reducers. For now, + // they are explicitly not supported. + // TODO: forward join() function to user functor hook, or just ignore it? + // TODO: forward init() function to user functor hook, or just ignore it? + // TODO: forward final() function to user functor hook, or just ignore it? +}; + +template +struct CombinedReductionFunctorWrapper + : CombinedReductionFunctorWrapperImpl< + make_index_sequence, Functor, Space, + Reducers...> { + using base_t = CombinedReductionFunctorWrapperImpl< + make_index_sequence, Functor, Space, Reducers...>; + using base_t::base_t; +}; + +// end CombinedReductionFunctorWrapper }}}1 +//============================================================================== + +//------------------------------------------------------------------------------ +// {{{2 + +template +KOKKOS_INLINE_FUNCTION constexpr typename std::enable_if< + Kokkos::is_reducer::type>::value, + typename std::decay::type>::type +_make_reducer_from_arg(Reducer&& arg_reducer) noexcept { + return arg_reducer; +} + +// Two purposes: SFINAE-safety for the `View` case and laziness for the return +// value otherwise to prevent extra instantiations of the Kokkos::Sum template +template +struct _wrap_with_kokkos_sum { + using type = Kokkos::Sum; +}; + +template +struct _wrap_with_kokkos_sum< + Space, T, typename std::enable_if::value>::type> { + using type = Kokkos::Sum; +}; + +// TODO better error message for the case when a const& to a scalar is passed in +// (this is needed in general, though) +template +KOKKOS_INLINE_FUNCTION constexpr typename std::enable_if< + !Kokkos::is_reducer::type>::value, + _wrap_with_kokkos_sum::type>>::type::type +_make_reducer_from_arg(T&& arg_scalar) noexcept { + return + typename _wrap_with_kokkos_sum::type>::type{ + arg_scalar}; +} + +// This can't be an alias template because GCC doesn't know how to mangle +// decltype expressions in return statements (and, even though every compiler +// is supposed to, GCC is the only one that does dependent alias template +// substitution correctly and tries to do the mangling, aparently). +template +struct _reducer_from_arg { + using type = decltype(Impl::_make_reducer_from_arg( + std::declval())); +}; +template +using _reducer_from_arg_t = + typename _reducer_from_arg::type; + +// end _make_reducer_from_arg }}}2 +//------------------------------------------------------------------------------ + +template +KOKKOS_INLINE_FUNCTION constexpr CombinedReducerValueImpl< + make_index_sequence, + typename _reducer_from_arg_t::value_type...> +make_combined_reducer_value(ReferencesOrViewsOrReducers&&... args) { + //---------------------------------------- + // This is a bit round-about and we should make sure it doesn't have + // any performance implications. Basically, we make a reducer out of anything + // just to get the value back out here (for the sake of uniformity). Most + // compilers should figure out what's going on, but we should double-check + // that. + return CombinedReducerValueImpl< + make_index_sequence, + typename _reducer_from_arg_t::value_type...>{ + // This helper function is now poorly named after refactoring. + _get_value_from_combined_reducer_ctor_arg((ReferencesOrViewsOrReducers &&) + args)...}; + //---------------------------------------- +} + +template +KOKKOS_INLINE_FUNCTION constexpr CombinedReducer< + Space, _reducer_from_arg_t...> +make_combined_reducer(ValueType& value, ReferencesOrViewsOrReducers&&... args) { + //---------------------------------------- + // This is doing more or less the same thing of making every argument into + // a reducer, just in a different place than in `make_combined_reducer_value`, + // so we should probably eventually make this read a little more similarly + using reducer_type = CombinedReducer< + Space, _reducer_from_arg_t...>; + return reducer_type(value, + _reducer_from_arg_t{ + (ReferencesOrViewsOrReducers &&) args}...); + //---------------------------------------- +} + +template +KOKKOS_INLINE_FUNCTION constexpr CombinedReductionFunctorWrapper< + Functor, Space, _reducer_from_arg_t...> +make_wrapped_combined_functor(Functor const& functor, Space, + ReferencesOrViewsOrReducers&&...) { + //---------------------------------------- + return CombinedReductionFunctorWrapper< + Functor, Space, + _reducer_from_arg_t...>(functor); + //---------------------------------------- +} + +} // end namespace Impl + +//============================================================================== +// {{{1 + +// These need to be forwarding references so that we can deduce const-ness, +// but none of them should be forwarded (and, indeed, none of them should be +// rvalue references) +template +auto parallel_reduce(std::string const& label, PolicyType const& policy, + Functor const& functor, ReturnType1&& returnType1, + ReturnType2&& returnType2, + ReturnTypes&&... returnTypes) noexcept -> + typename std::enable_if< + Kokkos::Impl::is_execution_policy::value>::type { + //---------------------------------------- + // Since we don't support asynchronous combined reducers yet for various + // reasons, we actually just want to work with the pointers and references + // directly + using space_type = Kokkos::DefaultHostExecutionSpace::memory_space; + + auto value = Impl::make_combined_reducer_value( + returnType1, returnType2, returnTypes...); + + using combined_reducer_type = Impl::CombinedReducer< + space_type, Impl::_reducer_from_arg_t, + Impl::_reducer_from_arg_t, + Impl::_reducer_from_arg_t...>; + auto combined_reducer = Impl::make_combined_reducer( + value, returnType1, returnType2, returnTypes...); + + auto combined_functor = Impl::make_wrapped_combined_functor( + functor, space_type{}, returnType1, returnType2, returnTypes...); + + using combined_functor_type = decltype(combined_functor); + static_assert( + Impl::FunctorDeclaresValueType::value, + "value_type not properly detected"); + using reduce_adaptor_t = + Impl::ParallelReduceAdaptor; + + reduce_adaptor_t::execute(label, policy, combined_functor, combined_reducer); + Impl::ParallelReduceFence::fence(policy.space(), + combined_reducer); + combined_reducer.write_value_back_to_original_references( + value, Impl::_make_reducer_from_arg(returnType1), + Impl::_make_reducer_from_arg(returnType2), + Impl::_make_reducer_from_arg(returnTypes)...); + //---------------------------------------- +} + +template +auto parallel_reduce(PolicyType const& policy, Functor const& functor, + ReturnType1&& returnType1, ReturnType2&& returnType2, + ReturnTypes&&... returnTypes) noexcept -> + typename std::enable_if< + Kokkos::Impl::is_execution_policy::value>::type { + //---------------------------------------- + Kokkos::parallel_reduce("", policy, functor, + std::forward(returnType1), + std::forward(returnType2), + std::forward(returnTypes)...); + //---------------------------------------- +} + +template +void parallel_reduce(std::string const& label, size_t n, Functor const& functor, + ReturnType1&& returnType1, ReturnType2&& returnType2, + ReturnTypes&&... returnTypes) noexcept { + Kokkos::parallel_reduce(label, + RangePolicy(0, n), + functor, std::forward(returnType1), + std::forward(returnType2), + std::forward(returnTypes)...); +} + +template +void parallel_reduce(size_t n, Functor const& functor, + ReturnType1&& returnType1, ReturnType2&& returnType2, + ReturnTypes&&... returnTypes) noexcept { + Kokkos::parallel_reduce("", n, functor, + std::forward(returnType1), + std::forward(returnType2), + std::forward(returnTypes)...); +} + +//------------------------------------------------------------------------------ +// {{{2 + +// Copied three times because that's the best way we have right now to match +// Impl::TeamThreadRangeBoundariesStruct, +// Impl::ThreadVectorRangeBoundariesStruct, and +// Impl::TeamVectorRangeBoundariesStruct. +// TODO make these work after restructuring + +// template +// KOKKOS_INLINE_FUNCTION void parallel_reduce( +// std::string const& label, +// Impl::TeamThreadRangeBoundariesStruct const& +// boundaries, Functor const& functor, ReturnType1&& returnType1, +// ReturnType2&& returnType2, ReturnTypes&&... returnTypes) noexcept { +// const auto combined_reducer = +// Impl::make_combined_reducer( +// returnType1, returnType2, returnTypes...); +// +// auto combined_functor = Impl::make_wrapped_combined_functor( +// functor, Kokkos::AnonymousSpace{}, returnType1, returnType2, +// returnTypes...); +// +// parallel_reduce(label, boundaries, combined_functor, combined_reducer); +//} +// +// template +// KOKKOS_INLINE_FUNCTION void parallel_reduce( +// std::string const& label, +// Impl::ThreadVectorRangeBoundariesStruct const& +// boundaries, +// Functor const& functor, ReturnType1&& returnType1, +// ReturnType2&& returnType2, ReturnTypes&&... returnTypes) noexcept { +// const auto combined_reducer = +// Impl::make_combined_reducer( +// returnType1, returnType2, returnTypes...); +// +// auto combined_functor = Impl::make_wrapped_combined_functor( +// functor, Kokkos::AnonymousSpace{}, returnType1, returnType2, +// returnTypes...); +// +// parallel_reduce(label, boundaries, combined_functor, combined_reducer); +//} + +// template +// KOKKOS_INLINE_FUNCTION void parallel_reduce( +// std::string const& label, +// Impl::TeamVectorRangeBoundariesStruct const& +// boundaries, Functor const& functor, ReturnType1&& returnType1, +// ReturnType2&& returnType2, ReturnTypes&&... returnTypes) noexcept { +// const auto combined_reducer = +// Impl::make_combined_reducer( +// returnType1, returnType2, returnTypes...); +// +// auto combined_functor = Impl::make_wrapped_combined_functor( +// functor, Kokkos::AnonymousSpace{}, returnType1, returnType2, +// returnTypes...); +// +// parallel_reduce(label, boundaries, combined_functor, combined_reducer); +//} + +// end Team overloads }}}2 +//------------------------------------------------------------------------------ + +// end Overloads of parallel_reduce for multiple outputs }}}1 +//============================================================================== + +} // namespace Kokkos + +#endif // KOKKOS_COMBINED_REDUCER_HPP diff --git a/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp b/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp index 4f10fb141e..9cdc888e33 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ConcurrentBitset.hpp @@ -123,7 +123,7 @@ struct concurrent_bitset { , uint32_t const state_header = 0 /* optional header */ ) noexcept { - typedef Kokkos::pair type; + using type = Kokkos::pair; const uint32_t bit_bound = 1 << bit_bound_lg2; const uint32_t word_count = bit_bound >> bits_per_int_lg2; @@ -208,7 +208,7 @@ struct concurrent_bitset { , uint32_t const state_header = 0 /* optional header */ ) noexcept { - typedef Kokkos::pair type; + using type = Kokkos::pair; if ((max_bit_count < bit_bound) || (state_header & ~state_header_mask) || (bit_bound <= bit)) { diff --git a/lib/kokkos/core/src/impl/Kokkos_Core.cpp b/lib/kokkos/core/src/impl/Kokkos_Core.cpp index 9640e0fccb..27f89bca8a 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Core.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Core.cpp @@ -91,8 +91,8 @@ int get_ctest_gpu(const char* local_rank_str) { } // Make sure rank is within bounds of resource groups specified by CTest - auto resource_group_count = std::atoi(ctest_resource_group_count_str); - auto local_rank = std::atoi(local_rank_str); + auto resource_group_count = std::stoi(ctest_resource_group_count_str); + auto local_rank = std::stoi(local_rank_str); if (local_rank >= resource_group_count) { std::ostringstream ss; ss << "Error: local rank " << local_rank @@ -163,11 +163,54 @@ int get_ctest_gpu(const char* local_rank_str) { } std::string id(resource_str + 3, comma - resource_str - 3); - return std::atoi(id.c_str()); + return std::stoi(id.c_str()); } namespace { +#if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_ROCM) || \ + defined(KOKKOS_ENABLE_HIP) +int get_gpu(const InitArguments& args) { + int use_gpu = args.device_id; + const int ndevices = args.ndevices; + const int skip_device = args.skip_device; + + // if the exact device is not set, but ndevices was given, assign round-robin + // using on-node MPI rank + if (use_gpu < 0) { + auto const* local_rank_str = + std::getenv("OMPI_COMM_WORLD_LOCAL_RANK"); // OpenMPI + if (!local_rank_str) + local_rank_str = std::getenv("MV2_COMM_WORLD_LOCAL_RANK"); // MVAPICH2 + if (!local_rank_str) + local_rank_str = std::getenv("SLURM_LOCALID"); // SLURM + + auto const* ctest_kokkos_device_type = + std::getenv("CTEST_KOKKOS_DEVICE_TYPE"); // CTest + auto const* ctest_resource_group_count_str = + std::getenv("CTEST_RESOURCE_GROUP_COUNT"); // CTest + if (ctest_kokkos_device_type && ctest_resource_group_count_str && + local_rank_str) { + // Use the device assigned by CTest + use_gpu = get_ctest_gpu(local_rank_str); + } else if (ndevices >= 0) { + // Use the device assigned by the rank + if (local_rank_str) { + auto local_rank = std::stoi(local_rank_str); + use_gpu = local_rank % ndevices; + } else { + // user only gave use ndevices, but the MPI environment variable wasn't + // set. start with GPU 0 at this point + use_gpu = 0; + } + } + // shift assignments over by one so no one is assigned to "skip_device" + if (use_gpu >= skip_device) ++use_gpu; + } + return use_gpu; +} +#endif // KOKKOS_ENABLE_CUDA || KOKKOS_ENABLE_ROCM || KOKKOS_ENABLE_HIP + bool is_unsigned_int(const char* str) { const size_t len = strlen(str); for (size_t i = 0; i < len; ++i) { @@ -196,51 +239,13 @@ void initialize_backends(const InitArguments& args) { #endif #if defined(KOKKOS_ENABLE_CUDA) || defined(KOKKOS_ENABLE_ROCM) || \ defined(KOKKOS_ENABLE_HIP) - int use_gpu = args.device_id; - const int ndevices = args.ndevices; - const int skip_device = args.skip_device; - // if the exact device is not set, but ndevices was given, assign round-robin - // using on-node MPI rank - if (use_gpu < 0) { - auto const* local_rank_str = - std::getenv("OMPI_COMM_WORLD_LOCAL_RANK"); // OpenMPI - if (!local_rank_str) - local_rank_str = std::getenv("MV2_COMM_WORLD_LOCAL_RANK"); // MVAPICH2 - if (!local_rank_str) - local_rank_str = std::getenv("SLURM_LOCALID"); // SLURM - - auto const* ctest_kokkos_device_type = - std::getenv("CTEST_KOKKOS_DEVICE_TYPE"); // CTest - auto const* ctest_resource_group_count_str = - std::getenv("CTEST_RESOURCE_GROUP_COUNT"); // CTest - if (ctest_kokkos_device_type && ctest_resource_group_count_str && - local_rank_str) { - // Use the device assigned by CTest - use_gpu = get_ctest_gpu(local_rank_str); - } else if (ndevices >= 0) { - // Use the device assigned by the rank - if (local_rank_str) { - auto local_rank = std::atoi(local_rank_str); - use_gpu = local_rank % ndevices; - } else { - // user only gave use ndevices, but the MPI environment variable wasn't - // set. start with GPU 0 at this point - use_gpu = 0; - } - } - // shift assignments over by one so no one is assigned to "skip_device" - if (use_gpu >= skip_device) ++use_gpu; - } + int use_gpu = get_gpu(args); #endif // defined( KOKKOS_ENABLE_CUDA ) #if defined(KOKKOS_ENABLE_OPENMP) if (std::is_same::value || std::is_same::value) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - Kokkos::OpenMP::initialize(num_threads); -#else Kokkos::OpenMP::impl_initialize(num_threads); -#endif } else { // std::cout << "Kokkos::initialize() fyi: OpenMP enabled but not // initialized" << std::endl ; @@ -251,17 +256,6 @@ void initialize_backends(const InitArguments& args) { if (std::is_same::value || std::is_same::value) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (num_threads > 0) { - if (use_numa > 0) { - Kokkos::Threads::initialize(num_threads, use_numa); - } else { - Kokkos::Threads::initialize(num_threads); - } - } else { - Kokkos::Threads::initialize(); - } -#else if (num_threads > 0) { if (use_numa > 0) { Kokkos::Threads::impl_initialize(num_threads, use_numa); @@ -271,7 +265,6 @@ void initialize_backends(const InitArguments& args) { } else { Kokkos::Threads::impl_initialize(); } -#endif // std::cout << "Kokkos::initialize() fyi: Pthread enabled and initialized" // << std::endl ; } else { @@ -305,12 +298,8 @@ void initialize_backends(const InitArguments& args) { (void)args; // Always initialize Serial if it is configure time enabled -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - Kokkos::Serial::initialize(); -#else Kokkos::Serial::impl_initialize(); #endif -#endif #if defined(KOKKOS_ENABLE_OPENMPTARGET) if (std::is_same::value || 0 < use_gpu) { if (use_gpu > -1) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - Kokkos::Cuda::initialize(Kokkos::Cuda::SelectDevice(use_gpu)); -#else Kokkos::Cuda::impl_initialize(Kokkos::Cuda::SelectDevice(use_gpu)); -#endif } else { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - Kokkos::Cuda::initialize(); -#else Kokkos::Cuda::impl_initialize(); -#endif } // std::cout << "Kokkos::initialize() fyi: Cuda enabled and initialized" << // std::endl ; @@ -370,22 +351,12 @@ void initialize_backends(const InitArguments& args) { } else { Kokkos::Experimental::HIP::impl_initialize(); } - std::cout << "Kokkos::initialize() fyi: HIP enabled and initialized" - << std::endl; } #endif } void initialize_profiling(const InitArguments&) { -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::initialize(); -#else - if (getenv("KOKKOS_PROFILE_LIBRARY") != nullptr) { - std::cerr << "Kokkos::initialize() warning: Requested Kokkos Profiling, " - "but Kokkos was built without Profiling support" - << std::endl; - } -#endif } void pre_initialize_internal(const InitArguments& args) { @@ -431,18 +402,12 @@ void finalize_internal(const bool all_spaces = false) { ++numSuccessfulCalls; } -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::finalize(); -#endif #if defined(KOKKOS_ENABLE_CUDA) if (std::is_same::value || all_spaces) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (Kokkos::Cuda::is_initialized()) Kokkos::Cuda::finalize(); -#else if (Kokkos::Cuda::impl_is_initialized()) Kokkos::Cuda::impl_finalize(); -#endif } #else (void)all_spaces; @@ -478,11 +443,7 @@ void finalize_internal(const bool all_spaces = false) { if (std::is_same::value || std::is_same::value || all_spaces) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (Kokkos::OpenMP::is_initialized()) Kokkos::OpenMP::finalize(); -#else if (Kokkos::OpenMP::impl_is_initialized()) Kokkos::OpenMP::impl_finalize(); -#endif } #endif @@ -502,21 +463,13 @@ void finalize_internal(const bool all_spaces = false) { std::is_same::value || all_spaces) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (Kokkos::Threads::is_initialized()) Kokkos::Threads::finalize(); -#else if (Kokkos::Threads::impl_is_initialized()) Kokkos::Threads::impl_finalize(); -#endif } #endif #if defined(KOKKOS_ENABLE_SERIAL) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (Kokkos::Serial::is_initialized()) Kokkos::Serial::finalize(); -#else if (Kokkos::Serial::impl_is_initialized()) Kokkos::Serial::impl_finalize(); -#endif #endif g_is_initialized = false; @@ -533,7 +486,7 @@ void fence_internal() { #endif #if defined(KOKKOS_ENABLE_HIP) - Kokkos::Experimental::HIP().fence(); + Kokkos::Experimental::HIP::impl_static_fence(); #endif #if defined(KOKKOS_ENABLE_OPENMP) @@ -541,7 +494,7 @@ void fence_internal() { #endif #if defined(KOKKOS_ENABLE_HPX) - Kokkos::Experimental::HPX::impl_static_fence(); + Kokkos::Experimental::HPX().fence(); #endif #if defined(KOKKOS_ENABLE_THREADS) @@ -577,7 +530,7 @@ bool check_int_arg(char const* arg, char const* expected, int* value) { if (arg_len == exp_len || arg[exp_len] != '=') okay = false; char const* number = arg + exp_len + 1; if (!Impl::is_unsigned_int(number) || strlen(number) == 0) okay = false; - *value = std::atoi(number); + *value = std::stoi(number); if (!okay) { std::ostringstream ss; ss << "Error: expecting an '=INT' after command line argument '" << expected @@ -614,10 +567,10 @@ void parse_command_line_arguments(int& narg, char* arg[], auto& skip_device = arguments.skip_device; auto& disable_warnings = arguments.disable_warnings; - int kokkos_threads_found = 0; - int kokkos_numa_found = 0; - int kokkos_device_found = 0; - int kokkos_ndevices_found = 0; + bool kokkos_threads_found = false; + bool kokkos_numa_found = false; + bool kokkos_device_found = false; + bool kokkos_ndevices_found = false; int iarg = 0; @@ -626,7 +579,7 @@ void parse_command_line_arguments(int& narg, char* arg[], for (int k = iarg; k < narg - 1; k++) { arg[k] = arg[k + 1]; } - kokkos_threads_found = 1; + kokkos_threads_found = true; narg--; } else if (!kokkos_threads_found && check_int_arg(arg[iarg], "--threads", &num_threads)) { @@ -635,7 +588,7 @@ void parse_command_line_arguments(int& narg, char* arg[], for (int k = iarg; k < narg - 1; k++) { arg[k] = arg[k + 1]; } - kokkos_numa_found = 1; + kokkos_numa_found = true; narg--; } else if (!kokkos_numa_found && check_int_arg(arg[iarg], "--numa", &numa)) { @@ -649,7 +602,7 @@ void parse_command_line_arguments(int& narg, char* arg[], for (int k = iarg; k < narg - 1; k++) { arg[k] = arg[k + 1]; } - kokkos_device_found = 1; + kokkos_device_found = true; narg--; } else if (!kokkos_device_found && (check_int_arg(arg[iarg], "--device-id", &device) || @@ -694,7 +647,7 @@ void parse_command_line_arguments(int& narg, char* arg[], } if (check_arg(arg[iarg], "--kokkos-num-devices") || check_arg(arg[iarg], "--kokkos-ndevices") || !kokkos_ndevices_found) - ndevices = atoi(num1_only); + ndevices = std::stoi(num1_only); delete[] num1_only; if (num2 != nullptr) { @@ -706,7 +659,7 @@ void parse_command_line_arguments(int& narg, char* arg[], if (check_arg(arg[iarg], "--kokkos-num-devices") || check_arg(arg[iarg], "--kokkos-ndevices") || !kokkos_ndevices_found) - skip_device = atoi(num2 + 1); + skip_device = std::stoi(num2 + 1); } // Remove the --kokkos-num-devices argument from the list but leave @@ -716,7 +669,7 @@ void parse_command_line_arguments(int& narg, char* arg[], for (int k = iarg; k < narg - 1; k++) { arg[k] = arg[k + 1]; } - kokkos_ndevices_found = 1; + kokkos_ndevices_found = true; narg--; } else { iarg++; @@ -1237,12 +1190,6 @@ void print_configuration(std::ostream& out, const bool detail) { #else msg << "no" << std::endl; #endif - msg << " KOKKOS_ENABLE_PROFILING: "; -#ifdef KOKKOS_ENABLE_PROFILING - msg << "yes" << std::endl; -#else - msg << "no" << std::endl; -#endif #ifdef KOKKOS_ENABLE_CUDA msg << "Cuda Options:" << std::endl; diff --git a/lib/kokkos/core/src/impl/Kokkos_Error.cpp b/lib/kokkos/core/src/impl/Kokkos_Error.cpp index a42b916f80..fd372b8e5e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Error.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Error.cpp @@ -51,6 +51,7 @@ #include #include #include +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -156,4 +157,19 @@ void traceback_callstack(std::ostream &msg) { } } // namespace Impl + +#ifdef KOKKOS_ENABLE_CUDA +namespace Experimental { + +void CudaRawMemoryAllocationFailure::append_additional_error_information( + std::ostream &o) const { + if (m_error_code != cudaSuccess) { + o << " The Cuda allocation returned the error code \"\"" + << cudaGetErrorName(m_error_code) << "\"."; + } +} + +} // end namespace Experimental +#endif + } // namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Error.hpp b/lib/kokkos/core/src/impl/Kokkos_Error.hpp index 41be6737e7..48be687d4b 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Error.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Error.hpp @@ -62,7 +62,7 @@ namespace Kokkos { namespace Impl { -void host_abort(const char *const); +[[noreturn]] void host_abort(const char *const); void throw_runtime_exception(const std::string &); @@ -164,9 +164,32 @@ class RawMemoryAllocationFailure : public std::bad_alloc { //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- +#if defined(KOKKOS_ENABLE_CUDA) && defined(__CUDA_ARCH__) + +#if defined(__APPLE__) || defined(KOKKOS_ENABLE_DEBUG_BOUNDS_CHECK) +// cuda_abort does not abort when building for macOS. +// required to workaround failures in random number generator unit tests with +// pre-volta architectures +#define KOKKOS_IMPL_ABORT_NORETURN +#else +// cuda_abort aborts when building for other platforms than macOS +#define KOKKOS_IMPL_ABORT_NORETURN [[noreturn]] +#endif + +#elif defined(KOKKOS_ENABLE_HIP) && defined(__HIP_DEVICE_COMPILE__) +// HIP aborts +#define KOKKOS_IMPL_ABORT_NORETURN [[noreturn]] +#elif !defined(KOKKOS_ENABLE_OPENMPTARGET) && !defined(__HCC_ACCELERATOR__) +// Host aborts +#define KOKKOS_IMPL_ABORT_NORETURN [[noreturn]] +#else +// Everything else does not abort +#define KOKKOS_IMPL_ABORT_NORETURN +#endif + namespace Kokkos { -KOKKOS_INLINE_FUNCTION -void abort(const char *const message) { +KOKKOS_IMPL_ABORT_NORETURN KOKKOS_INLINE_FUNCTION void abort( + const char *const message) { #if defined(KOKKOS_ENABLE_CUDA) && defined(__CUDA_ARCH__) Kokkos::Impl::cuda_abort(message); #elif defined(KOKKOS_ENABLE_HIP) && defined(__HIP_DEVICE_COMPILE__) diff --git a/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp b/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp index eada15fe99..1c337b9575 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_ExecPolicy.cpp @@ -43,6 +43,8 @@ */ #include +#include + namespace Kokkos { namespace Impl { PerTeamValue::PerTeamValue(int arg) : value(arg) {} @@ -56,4 +58,13 @@ Impl::PerThreadValue PerThread(const int& arg) { return Impl::PerThreadValue(arg); } +void team_policy_check_valid_storage_level_argument(int level) { + if (!(level == 0 || level == 1)) { + std::stringstream ss; + ss << "TeamPolicy::set_scratch_size(/*level*/ " << level + << ", ...) storage level argument must be 0 or 1 to be valid\n"; + Impl::throw_runtime_exception(ss.str()); + } +} + } // namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp b/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp index b777dac021..b5e01e33a1 100644 --- a/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_FunctorAdapter.hpp @@ -61,48 +61,99 @@ struct ReduceFunctorHasInit { enum { value = false }; }; +// The else clause idiom failed with NVCC+MSVC, causing some symbols not being +// compiled for the device. The code in there is anyway sketchy, and likely not +// standard compliant (just happens to work on all compilers we ever used) +// We intend to replace all of this long term with proper detection idiom. +#if defined(KOKKOS_COMPILER_MSVC) || defined(KOKKOS_IMPL_WINDOWS_CUDA) +template +using impl_void_t_workaround = void; + +template +using init_archetype = decltype(&F::init); + +template +struct ReduceFunctorHasInit< + FunctorType, impl_void_t_workaround>> { + enum { value = true }; +}; +#else template struct ReduceFunctorHasInit< FunctorType, typename std::enable_if<0 < sizeof(&FunctorType::init)>::type> { enum { value = true }; }; +#endif template struct ReduceFunctorHasJoin { enum { value = false }; }; +#if defined(KOKKOS_COMPILER_MSVC) || defined(KOKKOS_IMPL_WINDOWS_CUDA) +template +using join_archetype = decltype(&F::join); + +template +struct ReduceFunctorHasJoin< + FunctorType, impl_void_t_workaround>> { + enum { value = true }; +}; +#else template struct ReduceFunctorHasJoin< FunctorType, typename std::enable_if<0 < sizeof(&FunctorType::join)>::type> { enum { value = true }; }; +#endif template struct ReduceFunctorHasFinal { enum { value = false }; }; +#if defined(KOKKOS_COMPILER_MSVC) || defined(KOKKOS_IMPL_WINDOWS_CUDA) +template +using final_archetype = decltype(&F::final); + +template +struct ReduceFunctorHasFinal< + FunctorType, impl_void_t_workaround>> { + enum { value = true }; +}; +#else template struct ReduceFunctorHasFinal< FunctorType, typename std::enable_if<0 < sizeof(&FunctorType::final)>::type> { enum { value = true }; }; +#endif template struct ReduceFunctorHasShmemSize { enum { value = false }; }; +#if defined(KOKKOS_COMPILER_MSVC) || defined(KOKKOS_IMPL_WINDOWS_CUDA) +template +using shmemsize_archetype = decltype(&F::team_shmem_size); + +template +struct ReduceFunctorHasShmemSize< + FunctorType, impl_void_t_workaround>> { + enum { value = true }; +}; +#else template struct ReduceFunctorHasShmemSize< FunctorType, typename std::enable_if<0 < sizeof(&FunctorType::team_shmem_size)>::type> { enum { value = true }; }; +#endif template struct FunctorDeclaresValueType : public std::false_type {}; @@ -136,10 +187,10 @@ struct IsNonTrivialReduceFunctor { template ::value> struct FunctorValueTraits { - typedef void value_type; - typedef void pointer_type; - typedef void reference_type; - typedef void functor_type; + using value_type = void; + using pointer_type = void; + using reference_type = void; + using functor_type = void; enum { StaticValueSize = 0 }; @@ -154,10 +205,10 @@ struct FunctorValueTraits { template struct FunctorValueTraits { - typedef void value_type; - typedef void pointer_type; - typedef void reference_type; - typedef void functor_type; + using value_type = void; + using pointer_type = void; + using reference_type = void; + using functor_type = void; }; /** \brief FunctorType::value_type is explicitly declared so use it. @@ -165,18 +216,18 @@ struct FunctorValueTraits { * Two options for declaration * * 1) A plain-old-data (POD) type - * typedef {pod_type} value_type ; + * using value_type = {pod_type}; * * 2) An array of POD of a runtime specified count. - * typedef {pod_type} value_type[] ; + * using value_type = {pod_type}[]; * const unsigned value_count ; */ template struct FunctorValueTraits { - typedef typename std::remove_extent::type - value_type; - typedef FunctorType functor_type; + using value_type = + typename std::remove_extent::type; + using functor_type = FunctorType; static_assert((sizeof(value_type) < sizeof(int)) || 0 == (sizeof(value_type) % sizeof(int)), @@ -192,13 +243,13 @@ struct FunctorValueTraits::type - reference_type; + using reference_type = + typename Impl::if_c::type; // Number of values if single value template @@ -236,8 +287,8 @@ struct FunctorValueTraits::value, VOIDTAG, - ArgTag>::type tag_type; + using tag_type = typename Impl::if_c::value, + VOIDTAG, ArgTag>::type; //---------------------------------------- // parallel_for operator without a tag: @@ -1271,20 +1322,20 @@ struct FunctorValueTraits::value }; enum { IS_REJECT = std::is_same::value }; public: - typedef typename Impl::if_c::type - value_type; - typedef typename Impl::if_c::type - pointer_type; - typedef typename Impl::if_c::type - reference_type; - typedef FunctorType functor_type; + using value_type = + typename Impl::if_c::type; + using pointer_type = + typename Impl::if_c::type; + using reference_type = + typename Impl::if_c::type; + using functor_type = FunctorType; static_assert( IS_VOID || IS_REJECT || 0 == (sizeof(ValueType) % sizeof(int)), @@ -1316,8 +1367,8 @@ namespace Impl { */ template struct FunctorValueInitFunction { - typedef typename FunctorValueTraits::reference_type - reference_type; + using reference_type = + typename FunctorValueTraits::reference_type; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(ArgTag, reference_type) const); @@ -1334,8 +1385,8 @@ struct FunctorValueInitFunction { */ template struct FunctorValueInitFunction { - typedef typename FunctorValueTraits::reference_type - reference_type; + using reference_type = + typename FunctorValueTraits::reference_type; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(reference_type) const); @@ -1455,11 +1506,11 @@ template ::StaticValueSize> struct FunctorValueJoinFunction { - typedef - typename FunctorValueTraits::value_type value_type; + using value_type = + typename FunctorValueTraits::value_type; - typedef volatile value_type& vref_type; - typedef const volatile value_type& cvref_type; + using vref_type = volatile value_type&; + using cvref_type = const volatile value_type&; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(ArgTag, vref_type, cvref_type) const); @@ -1474,11 +1525,11 @@ struct FunctorValueJoinFunction { // Signatures for compatible FunctorType::join with tag and is an array template struct FunctorValueJoinFunction { - typedef - typename FunctorValueTraits::value_type value_type; + using value_type = + typename FunctorValueTraits::value_type; - typedef volatile value_type* vptr_type; - typedef const volatile value_type* cvptr_type; + using vptr_type = volatile value_type*; + using cvptr_type = const volatile value_type*; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(ArgTag, vptr_type, cvptr_type) const); @@ -1493,10 +1544,10 @@ struct FunctorValueJoinFunction { // Signatures for compatible FunctorType::join without tag and not an array template struct FunctorValueJoinFunction { - typedef typename FunctorValueTraits::value_type value_type; + using value_type = typename FunctorValueTraits::value_type; - typedef volatile value_type& vref_type; - typedef const volatile value_type& cvref_type; + using vref_type = volatile value_type&; + using cvref_type = const volatile value_type&; KOKKOS_INLINE_FUNCTION static void enable_if(void (FunctorType::*)(vref_type, cvref_type) @@ -1507,10 +1558,10 @@ struct FunctorValueJoinFunction { // Signatures for compatible FunctorType::join without tag and is an array template struct FunctorValueJoinFunction { - typedef typename FunctorValueTraits::value_type value_type; + using value_type = typename FunctorValueTraits::value_type; - typedef volatile value_type* vptr_type; - typedef const volatile value_type* cvptr_type; + using vptr_type = volatile value_type*; + using cvptr_type = const volatile value_type*; KOKKOS_INLINE_FUNCTION static void enable_if(void (FunctorType::*)(vptr_type, cvptr_type) @@ -1701,7 +1752,7 @@ namespace Impl { template struct JoinLambdaAdapter { - typedef ValueType value_type; + using value_type = ValueType; const JoinOp& lambda; KOKKOS_INLINE_FUNCTION JoinLambdaAdapter(const JoinOp& lambda_) : lambda(lambda_) {} @@ -1730,7 +1781,7 @@ template struct JoinLambdaAdapter::enable_if(&JoinOp::join))> { - typedef ValueType value_type; + using value_type = ValueType; static_assert( std::is_same::value, "JoinLambdaAdapter static_assert Fail: ValueType != JoinOp::value_type"); @@ -1763,7 +1814,7 @@ struct JoinLambdaAdapter struct JoinAdd { - typedef ValueType value_type; + using value_type = ValueType; KOKKOS_DEFAULTED_FUNCTION JoinAdd() = default; @@ -1839,8 +1890,8 @@ template ::StaticValueSize> struct FunctorFinalFunction { - typedef - typename FunctorValueTraits::value_type value_type; + using value_type = + typename FunctorValueTraits::value_type; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(ArgTag, value_type&) const); @@ -1893,8 +1944,8 @@ struct FunctorFinalFunction { // Compatible functions for 'final' function and value_type is an array template struct FunctorFinalFunction { - typedef - typename FunctorValueTraits::value_type value_type; + using value_type = + typename FunctorValueTraits::value_type; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(ArgTag, value_type*) const); @@ -1946,7 +1997,7 @@ struct FunctorFinalFunction { template struct FunctorFinalFunction { - typedef typename FunctorValueTraits::value_type value_type; + using value_type = typename FunctorValueTraits::value_type; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(value_type&) const); @@ -1963,7 +2014,7 @@ struct FunctorFinalFunction { template struct FunctorFinalFunction { - typedef typename FunctorValueTraits::value_type value_type; + using value_type = typename FunctorValueTraits::value_type; KOKKOS_INLINE_FUNCTION static void enable_if( void (FunctorType::*)(value_type*) const); diff --git a/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp b/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp index 827a9f346d..1d7b9809bb 100644 --- a/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_FunctorAnalysis.hpp @@ -391,8 +391,8 @@ struct FunctorAnalysis { template struct has_join_function { - typedef volatile ValueType& vref_type; - typedef volatile const ValueType& cvref_type; + using vref_type = volatile ValueType&; + using cvref_type = const volatile ValueType&; KOKKOS_INLINE_FUNCTION static void enable_if(void (F::*)(vref_type, cvref_type) const); @@ -409,8 +409,8 @@ struct FunctorAnalysis { template struct has_join_function { - typedef volatile ValueType* vref_type; - typedef volatile const ValueType* cvref_type; + using vref_type = volatile ValueType*; + using cvref_type = const volatile ValueType*; KOKKOS_INLINE_FUNCTION static void enable_if(void (F::*)(vref_type, cvref_type) const); @@ -427,8 +427,8 @@ struct FunctorAnalysis { template struct has_join_function { - typedef volatile ValueType& vref_type; - typedef volatile const ValueType& cvref_type; + using vref_type = volatile ValueType&; + using cvref_type = const volatile ValueType&; KOKKOS_INLINE_FUNCTION static void enable_if(void (F::*)(WTag, vref_type, cvref_type) const); @@ -453,8 +453,8 @@ struct FunctorAnalysis { template struct has_join_function { - typedef volatile ValueType* vref_type; - typedef volatile const ValueType* cvref_type; + using vref_type = volatile ValueType*; + using cvref_type = const volatile ValueType*; KOKKOS_INLINE_FUNCTION static void enable_if(void (F::*)(WTag, vref_type, cvref_type) const); diff --git a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp index 9b5bee2279..fad36c02f1 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HBWSpace.cpp @@ -62,9 +62,7 @@ #include #endif -#if defined(KOKKOS_ENABLE_PROFILING) -#include -#endif +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -93,6 +91,10 @@ HBWSpace::HBWSpace(const HBWSpace::AllocationMechanism &arg_alloc_mech) } void *HBWSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void *HBWSpace::allocate(const char *arg_label, const size_t arg_alloc_size, + const size_t arg_logical_size) const { static_assert(sizeof(void *) == sizeof(uintptr_t), "Error sizeof(void*) != sizeof(uintptr_t)"); @@ -147,13 +149,30 @@ void *HBWSpace::allocate(const size_t arg_alloc_size) const { Kokkos::Impl::throw_runtime_exception(msg.str()); } + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::allocateData(name(), arg_label, ptr, reported_size); + } return ptr; } void HBWSpace::deallocate(void *const arg_alloc_ptr, const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} +void HBWSpace::deallocate(const char *arg_label, void *const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t arg_logical_size) const { if (arg_alloc_ptr) { + if (Kokkos::Profiling::profileLibraryLoaded()) { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + Kokkos::Profiling::deallocateData(name(), arg_label, arg_alloc_ptr, + reported_size); + } + if (m_alloc_mech == STD_MALLOC) { void *alloc_ptr = *(reinterpret_cast(arg_alloc_ptr) - 1); memkind_free(MEMKIND_TYPE, alloc_ptr); @@ -187,16 +206,12 @@ SharedAllocationRecordm_label, data(), size()); - } -#endif - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); + m_space.deallocate(RecordBase::m_alloc_ptr->m_label, + SharedAllocationRecord::m_alloc_ptr, + SharedAllocationRecord::m_alloc_size, + (SharedAllocationRecord::m_alloc_size - + sizeof(SharedAllocationHeader))); } SharedAllocationRecord:: @@ -215,14 +230,6 @@ SharedAllocationRecord:: arg_alloc_size), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif - // Fill in the Header information RecordBase::m_alloc_ptr->m_record = static_cast *>(this); @@ -279,9 +286,9 @@ void *SharedAllocationRecord:: SharedAllocationRecord *SharedAllocationRecord::get_record( void *alloc_ptr) { - typedef SharedAllocationHeader Header; - typedef SharedAllocationRecord - RecordHost; + using Header = SharedAllocationHeader; + using RecordHost = + SharedAllocationRecord; SharedAllocationHeader const *const head = alloc_ptr ? Header::get_header(alloc_ptr) : (SharedAllocationHeader *)0; diff --git a/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp b/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp index 59d14e5392..2a4539cb84 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostSpace.cpp @@ -47,9 +47,7 @@ #include #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include -#endif +#include /*--------------------------------------------------------------------------*/ @@ -166,6 +164,14 @@ HostSpace::HostSpace(const HostSpace::AllocationMechanism &arg_alloc_mech) } void *HostSpace::allocate(const size_t arg_alloc_size) const { + return allocate("[unlabeled]", arg_alloc_size); +} +void *HostSpace::allocate(const char *arg_label, const size_t arg_alloc_size, + const size_t + + arg_logical_size) const { + const size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; static_assert(sizeof(void *) == sizeof(uintptr_t), "Error sizeof(void*) != sizeof(uintptr_t)"); @@ -274,16 +280,32 @@ void *HostSpace::allocate(const size_t arg_alloc_size) const { throw Kokkos::Experimental::RawMemoryAllocationFailure( arg_alloc_size, alignment, failure_mode, alloc_mec); } - + if (Kokkos::Profiling::profileLibraryLoaded()) { + Kokkos::Profiling::allocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, ptr, + reported_size); + } return ptr; } -void HostSpace::deallocate(void *const arg_alloc_ptr, const size_t -#if defined(KOKKOS_IMPL_POSIX_MMAP_FLAGS) - arg_alloc_size -#endif - ) const { +void HostSpace::deallocate(void *const arg_alloc_ptr, + const size_t arg_alloc_size) const { + deallocate("[unlabeled]", arg_alloc_ptr, arg_alloc_size); +} + +void HostSpace::deallocate(const char *arg_label, void *const arg_alloc_ptr, + const size_t arg_alloc_size, + const size_t + + arg_logical_size) const { if (arg_alloc_ptr) { + size_t reported_size = + (arg_logical_size > 0) ? arg_logical_size : arg_alloc_size; + if (Kokkos::Profiling::profileLibraryLoaded()) { + Kokkos::Profiling::deallocateData( + Kokkos::Profiling::make_space_handle(name()), arg_label, + arg_alloc_ptr, reported_size); + } if (m_alloc_mech == STD_MALLOC) { void *alloc_ptr = *(reinterpret_cast(arg_alloc_ptr) - 1); free(alloc_ptr); @@ -332,16 +354,12 @@ SharedAllocationRecord::~SharedAllocationRecord() noexcept #endif { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::deallocateData( - Kokkos::Profiling::SpaceHandle(Kokkos::HostSpace::name()), - RecordBase::m_alloc_ptr->m_label, data(), size()); - } -#endif - m_space.deallocate(SharedAllocationRecord::m_alloc_ptr, - SharedAllocationRecord::m_alloc_size); + m_space.deallocate(RecordBase::m_alloc_ptr->m_label, + SharedAllocationRecord::m_alloc_ptr, + SharedAllocationRecord::m_alloc_size, + (SharedAllocationRecord::m_alloc_size - + sizeof(SharedAllocationHeader))); } SharedAllocationHeader *_do_allocation(Kokkos::HostSpace const &space, @@ -380,13 +398,6 @@ SharedAllocationRecord::SharedAllocationRecord( arg_alloc_size), sizeof(SharedAllocationHeader) + arg_alloc_size, arg_dealloc), m_space(arg_space) { -#if defined(KOKKOS_ENABLE_PROFILING) - if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::allocateData( - Kokkos::Profiling::SpaceHandle(arg_space.name()), arg_label, data(), - arg_alloc_size); - } -#endif // Fill in the Header information RecordBase::m_alloc_ptr->m_record = static_cast *>(this); @@ -439,8 +450,8 @@ void *SharedAllocationRecord::reallocate_tracked( SharedAllocationRecord * SharedAllocationRecord::get_record(void *alloc_ptr) { - typedef SharedAllocationHeader Header; - typedef SharedAllocationRecord RecordHost; + using Header = SharedAllocationHeader; + using RecordHost = SharedAllocationRecord; SharedAllocationHeader const *const head = alloc_ptr ? Header::get_header(alloc_ptr) : nullptr; diff --git a/lib/kokkos/core/src/impl/Kokkos_HostSpace_deepcopy.cpp b/lib/kokkos/core/src/impl/Kokkos_HostSpace_deepcopy.cpp index 35eee40ab7..b86670346c 100644 --- a/lib/kokkos/core/src/impl/Kokkos_HostSpace_deepcopy.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_HostSpace_deepcopy.cpp @@ -60,7 +60,7 @@ void hostspace_parallel_deepcopy(void* dst, const void* src, ptrdiff_t n) { return; } - typedef Kokkos::RangePolicy policy_t; + using policy_t = Kokkos::RangePolicy; // Both src and dst are aligned the same way with respect to 8 byte words if (reinterpret_cast(src) % 8 == diff --git a/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp b/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp index d48368f761..889d821bb1 100644 --- a/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_MemoryPool.cpp @@ -42,9 +42,10 @@ //@HEADER */ +#include + #include #include -#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -106,5 +107,29 @@ void memory_pool_bounds_verification(size_t min_block_alloc_size, } } +// This has way too many parameters, but it is entirely for moving the iostream +// inclusion out of the header file with as few changes as possible +void _print_memory_pool_state(std::ostream& s, uint32_t const* sb_state_ptr, + int32_t sb_count, uint32_t sb_size_lg2, + uint32_t sb_state_size, uint32_t state_shift, + uint32_t state_used_mask) { + s << "pool_size(" << (size_t(sb_count) << sb_size_lg2) << ")" + << " superblock_size(" << (1LU << sb_size_lg2) << ")" << std::endl; + + for (int32_t i = 0; i < sb_count; ++i, sb_state_ptr += sb_state_size) { + if (*sb_state_ptr) { + const uint32_t block_count_lg2 = (*sb_state_ptr) >> state_shift; + const uint32_t block_size_lg2 = sb_size_lg2 - block_count_lg2; + const uint32_t block_count = 1u << block_count_lg2; + const uint32_t block_used = (*sb_state_ptr) & state_used_mask; + + s << "Superblock[ " << i << " / " << sb_count << " ] {" + << " block_size(" << (1 << block_size_lg2) << ")" + << " block_count( " << block_used << " / " << block_count << " )" + << std::endl; + } + } +} + } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/src/impl/Kokkos_MemorySpace.cpp similarity index 53% rename from lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp rename to lib/kokkos/core/src/impl/Kokkos_MemorySpace.cpp index 5a52ee9e86..ec2e573c04 100644 --- a/lib/kokkos/core/src/eti/ROCm/Kokkos_ROCm_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_MemorySpace.cpp @@ -1,15 +1,13 @@ +/* //@HEADER // ************************************************************************ // // Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). +// Copyright (2019) Sandia Corporation // // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,18 +39,57 @@ // // ************************************************************************ //@HEADER +*/ + +/** @file Kokkos_MemorySpace.cpp + * + * Operations common to memory space instances, or at least default + * implementations thereof. + */ + +#include + +#include +#include +#include -#define KOKKOS_IMPL_COMPILING_LIBRARY true -#include namespace Kokkos { namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, - Experimental::ROCm, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Experimental::ROCm, int64_t) -} // namespace Impl -} // namespace Kokkos +void safe_throw_allocation_with_header_failure( + std::string const& space_name, std::string const& label, + Kokkos::Experimental::RawMemoryAllocationFailure const& failure) { + auto generate_failure_message = [&](std::ostream& o) { + o << "Kokkos failed to allocate memory for label \"" << label + << "\". Allocation using MemorySpace named \"" << space_name + << "\" failed with the following error: "; + failure.print_error_message(o); + if (failure.failure_mode() == + Kokkos::Experimental::RawMemoryAllocationFailure::FailureMode:: + AllocationNotAligned) { + // TODO: delete the misaligned memory? + o << "Warning: Allocation failed due to misalignment; memory may " + "be leaked.\n"; + } + o.flush(); + }; + try { + std::ostringstream sstr; + generate_failure_message(sstr); + Kokkos::Impl::throw_runtime_exception(sstr.str()); + } catch (std::bad_alloc const&) { + // Probably failed to allocate the string because we're so close to out + // of memory. Try printing to std::cerr instead + try { + generate_failure_message(std::cerr); + } catch (std::bad_alloc const&) { + // oh well, we tried... + } + Kokkos::Impl::throw_runtime_exception( + "Kokkos encountered an allocation failure, then another allocation " + "failure while trying to create the error message."); + } +} + +} // end namespace Impl +} // end namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_MemorySpace.hpp b/lib/kokkos/core/src/impl/Kokkos_MemorySpace.hpp index 650cf8a70c..5b3764686f 100644 --- a/lib/kokkos/core/src/impl/Kokkos_MemorySpace.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_MemorySpace.hpp @@ -55,51 +55,25 @@ #include #include -#include -#include namespace Kokkos { namespace Impl { +// Defined in implementation file to avoid having to include iostream +void safe_throw_allocation_with_header_failure( + std::string const &space_name, std::string const &label, + Kokkos::Experimental::RawMemoryAllocationFailure const &failure); + template SharedAllocationHeader *checked_allocation_with_header(MemorySpace const &space, std::string const &label, size_t alloc_size) { try { - return reinterpret_cast( - space.allocate(alloc_size + sizeof(SharedAllocationHeader))); + return reinterpret_cast(space.allocate( + label.c_str(), alloc_size + sizeof(SharedAllocationHeader), + alloc_size)); } catch (Kokkos::Experimental::RawMemoryAllocationFailure const &failure) { - auto generate_failure_message = [&](std::ostream &o) { - o << "Kokkos failed to allocate memory for label \"" << label - << "\". Allocation using MemorySpace named \"" << space.name() - << "\" failed with the following error: "; - failure.print_error_message(o); - if (failure.failure_mode() == - Kokkos::Experimental::RawMemoryAllocationFailure::FailureMode:: - AllocationNotAligned) { - // TODO: delete the misaligned memory? - o << "Warning: Allocation failed due to misalignment; memory may " - "be leaked." - << std::endl; - } - o.flush(); - }; - try { - std::ostringstream sstr; - generate_failure_message(sstr); - Kokkos::Impl::throw_runtime_exception(sstr.str()); - } catch (std::bad_alloc const &) { - // Probably failed to allocate the string because we're so close to out - // of memory. Try printing to std::cerr instead - try { - generate_failure_message(std::cerr); - } catch (std::bad_alloc const &) { - // oh well, we tried... - } - Kokkos::Impl::throw_runtime_exception( - "Kokkos encountered an allocation failure, then another allocation " - "failure while trying to create the error message."); - } + safe_throw_allocation_with_header_failure(space.name(), label, failure); } return nullptr; // unreachable } diff --git a/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp b/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp index eae14a92d5..a7f0830a68 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Memory_Fence.hpp @@ -53,9 +53,11 @@ KOKKOS_FORCEINLINE_FUNCTION void memory_fence() { #if defined(__CUDA_ARCH__) __threadfence(); +#elif defined(KOKKOS_ENABLE_OPENMPTARGET) +#pragma omp flush #elif defined(KOKKOS_ENABLE_ROCM_ATOMICS) amp_barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE); -#elif defined(KOKKOS_ENABLE_HIP_ATOMICS) +#elif defined(__HIP_DEVICE_COMPILE__) __threadfence(); #elif defined(KOKKOS_ENABLE_ASM) && defined(KOKKOS_ENABLE_ISA_X86_64) asm volatile("mfence" ::: "memory"); diff --git a/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp b/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp deleted file mode 100644 index fbb921d7f2..0000000000 --- a/lib/kokkos/core/src/impl/Kokkos_OldMacros.hpp +++ /dev/null @@ -1,526 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_IMPL_OLD_MACROS_HPP -#define KOKKOS_IMPL_OLD_MACROS_HPP - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - -#ifdef KOKKOS_ATOMICS_USE_CUDA -#ifndef KOKKOS_ENABLE_CUDA_ATOMICS -#define KOKKOS_ENABLE_CUDA_ATOMICS KOKKOS_ATOMICS_USE_CUDA -#endif -#endif - -#ifdef KOKKOS_ATOMICS_USE_GCC -#ifndef KOKKOS_ENABLE_GNU_ATOMICS -#define KOKKOS_ENABLE_GNU_ATOMICS KOKKOS_ATOMICS_USE_GCC -#endif -#endif - -#ifdef KOKKOS_ATOMICS_USE_GNU -#ifndef KOKKOS_ENABLE_GNU_ATOMICS -#define KOKKOS_ENABLE_GNU_ATOMICS KOKKOS_ATOMICS_USE_GNU -#endif -#endif - -#ifdef KOKKOS_ATOMICS_USE_INTEL -#ifndef KOKKOS_ENABLE_INTEL_ATOMICS -#define KOKKOS_ENABLE_INTEL_ATOMICS KOKKOS_ATOMICS_USE_INTEL -#endif -#endif - -#ifdef KOKKOS_ATOMICS_USE_OMP31 -#ifndef KOKKOS_ENABLE_OPENMP_ATOMICS -#define KOKKOS_ENABLE_OPENMP_ATOMICS KOKKOS_ATOMICS_USE_OMP31 -#endif -#endif - -#ifdef KOKKOS_ATOMICS_USE_OPENMP31 -#ifndef KOKKOS_ENABLE_OPENMP_ATOMICS -#define KOKKOS_ENABLE_OPENMP_ATOMICS KOKKOS_ATOMICS_USE_OPENMP31 -#endif -#endif - -#ifdef KOKKOS_ATOMICS_USE_WINDOWS -#ifndef KOKKOS_ENABLE_WINDOWS_ATOMICS -#define KOKKOS_ENABLE_WINDOWS_ATOMICS KOKKOS_ATOMICS_USE_WINDOWS -#endif -#endif - -#ifdef KOKKOS_CUDA_CLANG_WORKAROUND -#ifndef KOKKOS_IMPL_CUDA_CLANG_WORKAROUND -#define KOKKOS_IMPL_CUDA_CLANG_WORKAROUND KOKKOS_CUDA_CLANG_WORKAROUND -#endif -#endif - -#ifdef KOKKOS_CUDA_USE_LAMBDA -#ifndef KOKKOS_ENABLE_CUDA_LAMBDA -#define KOKKOS_ENABLE_CUDA_LAMBDA KOKKOS_CUDA_USE_LAMBDA -#endif -#endif - -#ifdef KOKKOS_CUDA_USE_LDG_INTRINSIC -#ifndef KOKKOS_ENABLE_CUDA_LDG_INTRINSIC -#define KOKKOS_ENABLE_CUDA_LDG_INTRINSIC KOKKOS_CUDA_USE_LDG_INTRINSIC -#endif -#endif - -#ifdef KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE -#ifndef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE -#define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE \ - KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE -#endif -#endif - -#ifdef KOKKOS_CUDA_USE_UVM -#ifndef KOKKOS_ENABLE_CUDA_UVM -#define KOKKOS_ENABLE_CUDA_UVM KOKKOS_CUDA_USE_UVM -#endif -#endif - -#ifdef KOKKOS_HAVE_CUDA -#ifndef KOKKOS_ENABLE_CUDA -#define KOKKOS_ENABLE_CUDA KOKKOS_HAVE_CUDA -#endif -#endif - -#ifdef KOKKOS_HAVE_CUDA_LAMBDA -#ifndef KOKKOS_ENABLE_CUDA_LAMBDA -#define KOKKOS_ENABLE_CUDA_LAMBDA KOKKOS_HAVE_CUDA_LAMBDA -#endif -#endif - -#ifdef KOKKOS_HAVE_CUDA_RDC -#ifndef KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE -#define KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE KOKKOS_HAVE_CUDA_RDC -#endif -#endif - -#ifdef KOKKOS_HAVE_CUSPARSE -#ifndef KOKKOS_ENABLE_CUSPARSE -#define KOKKOS_ENABLE_CUSPARSE KOKKOS_HAVE_CUSPARSE -#endif -#endif - -#if defined(KOKKOS_HAVE_CXX1Z) || defined(KOKKOS_ENABLE_CXX17) -#ifndef KOKKOS_ENABLE_CXX1Z -#define KOKKOS_ENABLE_CXX1Z KOKKOS_HAVE_CXX1Z -#endif -#endif - -#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA -#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA -#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_CUDA \ - KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_CUDA -#endif -#endif - -#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP -#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP -#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_OPENMP \ - KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_OPENMP -#endif -#endif - -#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL -#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL -#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_SERIAL \ - KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_SERIAL -#endif -#endif - -#ifdef KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS -#ifndef KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS -#define KOKKOS_ENABLE_DEFAULT_DEVICE_TYPE_THREADS \ - KOKKOS_HAVE_DEFAULT_DEVICE_TYPE_THREADS -#endif -#endif - -#ifdef KOKKOS_HAVE_HBWSPACE -#ifndef KOKKOS_ENABLE_HBWSPACE -#define KOKKOS_ENABLE_HBWSPACE KOKKOS_HAVE_HBWSPACE -#endif -#endif - -#ifdef KOKKOS_HAVE_HWLOC -#ifndef KOKKOS_ENABLE_HWLOC -#define KOKKOS_ENABLE_HWLOC KOKKOS_HAVE_HWLOC -#endif -#endif - -#ifdef KOKKOS_HAVE_MPI -#ifndef KOKKOS_ENABLE_MPI -#define KOKKOS_ENABLE_MPI KOKKOS_HAVE_MPI -#endif -#endif - -#ifdef KOKKOS_HAVE_OPENMP -#ifndef KOKKOS_ENABLE_OPENMP -#define KOKKOS_ENABLE_OPENMP KOKKOS_HAVE_OPENMP -#endif -#endif - -#ifdef KOKKOS_HAVE_PRAGMA_IVDEP -#ifndef KOKKOS_ENABLE_PRAGMA_IVDEP -#define KOKKOS_ENABLE_PRAGMA_IVDEP KOKKOS_HAVE_PRAGMA_IVDEP -#endif -#endif - -#ifdef KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION -#ifndef KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION -#define KOKKOS_ENABLE_AGGRESSIVE_VECTORIZATION \ - KOKKOS_OPT_RANGE_AGGRESSIVE_VECTORIZATION -#endif -#endif - -#ifdef KOKKOS_HAVE_PRAGMA_LOOPCOUNT -#ifndef KOKKOS_ENABLE_PRAGMA_LOOPCOUNT -#define KOKKOS_ENABLE_PRAGMA_LOOPCOUNT KOKKOS_HAVE_PRAGMA_LOOPCOUNT -#endif -#endif - -#ifdef KOKKOS_HAVE_PRAGMA_SIMD -#ifndef KOKKOS_ENABLE_PRAGMA_SIMD -#define KOKKOS_ENABLE_PRAGMA_SIMD KOKKOS_HAVE_PRAGMA_SIMD -#endif -#endif - -#ifdef KOKKOS_HAVE_PRAGMA_UNROLL -#ifndef KOKKOS_ENABLE_PRAGMA_UNROLL -#define KOKKOS_ENABLE_PRAGMA_UNROLL KOKKOS_HAVE_PRAGMA_UNROLL -#endif -#endif - -#ifdef KOKKOS_HAVE_PRAGMA_VECTOR -#ifndef KOKKOS_ENABLE_PRAGMA_VECTOR -#define KOKKOS_ENABLE_PRAGMA_VECTOR KOKKOS_HAVE_PRAGMA_VECTOR -#endif -#endif - -#ifdef KOKKOS_HAVE_PTHREAD -#ifndef KOKKOS_ENABLE_PTHREAD -#define KOKKOS_ENABLE_PTHREAD KOKKOS_HAVE_PTHREAD -#endif -#endif - -#ifdef KOKKOS_HAVE_SERIAL -#ifndef KOKKOS_ENABLE_SERIAL -#define KOKKOS_ENABLE_SERIAL KOKKOS_HAVE_SERIAL -#endif -#endif - -#ifdef KOKKOS_HAVE_TYPE -#ifndef KOKKOS_IMPL_HAS_TYPE -#define KOKKOS_IMPL_HAS_TYPE KOKKOS_HAVE_TYPE -#endif -#endif - -#ifdef KOKKOS_HAVE_WINTHREAD -#ifndef KOKKOS_ENABLE_WINTHREAD -#define KOKKOS_ENABLE_WINTHREAD KOKKOS_HAVE_WINTHREAD -#endif -#endif - -#ifdef KOKKOS_HAVE_Winthread -#ifndef KOKKOS_ENABLE_WINTHREAD -#define KOKKOS_ENABLE_WINTHREAD KOKKOS_HAVE_Winthread -#endif -#endif - -#ifdef KOKKOS_INTEL_MM_ALLOC_AVAILABLE -#ifndef KOKKOS_ENABLE_INTEL_MM_ALLOC -#define KOKKOS_ENABLE_INTEL_MM_ALLOC KOKKOS_INTEL_MM_ALLOC_AVAILABLE -#endif -#endif - -#ifdef KOKKOS_MACRO_IMPL_TO_STRING -#ifndef KOKKOS_IMPL_MACRO_TO_STRING -#define KOKKOS_IMPL_MACRO_TO_STRING KOKKOS_MACRO_IMPL_TO_STRING -#endif -#endif - -#ifdef KOKKOS_MACRO_TO_STRING -#ifndef KOKKOS_MACRO_TO_STRING -#define KOKKOS_MACRO_TO_STRING KOKKOS_MACRO_TO_STRING -#endif -#endif - -#ifdef KOKKOS_MAY_ALIAS -#ifndef KOKKOS_IMPL_MAY_ALIAS -#define KOKKOS_IMPL_MAY_ALIAS KOKKOS_MAY_ALIAS -#endif -#endif - -#ifdef KOKKOS_MDRANGE_IVDEP -#ifndef KOKKOS_IMPL_MDRANGE_IVDEP -#define KOKKOS_IMPL_MDRANGE_IVDEP KOKKOS_MDRANGE_IVDEP -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINTERR -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINTERR -#define KOKKOS_ENABLE_MEMPOOL_PRINTERR KOKKOS_MEMPOOL_PRINTERR -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS -#define KOKKOS_ENABLE_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS \ - KOKKOS_MEMPOOL_PRINT_ACTIVE_SUPERBLOCKS -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO -#define KOKKOS_ENABLE_MEMPOOL_PRINT_BLOCKSIZE_INFO \ - KOKKOS_MEMPOOL_PRINT_BLOCKSIZE_INFO -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_CONSTRUCTOR_INFO -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_CONSTRUCTOR_INFO -#define KOKKOS_ENABLE_MEMPOOL_PRINT_CONSTRUCTOR_INFO \ - KOKKOS_MEMPOOL_PRINT_CONSTRUCTOR_INFO -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO -#define KOKKOS_ENABLE_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO \ - KOKKOS_MEMPOOL_PRINT_INDIVIDUAL_PAGE_INFO -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_INFO -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_INFO -#define KOKKOS_ENABLE_MEMPOOL_PRINT_INFO KOKKOS_MEMPOOL_PRINT_INFO -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_PAGE_INFO -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO -#define KOKKOS_ENABLE_MEMPOOL_PRINT_PAGE_INFO KOKKOS_MEMPOOL_PRINT_PAGE_INFO -#endif -#endif - -#ifdef KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO -#ifndef KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO -#define KOKKOS_ENABLE_MEMPOOL_PRINT_SUPERBLOCK_INFO \ - KOKKOS_MEMPOOL_PRINT_SUPERBLOCK_INFO -#endif -#endif - -#ifdef KOKKOS_POSIX_MEMALIGN_AVAILABLE -#ifndef KOKKOS_ENABLE_POSIX_MEMALIGN -#define KOKKOS_ENABLE_POSIX_MEMALIGN KOKKOS_POSIX_MEMALIGN_AVAILABLE -#endif -#endif - -#ifdef KOKKOS_POSIX_MMAP_FLAGS -#ifndef KOKKOS_IMPL_POSIX_MMAP_FLAGS -#define KOKKOS_IMPL_POSIX_MMAP_FLAGS KOKKOS_POSIX_MMAP_FLAGS -#endif -#endif - -#ifdef KOKKOS_POSIX_MMAP_FLAGS_HUGE -#ifndef KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE -#define KOKKOS_IMPL_POSIX_MMAP_FLAGS_HUGE KOKKOS_POSIX_MMAP_FLAGS_HUGE -#endif -#endif - -#ifdef KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT -#ifndef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT -#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT \ - KOKKOS_SHARED_ALLOCATION_TRACKER_DECREMENT -#endif -#endif - -#ifdef KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED -#ifndef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED -#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED \ - KOKKOS_SHARED_ALLOCATION_TRACKER_ENABLED -#endif -#endif - -#ifdef KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT -#ifndef KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT -#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT \ - KOKKOS_SHARED_ALLOCATION_TRACKER_INCREMENT -#endif -#endif - -#ifdef KOKKOS_USE_CUDA_UVM -#ifndef KOKKOS_ENABLE_CUDA_UVM -#define KOKKOS_ENABLE_CUDA_UVM KOKKOS_USE_CUDA_UVM -#endif -#endif - -#ifdef KOKKOS_USE_ISA_KNC -#ifndef KOKKOS_ENABLE_ISA_KNC -#define KOKKOS_ENABLE_ISA_KNC KOKKOS_USE_ISA_KNC -#endif -#endif - -#ifdef KOKKOS_USE_ISA_POWERPCLE -#ifndef KOKKOS_ENABLE_ISA_POWERPCLE -#define KOKKOS_ENABLE_ISA_POWERPCLE KOKKOS_USE_ISA_POWERPCLE -#endif -#endif - -#ifdef KOKKOS_USE_ISA_X86_64 -#ifndef KOKKOS_ENABLE_ISA_X86_64 -#define KOKKOS_ENABLE_ISA_X86_64 KOKKOS_USE_ISA_X86_64 -#endif -#endif - -#ifdef KOKKOS_USE_LIBRT -#ifndef KOKKOS_ENABLE_LIBRT -#define KOKKOS_ENABLE_LIBRT KOKKOS_USE_LIBRT -#endif -#endif - -#ifdef KOKKOS_VIEW_OPERATOR_VERIFY -#ifndef KOKKOS_IMPL_VIEW_OPERATOR_VERIFY -#define KOKKOS_IMPL_VIEW_OPERATOR_VERIFY KOKKOS_VIEW_OPERATOR_VERIFY -#endif -#endif - -#if defined(KOKKOS_ENABLE_PTHREAD) || defined(KOKKOS_ENABLE_WINTHREAD) -#ifndef KOKKOS_ENABLE_THREADS -#define KOKKOS_ENABLE_THREADS -#endif -#endif - -//------------------------------------------------------------------------------ -// Deprecated macros -//------------------------------------------------------------------------------ -#ifdef KOKKOS_HAVE_CXX11 -#undef KOKKOS_HAVE_CXX11 -#endif -#ifdef KOKKOS_ENABLE_CXX11 -#undef KOKKOS_ENABLE_CXX11 -#endif -#ifdef KOKKOS_USING_EXP_VIEW -#undef KOKKOS_USING_EXP_VIEW -#endif -#ifdef KOKKOS_USING_EXPERIMENTAL_VIEW -#undef KOKKOS_USING_EXPERIMENTAL_VIEW -#endif - -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_CXX11 1 -#define KOKKOS_USING_EXP_VIEW 1 -#define KOKKOS_USING_EXPERIMENTAL_VIEW 1 - -// backwards compatibility of no-longer-defined HAVE macros -// https://github.com/kokkos/kokkos/pull/1576/files -#if (!defined(KOKKOS_HAVE_CUDA)) && defined(KOKKOS_ENABLE_CUDA) -#define KOKKOS_HAVE_CUDA 1 -#endif - -#if (!defined(KOKKOS_HAVE_OPENMP)) && defined(KOKKOS_ENABLE_OPENMP) -#define KOKKOS_HAVE_OPENMP 1 -#endif - -#if (!defined(KOKKOS_HAVE_PTHREAD)) && defined(KOKKOS_ENABLE_THREADS) -#define KOKKOS_HAVE_PTHREAD 1 -#endif - -#if (!defined(KOKKOS_HAVE_SERIAL)) && defined(KOKKOS_ENABLE_SERIAL) -#define KOKKOS_HAVE_SERIAL 1 -#endif - -#if (!defined(KOKKOS_HAVE_CXX1Z)) && defined(KOKKOS_ENABLE_CXX1Z) -#define KOKKOS_HAVE_CXX1Z 1 -#endif - -#if (!defined(KOKKOS_HAVE_DEBUG)) && defined(KOKKOS_ENABLE_DEBUG) -#define KOKKOS_HAVE_DEBUG 1 -#endif - -#ifdef KOKKOS_HAVE_DEBUG -#ifndef KOKKOS_DEBUG -#define KOKKOS_DEBUG KOKKOS_HAVE_DEBUG -#endif -#endif - -#if (!defined(KOKKOS_HAVE_HWLOC)) && defined(KOKKOS_ENABLE_HWLOC) -#define KOKKOS_HAVE_HWLOC 1 -#endif - -#if (!defined(KOKKOS_HAVE_HBWSPACE)) && defined(KOKKOS_ENABLE_HBWSPACE) -#define KOKKOS_HAVE_HBWSPACE 1 -#endif - -#if (!defined(KOKKOS_CUDA_USE_LDG_INTRINSIC)) && \ - defined(KOKKOS_ENABLE_CUDA_LDG_INTRINSIC) -#define KOKKOS_CUDA_USE_LDG_INTRINSIC 1 -#endif - -#if (!defined(KOKKOS_CUDA_USE_UVM)) && defined(KOKKOS_ENABLE_CUDA_UVM) -#define KOKKOS_CUDA_USE_UVM 1 -#endif - -#if (!defined(KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE)) && \ - defined(KOKKOS_ENABLE_CUDA_RELOCATABLE_DEVICE_CODE) -#define KOKKOS_CUDA_USE_RELOCATABLE_DEVICE_CODE 1 -#endif - -#if (!defined(KOKKOS_CUDA_USE_LAMBDA)) && defined(KOKKOS_ENABLE_CUDA_LAMBDA) -#define KOKKOS_CUDA_USE_LAMBDA 1 -#endif - -#if (!defined(KOKKOS_CUDA_CLANG_WORKAROUND)) && \ - defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) -#define KOKKOS_CUDA_CLANG_WORKAROUND 1 -#endif - -#if (!defined(KOKKOS_HAVE_MPI)) && defined(KOKKOS_ENABLE_MPI) -#define KOKKOS_HAVE_MPI 1 -#endif - -#endif // KOKKOS_ENABLE_DEPRECATED_CODE - -#endif // KOKKOS_IMPL_OLD_MACROS_HPP diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling.cpp b/lib/kokkos/core/src/impl/Kokkos_Profiling.cpp new file mode 100644 index 0000000000..2a996f279f --- /dev/null +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling.cpp @@ -0,0 +1,893 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include +#if defined(KOKKOS_ENABLE_LIBDL) +#include +#endif + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace Kokkos { + +namespace Tools { + +namespace Experimental { +#ifdef KOKKOS_ENABLE_TUNING +static size_t kernel_name_context_variable_id; +static size_t kernel_type_context_variable_id; +static std::unordered_map> + features_per_context; +static std::unordered_set active_features; +static std::unordered_map feature_values; +static std::unordered_map variable_metadata; +#endif + +static EventSet current_callbacks; +static EventSet backup_callbacks; +static EventSet no_profiling; + +bool eventSetsEqual(const EventSet& l, const EventSet& r) { + return l.init == r.init && l.finalize == r.finalize && + l.begin_parallel_for == r.begin_parallel_for && + l.end_parallel_for == r.end_parallel_for && + l.begin_parallel_reduce == r.begin_parallel_reduce && + l.end_parallel_reduce == r.end_parallel_reduce && + l.begin_parallel_scan == r.begin_parallel_scan && + l.end_parallel_scan == r.end_parallel_scan && + l.push_region == r.push_region && l.pop_region == r.pop_region && + l.allocate_data == r.allocate_data && + l.deallocate_data == r.deallocate_data && + l.create_profile_section == r.create_profile_section && + l.start_profile_section == r.start_profile_section && + l.stop_profile_section == r.stop_profile_section && + l.destroy_profile_section == r.destroy_profile_section && + l.profile_event == r.profile_event && + l.begin_deep_copy == r.begin_deep_copy && + l.end_deep_copy == r.end_deep_copy && + l.declare_input_type == r.declare_input_type && + l.declare_output_type == r.declare_output_type && + l.end_tuning_context == r.end_tuning_context && + l.begin_tuning_context == r.begin_tuning_context && + l.request_output_values == r.request_output_values && + l.declare_optimization_goal == r.declare_optimization_goal; +} +} // namespace Experimental +bool profileLibraryLoaded() { + return !Experimental::eventSetsEqual(Experimental::current_callbacks, + Experimental::no_profiling); +} + +void beginParallelFor(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID) { + if (Experimental::current_callbacks.begin_parallel_for != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.begin_parallel_for)(kernelPrefix.c_str(), + devID, kernelID); +#ifdef KOKKOS_ENABLE_TUNING + auto context_id = Experimental::get_new_context_id(); + Experimental::begin_context(context_id); + Experimental::VariableValue contextValues[] = { + Experimental::make_variable_value( + Experimental::kernel_name_context_variable_id, kernelPrefix), + Experimental::make_variable_value( + Experimental::kernel_type_context_variable_id, "parallel_for")}; + Experimental::set_input_values(context_id, 2, contextValues); +#endif + } +} + +void endParallelFor(const uint64_t kernelID) { + if (Experimental::current_callbacks.end_parallel_for != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.end_parallel_for)(kernelID); +#ifdef KOKKOS_ENABLE_TUNING + Experimental::end_context(Experimental::get_current_context_id()); +#endif + } +} + +void beginParallelScan(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID) { + if (Experimental::current_callbacks.begin_parallel_scan != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.begin_parallel_scan)(kernelPrefix.c_str(), + devID, kernelID); +#ifdef KOKKOS_ENABLE_TUNING + auto context_id = Experimental::get_new_context_id(); + Experimental::begin_context(context_id); + Experimental::VariableValue contextValues[] = { + Experimental::make_variable_value( + Experimental::kernel_name_context_variable_id, kernelPrefix), + Experimental::make_variable_value( + Experimental::kernel_type_context_variable_id, "parallel_for")}; + Experimental::set_input_values(context_id, 2, contextValues); +#endif + } +} + +void endParallelScan(const uint64_t kernelID) { + if (Experimental::current_callbacks.end_parallel_scan != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.end_parallel_scan)(kernelID); +#ifdef KOKKOS_ENABLE_TUNING + Experimental::end_context(Experimental::get_current_context_id()); +#endif + } +} + +void beginParallelReduce(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID) { + if (Experimental::current_callbacks.begin_parallel_reduce != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.begin_parallel_reduce)( + kernelPrefix.c_str(), devID, kernelID); +#ifdef KOKKOS_ENABLE_TUNING + auto context_id = Experimental::get_new_context_id(); + Experimental::begin_context(context_id); + Experimental::VariableValue contextValues[] = { + Experimental::make_variable_value( + Experimental::kernel_name_context_variable_id, kernelPrefix), + Experimental::make_variable_value( + Experimental::kernel_type_context_variable_id, "parallel_for")}; + Experimental::set_input_values(context_id, 2, contextValues); +#endif + } +} + +void endParallelReduce(const uint64_t kernelID) { + if (Experimental::current_callbacks.end_parallel_reduce != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.end_parallel_reduce)(kernelID); +#ifdef KOKKOS_ENABLE_TUNING + Experimental::end_context(Experimental::get_current_context_id()); +#endif + } +} + +void pushRegion(const std::string& kName) { + if (Experimental::current_callbacks.push_region != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.push_region)(kName.c_str()); + } +} + +void popRegion() { + if (Experimental::current_callbacks.pop_region != nullptr) { + Kokkos::fence(); + (*Experimental::current_callbacks.pop_region)(); + } +} + +void allocateData(const SpaceHandle space, const std::string label, + const void* ptr, const uint64_t size) { + if (Experimental::current_callbacks.allocate_data != nullptr) { + (*Experimental::current_callbacks.allocate_data)(space, label.c_str(), ptr, + size); + } +} + +void deallocateData(const SpaceHandle space, const std::string label, + const void* ptr, const uint64_t size) { + if (Experimental::current_callbacks.deallocate_data != nullptr) { + (*Experimental::current_callbacks.deallocate_data)(space, label.c_str(), + ptr, size); + } +} + +void beginDeepCopy(const SpaceHandle dst_space, const std::string dst_label, + const void* dst_ptr, const SpaceHandle src_space, + const std::string src_label, const void* src_ptr, + const uint64_t size) { + if (Experimental::current_callbacks.begin_deep_copy != nullptr) { + (*Experimental::current_callbacks.begin_deep_copy)( + dst_space, dst_label.c_str(), dst_ptr, src_space, src_label.c_str(), + src_ptr, size); +#ifdef KOKKOS_ENABLE_TUNING + auto context_id = Experimental::get_new_context_id(); + Experimental::begin_context(context_id); + Experimental::VariableValue contextValues[] = { + Experimental::make_variable_value( + Experimental::kernel_name_context_variable_id, "deep_copy_kernel"), + Experimental::make_variable_value( + Experimental::kernel_type_context_variable_id, "deep_copy")}; + Experimental::set_input_values(context_id, 2, contextValues); +#endif + } +} + +void endDeepCopy() { + if (Experimental::current_callbacks.end_deep_copy != nullptr) { + (*Experimental::current_callbacks.end_deep_copy)(); +#ifdef KOKKOS_ENABLE_TUNING + Experimental::end_context(Experimental::get_current_context_id()); +#endif + } +} + +void createProfileSection(const std::string& sectionName, uint32_t* secID) { + if (Experimental::current_callbacks.create_profile_section != nullptr) { + (*Experimental::current_callbacks.create_profile_section)( + sectionName.c_str(), secID); + } +} + +void startSection(const uint32_t secID) { + if (Experimental::current_callbacks.start_profile_section != nullptr) { + (*Experimental::current_callbacks.start_profile_section)(secID); + } +} + +void stopSection(const uint32_t secID) { + if (Experimental::current_callbacks.stop_profile_section != nullptr) { + (*Experimental::current_callbacks.stop_profile_section)(secID); + } +} + +void destroyProfileSection(const uint32_t secID) { + if (Experimental::current_callbacks.destroy_profile_section != nullptr) { + (*Experimental::current_callbacks.destroy_profile_section)(secID); + } +} + +void markEvent(const std::string& eventName) { + if (Experimental::current_callbacks.profile_event != nullptr) { + (*Experimental::current_callbacks.profile_event)(eventName.c_str()); + } +} + +SpaceHandle make_space_handle(const char* space_name) { + SpaceHandle handle; + strncpy(handle.name, space_name, 63); + return handle; +} + +void initialize() { + // Make sure initialize calls happens only once + static int is_initialized = 0; + if (is_initialized) return; + is_initialized = 1; + +#ifdef KOKKOS_ENABLE_LIBDL + void* firstProfileLibrary = nullptr; + + char* envProfileLibrary = getenv("KOKKOS_PROFILE_LIBRARY"); + + // If we do not find a profiling library in the environment then exit + // early. + if (envProfileLibrary == nullptr) { + return; + } + + char* envProfileCopy = + (char*)malloc(sizeof(char) * (strlen(envProfileLibrary) + 1)); + sprintf(envProfileCopy, "%s", envProfileLibrary); + + char* profileLibraryName = strtok(envProfileCopy, ";"); + + if ((profileLibraryName != nullptr) && + (strcmp(profileLibraryName, "") != 0)) { + firstProfileLibrary = dlopen(profileLibraryName, RTLD_NOW | RTLD_GLOBAL); + + if (firstProfileLibrary == nullptr) { + std::cerr << "Error: Unable to load KokkosP library: " + << profileLibraryName << std::endl; + std::cerr << "dlopen(" << profileLibraryName + << ", RTLD_NOW | RTLD_GLOBAL) failed with " << dlerror() + << '\n'; + } else { +#ifdef KOKKOS_ENABLE_PROFILING_LOAD_PRINT + std::cout << "KokkosP: Library Loaded: " << profileLibraryName + << std::endl; +#endif + // dlsym returns a pointer to an object, while we want to assign to + // pointer to function A direct cast will give warnings hence, we have to + // workaround the issue by casting pointer to pointers. + auto p1 = dlsym(firstProfileLibrary, "kokkosp_begin_parallel_for"); + Experimental::set_begin_parallel_for_callback( + *reinterpret_cast(&p1)); + auto p2 = dlsym(firstProfileLibrary, "kokkosp_begin_parallel_scan"); + Experimental::set_begin_parallel_scan_callback( + *reinterpret_cast(&p2)); + auto p3 = dlsym(firstProfileLibrary, "kokkosp_begin_parallel_reduce"); + Experimental::set_begin_parallel_reduce_callback( + *reinterpret_cast(&p3)); + + auto p4 = dlsym(firstProfileLibrary, "kokkosp_end_parallel_scan"); + Experimental::set_end_parallel_scan_callback( + *reinterpret_cast(&p4)); + auto p5 = dlsym(firstProfileLibrary, "kokkosp_end_parallel_for"); + Experimental::set_end_parallel_for_callback( + *reinterpret_cast(&p5)); + auto p6 = dlsym(firstProfileLibrary, "kokkosp_end_parallel_reduce"); + Experimental::set_end_parallel_reduce_callback( + *reinterpret_cast(&p6)); + + auto p7 = dlsym(firstProfileLibrary, "kokkosp_init_library"); + Experimental::set_init_callback(*reinterpret_cast(&p7)); + auto p8 = dlsym(firstProfileLibrary, "kokkosp_finalize_library"); + Experimental::set_finalize_callback( + *reinterpret_cast(&p8)); + + auto p9 = dlsym(firstProfileLibrary, "kokkosp_push_profile_region"); + Experimental::set_push_region_callback( + *reinterpret_cast(&p9)); + auto p10 = dlsym(firstProfileLibrary, "kokkosp_pop_profile_region"); + Experimental::set_pop_region_callback( + *reinterpret_cast(&p10)); + + auto p11 = dlsym(firstProfileLibrary, "kokkosp_allocate_data"); + Experimental::set_allocate_data_callback( + *reinterpret_cast(&p11)); + auto p12 = dlsym(firstProfileLibrary, "kokkosp_deallocate_data"); + Experimental::set_deallocate_data_callback( + *reinterpret_cast(&p12)); + + auto p13 = dlsym(firstProfileLibrary, "kokkosp_begin_deep_copy"); + Experimental::set_begin_deep_copy_callback( + *reinterpret_cast(&p13)); + auto p14 = dlsym(firstProfileLibrary, "kokkosp_end_deep_copy"); + Experimental::set_end_deep_copy_callback( + *reinterpret_cast(&p14)); + + auto p15 = dlsym(firstProfileLibrary, "kokkosp_create_profile_section"); + Experimental::set_create_profile_section_callback( + *(reinterpret_cast(&p15))); + auto p16 = dlsym(firstProfileLibrary, "kokkosp_start_profile_section"); + Experimental::set_start_profile_section_callback( + *reinterpret_cast(&p16)); + auto p17 = dlsym(firstProfileLibrary, "kokkosp_stop_profile_section"); + Experimental::set_stop_profile_section_callback( + *reinterpret_cast(&p17)); + auto p18 = dlsym(firstProfileLibrary, "kokkosp_destroy_profile_section"); + Experimental::set_destroy_profile_section_callback( + *(reinterpret_cast(&p18))); + + auto p19 = dlsym(firstProfileLibrary, "kokkosp_profile_event"); + Experimental::set_profile_event_callback( + *reinterpret_cast(&p19)); + +#ifdef KOKKOS_ENABLE_TUNING + auto p20 = dlsym(firstProfileLibrary, "kokkosp_declare_output_type"); + Experimental::set_declare_output_type_callback( + *reinterpret_cast( + &p20)); + + auto p21 = dlsym(firstProfileLibrary, "kokkosp_declare_input_type"); + Experimental::set_declare_input_type_callback( + *reinterpret_cast(&p21)); + auto p22 = dlsym(firstProfileLibrary, "kokkosp_request_values"); + Experimental::set_request_output_values_callback( + *reinterpret_cast(&p22)); + auto p23 = dlsym(firstProfileLibrary, "kokkosp_end_context"); + Experimental::set_end_context_callback( + *reinterpret_cast(&p23)); + auto p24 = dlsym(firstProfileLibrary, "kokkosp_begin_context"); + Experimental::set_begin_context_callback( + *reinterpret_cast(&p24)); + auto p25 = + dlsym(firstProfileLibrary, "kokkosp_declare_optimization_goal"); + Experimental::set_declare_optimization_goal_callback( + *reinterpret_cast( + &p25)); +#endif // KOKKOS_ENABLE_TUNING + } + } +#endif // KOKKOS_ENABLE_LIBDL + if (Experimental::current_callbacks.init != nullptr) { + (*Experimental::current_callbacks.init)( + 0, (uint64_t)KOKKOSP_INTERFACE_VERSION, (uint32_t)0, nullptr); + } + +#ifdef KOKKOS_ENABLE_TUNING + Experimental::VariableInfo kernel_name; + kernel_name.type = Experimental::ValueType::kokkos_value_string; + kernel_name.category = + Experimental::StatisticalCategory::kokkos_value_categorical; + kernel_name.valueQuantity = + Experimental::CandidateValueType::kokkos_value_unbounded; + + std::array candidate_values = { + "parallel_for", + "parallel_reduce", + "parallel_scan", + "parallel_copy", + }; + + Experimental::SetOrRange kernel_type_variable_candidates = + Experimental::make_candidate_set(4, candidate_values.data()); + + Experimental::kernel_name_context_variable_id = + Experimental::declare_input_type("kokkos.kernel_name", kernel_name); + + Experimental::VariableInfo kernel_type; + kernel_type.type = Experimental::ValueType::kokkos_value_string; + kernel_type.category = + Experimental::StatisticalCategory::kokkos_value_categorical; + kernel_type.valueQuantity = + Experimental::CandidateValueType::kokkos_value_set; + kernel_type.candidates = kernel_type_variable_candidates; + Experimental::kernel_type_context_variable_id = + Experimental::declare_input_type("kokkos.kernel_type", kernel_type); + +#endif + + Experimental::no_profiling.init = nullptr; + Experimental::no_profiling.finalize = nullptr; + + Experimental::no_profiling.begin_parallel_for = nullptr; + Experimental::no_profiling.begin_parallel_scan = nullptr; + Experimental::no_profiling.begin_parallel_reduce = nullptr; + Experimental::no_profiling.end_parallel_scan = nullptr; + Experimental::no_profiling.end_parallel_for = nullptr; + Experimental::no_profiling.end_parallel_reduce = nullptr; + + Experimental::no_profiling.push_region = nullptr; + Experimental::no_profiling.pop_region = nullptr; + Experimental::no_profiling.allocate_data = nullptr; + Experimental::no_profiling.deallocate_data = nullptr; + + Experimental::no_profiling.begin_deep_copy = nullptr; + Experimental::no_profiling.end_deep_copy = nullptr; + + Experimental::no_profiling.create_profile_section = nullptr; + Experimental::no_profiling.start_profile_section = nullptr; + Experimental::no_profiling.stop_profile_section = nullptr; + Experimental::no_profiling.destroy_profile_section = nullptr; + + Experimental::no_profiling.profile_event = nullptr; + + Experimental::no_profiling.declare_input_type = nullptr; + Experimental::no_profiling.declare_output_type = nullptr; + Experimental::no_profiling.request_output_values = nullptr; + Experimental::no_profiling.end_tuning_context = nullptr; +#ifdef KOKKOS_ENABLE_LIBDL + free(envProfileCopy); +#endif +} + +void finalize() { + // Make sure finalize calls happens only once + static int is_finalized = 0; + if (is_finalized) return; + is_finalized = 1; + + if (Experimental::current_callbacks.finalize != nullptr) { + (*Experimental::current_callbacks.finalize)(); + + Experimental::pause_tools(); + } +#ifdef KOKKOS_ENABLE_TUNING + // clean up string candidate set + for (auto& metadata_pair : Experimental::variable_metadata) { + auto metadata = metadata_pair.second; + if ((metadata.type == Experimental::ValueType::kokkos_value_string) && + (metadata.valueQuantity == + Experimental::CandidateValueType::kokkos_value_set)) { + auto candidate_set = metadata.candidates.set; + delete[] candidate_set.values.string_value; + } + } +#endif +} + +} // namespace Tools + +namespace Tools { +namespace Experimental { +void set_init_callback(initFunction callback) { + current_callbacks.init = callback; +} +void set_finalize_callback(finalizeFunction callback) { + current_callbacks.finalize = callback; +} +void set_begin_parallel_for_callback(beginFunction callback) { + current_callbacks.begin_parallel_for = callback; +} +void set_end_parallel_for_callback(endFunction callback) { + current_callbacks.end_parallel_for = callback; +} +void set_begin_parallel_reduce_callback(beginFunction callback) { + current_callbacks.begin_parallel_reduce = callback; +} +void set_end_parallel_reduce_callback(endFunction callback) { + current_callbacks.end_parallel_reduce = callback; +} +void set_begin_parallel_scan_callback(beginFunction callback) { + current_callbacks.begin_parallel_scan = callback; +} +void set_end_parallel_scan_callback(endFunction callback) { + current_callbacks.end_parallel_scan = callback; +} +void set_push_region_callback(pushFunction callback) { + current_callbacks.push_region = callback; +} +void set_pop_region_callback(popFunction callback) { + current_callbacks.pop_region = callback; +} +void set_allocate_data_callback(allocateDataFunction callback) { + current_callbacks.allocate_data = callback; +} +void set_deallocate_data_callback(deallocateDataFunction callback) { + current_callbacks.deallocate_data = callback; +} +void set_create_profile_section_callback( + createProfileSectionFunction callback) { + current_callbacks.create_profile_section = callback; +} +void set_start_profile_section_callback(startProfileSectionFunction callback) { + current_callbacks.start_profile_section = callback; +} +void set_stop_profile_section_callback(stopProfileSectionFunction callback) { + current_callbacks.stop_profile_section = callback; +} +void set_destroy_profile_section_callback( + destroyProfileSectionFunction callback) { + current_callbacks.destroy_profile_section = callback; +} +void set_profile_event_callback(profileEventFunction callback) { + current_callbacks.profile_event = callback; +} +void set_begin_deep_copy_callback(beginDeepCopyFunction callback) { + current_callbacks.begin_deep_copy = callback; +} +void set_end_deep_copy_callback(endDeepCopyFunction callback) { + current_callbacks.end_deep_copy = callback; +} + +void set_declare_output_type_callback(outputTypeDeclarationFunction callback) { + current_callbacks.declare_output_type = callback; +} +void set_declare_input_type_callback(inputTypeDeclarationFunction callback) { + current_callbacks.declare_input_type = callback; +} +void set_request_output_values_callback(requestValueFunction callback) { + current_callbacks.request_output_values = callback; +} +void set_end_context_callback(contextEndFunction callback) { + current_callbacks.end_tuning_context = callback; +} +void set_begin_context_callback(contextBeginFunction callback) { + current_callbacks.begin_tuning_context = callback; +} +void set_declare_optimization_goal_callback( + optimizationGoalDeclarationFunction callback) { + current_callbacks.declare_optimization_goal = callback; +} + +void pause_tools() { + backup_callbacks = current_callbacks; + current_callbacks = no_profiling; +} + +void resume_tools() { current_callbacks = backup_callbacks; } + +EventSet get_callbacks() { return current_callbacks; } +void set_callbacks(EventSet new_events) { current_callbacks = new_events; } +} // namespace Experimental +} // namespace Tools + +namespace Profiling { +bool profileLibraryLoaded() { return Kokkos::Tools::profileLibraryLoaded(); } + +void beginParallelFor(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID) { + Kokkos::Tools::beginParallelFor(kernelPrefix, devID, kernelID); +} +void beginParallelReduce(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID) { + Kokkos::Tools::beginParallelReduce(kernelPrefix, devID, kernelID); +} +void beginParallelScan(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID) { + Kokkos::Tools::beginParallelScan(kernelPrefix, devID, kernelID); +} +void endParallelFor(const uint64_t kernelID) { + Kokkos::Tools::endParallelFor(kernelID); +} +void endParallelReduce(const uint64_t kernelID) { + Kokkos::Tools::endParallelReduce(kernelID); +} +void endParallelScan(const uint64_t kernelID) { + Kokkos::Tools::endParallelScan(kernelID); +} + +void pushRegion(const std::string& kName) { Kokkos::Tools::pushRegion(kName); } +void popRegion() { Kokkos::Tools::popRegion(); } + +void createProfileSection(const std::string& sectionName, uint32_t* secID) { + Kokkos::Tools::createProfileSection(sectionName, secID); +} +void destroyProfileSection(const uint32_t secID) { + Kokkos::Tools::destroyProfileSection(secID); +} + +void startSection(const uint32_t secID) { Kokkos::Tools::startSection(secID); } + +void stopSection(const uint32_t secID) { Kokkos::Tools::stopSection(secID); } + +void markEvent(const std::string& eventName) { + Kokkos::Tools::markEvent(eventName); +} +void allocateData(const SpaceHandle handle, const std::string name, + const void* data, const uint64_t size) { + Kokkos::Tools::allocateData(handle, name, data, size); +} +void deallocateData(const SpaceHandle space, const std::string label, + const void* ptr, const uint64_t size) { + Kokkos::Tools::deallocateData(space, label, ptr, size); +} + +void beginDeepCopy(const SpaceHandle dst_space, const std::string dst_label, + const void* dst_ptr, const SpaceHandle src_space, + const std::string src_label, const void* src_ptr, + const uint64_t size) { + Kokkos::Tools::beginDeepCopy(dst_space, dst_label, dst_ptr, src_space, + src_label, src_ptr, size); +} +void endDeepCopy() { Kokkos::Tools::endDeepCopy(); } + +void finalize() { Kokkos::Tools::finalize(); } +void initialize() { Kokkos::Tools::initialize(); } + +SpaceHandle make_space_handle(const char* space_name) { + return Kokkos::Tools::make_space_handle(space_name); +} +} // namespace Profiling + +} // namespace Kokkos + +// Tuning + +namespace Kokkos { +namespace Tools { +namespace Experimental { +static size_t& get_context_counter() { + static size_t x; + return x; +} +static size_t& get_variable_counter() { + static size_t x; + return ++x; +} + +size_t get_new_context_id() { return ++get_context_counter(); } +size_t get_current_context_id() { return get_context_counter(); } +void decrement_current_context_id() { --get_context_counter(); } +size_t get_new_variable_id() { return get_variable_counter(); } + +size_t declare_output_type(const std::string& variableName, VariableInfo info) { + size_t variableId = get_new_variable_id(); +#ifdef KOKKOS_ENABLE_TUNING + if (Experimental::current_callbacks.declare_output_type != nullptr) { + (*Experimental::current_callbacks.declare_output_type)(variableName.c_str(), + variableId, &info); + } + variable_metadata[variableId] = info; +#else + (void)variableName; + (void)info; +#endif + return variableId; +} + +size_t declare_input_type(const std::string& variableName, VariableInfo info) { + size_t variableId = get_new_variable_id(); +#ifdef KOKKOS_ENABLE_TUNING + if (Experimental::current_callbacks.declare_input_type != nullptr) { + (*Experimental::current_callbacks.declare_input_type)(variableName.c_str(), + variableId, &info); + } + variable_metadata[variableId] = info; +#else + (void)variableName; + (void)info; +#endif + return variableId; +} + +void set_input_values(size_t contextId, size_t count, VariableValue* values) { +#ifdef KOKKOS_ENABLE_TUNING + if (features_per_context.find(contextId) == features_per_context.end()) { + features_per_context[contextId] = std::unordered_set(); + } + for (size_t x = 0; x < count; ++x) { + values[x].metadata = &variable_metadata[values[x].type_id]; + features_per_context[contextId].insert(values[x].type_id); + active_features.insert(values[x].type_id); + feature_values[values[x].type_id] = values[x]; + } +#else + (void)contextId; + (void)count; + (void)values; +#endif +} +#include +void request_output_values(size_t contextId, size_t count, + VariableValue* values) { +#ifdef KOKKOS_ENABLE_TUNING + std::vector context_ids; + std::vector context_values; + for (auto id : active_features) { + context_values.push_back(feature_values[id]); + } + if (Experimental::current_callbacks.request_output_values != nullptr) { + for (size_t x = 0; x < count; ++x) { + values[x].metadata = &variable_metadata[values[x].type_id]; + } + (*Experimental::current_callbacks.request_output_values)( + contextId, context_values.size(), context_values.data(), count, values); + } +#else + (void)contextId; + (void)count; + (void)values; +#endif +} + +static std::unordered_map optimization_goals; + +void begin_context(size_t contextId) { + if (Experimental::current_callbacks.begin_tuning_context != nullptr) { + (*Experimental::current_callbacks.begin_tuning_context)(contextId); + } +} +void end_context(size_t contextId) { +#ifdef KOKKOS_ENABLE_TUNING + for (auto id : features_per_context[contextId]) { + active_features.erase(id); + } + if (Experimental::current_callbacks.end_tuning_context != nullptr) { + (*Experimental::current_callbacks.end_tuning_context)( + contextId, feature_values[optimization_goals[contextId]]); + } + optimization_goals.erase(contextId); + decrement_current_context_id(); +#else + (void)contextId; +#endif +} + +bool have_tuning_tool() { +#ifdef KOKKOS_ENABLE_TUNING + return (Experimental::current_callbacks.request_output_values != nullptr); +#else + return false; +#endif +} + +VariableValue make_variable_value(size_t id, int64_t val) { + VariableValue variable_value; + variable_value.type_id = id; + variable_value.value.int_value = val; + return variable_value; +} +VariableValue make_variable_value(size_t id, double val) { + VariableValue variable_value; + variable_value.type_id = id; + variable_value.value.double_value = val; + return variable_value; +} +VariableValue make_variable_value(size_t id, const std::string& val) { + VariableValue variable_value; + variable_value.type_id = id; + strncpy(variable_value.value.string_value, val.c_str(), + KOKKOS_TOOLS_TUNING_STRING_LENGTH - 1); + return variable_value; +} +SetOrRange make_candidate_set(size_t size, std::string* data) { + SetOrRange value_set; + value_set.set.values.string_value = new TuningString[size]; + for (size_t x = 0; x < size; ++x) { + strncpy(value_set.set.values.string_value[x], data[x].c_str(), + KOKKOS_TOOLS_TUNING_STRING_LENGTH - 1); + } + value_set.set.size = size; + return value_set; +} +SetOrRange make_candidate_set(size_t size, int64_t* data) { + SetOrRange value_set; + value_set.set.size = size; + value_set.set.values.int_value = data; + return value_set; +} +SetOrRange make_candidate_set(size_t size, double* data) { + SetOrRange value_set; + value_set.set.size = size; + value_set.set.values.double_value = data; + return value_set; +} +SetOrRange make_candidate_range(double lower, double upper, double step, + bool openLower = false, + bool openUpper = false) { + SetOrRange value_range; + value_range.range.lower.double_value = lower; + value_range.range.upper.double_value = upper; + value_range.range.step.double_value = step; + value_range.range.openLower = openLower; + value_range.range.openUpper = openUpper; + return value_range; +} + +SetOrRange make_candidate_range(int64_t lower, int64_t upper, int64_t step, + bool openLower = false, + bool openUpper = false) { + SetOrRange value_range; + value_range.range.lower.int_value = lower; + value_range.range.upper.int_value = upper; + value_range.range.step.int_value = step; + value_range.range.openLower = openLower; + value_range.range.openUpper = openUpper; + return value_range; +} + +size_t get_new_context_id(); +size_t get_current_context_id(); +void decrement_current_context_id(); +size_t get_new_variable_id(); +void declare_optimization_goal(const size_t context, + const OptimizationGoal& goal) { +#ifdef KOKKOS_ENABLE_TUNING + if (Experimental::current_callbacks.declare_optimization_goal != nullptr) { + (*Experimental::current_callbacks.declare_optimization_goal)(context, goal); + } + optimization_goals[context] = goal.type_id; +#else + (void)context; + (void)goal; +#endif +} +} // end namespace Experimental +} // end namespace Tools + +} // end namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling.hpp b/lib/kokkos/core/src/impl/Kokkos_Profiling.hpp new file mode 100644 index 0000000000..4cc1df8041 --- /dev/null +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling.hpp @@ -0,0 +1,244 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_IMPL_KOKKOS_PROFILING_HPP +#define KOKKOS_IMPL_KOKKOS_PROFILING_HPP + +#include +#include +#include + +#include + +namespace Kokkos { +namespace Tools { + +bool profileLibraryLoaded(); + +void beginParallelFor(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID); +void endParallelFor(const uint64_t kernelID); +void beginParallelScan(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID); +void endParallelScan(const uint64_t kernelID); +void beginParallelReduce(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID); +void endParallelReduce(const uint64_t kernelID); + +void pushRegion(const std::string& kName); +void popRegion(); + +void createProfileSection(const std::string& sectionName, uint32_t* secID); +void startSection(const uint32_t secID); +void stopSection(const uint32_t secID); +void destroyProfileSection(const uint32_t secID); + +void markEvent(const std::string& evName); + +void allocateData(const SpaceHandle space, const std::string label, + const void* ptr, const uint64_t size); +void deallocateData(const SpaceHandle space, const std::string label, + const void* ptr, const uint64_t size); + +void beginDeepCopy(const SpaceHandle dst_space, const std::string dst_label, + const void* dst_ptr, const SpaceHandle src_space, + const std::string src_label, const void* src_ptr, + const uint64_t size); +void endDeepCopy(); + +void initialize(); +void finalize(); + +Kokkos_Profiling_SpaceHandle make_space_handle(const char* space_name); + +namespace Experimental { + +void set_init_callback(initFunction callback); +void set_finalize_callback(finalizeFunction callback); +void set_begin_parallel_for_callback(beginFunction callback); +void set_end_parallel_for_callback(endFunction callback); +void set_begin_parallel_reduce_callback(beginFunction callback); +void set_end_parallel_reduce_callback(endFunction callback); +void set_begin_parallel_scan_callback(beginFunction callback); +void set_end_parallel_scan_callback(endFunction callback); +void set_push_region_callback(pushFunction callback); +void set_pop_region_callback(popFunction callback); +void set_allocate_data_callback(allocateDataFunction callback); +void set_deallocate_data_callback(deallocateDataFunction callback); +void set_create_profile_section_callback(createProfileSectionFunction callback); +void set_start_profile_section_callback(startProfileSectionFunction callback); +void set_stop_profile_section_callback(stopProfileSectionFunction callback); +void set_destroy_profile_section_callback( + destroyProfileSectionFunction callback); +void set_profile_event_callback(profileEventFunction callback); +void set_begin_deep_copy_callback(beginDeepCopyFunction callback); +void set_end_deep_copy_callback(endDeepCopyFunction callback); + +void set_declare_output_type_callback(outputTypeDeclarationFunction callback); +void set_declare_input_type_callback(inputTypeDeclarationFunction callback); +void set_request_output_values_callback(requestValueFunction callback); +void set_declare_optimization_goal_callback( + optimizationGoalDeclarationFunction callback); +void set_end_context_callback(contextEndFunction callback); +void set_begin_context_callback(contextBeginFunction callback); + +void pause_tools(); +void resume_tools(); + +EventSet get_callbacks(); +void set_callbacks(EventSet new_events); +} // namespace Experimental +} // namespace Tools +namespace Profiling { + +bool profileLibraryLoaded(); + +void beginParallelFor(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID); +void beginParallelReduce(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID); +void beginParallelScan(const std::string& kernelPrefix, const uint32_t devID, + uint64_t* kernelID); +void endParallelFor(const uint64_t kernelID); +void endParallelReduce(const uint64_t kernelID); +void endParallelScan(const uint64_t kernelID); +void pushRegion(const std::string& kName); +void popRegion(); + +void createProfileSection(const std::string& sectionName, uint32_t* secID); +void destroyProfileSection(const uint32_t secID); +void startSection(const uint32_t secID); + +void stopSection(const uint32_t secID); + +void markEvent(const std::string& eventName); +void allocateData(const SpaceHandle handle, const std::string name, + const void* data, const uint64_t size); +void deallocateData(const SpaceHandle space, const std::string label, + const void* ptr, const uint64_t size); +void beginDeepCopy(const SpaceHandle dst_space, const std::string dst_label, + const void* dst_ptr, const SpaceHandle src_space, + const std::string src_label, const void* src_ptr, + const uint64_t size); +void endDeepCopy(); + +void finalize(); +void initialize(); +SpaceHandle make_space_handle(const char* space_name); + +namespace Experimental { +using Kokkos::Tools::Experimental::set_allocate_data_callback; +using Kokkos::Tools::Experimental::set_begin_deep_copy_callback; +using Kokkos::Tools::Experimental::set_begin_parallel_for_callback; +using Kokkos::Tools::Experimental::set_begin_parallel_reduce_callback; +using Kokkos::Tools::Experimental::set_begin_parallel_scan_callback; +using Kokkos::Tools::Experimental::set_create_profile_section_callback; +using Kokkos::Tools::Experimental::set_deallocate_data_callback; +using Kokkos::Tools::Experimental::set_destroy_profile_section_callback; +using Kokkos::Tools::Experimental::set_end_deep_copy_callback; +using Kokkos::Tools::Experimental::set_end_parallel_for_callback; +using Kokkos::Tools::Experimental::set_end_parallel_reduce_callback; +using Kokkos::Tools::Experimental::set_end_parallel_scan_callback; +using Kokkos::Tools::Experimental::set_finalize_callback; +using Kokkos::Tools::Experimental::set_init_callback; +using Kokkos::Tools::Experimental::set_pop_region_callback; +using Kokkos::Tools::Experimental::set_profile_event_callback; +using Kokkos::Tools::Experimental::set_push_region_callback; +using Kokkos::Tools::Experimental::set_start_profile_section_callback; +using Kokkos::Tools::Experimental::set_stop_profile_section_callback; + +using Kokkos::Tools::Experimental::EventSet; + +using Kokkos::Tools::Experimental::pause_tools; +using Kokkos::Tools::Experimental::resume_tools; + +using Kokkos::Tools::Experimental::get_callbacks; +using Kokkos::Tools::Experimental::set_callbacks; + +} // namespace Experimental +} // namespace Profiling + +namespace Tools { +namespace Experimental { + +VariableValue make_variable_value(size_t id, int64_t val); +VariableValue make_variable_value(size_t id, double val); +VariableValue make_variable_value(size_t id, const std::string& val); + +SetOrRange make_candidate_set(size_t size, std::string* data); +SetOrRange make_candidate_set(size_t size, int64_t* data); +SetOrRange make_candidate_set(size_t size, double* data); +SetOrRange make_candidate_range(double lower, double upper, double step, + bool openLower, bool openUpper); + +SetOrRange make_candidate_range(int64_t lower, int64_t upper, int64_t step, + bool openLower, bool openUpper); + +void declare_optimization_goal(const size_t context, + const OptimizationGoal& goal); + +size_t declare_output_type(const std::string& typeName, VariableInfo info); + +size_t declare_input_type(const std::string& typeName, VariableInfo info); + +void set_input_values(size_t contextId, size_t count, VariableValue* values); + +void end_context(size_t contextId); +void begin_context(size_t contextId); + +void request_output_values(size_t contextId, size_t count, + VariableValue* values); + +bool have_tuning_tool(); + +size_t get_new_context_id(); +size_t get_current_context_id(); + +size_t get_new_variable_id(); +} // namespace Experimental +} // namespace Tools + +} // namespace Kokkos + +#endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_C_Interface.h b/lib/kokkos/core/src/impl/Kokkos_Profiling_C_Interface.h new file mode 100644 index 0000000000..04189d5268 --- /dev/null +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling_C_Interface.h @@ -0,0 +1,244 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_PROFILING_C_INTERFACE_HPP +#define KOKKOS_PROFILING_C_INTERFACE_HPP + +#ifdef __cplusplus +#include +#include +#else +#include +#include +#include +#endif + +#define KOKKOSP_INTERFACE_VERSION 20200625 + +// Profiling + +struct Kokkos_Profiling_KokkosPDeviceInfo { + size_t deviceID; +}; + +struct Kokkos_Profiling_SpaceHandle { + char name[64]; +}; + +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_initFunction)( + const int, const uint64_t, const uint32_t, + struct Kokkos_Profiling_KokkosPDeviceInfo*); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_finalizeFunction)(); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_beginFunction)(const char*, const uint32_t, + uint64_t*); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_endFunction)(uint64_t); + +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_pushFunction)(const char*); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_popFunction)(); + +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_allocateDataFunction)( + const struct Kokkos_Profiling_SpaceHandle, const char*, const void*, + const uint64_t); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_deallocateDataFunction)( + const struct Kokkos_Profiling_SpaceHandle, const char*, const void*, + const uint64_t); + +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_createProfileSectionFunction)(const char*, + uint32_t*); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_startProfileSectionFunction)(const uint32_t); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_stopProfileSectionFunction)(const uint32_t); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_destroyProfileSectionFunction)(const uint32_t); + +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_profileEventFunction)(const char*); + +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_beginDeepCopyFunction)( + struct Kokkos_Profiling_SpaceHandle, const char*, const void*, + struct Kokkos_Profiling_SpaceHandle, const char*, const void*, uint64_t); +// NOLINTNEXTLINE(modernize-use-using): C compatibility +typedef void (*Kokkos_Profiling_endDeepCopyFunction)(); + +// Tuning + +#define KOKKOS_TOOLS_TUNING_STRING_LENGTH 64 +typedef char Kokkos_Tools_Tuning_String[KOKKOS_TOOLS_TUNING_STRING_LENGTH]; +union Kokkos_Tools_VariableValue_ValueUnion { + int64_t int_value; + double double_value; + Kokkos_Tools_Tuning_String string_value; +}; + +union Kokkos_Tools_VariableValue_ValueUnionSet { + int64_t* int_value; + double* double_value; + Kokkos_Tools_Tuning_String* string_value; +}; + +struct Kokkos_Tools_ValueSet { + size_t size; + union Kokkos_Tools_VariableValue_ValueUnionSet values; +}; + +enum Kokkos_Tools_OptimizationType { + Kokkos_Tools_Minimize, + Kokkos_Tools_Maximize +}; + +struct Kokkos_Tools_OptimzationGoal { + size_t type_id; + enum Kokkos_Tools_OptimizationType goal; +}; + +struct Kokkos_Tools_ValueRange { + union Kokkos_Tools_VariableValue_ValueUnion lower; + union Kokkos_Tools_VariableValue_ValueUnion upper; + union Kokkos_Tools_VariableValue_ValueUnion step; + bool openLower; + bool openUpper; +}; + +enum Kokkos_Tools_VariableInfo_ValueType { + kokkos_value_double, + kokkos_value_int64, + kokkos_value_string, +}; + +enum Kokkos_Tools_VariableInfo_StatisticalCategory { + kokkos_value_categorical, // unordered distinct objects + kokkos_value_ordinal, // ordered distinct objects + kokkos_value_interval, // ordered distinct objects for which distance matters + kokkos_value_ratio // ordered distinct objects for which distance matters, + // division matters, and the concept of zero exists +}; + +enum Kokkos_Tools_VariableInfo_CandidateValueType { + kokkos_value_set, // I am one of [2,3,4,5] + kokkos_value_range, // I am somewhere in [2,12) + kokkos_value_unbounded // I am [text/int/float], but we don't know at + // declaration time what values are appropriate. Only + // valid for Context Variables +}; + +union Kokkos_Tools_VariableInfo_SetOrRange { + struct Kokkos_Tools_ValueSet set; + struct Kokkos_Tools_ValueRange range; +}; + +struct Kokkos_Tools_VariableInfo { + enum Kokkos_Tools_VariableInfo_ValueType type; + enum Kokkos_Tools_VariableInfo_StatisticalCategory category; + enum Kokkos_Tools_VariableInfo_CandidateValueType valueQuantity; + union Kokkos_Tools_VariableInfo_SetOrRange candidates; + void* toolProvidedInfo; +}; + +struct Kokkos_Tools_VariableValue { + size_t type_id; + union Kokkos_Tools_VariableValue_ValueUnion value; + struct Kokkos_Tools_VariableInfo* metadata; +}; + +typedef void (*Kokkos_Tools_outputTypeDeclarationFunction)( + const char*, const size_t, struct Kokkos_Tools_VariableInfo* info); +typedef void (*Kokkos_Tools_inputTypeDeclarationFunction)( + const char*, const size_t, struct Kokkos_Tools_VariableInfo* info); + +typedef void (*Kokkos_Tools_requestValueFunction)( + const size_t, const size_t, const struct Kokkos_Tools_VariableValue*, + const size_t count, struct Kokkos_Tools_VariableValue*); +typedef void (*Kokkos_Tools_contextBeginFunction)(const size_t); +typedef void (*Kokkos_Tools_contextEndFunction)( + const size_t, struct Kokkos_Tools_VariableValue); +typedef void (*Kokkos_Tools_optimizationGoalDeclarationFunction)( + const size_t, const struct Kokkos_Tools_OptimzationGoal goal); + +typedef void (*function_pointer)(); + +struct Kokkos_Profiling_EventSet { + Kokkos_Profiling_initFunction init; + Kokkos_Profiling_finalizeFunction finalize; + Kokkos_Profiling_beginFunction begin_parallel_for; + Kokkos_Profiling_endFunction end_parallel_for; + Kokkos_Profiling_beginFunction begin_parallel_reduce; + Kokkos_Profiling_endFunction end_parallel_reduce; + Kokkos_Profiling_beginFunction begin_parallel_scan; + Kokkos_Profiling_endFunction end_parallel_scan; + Kokkos_Profiling_pushFunction push_region; + Kokkos_Profiling_popFunction pop_region; + Kokkos_Profiling_allocateDataFunction allocate_data; + Kokkos_Profiling_deallocateDataFunction deallocate_data; + Kokkos_Profiling_createProfileSectionFunction create_profile_section; + Kokkos_Profiling_startProfileSectionFunction start_profile_section; + Kokkos_Profiling_stopProfileSectionFunction stop_profile_section; + Kokkos_Profiling_destroyProfileSectionFunction destroy_profile_section; + Kokkos_Profiling_profileEventFunction profile_event; + Kokkos_Profiling_beginDeepCopyFunction begin_deep_copy; + Kokkos_Profiling_endDeepCopyFunction end_deep_copy; + char profiling_padding[16 * sizeof(function_pointer)]; + Kokkos_Tools_outputTypeDeclarationFunction declare_output_type; + Kokkos_Tools_inputTypeDeclarationFunction declare_input_type; + Kokkos_Tools_requestValueFunction request_output_values; + Kokkos_Tools_contextBeginFunction begin_tuning_context; + Kokkos_Tools_contextEndFunction end_tuning_context; + Kokkos_Tools_optimizationGoalDeclarationFunction declare_optimization_goal; + char padding[234 * + sizeof(function_pointer)]; // allows us to add another 256 + // events to the Tools interface + // without changing struct layout +}; + +#endif // KOKKOS_PROFILING_C_INTERFACE_HPP diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp b/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp index 51d1446ef5..be6f756d0c 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling_DeviceInfo.hpp @@ -46,14 +46,10 @@ #define KOKKOSP_DEVICE_INFO_HPP #include - +#include namespace Kokkos { namespace Profiling { - -struct KokkosPDeviceInfo { - uint32_t deviceID; -}; - +using KokkosPDeviceInfo = Kokkos_Profiling_KokkosPDeviceInfo; } // namespace Profiling } // namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp deleted file mode 100644 index cf52caea90..0000000000 --- a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.cpp +++ /dev/null @@ -1,387 +0,0 @@ -/* - //@HEADER - // ************************************************************************ - // - // Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). - // - // Under the terms of Contract DE-NA0003525 with NTESS, - // the U.S. Government retains certain rights in this software. - // - // Redistribution and use in source and binary forms, with or without - // modification, are permitted provided that the following conditions are - // met: - // - // 1. Redistributions of source code must retain the above copyright - // notice, this list of conditions and the following disclaimer. - // - // 2. Redistributions in binary form must reproduce the above copyright - // notice, this list of conditions and the following disclaimer in the - // documentation and/or other materials provided with the distribution. - // - // 3. Neither the name of the Corporation nor the names of the - // contributors may be used to endorse or promote products derived from - // this software without specific prior written permission. - // - // THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY - // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE - // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, - // EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, - // PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR - // PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF - // LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - // NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS - // SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - // - // Questions? Contact Christian R. Trott (crtrott@sandia.gov) - // - // ************************************************************************ - //@HEADER - */ - -#include - -#if defined(KOKKOS_ENABLE_PROFILING) - -#include -#include - -namespace Kokkos { -namespace Profiling { - -static initFunction initProfileLibrary = nullptr; -static finalizeFunction finalizeProfileLibrary = nullptr; - -static beginFunction beginForCallee = nullptr; -static beginFunction beginScanCallee = nullptr; -static beginFunction beginReduceCallee = nullptr; -static endFunction endForCallee = nullptr; -static endFunction endScanCallee = nullptr; -static endFunction endReduceCallee = nullptr; - -static pushFunction pushRegionCallee = nullptr; -static popFunction popRegionCallee = nullptr; - -static allocateDataFunction allocateDataCallee = nullptr; -static deallocateDataFunction deallocateDataCallee = nullptr; - -static beginDeepCopyFunction beginDeepCopyCallee = nullptr; -static endDeepCopyFunction endDeepCopyCallee = nullptr; - -static createProfileSectionFunction createSectionCallee = nullptr; -static startProfileSectionFunction startSectionCallee = nullptr; -static stopProfileSectionFunction stopSectionCallee = nullptr; -static destroyProfileSectionFunction destroySectionCallee = nullptr; - -static profileEventFunction profileEventCallee = nullptr; - -SpaceHandle::SpaceHandle(const char* space_name) { - strncpy(name, space_name, 64); -} - -bool profileLibraryLoaded() { return (nullptr != initProfileLibrary); } - -void beginParallelFor(const std::string& kernelPrefix, const uint32_t devID, - uint64_t* kernelID) { - if (nullptr != beginForCallee) { - Kokkos::fence(); - (*beginForCallee)(kernelPrefix.c_str(), devID, kernelID); - } -} - -void endParallelFor(const uint64_t kernelID) { - if (nullptr != endForCallee) { - Kokkos::fence(); - (*endForCallee)(kernelID); - } -} - -void beginParallelScan(const std::string& kernelPrefix, const uint32_t devID, - uint64_t* kernelID) { - if (nullptr != beginScanCallee) { - Kokkos::fence(); - (*beginScanCallee)(kernelPrefix.c_str(), devID, kernelID); - } -} - -void endParallelScan(const uint64_t kernelID) { - if (nullptr != endScanCallee) { - Kokkos::fence(); - (*endScanCallee)(kernelID); - } -} - -void beginParallelReduce(const std::string& kernelPrefix, const uint32_t devID, - uint64_t* kernelID) { - if (nullptr != beginReduceCallee) { - Kokkos::fence(); - (*beginReduceCallee)(kernelPrefix.c_str(), devID, kernelID); - } -} - -void endParallelReduce(const uint64_t kernelID) { - if (nullptr != endReduceCallee) { - Kokkos::fence(); - (*endReduceCallee)(kernelID); - } -} - -void pushRegion(const std::string& kName) { - if (nullptr != pushRegionCallee) { - Kokkos::fence(); - (*pushRegionCallee)(kName.c_str()); - } -} - -void popRegion() { - if (nullptr != popRegionCallee) { - Kokkos::fence(); - (*popRegionCallee)(); - } -} - -void allocateData(const SpaceHandle space, const std::string label, - const void* ptr, const uint64_t size) { - if (nullptr != allocateDataCallee) { - (*allocateDataCallee)(space, label.c_str(), ptr, size); - } -} - -void deallocateData(const SpaceHandle space, const std::string label, - const void* ptr, const uint64_t size) { - if (nullptr != deallocateDataCallee) { - (*deallocateDataCallee)(space, label.c_str(), ptr, size); - } -} - -void beginDeepCopy(const SpaceHandle dst_space, const std::string dst_label, - const void* dst_ptr, const SpaceHandle src_space, - const std::string src_label, const void* src_ptr, - const uint64_t size) { - if (nullptr != beginDeepCopyCallee) { - (*beginDeepCopyCallee)(dst_space, dst_label.c_str(), dst_ptr, src_space, - src_label.c_str(), src_ptr, size); - } -} - -void endDeepCopy() { - if (nullptr != endDeepCopyCallee) { - (*endDeepCopyCallee)(); - } -} - -void createProfileSection(const std::string& sectionName, uint32_t* secID) { - if (nullptr != createSectionCallee) { - (*createSectionCallee)(sectionName.c_str(), secID); - } -} - -void startSection(const uint32_t secID) { - if (nullptr != startSectionCallee) { - (*startSectionCallee)(secID); - } -} - -void stopSection(const uint32_t secID) { - if (nullptr != stopSectionCallee) { - (*stopSectionCallee)(secID); - } -} - -void destroyProfileSection(const uint32_t secID) { - if (nullptr != destroySectionCallee) { - (*destroySectionCallee)(secID); - } -} - -void markEvent(const std::string& eventName) { - if (nullptr != profileEventCallee) { - (*profileEventCallee)(eventName.c_str()); - } -} - -void initialize() { - // Make sure initialize calls happens only once - static int is_initialized = 0; - if (is_initialized) return; - is_initialized = 1; - - void* firstProfileLibrary; - - char* envProfileLibrary = getenv("KOKKOS_PROFILE_LIBRARY"); - - // If we do not find a profiling library in the environment then exit - // early. - if (nullptr == envProfileLibrary) { - return; - } - - char* envProfileCopy = - (char*)malloc(sizeof(char) * (strlen(envProfileLibrary) + 1)); - sprintf(envProfileCopy, "%s", envProfileLibrary); - - char* profileLibraryName = strtok(envProfileCopy, ";"); - - if ((nullptr != profileLibraryName) && - (strcmp(profileLibraryName, "") != 0)) { - firstProfileLibrary = dlopen(profileLibraryName, RTLD_NOW | RTLD_GLOBAL); - - if (nullptr == firstProfileLibrary) { - std::cerr << "Error: Unable to load KokkosP library: " - << profileLibraryName << std::endl; - std::cerr << "dlopen(" << profileLibraryName - << ", RTLD_NOW | RTLD_GLOBAL) failed with " << dlerror() - << '\n'; - } else { -#ifdef KOKKOS_ENABLE_PROFILING_LOAD_PRINT - std::cout << "KokkosP: Library Loaded: " << profileLibraryName - << std::endl; -#endif - - // dlsym returns a pointer to an object, while we want to assign to - // pointer to function A direct cast will give warnings hence, we have to - // workaround the issue by casting pointer to pointers. - auto p1 = dlsym(firstProfileLibrary, "kokkosp_begin_parallel_for"); - beginForCallee = *((beginFunction*)&p1); - auto p2 = dlsym(firstProfileLibrary, "kokkosp_begin_parallel_scan"); - beginScanCallee = *((beginFunction*)&p2); - auto p3 = dlsym(firstProfileLibrary, "kokkosp_begin_parallel_reduce"); - beginReduceCallee = *((beginFunction*)&p3); - - auto p4 = dlsym(firstProfileLibrary, "kokkosp_end_parallel_scan"); - endScanCallee = *((endFunction*)&p4); - auto p5 = dlsym(firstProfileLibrary, "kokkosp_end_parallel_for"); - endForCallee = *((endFunction*)&p5); - auto p6 = dlsym(firstProfileLibrary, "kokkosp_end_parallel_reduce"); - endReduceCallee = *((endFunction*)&p6); - - auto p7 = dlsym(firstProfileLibrary, "kokkosp_init_library"); - initProfileLibrary = *((initFunction*)&p7); - auto p8 = dlsym(firstProfileLibrary, "kokkosp_finalize_library"); - finalizeProfileLibrary = *((finalizeFunction*)&p8); - - auto p9 = dlsym(firstProfileLibrary, "kokkosp_push_profile_region"); - pushRegionCallee = *((pushFunction*)&p9); - auto p10 = dlsym(firstProfileLibrary, "kokkosp_pop_profile_region"); - popRegionCallee = *((popFunction*)&p10); - - auto p11 = dlsym(firstProfileLibrary, "kokkosp_allocate_data"); - allocateDataCallee = *((allocateDataFunction*)&p11); - auto p12 = dlsym(firstProfileLibrary, "kokkosp_deallocate_data"); - deallocateDataCallee = *((deallocateDataFunction*)&p12); - - auto p13 = dlsym(firstProfileLibrary, "kokkosp_begin_deep_copy"); - beginDeepCopyCallee = *((beginDeepCopyFunction*)&p13); - auto p14 = dlsym(firstProfileLibrary, "kokkosp_end_deep_copy"); - endDeepCopyCallee = *((endDeepCopyFunction*)&p14); - - auto p15 = dlsym(firstProfileLibrary, "kokkosp_create_profile_section"); - createSectionCallee = *((createProfileSectionFunction*)&p15); - auto p16 = dlsym(firstProfileLibrary, "kokkosp_start_profile_section"); - startSectionCallee = *((startProfileSectionFunction*)&p16); - auto p17 = dlsym(firstProfileLibrary, "kokkosp_stop_profile_section"); - stopSectionCallee = *((stopProfileSectionFunction*)&p17); - auto p18 = dlsym(firstProfileLibrary, "kokkosp_destroy_profile_section"); - destroySectionCallee = *((destroyProfileSectionFunction*)&p18); - - auto p19 = dlsym(firstProfileLibrary, "kokkosp_profile_event"); - profileEventCallee = *((profileEventFunction*)&p19); - } - } - - if (nullptr != initProfileLibrary) { - (*initProfileLibrary)(0, (uint64_t)KOKKOSP_INTERFACE_VERSION, (uint32_t)0, - nullptr); - } - - free(envProfileCopy); -} - -void finalize() { - // Make sure finalize calls happens only once - static int is_finalized = 0; - if (is_finalized) return; - is_finalized = 1; - - if (nullptr != finalizeProfileLibrary) { - (*finalizeProfileLibrary)(); - - // Set all profile hooks to nullptr to prevent - // any additional calls. Once we are told to - // finalize, we mean it - initProfileLibrary = nullptr; - finalizeProfileLibrary = nullptr; - - beginForCallee = nullptr; - beginScanCallee = nullptr; - beginReduceCallee = nullptr; - endScanCallee = nullptr; - endForCallee = nullptr; - endReduceCallee = nullptr; - - pushRegionCallee = nullptr; - popRegionCallee = nullptr; - - allocateDataCallee = nullptr; - deallocateDataCallee = nullptr; - - beginDeepCopyCallee = nullptr; - endDeepCopyCallee = nullptr; - - createSectionCallee = nullptr; - startSectionCallee = nullptr; - stopSectionCallee = nullptr; - destroySectionCallee = nullptr; - - profileEventCallee = nullptr; - } -} -} // namespace Profiling -} // namespace Kokkos - -#else - -#include -#include - -namespace Kokkos { -namespace Profiling { - -bool profileLibraryLoaded() { return false; } - -void beginParallelFor(const std::string&, const uint32_t, uint64_t*) {} -void endParallelFor(const uint64_t) {} -void beginParallelScan(const std::string&, const uint32_t, uint64_t*) {} -void endParallelScan(const uint64_t) {} -void beginParallelReduce(const std::string&, const uint32_t, uint64_t*) {} -void endParallelReduce(const uint64_t) {} - -void pushRegion(const std::string&) {} -void popRegion() {} -void createProfileSection(const std::string&, uint32_t*) {} -void startSection(const uint32_t) {} -void stopSection(const uint32_t) {} -void destroyProfileSection(const uint32_t) {} - -void markEvent(const std::string&) {} - -void allocateData(const SpaceHandle, const std::string, const void*, - const uint64_t) {} -void deallocateData(const SpaceHandle, const std::string, const void*, - const uint64_t) {} - -void beginDeepCopy(const SpaceHandle, const std::string, const void*, - const SpaceHandle, const std::string, const void*, - const uint64_t) {} -void endDeepCopy() {} - -void initialize() {} -void finalize() {} - -} // namespace Profiling -} // namespace Kokkos - -#endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp index df17501ff4..5e0ba8f3d6 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Profiling_Interface.hpp @@ -45,20 +45,16 @@ #ifndef KOKKOSP_INTERFACE_HPP #define KOKKOSP_INTERFACE_HPP -#include #include #include -#include -#include -#include #include // NOTE: in this Kokkos::Profiling block, do not define anything that shouldn't // exist should Profiling be disabled namespace Kokkos { -namespace Profiling { +namespace Tools { namespace Experimental { enum struct DeviceType { Serial, @@ -80,132 +76,121 @@ inline uint32_t device_id(ExecutionSpace const& space) noexcept { return (device_id << instance_bits) + space.impl_instance_id(); } } // namespace Experimental -} // namespace Profiling +} // namespace Tools } // end namespace Kokkos -#if defined(KOKKOS_ENABLE_PROFILING) +#if defined(KOKKOS_ENABLE_LIBDL) // We check at configure time that libdl is available. #include +#endif #include - -#define KOKKOSP_INTERFACE_VERSION 20171029 +#include namespace Kokkos { +namespace Tools { + +using SpaceHandle = Kokkos_Profiling_SpaceHandle; + +} // namespace Tools + +namespace Tools { + +namespace Experimental { +using EventSet = Kokkos_Profiling_EventSet; +static_assert(sizeof(EventSet) / sizeof(function_pointer) == 275, + "sizeof EventSet has changed, this is an error on the part of a " + "Kokkos developer"); +} // namespace Experimental +using initFunction = Kokkos_Profiling_initFunction; +using finalizeFunction = Kokkos_Profiling_finalizeFunction; +using beginFunction = Kokkos_Profiling_beginFunction; +using endFunction = Kokkos_Profiling_endFunction; +using pushFunction = Kokkos_Profiling_pushFunction; +using popFunction = Kokkos_Profiling_popFunction; +using allocateDataFunction = Kokkos_Profiling_allocateDataFunction; +using deallocateDataFunction = Kokkos_Profiling_deallocateDataFunction; +using createProfileSectionFunction = + Kokkos_Profiling_createProfileSectionFunction; +using startProfileSectionFunction = + Kokkos_Profiling_startProfileSectionFunction; +using stopProfileSectionFunction = Kokkos_Profiling_stopProfileSectionFunction; +using destroyProfileSectionFunction = + Kokkos_Profiling_destroyProfileSectionFunction; +using profileEventFunction = Kokkos_Profiling_profileEventFunction; +using beginDeepCopyFunction = Kokkos_Profiling_beginDeepCopyFunction; +using endDeepCopyFunction = Kokkos_Profiling_endDeepCopyFunction; + +} // namespace Tools + +} // namespace Kokkos + +// Profiling + +namespace Kokkos { + namespace Profiling { -struct SpaceHandle { - SpaceHandle(const char* space_name); - char name[64]; -}; +/** The Profiling namespace is being renamed to Tools. + * This is reexposing the contents of what used to be the Profiling + * Interface with their original names, to avoid breaking old code + */ -typedef void (*initFunction)(const int, const uint64_t, const uint32_t, - KokkosPDeviceInfo*); -typedef void (*finalizeFunction)(); -typedef void (*beginFunction)(const char*, const uint32_t, uint64_t*); -typedef void (*endFunction)(uint64_t); +namespace Experimental { -typedef void (*pushFunction)(const char*); -typedef void (*popFunction)(); +using Kokkos::Tools::Experimental::device_id; +using Kokkos::Tools::Experimental::DeviceType; +using Kokkos::Tools::Experimental::DeviceTypeTraits; -typedef void (*allocateDataFunction)(const SpaceHandle, const char*, - const void*, const uint64_t); -typedef void (*deallocateDataFunction)(const SpaceHandle, const char*, - const void*, const uint64_t); +} // namespace Experimental -typedef void (*createProfileSectionFunction)(const char*, uint32_t*); -typedef void (*startProfileSectionFunction)(const uint32_t); -typedef void (*stopProfileSectionFunction)(const uint32_t); -typedef void (*destroyProfileSectionFunction)(const uint32_t); - -typedef void (*profileEventFunction)(const char*); - -typedef void (*beginDeepCopyFunction)(SpaceHandle, const char*, const void*, - SpaceHandle, const char*, const void*, - uint64_t); -typedef void (*endDeepCopyFunction)(); - -bool profileLibraryLoaded(); - -void beginParallelFor(const std::string& kernelPrefix, const uint32_t devID, - uint64_t* kernelID); -void endParallelFor(const uint64_t kernelID); -void beginParallelScan(const std::string& kernelPrefix, const uint32_t devID, - uint64_t* kernelID); -void endParallelScan(const uint64_t kernelID); -void beginParallelReduce(const std::string& kernelPrefix, const uint32_t devID, - uint64_t* kernelID); -void endParallelReduce(const uint64_t kernelID); - -void pushRegion(const std::string& kName); -void popRegion(); - -void createProfileSection(const std::string& sectionName, uint32_t* secID); -void startSection(const uint32_t secID); -void stopSection(const uint32_t secID); -void destroyProfileSection(const uint32_t secID); - -void markEvent(const std::string* evName); - -void allocateData(const SpaceHandle space, const std::string label, - const void* ptr, const uint64_t size); -void deallocateData(const SpaceHandle space, const std::string label, - const void* ptr, const uint64_t size); - -void beginDeepCopy(const SpaceHandle dst_space, const std::string dst_label, - const void* dst_ptr, const SpaceHandle src_space, - const std::string src_label, const void* src_ptr, - const uint64_t size); -void endDeepCopy(); - -void initialize(); -void finalize(); +using Kokkos::Tools::allocateDataFunction; +using Kokkos::Tools::beginDeepCopyFunction; +using Kokkos::Tools::beginFunction; +using Kokkos::Tools::createProfileSectionFunction; +using Kokkos::Tools::deallocateDataFunction; +using Kokkos::Tools::destroyProfileSectionFunction; +using Kokkos::Tools::endDeepCopyFunction; +using Kokkos::Tools::endFunction; +using Kokkos::Tools::finalizeFunction; +using Kokkos::Tools::initFunction; +using Kokkos::Tools::popFunction; +using Kokkos::Tools::profileEventFunction; +using Kokkos::Tools::pushFunction; +using Kokkos::Tools::SpaceHandle; +using Kokkos::Tools::startProfileSectionFunction; +using Kokkos::Tools::stopProfileSectionFunction; } // namespace Profiling } // namespace Kokkos -#else +// Tuning + namespace Kokkos { -namespace Profiling { +namespace Tools { +namespace Experimental { +using ValueSet = Kokkos_Tools_ValueSet; +using ValueRange = Kokkos_Tools_ValueRange; +using StatisticalCategory = Kokkos_Tools_VariableInfo_StatisticalCategory; +using ValueType = Kokkos_Tools_VariableInfo_ValueType; +using CandidateValueType = Kokkos_Tools_VariableInfo_CandidateValueType; +using SetOrRange = Kokkos_Tools_VariableInfo_SetOrRange; +using VariableInfo = Kokkos_Tools_VariableInfo; +using OptimizationGoal = Kokkos_Tools_OptimzationGoal; +using TuningString = Kokkos_Tools_Tuning_String; +using VariableValue = Kokkos_Tools_VariableValue; -struct SpaceHandle { - SpaceHandle(const char* space_name); - char name[64]; -}; +using outputTypeDeclarationFunction = + Kokkos_Tools_outputTypeDeclarationFunction; +using inputTypeDeclarationFunction = Kokkos_Tools_inputTypeDeclarationFunction; +using requestValueFunction = Kokkos_Tools_requestValueFunction; +using contextBeginFunction = Kokkos_Tools_contextBeginFunction; +using contextEndFunction = Kokkos_Tools_contextEndFunction; +using optimizationGoalDeclarationFunction = + Kokkos_Tools_optimizationGoalDeclarationFunction; +} // end namespace Experimental +} // end namespace Tools -bool profileLibraryLoaded(); - -void beginParallelFor(const std::string&, const uint32_t, uint64_t*); -void endParallelFor(const uint64_t); -void beginParallelScan(const std::string&, const uint32_t, uint64_t*); -void endParallelScan(const uint64_t); -void beginParallelReduce(const std::string&, const uint32_t, uint64_t*); -void endParallelReduce(const uint64_t); - -void pushRegion(const std::string&); -void popRegion(); -void createProfileSection(const std::string&, uint32_t*); -void startSection(const uint32_t); -void stopSection(const uint32_t); -void destroyProfileSection(const uint32_t); - -void markEvent(const std::string&); - -void allocateData(const SpaceHandle, const std::string, const void*, - const uint64_t); -void deallocateData(const SpaceHandle, const std::string, const void*, - const uint64_t); - -void beginDeepCopy(const SpaceHandle, const std::string, const void*, - const SpaceHandle, const std::string, const void*, - const uint64_t); -void endDeepCopy(); - -void initialize(); -void finalize(); - -} // namespace Profiling -} // namespace Kokkos +} // end namespace Kokkos #endif -#endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial.cpp b/lib/kokkos/core/src/impl/Kokkos_Serial.cpp index b39f9dfeea..76ffd0db35 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial.cpp @@ -94,7 +94,8 @@ void serial_resize_thread_team_data(size_t pool_reduce_bytes, g_serial_thread_team_data.disband_team(); g_serial_thread_team_data.disband_pool(); - space.deallocate(g_serial_thread_team_data.scratch_buffer(), + space.deallocate("Kokkos::Serial::scratch_mem", + g_serial_thread_team_data.scratch_buffer(), g_serial_thread_team_data.scratch_bytes()); } @@ -117,7 +118,7 @@ void serial_resize_thread_team_data(size_t pool_reduce_bytes, void* ptr = nullptr; try { - ptr = space.allocate(alloc_bytes); + ptr = space.allocate("Kokkos::Serial::scratch_mem", alloc_bytes); } catch (Kokkos::Experimental::RawMemoryAllocationFailure const& failure) { // For now, just rethrow the error message the existing way Kokkos::Impl::throw_runtime_exception(failure.get_error_message()); @@ -145,44 +146,18 @@ HostThreadTeamData* serial_get_thread_team_data() { namespace Kokkos { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -bool Serial::is_initialized() -#else -bool Serial::impl_is_initialized() -#endif -{ - return Impl::g_serial_is_initialized; -} +bool Serial::impl_is_initialized() { return Impl::g_serial_is_initialized; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void Serial::initialize(unsigned threads_count, unsigned use_numa_count, - unsigned use_cores_per_numa, - bool allow_asynchronous_threadpool) { - (void)threads_count; - (void)use_numa_count; - (void)use_cores_per_numa; - (void)allow_asynchronous_threadpool; -#else void Serial::impl_initialize() { -#endif - Impl::SharedAllocationRecord::tracking_enable(); // Init the array of locks used for arbitrarily sized atomics Impl::init_lock_array_host_space(); -#if defined(KOKKOS_ENABLE_DEPRECATED_CODE) && defined(KOKKOS_ENABLE_PROFILING) - Kokkos::Profiling::initialize(); -#endif Impl::g_serial_is_initialized = true; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE -void Serial::finalize() -#else -void Serial::impl_finalize() -#endif -{ +void Serial::impl_finalize() { if (Impl::g_serial_thread_team_data.scratch_buffer()) { Impl::g_serial_thread_team_data.disband_team(); Impl::g_serial_thread_team_data.disband_pool(); @@ -195,9 +170,7 @@ void Serial::impl_finalize() Impl::g_serial_thread_team_data.scratch_assign(nullptr, 0, 0, 0, 0, 0); } -#if defined(KOKKOS_ENABLE_PROFILING) Kokkos::Profiling::finalize(); -#endif Impl::g_serial_is_initialized = false; } diff --git a/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp b/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp index 4e26e0b138..0f6ad5cb03 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Serial_WorkGraphPolicy.hpp @@ -52,7 +52,7 @@ template class ParallelFor, Kokkos::Serial> { private: - typedef Kokkos::WorkGraphPolicy Policy; + using Policy = Kokkos::WorkGraphPolicy; Policy m_policy; FunctorType m_functor; diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp index 6a054f73a1..a9a2778813 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.cpp @@ -240,13 +240,7 @@ SharedAllocationRecord* SharedAllocationRecord< ss << arg_record->get_label(); ss << "\" is being deallocated after Kokkos::finalize was called\n"; auto s = ss.str(); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - std::cerr << s; - std::cerr << "This behavior is incorrect Kokkos usage, and will crash in " - "future releases\n"; -#else Kokkos::Impl::throw_runtime_exception(s); -#endif } #ifdef KOKKOS_DEBUG diff --git a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp index 6e954e8f27..dcff5be835 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_SharedAlloc.hpp @@ -48,6 +48,18 @@ #include #include +// undefined at end of file +#if defined(KOKKOS_ENABLE_OPENMPTARGET) +#if defined(KOKKOS_COMPILER_PGI) +#define KOKKOS_IMPL_IF_ON_HOST if (!__builtin_is_device_code()) +#else +// Note: OpenMPTarget enforces C++17 at configure time +#define KOKKOS_IMPL_IF_ON_HOST if constexpr (omp_is_initial_device()) +#endif +#else +#define KOKKOS_IMPL_IF_ON_HOST if (true) +#endif + namespace Kokkos { namespace Impl { @@ -56,7 +68,7 @@ class SharedAllocationRecord; class SharedAllocationHeader { private: - typedef SharedAllocationRecord Record; + using Record = SharedAllocationRecord; static constexpr unsigned maximum_label_length = (1u << 7 /* 128 */) - sizeof(Record*); @@ -120,17 +132,33 @@ class SharedAllocationRecord { public: virtual std::string get_label() const { return std::string("Unmanaged"); } - static int tracking_enabled() { return t_tracking_enabled; } +#ifdef KOKKOS_IMPL_ENABLE_OVERLOAD_HOST_DEVICE + /* Device tracking_enabled -- always disabled */ + KOKKOS_IMPL_DEVICE_FUNCTION + static int tracking_enabled() { return 0; } +#endif + + KOKKOS_IMPL_HOST_FUNCTION + static int tracking_enabled() { + KOKKOS_IMPL_IF_ON_HOST { return t_tracking_enabled; } + else { + return 0; + } + } /**\brief A host process thread claims and disables the * shared allocation tracking flag. */ - static void tracking_disable() { t_tracking_enabled = 0; } + static void tracking_disable() { + KOKKOS_IMPL_IF_ON_HOST { t_tracking_enabled = 0; } + } /**\brief A host process thread releases and enables the * shared allocation tracking flag. */ - static void tracking_enable() { t_tracking_enabled = 1; } + static void tracking_enable() { + KOKKOS_IMPL_IF_ON_HOST { t_tracking_enabled = 1; } + } virtual ~SharedAllocationRecord() = default; @@ -164,11 +192,25 @@ class SharedAllocationRecord { /* Cannot be 'constexpr' because 'm_count' is volatile */ int use_count() const { return *static_cast(&m_count); } +#ifdef KOKKOS_IMPL_ENABLE_OVERLOAD_HOST_DEVICE + /* Device tracking_enabled -- always disabled */ + KOKKOS_IMPL_DEVICE_FUNCTION + static void increment(SharedAllocationRecord*){}; +#endif + /* Increment use count */ + KOKKOS_IMPL_HOST_FUNCTION static void increment(SharedAllocationRecord*); +#ifdef KOKKOS_IMPL_ENABLE_OVERLOAD_HOST_DEVICE + /* Device tracking_enabled -- always disabled */ + KOKKOS_IMPL_DEVICE_FUNCTION + static void decrement(SharedAllocationRecord*){}; +#endif + /* Decrement use count. If 1->0 then remove from the tracking list and invoke * m_dealloc */ + KOKKOS_IMPL_HOST_FUNCTION static SharedAllocationRecord* decrement(SharedAllocationRecord*); /* Given a root record and data pointer find the record */ @@ -192,8 +234,8 @@ namespace { /* Taking the address of this function so make sure it is unique */ template void deallocate(SharedAllocationRecord* record_ptr) { - typedef SharedAllocationRecord base_type; - typedef SharedAllocationRecord this_type; + using base_type = SharedAllocationRecord; + using this_type = SharedAllocationRecord; this_type* const ptr = static_cast(static_cast(record_ptr)); @@ -259,7 +301,7 @@ class SharedAllocationRecord union SharedAllocationTracker { private: - typedef SharedAllocationRecord Record; + using Record = SharedAllocationRecord; enum : uintptr_t { DO_NOT_DEREF_FLAG = 0x01ul }; @@ -272,15 +314,36 @@ union SharedAllocationTracker { // pressure on compiler optimization by reducing // number of symbols and inline functions. -#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) +#if defined(KOKKOS_IMPL_ENABLE_OVERLOAD_HOST_DEVICE) + +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED Record::tracking_enabled() + +#ifdef KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_CONDITION \ + (!(m_record_bits & DO_NOT_DEREF_FLAG)) +#else +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_CONDITION (0) +#endif + +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT \ + if (KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_CONDITION) \ + KOKKOS_IMPL_IF_ON_HOST Record::increment(m_record); + +#define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT \ + if (KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_CONDITION) \ + KOKKOS_IMPL_IF_ON_HOST Record::decrement(m_record); + +#elif defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) #define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_ENABLED Record::tracking_enabled() #define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT \ - if (!(m_record_bits & DO_NOT_DEREF_FLAG)) Record::increment(m_record); + if (!(m_record_bits & DO_NOT_DEREF_FLAG)) \ + KOKKOS_IMPL_IF_ON_HOST Record::increment(m_record); #define KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT \ - if (!(m_record_bits & DO_NOT_DEREF_FLAG)) Record::decrement(m_record); + if (!(m_record_bits & DO_NOT_DEREF_FLAG)) \ + KOKKOS_IMPL_IF_ON_HOST Record::decrement(m_record); #else @@ -312,7 +375,7 @@ union SharedAllocationTracker { constexpr SharedAllocationRecord* get_record() const noexcept { return (m_record_bits & DO_NOT_DEREF_FLAG) - ? (SharedAllocationRecord*)0 + ? nullptr : static_cast*>( m_record); } @@ -397,6 +460,38 @@ union SharedAllocationTracker { return *this; } + /* The following functions (assign_direct and assign_force_disable) + * are the result of deconstructing the + * KOKKOS_IMPL_SHARED_ALLOCATION_CARRY_RECORD_BITS macro. This + * allows the caller to do the check for tracking enabled and managed + * apart from the assignement of the record because the tracking + * enabled / managed question may be important for other tasks as well + */ + + /** \brief Copy assignment without the carry bits logic + * This assumes that externally defined tracking is explicitly enabled + */ + KOKKOS_FORCEINLINE_FUNCTION + void assign_direct(const SharedAllocationTracker& rhs) { + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT + m_record_bits = rhs.m_record_bits; + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_INCREMENT + } + + /** \brief Copy assignment without the increment + * we cannot assume that current record is unmanaged + * but with externally defined tracking explicitly disabled + * we can go straight to the do not deref flag */ + KOKKOS_FORCEINLINE_FUNCTION + void assign_force_disable(const SharedAllocationTracker& rhs) { + KOKKOS_IMPL_SHARED_ALLOCATION_TRACKER_DECREMENT + m_record_bits = rhs.m_record_bits | DO_NOT_DEREF_FLAG; + } + + // report if record is tracking or not + KOKKOS_FORCEINLINE_FUNCTION + bool tracking_enabled() { return (!(m_record_bits & DO_NOT_DEREF_FLAG)); } + /** \brief Copy assignment may disable tracking */ KOKKOS_FORCEINLINE_FUNCTION void assign(const SharedAllocationTracker& rhs, const bool enable_tracking) { @@ -413,5 +508,5 @@ union SharedAllocationTracker { } /* namespace Impl */ } /* namespace Kokkos */ - +#undef KOKKOS_IMPL_IF_ON_HOST #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_SimpleTaskScheduler.hpp b/lib/kokkos/core/src/impl/Kokkos_SimpleTaskScheduler.hpp index a01b22e4e9..b8d1f1df0d 100644 --- a/lib/kokkos/core/src/impl/Kokkos_SimpleTaskScheduler.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_SimpleTaskScheduler.hpp @@ -366,20 +366,6 @@ class SimpleTaskScheduler //---------------------------------------------------------------------------- -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - // For backwards compatibility purposes only - KOKKOS_DEPRECATED - KOKKOS_INLINE_FUNCTION - memory_pool* memory() const noexcept KOKKOS_DEPRECATED_TRAILING_ATTRIBUTE { - if (m_queue != nullptr) - return &(m_queue->get_memory_pool()); - else - return nullptr; - } -#endif - - //---------------------------------------------------------------------------- - template KOKKOS_FUNCTION static Kokkos::BasicFuture diff --git a/lib/kokkos/core/src/impl/Kokkos_Tags.hpp b/lib/kokkos/core/src/impl/Kokkos_Tags.hpp index 1b33180ed2..eea4c93866 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Tags.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Tags.hpp @@ -54,8 +54,8 @@ /** KOKKOS_IMPL_HAS_TYPE( Type ) * - * defines a meta-function that check if a type expose an internal typedef or - * type alias which matches Type + * defines a meta-function that check if a type expose an internal alias which + * matches Type * * e.g. * KOKKOS_IMPL_HAS_TYPE( array_layout ); @@ -73,7 +73,7 @@ : std::true_type {}; \ \ public: \ - typedef typename X::type type; \ + using type = typename X::type; \ enum : bool { value = type::value }; \ }; diff --git a/lib/kokkos/core/src/impl/Kokkos_TaskBase.hpp b/lib/kokkos/core/src/impl/Kokkos_TaskBase.hpp index 8078c68dbd..2d0f62a563 100644 --- a/lib/kokkos/core/src/impl/Kokkos_TaskBase.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_TaskBase.hpp @@ -148,7 +148,7 @@ class TaskBase { using queue_type = TaskQueueBase; using function_type = void (*)(TaskBase*, void*); - typedef void (*destroy_type)(TaskBase*); + using destroy_type = void (*)(TaskBase*); // sizeof(TaskBase) == 48 diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ViewCopyETIDecl.hpp b/lib/kokkos/core/src/impl/Kokkos_Tools.hpp similarity index 86% rename from lib/kokkos/core/src/ROCm/Kokkos_ROCm_ViewCopyETIDecl.hpp rename to lib/kokkos/core/src/impl/Kokkos_Tools.hpp index db02a49c8a..8d6ec64685 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ViewCopyETIDecl.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Tools.hpp @@ -42,16 +42,13 @@ //@HEADER */ -#ifndef KOKKOS_ROCM_VIEWETIDECL_HPP -#define KOKKOS_ROCM_VIEWETIDECL_HPP +/** + * Header file to include all of Kokkos Tooling support + */ -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::ROCm +#ifndef KOKKOS_IMPL_KOKKOS_TOOLS_HPP +#define KOKKOS_IMPL_KOKKOS_TOOLS_HPP -#include +#include -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos #endif diff --git a/lib/kokkos/core/src/impl/Kokkos_Traits.hpp b/lib/kokkos/core/src/impl/Kokkos_Traits.hpp index 32e78b7f5f..770c7b002e 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Traits.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Traits.hpp @@ -60,17 +60,17 @@ namespace Impl { template struct get_type { - typedef void type; + using type = void; }; template struct get_type<0, T, Pack...> { - typedef T type; + using type = T; }; template struct get_type { - typedef typename get_type::type type; + using type = typename get_type::type; }; template @@ -83,7 +83,7 @@ struct has_type { private: enum { self_value = std::is_same::value }; - typedef has_type next; + using next = has_type; static_assert( !(self_value && next::value), @@ -97,7 +97,7 @@ template class Condition, typename... Pack> struct has_condition { enum { value = false }; - typedef DefaultType type; + using type = DefaultType; }; template class Condition, typename S, @@ -106,7 +106,7 @@ struct has_condition { private: enum { self_value = Condition::value }; - typedef has_condition next; + using next = has_condition; static_assert( !(self_value && next::value), @@ -115,8 +115,8 @@ struct has_condition { public: enum { value = self_value || next::value }; - typedef - typename std::conditional::type type; + using type = + typename std::conditional::type; }; template @@ -151,7 +151,7 @@ namespace Impl { template struct enable_if_type { - typedef T type; + using type = T; }; //---------------------------------------------------------------------------- @@ -161,12 +161,12 @@ template struct if_c { enum { value = Cond }; - typedef FalseType type; + using type = FalseType; - typedef typename std::remove_const< - typename std::remove_reference::type>::type value_type; + using value_type = typename std::remove_const< + typename std::remove_reference::type>::type; - typedef typename std::add_const::type const_value_type; + using const_value_type = typename std::add_const::type; static KOKKOS_INLINE_FUNCTION const_value_type& select(const_value_type& v) { return v; @@ -196,12 +196,12 @@ template struct if_c { enum { value = true }; - typedef TrueType type; + using type = TrueType; - typedef typename std::remove_const< - typename std::remove_reference::type>::type value_type; + using value_type = typename std::remove_const< + typename std::remove_reference::type>::type; - typedef typename std::add_const::type const_value_type; + using const_value_type = typename std::add_const::type; static KOKKOS_INLINE_FUNCTION const_value_type& select(const_value_type& v) { return v; @@ -231,16 +231,16 @@ template struct if_c { enum { value = false }; - typedef void type; - typedef void value_type; + using type = void; + using value_type = void; }; template struct if_c { enum { value = true }; - typedef void type; - typedef void value_type; + using type = void; + using value_type = void; }; template @@ -337,16 +337,16 @@ struct integral_nonzero_constant { // Declaration of 'static const' causes an unresolved linker symbol in debug // static const T value = v ; enum { value = T(v) }; - typedef T value_type; - typedef integral_nonzero_constant type; + using value_type = T; + using type = integral_nonzero_constant; KOKKOS_INLINE_FUNCTION integral_nonzero_constant(const T&) {} }; template struct integral_nonzero_constant { const T value; - typedef T value_type; - typedef integral_nonzero_constant type; + using value_type = T; + using type = integral_nonzero_constant; KOKKOS_INLINE_FUNCTION integral_nonzero_constant(const T& v) : value(v) {} }; diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp index 119ad4eccf..de1c0750f0 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewArray.hpp @@ -51,21 +51,21 @@ namespace Kokkos { namespace Impl { template -struct ViewDataAnalysis > { +struct ViewDataAnalysis> { private: - typedef ViewArrayAnalysis array_analysis; + using array_analysis = ViewArrayAnalysis; static_assert(std::is_same::value, ""); static_assert(std::is_same >::value, + Kokkos::Array>::value, ""); static_assert(std::is_scalar::value, "View of Array type must be of a scalar type"); public: - typedef Kokkos::Array<> specialize; + using specialize = Kokkos::Array<>; - typedef typename array_analysis::dimension dimension; + using dimension = typename array_analysis::dimension; private: enum { @@ -73,29 +73,29 @@ struct ViewDataAnalysis > { typename array_analysis::const_value_type>::value }; - typedef typename dimension::template append::type array_scalar_dimension; + using array_scalar_dimension = typename dimension::template append::type; - typedef typename std::conditional::type scalar_type; - typedef V non_const_scalar_type; - typedef const V const_scalar_type; + using scalar_type = typename std::conditional::type; + using non_const_scalar_type = V; + using const_scalar_type = const V; public: - typedef typename array_analysis::value_type value_type; - typedef typename array_analysis::const_value_type const_value_type; - typedef typename array_analysis::non_const_value_type non_const_value_type; + using value_type = typename array_analysis::value_type; + using const_value_type = typename array_analysis::const_value_type; + using non_const_value_type = typename array_analysis::non_const_value_type; - typedef typename ViewDataType::type type; - typedef typename ViewDataType::type const_type; - typedef typename ViewDataType::type - non_const_type; + using type = typename ViewDataType::type; + using const_type = typename ViewDataType::type; + using non_const_type = + typename ViewDataType::type; - typedef typename ViewDataType::type - scalar_array_type; - typedef typename ViewDataType::type - const_scalar_array_type; - typedef - typename ViewDataType::type - non_const_scalar_array_type; + using scalar_array_type = + typename ViewDataType::type; + using const_scalar_array_type = + typename ViewDataType::type; + using non_const_scalar_array_type = + typename ViewDataType::type; }; } // namespace Impl @@ -109,31 +109,28 @@ namespace Impl { /** \brief View mapping for non-specialized data type and standard layout */ template -class ViewMapping > { +class ViewMapping> { private: template friend class ViewMapping; template friend class Kokkos::View; - typedef ViewOffset - offset_type; + using offset_type = ViewOffset; - typedef typename Traits::value_type::pointer handle_type; + using handle_type = typename Traits::value_type::pointer; handle_type m_impl_handle; offset_type m_impl_offset; size_t m_stride; - typedef typename Traits::value_type::value_type scalar_type; + using scalar_type = typename Traits::value_type::value_type; - typedef Kokkos::Array::contiguous> - contiguous_reference; - typedef Kokkos::Array::strided> - strided_reference; + using contiguous_reference = Kokkos::Array::contiguous>; + using strided_reference = + Kokkos::Array::strided>; enum { is_contiguous_reference = @@ -232,11 +229,11 @@ class ViewMapping > { return m_impl_offset.span_is_contiguous(); } - typedef + using reference_type = typename std::conditional::type reference_type; + strided_reference>::type; - typedef handle_type pointer_type; + using pointer_type = handle_type; /** \brief If data references are lvalue_reference than can query pointer to * memory */ @@ -377,31 +374,33 @@ class ViewMapping > { Kokkos::Impl::SharedAllocationRecord<> *allocate_shared( Kokkos::Impl::ViewCtorProp const &arg_prop, typename Traits::array_layout const &arg_layout) { - typedef Kokkos::Impl::ViewCtorProp alloc_prop; + using alloc_prop = Kokkos::Impl::ViewCtorProp; - typedef typename alloc_prop::execution_space execution_space; - typedef typename Traits::memory_space memory_space; - typedef ViewValueFunctor functor_type; - typedef Kokkos::Impl::SharedAllocationRecord - record_type; + using execution_space = typename alloc_prop::execution_space; + using memory_space = typename Traits::memory_space; + using functor_type = ViewValueFunctor; + using record_type = + Kokkos::Impl::SharedAllocationRecord; // Query the mapping for byte-size of allocation. - typedef std::integral_constant< - unsigned, alloc_prop::allow_padding ? sizeof(scalar_type) : 0> - padding; + using padding = std::integral_constant< + unsigned int, alloc_prop::allow_padding ? sizeof(scalar_type) : 0>; m_impl_offset = offset_type(padding(), arg_layout); const size_t alloc_size = (m_impl_offset.span() * Array_N * MemorySpanSize + MemorySpanMask) & ~size_t(MemorySpanMask); - + const auto &alloc_name = + static_cast const &>( + arg_prop) + .value; // Allocate memory from the memory space and create tracking record. record_type *const record = record_type::allocate( - ((Kokkos::Impl::ViewCtorProp const &)arg_prop) + static_cast const &>( + arg_prop) .value, - ((Kokkos::Impl::ViewCtorProp const &)arg_prop).value, - alloc_size); + alloc_name, alloc_size); if (alloc_size) { m_impl_handle = @@ -410,10 +409,11 @@ class ViewMapping > { if (alloc_prop::initialize) { // The functor constructs and destroys record->m_destroy = functor_type( - ((Kokkos::Impl::ViewCtorProp const &) - arg_prop) + static_cast const + &>(arg_prop) .value, - (pointer_type)m_impl_handle, m_impl_offset.span() * Array_N); + (pointer_type)m_impl_handle, m_impl_offset.span() * Array_N, + alloc_name); record->m_destroy.construct_shared_allocation(); } @@ -438,7 +438,7 @@ class ViewMapping< Kokkos::LayoutRight>::value || std::is_same::value) && - std::is_same >::value && + std::is_same>::value && (std::is_same::value || std::is_same::value }; - typedef Kokkos::Impl::SharedAllocationTracker TrackType; - typedef ViewMapping DstType; - typedef ViewMapping > SrcType; + using TrackType = Kokkos::Impl::SharedAllocationTracker; + using DstType = ViewMapping; + using SrcType = ViewMapping>; KOKKOS_INLINE_FUNCTION static void assign(DstType &dst, const SrcType &src, const TrackType & /*src_track*/) { static_assert(is_assignable, "Can only convert to array_type"); - typedef typename DstType::offset_type dst_offset_type; + using dst_offset_type = typename DstType::offset_type; // Array dimension becomes the last dimension. // Arguments beyond the destination rank are ignored. @@ -496,9 +496,8 @@ class ViewMapping< (7 < SrcType::Rank ? src.dimension_7() : SrcTraits::value_type::size()))); } else { // is padded - typedef std::integral_constant< - unsigned, sizeof(typename SrcTraits::value_type::value_type)> - padded; + using padded = std::integral_constant< + unsigned int, sizeof(typename SrcTraits::value_type::value_type)>; dst.m_impl_offset = dst_offset_type( padded(), typename DstTraits::array_layout( @@ -530,7 +529,7 @@ class ViewMapping< template struct ViewMapping< typename std::enable_if<( - std::is_same >::value && + std::is_same>::value && (std::is_same::value || std::is_same::value) || - // OutputRank 1 or 2, InputLayout Right, Interval [InputRank-1] - // because single stride one or second index has a stride. - (rank <= 2 && R0_rev && - std::is_same::value)), - typename SrcTraits::array_layout, Kokkos::LayoutStride>::type - array_layout; + using array_layout = + typename std::conditional<((rank == 0) || + (rank <= 2 && R0 && + std::is_same::value) || + (rank <= 2 && R0_rev && + std::is_same::value)), + typename SrcTraits::array_layout, + Kokkos::LayoutStride>::type; - typedef typename SrcTraits::value_type value_type; + using value_type = typename SrcTraits::value_type; - typedef typename std::conditional< + using data_type = typename std::conditional< rank == 0, value_type, typename std::conditional< rank == 1, value_type *, @@ -616,25 +609,24 @@ struct ViewMapping< typename std::conditional< rank == 7, value_type *******, value_type ********>::type>::type>::type>:: - type>::type>::type>::type>::type data_type; + type>::type>::type>::type>::type; public: - typedef Kokkos::ViewTraits - traits_type; + using traits_type = Kokkos::ViewTraits; - typedef Kokkos::View - type; + using type = + Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign(ViewMapping &dst, ViewMapping const &src, Args... args) { - typedef ViewMapping DstType; + using DstType = ViewMapping; - typedef typename DstType::offset_type dst_offset_type; - typedef typename DstType::handle_type dst_handle_type; + using dst_offset_type = typename DstType::offset_type; + using dst_handle_type = typename DstType::handle_type; const SubviewExtents extents(src.m_impl_offset.m_dim, args...); diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp index 93a267ffa3..a817784dc0 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewCtor.hpp @@ -141,7 +141,7 @@ struct ViewCtorProp::value>::type, ViewCtorProp(const ViewCtorProp &) = default; ViewCtorProp &operator=(const ViewCtorProp &) = default; - typedef std::string type; + using type = std::string; ViewCtorProp(const type &arg) : value(arg) {} ViewCtorProp(type &&arg) : value(arg) {} @@ -173,7 +173,7 @@ struct ViewCtorProp { ViewCtorProp(const ViewCtorProp &) = default; ViewCtorProp &operator=(const ViewCtorProp &) = default; - typedef T *type; + using type = T *; KOKKOS_INLINE_FUNCTION ViewCtorProp(const type arg) : value(arg) {} @@ -194,20 +194,49 @@ struct ViewCtorProp { type value; }; +// For some reason I don't understand I needed this specialization explicitly +// for NVCC/MSVC +template +struct ViewCtorProp { + ViewCtorProp() = default; + ViewCtorProp(const ViewCtorProp &) = default; + ViewCtorProp &operator=(const ViewCtorProp &) = default; + + using type = T *; + + KOKKOS_INLINE_FUNCTION + ViewCtorProp(const type arg) : value(arg) {} + + enum { has_pointer = true }; + using pointer_type = type; + type value; +}; + +// If we use `ViewCtorProp` and `ViewCtorProp...` directly +// in the parameter lists and base class initializers, respectively, as far as +// we can tell MSVC 16.5.5+CUDA 10.2 thinks that `ViewCtorProp` refers to the +// current instantiation, not the template itself, and gets all kinds of +// confused. To work around this, we just use a couple of alias templates that +// amount to the same thing. +template +using view_ctor_prop_args = ViewCtorProp; + +template +using view_ctor_prop_base = ViewCtorProp; + template struct ViewCtorProp : public ViewCtorProp... { private: - typedef Kokkos::Impl::has_condition - var_memory_space; + using var_memory_space = + Kokkos::Impl::has_condition; - typedef Kokkos::Impl::has_condition - var_execution_space; + using var_execution_space = + Kokkos::Impl::has_condition; struct VOIDDUMMY {}; - typedef Kokkos::Impl::has_condition - var_pointer; + using var_pointer = + Kokkos::Impl::has_condition; public: /* Flags for the common properties */ @@ -220,9 +249,9 @@ struct ViewCtorProp : public ViewCtorProp... { initialize = !Kokkos::Impl::has_type::value }; - typedef typename var_memory_space::type memory_space; - typedef typename var_execution_space::type execution_space; - typedef typename var_pointer::type pointer_type; + using memory_space = typename var_memory_space::type; + using execution_space = typename var_execution_space::type; + using pointer_type = typename var_pointer::type; /* Copy from a matching argument list. * Requires std::is_same< P , ViewCtorProp< void , Args >::value ... @@ -236,10 +265,20 @@ struct ViewCtorProp : public ViewCtorProp... { ViewCtorProp::type>(args)... {} /* Copy from a matching property subset */ + KOKKOS_INLINE_FUNCTION ViewCtorProp(pointer_type arg0) + : ViewCtorProp(arg0) {} + + // If we use `ViewCtorProp` and `ViewCtorProp...` here + // directly, MSVC 16.5.5+CUDA 10.2 appears to think that `ViewCtorProp` refers + // to the current instantiation, not the template itself, and gets all kinds + // of confused. To work around this, we just use a couple of alias templates + // that amount to the same thing. template - ViewCtorProp(ViewCtorProp const &arg) - : ViewCtorProp( - static_cast const &>(arg))... { + ViewCtorProp(view_ctor_prop_args const &arg) + : view_ctor_prop_base( + static_cast const &>(arg))... { + // Suppress an unused argument warning that (at least at one point) would + // show up if sizeof...(Args) == 0 (void)arg; } }; diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewFillCopyETIAvail.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewFillCopyETIAvail.hpp deleted file mode 100644 index b415cb6d50..0000000000 --- a/lib/kokkos/core/src/impl/Kokkos_ViewFillCopyETIAvail.hpp +++ /dev/null @@ -1,126 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_EXPERIMENTAL_VIEWETIAVAIL_HPP -#define KOKKOS_EXPERIMENTAL_VIEWETIAVAIL_HPP - -namespace Kokkos { -namespace Impl { - -template -struct ViewCopyETIAvail { - enum { value = false }; -}; - -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL(DATATYPE, LAYOUTA, LAYOUTB, EXECSPACE, \ - ITYPE) \ - template <> \ - struct ViewCopyETIAvail< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutLeft, EXECSPACE, Kokkos::View::rank, ITYPE> { \ - enum { value = true }; \ - }; \ - template <> \ - struct ViewCopyETIAvail< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutRight, EXECSPACE, Kokkos::View::rank, ITYPE> { \ - enum { value = true }; \ - }; - -template -struct ViewFillETIAvail { - enum { value = false }; -}; - -#define KOKKOS_IMPL_VIEWFILL_ETI_AVAIL(DATATYPE, LAYOUT, EXECSPACE, ITYPE) \ - template <> \ - struct ViewFillETIAvail< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutLeft, EXECSPACE, Kokkos::View::rank, ITYPE> { \ - enum { value = true }; \ - }; \ - template <> \ - struct ViewFillETIAvail< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutRight, EXECSPACE, Kokkos::View::rank, ITYPE> { \ - enum { value = true }; \ - }; - -} // namespace Impl -} // namespace Kokkos -#ifdef KOKKOS_ENABLE_ETI -#ifdef KOKKOS_ENABLE_Serial -#include -#endif -#ifdef KOKKOS_ENABLE_OPENMP -#include -#endif -#ifdef KOKKOS_ENABLE_THREADS -#include -#endif -#ifdef KOKKOS_ENABLE_CUDA -#include -#endif -#ifdef KOKKOS_ENABLE_ROCM -#include -#endif -#endif - -#endif diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewFillCopyETIDecl.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewFillCopyETIDecl.hpp deleted file mode 100644 index e23dabd840..0000000000 --- a/lib/kokkos/core/src/impl/Kokkos_ViewFillCopyETIDecl.hpp +++ /dev/null @@ -1,140 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_EXPERIMENTAL_VIEWETIDECL_HPP -#define KOKKOS_EXPERIMENTAL_VIEWETIDECL_HPP - -namespace Kokkos { -namespace Impl { - -#define KOKKOS_IMPL_VIEWCOPY_ETI_DECL(DATATYPE, LAYOUTA, LAYOUTB, EXECSPACE, \ - ITYPE) \ - extern template struct ViewCopy< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutLeft, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; \ - extern template struct ViewCopy< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutRight, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; - -#define KOKKOS_IMPL_VIEWFILL_ETI_DECL(DATATYPE, LAYOUT, EXECSPACE, ITYPE) \ - extern template struct ViewFill< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutLeft, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; \ - extern template struct ViewFill< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutRight, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; - -#define KOKKOS_IMPL_VIEWCOPY_ETI_INST(DATATYPE, LAYOUTA, LAYOUTB, EXECSPACE, \ - ITYPE) \ - template struct ViewCopy< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutLeft, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; \ - template struct ViewCopy< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutRight, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; - -#define KOKKOS_IMPL_VIEWFILL_ETI_INST(DATATYPE, LAYOUT, EXECSPACE, ITYPE) \ - template struct ViewFill< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutLeft, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; \ - template struct ViewFill< \ - Kokkos::View, \ - Kokkos::MemoryTraits<0>>, \ - Kokkos::LayoutRight, EXECSPACE, Kokkos::View::rank, ITYPE, \ - true>; - -} // namespace Impl -} // namespace Kokkos -#ifdef KOKKOS_ENABLE_ETI -#ifdef KOKKOS_ENABLE_Serial -#include -#endif -#ifdef KOKKOS_ENABLE_OPENMP -#include -#endif -#ifdef KOKKOS_ENABLE_THREADS -#include -#endif -#ifdef KOKKOS_ENABLE_CUDA -#include -#endif -#ifdef KOKKOS_ENABLE_ROCM -#include -#endif -#endif -#endif diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp index 27f4375e56..b171f5feeb 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewLayoutTiled.hpp @@ -45,8 +45,6 @@ #ifndef KOKKOS_EXPERIMENTAL_VIEWLAYOUTTILE_HPP #define KOKKOS_EXPERIMENTAL_VIEWLAYOUTTILE_HPP -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE - #include #include @@ -131,14 +129,14 @@ struct ViewOffset< enum { VORank = Dimension::rank }; - enum { SHIFT_0 = Kokkos::Impl::integral_power_of_two(Layout::N0) }; - enum { SHIFT_1 = Kokkos::Impl::integral_power_of_two(Layout::N1) }; - enum { SHIFT_2 = Kokkos::Impl::integral_power_of_two(Layout::N2) }; - enum { SHIFT_3 = Kokkos::Impl::integral_power_of_two(Layout::N3) }; - enum { SHIFT_4 = Kokkos::Impl::integral_power_of_two(Layout::N4) }; - enum { SHIFT_5 = Kokkos::Impl::integral_power_of_two(Layout::N5) }; - enum { SHIFT_6 = Kokkos::Impl::integral_power_of_two(Layout::N6) }; - enum { SHIFT_7 = Kokkos::Impl::integral_power_of_two(Layout::N7) }; + enum : unsigned { SHIFT_0 = Kokkos::Impl::integral_power_of_two(Layout::N0) }; + enum : unsigned { SHIFT_1 = Kokkos::Impl::integral_power_of_two(Layout::N1) }; + enum : unsigned { SHIFT_2 = Kokkos::Impl::integral_power_of_two(Layout::N2) }; + enum : unsigned { SHIFT_3 = Kokkos::Impl::integral_power_of_two(Layout::N3) }; + enum : unsigned { SHIFT_4 = Kokkos::Impl::integral_power_of_two(Layout::N4) }; + enum : unsigned { SHIFT_5 = Kokkos::Impl::integral_power_of_two(Layout::N5) }; + enum : unsigned { SHIFT_6 = Kokkos::Impl::integral_power_of_two(Layout::N6) }; + enum : unsigned { SHIFT_7 = Kokkos::Impl::integral_power_of_two(Layout::N7) }; enum { MASK_0 = Layout::N0 - 1 }; enum { MASK_1 = Layout::N1 - 1 }; enum { MASK_2 = Layout::N2 - 1 }; @@ -148,16 +146,20 @@ struct ViewOffset< enum { MASK_6 = Layout::N6 - 1 }; enum { MASK_7 = Layout::N7 - 1 }; - enum { SHIFT_2T = SHIFT_0 + SHIFT_1 }; - enum { SHIFT_3T = SHIFT_0 + SHIFT_1 + SHIFT_2 }; - enum { SHIFT_4T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 }; - enum { SHIFT_5T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 }; - enum { SHIFT_6T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 }; - enum { + enum : unsigned { SHIFT_2T = SHIFT_0 + SHIFT_1 }; + enum : unsigned { SHIFT_3T = SHIFT_0 + SHIFT_1 + SHIFT_2 }; + enum : unsigned { SHIFT_4T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 }; + enum : unsigned { + SHIFT_5T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + }; + enum : unsigned { + SHIFT_6T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 + }; + enum : unsigned { SHIFT_7T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 + SHIFT_6 }; - enum { + enum : unsigned { SHIFT_8T = SHIFT_0 + SHIFT_1 + SHIFT_2 + SHIFT_3 + SHIFT_4 + SHIFT_5 + SHIFT_6 + SHIFT_7 }; @@ -166,9 +168,9 @@ struct ViewOffset< using is_mapping_plugin = std::true_type; using is_regular = std::false_type; - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Layout array_layout; + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Layout; dimension_type m_dim; size_type m_tile_N0; // Num tiles dim 0 @@ -600,11 +602,37 @@ struct ViewOffset< } //---------------------------------------- - +#ifdef KOKKOS_IMPL_WINDOWS_CUDA + KOKKOS_FUNCTION ViewOffset() {} + KOKKOS_FUNCTION ViewOffset(const ViewOffset& src) { + m_dim = src.m_dim; + m_tile_N0 = src.m_tile_N0; + m_tile_N1 = src.m_tile_N1; + m_tile_N2 = src.m_tile_N2; + m_tile_N3 = src.m_tile_N3; + m_tile_N4 = src.m_tile_N4; + m_tile_N5 = src.m_tile_N5; + m_tile_N6 = src.m_tile_N6; + m_tile_N7 = src.m_tile_N7; + } + KOKKOS_FUNCTION ViewOffset& operator=(const ViewOffset& src) { + m_dim = src.m_dim; + m_tile_N0 = src.m_tile_N0; + m_tile_N1 = src.m_tile_N1; + m_tile_N2 = src.m_tile_N2; + m_tile_N3 = src.m_tile_N3; + m_tile_N4 = src.m_tile_N4; + m_tile_N5 = src.m_tile_N5; + m_tile_N6 = src.m_tile_N6; + m_tile_N7 = src.m_tile_N7; + return *this; + } +#else KOKKOS_DEFAULTED_FUNCTION ~ViewOffset() = default; KOKKOS_DEFAULTED_FUNCTION ViewOffset() = default; KOKKOS_DEFAULTED_FUNCTION ViewOffset(const ViewOffset&) = default; KOKKOS_DEFAULTED_FUNCTION ViewOffset& operator=(const ViewOffset&) = default; +#endif template KOKKOS_INLINE_FUNCTION constexpr ViewOffset( @@ -653,26 +681,27 @@ struct ViewMapping< Kokkos::Experimental::LayoutTiled, iType0, iType1> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits traits; - typedef Kokkos::View type; + using array_layout = + typename std::conditional::type; + using traits = Kokkos::ViewTraits; + using type = Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -703,27 +732,28 @@ struct ViewMapping, iType0, iType1, iType2> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits traits; - typedef Kokkos::View type; + using array_layout = + typename std::conditional::type; + using traits = Kokkos::ViewTraits; + using type = Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1, const iType2 i_tile2) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -759,27 +789,28 @@ struct ViewMapping, iType0, iType1, iType2, iType3> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits traits; - typedef Kokkos::View type; + using array_layout = + typename std::conditional::type; + using traits = Kokkos::ViewTraits; + using type = Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1, const iType2 i_tile2, const iType3 i_tile3) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -820,27 +851,28 @@ struct ViewMapping< Kokkos::Experimental::LayoutTiled, iType0, iType1, iType2, iType3, iType4> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits traits; - typedef Kokkos::View type; + using array_layout = + typename std::conditional::type; + using traits = Kokkos::ViewTraits; + using type = Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1, const iType2 i_tile2, const iType3 i_tile3, const iType4 i_tile4) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -886,29 +918,30 @@ struct ViewMapping::type // void Kokkos::Experimental::LayoutTiled, iType0, iType1, iType2, iType3, iType4, iType5> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits - traits; - typedef Kokkos::View type; + using array_layout = + typename std::conditional::type; + using traits = + Kokkos::ViewTraits; + using type = Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1, const iType2 i_tile2, const iType3 i_tile3, const iType4 i_tile4, const iType5 i_tile5) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -958,29 +991,30 @@ struct ViewMapping::type // void Kokkos::Experimental::LayoutTiled, iType0, iType1, iType2, iType3, iType4, iType5, iType6> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits - traits; - typedef Kokkos::View type; + using array_layout = + typename std::conditional::type; + using traits = + Kokkos::ViewTraits; + using type = Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1, const iType2 i_tile2, const iType3 i_tile3, const iType4 i_tile4, const iType5 i_tile5, const iType6 i_tile6) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -1039,31 +1073,31 @@ struct ViewMapping< Kokkos::Experimental::LayoutTiled, iType0, iType1, iType2, iType3, iType4, iType5, iType6, iType7> { - typedef Kokkos::Experimental::LayoutTiled - src_layout; - typedef Kokkos::ViewTraits src_traits; + using src_layout = + Kokkos::Experimental::LayoutTiled; + using src_traits = Kokkos::ViewTraits; enum { is_outer_left = (OuterP == Kokkos::Iterate::Left) }; enum { is_inner_left = (InnerP == Kokkos::Iterate::Left) }; - typedef typename std::conditional::type array_layout; - typedef Kokkos::ViewTraits - traits; - typedef Kokkos::View - type; + using array_layout = + typename std::conditional::type; + using traits = + Kokkos::ViewTraits; + using type = + Kokkos::View; KOKKOS_INLINE_FUNCTION static void assign( ViewMapping& dst, const ViewMapping& src, const src_layout&, const iType0 i_tile0, const iType1 i_tile1, const iType2 i_tile2, const iType3 i_tile3, const iType4 i_tile4, const iType5 i_tile5, const iType6 i_tile6, const iType7 i_tile7) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; + using dst_map_type = ViewMapping; + using src_map_type = ViewMapping; + using dst_handle_type = typename dst_map_type::handle_type; + using dst_offset_type = typename dst_map_type::offset_type; + using src_offset_type = typename src_map_type::offset_type; dst = dst_map_type( dst_handle_type( @@ -1131,13 +1165,12 @@ tile_subview(const Kokkos::View< const size_t i_tile0, const size_t i_tile1) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View(src, SrcLayout(), i_tile0, i_tile1); @@ -1160,13 +1193,12 @@ tile_subview(const Kokkos::View< const size_t i_tile0, const size_t i_tile1, const size_t i_tile2) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View( src, SrcLayout(), i_tile0, i_tile1, i_tile2); @@ -1190,13 +1222,12 @@ tile_subview(const Kokkos::View< const size_t i_tile3) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View( src, SrcLayout(), i_tile0, i_tile1, i_tile2, i_tile3); @@ -1220,13 +1251,12 @@ tile_subview(const Kokkos::View< const size_t i_tile3, const size_t i_tile4) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View( src, SrcLayout(), i_tile0, i_tile1, i_tile2, i_tile3, i_tile4); @@ -1250,13 +1280,12 @@ tile_subview(const Kokkos::View< const size_t i_tile3, const size_t i_tile4, const size_t i_tile5) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View( src, SrcLayout(), i_tile0, i_tile1, i_tile2, i_tile3, i_tile4, i_tile5); @@ -1281,13 +1310,12 @@ tile_subview(const Kokkos::View< const size_t i_tile6) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View( src, SrcLayout(), i_tile0, i_tile1, i_tile2, i_tile3, i_tile4, i_tile5, @@ -1313,13 +1341,12 @@ tile_subview(const Kokkos::View< const size_t i_tile6, const size_t i_tile7) { // Force the specialized ViewMapping for extracting a tile // by using the first subview argument as the layout. - typedef + using array_layout = typename std::conditional<(InnerP == Kokkos::Iterate::Left), - Kokkos::LayoutLeft, Kokkos::LayoutRight>::type - array_layout; - typedef Kokkos::Experimental::LayoutTiled - SrcLayout; + Kokkos::LayoutLeft, Kokkos::LayoutRight>::type; + using SrcLayout = + Kokkos::Experimental::LayoutTiled; return Kokkos::View( src, SrcLayout(), i_tile0, i_tile1, i_tile2, i_tile3, i_tile4, i_tile5, @@ -1327,7 +1354,6 @@ tile_subview(const Kokkos::View< } } /* namespace Kokkos */ -#endif //! defined(KOKKOS_ENABLE_DEPRECATED_CODE //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp index c8230169e7..61e23f72b8 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewMapping.hpp @@ -54,11 +54,10 @@ #include #include #include +#include #include #include -#if defined(KOKKOS_ENABLE_PROFILING) -#include -#endif +#include //---------------------------------------------------------------------------- //---------------------------------------------------------------------------- @@ -68,17 +67,17 @@ namespace Impl { template struct variadic_size_t { - enum { value = KOKKOS_INVALID_INDEX }; + enum : size_t { value = KOKKOS_INVALID_INDEX }; }; template struct variadic_size_t<0, Val, Args...> { - enum { value = Val }; + enum : size_t { value = Val }; }; template struct variadic_size_t { - enum { value = variadic_size_t::value }; + enum : size_t { value = variadic_size_t::value }; }; template @@ -86,27 +85,27 @@ struct rank_dynamic; template <> struct rank_dynamic<> { - enum { value = 0 }; + enum : unsigned { value = 0 }; }; template struct rank_dynamic { - enum { value = (Val == 0 ? 1 : 0) + rank_dynamic::value }; + enum : unsigned { value = (Val == 0 ? 1 : 0) + rank_dynamic::value }; }; #define KOKKOS_IMPL_VIEW_DIMENSION(R) \ template \ struct ViewDimension##R { \ - enum { ArgN##R = (V != KOKKOS_INVALID_INDEX ? V : 1) }; \ - enum { N##R = (V != KOKKOS_INVALID_INDEX ? V : 1) }; \ + enum : size_t { ArgN##R = (V != KOKKOS_INVALID_INDEX ? V : 1) }; \ + enum : size_t { N##R = (V != KOKKOS_INVALID_INDEX ? V : 1) }; \ KOKKOS_INLINE_FUNCTION explicit ViewDimension##R(size_t) {} \ ViewDimension##R() = default; \ ViewDimension##R(const ViewDimension##R&) = default; \ ViewDimension##R& operator=(const ViewDimension##R&) = default; \ }; \ template \ - struct ViewDimension##R<0, RD> { \ - enum { ArgN##R = 0 }; \ + struct ViewDimension##R<0u, RD> { \ + enum : size_t { ArgN##R = 0 }; \ typename std::conditional<(RD < 3), size_t, unsigned>::type N##R; \ ViewDimension##R() = default; \ ViewDimension##R(const ViewDimension##R&) = default; \ @@ -125,47 +124,42 @@ KOKKOS_IMPL_VIEW_DIMENSION(7) #undef KOKKOS_IMPL_VIEW_DIMENSION +// MSVC does not do empty base class optimization by default. +// Per standard it is required for standard layout types template -struct ViewDimension : public ViewDimension0::value, - rank_dynamic::value>, - public ViewDimension1::value, - rank_dynamic::value>, - public ViewDimension2::value, - rank_dynamic::value>, - public ViewDimension3::value, - rank_dynamic::value>, - public ViewDimension4::value, - rank_dynamic::value>, - public ViewDimension5::value, - rank_dynamic::value>, - public ViewDimension6::value, - rank_dynamic::value>, - public ViewDimension7::value, - rank_dynamic::value> { - typedef ViewDimension0::value, - rank_dynamic::value> - D0; - typedef ViewDimension1::value, - rank_dynamic::value> - D1; - typedef ViewDimension2::value, - rank_dynamic::value> - D2; - typedef ViewDimension3::value, - rank_dynamic::value> - D3; - typedef ViewDimension4::value, - rank_dynamic::value> - D4; - typedef ViewDimension5::value, - rank_dynamic::value> - D5; - typedef ViewDimension6::value, - rank_dynamic::value> - D6; - typedef ViewDimension7::value, - rank_dynamic::value> - D7; +struct KOKKOS_IMPL_ENFORCE_EMPTY_BASE_OPTIMIZATION ViewDimension + : public ViewDimension0::value, + rank_dynamic::value>, + public ViewDimension1::value, + rank_dynamic::value>, + public ViewDimension2::value, + rank_dynamic::value>, + public ViewDimension3::value, + rank_dynamic::value>, + public ViewDimension4::value, + rank_dynamic::value>, + public ViewDimension5::value, + rank_dynamic::value>, + public ViewDimension6::value, + rank_dynamic::value>, + public ViewDimension7::value, + rank_dynamic::value> { + using D0 = ViewDimension0::value, + rank_dynamic::value>; + using D1 = ViewDimension1::value, + rank_dynamic::value>; + using D2 = ViewDimension2::value, + rank_dynamic::value>; + using D3 = ViewDimension3::value, + rank_dynamic::value>; + using D4 = ViewDimension4::value, + rank_dynamic::value>; + using D5 = ViewDimension5::value, + rank_dynamic::value>; + using D6 = ViewDimension6::value, + rank_dynamic::value>; + using D7 = ViewDimension7::value, + rank_dynamic::value>; using D0::ArgN0; using D1::ArgN1; @@ -185,8 +179,8 @@ struct ViewDimension : public ViewDimension0::value, using D6::N6; using D7::N7; - enum { rank = sizeof...(Vals) }; - enum { rank_dynamic = Impl::rank_dynamic::value }; + enum : unsigned { rank = sizeof...(Vals) }; + enum : unsigned { rank_dynamic = Impl::rank_dynamic::value }; ViewDimension() = default; ViewDimension(const ViewDimension&) = default; @@ -239,12 +233,12 @@ struct ViewDimension : public ViewDimension0::value, template struct prepend { - typedef ViewDimension type; + using type = ViewDimension; }; template struct append { - typedef ViewDimension type; + using type = ViewDimension; }; }; @@ -253,7 +247,7 @@ struct ViewDimensionJoin; template struct ViewDimensionJoin, ViewDimension> { - typedef ViewDimension type; + using type = ViewDimension; }; //---------------------------------------------------------------------------- @@ -264,8 +258,8 @@ struct ViewDimensionAssignable; template struct ViewDimensionAssignable, ViewDimension> { - typedef ViewDimension dst; - typedef ViewDimension src; + using dst = ViewDimension; + using src = ViewDimension; enum { value = unsigned(dst::rank) == unsigned(src::rank) && @@ -345,8 +339,8 @@ struct is_integral_extent_type> { template struct is_integral_extent { // get_type is void when sizeof...(Args) <= I - typedef typename std::remove_cv::type>::type>::type type; + using type = typename std::remove_cv::type>::type>::type; enum { value = is_integral_extent_type::value }; @@ -731,17 +725,17 @@ struct ViewDataType; template struct ViewDataType> { - typedef T type; + using type = T; }; template struct ViewDataType> { - typedef typename ViewDataType>::type type; + using type = typename ViewDataType>::type; }; template struct ViewDataType> { - typedef typename ViewDataType>::type type[N]; + using type = typename ViewDataType>::type[N]; }; /**\brief Analysis of View data type. @@ -751,80 +745,80 @@ struct ViewDataType> { * {const} value_type ***[#][#][#] * Where the sum of counts of '*' and '[#]' is at most ten. * - * Provide typedef for the ViewDimension<...> and value_type. + * Provide alias for ViewDimension<...> and value_type. */ template struct ViewArrayAnalysis { - typedef T value_type; - typedef typename std::add_const::type const_value_type; - typedef typename std::remove_const::type non_const_value_type; - typedef ViewDimension<> static_dimension; - typedef ViewDimension<> dynamic_dimension; - typedef ViewDimension<> dimension; + using value_type = T; + using const_value_type = typename std::add_const::type; + using non_const_value_type = typename std::remove_const::type; + using static_dimension = ViewDimension<>; + using dynamic_dimension = ViewDimension<>; + using dimension = ViewDimension<>; }; template struct ViewArrayAnalysis { private: - typedef ViewArrayAnalysis nested; + using nested = ViewArrayAnalysis; public: - typedef typename nested::value_type value_type; - typedef typename nested::const_value_type const_value_type; - typedef typename nested::non_const_value_type non_const_value_type; + using value_type = typename nested::value_type; + using const_value_type = typename nested::const_value_type; + using non_const_value_type = typename nested::non_const_value_type; - typedef typename nested::static_dimension::template prepend::type - static_dimension; + using static_dimension = + typename nested::static_dimension::template prepend::type; - typedef typename nested::dynamic_dimension dynamic_dimension; + using dynamic_dimension = typename nested::dynamic_dimension; - typedef typename ViewDimensionJoin::type - dimension; + using dimension = + typename ViewDimensionJoin::type; }; template struct ViewArrayAnalysis { private: - typedef ViewArrayAnalysis nested; - typedef typename nested::dimension nested_dimension; + using nested = ViewArrayAnalysis; + using nested_dimension = typename nested::dimension; public: - typedef typename nested::value_type value_type; - typedef typename nested::const_value_type const_value_type; - typedef typename nested::non_const_value_type non_const_value_type; + using value_type = typename nested::value_type; + using const_value_type = typename nested::const_value_type; + using non_const_value_type = typename nested::non_const_value_type; - typedef typename nested::dynamic_dimension::template prepend<0>::type - dynamic_dimension; + using dynamic_dimension = + typename nested::dynamic_dimension::template prepend<0>::type; - typedef typename nested::static_dimension static_dimension; + using static_dimension = typename nested::static_dimension; - typedef typename ViewDimensionJoin::type - dimension; + using dimension = + typename ViewDimensionJoin::type; }; template struct ViewArrayAnalysis { private: - typedef ViewArrayAnalysis nested; + using nested = ViewArrayAnalysis; public: - typedef typename nested::value_type value_type; - typedef typename nested::const_value_type const_value_type; - typedef typename nested::non_const_value_type non_const_value_type; + using value_type = typename nested::value_type; + using const_value_type = typename nested::const_value_type; + using non_const_value_type = typename nested::non_const_value_type; - typedef typename nested::dynamic_dimension::template prepend<0>::type - dynamic_dimension; + using dynamic_dimension = + typename nested::dynamic_dimension::template prepend<0>::type; - typedef typename nested::static_dimension static_dimension; + using static_dimension = typename nested::static_dimension; - typedef typename ViewDimensionJoin::type - dimension; + using dimension = + typename ViewDimensionJoin::type; }; template struct ViewDataAnalysis { private: - typedef ViewArrayAnalysis array_analysis; + using array_analysis = ViewArrayAnalysis; // ValueType is opportunity for partial specialization. // Must match array analysis when this default template is used. @@ -834,23 +828,23 @@ struct ViewDataAnalysis { ""); public: - typedef void specialize; // No specialization + using specialize = void; // No specialization - typedef typename array_analysis::dimension dimension; - typedef typename array_analysis::value_type value_type; - typedef typename array_analysis::const_value_type const_value_type; - typedef typename array_analysis::non_const_value_type non_const_value_type; + using dimension = typename array_analysis::dimension; + using value_type = typename array_analysis::value_type; + using const_value_type = typename array_analysis::const_value_type; + using non_const_value_type = typename array_analysis::non_const_value_type; // Generate analogous multidimensional array specification type. - typedef typename ViewDataType::type type; - typedef typename ViewDataType::type const_type; - typedef typename ViewDataType::type - non_const_type; + using type = typename ViewDataType::type; + using const_type = typename ViewDataType::type; + using non_const_type = + typename ViewDataType::type; // Generate "flattened" multidimensional array specification type. - typedef type scalar_array_type; - typedef const_type const_scalar_array_type; - typedef non_const_type non_const_scalar_array_type; + using scalar_array_type = type; + using const_scalar_array_type = const_type; + using non_const_scalar_array_type = non_const_type; }; } // namespace Impl @@ -877,9 +871,9 @@ struct ViewOffset< using is_mapping_plugin = std::true_type; using is_regular = std::true_type; - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Kokkos::LayoutLeft array_layout; + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Kokkos::LayoutLeft; dimension_type m_dim; @@ -1080,9 +1074,21 @@ struct ViewOffset< //---------------------------------------- + // MSVC (16.5.5) + CUDA (10.2) did not generate the defaulted functions + // correct and errors out during compilation. Same for the other places where + // I changed this. +#ifdef KOKKOS_IMPL_WINDOWS_CUDA + KOKKOS_FUNCTION ViewOffset() : m_dim(dimension_type()) {} + KOKKOS_FUNCTION ViewOffset(const ViewOffset& src) { m_dim = src.m_dim; } + KOKKOS_FUNCTION ViewOffset& operator=(const ViewOffset& src) { + m_dim = src.m_dim; + return *this; + } +#else ViewOffset() = default; ViewOffset(const ViewOffset&) = default; ViewOffset& operator=(const ViewOffset&) = default; +#endif template KOKKOS_INLINE_FUNCTION constexpr ViewOffset( @@ -1147,9 +1153,9 @@ struct ViewOffset< using is_mapping_plugin = std::true_type; using is_regular = std::true_type; - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Kokkos::LayoutLeft array_layout; + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Kokkos::LayoutLeft; dimension_type m_dim; size_type m_stride; @@ -1385,9 +1391,26 @@ struct ViewOffset< }; public: + // MSVC (16.5.5) + CUDA (10.2) did not generate the defaulted functions + // correct and errors out during compilation. Same for the other places where + // I changed this. +#ifdef KOKKOS_IMPL_WINDOWS_CUDA + KOKKOS_FUNCTION ViewOffset() : m_dim(dimension_type()), m_stride(0) {} + KOKKOS_FUNCTION ViewOffset(const ViewOffset& src) { + m_dim = src.m_dim; + m_stride = src.m_stride; + } + KOKKOS_FUNCTION ViewOffset& operator=(const ViewOffset& src) { + m_dim = src.m_dim; + m_stride = src.m_stride; + return *this; + } +#else + ViewOffset() = default; ViewOffset(const ViewOffset&) = default; ViewOffset& operator=(const ViewOffset&) = default; +#endif /* Enable padding for trivial scalar types with non-zero trivial scalar size */ @@ -1473,9 +1496,9 @@ struct ViewOffset< using is_mapping_plugin = std::true_type; using is_regular = std::true_type; - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Kokkos::LayoutRight array_layout; + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Kokkos::LayoutRight; dimension_type m_dim; @@ -1685,10 +1708,23 @@ struct ViewOffset< } //---------------------------------------- + // MSVC (16.5.5) + CUDA (10.2) did not generate the defaulted functions + // correct and errors out during compilation. Same for the other places where + // I changed this. + +#ifdef KOKKOS_IMPL_WINDOWS_CUDA + KOKKOS_FUNCTION ViewOffset() : m_dim(dimension_type()) {} + KOKKOS_FUNCTION ViewOffset(const ViewOffset& src) { m_dim = src.m_dim; } + KOKKOS_FUNCTION ViewOffset& operator=(const ViewOffset& src) { + m_dim = src.m_dim; + return *this; + } +#else ViewOffset() = default; ViewOffset(const ViewOffset&) = default; ViewOffset& operator=(const ViewOffset&) = default; +#endif template KOKKOS_INLINE_FUNCTION constexpr ViewOffset( @@ -1747,9 +1783,9 @@ struct ViewOffset< using is_mapping_plugin = std::true_type; using is_regular = std::true_type; - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Kokkos::LayoutRight array_layout; + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Kokkos::LayoutRight; dimension_type m_dim; size_type m_stride; @@ -1988,9 +2024,27 @@ struct ViewOffset< }; public: + // MSVC (16.5.5) + CUDA (10.2) did not generate the defaulted functions + // correct and errors out during compilation. Same for the other places where + // I changed this. + +#ifdef KOKKOS_IMPL_WINDOWS_CUDA + KOKKOS_FUNCTION ViewOffset() : m_dim(dimension_type()), m_stride(0) {} + KOKKOS_FUNCTION ViewOffset(const ViewOffset& src) { + m_dim = src.m_dim; + m_stride = src.m_stride; + } + KOKKOS_FUNCTION ViewOffset& operator=(const ViewOffset& src) { + m_dim = src.m_dim; + m_stride = src.m_stride; + return *this; + } +#else + ViewOffset() = default; ViewOffset(const ViewOffset&) = default; ViewOffset& operator=(const ViewOffset&) = default; +#endif /* Enable padding for trivial scalar types with non-zero trivial scalar size. */ @@ -2259,15 +2313,15 @@ struct ViewStride<8> { template struct ViewOffset { private: - typedef ViewStride stride_type; + using stride_type = ViewStride; public: using is_mapping_plugin = std::true_type; using is_regular = std::true_type; - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Kokkos::LayoutStride array_layout; + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Kokkos::LayoutStride; dimension_type m_dim; stride_type m_stride; @@ -2473,10 +2527,28 @@ struct ViewOffset { } //---------------------------------------- + // MSVC (16.5.5) + CUDA (10.2) did not generate the defaulted functions + // correct and errors out during compilation. Same for the other places where + // I changed this. + +#ifdef KOKKOS_IMPL_WINDOWS_CUDA + KOKKOS_FUNCTION ViewOffset() + : m_dim(dimension_type()), m_stride(stride_type()) {} + KOKKOS_FUNCTION ViewOffset(const ViewOffset& src) { + m_dim = src.m_dim; + m_stride = src.m_stride; + } + KOKKOS_FUNCTION ViewOffset& operator=(const ViewOffset& src) { + m_dim = src.m_dim; + m_stride = src.m_stride; + return *this; + } +#else ViewOffset() = default; ViewOffset(const ViewOffset&) = default; ViewOffset& operator=(const ViewOffset&) = default; +#endif KOKKOS_INLINE_FUNCTION constexpr ViewOffset(std::integral_constant const&, @@ -2568,10 +2640,10 @@ namespace Impl { */ template struct ViewDataHandle { - typedef typename Traits::value_type value_type; - typedef typename Traits::value_type* handle_type; - typedef typename Traits::value_type& return_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using value_type = typename Traits::value_type; + using handle_type = typename Traits::value_type*; + using return_type = typename Traits::value_type&; + using track_type = Kokkos::Impl::SharedAllocationTracker; KOKKOS_INLINE_FUNCTION static handle_type assign(value_type* arg_data_ptr, @@ -2592,10 +2664,10 @@ struct ViewDataHandle< typename Traits::value_type>::value && std::is_same::value && Traits::memory_traits::is_atomic)>::type> { - typedef typename Traits::value_type value_type; - typedef typename Kokkos::Impl::AtomicViewDataHandle handle_type; - typedef typename Kokkos::Impl::AtomicDataElement return_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using value_type = typename Traits::value_type; + using handle_type = typename Kokkos::Impl::AtomicViewDataHandle; + using return_type = typename Kokkos::Impl::AtomicDataElement; + using track_type = Kokkos::Impl::SharedAllocationTracker; KOKKOS_INLINE_FUNCTION static handle_type assign(value_type* arg_data_ptr, @@ -2623,10 +2695,10 @@ struct ViewDataHandle< Kokkos::CudaUVMSpace>::value)) #endif && (!Traits::memory_traits::is_atomic))>::type> { - typedef typename Traits::value_type value_type; - typedef typename Traits::value_type* KOKKOS_RESTRICT handle_type; - typedef typename Traits::value_type& KOKKOS_RESTRICT return_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using value_type = typename Traits::value_type; + using handle_type = typename Traits::value_type*; + using return_type = typename Traits::value_type&; + using track_type = Kokkos::Impl::SharedAllocationTracker; KOKKOS_INLINE_FUNCTION static value_type* assign(value_type* arg_data_ptr, @@ -2653,11 +2725,10 @@ struct ViewDataHandle< Kokkos::CudaUVMSpace>::value)) #endif && (!Traits::memory_traits::is_atomic))>::type> { - typedef typename Traits::value_type value_type; - typedef typename Traits::value_type* KOKKOS_IMPL_ALIGN_PTR( - KOKKOS_MEMORY_ALIGNMENT) handle_type; - typedef typename Traits::value_type& return_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using value_type = typename Traits::value_type; + using handle_type = typename Traits::value_type*; + using return_type = typename Traits::value_type&; + using track_type = Kokkos::Impl::SharedAllocationTracker; KOKKOS_INLINE_FUNCTION static handle_type assign(value_type* arg_data_ptr, @@ -2695,11 +2766,10 @@ struct ViewDataHandle< Kokkos::CudaUVMSpace>::value)) #endif && (!Traits::memory_traits::is_atomic))>::type> { - typedef typename Traits::value_type value_type; - typedef typename Traits::value_type* KOKKOS_RESTRICT - KOKKOS_IMPL_ALIGN_PTR(KOKKOS_MEMORY_ALIGNMENT) handle_type; - typedef typename Traits::value_type& return_type; - typedef Kokkos::Impl::SharedAllocationTracker track_type; + using value_type = typename Traits::value_type; + using handle_type = typename Traits::value_type*; + using return_type = typename Traits::value_type&; + using track_type = Kokkos::Impl::SharedAllocationTracker; KOKKOS_INLINE_FUNCTION static value_type* assign(value_type* arg_data_ptr, @@ -2748,13 +2818,14 @@ struct ViewValueFunctor; template struct ViewValueFunctor { - typedef Kokkos::RangePolicy> PolicyType; - typedef typename ExecSpace::execution_space Exec; + using PolicyType = Kokkos::RangePolicy>; + using Exec = typename ExecSpace::execution_space; Exec space; ValueType* ptr; size_t n; bool destroy; + std::string name; KOKKOS_INLINE_FUNCTION void operator()(const size_t i) const { @@ -2772,21 +2843,23 @@ struct ViewValueFunctor { ViewValueFunctor& operator=(const ViewValueFunctor&) = default; ViewValueFunctor(ExecSpace const& arg_space, ValueType* const arg_ptr, - size_t const arg_n) - : space(arg_space), ptr(arg_ptr), n(arg_n), destroy(false) {} + size_t const arg_n, std::string arg_name) + : space(arg_space), + ptr(arg_ptr), + n(arg_n), + destroy(false), + name(std::move(arg_name)) {} void execute(bool arg) { destroy = arg; if (!space.in_parallel()) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::beginParallelFor( - (destroy ? "Kokkos::View::destruction" - : "Kokkos::View::initialization"), - 0, &kpID); + auto functor_name = + (destroy ? "Kokkos::View::destruction [" + name + "]" + : "Kokkos::View::initialization [" + name + "]"); + Kokkos::Profiling::beginParallelFor(functor_name.c_str(), 0, &kpID); } -#endif #ifdef KOKKOS_ENABLE_CUDA if (std::is_same::value) { Kokkos::Impl::cuda_prefetch_pointer(space, ptr, sizeof(ValueType) * n, @@ -2797,11 +2870,9 @@ struct ViewValueFunctor { *this, PolicyType(0, n)); closure.execute(); space.fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelFor(kpID); } -#endif } else { for (size_t i = 0; i < n; ++i) operator()(i); } @@ -2814,11 +2885,12 @@ struct ViewValueFunctor { template struct ViewValueFunctor { - typedef Kokkos::RangePolicy> PolicyType; + using PolicyType = Kokkos::RangePolicy>; ExecSpace space; ValueType* ptr; size_t n; + std::string name; KOKKOS_INLINE_FUNCTION void operator()(const size_t i) const { ptr[i] = ValueType(); } @@ -2828,18 +2900,16 @@ struct ViewValueFunctor { ViewValueFunctor& operator=(const ViewValueFunctor&) = default; ViewValueFunctor(ExecSpace const& arg_space, ValueType* const arg_ptr, - size_t const arg_n) - : space(arg_space), ptr(arg_ptr), n(arg_n) {} + size_t const arg_n, std::string arg_name) + : space(arg_space), ptr(arg_ptr), n(arg_n), name(std::move(arg_name)) {} void construct_shared_allocation() { if (!space.in_parallel()) { -#if defined(KOKKOS_ENABLE_PROFILING) uint64_t kpID = 0; if (Kokkos::Profiling::profileLibraryLoaded()) { - Kokkos::Profiling::beginParallelFor("Kokkos::View::initialization", 0, - &kpID); + Kokkos::Profiling::beginParallelFor( + "Kokkos::View::initialization [" + name + "]", 0, &kpID); } -#endif #ifdef KOKKOS_ENABLE_CUDA if (std::is_same::value) { Kokkos::Impl::cuda_prefetch_pointer(space, ptr, sizeof(ValueType) * n, @@ -2850,11 +2920,9 @@ struct ViewValueFunctor { *this, PolicyType(0, n)); closure.execute(); space.fence(); -#if defined(KOKKOS_ENABLE_PROFILING) if (Kokkos::Profiling::profileLibraryLoaded()) { Kokkos::Profiling::endParallelFor(kpID); } -#endif } else { for (size_t i = 0; i < n; ++i) operator()(i); } @@ -2873,11 +2941,10 @@ class ViewMapping< ViewOffset::is_mapping_plugin::value)>::type> { public: - typedef ViewOffset - offset_type; + using offset_type = ViewOffset; - typedef typename ViewDataHandle::handle_type handle_type; + using handle_type = typename ViewDataHandle::handle_type; handle_type m_impl_handle; offset_type m_impl_offset; @@ -2891,7 +2958,7 @@ class ViewMapping< : m_impl_handle(arg_handle), m_impl_offset(arg_offset) {} public: - typedef void printable_label_typedef; + using printable_label_typedef = void; enum { is_managed = Traits::is_managed }; //---------------------------------------- @@ -2986,8 +3053,8 @@ class ViewMapping< return m_impl_offset.span_is_contiguous(); } - typedef typename ViewDataHandle::return_type reference_type; - typedef typename Traits::value_type* pointer_type; + using reference_type = typename ViewDataHandle::return_type; + using pointer_type = typename Traits::value_type*; /** \brief Query raw pointer to memory */ KOKKOS_INLINE_FUNCTION constexpr pointer_type data() const { @@ -3003,9 +3070,12 @@ class ViewMapping< template KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if::value && - !std::is_same::value, + typename std::enable_if<(std::is_integral::value && + // if layout is neither stride nor irregular, + // then just use the handle directly + !(std::is_same::value || + !is_regular::value)), reference_type>::type reference(const I0& i0) const { return m_impl_handle[i0]; @@ -3013,9 +3083,12 @@ class ViewMapping< template KOKKOS_FORCEINLINE_FUNCTION - typename std::enable_if::value && - std::is_same::value, + typename std::enable_if<(std::is_integral::value && + // if the layout is strided or irregular, then + // we have to use the offset + (std::is_same::value || + !is_regular::value)), reference_type>::type reference(const I0& i0) const { return m_impl_handle[m_impl_offset(i0)]; @@ -3091,21 +3164,13 @@ class ViewMapping< KOKKOS_DEFAULTED_FUNCTION ~ViewMapping() = default; KOKKOS_INLINE_FUNCTION ViewMapping() : m_impl_handle(), m_impl_offset() {} - KOKKOS_INLINE_FUNCTION ViewMapping(const ViewMapping& rhs) - : m_impl_handle(rhs.m_impl_handle), m_impl_offset(rhs.m_impl_offset) {} - KOKKOS_INLINE_FUNCTION ViewMapping& operator=(const ViewMapping& rhs) { - m_impl_handle = rhs.m_impl_handle; - m_impl_offset = rhs.m_impl_offset; - return *this; - } - KOKKOS_INLINE_FUNCTION ViewMapping(ViewMapping&& rhs) - : m_impl_handle(rhs.m_impl_handle), m_impl_offset(rhs.m_impl_offset) {} - KOKKOS_INLINE_FUNCTION ViewMapping& operator=(ViewMapping&& rhs) { - m_impl_handle = rhs.m_impl_handle; - m_impl_offset = rhs.m_impl_offset; - return *this; - } + KOKKOS_DEFAULTED_FUNCTION ViewMapping(const ViewMapping&) = default; + KOKKOS_DEFAULTED_FUNCTION ViewMapping& operator=(const ViewMapping&) = + default; + + KOKKOS_DEFAULTED_FUNCTION ViewMapping(ViewMapping&&) = default; + KOKKOS_DEFAULTED_FUNCTION ViewMapping& operator=(ViewMapping&&) = default; //---------------------------------------- @@ -3113,7 +3178,7 @@ class ViewMapping< KOKKOS_INLINE_FUNCTION static constexpr size_t memory_span( typename Traits::array_layout const& arg_layout) { - typedef std::integral_constant padding; + using padding = std::integral_constant; return (offset_type(padding(), arg_layout).span() * MemorySpanSize + MemorySpanMask) & ~size_t(MemorySpanMask); @@ -3144,43 +3209,39 @@ class ViewMapping< Kokkos::Impl::SharedAllocationRecord<>* allocate_shared( Kokkos::Impl::ViewCtorProp const& arg_prop, typename Traits::array_layout const& arg_layout) { - typedef Kokkos::Impl::ViewCtorProp alloc_prop; + using alloc_prop = Kokkos::Impl::ViewCtorProp; - typedef typename alloc_prop::execution_space execution_space; - typedef typename Traits::memory_space memory_space; - typedef typename Traits::value_type value_type; - typedef ViewValueFunctor functor_type; - typedef Kokkos::Impl::SharedAllocationRecord - record_type; + using execution_space = typename alloc_prop::execution_space; + using memory_space = typename Traits::memory_space; + using value_type = typename Traits::value_type; + using functor_type = ViewValueFunctor; + using record_type = + Kokkos::Impl::SharedAllocationRecord; // Query the mapping for byte-size of allocation. // If padding is allowed then pass in sizeof value type // for padding computation. - typedef std::integral_constant< - unsigned, alloc_prop::allow_padding ? sizeof(value_type) : 0> - padding; + using padding = std::integral_constant< + unsigned int, alloc_prop::allow_padding ? sizeof(value_type) : 0>; m_impl_offset = offset_type(padding(), arg_layout); const size_t alloc_size = (m_impl_offset.span() * MemorySpanSize + MemorySpanMask) & ~size_t(MemorySpanMask); - + const std::string& alloc_name = + static_cast const&>( + arg_prop) + .value; // Create shared memory tracking record with allocate memory from the memory // space record_type* const record = record_type::allocate( - ((Kokkos::Impl::ViewCtorProp const&)arg_prop).value, - ((Kokkos::Impl::ViewCtorProp const&)arg_prop).value, - alloc_size); + static_cast const&>( + arg_prop) + .value, + alloc_name, alloc_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (alloc_size) { -#endif - m_impl_handle = - handle_type(reinterpret_cast(record->data())); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - } -#endif + m_impl_handle = handle_type(reinterpret_cast(record->data())); // Only initialize if the allocation is non-zero. // May be zero if one of the dimensions is zero. @@ -3189,9 +3250,10 @@ class ViewMapping< // The ViewValueFunctor has both value construction and destruction // operators. record->m_destroy = functor_type( - ((Kokkos::Impl::ViewCtorProp const&)arg_prop) + static_cast const&>( + arg_prop) .value, - (value_type*)m_impl_handle, m_impl_offset.span()); + (value_type*)m_impl_handle, m_impl_offset.span(), alloc_name); // Construct values record->m_destroy.construct_shared_allocation(); @@ -3281,9 +3343,9 @@ class ViewMapping< is_assignable_dimension && is_assignable_layout }; - typedef Kokkos::Impl::SharedAllocationTracker TrackType; - typedef ViewMapping DstType; - typedef ViewMapping SrcType; + using TrackType = Kokkos::Impl::SharedAllocationTracker; + using DstType = ViewMapping; + using SrcType = ViewMapping; KOKKOS_INLINE_FUNCTION static void assign(DstType& dst, const SrcType& src, @@ -3302,11 +3364,11 @@ class ViewMapping< is_assignable_layout, "View assignment must have compatible layout or have rank <= 1"); - typedef typename DstType::offset_type dst_offset_type; + using dst_offset_type = typename DstType::offset_type; if (size_t(DstTraits::dimension::rank_dynamic) < size_t(SrcTraits::dimension::rank_dynamic)) { - typedef typename DstTraits::dimension dst_dim; + using dst_dim = typename DstTraits::dimension; bool assignable = ((1 > DstTraits::dimension::rank_dynamic && 1 <= SrcTraits::dimension::rank_dynamic) ? dst_dim::ArgN0 == src.dimension_0() @@ -3403,9 +3465,9 @@ class ViewMapping< is_assignable_dimension }; - typedef Kokkos::Impl::SharedAllocationTracker TrackType; - typedef ViewMapping DstType; - typedef ViewMapping SrcType; + using TrackType = Kokkos::Impl::SharedAllocationTracker; + using DstType = ViewMapping; + using SrcType = ViewMapping; KOKKOS_INLINE_FUNCTION static bool assignable_layout_check(DstType&, @@ -3455,11 +3517,11 @@ class ViewMapping< if (!assignable_layout) Kokkos::abort("View assignment must have compatible layouts\n"); - typedef typename DstType::offset_type dst_offset_type; + using dst_offset_type = typename DstType::offset_type; if (size_t(DstTraits::dimension::rank_dynamic) < size_t(SrcTraits::dimension::rank_dynamic)) { - typedef typename DstTraits::dimension dst_dim; + using dst_dim = typename DstTraits::dimension; bool assignable = ((1 > DstTraits::dimension::rank_dynamic && 1 <= SrcTraits::dimension::rank_dynamic) ? dst_dim::ArgN0 == src.dimension_0() @@ -3609,7 +3671,7 @@ struct ViewMapping< }; // Subview's layout - typedef typename std::conditional< + using array_layout = typename std::conditional< ( /* Same array layout IF */ (rank == 0) /* output rank zero */ || SubviewLegalArgsCompileTime::value) // replace input rank ), - typename SrcTraits::array_layout, Kokkos::LayoutStride>::type - array_layout; + typename SrcTraits::array_layout, Kokkos::LayoutStride>::type; - typedef typename SrcTraits::value_type value_type; + using value_type = typename SrcTraits::value_type; using data_type = typename SubViewDataType::type, Args...>::type; - // typedef typename std::conditional< rank == 0 , value_type , - // typename std::conditional< rank == 1 , value_type * , - // typename std::conditional< rank == 2 , value_type ** , - // typename std::conditional< rank == 3 , value_type *** , - // typename std::conditional< rank == 4 , value_type **** , - // typename std::conditional< rank == 5 , value_type ***** , - // typename std::conditional< rank == 6 , value_type ****** , - // typename std::conditional< rank == 7 , value_type ******* , - // value_type ******** - // >::type >::type >::type >::type >::type >::type >::type >::type - // data_type ; public: - typedef Kokkos::ViewTraits - traits_type; + using traits_type = Kokkos::ViewTraits; - typedef Kokkos::View - type; + using type = + Kokkos::View; template struct apply { static_assert(Kokkos::Impl::is_memory_traits::value, ""); - typedef Kokkos::ViewTraits - traits_type; + using traits_type = + Kokkos::ViewTraits; - typedef Kokkos::View - type; + using type = Kokkos::View; }; // The presumed type is 'ViewMapping< traits_type , void >' @@ -3682,9 +3730,9 @@ struct ViewMapping< "Subview destination type must be compatible with subview " "derived type"); - typedef ViewMapping DstType; + using DstType = ViewMapping; - typedef typename DstType::offset_type dst_offset_type; + using dst_offset_type = typename DstType::offset_type; const SubviewExtents extents(src.m_impl_offset.m_dim, args...); @@ -3774,7 +3822,7 @@ struct OperatorBoundsErrorOnDevice { /* Check #2: does the ViewMapping have the printable_label_typedef defined? See above that only the non-specialized standard-layout ViewMapping has this defined by default. - The existence of this typedef indicates the existence of MapType::is_managed + The existence of this alias indicates the existence of MapType::is_managed */ template struct has_printable_label_typedef : public std::false_type {}; @@ -3798,15 +3846,16 @@ KOKKOS_INLINE_FUNCTION void operator_bounds_error_on_device(MapType const& map, #endif // ! defined( KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST ) -template +template KOKKOS_INLINE_FUNCTION void view_verify_operator_bounds( - Kokkos::Impl::SharedAllocationTracker const& tracker, const MapType& map, + Kokkos::Impl::ViewTracker const& tracker, const MapType& map, Args... args) { if (!view_verify_operator_bounds<0>(map, args...)) { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) enum { LEN = 1024 }; char buffer[LEN]; - const std::string label = tracker.template get_label(); + const std::string label = + tracker.m_tracker.template get_label(); int n = snprintf(buffer, LEN, "View bounds error of view %s (", label.c_str()); view_error_operator_bounds<0>(buffer + n, LEN - n, map, args...); @@ -3817,7 +3866,7 @@ KOKKOS_INLINE_FUNCTION void view_verify_operator_bounds( a corresponding SharedAllocationHeader containing a label). This check should cover the case of Views that don't have the Unmanaged trait but were initialized by pointer. */ - if (tracker.has_record()) { + if (tracker.m_tracker.has_record()) { operator_bounds_error_on_device( map, has_printable_label_typedef()); } else { diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp deleted file mode 100644 index 342927ef77..0000000000 --- a/lib/kokkos/core/src/impl/Kokkos_ViewTile.hpp +++ /dev/null @@ -1,222 +0,0 @@ -/* -//@HEADER -// ************************************************************************ -// -// Kokkos v. 3.0 -// Copyright (2020) National Technology & Engineering -// Solutions of Sandia, LLC (NTESS). -// -// Under the terms of Contract DE-NA0003525 with NTESS, -// the U.S. Government retains certain rights in this software. -// -// Redistribution and use in source and binary forms, with or without -// modification, are permitted provided that the following conditions are -// met: -// -// 1. Redistributions of source code must retain the above copyright -// notice, this list of conditions and the following disclaimer. -// -// 2. Redistributions in binary form must reproduce the above copyright -// notice, this list of conditions and the following disclaimer in the -// documentation and/or other materials provided with the distribution. -// -// 3. Neither the name of the Corporation nor the names of the -// contributors may be used to endorse or promote products derived from -// this software without specific prior written permission. -// -// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY -// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE -// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR -// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF -// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS -// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -// -// Questions? Contact Christian R. Trott (crtrott@sandia.gov) -// -// ************************************************************************ -//@HEADER -*/ - -#ifndef KOKKOS_EXPERIMENTAL_VIEWTILE_HPP -#define KOKKOS_EXPERIMENTAL_VIEWTILE_HPP - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -namespace Kokkos { -namespace Impl { - -// =========================================================================== -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - -// View mapping for rank two tiled array - -template -struct is_layout_tile : public std::false_type {}; - -template -struct is_layout_tile > - : public std::true_type {}; - -template -struct ViewOffset< - Dimension, Layout, - typename std::enable_if<((Dimension::rank == 2) && - is_layout_tile::value)>::type> { - public: - enum { SHIFT_0 = Kokkos::Impl::integral_power_of_two(Layout::N0) }; - enum { SHIFT_1 = Kokkos::Impl::integral_power_of_two(Layout::N1) }; - enum { SHIFT_T = SHIFT_0 + SHIFT_1 }; - enum { MASK_0 = Layout::N0 - 1 }; - enum { MASK_1 = Layout::N1 - 1 }; - - // Is an irregular layout that does not have uniform striding for each index. - using is_mapping_plugin = std::true_type; - using is_regular = std::false_type; - - typedef size_t size_type; - typedef Dimension dimension_type; - typedef Layout array_layout; - - dimension_type m_dim; - size_type m_tile_N0; - - //---------------------------------------- - - // Only instantiated for rank 2 - template - KOKKOS_INLINE_FUNCTION constexpr size_type operator()(I0 const& i0, - I1 const& i1, int = 0, - int = 0, int = 0, - int = 0, int = 0, - int = 0) const { - return /* ( ( Tile offset ) * Tile size ) */ - (((i0 >> SHIFT_0) + m_tile_N0 * (i1 >> SHIFT_1)) << SHIFT_T) + - /* ( Offset within tile ) */ - ((i0 & MASK_0) + ((i1 & MASK_1) << SHIFT_0)); - } - - //---------------------------------------- - - KOKKOS_INLINE_FUNCTION constexpr array_layout layout() const { - return array_layout(m_dim.N0, m_dim.N1); - } - - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_0() const { - return m_dim.N0; - } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_1() const { - return m_dim.N1; - } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_2() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_3() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_4() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_5() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_6() const { return 1; } - KOKKOS_INLINE_FUNCTION constexpr size_type dimension_7() const { return 1; } - - KOKKOS_INLINE_FUNCTION constexpr size_type size() const { - return m_dim.N0 * m_dim.N1; - } - - // Strides are meaningless due to irregularity - KOKKOS_INLINE_FUNCTION constexpr size_type stride_0() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_1() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_2() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_3() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_4() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_5() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_6() const { return 0; } - KOKKOS_INLINE_FUNCTION constexpr size_type stride_7() const { return 0; } - - KOKKOS_INLINE_FUNCTION constexpr size_type span() const { - // ( TileDim0 * ( TileDim1 ) ) * TileSize - return (m_tile_N0 * ((m_dim.N1 + MASK_1) >> SHIFT_1)) << SHIFT_T; - } - - KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const { - // Only if dimensions align with tile size - return (m_dim.N0 & MASK_0) == 0 && (m_dim.N1 & MASK_1) == 0; - } - - //---------------------------------------- - - KOKKOS_DEFAULTED_FUNCTION ~ViewOffset() = default; - KOKKOS_DEFAULTED_FUNCTION ViewOffset() = default; - KOKKOS_DEFAULTED_FUNCTION ViewOffset(const ViewOffset&) = default; - KOKKOS_DEFAULTED_FUNCTION ViewOffset& operator=(const ViewOffset&) = default; - - template - KOKKOS_INLINE_FUNCTION constexpr ViewOffset( - std::integral_constant const&, - array_layout const arg_layout) - : m_dim(arg_layout.dimension[0], arg_layout.dimension[1], 0, 0, 0, 0, 0, - 0), - m_tile_N0((arg_layout.dimension[0] + MASK_0) >> - SHIFT_0 /* number of tiles in first dimension */) {} -}; - -template -struct ViewMapping< - void, Kokkos::ViewTraits, P...>, - Kokkos::LayoutTileLeft, iType0, iType1> { - typedef Kokkos::LayoutTileLeft src_layout; - typedef Kokkos::ViewTraits src_traits; - typedef Kokkos::ViewTraits traits; - typedef Kokkos::View type; - - KOKKOS_INLINE_FUNCTION static void assign( - ViewMapping& dst, const ViewMapping& src, - const src_layout&, const size_t i_tile0, const size_t i_tile1) { - typedef ViewMapping dst_map_type; - typedef ViewMapping src_map_type; - typedef typename dst_map_type::handle_type dst_handle_type; - typedef typename dst_map_type::offset_type dst_offset_type; - typedef typename src_map_type::offset_type src_offset_type; - - dst = dst_map_type( - dst_handle_type(src.m_impl_handle + - ((i_tile0 + src.m_impl_offset.m_tile_N0 * i_tile1) - << src_offset_type::SHIFT_T)), - dst_offset_type()); - } -}; - -#endif // KOKKOS_ENABLE_DEPRECATED_CODE -// =============================================================================== - -} /* namespace Impl */ -} /* namespace Kokkos */ - -namespace Kokkos { - -// ============================================================================== -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - -template -KOKKOS_INLINE_FUNCTION Kokkos::View tile_subview( - const Kokkos::View, P...>& src, - const size_t i_tile0, const size_t i_tile1) { - // Force the specialized ViewMapping for extracting a tile - // by using the first subview argument as the layout. - typedef Kokkos::LayoutTileLeft SrcLayout; - - return Kokkos::View(src, SrcLayout(), i_tile0, - i_tile1); -} - -#endif // KOKKOS_ENABLE_DEPRECATED_CODE -// =============================================================================== - -} /* namespace Kokkos */ - -//---------------------------------------------------------------------------- -//---------------------------------------------------------------------------- - -#endif /* #ifndef KOKKOS_EXPERIENTAL_VIEWTILE_HPP */ diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewTracker.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewTracker.hpp new file mode 100644 index 0000000000..9cfe9d7914 --- /dev/null +++ b/lib/kokkos/core/src/impl/Kokkos_ViewTracker.hpp @@ -0,0 +1,130 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef KOKKOS_VIEW_TRACKER_HPP +#define KOKKOS_VIEW_TRACKER_HPP + +namespace Kokkos { + +template +class View; + +namespace Impl { + +/* + * \class ViewTracker + * \brief template class to wrap the shared allocation tracker + * + * \section This class is templated on the View and provides + * constructors that match the view. The constructors and assignments + * from view will externalize the logic needed to enable/disable + * ref counting to provide a single gate to enable further developments + * which may hing on the same logic. + * + */ +template +struct ViewTracker { + using track_type = Kokkos::Impl::SharedAllocationTracker; + using view_traits = typename ParentView::traits; + + track_type m_tracker; + + KOKKOS_INLINE_FUNCTION + ViewTracker() : m_tracker() {} + + KOKKOS_INLINE_FUNCTION + ViewTracker(const ViewTracker& vt) noexcept + : m_tracker(vt.m_tracker, view_traits::is_managed) {} + + KOKKOS_INLINE_FUNCTION + explicit ViewTracker(const ParentView& vt) noexcept : m_tracker() { + assign(vt); + } + + template + KOKKOS_INLINE_FUNCTION explicit ViewTracker( + const View& vt) noexcept + : m_tracker() { + assign(vt); + } + + template + KOKKOS_INLINE_FUNCTION void assign(const View& vt) noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (view_traits::is_managed && + Kokkos::Impl::SharedAllocationRecord::tracking_enabled()) { + m_tracker.assign_direct(vt.m_track.m_tracker); + } else { + m_tracker.assign_force_disable(vt.m_track.m_tracker); + } +#else + m_tracker.assign_force_disable(vt.m_track.m_tracker); +#endif + } + + KOKKOS_INLINE_FUNCTION + ViewTracker& operator=(const ViewTracker& rhs) noexcept { +#if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) + if (view_traits::is_managed && + Kokkos::Impl::SharedAllocationRecord::tracking_enabled()) { + m_tracker.assign_direct(rhs.m_tracker); + } else { + m_tracker.assign_force_disable(rhs.m_tracker); + } +#else + m_tracker.assign_force_disable(rhs.m_tracker); +#endif + return *this; + } + + KOKKOS_INLINE_FUNCTION + explicit ViewTracker(const track_type& tt) noexcept + : m_tracker(tt, view_traits::is_managed) {} +}; + +} // namespace Impl + +} // namespace Kokkos + +#endif // KOKKOS_VIEW_TRACKER_HPP diff --git a/lib/kokkos/core/src/impl/Kokkos_ViewUniformType.hpp b/lib/kokkos/core/src/impl/Kokkos_ViewUniformType.hpp index 7ce3a532b4..2eb8fc9e3b 100644 --- a/lib/kokkos/core/src/impl/Kokkos_ViewUniformType.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_ViewUniformType.hpp @@ -45,77 +45,77 @@ #ifndef KOKKOS_EXPERIMENTAL_VIEWUNIFORMTYPE_HPP #define KOKKOS_EXPERIMENTAL_VIEWUNIFORMTYPE_HPP +#include + namespace Kokkos { namespace Impl { template struct ViewScalarToDataType { - typedef typename ViewScalarToDataType::type* type; + using type = typename ViewScalarToDataType::type *; }; template struct ViewScalarToDataType { - typedef ScalarType type; + using type = ScalarType; }; template struct ViewUniformLayout { - typedef LayoutType array_layout; + using array_layout = LayoutType; }; template struct ViewUniformLayout { - typedef Kokkos::LayoutLeft array_layout; + using array_layout = Kokkos::LayoutLeft; }; template <> struct ViewUniformLayout { - typedef Kokkos::LayoutLeft array_layout; + using array_layout = Kokkos::LayoutLeft; }; template struct ViewUniformType { - typedef typename ViewType::data_type data_type; - typedef typename std::add_const::type - const_data_type; - typedef typename ViewScalarToDataType::type runtime_data_type; - typedef typename ViewScalarToDataType< + using data_type = typename ViewType::data_type; + using const_data_type = + typename std::add_const::type; + using runtime_data_type = + typename ViewScalarToDataType::type; + using runtime_const_data_type = typename ViewScalarToDataType< typename std::add_const::type, - ViewType::rank>::type runtime_const_data_type; + ViewType::rank>::type; - typedef typename ViewUniformLayout::array_layout array_layout; + using array_layout = + typename ViewUniformLayout::array_layout; - typedef typename ViewType::device_type device_type; - typedef typename Kokkos::Device - anonymous_device_type; + using device_type = typename ViewType::device_type; + using anonymous_device_type = + typename Kokkos::Device; - typedef typename Kokkos::MemoryTraits memory_traits; - typedef Kokkos::View - type; - typedef Kokkos::View - const_type; - typedef Kokkos::View - runtime_type; - typedef Kokkos::View - runtime_const_type; + using memory_traits = typename Kokkos::MemoryTraits; + using type = + Kokkos::View; + using const_type = + Kokkos::View; + using runtime_type = + Kokkos::View; + using runtime_const_type = Kokkos::View; - typedef Kokkos::View - nomemspace_type; - typedef Kokkos::View - const_nomemspace_type; - typedef Kokkos::View - runtime_nomemspace_type; - typedef Kokkos::View - runtime_const_nomemspace_type; + using nomemspace_type = Kokkos::View; + using const_nomemspace_type = + Kokkos::View; + using runtime_nomemspace_type = + Kokkos::View; + using runtime_const_nomemspace_type = + Kokkos::View; }; } // namespace Impl } // namespace Kokkos diff --git a/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp b/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp index 3626a1f17c..4af26dcc91 100644 --- a/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp +++ b/lib/kokkos/core/src/impl/Kokkos_Volatile_Load.hpp @@ -42,6 +42,8 @@ //@HEADER */ +#include + #if defined(KOKKOS_ATOMIC_HPP) && !defined(KOKKOS_VOLATILE_LOAD_HPP) #define KOKKOS_VOLATILE_LOAD_HPP @@ -62,10 +64,10 @@ namespace Kokkos { template KOKKOS_FORCEINLINE_FUNCTION T volatile_load(T const volatile* const src_ptr) { - typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; - typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; - typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; - typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; // NOLINT(modernize-use-using) + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; // NOLINT(modernize-use-using) + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; // NOLINT(modernize-use-using) + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; // NOLINT(modernize-use-using) enum { NUM_8 = sizeof(T), @@ -114,10 +116,10 @@ KOKKOS_FORCEINLINE_FUNCTION T volatile_load(T const volatile* const src_ptr) { template KOKKOS_FORCEINLINE_FUNCTION void volatile_store( T volatile* const dst_ptr, T const volatile* const src_ptr) { - typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; - typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; - typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; - typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; // NOLINT(modernize-use-using) + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; // NOLINT(modernize-use-using) + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; // NOLINT(modernize-use-using) + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; // NOLINT(modernize-use-using) enum { NUM_8 = sizeof(T), @@ -162,10 +164,10 @@ KOKKOS_FORCEINLINE_FUNCTION void volatile_store( template KOKKOS_FORCEINLINE_FUNCTION void volatile_store(T volatile* const dst_ptr, T const* const src_ptr) { - typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; - typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; - typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; - typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; + typedef uint64_t KOKKOS_IMPL_MAY_ALIAS T64; // NOLINT(modernize-use-using) + typedef uint32_t KOKKOS_IMPL_MAY_ALIAS T32; // NOLINT(modernize-use-using) + typedef uint16_t KOKKOS_IMPL_MAY_ALIAS T16; // NOLINT(modernize-use-using) + typedef uint8_t KOKKOS_IMPL_MAY_ALIAS T8; // NOLINT(modernize-use-using) enum { NUM_8 = sizeof(T), diff --git a/lib/kokkos/core/unit_test/CMakeLists.txt b/lib/kokkos/core/unit_test/CMakeLists.txt index dec2f5e920..d87acdadfd 100644 --- a/lib/kokkos/core/unit_test/CMakeLists.txt +++ b/lib/kokkos/core/unit_test/CMakeLists.txt @@ -12,18 +12,20 @@ KOKKOS_ADD_TEST_LIBRARY( HEADERS ${GTEST_SOURCE_DIR}/gtest/gtest.h SOURCES ${GTEST_SOURCE_DIR}/gtest/gtest-all.cc ) -#These can be direct, no need for Tribits or Kokkos wrappers -# WORKAROUND FOR HIPCC -IF(Kokkos_ENABLE_HIP) - TARGET_COMPILE_DEFINITIONS(kokkos_gtest PUBLIC "-DGTEST_HAS_PTHREAD=0 --amdgpu-target=gfx906") -ELSE() - TARGET_COMPILE_DEFINITIONS(kokkos_gtest PUBLIC "-DGTEST_HAS_PTHREAD=0") -ENDIF() +# avoid deprecation warnings from MSVC +TARGET_COMPILE_DEFINITIONS(kokkos_gtest PUBLIC GTEST_HAS_TR1_TUPLE=0 GTEST_HAS_PTHREAD=0) TARGET_INCLUDE_DIRECTORIES(kokkos_gtest PUBLIC ${GTEST_SOURCE_DIR}) #Gtest minimally requires C++11 +IF(NOT (Kokkos_ENABLE_CUDA AND WIN32)) TARGET_COMPILE_FEATURES(kokkos_gtest PUBLIC cxx_std_11) +ENDIF() + +# Suppress clang-tidy diagnostics on code that we do not have control over +IF(CMAKE_CXX_CLANG_TIDY) + SET_TARGET_PROPERTIES(kokkos_gtest PROPERTIES CXX_CLANG_TIDY "") +ENDIF() # # Define Incremental Testing Feature Levels @@ -63,8 +65,10 @@ foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;OpenMPTarget;HIP) endif() string(TOLOWER ${Tag} dir) - SET(${Tag}_SOURCES - UnitTestMainInit.cpp + # Needed to split this for Windows NVCC, since it ends up putting everything on the + # command line in an intermediate compilation step even if CMake generated a response + # file. That then exceeded the shell comand line max length. + SET(${Tag}_SOURCES1 ${dir}/Test${Tag}_AtomicOperations_int.cpp ${dir}/Test${Tag}_AtomicOperations_unsignedint.cpp ${dir}/Test${Tag}_AtomicOperations_longint.cpp @@ -99,6 +103,9 @@ foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;OpenMPTarget;HIP) ${dir}/Test${Tag}_Reductions_DeviceView.cpp ${dir}/Test${Tag}_Scan.cpp ${dir}/Test${Tag}_SharedAlloc.cpp + ) + + SET(${Tag}_SOURCES2 ${dir}/Test${Tag}_SubView_a.cpp ${dir}/Test${Tag}_SubView_b.cpp ${dir}/Test${Tag}_SubView_c01.cpp @@ -134,10 +141,13 @@ foreach(Tag Threads;Serial;OpenMP;Cuda;HPX;OpenMPTarget;HIP) ${dir}/Test${Tag}_View_64bit.cpp ${dir}/Test${Tag}_ViewResize.cpp ) + SET(${Tag}_SOURCES ${${Tag}_SOURCES1} ${${Tag}_SOURCES2}) + endforeach() if(Kokkos_ENABLE_OPENMPTARGET) list(REMOVE_ITEM OpenMPTarget_SOURCES + openmptarget/TestOpenMPTarget_AtomicOperations_complexfloat.cpp openmptarget/TestOpenMPTarget_AtomicOperations_complexdouble.cpp openmptarget/TestOpenMPTarget_MDRange_a.cpp openmptarget/TestOpenMPTarget_MDRange_b.cpp @@ -151,28 +161,31 @@ if(Kokkos_ENABLE_OPENMPTARGET) openmptarget/TestOpenMPTarget_ViewAPI_e.cpp openmptarget/TestOpenMPTarget_ViewMapping_subview.cpp openmptarget/TestOpenMPTarget_ViewOfClass.cpp - ) -endif() -if(Kokkos_ENABLE_HIP) - # FIXME Linktime error: undefined reference to - # Kokkos::Impl::ViewDimensin<0ul, ...>(unsigned int, ...) - list(REMOVE_ITEM Serial_SOURCES serial/TestSerial_ViewLayoutStrideAssignment.cpp) + ) endif() if(Kokkos_ENABLE_SERIAL) KOKKOS_ADD_EXECUTABLE_AND_TEST( - UnitTest_Serial + UnitTest_Serial1 SOURCES - ${Serial_SOURCES} + UnitTestMainInit.cpp + ${Serial_SOURCES1} serial/TestSerial_Task.cpp ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_Serial2 + SOURCES + UnitTestMainInit.cpp + ${Serial_SOURCES2} + ) endif() if(Kokkos_ENABLE_PTHREAD) KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_Threads SOURCES ${Threads_SOURCES} + UnitTestMainInit.cpp ) endif() @@ -180,6 +193,7 @@ if(Kokkos_ENABLE_OPENMP) KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_OpenMP SOURCES + UnitTestMainInit.cpp ${OpenMP_SOURCES} openmp/TestOpenMP_Task.cpp ) @@ -195,6 +209,7 @@ if(Kokkos_ENABLE_HPX) KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_HPX SOURCES + UnitTestMainInit.cpp ${HPX_SOURCES} hpx/TestHPX_Task.cpp ) @@ -204,21 +219,60 @@ if(Kokkos_ENABLE_HPX) UnitTestMain.cpp hpx/TestHPX_InterOp.cpp ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_HPX_IndependentInstances + SOURCES + UnitTestMain.cpp + hpx/TestHPX_IndependentInstances.cpp + ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_HPX_IndependentInstancesDelayedExecution + SOURCES + UnitTestMain.cpp + hpx/TestHPX_IndependentInstancesDelayedExecution.cpp + ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_HPX_IndependentInstancesInstanceIds + SOURCES + UnitTestMain.cpp + hpx/TestHPX_IndependentInstancesInstanceIds.cpp + ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_HPX_IndependentInstancesRefCounting + SOURCES + UnitTestMain.cpp + hpx/TestHPX_IndependentInstancesRefCounting.cpp + ) endif() if(Kokkos_ENABLE_OPENMPTARGET) KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_OpenMPTarget SOURCES + UnitTestMainInit.cpp ${OpenMPTarget_SOURCES} ) endif() if(Kokkos_ENABLE_CUDA) - KOKKOS_ADD_EXECUTABLE_AND_TEST( - UnitTest_Cuda + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_Cuda1 SOURCES - ${Cuda_SOURCES} + UnitTestMainInit.cpp + ${Cuda_SOURCES1} + ) + + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_Cuda2 + SOURCES + UnitTestMainInit.cpp + ${Cuda_SOURCES2} + ) + + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_Cuda3 + SOURCES + UnitTestMainInit.cpp cuda/TestCuda_Task.cpp cuda/TestCudaHostPinned_SharedAlloc.cpp cuda/TestCudaHostPinned_ViewCopy.cpp @@ -244,6 +298,7 @@ if(Kokkos_ENABLE_CUDA) cuda/TestCuda_DebugSerialExecution.cpp cuda/TestCuda_DebugPinUVMSpace.cpp ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_CudaInterOpInit SOURCES @@ -262,25 +317,16 @@ if(Kokkos_ENABLE_HIP) # FIXME_HIP LIST(REMOVE_ITEM HIP_SOURCES hip/TestHIP_AtomicOperations_complexdouble.cpp - hip/TestHIP_Other.cpp - hip/TestHIP_Reductions_DeviceView.cpp - hip/TestHIP_Team.cpp - hip/TestHIP_TeamReductionScan.cpp - hip/TestHIP_TeamScratch.cpp hip/TestHIP_TeamTeamSize.cpp hip/TestHIP_TeamVectorRange.cpp - hip/TestHIP_UniqueToken.cpp - hip/TestHIP_ViewAPI_a.cpp - hip/TestHIP_ViewAPI_b.cpp - hip/TestHIP_ViewAPI_e.cpp - hip/TestHIP_ViewLayoutStrideAssignment.cpp - hip/TestHIP_WorkGraph.cpp ) KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_HIP SOURCES + UnitTestMainInit.cpp ${HIP_SOURCES} + hip/TestHIP_ScanUnit.cpp hip/TestHIPHostPinned_ViewAPI_a.cpp hip/TestHIPHostPinned_ViewAPI_b.cpp hip/TestHIPHostPinned_ViewAPI_c.cpp @@ -297,6 +343,12 @@ if(Kokkos_ENABLE_HIP) UnitTestMain.cpp hip/TestHIP_InterOp_Init.cpp ) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_HIPInterOpStreams + SOURCES + UnitTestMain.cpp + hip/TestHIP_InterOp_Streams.cpp + ) endif() SET(DEFAULT_DEVICE_SOURCES @@ -326,6 +378,15 @@ KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_PushFinalizeHook.cpp ) +# This test is intended for development and debugging by putting code +# into TestDefaultDeviceDevelop.cpp. By default its empty. +KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_Develop + SOURCES + UnitTestMainInit.cpp + default/TestDefaultDeviceDevelop.cpp +) + # This test is special, because it passes exactly when it prints the # message "PASSED: I am the custom std::terminate handler.", AND calls # std::terminate. This means that we can't use @@ -344,6 +405,36 @@ KOKKOS_ADD_ADVANCED_TEST( UnitTest_PushFinalizeHook_terminate ALWAYS_FAIL_ON_ZERO_RETURN ) + if(KOKKOS_ENABLE_TUNING) + KOKKOS_ADD_EXECUTABLE_AND_TEST( + UnitTest_TuningBasics + SOURCES + tools/TestTuning.cpp + ) + endif() + if(KOKKOS_ENABLE_LIBDL) + + KOKKOS_ADD_LIBRARY( + printer-tool SHARED + SOURCES tools/printing-tool.cpp + ) + + KOKKOS_ADD_TEST_EXECUTABLE( + ProfilingAllCalls + tools/TestAllCalls.cpp + ) + + set(ADDRESS_REGEX "0x[0-9a-f]*") + set(MEMSPACE_REGEX "[HC][ou][sd][ta][a-zA-Z]*") + set(SIZE_REGEX "[0-9]*") + set(SKIP_SCRATCH_INITIALIZATION_REGEX ".*") + + KOKKOS_ADD_TEST( NAME ProfilingTestLibraryLoad + EXE ProfilingAllCalls + TOOL printer-tool + PASS_REGULAR_EXPRESSION "kokkosp_init_library::kokkosp_allocate_data:${MEMSPACE_REGEX}:source:${ADDRESS_REGEX}:40::kokkosp_begin_parallel_for:Kokkos::View::initialization [[]source]:0:0::kokkosp_end_parallel_for:0::kokkosp_allocate_data:${MEMSPACE_REGEX}:destination:${ADDRESS_REGEX}:40::kokkosp_begin_parallel_for:Kokkos::View::initialization [[]destination]:0:0::kokkosp_end_parallel_for:0::kokkosp_begin_deep_copy:${MEMSPACE_REGEX}:destination:${ADDRESS_REGEX}:${MEMSPACE_REGEX}:source:${ADDRESS_REGEX}:40::kokkosp_end_deep_copy::kokkosp_begin_parallel_for:parallel_for:${SIZE_REGEX}:0::kokkosp_end_parallel_for:0::kokkosp_begin_parallel_reduce:parallel_reduce:0:1${SKIP_SCRATCH_INITIALIZATION_REGEX}::kokkosp_end_parallel_reduce:1::kokkosp_begin_parallel_scan:parallel_scan:${SIZE_REGEX}:2::kokkosp_end_parallel_scan:2::kokkosp_push_profile_region:push_region::kokkosp_pop_profile_region::kokkosp_create_profile_section:created_section:3::kokkosp_start_profile_section:3::kokkosp_stop_profile_section:3::kokkosp_destroy_profile_section:3::kokkosp_profile_event:profiling_event::kokkosp_deallocate_data:${MEMSPACE_REGEX}:destination:${ADDRESS_REGEX}:40::kokkosp_deallocate_data:${MEMSPACE_REGEX}:source:${ADDRESS_REGEX}:40::kokkosp_finalize_library::" + ) + endif() #KOKKOS_ENABLE_LIBDL if(NOT KOKKOS_HAS_TRILINOS) KOKKOS_ADD_TEST_EXECUTABLE( StackTraceTestExec @@ -433,3 +524,5 @@ KOKKOS_ADD_EXECUTABLE_AND_TEST( UnitTest_CTestDevice SOURCES UnitTestMain.cpp TestCTestDevice.cpp ) + +add_subdirectory(headers_self_contained) diff --git a/lib/kokkos/core/unit_test/TestAggregate.hpp b/lib/kokkos/core/unit_test/TestAggregate.hpp index 1f812cc11e..3151143a6f 100644 --- a/lib/kokkos/core/unit_test/TestAggregate.hpp +++ b/lib/kokkos/core/unit_test/TestAggregate.hpp @@ -57,18 +57,18 @@ namespace Test { template void TestViewAggregate() { - typedef Kokkos::Array value_type; - typedef Kokkos::Impl::ViewDataAnalysis - analysis_1d; + using value_type = Kokkos::Array; + using analysis_1d = + Kokkos::Impl::ViewDataAnalysis; static_assert( std::is_same >::value, ""); - typedef Kokkos::ViewTraits a32_traits; - typedef Kokkos::ViewTraits - flat_traits; + using a32_traits = Kokkos::ViewTraits; + using flat_traits = + Kokkos::ViewTraits; static_assert( std::is_same >::value, @@ -84,8 +84,8 @@ void TestViewAggregate() { static_assert(flat_traits::rank_dynamic == 2, ""); static_assert(flat_traits::dimension::N2 == 32, ""); - typedef Kokkos::View **, DeviceType> a32_type; - typedef typename a32_type::array_type a32_flat_type; + using a32_type = Kokkos::View **, DeviceType>; + using a32_flat_type = typename a32_type::array_type; static_assert(std::is_same::value, ""); diff --git a/lib/kokkos/core/unit_test/TestAtomic.hpp b/lib/kokkos/core/unit_test/TestAtomic.hpp index 809f9dc01f..1051ae20f6 100644 --- a/lib/kokkos/core/unit_test/TestAtomic.hpp +++ b/lib/kokkos/core/unit_test/TestAtomic.hpp @@ -160,9 +160,9 @@ std::ostream& operator<<(std::ostream& os, const SuperScalar& dt) { template struct ZeroFunctor { - typedef DEVICE_TYPE execution_space; - typedef typename Kokkos::View type; - typedef typename Kokkos::View::HostMirror h_type; + using execution_space = DEVICE_TYPE; + using type = typename Kokkos::View; + using h_type = typename Kokkos::View::HostMirror; type data; @@ -176,8 +176,8 @@ struct ZeroFunctor { template struct AddFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; @@ -187,8 +187,8 @@ struct AddFunctor { template struct AddFunctorReduce { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; @@ -246,8 +246,8 @@ T AddLoopSerial(int loop) { template struct CASFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; @@ -266,8 +266,8 @@ struct CASFunctor { template struct CASFunctorReduce { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; @@ -341,8 +341,8 @@ T CASLoopSerial(int loop) { template struct ExchFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data, data2; @@ -355,8 +355,8 @@ struct ExchFunctor { template struct ExchFunctorReduce { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data, data2; diff --git a/lib/kokkos/core/unit_test/TestAtomicOperations.hpp b/lib/kokkos/core/unit_test/TestAtomicOperations.hpp index 109adaa1b3..04362125c0 100644 --- a/lib/kokkos/core/unit_test/TestAtomicOperations.hpp +++ b/lib/kokkos/core/unit_test/TestAtomicOperations.hpp @@ -52,9 +52,9 @@ namespace TestAtomicOperations { template struct ZeroFunctor { - typedef DEVICE_TYPE execution_space; - typedef typename Kokkos::View type; - typedef typename Kokkos::View::HostMirror h_type; + using execution_space = DEVICE_TYPE; + using type = typename Kokkos::View; + using h_type = typename Kokkos::View::HostMirror; type data; @@ -68,9 +68,9 @@ struct ZeroFunctor { template struct InitFunctor { - typedef DEVICE_TYPE execution_space; - typedef typename Kokkos::View type; - typedef typename Kokkos::View::HostMirror h_type; + using execution_space = DEVICE_TYPE; + using type = typename Kokkos::View; + using h_type = typename Kokkos::View::HostMirror; type data; T init_value; @@ -87,8 +87,8 @@ struct InitFunctor { template struct MaxFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -160,8 +160,8 @@ bool MaxAtomicTest(T i0, T i1) { template struct MinFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -231,8 +231,8 @@ bool MinAtomicTest(T i0, T i1) { template struct IncFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -301,8 +301,8 @@ bool IncAtomicTest(T i0) { template struct DecFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -371,8 +371,8 @@ bool DecAtomicTest(T i0) { template struct MulFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -442,8 +442,8 @@ bool MulAtomicTest(T i0, T i1) { template struct DivFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -515,8 +515,8 @@ bool DivAtomicTest(T i0, T i1) { template struct ModFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -586,8 +586,8 @@ bool ModAtomicTest(T i0, T i1) { template struct AndFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -657,8 +657,8 @@ bool AndAtomicTest(T i0, T i1) { template struct OrFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -728,8 +728,8 @@ bool OrAtomicTest(T i0, T i1) { template struct XorFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -799,8 +799,8 @@ bool XorAtomicTest(T i0, T i1) { template struct LShiftFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; @@ -870,8 +870,8 @@ bool LShiftAtomicTest(T i0, T i1) { template struct RShiftFunctor { - typedef DEVICE_TYPE execution_space; - typedef Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = Kokkos::View; type data; T i0; diff --git a/lib/kokkos/core/unit_test/TestAtomicViews.hpp b/lib/kokkos/core/unit_test/TestAtomicViews.hpp index 109598e8c6..6b79b3d642 100644 --- a/lib/kokkos/core/unit_test/TestAtomicViews.hpp +++ b/lib/kokkos/core/unit_test/TestAtomicViews.hpp @@ -66,11 +66,11 @@ struct TestViewOperator_LeftAndRight; template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type& update, @@ -81,17 +81,16 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type& update) { update = 0; } - typedef Kokkos::View > - left_view; + using left_view = Kokkos::View >; - typedef Kokkos::View > - right_view; + using right_view = + Kokkos::View >; - typedef Kokkos::View > - stride_view; + using stride_view = + Kokkos::View >; left_view left; right_view right; @@ -123,21 +122,12 @@ struct TestViewOperator_LeftAndRight { for (unsigned i0 = 0; i0 < unsigned(left.extent(0)); ++i0) { // Below checks that values match, but unable to check the references. // Should this be able to be checked? -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (left(i0) != left(i0, 0, 0, 0, 0, 0, 0, 0)) { - update |= 3; - } - if (right(i0) != right(i0, 0, 0, 0, 0, 0, 0, 0)) { - update |= 3; - } -#else if (left(i0) != left.access(i0, 0, 0, 0, 0, 0, 0, 0)) { update |= 3; } if (right(i0) != right.access(i0, 0, 0, 0, 0, 0, 0, 0)) { update |= 3; } -#endif if (left(i0) != left_stride(i0)) { update |= 4; } @@ -157,39 +147,36 @@ struct TestViewOperator_LeftAndRight { template class TestAtomicViewAPI { public: - typedef DeviceType device; + using device = DeviceType; enum { N0 = 1000, N1 = 3, N2 = 5, N3 = 7 }; - typedef Kokkos::View dView0; - typedef Kokkos::View dView1; - typedef Kokkos::View dView2; - typedef Kokkos::View dView3; - typedef Kokkos::View dView4; - typedef Kokkos::View const_dView4; - typedef Kokkos::View dView4_unmanaged; - typedef typename dView0::host_mirror_space host; + using dView0 = Kokkos::View; + using dView1 = Kokkos::View; + using dView2 = Kokkos::View; + using dView3 = Kokkos::View; + using dView4 = Kokkos::View; + using const_dView4 = Kokkos::View; + using dView4_unmanaged = Kokkos::View; + using host = typename dView0::host_mirror_space; - typedef Kokkos::View > aView0; - typedef Kokkos::View > - aView1; - typedef Kokkos::View > - aView2; - typedef Kokkos::View > - aView3; - typedef Kokkos::View > - aView4; - typedef Kokkos::View > - const_aView4; + using aView0 = Kokkos::View >; + using aView1 = + Kokkos::View >; + using aView2 = + Kokkos::View >; + using aView3 = + Kokkos::View >; + using aView4 = Kokkos::View >; + using const_aView4 = Kokkos::View >; - typedef Kokkos::View< - T****, device, Kokkos::MemoryTraits > - aView4_unmanaged; + using aView4_unmanaged = + Kokkos::View >; - typedef typename aView0::host_mirror_space host_atomic; + using host_atomic = typename aView0::host_mirror_space; TestAtomicViewAPI() { TestViewOperator_LeftAndRight::testit(); @@ -281,7 +268,7 @@ class TestAtomicViewAPI { unsigned(N0) * unsigned(N1) * unsigned(N2) * unsigned(N3)); } - typedef T DataType[2]; + using DataType = T[2]; static void check_auto_conversion_to_const( const Kokkos::View > - typeX; - typedef Kokkos::View > - const_typeX; + using typeX = + Kokkos::View >; + using const_typeX = Kokkos::View >; typeX x("X"); const_typeX xc = x; @@ -315,7 +300,7 @@ class TestAtomicViewAPI { template struct InitFunctor_Seq { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type input; const int64_t length; @@ -333,7 +318,7 @@ struct InitFunctor_Seq { template struct InitFunctor_ModTimes { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type input; const int64_t length; @@ -357,7 +342,7 @@ struct InitFunctor_ModTimes { template struct InitFunctor_ModShift { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type input; const int64_t length; @@ -383,10 +368,9 @@ struct InitFunctor_ModShift { template struct PlusEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; view_type input; atomic_view_type even_odd_result; @@ -411,8 +395,8 @@ struct PlusEqualAtomicViewFunctor { template T PlusEqualAtomicView(const int64_t input_length) { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; const int64_t length = input_length; @@ -480,10 +464,9 @@ bool PlusEqualAtomicViewTest(int64_t input_length) { template struct MinusEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; view_type input; atomic_view_type even_odd_result; @@ -509,8 +492,8 @@ struct MinusEqualAtomicViewFunctor { template T MinusEqualAtomicView(const int64_t input_length) { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; const int64_t length = input_length; @@ -578,10 +561,9 @@ bool MinusEqualAtomicViewTest(int64_t input_length) { template struct TimesEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; view_type input; atomic_view_type result; @@ -602,8 +584,8 @@ struct TimesEqualAtomicViewFunctor { template T TimesEqualAtomicView(const int64_t input_length, const int64_t remainder) { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; const int64_t length = input_length; @@ -669,11 +651,10 @@ bool TimesEqualAtomicViewTest(const int64_t input_length) { template struct DivEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; - typedef Kokkos::View scalar_view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; + using scalar_view_type = Kokkos::View; view_type input; atomic_view_type result; @@ -694,9 +675,9 @@ struct DivEqualAtomicViewFunctor { template T DivEqualAtomicView(const int64_t input_length, const int64_t remainder) { - typedef Kokkos::View view_type; - typedef Kokkos::View scalar_view_type; - typedef typename scalar_view_type::HostMirror host_scalar_view_type; + using view_type = Kokkos::View; + using scalar_view_type = Kokkos::View; + using host_scalar_view_type = typename scalar_view_type::HostMirror; const int64_t length = input_length; @@ -760,11 +741,10 @@ bool DivEqualAtomicViewTest(const int64_t input_length) { template struct ModEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; - typedef Kokkos::View scalar_view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; + using scalar_view_type = Kokkos::View; view_type input; atomic_view_type result; @@ -785,9 +765,9 @@ struct ModEqualAtomicViewFunctor { template T ModEqualAtomicView(const int64_t input_length, const int64_t remainder) { - typedef Kokkos::View view_type; - typedef Kokkos::View scalar_view_type; - typedef typename scalar_view_type::HostMirror host_scalar_view_type; + using view_type = Kokkos::View; + using scalar_view_type = Kokkos::View; + using host_scalar_view_type = typename scalar_view_type::HostMirror; const int64_t length = input_length; @@ -855,11 +835,10 @@ bool ModEqualAtomicViewTest(const int64_t input_length) { template struct RSEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; - typedef Kokkos::View result_view_type; + using atomic_view_type = Kokkos::View >; + using view_type = Kokkos::View; + using result_view_type = Kokkos::View; const view_type input; atomic_view_type result; @@ -890,9 +869,9 @@ struct RSEqualAtomicViewFunctor { template T RSEqualAtomicView(const int64_t input_length, const int64_t value, const int64_t remainder) { - typedef Kokkos::View view_type; - typedef Kokkos::View result_view_type; - typedef typename result_view_type::HostMirror host_scalar_view_type; + using view_type = Kokkos::View; + using result_view_type = Kokkos::View; + using host_scalar_view_type = typename result_view_type::HostMirror; const int64_t length = input_length; @@ -983,11 +962,10 @@ bool RSEqualAtomicViewTest(const int64_t input_length) { template struct LSEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; - typedef Kokkos::View result_view_type; + using atomic_view_type = Kokkos::View >; + using view_type = Kokkos::View; + using result_view_type = Kokkos::View; view_type input; atomic_view_type result; @@ -1018,9 +996,9 @@ struct LSEqualAtomicViewFunctor { template T LSEqualAtomicView(const int64_t input_length, const int64_t value, const int64_t remainder) { - typedef Kokkos::View view_type; - typedef Kokkos::View result_view_type; - typedef typename result_view_type::HostMirror host_scalar_view_type; + using view_type = Kokkos::View; + using result_view_type = Kokkos::View; + using host_scalar_view_type = typename result_view_type::HostMirror; const int64_t length = input_length; @@ -1111,10 +1089,9 @@ bool LSEqualAtomicViewTest(const int64_t input_length) { template struct AndEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; view_type input; atomic_view_type even_odd_result; @@ -1139,8 +1116,8 @@ struct AndEqualAtomicViewFunctor { template T AndEqualAtomicView(const int64_t input_length) { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; const int64_t length = input_length; @@ -1205,10 +1182,9 @@ bool AndEqualAtomicViewTest(int64_t input_length) { template struct OrEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; view_type input; atomic_view_type even_odd_result; @@ -1233,8 +1209,8 @@ struct OrEqualAtomicViewFunctor { template T OrEqualAtomicView(const int64_t input_length) { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; const int64_t length = input_length; @@ -1298,10 +1274,9 @@ bool OrEqualAtomicViewTest(int64_t input_length) { template struct XOrEqualAtomicViewFunctor { - typedef Kokkos::View > - atomic_view_type; - typedef Kokkos::View view_type; + using atomic_view_type = + Kokkos::View >; + using view_type = Kokkos::View; view_type input; atomic_view_type even_odd_result; @@ -1326,8 +1301,8 @@ struct XOrEqualAtomicViewFunctor { template T XOrEqualAtomicView(const int64_t input_length) { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror host_view_type; + using view_type = Kokkos::View; + using host_view_type = typename view_type::HostMirror; const int64_t length = input_length; diff --git a/lib/kokkos/core/unit_test/TestCXX11.hpp b/lib/kokkos/core/unit_test/TestCXX11.hpp index 405652b29e..59a8610955 100644 --- a/lib/kokkos/core/unit_test/TestCXX11.hpp +++ b/lib/kokkos/core/unit_test/TestCXX11.hpp @@ -48,9 +48,9 @@ namespace TestCXX11 { template struct FunctorAddTest { - typedef Kokkos::View view_type; - typedef DeviceType execution_space; - typedef typename Kokkos::TeamPolicy::member_type team_member; + using view_type = Kokkos::View; + using execution_space = DeviceType; + using team_member = typename Kokkos::TeamPolicy::member_type; view_type a_, b_; @@ -81,7 +81,7 @@ struct FunctorAddTest { template double AddTestFunctor() { - typedef Kokkos::TeamPolicy policy_type; + using policy_type = Kokkos::TeamPolicy; Kokkos::View a("A", 100, 5); Kokkos::View b("B", 100, 5); @@ -142,8 +142,8 @@ double AddTestLambda() { b(i, 4) = a(i, 3) + a(i, 4); }); } else { - typedef Kokkos::TeamPolicy policy_type; - typedef typename policy_type::member_type team_member; + using policy_type = Kokkos::TeamPolicy; + using team_member = typename policy_type::member_type; policy_type policy(25, Kokkos::AUTO); @@ -180,10 +180,10 @@ double AddTestLambda() { template struct FunctorReduceTest { - typedef Kokkos::View view_type; - typedef DeviceType execution_space; - typedef double value_type; - typedef typename Kokkos::TeamPolicy::member_type team_member; + using view_type = Kokkos::View; + using execution_space = DeviceType; + using value_type = double; + using team_member = typename Kokkos::TeamPolicy::member_type; view_type a_; @@ -223,10 +223,10 @@ struct FunctorReduceTest { template double ReduceTestFunctor() { - typedef Kokkos::TeamPolicy policy_type; - typedef Kokkos::View view_type; - typedef Kokkos::View - unmanaged_result; + using policy_type = Kokkos::TeamPolicy; + using view_type = Kokkos::View; + using unmanaged_result = + Kokkos::View; view_type a("A", 100, 5); typename view_type::HostMirror h_a = Kokkos::create_mirror_view(a); @@ -255,10 +255,10 @@ double ReduceTestFunctor() { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) template double ReduceTestLambda() { - typedef Kokkos::TeamPolicy policy_type; - typedef Kokkos::View view_type; - typedef Kokkos::View - unmanaged_result; + using policy_type = Kokkos::TeamPolicy; + using view_type = Kokkos::View; + using unmanaged_result = + Kokkos::View; view_type a("A", 100, 5); typename view_type::HostMirror h_a = Kokkos::create_mirror_view(a); @@ -284,7 +284,7 @@ double ReduceTestLambda() { }, unmanaged_result(&result)); } else { - typedef typename policy_type::member_type team_member; + using team_member = typename policy_type::member_type; Kokkos::parallel_reduce( policy_type(25, Kokkos::AUTO), KOKKOS_LAMBDA(const team_member& dev, double& sum) { diff --git a/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp b/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp index 0e60d91a89..c7efab2711 100644 --- a/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp +++ b/lib/kokkos/core/unit_test/TestCXX11Deduction.hpp @@ -72,7 +72,7 @@ struct TestReductionDeductionFunctor { template void test_reduction_deduction() { - typedef TestReductionDeductionFunctor Functor; + using Functor = TestReductionDeductionFunctor; const long N = 50; // const long answer = N % 2 ? ( N * ( ( N + 1 ) / 2 ) ) : ( ( N / 2 ) * ( N diff --git a/lib/kokkos/core/unit_test/TestCompilerMacros.hpp b/lib/kokkos/core/unit_test/TestCompilerMacros.hpp index c644daca0e..5ba83f376b 100644 --- a/lib/kokkos/core/unit_test/TestCompilerMacros.hpp +++ b/lib/kokkos/core/unit_test/TestCompilerMacros.hpp @@ -60,8 +60,8 @@ namespace TestCompilerMacros { template struct AddFunctor { - typedef DEVICE_TYPE execution_space; - typedef typename Kokkos::View type; + using execution_space = DEVICE_TYPE; + using type = typename Kokkos::View; type a, b; int length; @@ -94,7 +94,7 @@ struct AddFunctor { template bool Test() { - typedef typename Kokkos::View type; + using type = typename Kokkos::View; type a("A", 1024, 128); type b("B", 1024, 128); diff --git a/lib/kokkos/core/unit_test/TestComplex.hpp b/lib/kokkos/core/unit_test/TestComplex.hpp index 2bb81052fe..2e04c209d8 100644 --- a/lib/kokkos/core/unit_test/TestComplex.hpp +++ b/lib/kokkos/core/unit_test/TestComplex.hpp @@ -86,7 +86,6 @@ struct TestComplexConstruction { // Copy construction conversion between // Kokkos::complex and std::complex doesn't compile -#ifndef KOKKOS_ENABLE_HIP // FIXME_HIP Kokkos::complex a(1.5, 2.5), b(3.25, 5.25), r_kk; std::complex sa(a), sb(3.25, 5.25), r; r = a; @@ -101,7 +100,6 @@ struct TestComplexConstruction { r_kk = a; ASSERT_FLOAT_EQ(r.real(), r_kk.real()); ASSERT_FLOAT_EQ(r.imag(), r_kk.imag()); -#endif } KOKKOS_INLINE_FUNCTION diff --git a/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp b/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp index db451495b4..5a7b8e4bae 100644 --- a/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp +++ b/lib/kokkos/core/unit_test/TestConcurrentBitset.hpp @@ -57,8 +57,8 @@ namespace Test { template struct ConcurrentBitset { - typedef Kokkos::View view_unsigned_type; - typedef Kokkos::View view_int_type; + using view_unsigned_type = Kokkos::View; + using view_int_type = Kokkos::View; view_unsigned_type bitset; view_int_type acquired; @@ -117,9 +117,9 @@ struct ConcurrentBitset { template void test_concurrent_bitset(int bit_count) { - typedef ConcurrentBitset Functor; - typedef typename Functor::view_unsigned_type view_unsigned_type; - typedef typename Functor::view_int_type view_int_type; + using Functor = ConcurrentBitset; + using view_unsigned_type = typename Functor::view_unsigned_type; + using view_int_type = typename Functor::view_int_type; int bit_count_lg2 = 1; diff --git a/lib/kokkos/core/unit_test/TestCrs.hpp b/lib/kokkos/core/unit_test/TestCrs.hpp index 296235aad0..78208c9116 100644 --- a/lib/kokkos/core/unit_test/TestCrs.hpp +++ b/lib/kokkos/core/unit_test/TestCrs.hpp @@ -176,7 +176,7 @@ void test_count_fill(std::int32_t nrows) { template void test_constructor(std::int32_t nrows) { for (int nTest = 1; nTest < 5; nTest++) { - typedef Kokkos::Crs crs_type; + using crs_type = Kokkos::Crs; crs_type graph; Kokkos::count_and_fill_crs(graph, nrows, CountFillFunctor()); ASSERT_EQ(graph.numRows(), nrows); diff --git a/lib/kokkos/core/unit_test/TestDeepCopy.hpp b/lib/kokkos/core/unit_test/TestDeepCopy.hpp index 56c259ff6a..8158f40580 100644 --- a/lib/kokkos/core/unit_test/TestDeepCopy.hpp +++ b/lib/kokkos/core/unit_test/TestDeepCopy.hpp @@ -6,13 +6,13 @@ namespace Test { namespace Impl { template struct TestDeepCopy { - typedef Kokkos::View a_base_t; - typedef Kokkos::View b_base_t; - typedef Kokkos::View a_char_t; - typedef Kokkos::View b_char_t; + using a_base_t = Kokkos::View; + using b_base_t = Kokkos::View; + using a_char_t = Kokkos::View; + using b_char_t = Kokkos::View; - typedef Kokkos::RangePolicy policyA_t; - typedef Kokkos::RangePolicy policyB_t; + using policyA_t = Kokkos::RangePolicy; + using policyB_t = Kokkos::RangePolicy; static void reset_a_copy_and_b( Kokkos::View a_char_copy, @@ -213,8 +213,6 @@ TEST(TEST_CATEGORY, deep_copy_alignment) { } #endif -// KOKKOS_IMPL_HIP_CLANG_WORKAROUND -#ifndef KOKKOS_ENABLE_HIP namespace Impl { template struct TestDeepCopyScalarConversion { @@ -355,5 +353,4 @@ TEST(TEST_CATEGORY, deep_copy_conversion) { Impl::TestDeepCopyScalarConversion().run_tests( N0, N1); } -#endif } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp b/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp index 33c736c5e0..2704cd7a71 100644 --- a/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp +++ b/lib/kokkos/core/unit_test/TestDefaultDeviceTypeInit.hpp @@ -117,7 +117,7 @@ char** init_kokkos_args(bool do_threads, bool do_numa, bool do_device, if (do_device) { init_args.device_id = 0; - sprintf(args_kokkos[device_idx], "--device=%i", 0); + sprintf(args_kokkos[device_idx], "--device-id=%i", 0); } if (do_other) { @@ -186,13 +186,8 @@ Kokkos::InitArguments init_initstruct(bool do_threads, bool do_numa, } void check_correct_initialization(const Kokkos::InitArguments& argstruct) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(Kokkos::DefaultExecutionSpace::is_initialized(), 1); - ASSERT_EQ(Kokkos::HostSpace::execution_space::is_initialized(), 1); -#else ASSERT_EQ(Kokkos::DefaultExecutionSpace::impl_is_initialized(), 1); ASSERT_EQ(Kokkos::HostSpace::execution_space::impl_is_initialized(), 1); -#endif // Figure out the number of threads the HostSpace ExecutionSpace should have // initialized to. @@ -258,13 +253,8 @@ void check_correct_initialization(const Kokkos::InitArguments& argstruct) { #endif } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(Kokkos::HostSpace::execution_space::thread_pool_size(), - expected_nthreads); -#else ASSERT_EQ(Kokkos::HostSpace::execution_space::impl_thread_pool_size(), expected_nthreads); -#endif #ifdef KOKKOS_ENABLE_CUDA if (std::is_same::value) { @@ -273,7 +263,7 @@ void check_correct_initialization(const Kokkos::InitArguments& argstruct) { int expected_device = argstruct.device_id; if (argstruct.device_id < 0) { - expected_device = 0; + expected_device = Kokkos::Cuda().cuda_device(); } ASSERT_EQ(expected_device, device); diff --git a/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp b/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp index 5e72972bed..d9e2486a4a 100644 --- a/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp +++ b/lib/kokkos/core/unit_test/TestFunctorAnalysis.hpp @@ -70,12 +70,12 @@ template void test_functor_analysis() { //------------------------------ auto c01 = KOKKOS_LAMBDA(int){}; - typedef Kokkos::Impl::FunctorAnalysis< - Kokkos::Impl::FunctorPatternInterface::FOR, - Kokkos::RangePolicy, decltype(c01)> - A01; + using A01 = + Kokkos::Impl::FunctorAnalysis, + decltype(c01)>; - typedef typename A01::template Reducer R01; + using R01 = typename A01::template Reducer; static_assert(std::is_same::value, ""); static_assert(std::is_same::value, ""); @@ -90,12 +90,11 @@ void test_functor_analysis() { ASSERT_EQ(R01(&c01).length(), 0); //------------------------------ - auto c02 = KOKKOS_LAMBDA(int, double&){}; - typedef Kokkos::Impl::FunctorAnalysis< + auto c02 = KOKKOS_LAMBDA(int, double&){}; + using A02 = Kokkos::Impl::FunctorAnalysis< Kokkos::Impl::FunctorPatternInterface::REDUCE, - Kokkos::RangePolicy, decltype(c02)> - A02; - typedef typename A02::template Reducer R02; + Kokkos::RangePolicy, decltype(c02)>; + using R02 = typename A02::template Reducer; static_assert(std::is_same::value, ""); static_assert(std::is_same::value, ""); @@ -112,11 +111,10 @@ void test_functor_analysis() { //------------------------------ TestFunctorAnalysis_03 c03; - typedef Kokkos::Impl::FunctorAnalysis< + using A03 = Kokkos::Impl::FunctorAnalysis< Kokkos::Impl::FunctorPatternInterface::REDUCE, - Kokkos::RangePolicy, TestFunctorAnalysis_03> - A03; - typedef typename A03::template Reducer R03; + Kokkos::RangePolicy, TestFunctorAnalysis_03>; + using R03 = typename A03::template Reducer; static_assert(std::is_same::value, diff --git a/lib/kokkos/core/unit_test/TestIrregularLayout.hpp b/lib/kokkos/core/unit_test/TestIrregularLayout.hpp new file mode 100644 index 0000000000..7e37e14655 --- /dev/null +++ b/lib/kokkos/core/unit_test/TestIrregularLayout.hpp @@ -0,0 +1,264 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include +#include +#include +#include +#define OFFSET_LIST_MAX_SIZE 100 + +namespace Kokkos { + +struct LayoutSelective { + //! Tag this class as a kokkos array layout + using array_layout = LayoutSelective; + + size_t offset_list[OFFSET_LIST_MAX_SIZE]; + size_t list_size; + + enum { is_extent_constructible = false }; + + KOKKOS_INLINE_FUNCTION + LayoutSelective() { + for (int i = 0; i < OFFSET_LIST_MAX_SIZE; i++) { + offset_list[i] = i; + } + } + + KOKKOS_INLINE_FUNCTION + void assign(const size_t ol_[], const size_t size_) { + list_size = size_; + for (int i = 0; i < (int)list_size; i++) { + offset_list[i] = ol_[i]; + } + } + + KOKKOS_INLINE_FUNCTION + LayoutSelective(LayoutSelective const& rhs) { + assign(rhs.offset_list, rhs.list_size); + } + + KOKKOS_INLINE_FUNCTION + LayoutSelective(LayoutSelective&& rhs) { + assign(rhs.offset_list, rhs.list_size); + } + KOKKOS_INLINE_FUNCTION + LayoutSelective& operator=(LayoutSelective const& rhs) { + assign(rhs.offset_list, rhs.list_size); + return *this; + } + KOKKOS_INLINE_FUNCTION + LayoutSelective& operator=(LayoutSelective&& rhs) { + assign(rhs.offset_list, rhs.list_size); + return *this; + } + + KOKKOS_INLINE_FUNCTION + explicit LayoutSelective(const size_t ol_[], const size_t size_) { + assign(ol_, size_); + } + + KOKKOS_INLINE_FUNCTION + size_t offset(size_t ndx) const { + KOKKOS_ASSERT(ndx < list_size); + return offset_list[ndx]; + } +}; + +namespace Impl { +template +struct ViewOffset { + public: + using is_mapping_plugin = std::true_type; + using is_regular = std::false_type; + + using size_type = size_t; + using dimension_type = Dimension; + using array_layout = Kokkos::LayoutSelective; + + //---------------------------------------- + dimension_type m_dim; + array_layout m_selective; + + // rank 1 + template + KOKKOS_INLINE_FUNCTION size_type operator()(I0 const& i0) const { + return m_selective.offset(i0); + } + + // This ViewOffset and the underlying layout only supports rank 1 Views + + //---------------------------------------- + + KOKKOS_INLINE_FUNCTION + array_layout layout() const { return array_layout(); } + + KOKKOS_INLINE_FUNCTION constexpr size_type dimension_0() const { + return m_dim.N0; + } + + /* Cardinality of the domain index space */ + KOKKOS_INLINE_FUNCTION + constexpr size_type size() const { return m_dim.N0; } + + public: + /* Span of the range space, largest stride * dimension */ + KOKKOS_INLINE_FUNCTION + constexpr size_type span() const { return m_dim.N0; } + + KOKKOS_INLINE_FUNCTION constexpr bool span_is_contiguous() const { + return false; + } + + /* Strides of dimensions */ + KOKKOS_INLINE_FUNCTION constexpr size_type stride_0() const { return 1; } + + // Stride with [ rank ] value is the total length + template + KOKKOS_INLINE_FUNCTION void stride(iType* const s) const { + if (0 < dimension_type::rank) { + s[0] = 1; + } + for (int i = 1; i < 8; i++) s[i] = 0; + s[dimension_type::rank] = span(); + } + + //---------------------------------------- + ViewOffset() = default; + ViewOffset(const ViewOffset&) = default; + ViewOffset& operator=(const ViewOffset&) = default; + + KOKKOS_INLINE_FUNCTION + ViewOffset(std::integral_constant const&, + Kokkos::LayoutSelective const& rhs) + : m_dim(rhs.list_size, 0, 0, 0, 0, 0, 0, 0), m_selective(rhs) {} +}; + +} // namespace Impl +} // namespace Kokkos + +namespace Test { + +class InnerClass { + public: + long data[100]; + + KOKKOS_INLINE_FUNCTION + InnerClass() { + for (int i = 0; i < 100; i++) { + data[i] = (long)i; + } + } + + KOKKOS_INLINE_FUNCTION + void update(long d) { + for (int i = 0; i < 100; i++) { + data[i] += d; + } + } + + KOKKOS_INLINE_FUNCTION + void set(long d) { + for (int i = 0; i < 100; i++) { + data[i] = d; + } + } +}; + +template +struct TestLayout { + const int N = 100; + size_t offsets[2] = {20, 40}; + using Layout = Kokkos::LayoutRight; + using SubLayout = Kokkos::LayoutSelective; + + // Allocate y, x vectors and Matrix A on device. + using ViewVectorType = + Kokkos::View; + using SubViewVectorType = Kokkos::View; + struct InitTag {}; + struct UpdateTag {}; + + ViewVectorType a; + SubLayout sl; + SubViewVectorType b; + TestLayout() : a("a", N), sl(offsets, 2), b(a.data(), sl) {} + + void run_test() { + Kokkos::parallel_for(Kokkos::RangePolicy(0, N), + *this); + + Kokkos::parallel_for(Kokkos::RangePolicy(0, 2), + *this); + + validate_results(); + } + + // set all values + KOKKOS_INLINE_FUNCTION + void operator()(const InitTag&, const int i) const { a(i).update(i); } + + // update selective values + KOKKOS_INLINE_FUNCTION + void operator()(const UpdateTag&, const int i) const { + b(i).set(200 * (i + 1)); + } + + void validate_results() { + auto a_h = Kokkos::create_mirror_view(a); + Kokkos::deep_copy(a_h, a); + ASSERT_EQ(a_h(20).data[0], 200); + ASSERT_EQ(a_h(40).data[0], 400); + } +}; + +TEST(TEST_CATEGORY, view_irregular_layout) { + TestLayout tl; + tl.run_test(); +} + +} // namespace Test diff --git a/lib/kokkos/core/unit_test/TestLocalDeepCopy.hpp b/lib/kokkos/core/unit_test/TestLocalDeepCopy.hpp index c776481c70..80feb11f9b 100644 --- a/lib/kokkos/core/unit_test/TestLocalDeepCopy.hpp +++ b/lib/kokkos/core/unit_test/TestLocalDeepCopy.hpp @@ -68,8 +68,8 @@ void impl_test_local_deepcopy_teampolicy_rank_1(const int N) { Kokkos::subview(A, 1, 1, 1, 1, 1, 1, Kokkos::ALL(), Kokkos::ALL()); Kokkos::deep_copy(subA, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -130,8 +130,8 @@ void impl_test_local_deepcopy_teampolicy_rank_2(const int N) { Kokkos::ALL()); Kokkos::deep_copy(subA, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -195,8 +195,8 @@ void impl_test_local_deepcopy_teampolicy_rank_3(const int N) { Kokkos::ALL(), Kokkos::ALL()); Kokkos::deep_copy(subA, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -260,8 +260,8 @@ void impl_test_local_deepcopy_teampolicy_rank_4(const int N) { Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); Kokkos::deep_copy(subA, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -329,8 +329,8 @@ void impl_test_local_deepcopy_teampolicy_rank_5(const int N) { Kokkos::ALL(), Kokkos::ALL(), Kokkos::ALL()); Kokkos::deep_copy(subA, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -398,8 +398,8 @@ void impl_test_local_deepcopy_teampolicy_rank_6(const int N) { Kokkos::ALL()); Kokkos::deep_copy(subA, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -464,8 +464,8 @@ void impl_test_local_deepcopy_teampolicy_rank_7(const int N) { // Initialize A matrix. Kokkos::deep_copy(A, 10.0); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Deep Copy Kokkos::parallel_for( @@ -935,8 +935,8 @@ void impl_test_local_deepcopy_rangepolicy_rank_7(const int N) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutleft) { - typedef TEST_EXECSPACE ExecSpace; - typedef Kokkos::View ViewType; + using ExecSpace = TEST_EXECSPACE; + using ViewType = Kokkos::View; { // Rank-1 impl_test_local_deepcopy_teampolicy_rank_1(8); @@ -962,8 +962,8 @@ TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutleft) { } //------------------------------------------------------------------------------------------------------------- TEST(TEST_CATEGORY, local_deepcopy_rangepolicy_layoutleft) { - typedef TEST_EXECSPACE ExecSpace; - typedef Kokkos::View ViewType; + using ExecSpace = TEST_EXECSPACE; + using ViewType = Kokkos::View; { // Rank-1 impl_test_local_deepcopy_rangepolicy_rank_1(8); @@ -989,8 +989,8 @@ TEST(TEST_CATEGORY, local_deepcopy_rangepolicy_layoutleft) { } //------------------------------------------------------------------------------------------------------------- TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutright) { - typedef TEST_EXECSPACE ExecSpace; - typedef Kokkos::View ViewType; + using ExecSpace = TEST_EXECSPACE; + using ViewType = Kokkos::View; { // Rank-1 impl_test_local_deepcopy_teampolicy_rank_1(8); @@ -1016,8 +1016,8 @@ TEST(TEST_CATEGORY, local_deepcopy_teampolicy_layoutright) { } //------------------------------------------------------------------------------------------------------------- TEST(TEST_CATEGORY, local_deepcopy_rangepolicy_layoutright) { - typedef TEST_EXECSPACE ExecSpace; - typedef Kokkos::View ViewType; + using ExecSpace = TEST_EXECSPACE; + using ViewType = Kokkos::View; { // Rank-1 impl_test_local_deepcopy_rangepolicy_rank_1(8); diff --git a/lib/kokkos/core/unit_test/TestMDRange.hpp b/lib/kokkos/core/unit_test/TestMDRange.hpp index c4288f21a1..ceb68b314e 100644 --- a/lib/kokkos/core/unit_test/TestMDRange.hpp +++ b/lib/kokkos/core/unit_test/TestMDRange.hpp @@ -103,14 +103,14 @@ struct TestMDRange_ReduceArray_2D { static void test_arrayreduce2(const int N0, const int N1) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type_init; - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type_init = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type_init range_init(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{3, 3}}); @@ -190,14 +190,14 @@ struct TestMDRange_ReduceArray_3D { static void test_arrayreduce3(const int N0, const int N1, const int N2) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type_init; - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type_init = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type_init range_init(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, @@ -257,11 +257,11 @@ struct TestMDRange_2D { static void test_reduce2(const int N0, const int N1) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{3, 3}}); @@ -277,11 +277,11 @@ struct TestMDRange_2D { #endif { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{3, 3}}); @@ -297,9 +297,9 @@ struct TestMDRange_2D { // Test with reducers - scalar { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; int s0 = 1; int s1 = 1; range_type range({{s0, s1}}, {{N0, N1}}, {{3, 3}}); @@ -317,9 +317,9 @@ struct TestMDRange_2D { } // Test with reducers - scalar + label { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; int s0 = 1; int s1 = 1; range_type range({{s0, s1}}, {{N0, N1}}, {{3, 3}}); @@ -337,9 +337,9 @@ struct TestMDRange_2D { } // Test with reducers - scalar view { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0}}, {{N0, N1}}, {{3, 3}}); TestMDRange_2D functor(N0, N1); @@ -360,9 +360,9 @@ struct TestMDRange_2D { // Test Min reducer with lambda #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{1, 1}}, {{N0, N1}}, {{3, 3}}); Kokkos::View v_in("v_in", N0, N1); @@ -387,12 +387,11 @@ struct TestMDRange_2D { #endif // Tagged operator test { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default>, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{2, 4}}); @@ -426,12 +425,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{2, 6}}); @@ -446,12 +444,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{2, 6}}); @@ -466,12 +463,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{2, 6}}); @@ -486,12 +482,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{2, 6}}); @@ -506,12 +501,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{2, 6}}); @@ -529,11 +523,11 @@ struct TestMDRange_2D { static void test_for2(const int N0, const int N1) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const int s0 = 1; const int s1 = 1; @@ -569,11 +563,11 @@ struct TestMDRange_2D { #endif { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const int s0 = 1; const int s1 = 1; @@ -605,11 +599,10 @@ struct TestMDRange_2D { } { - typedef - typename Kokkos::MDRangePolicy, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{3, 3}}); @@ -639,10 +632,9 @@ struct TestMDRange_2D { } { - typedef - typename Kokkos::MDRangePolicy, InitTag> - range_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, InitTag>; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}); TestMDRange_2D functor(N0, N1); @@ -671,11 +663,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{3, 3}}); @@ -702,12 +694,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{4, 4}}); @@ -734,12 +725,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{3, 3}}); @@ -766,12 +756,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{7, 7}}); @@ -798,12 +787,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{16, 16}}); @@ -830,12 +818,11 @@ struct TestMDRange_2D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<2, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0}}, point_type{{N0, N1}}, tile_type{{5, 16}}); @@ -904,11 +891,11 @@ struct TestMDRange_3D { static void test_reduce3(const int N0, const int N1, const int N2) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{3, 3, 3}}); @@ -923,11 +910,11 @@ struct TestMDRange_3D { #endif { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -946,9 +933,9 @@ struct TestMDRange_3D { // Test with reducers - scalar { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0}}, {{N0, N1, N2}}, {{3, 3, 3}}); TestMDRange_3D functor(N0, N1, N2); @@ -964,9 +951,9 @@ struct TestMDRange_3D { } // Test with reducers - scalar + label { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0}}, {{N0, N1, N2}}, {{3, 3, 3}}); TestMDRange_3D functor(N0, N1, N2); @@ -982,9 +969,9 @@ struct TestMDRange_3D { } // Test with reducers - scalar view { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0}}, {{N0, N1, N2}}, {{3, 3, 3}}); TestMDRange_3D functor(N0, N1, N2); @@ -1005,9 +992,9 @@ struct TestMDRange_3D { // Test Min reducer with lambda #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{1, 1, 1}}, {{N0, N1, N2}}, {{3, 3, 3}}); @@ -1040,12 +1027,11 @@ struct TestMDRange_3D { // Tagged operator test { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Default, Iterate::Default>, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 6}}); @@ -1080,12 +1066,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 6}}); @@ -1100,12 +1085,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 6}}); @@ -1120,12 +1104,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 6}}); @@ -1140,12 +1123,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 6}}); @@ -1160,12 +1142,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 6}}); @@ -1183,11 +1164,11 @@ struct TestMDRange_3D { static void test_for3(const int N0, const int N1, const int N2) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const int s0 = 1; const int s1 = 1; @@ -1227,9 +1208,9 @@ struct TestMDRange_3D { #endif { - typedef typename Kokkos::MDRangePolicy > - range_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy >; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}); TestMDRange_3D functor(N0, N1, N2); @@ -1257,11 +1238,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -1295,11 +1276,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{3, 3, 3}}); @@ -1328,12 +1309,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{3, 3, 3}}); @@ -1361,12 +1341,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 2}}); @@ -1394,12 +1373,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{3, 5, 7}}); @@ -1427,12 +1405,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{8, 8, 8}}); @@ -1460,12 +1437,11 @@ struct TestMDRange_3D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<3, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0}}, point_type{{N0, N1, N2}}, tile_type{{2, 4, 2}}); @@ -1537,11 +1513,11 @@ struct TestMDRange_4D { const int N3) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{3, 3, 3, 3}}); @@ -1556,11 +1532,11 @@ struct TestMDRange_4D { #endif { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -1580,9 +1556,9 @@ struct TestMDRange_4D { // Test with reducers - scalar { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0}}, {{N0, N1, N2, N3}}, {{3, 3, 3, 3}}); TestMDRange_4D functor(N0, N1, N2, N3); @@ -1599,9 +1575,9 @@ struct TestMDRange_4D { // Test with reducers - scalar + label { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0}}, {{N0, N1, N2, N3}}, {{3, 3, 3, 3}}); TestMDRange_4D functor(N0, N1, N2, N3); @@ -1618,9 +1594,9 @@ struct TestMDRange_4D { // Test with reducers - scalar view { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0}}, {{N0, N1, N2, N3}}, {{3, 3, 3, 3}}); TestMDRange_4D functor(N0, N1, N2, N3); @@ -1642,9 +1618,9 @@ struct TestMDRange_4D { // Test Min reducer with lambda #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{1, 1, 1, 1}}, {{N0, N1, N2, N3}}, {{3, 3, 3, 3}}); @@ -1672,12 +1648,11 @@ struct TestMDRange_4D { // Tagged operator test { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default>, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{2, 4, 6, 2}}); @@ -1714,12 +1689,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{2, 4, 6, 2}}); @@ -1734,12 +1708,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{2, 4, 6, 2}}); @@ -1754,12 +1727,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{2, 4, 6, 2}}); @@ -1774,12 +1746,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{2, 4, 6, 2}}); @@ -1794,12 +1765,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{2, 4, 6, 2}}); @@ -1818,11 +1788,11 @@ struct TestMDRange_4D { const int N3) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const int s0 = 1; const int s1 = 1; @@ -1863,9 +1833,9 @@ struct TestMDRange_4D { #endif { - typedef typename Kokkos::MDRangePolicy > - range_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy >; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}); TestMDRange_4D functor(N0, N1, N2, N3); @@ -1894,11 +1864,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -1934,11 +1904,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{4, 4, 4, 4}}); @@ -1968,12 +1938,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{4, 4, 4, 4}}); @@ -2003,12 +1972,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{4, 4, 4, 4}}); @@ -2038,12 +2006,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{4, 4, 4, 4}}); @@ -2073,12 +2040,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{4, 4, 4, 4}}); @@ -2108,12 +2074,11 @@ struct TestMDRange_4D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<4, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0}}, point_type{{N0, N1, N2, N3}}, tile_type{{4, 4, 4, 4}}); @@ -2188,11 +2153,11 @@ struct TestMDRange_5D { const int N3, const int N4) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2209,11 +2174,11 @@ struct TestMDRange_5D { #endif { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -2236,9 +2201,9 @@ struct TestMDRange_5D { // Test with reducers - scalar { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0, 0}}, {{N0, N1, N2, N3, N4}}, {{3, 3, 3, 3, 3}}); @@ -2256,9 +2221,9 @@ struct TestMDRange_5D { // Test with reducers - scalar + label { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0, 0}}, {{N0, N1, N2, N3, N4}}, {{3, 3, 3, 3, 3}}); @@ -2276,9 +2241,9 @@ struct TestMDRange_5D { // Test with reducers - scalar view { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0, 0}}, {{N0, N1, N2, N3, N4}}, {{3, 3, 3, 3, 3}}); @@ -2301,9 +2266,9 @@ struct TestMDRange_5D { // Test Min reducer with lambda #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{1, 1, 1, 1, 1}}, {{N0, N1, N2, N3, N4}}, {{3, 3, 3, 2, 2}}); @@ -2335,12 +2300,11 @@ struct TestMDRange_5D { // Tagged operator test { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Default, Iterate::Default>, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2383,11 +2347,11 @@ struct TestMDRange_5D { const int N4) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const int s0 = 1; const int s1 = 1; @@ -2432,9 +2396,9 @@ struct TestMDRange_5D { #endif { - typedef typename Kokkos::MDRangePolicy > - range_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy >; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}); @@ -2465,11 +2429,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -2508,11 +2472,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2544,12 +2508,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2581,12 +2544,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2618,12 +2580,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2655,12 +2616,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2692,12 +2652,11 @@ struct TestMDRange_5D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<5, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4}}, @@ -2775,11 +2734,11 @@ struct TestMDRange_6D { const int N3, const int N4, const int N5) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -2796,11 +2755,11 @@ struct TestMDRange_6D { #endif { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -2824,9 +2783,9 @@ struct TestMDRange_6D { // Test with reducers - scalar { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0, 0, 0}}, {{N0, N1, N2, N3, N4, N5}}, {{3, 3, 3, 3, 3, 2}}); @@ -2844,9 +2803,9 @@ struct TestMDRange_6D { // Test with reducers - scalar + label { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0, 0, 0}}, {{N0, N1, N2, N3, N4, N5}}, {{3, 3, 3, 3, 3, 2}}); @@ -2864,9 +2823,9 @@ struct TestMDRange_6D { // Test with reducers - scalar view { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{0, 0, 0, 0, 0, 0}}, {{N0, N1, N2, N3, N4, N5}}, {{3, 3, 3, 3, 3, 2}}); @@ -2889,9 +2848,9 @@ struct TestMDRange_6D { // Test Min reducer with lambda #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; range_type range({{1, 1, 1, 1, 1, 1}}, {{N0, N1, N2, N3, N4, N5}}, {{3, 3, 3, 2, 2, 1}}); @@ -2925,12 +2884,11 @@ struct TestMDRange_6D { // Tagged operator test { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Default, Iterate::Default>, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -2974,11 +2932,11 @@ struct TestMDRange_6D { const int N4, const int N5) { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const int s0 = 1; const int s1 = 1; @@ -3025,9 +2983,9 @@ struct TestMDRange_6D { #endif { - typedef typename Kokkos::MDRangePolicy > - range_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy >; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}); @@ -3059,11 +3017,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType, InitTag> - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType, InitTag>; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; int s0 = 1; int s1 = 1; @@ -3106,11 +3064,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -3143,12 +3101,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Default, Iterate::Default>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -3181,12 +3138,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Left, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -3219,12 +3175,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Left, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -3257,12 +3212,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Right, Iterate::Left>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -3295,12 +3249,11 @@ struct TestMDRange_6D { } { - typedef typename Kokkos::MDRangePolicy< + using range_type = typename Kokkos::MDRangePolicy< ExecSpace, Kokkos::Rank<6, Iterate::Right, Iterate::Right>, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; range_type range(point_type{{0, 0, 0, 0, 0, 0}}, point_type{{N0, N1, N2, N3, N4, N5}}, @@ -3366,11 +3319,11 @@ struct TestMDRange_2D_NegIdx { static void test_2D_negidx(const int N0, const int N1) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const point_type lower{{-1, -1}}; const point_type upper{{N0, N1}}; @@ -3428,11 +3381,11 @@ struct TestMDRange_3D_NegIdx { static void test_3D_negidx(const int N0, const int N1, const int N2) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const point_type lower{{-1, -1, -1}}; const point_type upper{{N0, N1, N2}}; @@ -3495,11 +3448,11 @@ struct TestMDRange_4D_NegIdx { static void test_4D_negidx(const int N0, const int N1, const int N2, const int N3) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const point_type lower{{-1, -1, -1, -1}}; const point_type upper{{N0, N1, N2, N3}}; @@ -3566,11 +3519,11 @@ struct TestMDRange_5D_NegIdx { static void test_5D_negidx(const int N0, const int N1, const int N2, const int N3, const int N4) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const point_type lower{{-1, -1, -1, -1, -1}}; const point_type upper{{N0, N1, N2, N3, N4}}; @@ -3643,11 +3596,11 @@ struct TestMDRange_6D_NegIdx { static void test_6D_negidx(const int N0, const int N1, const int N2, const int N3, const int N4, const int N5) { { - typedef typename Kokkos::MDRangePolicy, - Kokkos::IndexType > - range_type; - typedef typename range_type::tile_type tile_type; - typedef typename range_type::point_type point_type; + using range_type = + typename Kokkos::MDRangePolicy, + Kokkos::IndexType >; + using tile_type = typename range_type::tile_type; + using point_type = typename range_type::point_type; const point_type lower{{-1, -1, -1, -1, -1, -1}}; const point_type upper{{N0, N1, N2, N3, N4, N5}}; diff --git a/lib/kokkos/core/unit_test/TestMemoryPool.hpp b/lib/kokkos/core/unit_test/TestMemoryPool.hpp index cc18a90305..63895ad47d 100644 --- a/lib/kokkos/core/unit_test/TestMemoryPool.hpp +++ b/lib/kokkos/core/unit_test/TestMemoryPool.hpp @@ -56,8 +56,8 @@ namespace TestMemoryPool { template void test_host_memory_pool_defaults() { - typedef typename MemSpace::execution_space Space; - typedef typename Kokkos::MemoryPool MemPool; + using Space = typename MemSpace::execution_space; + using MemPool = typename Kokkos::MemoryPool; { const size_t MemoryCapacity = 32000; @@ -132,8 +132,8 @@ void test_host_memory_pool_defaults() { template void test_host_memory_pool_stats() { - typedef typename MemSpace::execution_space Space; - typedef typename Kokkos::MemoryPool MemPool; + using Space = typename MemSpace::execution_space; + using MemPool = typename Kokkos::MemoryPool; const size_t MemoryCapacity = 32000; const size_t MinBlockSize = 64; @@ -178,8 +178,8 @@ void test_host_memory_pool_stats() { template struct TestMemoryPool_Functor { - typedef Kokkos::View ptrs_type; - typedef Kokkos::MemoryPool pool_type; + using ptrs_type = Kokkos::View; + using pool_type = Kokkos::MemoryPool; pool_type pool; ptrs_type ptrs; @@ -268,15 +268,15 @@ void print_memory_pool_stats(typename PoolType::usage_statistics const& stats) { template void test_memory_pool_v2(const bool print_statistics, const bool print_superblocks) { - typedef typename DeviceType::memory_space memory_space; - typedef typename DeviceType::execution_space execution_space; - typedef Kokkos::MemoryPool pool_type; - typedef TestMemoryPool_Functor functor_type; + using memory_space = typename DeviceType::memory_space; + using execution_space = typename DeviceType::execution_space; + using pool_type = Kokkos::MemoryPool; + using functor_type = TestMemoryPool_Functor; - typedef typename functor_type::TagAlloc TagAlloc; - typedef typename functor_type::TagDealloc TagDealloc; - typedef typename functor_type::TagRealloc TagRealloc; - typedef typename functor_type::TagMixItUp TagMixItUp; + using TagAlloc = typename functor_type::TagAlloc; + using TagDealloc = typename functor_type::TagDealloc; + using TagRealloc = typename functor_type::TagRealloc; + using TagMixItUp = typename functor_type::TagMixItUp; const size_t total_alloc_size = 10000000; const unsigned min_block_size = 64; @@ -364,8 +364,8 @@ void test_memory_pool_v2(const bool print_statistics, template struct TestMemoryPoolCorners { - typedef Kokkos::View ptrs_type; - typedef Kokkos::MemoryPool pool_type; + using ptrs_type = Kokkos::View; + using pool_type = Kokkos::MemoryPool; pool_type pool; ptrs_type ptrs; @@ -407,11 +407,11 @@ struct TestMemoryPoolCorners { template void test_memory_pool_corners(const bool print_statistics, const bool print_superblocks) { - typedef typename DeviceType::memory_space memory_space; - typedef typename DeviceType::execution_space execution_space; - typedef Kokkos::MemoryPool pool_type; - typedef TestMemoryPoolCorners functor_type; - typedef typename functor_type::ptrs_type ptrs_type; + using memory_space = typename DeviceType::memory_space; + using execution_space = typename DeviceType::execution_space; + using pool_type = Kokkos::MemoryPool; + using functor_type = TestMemoryPoolCorners; + using ptrs_type = typename functor_type::ptrs_type; { // superblock size 1 << 14 @@ -491,9 +491,9 @@ struct TestMemoryPoolHuge< DeviceType, typename std::enable_if::value>::type> { - typedef Kokkos::View ptrs_type; - typedef Kokkos::MemoryPool pool_type; - typedef typename DeviceType::memory_space memory_space; + using ptrs_type = Kokkos::View; + using pool_type = Kokkos::MemoryPool; + using memory_space = typename DeviceType::memory_space; pool_type pool; ptrs_type ptrs; @@ -541,9 +541,9 @@ struct TestMemoryPoolHuge< template void test_memory_pool_huge() { - typedef typename DeviceType::execution_space execution_space; - typedef TestMemoryPoolHuge functor_type; - typedef Kokkos::RangePolicy policy_type; + using execution_space = typename DeviceType::execution_space; + using functor_type = TestMemoryPoolHuge; + using policy_type = Kokkos::RangePolicy; functor_type f; policy_type policy(0, functor_type::num_superblock); diff --git a/lib/kokkos/core/unit_test/TestNonTrivialScalarTypes.hpp b/lib/kokkos/core/unit_test/TestNonTrivialScalarTypes.hpp new file mode 100644 index 0000000000..3ee4a25ec0 --- /dev/null +++ b/lib/kokkos/core/unit_test/TestNonTrivialScalarTypes.hpp @@ -0,0 +1,338 @@ + +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#ifndef TESTNONTRIVIALSCALARTYPES_HPP_ +#define TESTNONTRIVIALSCALARTYPES_HPP_ + +#include + +#include +#include +#include +#include +#include + +namespace Test { + +struct my_complex { + double re, im; + int dummy; + + KOKKOS_INLINE_FUNCTION + my_complex() { + re = 0.0; + im = 0.0; + dummy = 0; + } + + KOKKOS_INLINE_FUNCTION + my_complex(const my_complex &src) { + re = src.re; + im = src.im; + dummy = src.dummy; + } + + KOKKOS_INLINE_FUNCTION + my_complex &operator=(const my_complex &src) { + re = src.re; + im = src.im; + dummy = src.dummy; + return *this; + } + + KOKKOS_INLINE_FUNCTION + my_complex &operator=(const volatile my_complex &src) { + re = src.re; + im = src.im; + dummy = src.dummy; + return *this; + } + + KOKKOS_INLINE_FUNCTION + volatile my_complex &operator=(const my_complex &src) volatile { + re = src.re; + im = src.im; + dummy = src.dummy; + return *this; + } + + KOKKOS_INLINE_FUNCTION + volatile my_complex &operator=(const volatile my_complex &src) volatile { + re = src.re; + im = src.im; + dummy = src.dummy; + return *this; + } + + KOKKOS_INLINE_FUNCTION + my_complex(const volatile my_complex &src) { + re = src.re; + im = src.im; + dummy = src.dummy; + } + + KOKKOS_INLINE_FUNCTION + my_complex(const double &val) { + re = val; + im = 0.0; + dummy = 0; + } + + KOKKOS_INLINE_FUNCTION + my_complex &operator+=(const my_complex &src) { + re += src.re; + im += src.im; + dummy += src.dummy; + return *this; + } + + KOKKOS_INLINE_FUNCTION + void operator+=(const volatile my_complex &src) volatile { + re += src.re; + im += src.im; + dummy += src.dummy; + } + + KOKKOS_INLINE_FUNCTION + my_complex operator+(const my_complex &src) { + my_complex tmp = *this; + tmp.re += src.re; + tmp.im += src.im; + tmp.dummy += src.dummy; + return tmp; + } + + KOKKOS_INLINE_FUNCTION + my_complex operator+(const volatile my_complex &src) volatile { + my_complex tmp = *this; + tmp.re += src.re; + tmp.im += src.im; + tmp.dummy += src.dummy; + return tmp; + } + + KOKKOS_INLINE_FUNCTION + my_complex &operator*=(const my_complex &src) { + double re_tmp = re * src.re - im * src.im; + double im_tmp = re * src.im + im * src.re; + re = re_tmp; + im = im_tmp; + dummy *= src.dummy; + return *this; + } + + KOKKOS_INLINE_FUNCTION + void operator*=(const volatile my_complex &src) volatile { + double re_tmp = re * src.re - im * src.im; + double im_tmp = re * src.im + im * src.re; + re = re_tmp; + im = im_tmp; + dummy *= src.dummy; + } + + KOKKOS_INLINE_FUNCTION + bool operator==(const my_complex &src) { + return (re == src.re) && (im == src.im) && (dummy == src.dummy); + } + + KOKKOS_INLINE_FUNCTION + bool operator!=(const my_complex &src) { + return (re != src.re) || (im != src.im) || (dummy != src.dummy); + } + + KOKKOS_INLINE_FUNCTION + bool operator!=(const double &val) { + return (re != val) || (im != 0) || (dummy != 0); + } + + KOKKOS_INLINE_FUNCTION + my_complex &operator=(const int &val) { + re = val; + im = 0.0; + dummy = 0; + return *this; + } + + KOKKOS_INLINE_FUNCTION + my_complex &operator=(const double &val) { + re = val; + im = 0.0; + dummy = 0; + return *this; + } + + KOKKOS_INLINE_FUNCTION + operator double() { return re; } +}; + +template +struct array_reduce { + scalar_t data[N]; + KOKKOS_INLINE_FUNCTION + array_reduce() { + for (int i = 0; i < N; i++) data[i] = scalar_t(); + } + KOKKOS_INLINE_FUNCTION + array_reduce(const array_reduce &rhs) { + for (int i = 0; i < N; i++) data[i] = rhs.data[i]; + } + KOKKOS_INLINE_FUNCTION + array_reduce(const scalar_t value) { + for (int i = 0; i < N; i++) data[i] = scalar_t(value); + } + + KOKKOS_INLINE_FUNCTION + array_reduce &operator=(const array_reduce &src) { + for (int i = 0; i < N; i++) data[i] = src.data[i]; + return *this; + } + + KOKKOS_INLINE_FUNCTION + array_reduce &operator=(const volatile array_reduce &src) { + for (int i = 0; i < N; i++) data[i] = src.data[i]; + return *this; + } + + KOKKOS_INLINE_FUNCTION // add operator + array_reduce & + operator=(const scalar_t val) { + for (int i = 0; i < N; i++) data[i] = val; + return *this; + } + KOKKOS_INLINE_FUNCTION // add operator + array_reduce & + operator=(const int val) { + for (int i = 0; i < N; i++) data[i] = val; + return *this; + } + + KOKKOS_INLINE_FUNCTION // add operator + array_reduce & + operator+=(const array_reduce &src) { + for (int i = 0; i < N; i++) data[i] += src.data[i]; + return *this; + } + KOKKOS_INLINE_FUNCTION // volatile add operator + void + operator+=(const volatile array_reduce &src) volatile { + for (int i = 0; i < N; i++) data[i] += src.data[i]; + } + KOKKOS_INLINE_FUNCTION // add operator + array_reduce + operator+(const array_reduce &src) const { + array_reduce result(*this); + for (int i = 0; i < N; i++) result.data[i] += src.data[i]; + return result; + } + KOKKOS_INLINE_FUNCTION // add operator + array_reduce + operator-(const array_reduce &src) const { + array_reduce result(*this); + for (int i = 0; i < N; i++) result.data[i] -= src.data[i]; + return result; + } + KOKKOS_INLINE_FUNCTION // add operator + array_reduce & + operator*=(const array_reduce &src) { + for (int i = 0; i < N; i++) data[i] *= src.data[i]; + return *this; + } + KOKKOS_INLINE_FUNCTION // volatile add operator + void + operator*=(const volatile array_reduce &src) volatile { + for (int i = 0; i < N; i++) data[i] *= src.data[i]; + } + KOKKOS_INLINE_FUNCTION // add operator + array_reduce + operator*(const array_reduce &src) const { + array_reduce result(*this); + for (int i = 0; i < N; i++) result.data[i] *= src.data[i]; + return result; + } + KOKKOS_INLINE_FUNCTION + bool operator==(const array_reduce &src) const { + bool equal = true; + for (int i = 0; i < N; i++) equal = equal && (data[i] == src.data[i]); + return equal; + } + KOKKOS_INLINE_FUNCTION + bool operator!=(const array_reduce &src) const { + bool equal = true; + for (int i = 0; i < N; i++) equal = equal && (data[i] == src.data[i]); + return !equal; + } + KOKKOS_INLINE_FUNCTION + explicit operator double() const { + double lsum = 0.0; + for (int i = 0; i < N; i++) lsum += data[i]; + return lsum; + } +}; +} // namespace Test + +namespace Kokkos { +template <> +struct reduction_identity { + using t_red_ident = reduction_identity; + KOKKOS_FORCEINLINE_FUNCTION static Test::my_complex sum() { + return Test::my_complex(t_red_ident::sum()); + } + KOKKOS_FORCEINLINE_FUNCTION static Test::my_complex prod() { + return Test::my_complex(t_red_ident::prod()); + } +}; + +template +struct reduction_identity> { + using t_red_ident = reduction_identity; + KOKKOS_FORCEINLINE_FUNCTION static Test::array_reduce sum() { + return Test::array_reduce(t_red_ident::sum()); + } + KOKKOS_FORCEINLINE_FUNCTION static Test::array_reduce prod() { + return Test::array_reduce(t_red_ident::prod()); + } +}; +} // namespace Kokkos +#endif // TESTNONTRIVIALSCALARTYPES_HPP_ diff --git a/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp b/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp index a5ec173205..f5f9a2fb66 100644 --- a/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp +++ b/lib/kokkos/core/unit_test/TestPolicyConstruction.hpp @@ -68,264 +68,262 @@ class TestRangePolicyConstruction { } { - typedef Kokkos::RangePolicy<> policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy<>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::RangePolicy, + Kokkos::IndexType>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, ExecutionSpace, - Kokkos::Schedule > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::RangePolicy, ExecutionSpace, + Kokkos::Schedule>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType, SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::RangePolicy, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - ExecutionSpace, Kokkos::IndexType, - SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::RangePolicy, ExecutionSpace, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType, ExecutionSpace> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::RangePolicy, + Kokkos::IndexType, ExecutionSpace>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy > policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy, + Kokkos::IndexType>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::Schedule > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy, + Kokkos::Schedule>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType, SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType, SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::RangePolicy, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::RangePolicy, - Kokkos::IndexType > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::RangePolicy, + Kokkos::IndexType>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } } void test_runtime_parameters() { + using policy_t = Kokkos::RangePolicy<>; { - typedef Kokkos::RangePolicy<> policy_t; policy_t p(5, 15); ASSERT_TRUE((p.begin() == 5)); ASSERT_TRUE((p.end() == 15)); } { - typedef Kokkos::RangePolicy<> policy_t; policy_t p(Kokkos::DefaultExecutionSpace(), 5, 15); ASSERT_TRUE((p.begin() == 5)); ASSERT_TRUE((p.end() == 15)); } { - typedef Kokkos::RangePolicy<> policy_t; policy_t p(5, 15, Kokkos::ChunkSize(10)); ASSERT_TRUE((p.begin() == 5)); ASSERT_TRUE((p.end() == 15)); ASSERT_TRUE((p.chunk_size() == 10)); } { - typedef Kokkos::RangePolicy<> policy_t; policy_t p(Kokkos::DefaultExecutionSpace(), 5, 15, Kokkos::ChunkSize(10)); ASSERT_TRUE((p.begin() == 5)); ASSERT_TRUE((p.end() == 15)); ASSERT_TRUE((p.chunk_size() == 10)); } + { + policy_t p; + ASSERT_TRUE((p.begin() == 0)); + ASSERT_TRUE((p.end() == 0)); + p = policy_t(5, 15, Kokkos::ChunkSize(10)); + ASSERT_TRUE((p.begin() == 5)); + ASSERT_TRUE((p.end() == 15)); + ASSERT_TRUE((p.chunk_size() == 10)); + } } }; @@ -340,234 +338,226 @@ class TestTeamPolicyConstruction { private: void test_compile_time_parameters() { { - typedef Kokkos::TeamPolicy<> policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy<>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy, + Kokkos::IndexType>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, ExecutionSpace, - Kokkos::Schedule > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy, ExecutionSpace, + Kokkos::Schedule>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType, SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - ExecutionSpace, Kokkos::IndexType, - SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy, ExecutionSpace, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType, ExecutionSpace> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy, + Kokkos::IndexType, ExecutionSpace>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy > policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy, + Kokkos::IndexType>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::Schedule > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy, + Kokkos::Schedule>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType, SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType, SomeTag> - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = Kokkos::TeamPolicy, + Kokkos::IndexType, SomeTag>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } { - typedef Kokkos::TeamPolicy, - Kokkos::IndexType > - policy_t; - typedef typename policy_t::execution_space execution_space; - typedef typename policy_t::index_type index_type; - typedef typename policy_t::schedule_type schedule_type; - typedef typename policy_t::work_tag work_tag; + using policy_t = + Kokkos::TeamPolicy, + Kokkos::IndexType>; + using execution_space = typename policy_t::execution_space; + using index_type = typename policy_t::index_type; + using schedule_type = typename policy_t::schedule_type; + using work_tag = typename policy_t::work_tag; ASSERT_TRUE(( std::is_same::value)); ASSERT_TRUE((std::is_same::value)); ASSERT_TRUE((std::is_same >::value)); + Kokkos::Schedule>::value)); ASSERT_TRUE((std::is_same::value)); } } @@ -585,9 +575,6 @@ class TestTeamPolicyConstruction { int per_team_scratch = 1024; int per_thread_scratch = 16; int scratch_size = per_team_scratch + per_thread_scratch * team_size; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - int vector_length = 4; -#endif policy_t p1(league_size, team_size); ASSERT_EQ(p1.league_size(), league_size); @@ -598,11 +585,7 @@ class TestTeamPolicyConstruction { policy_t p2 = p1.set_chunk_size(chunk_size); ASSERT_EQ(p1.league_size(), league_size); ASSERT_EQ(p1.team_size(), team_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_TRUE(p1.chunk_size() > 0); -#else ASSERT_EQ(p1.chunk_size(), chunk_size); -#endif ASSERT_EQ(p1.scratch_size(0), 0); ASSERT_EQ(p2.league_size(), league_size); @@ -614,11 +597,7 @@ class TestTeamPolicyConstruction { ASSERT_EQ(p2.league_size(), league_size); ASSERT_EQ(p2.team_size(), team_size); ASSERT_EQ(p2.chunk_size(), chunk_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(p2.scratch_size(0), 0); -#else ASSERT_EQ(p2.scratch_size(0), per_team_scratch); -#endif ASSERT_EQ(p3.league_size(), league_size); ASSERT_EQ(p3.team_size(), team_size); ASSERT_EQ(p3.chunk_size(), chunk_size); @@ -628,30 +607,18 @@ class TestTeamPolicyConstruction { ASSERT_EQ(p2.league_size(), league_size); ASSERT_EQ(p2.team_size(), team_size); ASSERT_EQ(p2.chunk_size(), chunk_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(p2.scratch_size(0), 0); -#else ASSERT_EQ(p2.scratch_size(0), scratch_size); -#endif ASSERT_EQ(p4.league_size(), league_size); ASSERT_EQ(p4.team_size(), team_size); ASSERT_EQ(p4.chunk_size(), chunk_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(p4.scratch_size(0), per_thread_scratch * team_size); -#else ASSERT_EQ(p4.scratch_size(0), scratch_size); -#endif policy_t p5 = p2.set_scratch_size(0, Kokkos::PerThread(per_thread_scratch), Kokkos::PerTeam(per_team_scratch)); ASSERT_EQ(p2.league_size(), league_size); ASSERT_EQ(p2.team_size(), team_size); ASSERT_EQ(p2.chunk_size(), chunk_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(p2.scratch_size(0), 0); -#else ASSERT_EQ(p2.scratch_size(0), scratch_size); -#endif ASSERT_EQ(p5.league_size(), league_size); ASSERT_EQ(p5.team_size(), team_size); ASSERT_EQ(p5.chunk_size(), chunk_size); @@ -662,11 +629,7 @@ class TestTeamPolicyConstruction { ASSERT_EQ(p2.league_size(), league_size); ASSERT_EQ(p2.team_size(), team_size); ASSERT_EQ(p2.chunk_size(), chunk_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(p2.scratch_size(0), 0); -#else ASSERT_EQ(p2.scratch_size(0), scratch_size); -#endif ASSERT_EQ(p6.league_size(), league_size); ASSERT_EQ(p6.team_size(), team_size); ASSERT_EQ(p6.chunk_size(), chunk_size); @@ -677,206 +640,56 @@ class TestTeamPolicyConstruction { ASSERT_EQ(p3.league_size(), league_size); ASSERT_EQ(p3.team_size(), team_size); ASSERT_EQ(p3.chunk_size(), chunk_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - ASSERT_EQ(p3.scratch_size(0), per_team_scratch); -#else ASSERT_EQ(p3.scratch_size(0), scratch_size); -#endif ASSERT_EQ(p7.league_size(), league_size); ASSERT_EQ(p7.team_size(), team_size); ASSERT_EQ(p7.chunk_size(), chunk_size); ASSERT_EQ(p7.scratch_size(0), scratch_size); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - policy_t p8(league_size, team_size, Kokkos::ChunkSize(chunk_size)); + policy_t p8; // default constructed + ASSERT_EQ(p8.league_size(), 0); + ASSERT_EQ(p8.scratch_size(0), 0); + p8 = p3; // call assignment operator + ASSERT_EQ(p3.league_size(), league_size); + ASSERT_EQ(p3.team_size(), team_size); + ASSERT_EQ(p3.chunk_size(), chunk_size); + ASSERT_EQ(p3.scratch_size(0), scratch_size); ASSERT_EQ(p8.league_size(), league_size); ASSERT_EQ(p8.team_size(), team_size); ASSERT_EQ(p8.chunk_size(), chunk_size); - ASSERT_EQ(p8.scratch_size(0), 0); - - policy_t p10(league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p10.league_size(), league_size); - ASSERT_EQ(p10.team_size(), team_size); - ASSERT_TRUE(p10.chunk_size() > 0); - ASSERT_EQ(p10.scratch_size(0), per_team_scratch); - - policy_t p11( - league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p11.league_size(), league_size); - ASSERT_EQ(p11.team_size(), team_size); - ASSERT_TRUE(p11.chunk_size() > 0); - ASSERT_EQ(p11.scratch_size(0), per_thread_scratch * team_size); - - policy_t p12( - league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch), - Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p12.league_size(), league_size); - ASSERT_EQ(p12.team_size(), team_size); - ASSERT_TRUE(p12.chunk_size() > 0); - ASSERT_EQ(p12.scratch_size(0), scratch_size); - - policy_t p13(league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p13.league_size(), league_size); - ASSERT_EQ(p13.team_size(), team_size); - ASSERT_TRUE(p13.chunk_size() > 0); - ASSERT_EQ(p13.scratch_size(0), scratch_size); - - policy_t p14(league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p14.league_size(), league_size); - ASSERT_EQ(p14.team_size(), team_size); - ASSERT_TRUE(p14.chunk_size() > 0); - ASSERT_EQ(p14.scratch_size(0), scratch_size); - - policy_t p15(league_size, team_size, Kokkos::ChunkSize(chunk_size), - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p15.league_size(), league_size); - ASSERT_EQ(p15.team_size(), team_size); - ASSERT_TRUE(p15.chunk_size() > 0); - ASSERT_EQ(p15.scratch_size(0), per_team_scratch); - - policy_t p16( - league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch)), - Kokkos::ChunkSize(chunk_size)); - ASSERT_EQ(p16.league_size(), league_size); - ASSERT_EQ(p16.team_size(), team_size); - ASSERT_EQ(p16.chunk_size(), chunk_size); - ASSERT_EQ(p16.scratch_size(0), per_thread_scratch * team_size); - - policy_t p17( - league_size, team_size, Kokkos::ChunkSize(chunk_size), - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch), - Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p17.league_size(), league_size); - ASSERT_EQ(p17.team_size(), team_size); - ASSERT_EQ(p17.chunk_size(), chunk_size); - ASSERT_EQ(p17.scratch_size(0), scratch_size); - - policy_t p18(league_size, team_size, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch)), - Kokkos::ChunkSize(chunk_size)); - ASSERT_EQ(p18.league_size(), league_size); - ASSERT_EQ(p18.team_size(), team_size); - ASSERT_EQ(p18.chunk_size(), chunk_size); - ASSERT_EQ(p18.scratch_size(0), scratch_size); - - policy_t p19(league_size, team_size, Kokkos::ChunkSize(chunk_size), - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p19.league_size(), league_size); - ASSERT_EQ(p19.team_size(), team_size); - ASSERT_EQ(p19.chunk_size(), chunk_size); - ASSERT_EQ(p19.scratch_size(0), scratch_size); - - policy_t p20(league_size, team_size, vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p20.league_size(), league_size); - ASSERT_EQ(p20.team_size(), team_size); - ASSERT_TRUE(p20.chunk_size() > 0); - ASSERT_EQ(p20.scratch_size(0), per_team_scratch); - - policy_t p21( - league_size, team_size, vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p21.league_size(), league_size); - ASSERT_EQ(p21.team_size(), team_size); - ASSERT_TRUE(p21.chunk_size() > 0); - ASSERT_EQ(p21.scratch_size(0), per_thread_scratch * team_size); - - policy_t p22( - league_size, team_size, vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch), - Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p22.league_size(), league_size); - ASSERT_EQ(p22.team_size(), team_size); - ASSERT_TRUE(p22.chunk_size() > 0); - ASSERT_EQ(p22.scratch_size(0), scratch_size); - - policy_t p23(league_size, team_size, (size_t)vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p23.league_size(), league_size); - ASSERT_EQ(p23.team_size(), team_size); - ASSERT_TRUE(p23.chunk_size() > 0); - ASSERT_EQ(p23.scratch_size(0), scratch_size); - - policy_t p24(league_size, team_size, (size_t)vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p24.league_size(), league_size); - ASSERT_EQ(p24.team_size(), team_size); - ASSERT_TRUE(p24.chunk_size() > 0); - ASSERT_EQ(p24.scratch_size(0), scratch_size); - - policy_t p25(league_size, team_size, vector_length, - Kokkos::ChunkSize(chunk_size), - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p25.league_size(), league_size); - ASSERT_EQ(p25.team_size(), team_size); - ASSERT_TRUE(p25.chunk_size() > 0); - ASSERT_EQ(p25.scratch_size(0), per_team_scratch); - - policy_t p26( - league_size, team_size, vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch)), - Kokkos::ChunkSize(chunk_size)); - ASSERT_EQ(p26.league_size(), league_size); - ASSERT_EQ(p26.team_size(), team_size); - ASSERT_EQ(p26.chunk_size(), chunk_size); - ASSERT_EQ(p26.scratch_size(0), per_thread_scratch * team_size); - - policy_t p27( - league_size, team_size, vector_length, Kokkos::ChunkSize(chunk_size), - Kokkos::ScratchRequest(0, Kokkos::PerThread(per_thread_scratch), - Kokkos::PerTeam(per_team_scratch))); - ASSERT_EQ(p27.league_size(), league_size); - ASSERT_EQ(p27.team_size(), team_size); - ASSERT_EQ(p27.chunk_size(), chunk_size); - ASSERT_EQ(p27.scratch_size(0), scratch_size); - - policy_t p28(league_size, team_size, (size_t)vector_length, - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch)), - Kokkos::ChunkSize(chunk_size)); - ASSERT_EQ(p28.league_size(), league_size); - ASSERT_EQ(p28.team_size(), team_size); - ASSERT_EQ(p28.chunk_size(), chunk_size); - ASSERT_EQ(p28.scratch_size(0), scratch_size); - - policy_t p29(league_size, team_size, (size_t)vector_length, - Kokkos::ChunkSize(chunk_size), - Kokkos::ScratchRequest(0, Kokkos::PerTeam(per_team_scratch), - Kokkos::PerThread(per_thread_scratch))); - ASSERT_EQ(p29.league_size(), league_size); - ASSERT_EQ(p29.team_size(), team_size); - ASSERT_EQ(p29.chunk_size(), chunk_size); - ASSERT_EQ(p29.scratch_size(0), scratch_size); -#endif + ASSERT_EQ(p8.scratch_size(0), scratch_size); } void test_run_time_parameters() { - test_run_time_parameters_type >(); + test_run_time_parameters_type>(); test_run_time_parameters_type< Kokkos::TeamPolicy, - Kokkos::IndexType > >(); + Kokkos::IndexType>>(); test_run_time_parameters_type< Kokkos::TeamPolicy, ExecutionSpace, - Kokkos::Schedule > >(); - test_run_time_parameters_type, Kokkos::IndexType, - ExecutionSpace, SomeTag> >(); + Kokkos::Schedule>>(); + test_run_time_parameters_type< + Kokkos::TeamPolicy, + Kokkos::IndexType, ExecutionSpace, SomeTag>>(); } }; +// semiregular is copyable and default initializable +// (regular requires equality comparable) +template +void check_semiregular() { + static_assert(std::is_default_constructible::value, ""); + static_assert(std::is_copy_constructible::value, ""); + static_assert(std::is_move_constructible::value, ""); + static_assert(std::is_copy_assignable::value, ""); + static_assert(std::is_move_assignable::value, ""); + static_assert(std::is_destructible::value, ""); +} + TEST(TEST_CATEGORY, policy_construction) { + check_semiregular>(); + check_semiregular>(); + TestRangePolicyConstruction(); TestTeamPolicyConstruction(); } diff --git a/lib/kokkos/core/unit_test/TestRange.hpp b/lib/kokkos/core/unit_test/TestRange.hpp index 9bd13ad239..83cc16d6c0 100644 --- a/lib/kokkos/core/unit_test/TestRange.hpp +++ b/lib/kokkos/core/unit_test/TestRange.hpp @@ -52,9 +52,9 @@ namespace { template struct TestRange { - typedef int value_type; ///< typedef required for the parallel_reduce + using value_type = int; ///< alias required for the parallel_reduce - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type m_flags; view_type result_view; @@ -87,9 +87,8 @@ struct TestRange { Kokkos::parallel_for(Kokkos::RangePolicy(0, N), *this); -#if defined(KOKKOS_ENABLE_PROFILING) { - typedef TestRange ThisType; + using ThisType = TestRange; std::string label("parallel_for"); Kokkos::Impl::ParallelConstructName pcn(label); ASSERT_EQ(pcn.get(), label); @@ -98,15 +97,13 @@ struct TestRange { empty_label); ASSERT_EQ(empty_pcn.get(), typeid(ThisType).name()); } -#endif Kokkos::parallel_for( Kokkos::RangePolicy(0, N), *this); -#if defined(KOKKOS_ENABLE_PROFILING) { - typedef TestRange ThisType; + using ThisType = TestRange; std::string label("parallel_for"); Kokkos::Impl::ParallelConstructName pcn(label); ASSERT_EQ(pcn.get(), label); @@ -116,7 +113,6 @@ struct TestRange { ASSERT_EQ(empty_pcn.get(), std::string(typeid(ThisType).name()) + "/" + typeid(VerifyInitTag).name()); } -#endif Kokkos::deep_copy(host_flags, m_flags); @@ -276,8 +272,8 @@ struct TestRange { void test_dynamic_policy() { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) auto const N_no_implicit_capture = N; - typedef Kokkos::RangePolicy > - policy_t; + using policy_t = + Kokkos::RangePolicy >; { Kokkos::View > @@ -290,11 +286,7 @@ struct TestRange { k++) { a(i)++; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - count(ExecSpace::hardware_thread_id())++; -#else - count( ExecSpace::impl_hardware_thread_id() )++; -#endif + count(ExecSpace::impl_hardware_thread_id())++; }); int error = 0; @@ -335,11 +327,7 @@ struct TestRange { k++) { a(i)++; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - count(ExecSpace::hardware_thread_id())++; -#else count(ExecSpace::impl_hardware_thread_id())++; -#endif lsum++; }, sum); diff --git a/lib/kokkos/core/unit_test/TestRangeRequire.hpp b/lib/kokkos/core/unit_test/TestRangeRequire.hpp index a75af0b95b..e70ea666b9 100644 --- a/lib/kokkos/core/unit_test/TestRangeRequire.hpp +++ b/lib/kokkos/core/unit_test/TestRangeRequire.hpp @@ -56,9 +56,9 @@ namespace { template struct TestRangeRequire { - typedef int value_type; ///< typedef required for the parallel_reduce + using value_type = int; ///< alias required for the parallel_reduce - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type m_flags; @@ -82,9 +82,8 @@ struct TestRangeRequire { Kokkos::RangePolicy(0, N), Property()), *this); -#if defined(KOKKOS_ENABLE_PROFILING) { - typedef TestRangeRequire ThisType; + using ThisType = TestRangeRequire; std::string label("parallel_for"); Kokkos::Impl::ParallelConstructName pcn(label); ASSERT_EQ(pcn.get(), label); @@ -93,7 +92,6 @@ struct TestRangeRequire { empty_label); ASSERT_EQ(empty_pcn.get(), typeid(ThisType).name()); } -#endif Kokkos::parallel_for( Kokkos::Experimental::require( @@ -101,9 +99,8 @@ struct TestRangeRequire { Property()), *this); -#if defined(KOKKOS_ENABLE_PROFILING) { - typedef TestRangeRequire ThisType; + using ThisType = TestRangeRequire; std::string label("parallel_for"); Kokkos::Impl::ParallelConstructName pcn(label); ASSERT_EQ(pcn.get(), label); @@ -113,7 +110,6 @@ struct TestRangeRequire { ASSERT_EQ(empty_pcn.get(), std::string(typeid(ThisType).name()) + "/" + typeid(VerifyInitTag).name()); } -#endif Kokkos::deep_copy(host_flags, m_flags); @@ -274,8 +270,8 @@ struct TestRangeRequire { void test_dynamic_policy() { #if defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) auto const N_no_implicit_capture = N; - typedef Kokkos::RangePolicy > - policy_t; + using policy_t = + Kokkos::RangePolicy >; { Kokkos::View > @@ -288,11 +284,7 @@ struct TestRangeRequire { k++) { a(i)++; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - count(ExecSpace::hardware_thread_id())++; -#else - count( ExecSpace::impl_hardware_thread_id() )++; -#endif + count(ExecSpace::impl_hardware_thread_id())++; }); int error = 0; @@ -333,11 +325,7 @@ struct TestRangeRequire { k++) { a(i)++; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - count(ExecSpace::hardware_thread_id())++; -#else count(ExecSpace::impl_hardware_thread_id())++; -#endif lsum++; }, sum); diff --git a/lib/kokkos/core/unit_test/TestReduce.hpp b/lib/kokkos/core/unit_test/TestReduce.hpp index d63d5e8d4a..fd559f521c 100644 --- a/lib/kokkos/core/unit_test/TestReduce.hpp +++ b/lib/kokkos/core/unit_test/TestReduce.hpp @@ -54,8 +54,8 @@ namespace Test { template class ReduceFunctor { public: - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; struct value_type { ScalarType value[3]; @@ -97,7 +97,7 @@ class ReduceFunctor { template class ReduceFunctorFinal : public ReduceFunctor { public: - typedef typename ReduceFunctor::value_type value_type; + using value_type = typename ReduceFunctor::value_type; KOKKOS_INLINE_FUNCTION ReduceFunctorFinal(const size_t n) : ReduceFunctor(n) {} @@ -114,13 +114,13 @@ template class RuntimeReduceFunctor { public: // Required for functor: - typedef DeviceType execution_space; - typedef ScalarType value_type[]; + using execution_space = DeviceType; + using value_type = ScalarType[]; const unsigned value_count; // Unit test details: - typedef typename execution_space::size_type size_type; + using size_type = typename execution_space::size_type; const size_type nwork; @@ -151,13 +151,13 @@ template class RuntimeReduceMinMax { public: // Required for functor: - typedef DeviceType execution_space; - typedef ScalarType value_type[]; + using execution_space = DeviceType; + using value_type = ScalarType[]; const unsigned value_count; // Unit test details: - typedef typename execution_space::size_type size_type; + using size_type = typename execution_space::size_type; const size_type nwork; const ScalarType amin; @@ -200,9 +200,9 @@ template class RuntimeReduceFunctorFinal : public RuntimeReduceFunctor { public: - typedef RuntimeReduceFunctor base_type; - typedef typename base_type::value_type value_type; - typedef int64_t scalar_type; + using base_type = RuntimeReduceFunctor; + using value_type = typename base_type::value_type; + using scalar_type = int64_t; RuntimeReduceFunctorFinal(const size_t theNwork, const size_t count) : base_type(theNwork, count) {} @@ -215,13 +215,38 @@ class RuntimeReduceFunctorFinal } }; +template +class CombinedReduceFunctorSameType { + public: + using execution_space = typename DeviceType::execution_space; + using size_type = typename execution_space::size_type; + + const size_type nwork; + + KOKKOS_INLINE_FUNCTION + constexpr explicit CombinedReduceFunctorSameType(const size_type& arg_nwork) + : nwork(arg_nwork) {} + + KOKKOS_DEFAULTED_FUNCTION + constexpr CombinedReduceFunctorSameType( + const CombinedReduceFunctorSameType& rhs) = default; + + KOKKOS_INLINE_FUNCTION + void operator()(size_type iwork, ValueType& dst1, ValueType& dst2, + ValueType& dst3) const { + dst1 += 1; + dst2 += iwork + 1; + dst3 += nwork - iwork; + } +}; + namespace { template class TestReduce { public: - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; TestReduce(const size_type& nwork) { run_test(nwork); @@ -229,8 +254,8 @@ class TestReduce { } void run_test(const size_type& nwork) { - typedef Test::ReduceFunctor functor_type; - typedef typename functor_type::value_type value_type; + using functor_type = Test::ReduceFunctor; + using value_type = typename functor_type::value_type; enum { Count = 3 }; enum { Repeat = 100 }; @@ -253,8 +278,8 @@ class TestReduce { } void run_test_final(const size_type& nwork) { - typedef Test::ReduceFunctorFinal functor_type; - typedef typename functor_type::value_type value_type; + using functor_type = Test::ReduceFunctorFinal; + using value_type = typename functor_type::value_type; enum { Count = 3 }; enum { Repeat = 100 }; @@ -285,8 +310,8 @@ class TestReduce { template class TestReduceDynamic { public: - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; TestReduceDynamic(const size_type nwork) { run_test_dynamic(nwork); @@ -295,8 +320,8 @@ class TestReduceDynamic { } void run_test_dynamic(const size_type nwork) { - typedef Test::RuntimeReduceFunctor - functor_type; + using functor_type = + Test::RuntimeReduceFunctor; enum { Count = 3 }; enum { Repeat = 100 }; @@ -324,7 +349,7 @@ class TestReduceDynamic { } void run_test_dynamic_minmax(const size_type nwork) { - typedef Test::RuntimeReduceMinMax functor_type; + using functor_type = Test::RuntimeReduceMinMax; enum { Count = 2 }; enum { Repeat = 100 }; @@ -356,7 +381,7 @@ class TestReduceDynamic { } void run_test_dynamic_final(const size_type nwork) { - typedef Test::RuntimeReduceFunctorFinal functor_type; + using functor_type = Test::RuntimeReduceFunctorFinal; enum { Count = 3 }; enum { Repeat = 100 }; @@ -387,17 +412,17 @@ class TestReduceDynamic { template class TestReduceDynamicView { public: - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; TestReduceDynamicView(const size_type nwork) { run_test_dynamic_view(nwork); } void run_test_dynamic_view(const size_type nwork) { - typedef Test::RuntimeReduceFunctor - functor_type; + using functor_type = + Test::RuntimeReduceFunctor; - typedef Kokkos::View result_type; - typedef typename result_type::HostMirror result_host_type; + using result_type = Kokkos::View; + using result_host_type = typename result_type::HostMirror; const unsigned CountLimit = 23; @@ -455,4 +480,45 @@ TEST(TEST_CATEGORY, int64_t_reduce_dynamic_view) { TestReduceDynamicView(1000000); } +TEST(TEST_CATEGORY, int_combined_reduce) { + using functor_type = CombinedReduceFunctorSameType; + constexpr uint64_t nw = 1000; + + uint64_t nsum = (nw / 2) * (nw + 1); + + int64_t result1 = 0; + int64_t result2 = 0; + int64_t result3 = 0; + + Kokkos::parallel_reduce("int_combined_reduce", + Kokkos::RangePolicy(0, nw), + functor_type(nw), result1, result2, result3); + + ASSERT_EQ(nw, result1); + ASSERT_EQ(nsum, result2); + ASSERT_EQ(nsum, result3); +} + +TEST(TEST_CATEGORY, int_combined_reduce_mixed) { + using functor_type = CombinedReduceFunctorSameType; + + constexpr uint64_t nw = 1000; + + uint64_t nsum = (nw / 2) * (nw + 1); + + auto result1_v = Kokkos::View{"result1_v"}; + + int64_t result2 = 0; + + auto result3_v = Kokkos::View{"result3_v"}; + + Kokkos::parallel_reduce("int_combined-reduce_mixed", + Kokkos::RangePolicy(0, nw), + functor_type(nw), result1_v, result2, + Kokkos::Sum{result3_v}); + + ASSERT_EQ(nw, result1_v()); + ASSERT_EQ(nsum, result2); + ASSERT_EQ(nsum, result3_v()); +} } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp b/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp index fe85f360cb..199cec11a4 100644 --- a/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp +++ b/lib/kokkos/core/unit_test/TestReduceCombinatorical.hpp @@ -57,12 +57,11 @@ template struct AddPlus { public: // Required. - typedef AddPlus reducer; - typedef Scalar value_type; + using reducer = AddPlus; + using value_type = Scalar; - typedef Kokkos::View > - result_view_type; + using result_view_type = + Kokkos::View >; private: result_view_type result; @@ -105,7 +104,7 @@ struct FunctorScalar<0> { template <> struct FunctorScalar<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -135,7 +134,7 @@ struct FunctorScalarInit<0> { template <> struct FunctorScalarInit<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -168,7 +167,7 @@ struct FunctorScalarFinal<0> { template <> struct FunctorScalarFinal<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -203,7 +202,7 @@ struct FunctorScalarJoin<0> { template <> struct FunctorScalarJoin<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -243,7 +242,7 @@ struct FunctorScalarJoinFinal<0> { template <> struct FunctorScalarJoinFinal<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -286,7 +285,7 @@ struct FunctorScalarJoinInit<0> { template <> struct FunctorScalarJoinInit<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -332,7 +331,7 @@ struct FunctorScalarJoinFinalInit<0> { template <> struct FunctorScalarJoinFinalInit<1> { - typedef Kokkos::TeamPolicy<>::member_type team_type; + using team_type = Kokkos::TeamPolicy<>::member_type; Kokkos::View result; @@ -361,7 +360,7 @@ struct Functor1 { }; struct Functor2 { - typedef double value_type[]; + using value_type = double[]; const unsigned value_count; @@ -425,6 +424,8 @@ struct TestReduceCombinatoricalInstantiation { ASSERT_EQ(expected_result, result_view_const_um()); value = 0; +// WORKAROUND OPENMPTARGET Custom Reducers not implemented +#ifndef KOKKOS_ENABLE_OPENMPTARGET CallParallelReduce(args..., Test::ReduceCombinatorical::AddPlus(value)); if ((Kokkos::DefaultExecutionSpace::concurrency() > 1) && @@ -449,6 +450,7 @@ struct TestReduceCombinatoricalInstantiation { } else { ASSERT_EQ(expected_result, value); } +#endif } template @@ -483,6 +485,9 @@ struct TestReduceCombinatoricalInstantiation { AddReturnArgument( args..., Test::ReduceCombinatorical::FunctorScalar(result_view)); +// WORKAROUND OPENMPTARGET: reductions with functor join/init/final not +// implemented +#ifndef KOKKOS_ENABLE_OPENMPTARGET AddReturnArgument( args..., Test::ReduceCombinatorical::FunctorScalarInit(result_view)); @@ -519,6 +524,7 @@ struct TestReduceCombinatoricalInstantiation { Kokkos::fence(); Kokkos::deep_copy(h_r, result_view); ASSERT_EQ(expected_result, h_r()); +#endif } template diff --git a/lib/kokkos/core/unit_test/TestReduceDeviceView.hpp b/lib/kokkos/core/unit_test/TestReduceDeviceView.hpp index d0562a2aa0..d82709b300 100644 --- a/lib/kokkos/core/unit_test/TestReduceDeviceView.hpp +++ b/lib/kokkos/core/unit_test/TestReduceDeviceView.hpp @@ -123,11 +123,13 @@ TEST(TEST_CATEGORY, reduce_device_view_mdrange_policy) { MDRangePolicyFunctor()); } +// FIXME_HIP +#ifndef KOKKOS_ENABLE_HIP TEST(TEST_CATEGORY, reduce_device_view_team_policy) { int N = 1000 * 1024 * 1024; test_reduce_device_view( N, Kokkos::TeamPolicy(1000 * 1024, Kokkos::AUTO), TeamPolicyFunctor(1024)); } - +#endif } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestReducers.hpp b/lib/kokkos/core/unit_test/TestReducers.hpp index 04b4bd373f..b0b6fe7c85 100644 --- a/lib/kokkos/core/unit_test/TestReducers.hpp +++ b/lib/kokkos/core/unit_test/TestReducers.hpp @@ -493,7 +493,7 @@ struct TestReducers { } static void test_minloc(int N) { - typedef typename Kokkos::MinLoc::value_type value_type; + using value_type = typename Kokkos::MinLoc::value_type; Kokkos::View values("Values", N); auto h_values = Kokkos::create_mirror_view(values); @@ -556,7 +556,7 @@ struct TestReducers { } static void test_maxloc(int N) { - typedef typename Kokkos::MaxLoc::value_type value_type; + using value_type = typename Kokkos::MaxLoc::value_type; Kokkos::View values("Values", N); auto h_values = Kokkos::create_mirror_view(values); @@ -619,7 +619,7 @@ struct TestReducers { } static void test_minmaxloc(int N) { - typedef typename Kokkos::MinMaxLoc::value_type value_type; + using value_type = typename Kokkos::MinMaxLoc::value_type; Kokkos::View values("Values", N); auto h_values = Kokkos::create_mirror_view(values); diff --git a/lib/kokkos/core/unit_test/TestReducers_d.hpp b/lib/kokkos/core/unit_test/TestReducers_d.hpp index 2dc8ae5b5a..44545a89dd 100644 --- a/lib/kokkos/core/unit_test/TestReducers_d.hpp +++ b/lib/kokkos/core/unit_test/TestReducers_d.hpp @@ -42,11 +42,20 @@ //@HEADER */ +#include #include +#include namespace Test { TEST(TEST_CATEGORY, reducers_complex_double) { TestReducers, TEST_EXECSPACE>::execute_basic(); } +TEST(TEST_CATEGORY, reducers_struct) { + TestReducers, TEST_EXECSPACE>::test_sum(1031); + TestReducers, TEST_EXECSPACE>::test_sum(1031); + TestReducers, TEST_EXECSPACE>::test_sum(1031); + TestReducers, TEST_EXECSPACE>::test_sum(1031); + TestReducers, TEST_EXECSPACE>::test_sum(1031); +} } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestResize.hpp b/lib/kokkos/core/unit_test/TestResize.hpp index 32a85f03e9..cf5c0df6f9 100644 --- a/lib/kokkos/core/unit_test/TestResize.hpp +++ b/lib/kokkos/core/unit_test/TestResize.hpp @@ -68,7 +68,7 @@ void impl_testResize() { // Check #904 fix (no reallocation if dimensions didn't change). { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_1d("view_1d", sizes[0]); const int* oldPointer = view_1d.data(); EXPECT_TRUE(oldPointer != nullptr); @@ -77,7 +77,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_2d("view_2d", sizes[0], sizes[1]); const int* oldPointer = view_2d.data(); EXPECT_TRUE(oldPointer != nullptr); @@ -86,7 +86,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_3d("view_3d", sizes[0], sizes[1], sizes[2]); const int* oldPointer = view_3d.data(); EXPECT_TRUE(oldPointer != nullptr); @@ -95,7 +95,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_4d("view_4d", sizes[0], sizes[1], sizes[2], sizes[3]); const int* oldPointer = view_4d.data(); EXPECT_TRUE(oldPointer != nullptr); @@ -104,7 +104,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_5d("view_5d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4]); const int* oldPointer = view_5d.data(); @@ -115,7 +115,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_6d("view_6d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4], sizes[5]); const int* oldPointer = view_6d.data(); @@ -126,7 +126,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_7d("view_7d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4], sizes[5], sizes[6]); const int* oldPointer = view_7d.data(); @@ -137,7 +137,7 @@ void impl_testResize() { EXPECT_TRUE(oldPointer == newPointer); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_8d("view_8d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4], sizes[5], sizes[6], sizes[7]); const int* oldPointer = view_8d.data(); @@ -149,7 +149,7 @@ void impl_testResize() { } // Resize without initialization: check if data preserved { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_1d("view_1d", sizes[0]); typename view_type::HostMirror h_view_1d_old = Kokkos::create_mirror(view_1d); @@ -170,7 +170,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_2d("view_2d", sizes[0], sizes[1]); typename view_type::HostMirror h_view_2d_old = Kokkos::create_mirror(view_2d); @@ -193,7 +193,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_3d("view_3d", sizes[0], sizes[1], sizes[2]); typename view_type::HostMirror h_view_3d_old = Kokkos::create_mirror(view_3d); @@ -218,7 +218,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_4d("view_4d", sizes[0], sizes[1], sizes[2], sizes[3]); typename view_type::HostMirror h_view_4d_old = Kokkos::create_mirror(view_4d); @@ -245,7 +245,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_5d("view_5d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4]); typename view_type::HostMirror h_view_5d_old = @@ -277,7 +277,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_6d("view_6d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4], sizes[5]); typename view_type::HostMirror h_view_6d_old = @@ -311,7 +311,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_7d("view_7d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4], sizes[5], sizes[6]); typename view_type::HostMirror h_view_7d_old = @@ -347,7 +347,7 @@ void impl_testResize() { EXPECT_TRUE(test == true); } { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; view_type view_8d("view_8d", sizes[0], sizes[1], sizes[2], sizes[3], sizes[4], sizes[5], sizes[6], sizes[7]); typename view_type::HostMirror h_view_8d_old = diff --git a/lib/kokkos/core/unit_test/TestScan.hpp b/lib/kokkos/core/unit_test/TestScan.hpp index f7ebbb62a3..0a2121a850 100644 --- a/lib/kokkos/core/unit_test/TestScan.hpp +++ b/lib/kokkos/core/unit_test/TestScan.hpp @@ -49,8 +49,8 @@ namespace Test { template struct TestScan { - typedef Device execution_space; - typedef int64_t value_type; + using execution_space = Device; + using value_type = int64_t; Kokkos::View > errors; @@ -76,7 +76,8 @@ struct TestScan { int fail = errors()++; if (fail < 20) { - printf("TestScan(%d,%ld) != %ld\n", iwork, update, answer); + printf("TestScan(%d,%ld) != %ld\n", iwork, static_cast(update), + static_cast(answer)); } } } @@ -108,7 +109,7 @@ struct TestScan { } TestScan(const WorkSpec& Start, const WorkSpec& N) { - typedef Kokkos::RangePolicy exec_policy; + using exec_policy = Kokkos::RangePolicy; Kokkos::View errors_a("Errors"); Kokkos::deep_copy(errors_a, 0); @@ -143,8 +144,8 @@ TEST(TEST_CATEGORY, scan) { /*TEST( TEST_CATEGORY, scan_small ) { - typedef TestScan< TEST_EXECSPACE, Kokkos::Impl::ThreadsExecUseScanSmall > -TestScanFunctor; + using TestScanFunctor = + TestScan< TEST_EXECSPACE, Kokkos::Impl::ThreadsExecUseScanSmall >; for ( int i = 0; i < 1000; ++i ) { TestScanFunctor( 10 ); diff --git a/lib/kokkos/core/unit_test/TestSharedAlloc.hpp b/lib/kokkos/core/unit_test/TestSharedAlloc.hpp index 1b67e29d70..6c89649530 100644 --- a/lib/kokkos/core/unit_test/TestSharedAlloc.hpp +++ b/lib/kokkos/core/unit_test/TestSharedAlloc.hpp @@ -66,12 +66,12 @@ struct SharedAllocDestroy { template void test_shared_alloc() { #if defined(KOKKOS_ACTIVE_EXECUTION_MEMORY_SPACE_HOST) - typedef const Kokkos::Impl::SharedAllocationHeader Header; - typedef Kokkos::Impl::SharedAllocationTracker Tracker; - typedef Kokkos::Impl::SharedAllocationRecord RecordBase; - typedef Kokkos::Impl::SharedAllocationRecord RecordMemS; - typedef Kokkos::Impl::SharedAllocationRecord - RecordFull; + using Header = const Kokkos::Impl::SharedAllocationHeader; + using Tracker = Kokkos::Impl::SharedAllocationTracker; + using RecordBase = Kokkos::Impl::SharedAllocationRecord; + using RecordMemS = Kokkos::Impl::SharedAllocationRecord; + using RecordFull = + Kokkos::Impl::SharedAllocationRecord; static_assert(sizeof(Tracker) == sizeof(int*), "SharedAllocationTracker has wrong size!"); diff --git a/lib/kokkos/core/unit_test/TestTaskScheduler.hpp b/lib/kokkos/core/unit_test/TestTaskScheduler.hpp index ebfdcf1df3..9435e8eccc 100644 --- a/lib/kokkos/core/unit_test/TestTaskScheduler.hpp +++ b/lib/kokkos/core/unit_test/TestTaskScheduler.hpp @@ -136,7 +136,7 @@ struct TestFib { } static void run(int i, size_t MemoryCapacity = 16000) { - typedef typename sched_type::memory_space memory_space; + using memory_space = typename sched_type::memory_space; enum { MinBlockSize = 64 }; enum { MaxBlockSize = 1024 }; @@ -185,10 +185,10 @@ namespace TestTaskScheduler { template struct TestTaskDependence { - typedef Scheduler sched_type; - typedef Kokkos::BasicFuture future_type; - typedef Kokkos::View accum_type; - typedef void value_type; + using sched_type = Scheduler; + using future_type = Kokkos::BasicFuture; + using accum_type = Kokkos::View; + using value_type = void; accum_type m_accum; long m_count; @@ -224,7 +224,7 @@ struct TestTaskDependence { } static void run(int n) { - typedef typename sched_type::memory_space memory_space; + using memory_space = typename sched_type::memory_space; enum { MemoryCapacity = 16000 }; enum { MinBlockSize = 64 }; @@ -264,11 +264,11 @@ struct TestTaskTeam { enum { SPAN = 33 }; // enum { SPAN = 1 }; - typedef void value_type; + using value_type = void; using sched_type = Scheduler; using future_type = Kokkos::BasicFuture; using ExecSpace = typename sched_type::execution_space; - typedef Kokkos::View view_type; + using view_type = Kokkos::View; future_type future; @@ -480,11 +480,11 @@ template struct TestTaskTeamValue { enum { SPAN = 8 }; - typedef long value_type; + using value_type = long; using sched_type = Scheduler; using future_type = Kokkos::BasicFuture; using ExecSpace = typename sched_type::execution_space; - typedef Kokkos::View view_type; + using view_type = Kokkos::View; future_type future; @@ -576,8 +576,8 @@ template struct TestTaskSpawnWithPool { using sched_type = Scheduler; using future_type = Kokkos::BasicFuture; - typedef void value_type; - using Space = typename sched_type::execution_space; + using value_type = void; + using Space = typename sched_type::execution_space; int m_count; Kokkos::MemoryPool m_pool; @@ -596,7 +596,7 @@ struct TestTaskSpawnWithPool { } static void run() { - typedef typename sched_type::memory_space memory_space; + using memory_space = typename sched_type::memory_space; enum { MemoryCapacity = 16000 }; enum { MinBlockSize = 64 }; @@ -793,7 +793,7 @@ struct TestMultipleDependence { } static void run(int depth) { - typedef typename sched_type::memory_space memory_space; + using memory_space = typename sched_type::memory_space; enum { MemoryCapacity = 1 << 30 }; enum { MinBlockSize = 64 }; diff --git a/lib/kokkos/core/unit_test/TestTeam.hpp b/lib/kokkos/core/unit_test/TestTeam.hpp index d1ee003969..023e3dfbb3 100644 --- a/lib/kokkos/core/unit_test/TestTeam.hpp +++ b/lib/kokkos/core/unit_test/TestTeam.hpp @@ -55,9 +55,9 @@ namespace { template struct TestTeamPolicy { - typedef typename Kokkos::TeamPolicy::member_type - team_member; - typedef Kokkos::View view_type; + using team_member = + typename Kokkos::TeamPolicy::member_type; + using view_type = Kokkos::View; view_type m_flags; @@ -120,9 +120,9 @@ struct TestTeamPolicy { static void test_for(const size_t league_size) { TestTeamPolicy functor(league_size); - typedef Kokkos::TeamPolicy policy_type; - typedef Kokkos::TeamPolicy - policy_type_init; + using policy_type = Kokkos::TeamPolicy; + using policy_type_init = + Kokkos::TeamPolicy; const int team_size = policy_type(league_size, 1) .team_size_max(functor, Kokkos::ParallelForTag()); @@ -139,7 +139,7 @@ struct TestTeamPolicy { struct ReduceTag {}; - typedef int64_t value_type; + using value_type = int64_t; KOKKOS_INLINE_FUNCTION void operator()(const team_member &member, value_type &update) const { @@ -156,9 +156,9 @@ struct TestTeamPolicy { static void test_reduce(const size_t league_size) { TestTeamPolicy functor(league_size); - typedef Kokkos::TeamPolicy policy_type; - typedef Kokkos::TeamPolicy - policy_type_reduce; + using policy_type = Kokkos::TeamPolicy; + using policy_type_reduce = + Kokkos::TeamPolicy; const int team_size = policy_type_reduce(league_size, 1) @@ -189,9 +189,9 @@ namespace Test { template class ReduceTeamFunctor { public: - typedef DeviceType execution_space; - typedef Kokkos::TeamPolicy policy_type; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using policy_type = Kokkos::TeamPolicy; + using size_type = typename execution_space::size_type; struct value_type { ScalarType value[3]; @@ -245,18 +245,18 @@ namespace { template class TestReduceTeam { public: - typedef DeviceType execution_space; - typedef Kokkos::TeamPolicy policy_type; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using policy_type = Kokkos::TeamPolicy; + using size_type = typename execution_space::size_type; TestReduceTeam(const size_type &nwork) { run_test(nwork); } void run_test(const size_type &nwork) { - typedef Test::ReduceTeamFunctor - functor_type; - typedef typename functor_type::value_type value_type; - typedef Kokkos::View - result_type; + using functor_type = + Test::ReduceTeamFunctor; + using value_type = typename functor_type::value_type; + using result_type = + Kokkos::View; enum { Count = 3 }; enum { Repeat = 100 }; @@ -299,9 +299,9 @@ namespace Test { template class ScanTeamFunctor { public: - typedef DeviceType execution_space; - typedef Kokkos::TeamPolicy policy_type; - typedef int64_t value_type; + using execution_space = DeviceType; + using policy_type = Kokkos::TeamPolicy; + using value_type = int64_t; Kokkos::View accum; Kokkos::View total; @@ -318,7 +318,7 @@ class ScanTeamFunctor { } struct JoinMax { - typedef int64_t value_type; + using value_type = int64_t; KOKKOS_INLINE_FUNCTION void join(value_type volatile &dst, @@ -341,11 +341,14 @@ class ScanTeamFunctor { if (m != ind.league_rank() + (ind.team_size() - 1)) { printf( - "ScanTeamFunctor[%d.%d of %d.%d] reduce_max_answer(%ld) != " - "reduce_max(%ld)\n", - ind.league_rank(), ind.team_rank(), ind.league_size(), - ind.team_size(), (int64_t)(ind.league_rank() + (ind.team_size() - 1)), - m); + "ScanTeamFunctor[%i.%i of %i.%i] reduce_max_answer(%li) != " + "reduce_max(%li)\n", + static_cast(ind.league_rank()), + static_cast(ind.team_rank()), + static_cast(ind.league_size()), + static_cast(ind.team_size()), + static_cast(ind.league_rank() + (ind.team_size() - 1)), + static_cast(m)); } // Scan: @@ -360,10 +363,13 @@ class ScanTeamFunctor { if (answer != result || answer != result2) { printf( - "ScanTeamFunctor[%d.%d of %d.%d] answer(%ld) != scan_first(%ld) or " - "scan_second(%ld)\n", - ind.league_rank(), ind.team_rank(), ind.league_size(), - ind.team_size(), answer, result, result2); + "ScanTeamFunctor[%i.%i of %i.%i] answer(%li) != scan_first(%li) or " + "scan_second(%li)\n", + static_cast(ind.league_rank()), + static_cast(ind.team_rank()), + static_cast(ind.league_size()), + static_cast(ind.team_size()), static_cast(answer), + static_cast(result), static_cast(result2)); error = 1; } @@ -377,16 +383,16 @@ class ScanTeamFunctor { template class TestScanTeam { public: - typedef DeviceType execution_space; - typedef int64_t value_type; - typedef Kokkos::TeamPolicy policy_type; - typedef Test::ScanTeamFunctor functor_type; + using execution_space = DeviceType; + using value_type = int64_t; + using policy_type = Kokkos::TeamPolicy; + using functor_type = Test::ScanTeamFunctor; TestScanTeam(const size_t nteam) { run_test(nteam); } void run_test(const size_t nteam) { - typedef Kokkos::View - result_type; + using result_type = + Kokkos::View; const unsigned REPEAT = 100000; unsigned Repeat; @@ -431,17 +437,17 @@ namespace Test { template struct SharedTeamFunctor { - typedef ExecSpace execution_space; - typedef int value_type; - typedef Kokkos::TeamPolicy policy_type; + using execution_space = ExecSpace; + using value_type = int; + using policy_type = Kokkos::TeamPolicy; enum { SHARED_COUNT = 1000 }; - typedef typename ExecSpace::scratch_memory_space shmem_space; + using shmem_space = typename ExecSpace::scratch_memory_space; // TBD: MemoryUnmanaged should be the default for shared memory space. - typedef Kokkos::View - shared_int_array_type; + using shared_int_array_type = + Kokkos::View; // Tell how much shared memory will be required by this functor. inline unsigned team_shmem_size(int /*team_size*/) const { @@ -458,10 +464,12 @@ struct SharedTeamFunctor { if ((shared_A.data() == nullptr && SHARED_COUNT > 0) || (shared_B.data() == nullptr && SHARED_COUNT > 0)) { printf( - "member( %d/%d , %d/%d ) Failed to allocate shared memory of size " + "member( %i/%i , %i/%i ) Failed to allocate shared memory of size " "%lu\n", - ind.league_rank(), ind.league_size(), ind.team_rank(), - ind.team_size(), static_cast(SHARED_COUNT)); + static_cast(ind.league_rank()), + static_cast(ind.league_size()), + static_cast(ind.team_rank()), static_cast(ind.team_size()), + static_cast(SHARED_COUNT)); ++update; // Failure to allocate is an error. } else { @@ -496,10 +504,10 @@ struct TestSharedTeam { TestSharedTeam() { run(); } void run() { - typedef Test::SharedTeamFunctor Functor; - typedef Kokkos::View - result_type; + using Functor = Test::SharedTeamFunctor; + using result_type = + Kokkos::View; const size_t team_size = Kokkos::TeamPolicy(8192, 1).team_size_max( @@ -527,18 +535,15 @@ struct TestLambdaSharedTeam { TestLambdaSharedTeam() { run(); } void run() { - typedef Test::SharedTeamFunctor Functor; - // typedef Kokkos::View< typename Functor::value_type, Kokkos::HostSpace, - // Kokkos::MemoryUnmanaged > result_type; - typedef Kokkos::View - result_type; + using Functor = Test::SharedTeamFunctor; + using result_type = Kokkos::View; - typedef typename ExecSpace::scratch_memory_space shmem_space; + using shmem_space = typename ExecSpace::scratch_memory_space; // TBD: MemoryUnmanaged should be the default for shared memory space. - typedef Kokkos::View - shared_int_array_type; + using shared_int_array_type = + Kokkos::View; const int SHARED_COUNT = 1000; int team_size = 1; @@ -566,7 +571,7 @@ struct TestLambdaSharedTeam { if ((shared_A.data() == nullptr && SHARED_COUNT > 0) || (shared_B.data() == nullptr && SHARED_COUNT > 0)) { printf("Failed to allocate shared memory of size %lu\n", - static_cast(SHARED_COUNT)); + static_cast(SHARED_COUNT)); ++update; // Failure to allocate is an error. } else { @@ -606,18 +611,18 @@ namespace Test { template struct ScratchTeamFunctor { - typedef ExecSpace execution_space; - typedef int value_type; - typedef Kokkos::TeamPolicy policy_type; + using execution_space = ExecSpace; + using value_type = int; + using policy_type = Kokkos::TeamPolicy; enum { SHARED_TEAM_COUNT = 100 }; enum { SHARED_THREAD_COUNT = 10 }; - typedef typename ExecSpace::scratch_memory_space shmem_space; + using shmem_space = typename ExecSpace::scratch_memory_space; // TBD: MemoryUnmanaged should be the default for shared memory space. - typedef Kokkos::View - shared_int_array_type; + using shared_int_array_type = + Kokkos::View; KOKKOS_INLINE_FUNCTION void operator()(const typename policy_type::member_type &ind, @@ -633,7 +638,7 @@ struct ScratchTeamFunctor { (scratch_A.data() == nullptr && SHARED_TEAM_COUNT > 0) || (scratch_B.data() == nullptr && SHARED_THREAD_COUNT > 0)) { printf("Failed to allocate shared memory of size %lu\n", - static_cast(SHARED_TEAM_COUNT)); + static_cast(SHARED_TEAM_COUNT)); ++update; // Failure to allocate is an error. } else { @@ -684,11 +689,11 @@ struct TestScratchTeam { TestScratchTeam() { run(); } void run() { - typedef Test::ScratchTeamFunctor Functor; - typedef Kokkos::View - result_type; - typedef Kokkos::TeamPolicy p_type; + using Functor = Test::ScratchTeamFunctor; + using result_type = + Kokkos::View; + using p_type = Kokkos::TeamPolicy; typename Functor::value_type error_count = 0; @@ -842,8 +847,8 @@ struct TagFor {}; template struct ClassNoShmemSizeFunction { - typedef typename Kokkos::TeamPolicy::member_type - member_type; + using member_type = + typename Kokkos::TeamPolicy::member_type; Kokkos::View > errors; @@ -924,8 +929,8 @@ struct ClassNoShmemSizeFunction { template struct ClassWithShmemSizeFunction { - typedef typename Kokkos::TeamPolicy::member_type - member_type; + using member_type = + typename Kokkos::TeamPolicy::member_type; Kokkos::View > errors; @@ -1097,7 +1102,7 @@ struct TestShmemSize { TestShmemSize() { run(); } void run() { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; size_t d1 = 5; size_t d2 = 6; @@ -1196,9 +1201,9 @@ struct TestTeamBroadcast< const value_type off) { TestTeamBroadcast functor(league_size, off); - typedef Kokkos::TeamPolicy policy_type; - typedef Kokkos::TeamPolicy - policy_type_f; + using policy_type = Kokkos::TeamPolicy; + using policy_type_f = + Kokkos::TeamPolicy; const int team_size = policy_type_f(league_size, 1) @@ -1341,9 +1346,9 @@ struct TestTeamBroadcast< const value_type off) { TestTeamBroadcast functor(league_size, off); - typedef Kokkos::TeamPolicy policy_type; - typedef Kokkos::TeamPolicy - policy_type_f; + using policy_type = Kokkos::TeamPolicy; + using policy_type_f = + Kokkos::TeamPolicy; const int team_size = policy_type_f(league_size, 1) @@ -1397,10 +1402,10 @@ struct TestScratchAlignment { test(true); test(false); } - typedef Kokkos::View - ScratchView; - typedef Kokkos::View - ScratchViewInt; + using ScratchView = + Kokkos::View; + using ScratchViewInt = + Kokkos::View; void test(bool allocate_small) { int shmem_size = ScratchView::shmem_size(11); if (allocate_small) shmem_size += ScratchViewInt::shmem_size(1); diff --git a/lib/kokkos/core/unit_test/TestTeamTeamSize.hpp b/lib/kokkos/core/unit_test/TestTeamTeamSize.hpp index 0703f90cf8..1780d074f6 100644 --- a/lib/kokkos/core/unit_test/TestTeamTeamSize.hpp +++ b/lib/kokkos/core/unit_test/TestTeamTeamSize.hpp @@ -91,11 +91,11 @@ struct FunctorReduce { }; } // namespace -typedef Kokkos::TeamPolicy policy_type; -typedef Kokkos::TeamPolicy > - policy_type_128_8; -typedef Kokkos::TeamPolicy > - policy_type_1024_2; +using policy_type = Kokkos::TeamPolicy; +using policy_type_128_8 = + Kokkos::TeamPolicy >; +using policy_type_1024_2 = + Kokkos::TeamPolicy >; template void test_team_policy_max_recommended_static_size(int scratch_size) { diff --git a/lib/kokkos/core/unit_test/TestTeamVector.hpp b/lib/kokkos/core/unit_test/TestTeamVector.hpp index c313988efc..659df5430f 100644 --- a/lib/kokkos/core/unit_test/TestTeamVector.hpp +++ b/lib/kokkos/core/unit_test/TestTeamVector.hpp @@ -49,196 +49,30 @@ #include #include #include - -namespace TestTeamVector { - -struct my_complex { - double re, im; - int dummy; - - KOKKOS_INLINE_FUNCTION - my_complex() { - re = 0.0; - im = 0.0; - dummy = 0; - } - - KOKKOS_INLINE_FUNCTION - my_complex(const my_complex &src) { - re = src.re; - im = src.im; - dummy = src.dummy; - } - - KOKKOS_INLINE_FUNCTION - my_complex &operator=(const my_complex &src) { - re = src.re; - im = src.im; - dummy = src.dummy; - return *this; - } - - KOKKOS_INLINE_FUNCTION - my_complex &operator=(const volatile my_complex &src) { - re = src.re; - im = src.im; - dummy = src.dummy; - return *this; - } - - KOKKOS_INLINE_FUNCTION - volatile my_complex &operator=(const my_complex &src) volatile { - re = src.re; - im = src.im; - dummy = src.dummy; - return *this; - } - - KOKKOS_INLINE_FUNCTION - volatile my_complex &operator=(const volatile my_complex &src) volatile { - re = src.re; - im = src.im; - dummy = src.dummy; - return *this; - } - - KOKKOS_INLINE_FUNCTION - my_complex(const volatile my_complex &src) { - re = src.re; - im = src.im; - dummy = src.dummy; - } - - KOKKOS_INLINE_FUNCTION - my_complex(const double &val) { - re = val; - im = 0.0; - dummy = 0; - } - - KOKKOS_INLINE_FUNCTION - my_complex &operator+=(const my_complex &src) { - re += src.re; - im += src.im; - dummy += src.dummy; - return *this; - } - - KOKKOS_INLINE_FUNCTION - void operator+=(const volatile my_complex &src) volatile { - re += src.re; - im += src.im; - dummy += src.dummy; - } - - KOKKOS_INLINE_FUNCTION - my_complex operator+(const my_complex &src) { - my_complex tmp = *this; - tmp.re += src.re; - tmp.im += src.im; - tmp.dummy += src.dummy; - return tmp; - } - - KOKKOS_INLINE_FUNCTION - my_complex operator+(const volatile my_complex &src) volatile { - my_complex tmp = *this; - tmp.re += src.re; - tmp.im += src.im; - tmp.dummy += src.dummy; - return tmp; - } - - KOKKOS_INLINE_FUNCTION - my_complex &operator*=(const my_complex &src) { - double re_tmp = re * src.re - im * src.im; - double im_tmp = re * src.im + im * src.re; - re = re_tmp; - im = im_tmp; - dummy *= src.dummy; - return *this; - } - - KOKKOS_INLINE_FUNCTION - void operator*=(const volatile my_complex &src) volatile { - double re_tmp = re * src.re - im * src.im; - double im_tmp = re * src.im + im * src.re; - re = re_tmp; - im = im_tmp; - dummy *= src.dummy; - } - - KOKKOS_INLINE_FUNCTION - bool operator==(const my_complex &src) { - return (re == src.re) && (im == src.im) && (dummy == src.dummy); - } - - KOKKOS_INLINE_FUNCTION - bool operator!=(const my_complex &src) { - return (re != src.re) || (im != src.im) || (dummy != src.dummy); - } - - KOKKOS_INLINE_FUNCTION - bool operator!=(const double &val) { - return (re != val) || (im != 0) || (dummy != 0); - } - - KOKKOS_INLINE_FUNCTION - my_complex &operator=(const int &val) { - re = val; - im = 0.0; - dummy = 0; - return *this; - } - - KOKKOS_INLINE_FUNCTION - my_complex &operator=(const double &val) { - re = val; - im = 0.0; - dummy = 0; - return *this; - } - - KOKKOS_INLINE_FUNCTION - operator double() { return re; } -}; -} // namespace TestTeamVector - -namespace Kokkos { -template <> -struct reduction_identity { - typedef reduction_identity t_red_ident; - KOKKOS_FORCEINLINE_FUNCTION static TestTeamVector::my_complex sum() { - return TestTeamVector::my_complex(t_red_ident::sum()); - } - KOKKOS_FORCEINLINE_FUNCTION static TestTeamVector::my_complex prod() { - return TestTeamVector::my_complex(t_red_ident::prod()); - } -}; -} // namespace Kokkos +#include namespace TestTeamVector { template struct functor_team_for { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; functor_team_for(Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_int; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_int = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_int::shmem_size(team_size * 13); } KOKKOS_INLINE_FUNCTION void operator()(typename policy_type::member_type team) const { - typedef typename shmem_space::size_type size_type; + using size_type = typename shmem_space::size_type; const size_type shmemSize = team.team_size() * 13; shared_int values = shared_int(team.team_shmem(), shmemSize); @@ -286,8 +120,8 @@ struct functor_team_for { template struct functor_team_reduce { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -295,9 +129,9 @@ struct functor_team_reduce { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_scalar_t; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_scalar_t = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_scalar_t::shmem_size(team_size * 13); } @@ -335,7 +169,7 @@ struct functor_team_reduce { printf("FAILED team_parallel_reduce %i %i %lf %lf %lu\n", team.league_rank(), team.team_rank(), static_cast(test), static_cast(value), - sizeof(Scalar)); + static_cast(sizeof(Scalar))); } flag() = 1; @@ -346,7 +180,8 @@ struct functor_team_reduce { "FAILED team_parallel_reduce with shared result %i %i %lf %lf " "%lu\n", team.league_rank(), team.team_rank(), static_cast(test), - static_cast(shared_value(0)), sizeof(Scalar)); + static_cast(shared_value(0)), + static_cast(sizeof(Scalar))); } flag() = 1; @@ -357,8 +192,8 @@ struct functor_team_reduce { template struct functor_team_reduce_reducer { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -366,9 +201,9 @@ struct functor_team_reduce_reducer { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_scalar_t; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_scalar_t = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_scalar_t::shmem_size(team_size * 13); } @@ -423,8 +258,8 @@ struct functor_team_reduce_reducer { template struct functor_team_vector_for { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -432,16 +267,16 @@ struct functor_team_vector_for { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_int; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_int = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_int::shmem_size(team_size * 13); } KOKKOS_INLINE_FUNCTION void operator()(typename policy_type::member_type team) const { - typedef typename shared_int::size_type size_type; + using size_type = typename shared_int::size_type; const size_type shmemSize = team.team_size() * 13; shared_int values = shared_int(team.team_shmem(), shmemSize); @@ -491,17 +326,17 @@ struct functor_team_vector_for { template struct functor_team_vector_reduce { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; functor_team_vector_reduce( Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_int; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_int = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_int::shmem_size(team_size * 13); } @@ -531,7 +366,7 @@ struct functor_team_vector_reduce { printf("FAILED team_vector_parallel_reduce %i %i %f %f %lu\n", team.league_rank(), team.team_rank(), static_cast(test), static_cast(value), - sizeof(Scalar)); + static_cast(sizeof(Scalar))); } flag() = 1; @@ -542,8 +377,8 @@ struct functor_team_vector_reduce { template struct functor_team_vector_reduce_reducer { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -551,9 +386,9 @@ struct functor_team_vector_reduce_reducer { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_int; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_int = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_int::shmem_size(team_size * 13); } @@ -591,8 +426,8 @@ struct functor_team_vector_reduce_reducer { template struct functor_vec_single { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; int nStart; @@ -624,7 +459,7 @@ struct functor_vec_single { Kokkos::ThreadVectorRange(team, nStart, nEnd), [&](int /*i*/, Scalar &val) { val += value; }, value2); - if (value2 != (value * (nEnd - nStart))) { + if (value2 != (value * Scalar(nEnd - nStart))) { printf("FAILED vector_single broadcast %i %i %f %f\n", team.league_rank(), team.team_rank(), (double)value2, (double)value); @@ -635,17 +470,17 @@ struct functor_vec_single { template struct functor_vec_for { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; functor_vec_for(Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_int; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_int = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_int::shmem_size(team_size * 13); } @@ -690,8 +525,8 @@ struct functor_vec_for { template struct functor_vec_red { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -724,8 +559,8 @@ struct functor_vec_red { template struct functor_vec_red_reducer { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -763,8 +598,8 @@ struct functor_vec_red_reducer { template struct functor_vec_scan { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; functor_vec_scan(Kokkos::View flag_) @@ -794,9 +629,9 @@ struct functor_vec_scan { template struct functor_reduce { - typedef double value_type; - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using value_type = double; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; functor_reduce(Kokkos::View flag_) @@ -882,8 +717,14 @@ bool Test(int test) { test_scalar(317, team_size, test); passed = passed && test_scalar(317, team_size, test); passed = passed && test_scalar(317, team_size, test); - passed = - passed && test_scalar(317, team_size, test); + passed = passed && + test_scalar(317, team_size, test); + passed = passed && test_scalar, ExecutionSpace>( + 317, team_size, test); + passed = passed && test_scalar, ExecutionSpace>( + 317, team_size, test); + passed = passed && test_scalar, ExecutionSpace>( + 317, team_size, test); return passed; } @@ -899,8 +740,8 @@ namespace Test { template class TestTripleNestedReduce { public: - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; TestTripleNestedReduce(const size_type &nrows, const size_type &ncols, const size_type &team_size, @@ -920,17 +761,17 @@ class TestTripleNestedReduce { } #endif - // typedef Kokkos::LayoutLeft Layout; - typedef Kokkos::LayoutRight Layout; + // using Layout = Kokkos::LayoutLeft; + using Layout = Kokkos::LayoutRight; - typedef Kokkos::View ViewVector; - typedef Kokkos::View ViewMatrix; + using ViewVector = Kokkos::View; + using ViewMatrix = Kokkos::View; ViewVector y("y", nrows); ViewVector x("x", ncols); ViewMatrix A("A", nrows, ncols); - typedef Kokkos::RangePolicy range_policy; + using range_policy = Kokkos::RangePolicy; // Initialize y vector. Kokkos::parallel_for( @@ -941,8 +782,8 @@ class TestTripleNestedReduce { range_policy(0, ncols), KOKKOS_LAMBDA(const int i) { x(i) = 1; }); Kokkos::fence(); - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; // Initialize A matrix, note 2D indexing computation. Kokkos::parallel_for( @@ -1000,8 +841,8 @@ class TestTripleNestedReduce { template class TestTripleNestedReduce { public: - typedef DeviceType execution_space; - typedef typename execution_space::size_type size_type; + using execution_space = DeviceType; + using size_type = typename execution_space::size_type; TestTripleNestedReduce(const size_type &, const size_type, const size_type &, const size_type) {} @@ -1009,7 +850,7 @@ class TestTripleNestedReduce { #endif -#if !defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) +#if !(defined(KOKKOS_IMPL_CUDA_CLANG_WORKAROUND) || defined(KOKKOS_ENABLE_HIP)) TEST(TEST_CATEGORY, team_vector) { ASSERT_TRUE((TestTeamVector::Test(0))); ASSERT_TRUE((TestTeamVector::Test(1))); diff --git a/lib/kokkos/core/unit_test/TestTeamVectorRange.hpp b/lib/kokkos/core/unit_test/TestTeamVectorRange.hpp index cc83785185..1b64fef050 100644 --- a/lib/kokkos/core/unit_test/TestTeamVectorRange.hpp +++ b/lib/kokkos/core/unit_test/TestTeamVectorRange.hpp @@ -207,7 +207,7 @@ struct my_complex { namespace Kokkos { template <> struct reduction_identity { - typedef reduction_identity t_red_ident; + using t_red_ident = reduction_identity; KOKKOS_FORCEINLINE_FUNCTION static TestTeamVectorRange::my_complex sum() { return TestTeamVectorRange::my_complex(t_red_ident::sum()); } @@ -221,8 +221,8 @@ namespace TestTeamVectorRange { template struct functor_teamvector_for { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -230,16 +230,16 @@ struct functor_teamvector_for { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_int; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_int = + Kokkos::View; unsigned team_shmem_size(int /*team_size*/) const { return shared_int::shmem_size(131); } KOKKOS_INLINE_FUNCTION void operator()(typename policy_type::member_type team) const { - typedef typename shmem_space::size_type size_type; + using size_type = typename shmem_space::size_type; const size_type shmemSize = 131; shared_int values = shared_int(team.team_shmem(), shmemSize); @@ -290,8 +290,8 @@ struct functor_teamvector_for { template struct functor_teamvector_reduce { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -299,9 +299,9 @@ struct functor_teamvector_reduce { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_scalar_t; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_scalar_t = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_scalar_t::shmem_size(team_size * 13); } @@ -345,9 +345,9 @@ struct functor_teamvector_reduce { if (test != value) { if (team.league_rank() == 0) { printf("FAILED teamvector_parallel_reduce %i %i %lf %lf %lu\n", - team.league_rank(), team.team_rank(), + (int)team.league_rank(), (int)team.team_rank(), static_cast(test), static_cast(value), - sizeof(Scalar)); + static_cast(sizeof(Scalar))); } flag() = 1; @@ -357,8 +357,10 @@ struct functor_teamvector_reduce { printf( "FAILED teamvector_parallel_reduce with shared result %i %i %lf " "%lf %lu\n", - team.league_rank(), team.team_rank(), static_cast(test), - static_cast(shared_value(0)), sizeof(Scalar)); + static_cast(team.league_rank()), + static_cast(team.team_rank()), static_cast(test), + static_cast(shared_value(0)), + static_cast(sizeof(Scalar))); } flag() = 1; @@ -369,8 +371,8 @@ struct functor_teamvector_reduce { template struct functor_teamvector_reduce_reducer { - typedef Kokkos::TeamPolicy policy_type; - typedef ExecutionSpace execution_space; + using policy_type = Kokkos::TeamPolicy; + using execution_space = ExecutionSpace; Kokkos::View flag; @@ -378,9 +380,9 @@ struct functor_teamvector_reduce_reducer { Kokkos::View flag_) : flag(flag_) {} - typedef typename ExecutionSpace::scratch_memory_space shmem_space; - typedef Kokkos::View - shared_scalar_t; + using shmem_space = typename ExecutionSpace::scratch_memory_space; + using shared_scalar_t = + Kokkos::View; unsigned team_shmem_size(int team_size) const { return shared_scalar_t::shmem_size(team_size * 13); } diff --git a/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp b/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp index b9c16f506c..a0bc7c4304 100644 --- a/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp +++ b/lib/kokkos/core/unit_test/TestTemplateMetaFunctions.hpp @@ -50,8 +50,8 @@ namespace { template struct SumPlain { - typedef ExecutionSpace execution_space; - typedef typename Kokkos::View type; + using execution_space = ExecutionSpace; + using type = typename Kokkos::View; type view; @@ -63,9 +63,9 @@ struct SumPlain { template struct SumInitJoinFinalValueType { - typedef ExecutionSpace execution_space; - typedef typename Kokkos::View type; - typedef Scalar value_type; + using execution_space = ExecutionSpace; + using type = typename Kokkos::View; + using value_type = Scalar; type view; @@ -85,9 +85,9 @@ struct SumInitJoinFinalValueType { template struct SumInitJoinFinalValueType2 { - typedef ExecutionSpace execution_space; - typedef typename Kokkos::View type; - typedef Scalar value_type; + using execution_space = ExecutionSpace; + using type = typename Kokkos::View; + using value_type = Scalar; type view; @@ -107,9 +107,9 @@ struct SumInitJoinFinalValueType2 { template struct SumInitJoinFinalValueTypeArray { - typedef ExecutionSpace execution_space; - typedef typename Kokkos::View type; - typedef Scalar value_type[]; + using execution_space = ExecutionSpace; + using type = typename Kokkos::View; + using value_type = Scalar[]; type view; int n; @@ -140,9 +140,9 @@ struct SumInitJoinFinalValueTypeArray { template struct SumWrongInitJoinFinalValueType { - typedef ExecutionSpace execution_space; - typedef typename Kokkos::View type; - typedef Scalar value_type; + using execution_space = ExecutionSpace; + using type = typename Kokkos::View; + using value_type = Scalar; type view; @@ -162,7 +162,7 @@ struct SumWrongInitJoinFinalValueType { template void TestTemplateMetaFunctions() { - typedef typename Kokkos::View type; + using type = typename Kokkos::View; type a("A", 100); /* int sum_plain_has_init_arg = Kokkos::Impl::FunctorHasInit< SumPlain -#include - -namespace TestTile { - -template -struct ReduceTileErrors { - typedef Device execution_space; - typedef Kokkos::View array_type; - typedef Kokkos::View - tile_type; - typedef ptrdiff_t value_type; - - array_type m_array; - - ReduceTileErrors(array_type a) : m_array(a) {} - - KOKKOS_INLINE_FUNCTION - static void init(value_type& errors) { errors = 0; } - - KOKKOS_INLINE_FUNCTION - static void join(volatile value_type& errors, - const volatile value_type& src_errors) { - errors += src_errors; - } - - // Initialize. - KOKKOS_INLINE_FUNCTION - void operator()(size_t iwork) const { - const size_t i = iwork % m_array.extent(0); - const size_t j = iwork / m_array.extent(0); - - if (j < m_array.extent(1)) { - m_array(i, j) = &m_array(i, j) - &m_array(0, 0); - - // printf( "m_array(%d, %d) = %d\n", int( i ), int( j ), int( m_array( i, - // j ) ) ); - } - } - - // Verify: - KOKKOS_INLINE_FUNCTION - void operator()(size_t iwork, value_type& errors) const { - const size_t tile_dim0 = - (m_array.extent(0) + TileLayout::N0 - 1) / TileLayout::N0; - const size_t tile_dim1 = - (m_array.extent(1) + TileLayout::N1 - 1) / TileLayout::N1; - - const size_t itile = iwork % tile_dim0; - const size_t jtile = iwork / tile_dim0; - - if (jtile < tile_dim1) { - tile_type tile = Kokkos::tile_subview(m_array, itile, jtile); - - if (tile(0, 0) != ptrdiff_t((itile + jtile * tile_dim0) * TileLayout::N0 * - TileLayout::N1)) { - ++errors; - } else { - for (size_t j = 0; j < size_t(TileLayout::N1); ++j) { - for (size_t i = 0; i < size_t(TileLayout::N0); ++i) { - const size_t iglobal = i + itile * TileLayout::N0; - const size_t jglobal = j + jtile * TileLayout::N1; - - if (iglobal < m_array.extent(0) && jglobal < m_array.extent(1)) { - if (tile(i, j) != ptrdiff_t(tile(0, 0) + i + j * TileLayout::N0)) - ++errors; - - // printf( "tile(%d, %d)(%d, %d) = %d\n", int( itile ), int( jtile - // ), int( i ), int( j ), int( tile( i, j ) ) ); - } - } - } - } - } - } -}; - -template -void test(const size_t dim0, const size_t dim1) { - typedef Kokkos::LayoutTileLeft array_layout; - typedef ReduceTileErrors functor_type; - - const size_t tile_dim0 = (dim0 + N0 - 1) / N0; - const size_t tile_dim1 = (dim1 + N1 - 1) / N1; - - typename functor_type::array_type array("", dim0, dim1); - - Kokkos::parallel_for(Kokkos::RangePolicy(0, dim0 * dim1), - functor_type(array)); - - ptrdiff_t error = 0; - - Kokkos::parallel_reduce( - Kokkos::RangePolicy(0, tile_dim0 * tile_dim1), - functor_type(array), error); - - EXPECT_EQ(error, ptrdiff_t(0)); -} - -} // namespace TestTile - -namespace Test { -TEST(TEST_CATEGORY, tile_layout) { - TestTile::test(1, 1); - TestTile::test(2, 3); - TestTile::test(9, 10); - - TestTile::test(1, 1); - TestTile::test(2, 3); - TestTile::test(4, 4); - TestTile::test(9, 9); - - TestTile::test(9, 9); - TestTile::test(9, 9); - - TestTile::test(1, 1); - TestTile::test(4, 4); - TestTile::test(9, 9); - TestTile::test(9, 11); - - TestTile::test(1, 1); - TestTile::test(4, 4); - TestTile::test(9, 9); - TestTile::test(9, 11); -} - -} // namespace Test - -#endif // KOKKOS_ENABLE_DEPRECATED_CODE -//===================================================================== - -#endif // TEST_TILE_HPP diff --git a/lib/kokkos/core/unit_test/TestUniqueToken.hpp b/lib/kokkos/core/unit_test/TestUniqueToken.hpp index c85ba1afc3..e1455d7bbb 100644 --- a/lib/kokkos/core/unit_test/TestUniqueToken.hpp +++ b/lib/kokkos/core/unit_test/TestUniqueToken.hpp @@ -48,15 +48,13 @@ namespace Test { -template +template class TestUniqueToken { public: - typedef typename Space::execution_space execution_space; - typedef Kokkos::View view_type; + using execution_space = typename Space::execution_space; + using view_type = Kokkos::View; - Kokkos::Experimental::UniqueToken< - execution_space, Kokkos::Experimental::UniqueTokenScope::Global> - tokens; + Kokkos::Experimental::UniqueToken tokens; view_type verify; view_type counts; @@ -64,7 +62,9 @@ class TestUniqueToken { KOKKOS_INLINE_FUNCTION void operator()(long) const { - const int32_t t = tokens.acquire(); + Kokkos::Experimental::AcquireUniqueToken token_val( + tokens); + const int32_t t = token_val.value(); bool ok = true; @@ -79,8 +79,6 @@ class TestUniqueToken { if (!ok) { Kokkos::atomic_fetch_add(&errors(0), 1); } - - tokens.release(t); } TestUniqueToken() @@ -129,6 +127,118 @@ class TestUniqueToken { } }; -TEST(TEST_CATEGORY, unique_token) { TestUniqueToken::run(); } +TEST(TEST_CATEGORY, unique_token_global) { + TestUniqueToken::run(); +} + +TEST(TEST_CATEGORY, unique_token_instance) { + TestUniqueToken::run(); +} + +template +class TestAcquireTeamUniqueToken { + public: + using execution_space = typename Space::execution_space; + using view_type = Kokkos::View; + using scratch_view = + Kokkos::View; + using team_policy_type = Kokkos::TeamPolicy; + using team_member_type = typename team_policy_type::member_type; + using tokens_type = Kokkos::Experimental::UniqueToken; + + tokens_type tokens; + + view_type verify; + view_type counts; + view_type errors; + + KOKKOS_INLINE_FUNCTION + void operator()(team_member_type team) const { + Kokkos::Experimental::AcquireTeamUniqueToken token_val( + tokens, team); + scratch_view team_rank_0_token_val(team.team_scratch(0)); + const int32_t t = token_val.value(); + + bool ok = true; + + ok = ok && 0 <= t; + ok = ok && t < tokens.size(); + + Kokkos::single(Kokkos::PerTeam(team), [&]() { + ok = ok && 0 == Kokkos::atomic_fetch_add(&verify(t), 1); + + Kokkos::atomic_fetch_add(&counts(t), 1); + + ok = ok && 1 == Kokkos::atomic_fetch_add(&verify(t), -1); + }); + + if (team.team_rank() == 0) { + team_rank_0_token_val() = t; + } + team.team_barrier(); + ok = ok && team_rank_0_token_val() == t; + + if (!ok) { + Kokkos::atomic_fetch_add(&errors(0), 1); + } + } + + TestAcquireTeamUniqueToken(int team_size) + : tokens(execution_space::concurrency() / team_size, execution_space()), + verify("TestAcquireTeamUniqueTokenVerify", tokens.size()), + counts("TestAcquireTeamUniqueTokenCounts", tokens.size()), + errors("TestAcquireTeamUniqueTokenErrors", 1) {} + + static void run() { + const int max_team_size = team_policy_type(1, 1).team_size_max( + TestAcquireTeamUniqueToken(1), Kokkos::ParallelForTag()); + const int team_size = std::min(2, max_team_size); + TestAcquireTeamUniqueToken self(team_size); + + { + const int duplicate = 100; + const long n = duplicate * self.tokens.size(); + + team_policy_type team_policy(n, team_size); + team_policy.set_scratch_size( + 0, Kokkos::PerTeam(Kokkos::Experimental::AcquireTeamUniqueToken< + team_policy_type>::shmem_size() + + scratch_view::shmem_size())); + + Kokkos::parallel_for(team_policy, self); + Kokkos::fence(); + } + + typename view_type::HostMirror host_counts = + Kokkos::create_mirror_view(self.counts); + + Kokkos::deep_copy(host_counts, self.counts); + + int32_t max = 0; + + { + const long n = host_counts.extent(0); + for (long i = 0; i < n; ++i) { + if (max < host_counts[i]) max = host_counts[i]; + } + } + + std::cout << "TestAcquireTeamUniqueToken max reuse = " << max << std::endl; + + typename view_type::HostMirror host_errors = + Kokkos::create_mirror_view(self.errors); + + Kokkos::deep_copy(host_errors, self.errors); + + ASSERT_EQ(host_errors(0), 0); + } +}; + +TEST(TEST_CATEGORY, acquire_team_unique_token) { + TestAcquireTeamUniqueToken::run(); +} } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestViewAPI.hpp b/lib/kokkos/core/unit_test/TestViewAPI.hpp index b9847773b6..717d870719 100644 --- a/lib/kokkos/core/unit_test/TestViewAPI.hpp +++ b/lib/kokkos/core/unit_test/TestViewAPI.hpp @@ -65,12 +65,12 @@ size_t allocation_count(const Kokkos::View &view) { template struct TestViewOperator { - typedef typename DeviceType::execution_space execution_space; + using execution_space = typename DeviceType::execution_space; enum { N = 1000 }; enum { D = 3 }; - typedef Kokkos::View view_type; + using view_type = Kokkos::View; const view_type v1; const view_type v2; @@ -97,11 +97,11 @@ struct TestViewOperator_LeftAndRight; template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -112,11 +112,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; - typedef Kokkos::View - stride_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; + using stride_view = + Kokkos::View; left_view left; right_view right; @@ -193,11 +193,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -208,9 +208,9 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; left_view left; right_view right; @@ -271,11 +271,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -286,9 +286,9 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; left_view left; right_view right; @@ -347,11 +347,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -362,11 +362,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; - typedef Kokkos::View - stride_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; + using stride_view = + Kokkos::View; left_view left; right_view right; @@ -435,11 +435,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -450,9 +450,9 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; left_view left; right_view right; @@ -505,11 +505,11 @@ struct TestViewOperator_LeftAndRight { template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -520,11 +520,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; - typedef Kokkos::View - stride_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; + using stride_view = + Kokkos::View; left_view left; right_view right; @@ -586,32 +586,23 @@ struct TestViewOperator_LeftAndRight { for (unsigned i0 = 0; i0 < unsigned(left.extent(0)); ++i0) for (unsigned i1 = 0; i1 < unsigned(left.extent(1)); ++i1) for (unsigned i2 = 0; i2 < unsigned(left.extent(2)); ++i2) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (&left(i0, i1, i2) != &left(i0, i1, i2, 0, 0, 0, 0, 0)) { - update |= 3; - } - if (&right(i0, i1, i2) != &right(i0, i1, i2, 0, 0, 0, 0, 0)) { - update |= 3; - } -#else if (&left(i0, i1, i2) != &left.access(i0, i1, i2, 0, 0, 0, 0, 0)) { update |= 3; } if (&right(i0, i1, i2) != &right.access(i0, i1, i2, 0, 0, 0, 0, 0)) { update |= 3; } -#endif } } }; template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -622,9 +613,9 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; left_view left; right_view right; @@ -671,32 +662,23 @@ struct TestViewOperator_LeftAndRight { for (unsigned i0 = 0; i0 < unsigned(left.extent(0)); ++i0) for (unsigned i1 = 0; i1 < unsigned(left.extent(1)); ++i1) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (&left(i0, i1) != &left(i0, i1, 0, 0, 0, 0, 0, 0)) { - update |= 3; - } - if (&right(i0, i1) != &right(i0, i1, 0, 0, 0, 0, 0, 0)) { - update |= 3; - } -#else if (&left(i0, i1) != &left.access(i0, i1, 0, 0, 0, 0, 0, 0)) { update |= 3; } if (&right(i0, i1) != &right.access(i0, i1, 0, 0, 0, 0, 0, 0)) { update |= 3; } -#endif } } }; template struct TestViewOperator_LeftAndRight { - typedef typename DeviceType::execution_space execution_space; - typedef typename DeviceType::memory_space memory_space; - typedef typename execution_space::size_type size_type; + using execution_space = typename DeviceType::execution_space; + using memory_space = typename DeviceType::memory_space; + using size_type = typename execution_space::size_type; - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION static void join(volatile value_type &update, @@ -707,11 +689,11 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION static void init(value_type &update) { update = 0; } - typedef Kokkos::View left_view; - typedef Kokkos::View - right_view; - typedef Kokkos::View - stride_view; + using left_view = Kokkos::View; + using right_view = + Kokkos::View; + using stride_view = + Kokkos::View; left_view left; right_view right; @@ -741,21 +723,12 @@ struct TestViewOperator_LeftAndRight { KOKKOS_INLINE_FUNCTION void operator()(const size_type, value_type &update) const { for (unsigned i0 = 0; i0 < unsigned(left.extent(0)); ++i0) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (&left(i0) != &left(i0, 0, 0, 0, 0, 0, 0, 0)) { - update |= 3; - } - if (&right(i0) != &right(i0, 0, 0, 0, 0, 0, 0, 0)) { - update |= 3; - } -#else if (&left(i0) != &left.access(i0, 0, 0, 0, 0, 0, 0, 0)) { update |= 3; } if (&right(i0) != &right.access(i0, 0, 0, 0, 0, 0, 0, 0)) { update |= 3; } -#endif if (&left(i0) != &left_stride(i0)) { update |= 4; } @@ -846,6 +819,44 @@ struct TestViewMirror { return v; } + static void test_allocated() { + using ExecutionSpace = typename DeviceType::execution_space; + using dynamic_view = Kokkos::View; + using static_view = Kokkos::View; + using unmanaged_view = + Kokkos::View >; + int const N = 100; + + dynamic_view d1; + static_view s1; + unmanaged_view u1; + ASSERT_FALSE(d1.is_allocated()); + ASSERT_FALSE(s1.is_allocated()); + ASSERT_FALSE(u1.is_allocated()); + + d1 = dynamic_view("d1", N); + dynamic_view d2(d1); + dynamic_view d3("d3", N); + ASSERT_TRUE(d1.is_allocated()); + ASSERT_TRUE(d2.is_allocated()); + ASSERT_TRUE(d3.is_allocated()); + + s1 = static_view("s1"); + static_view s2(s1); + static_view s3("s3"); + ASSERT_TRUE(s1.is_allocated()); + ASSERT_TRUE(s2.is_allocated()); + ASSERT_TRUE(s3.is_allocated()); + + u1 = unmanaged_view(d1.data(), N); + unmanaged_view u2(u1); + unmanaged_view u3(d1.data(), N); + ASSERT_TRUE(u1.is_allocated()); + ASSERT_TRUE(u2.is_allocated()); + ASSERT_TRUE(u3.is_allocated()); + } + static void test_mirror_copy_const_data_type() { using ExecutionSpace = typename DeviceType::execution_space; int const N = 100; @@ -859,9 +870,8 @@ struct TestViewMirror { template struct CopyUnInit { - typedef typename Kokkos::Impl::MirrorViewType< - Space, double *, Layout, Kokkos::HostSpace, MemoryTraits>::view_type - mirror_view_type; + using mirror_view_type = typename Kokkos::Impl::MirrorViewType< + Space, double *, Layout, Kokkos::HostSpace, MemoryTraits>::view_type; mirror_view_type a_d; @@ -913,6 +923,7 @@ struct TestViewMirror { test_mirror_copy >(); test_mirror_copy >(); test_mirror_copy_const_data_type(); + test_allocated(); test_mirror_no_initialize >(); test_mirror_no_initialize >(); } @@ -923,19 +934,19 @@ struct TestViewMirror { template class TestViewAPI { public: - typedef DeviceType device; + using device = DeviceType; enum { N0 = 1000, N1 = 3, N2 = 5, N3 = 7 }; - typedef Kokkos::View dView0; - typedef Kokkos::View dView1; - typedef Kokkos::View dView2; - typedef Kokkos::View dView3; - typedef Kokkos::View dView4; - typedef Kokkos::View const_dView4; - typedef Kokkos::View - dView4_unmanaged; - typedef typename dView0::host_mirror_space host; + using dView0 = Kokkos::View; + using dView1 = Kokkos::View; + using dView2 = Kokkos::View; + using dView3 = Kokkos::View; + using dView4 = Kokkos::View; + using const_dView4 = Kokkos::View; + using dView4_unmanaged = + Kokkos::View; + using host = typename dView0::host_mirror_space; static void run_test_view_operator_a() { { @@ -974,8 +985,8 @@ class TestViewAPI { } static void run_test_mirror() { - typedef Kokkos::View view_type; - typedef typename view_type::HostMirror mirror_type; + using view_type = Kokkos::View; + using mirror_type = typename view_type::HostMirror; static_assert(std::is_same::value, @@ -991,7 +1002,7 @@ class TestViewAPI { } static void run_test_scalar() { - typedef typename dView0::HostMirror hView0; + using hView0 = typename dView0::HostMirror; dView0 dx, dy; hView0 hx, hy; @@ -1014,16 +1025,16 @@ class TestViewAPI { static void run_test() { // mfh 14 Feb 2014: This test doesn't actually create instances of - // these types. In order to avoid "declared but unused typedef" + // these types. In order to avoid "unused type alias" // warnings, we declare empty instances of these types, with the // usual "(void)" marker to avoid compiler warnings for unused // variables. - typedef typename dView0::HostMirror hView0; - typedef typename dView1::HostMirror hView1; - typedef typename dView2::HostMirror hView2; - typedef typename dView3::HostMirror hView3; - typedef typename dView4::HostMirror hView4; + using hView0 = typename dView0::HostMirror; + using hView1 = typename dView1::HostMirror; + using hView2 = typename dView2::HostMirror; + using hView3 = typename dView3::HostMirror; + using hView4 = typename dView4::HostMirror; { hView0 thing; @@ -1082,13 +1093,7 @@ class TestViewAPI { { // Destruction of this view should be harmless. - const_dView4 unmanaged_from_ptr_const_dx(dx.data(), dx.extent(0) -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - , - dx.extent(1), dx.extent(2), - dx.extent(3) -#endif - ); + const_dView4 unmanaged_from_ptr_const_dx(dx.data(), dx.extent(0)); } const_dView4 const_dx = dx; @@ -1294,7 +1299,7 @@ class TestViewAPI { } } - typedef T DataType[2]; + using DataType = T[2]; static void check_auto_conversion_to_const( const Kokkos::View &arg_const, @@ -1303,10 +1308,10 @@ class TestViewAPI { } static void run_test_const() { - typedef Kokkos::View typeX; - typedef Kokkos::View const_typeX; - typedef Kokkos::View - const_typeR; + using typeX = Kokkos::View; + using const_typeX = Kokkos::View; + using const_typeR = + Kokkos::View; typeX x("X"); const_typeX xc = x; @@ -1331,7 +1336,7 @@ class TestViewAPI { } static void run_test_subview() { - typedef Kokkos::View sView; + using sView = Kokkos::View; dView0 d0("d0"); dView1 d1("d1", N0); @@ -1347,13 +1352,13 @@ class TestViewAPI { } static void run_test_subview_strided() { - typedef Kokkos::View view_left_4; - typedef Kokkos::View view_right_4; - typedef Kokkos::View view_left_2; - typedef Kokkos::View view_right_2; + using view_left_4 = Kokkos::View; + using view_right_4 = Kokkos::View; + using view_left_2 = Kokkos::View; + using view_right_2 = Kokkos::View; - typedef Kokkos::View view_stride_1; - typedef Kokkos::View view_stride_2; + using view_stride_1 = Kokkos::View; + using view_stride_2 = Kokkos::View; view_left_2 xl2("xl2", 100, 200); view_right_2 xr2("xr2", 100, 200); @@ -1392,18 +1397,18 @@ class TestViewAPI { static void run_test_vector() { static const unsigned Length = 1000, Count = 8; - typedef Kokkos::View vector_type; - typedef Kokkos::View multivector_type; + using vector_type = Kokkos::View; + using multivector_type = Kokkos::View; - typedef Kokkos::View vector_right_type; - typedef Kokkos::View - multivector_right_type; + using vector_right_type = Kokkos::View; + using multivector_right_type = + Kokkos::View; - typedef Kokkos::View - const_vector_right_type; - typedef Kokkos::View const_vector_type; - typedef Kokkos::View - const_multivector_type; + using const_vector_right_type = + Kokkos::View; + using const_vector_type = Kokkos::View; + using const_multivector_type = + Kokkos::View; multivector_type mv = multivector_type("mv", Length, Count); multivector_right_type mv_right = diff --git a/lib/kokkos/core/unit_test/TestViewAPI_e.hpp b/lib/kokkos/core/unit_test/TestViewAPI_e.hpp index 40ae083630..be57bcfe38 100644 --- a/lib/kokkos/core/unit_test/TestViewAPI_e.hpp +++ b/lib/kokkos/core/unit_test/TestViewAPI_e.hpp @@ -59,11 +59,11 @@ TEST(TEST_CATEGORY, view_remap) { std::conditional::value, \ Kokkos::CudaHostPinnedSpace, TEST_EXECSPACE>::type #else -#ifdef KOKKOS_ENABLE_ROCM -#define EXECSPACE \ - std::conditional< \ - std::is_same::value, \ - Kokkos::Experimental::ROCmHostPinnedSpace, TEST_EXECSPACE>::type +#ifdef KOKKOS_ENABLE_HIP +#define EXECSPACE \ + std::conditional< \ + std::is_same::value, \ + Kokkos::Experimental::HIPHostPinnedSpace, TEST_EXECSPACE>::type #else #if defined(KOKKOS_ENABLE_OPENMPTARGET) #define EXECSPACE Kokkos::HostSpace @@ -73,14 +73,14 @@ TEST(TEST_CATEGORY, view_remap) { #endif #endif - typedef Kokkos::View - output_type; + using output_type = + Kokkos::View; - typedef Kokkos::View - input_type; + using input_type = + Kokkos::View; - typedef Kokkos::View - diff_type; + using diff_type = + Kokkos::View; output_type output("output", N0); input_type input("input", N0, N1); diff --git a/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp b/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp index 30701b3a4e..04fb6e1397 100644 --- a/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp +++ b/lib/kokkos/core/unit_test/TestViewCtorPropEmbeddedDim.hpp @@ -87,10 +87,10 @@ struct TestViewCtorProp_EmbeddedDim { { // Two views auto view_alloc_arg = Kokkos::common_view_alloc_prop(vi1, vd1); - typedef - typename decltype(view_alloc_arg)::value_type CommonViewValueType; - typedef typename Kokkos::View CVT; - typedef typename CVT::HostMirror HostCVT; + using CommonViewValueType = + typename decltype(view_alloc_arg)::value_type; + using CVT = typename Kokkos::View; + using HostCVT = typename CVT::HostMirror; // Construct View using the common type; for case of specialization, an // 'embedded_dim' would be stored by view_alloc_arg @@ -128,10 +128,10 @@ struct TestViewCtorProp_EmbeddedDim { { // Single view auto view_alloc_arg = Kokkos::common_view_alloc_prop(vi1); - typedef - typename decltype(view_alloc_arg)::value_type CommonViewValueType; - typedef typename Kokkos::View CVT; - typedef typename CVT::HostMirror HostCVT; + using CommonViewValueType = + typename decltype(view_alloc_arg)::value_type; + using CVT = typename Kokkos::View; + using HostCVT = typename CVT::HostMirror; // Construct View using the common type; for case of specialization, an // 'embedded_dim' would be stored by view_alloc_arg diff --git a/lib/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp b/lib/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp index 583d135f35..462dd523f4 100644 --- a/lib/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp +++ b/lib/kokkos/core/unit_test/TestViewLayoutStrideAssignment.hpp @@ -54,12 +54,12 @@ namespace Test { TEST(TEST_CATEGORY, view_layoutstride_left_to_layoutleft_assignment) { - typedef TEST_EXECSPACE exec_space; + using exec_space = TEST_EXECSPACE; auto t = time(nullptr); srand(t); // Use current time as seed for random generator printf("view_layoutstride_left_to_layoutleft_assignment: srand(%lu)\n", - size_t(t)); + static_cast(t)); { // Assignment of rank-1 LayoutLeft = LayoutStride int ndims = 1; @@ -336,12 +336,12 @@ TEST(TEST_CATEGORY, view_layoutstride_left_to_layoutleft_assignment) { } TEST(TEST_CATEGORY, view_layoutstride_right_to_layoutright_assignment) { - typedef TEST_EXECSPACE exec_space; + using exec_space = TEST_EXECSPACE; auto t = time(nullptr); srand(t); // Use current time as seed for random generator printf("view_layoutstride_right_to_layoutright_assignment: srand(%lu)\n", - size_t(t)); + static_cast(t)); { // Assignment of rank-1 LayoutRight = LayoutStride int ndims = 1; @@ -618,12 +618,12 @@ TEST(TEST_CATEGORY, view_layoutstride_right_to_layoutright_assignment) { } TEST(TEST_CATEGORY_DEATH, view_layoutstride_right_to_layoutleft_assignment) { - typedef TEST_EXECSPACE exec_space; + using exec_space = TEST_EXECSPACE; auto t = time(nullptr); srand(t); // Use current time as seed for random generator printf("view_layoutstride_right_to_layoutleft_assignment: srand(%lu)\n", - size_t(t)); + static_cast(t)); { // Assignment of rank-1 LayoutLeft = LayoutStride (LayoutRight compatible) int ndims = 1; @@ -661,6 +661,10 @@ TEST(TEST_CATEGORY_DEATH, view_layoutstride_right_to_layoutleft_assignment) { ASSERT_EQ(dst.span(), src.span()); ASSERT_EQ(test, true); } +// WORKAROUND OPENMPTARGET : death tests don't seem to work ... +#ifdef KOKKOS_ENABLE_OPENMPTARGET + return; +#endif { // Assignment of rank-2 LayoutLeft = LayoutStride (LayoutRight compatible) int ndims = 2; int dims[] = {10, 9}; @@ -769,12 +773,12 @@ TEST(TEST_CATEGORY_DEATH, view_layoutstride_right_to_layoutleft_assignment) { } TEST(TEST_CATEGORY_DEATH, view_layoutstride_left_to_layoutright_assignment) { - typedef TEST_EXECSPACE exec_space; + using exec_space = TEST_EXECSPACE; auto t = time(nullptr); srand(t); // Use current time as seed for random generator printf("view_layoutstride_left_to_layoutright_assignment: srand(%lu)\n", - size_t(t)); + static_cast(t)); { // Assignment of rank-1 LayoutRight = LayoutStride (LayoutLeft compatible) int ndims = 1; @@ -812,6 +816,10 @@ TEST(TEST_CATEGORY_DEATH, view_layoutstride_left_to_layoutright_assignment) { ASSERT_EQ(dst.span(), src.span()); ASSERT_EQ(test, true); } +// WORKAROUND OPENMPTARGET : death tests don't seem to work ... +#ifdef KOKKOS_ENABLE_OPENMPTARGET + return; +#endif { // Assignment of rank-2 LayoutRight = LayoutStride (LayoutLeft compatible) int ndims = 2; int dims[] = {10, 9}; diff --git a/lib/kokkos/core/unit_test/TestViewLayoutTiled.hpp b/lib/kokkos/core/unit_test/TestViewLayoutTiled.hpp index 75eef2d69e..2510a12446 100644 --- a/lib/kokkos/core/unit_test/TestViewLayoutTiled.hpp +++ b/lib/kokkos/core/unit_test/TestViewLayoutTiled.hpp @@ -54,12 +54,11 @@ namespace Test { -#ifndef KOKKOS_ENABLE_DEPRECATED_CODE namespace { template struct TestViewLayoutTiled { - typedef double Scalar; + using Scalar = double; static constexpr int T0 = 2; static constexpr int T1 = 4; @@ -71,46 +70,46 @@ struct TestViewLayoutTiled { static constexpr int T7 = 2; // Rank 2 - typedef Kokkos::Experimental::LayoutTiled - LayoutLL_2D_2x4; - typedef Kokkos::Experimental::LayoutTiled - LayoutRL_2D_2x4; - typedef Kokkos::Experimental::LayoutTiled - LayoutLR_2D_2x4; - typedef Kokkos::Experimental::LayoutTiled - LayoutRR_2D_2x4; + using LayoutLL_2D_2x4 = + Kokkos::Experimental::LayoutTiled; + using LayoutRL_2D_2x4 = + Kokkos::Experimental::LayoutTiled; + using LayoutLR_2D_2x4 = + Kokkos::Experimental::LayoutTiled; + using LayoutRR_2D_2x4 = + Kokkos::Experimental::LayoutTiled; // Rank 3 - typedef Kokkos::Experimental::LayoutTiled - LayoutLL_3D_2x4x4; - typedef Kokkos::Experimental::LayoutTiled - LayoutRL_3D_2x4x4; - typedef Kokkos::Experimental::LayoutTiled - LayoutLR_3D_2x4x4; - typedef Kokkos::Experimental::LayoutTiled - LayoutRR_3D_2x4x4; + using LayoutLL_3D_2x4x4 = + Kokkos::Experimental::LayoutTiled; + using LayoutRL_3D_2x4x4 = + Kokkos::Experimental::LayoutTiled; + using LayoutLR_3D_2x4x4 = + Kokkos::Experimental::LayoutTiled; + using LayoutRR_3D_2x4x4 = + Kokkos::Experimental::LayoutTiled; // Rank 4 - typedef Kokkos::Experimental::LayoutTiled< - Kokkos::Iterate::Left, Kokkos::Iterate::Left, T0, T1, T2, T3> - LayoutLL_4D_2x4x4x2; - typedef Kokkos::Experimental::LayoutTiled< - Kokkos::Iterate::Right, Kokkos::Iterate::Left, T0, T1, T2, T3> - LayoutRL_4D_2x4x4x2; - typedef Kokkos::Experimental::LayoutTiled< - Kokkos::Iterate::Left, Kokkos::Iterate::Right, T0, T1, T2, T3> - LayoutLR_4D_2x4x4x2; - typedef Kokkos::Experimental::LayoutTiled< - Kokkos::Iterate::Right, Kokkos::Iterate::Right, T0, T1, T2, T3> - LayoutRR_4D_2x4x4x2; + using LayoutLL_4D_2x4x4x2 = + Kokkos::Experimental::LayoutTiled; + using LayoutRL_4D_2x4x4x2 = + Kokkos::Experimental::LayoutTiled; + using LayoutLR_4D_2x4x4x2 = + Kokkos::Experimental::LayoutTiled; + using LayoutRR_4D_2x4x4x2 = + Kokkos::Experimental::LayoutTiled; #if !defined(KOKKOS_ENABLE_CXX11_DISPATCH_LAMBDA) static void test_view_layout_tiled_2d(const int, const int) { @@ -123,8 +122,8 @@ struct TestViewLayoutTiled { // Test create_mirror_view, deep_copy // Create LL View { - typedef typename Kokkos::View - ViewType; + using ViewType = + typename Kokkos::View; ViewType v("v", N0, N1); typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); @@ -188,8 +187,8 @@ struct TestViewLayoutTiled { // Create RL View { - typedef typename Kokkos::View - ViewType; + using ViewType = + typename Kokkos::View; Kokkos::View v("v", N0, N1); typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); @@ -254,8 +253,8 @@ struct TestViewLayoutTiled { // Create LR View { - typedef typename Kokkos::View - ViewType; + using ViewType = + typename Kokkos::View; Kokkos::View v("v", N0, N1); typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); @@ -320,8 +319,8 @@ struct TestViewLayoutTiled { // Create RR View { - typedef typename Kokkos::View - ViewType; + using ViewType = + typename Kokkos::View; Kokkos::View v("v", N0, N1); typename ViewType::HostMirror hv = Kokkos::create_mirror_view(v); @@ -399,7 +398,7 @@ struct TestViewLayoutTiled { // Create LL View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2); @@ -470,7 +469,7 @@ struct TestViewLayoutTiled { // Create RL View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2); @@ -541,7 +540,7 @@ struct TestViewLayoutTiled { // Create LR View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2); @@ -612,7 +611,7 @@ struct TestViewLayoutTiled { // Create RR View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2); @@ -698,7 +697,7 @@ struct TestViewLayoutTiled { // Create LL View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2, N3); @@ -780,7 +779,7 @@ struct TestViewLayoutTiled { // Create RL View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2, N3); @@ -863,7 +862,7 @@ struct TestViewLayoutTiled { // Create LR View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2, N3); @@ -947,7 +946,7 @@ struct TestViewLayoutTiled { // Create RR View { - typedef Kokkos::View ViewType; + using ViewType = Kokkos::View; Kokkos::View dv("dv", N0, N1, N2, N3); @@ -1776,5 +1775,4 @@ TEST(TEST_CATEGORY, view_layouttiled_subtile) { TestViewLayoutTiled::test_view_layout_tiled_subtile_4d( 4, 12, 16, 12); } -#endif } // namespace Test diff --git a/lib/kokkos/core/unit_test/TestViewMapping_a.hpp b/lib/kokkos/core/unit_test/TestViewMapping_a.hpp index 7bd6353c2b..084246a274 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping_a.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping_a.hpp @@ -54,28 +54,28 @@ namespace Test { template void test_view_mapping() { - typedef typename Space::execution_space ExecSpace; + using ExecSpace = typename Space::execution_space; - typedef Kokkos::Impl::ViewDimension<> dim_0; - typedef Kokkos::Impl::ViewDimension<2> dim_s2; - typedef Kokkos::Impl::ViewDimension<2, 3> dim_s2_s3; - typedef Kokkos::Impl::ViewDimension<2, 3, 4> dim_s2_s3_s4; + using dim_0 = Kokkos::Impl::ViewDimension<>; + using dim_s2 = Kokkos::Impl::ViewDimension<2>; + using dim_s2_s3 = Kokkos::Impl::ViewDimension<2, 3>; + using dim_s2_s3_s4 = Kokkos::Impl::ViewDimension<2, 3, 4>; - typedef Kokkos::Impl::ViewDimension<0> dim_s0; - typedef Kokkos::Impl::ViewDimension<0, 3> dim_s0_s3; - typedef Kokkos::Impl::ViewDimension<0, 3, 4> dim_s0_s3_s4; + using dim_s0 = Kokkos::Impl::ViewDimension<0>; + using dim_s0_s3 = Kokkos::Impl::ViewDimension<0, 3>; + using dim_s0_s3_s4 = Kokkos::Impl::ViewDimension<0, 3, 4>; - typedef Kokkos::Impl::ViewDimension<0, 0> dim_s0_s0; - typedef Kokkos::Impl::ViewDimension<0, 0, 4> dim_s0_s0_s4; + using dim_s0_s0 = Kokkos::Impl::ViewDimension<0, 0>; + using dim_s0_s0_s4 = Kokkos::Impl::ViewDimension<0, 0, 4>; - typedef Kokkos::Impl::ViewDimension<0, 0, 0> dim_s0_s0_s0; - typedef Kokkos::Impl::ViewDimension<0, 0, 0, 0> dim_s0_s0_s0_s0; - typedef Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0> dim_s0_s0_s0_s0_s0; - typedef Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0, 0> dim_s0_s0_s0_s0_s0_s0; - typedef Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0, 0, 0> - dim_s0_s0_s0_s0_s0_s0_s0; - typedef Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0, 0, 0, 0> - dim_s0_s0_s0_s0_s0_s0_s0_s0; + using dim_s0_s0_s0 = Kokkos::Impl::ViewDimension<0, 0, 0>; + using dim_s0_s0_s0_s0 = Kokkos::Impl::ViewDimension<0, 0, 0, 0>; + using dim_s0_s0_s0_s0_s0 = Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0>; + using dim_s0_s0_s0_s0_s0_s0 = Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0, 0>; + using dim_s0_s0_s0_s0_s0_s0_s0 = + Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0, 0, 0>; + using dim_s0_s0_s0_s0_s0_s0_s0_s0 = + Kokkos::Impl::ViewDimension<0, 0, 0, 0, 0, 0, 0, 0>; // Fully static dimensions should not be larger than an int. #ifndef _WIN32 // For some reason on Windows the first test here fails with @@ -190,14 +190,14 @@ void test_view_mapping() { //---------------------------------------- - typedef Kokkos::Impl::ViewOffset - stride_s0_s0_s0; + using stride_s0_s0_s0 = + Kokkos::Impl::ViewOffset; //---------------------------------------- // Static dimension. { - typedef Kokkos::Impl::ViewOffset - left_s2_s3_s4; + using left_s2_s3_s4 = + Kokkos::Impl::ViewOffset; ASSERT_EQ(sizeof(left_s2_s3_s4), sizeof(dim_s2_s3_s4)); @@ -228,8 +228,8 @@ void test_view_mapping() { //---------------------------------------- // Small dimension is unpadded. { - typedef Kokkos::Impl::ViewOffset - left_s0_s0_s4; + using left_s0_s0_s4 = + Kokkos::Impl::ViewOffset; left_s0_s0_s4 dyn_off3(std::integral_constant(), Kokkos::LayoutLeft(2, 3, 0, 0, 0, 0, 0, 0)); @@ -280,8 +280,8 @@ void test_view_mapping() { constexpr int N0 = 2000; constexpr int N1 = 300; - typedef Kokkos::Impl::ViewOffset - left_s0_s0_s4; + using left_s0_s0_s4 = + Kokkos::Impl::ViewOffset; left_s0_s0_s4 dyn_off3(std::integral_constant(), Kokkos::LayoutLeft(N0, N1, 0, 0, 0, 0, 0, 0)); @@ -319,8 +319,8 @@ void test_view_mapping() { //---------------------------------------- // Static dimension. { - typedef Kokkos::Impl::ViewOffset - right_s2_s3_s4; + using right_s2_s3_s4 = + Kokkos::Impl::ViewOffset; ASSERT_EQ(sizeof(right_s2_s3_s4), sizeof(dim_s2_s3_s4)); @@ -355,8 +355,8 @@ void test_view_mapping() { //---------------------------------------- // Small dimension is unpadded. { - typedef Kokkos::Impl::ViewOffset - right_s0_s0_s4; + using right_s0_s0_s4 = + Kokkos::Impl::ViewOffset; right_s0_s0_s4 dyn_off3(std::integral_constant(), Kokkos::LayoutRight(2, 3, 0, 0, 0, 0, 0, 0)); @@ -396,8 +396,8 @@ void test_view_mapping() { constexpr int N0 = 2000; constexpr int N1 = 300; - typedef Kokkos::Impl::ViewOffset - right_s0_s0_s4; + using right_s0_s0_s4 = + Kokkos::Impl::ViewOffset; right_s0_s0_s4 dyn_off3(std::integral_constant(), Kokkos::LayoutRight(N0, N1, 0, 0, 0, 0, 0, 0)); @@ -436,7 +436,7 @@ void test_view_mapping() { // Subview. { // Mapping rank 4 to rank 3 - typedef Kokkos::Impl::SubviewExtents<4, 3> SubviewExtents; + using SubviewExtents = Kokkos::Impl::SubviewExtents<4, 3>; constexpr int N0 = 1000; constexpr int N1 = 2000; @@ -471,8 +471,8 @@ void test_view_mapping() { constexpr int sub_N1 = 200; constexpr int sub_N2 = 4; - typedef Kokkos::Impl::ViewOffset - left_s0_s0_s4; + using left_s0_s0_s4 = + Kokkos::Impl::ViewOffset; left_s0_s0_s4 dyn_off3(std::integral_constant(), Kokkos::LayoutLeft(N0, N1, 0, 0, 0, 0, 0, 0)); @@ -508,8 +508,8 @@ void test_view_mapping() { constexpr int sub_N1 = 200; constexpr int sub_N2 = 4; - typedef Kokkos::Impl::ViewOffset - right_s0_s0_s4; + using right_s0_s0_s4 = + Kokkos::Impl::ViewOffset; right_s0_s0_s4 dyn_off3(std::integral_constant(), Kokkos::LayoutRight(N0, N1, 0, 0, 0, 0, 0, 0)); @@ -552,10 +552,10 @@ void test_view_mapping() { { using namespace Kokkos::Impl; - typedef ViewArrayAnalysis a_int_r1; - typedef ViewArrayAnalysis a_int_r5; - typedef ViewArrayAnalysis a_const_int_r1; - typedef ViewArrayAnalysis a_const_int_r5; + using a_int_r1 = ViewArrayAnalysis; + using a_int_r5 = ViewArrayAnalysis; + using a_const_int_r1 = ViewArrayAnalysis; + using a_const_int_r5 = ViewArrayAnalysis; static_assert(a_int_r1::dimension::rank == 1, ""); static_assert(a_int_r1::dimension::rank_dynamic == 1, ""); @@ -610,10 +610,10 @@ void test_view_mapping() { { using namespace Kokkos::Impl; - typedef int t_i4[4]; + using t_i4 = int[4]; // Dimensions of t_i4 are appended to the multdimensional array. - typedef ViewArrayAnalysis a_int_r5; + using a_int_r5 = ViewArrayAnalysis; static_assert(a_int_r5::dimension::rank == 5, ""); static_assert(a_int_r5::dimension::rank_dynamic == 3, ""); @@ -629,7 +629,7 @@ void test_view_mapping() { { using namespace Kokkos::Impl; - typedef ViewDataAnalysis a_const_int_r1; + using a_const_int_r1 = ViewDataAnalysis; static_assert( std::is_same::value, ""); @@ -661,7 +661,7 @@ void test_view_mapping() { std::is_same::value, ""); - typedef ViewDataAnalysis a_const_int_r3; + using a_const_int_r3 = ViewDataAnalysis; static_assert( std::is_same::value, ""); @@ -708,8 +708,8 @@ void test_view_mapping() { { constexpr int N = 10; - typedef Kokkos::View T; - typedef Kokkos::View C; + using T = Kokkos::View; + using C = Kokkos::View; int data[N]; @@ -788,8 +788,8 @@ void test_view_mapping() { { constexpr int N = 10; - typedef Kokkos::View T; - typedef Kokkos::View C; + using T = Kokkos::View; + using C = Kokkos::View; T vr1("vr1", N); C cr1(vr1); @@ -835,8 +835,8 @@ void test_view_mapping() { // Testing proper handling of zero-length allocations. { constexpr int N = 0; - typedef Kokkos::View T; - typedef Kokkos::View C; + using T = Kokkos::View; + using C = Kokkos::View; T vr1("vr1", N); C cr1(vr1); @@ -852,8 +852,8 @@ void test_view_mapping() { typename ExecSpace::memory_space::execution_space>::value) { using namespace Kokkos; - typedef typename ExecSpace::memory_space memory_space; - typedef View V; + using memory_space = typename ExecSpace::memory_space; + using V = View; constexpr int N = 10; @@ -874,10 +874,10 @@ void test_view_mapping() { } { - typedef Kokkos::ViewTraits - traits_t; - typedef Kokkos::Impl::ViewDimension<0, 0, 0> dims_t; - typedef Kokkos::Impl::ViewOffset offset_t; + using traits_t = + Kokkos::ViewTraits; + using dims_t = Kokkos::Impl::ViewDimension<0, 0, 0>; + using offset_t = Kokkos::Impl::ViewOffset; Kokkos::LayoutStride stride; @@ -906,9 +906,9 @@ void test_view_mapping() { } { - typedef Kokkos::View V; - typedef typename V::HostMirror M; - typedef typename Kokkos::View::array_layout layout_type; + using V = Kokkos::View; + using M = typename V::HostMirror; + using layout_type = typename Kokkos::View::array_layout; constexpr int N0 = 10; constexpr int N1 = 11; @@ -980,11 +980,10 @@ void test_view_mapping() { } { - typedef Kokkos::View V; - typedef typename V::HostMirror M; - typedef - typename Kokkos::View::array_layout - layout_type; + using V = Kokkos::View; + using M = typename V::HostMirror; + using layout_type = + typename Kokkos::View::array_layout; constexpr int N0 = 10; constexpr int N1 = 11; @@ -1034,8 +1033,8 @@ void test_view_mapping() { } { - typedef Kokkos::View V; - typedef Kokkos::View U; + using V = Kokkos::View; + using U = Kokkos::View; V a("a", 10); @@ -1075,8 +1074,8 @@ void test_view_mapping() { !(defined(KOKKOS_ENABLE_HPX) && defined(KOKKOS_ENABLE_HPX_ASYNC_DISPATCH)) // Cannot launch host lambda when CUDA lambda is enabled. - typedef typename Kokkos::Impl::HostMirror::Space::execution_space - host_exec_space; + using host_exec_space = + typename Kokkos::Impl::HostMirror::Space::execution_space; int errors = 0; Kokkos::parallel_reduce( @@ -1104,20 +1103,12 @@ struct TestViewMapOperator { static_assert(ViewType::reference_type_is_lvalue_reference, "Test only valid for lvalue reference type"); -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const ViewType v; -#else ViewType v; -#endif KOKKOS_INLINE_FUNCTION void test_left(size_t i0, int64_t& error_count) const { -#ifdef KOKKOS_ENABLE_DEPPRECATED_CODE - typename ViewType::value_type* const base_ptr = &v(0, 0, 0, 0, 0, 0, 0, 0); -#else typename ViewType::value_type* const base_ptr = &v.access(0, 0, 0, 0, 0, 0, 0, 0); -#endif const size_t n1 = v.extent(1); const size_t n2 = v.extent(2); const size_t n3 = v.extent(3); @@ -1135,13 +1126,8 @@ struct TestViewMapOperator { for (size_t i3 = 0; i3 < n3; ++i3) for (size_t i2 = 0; i2 < n2; ++i2) for (size_t i1 = 0; i1 < n1; ++i1) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int64_t d = - &v(i0, i1, i2, i3, i4, i5, i6, i7) - base_ptr; -#else const int64_t d = &v.access(i0, i1, i2, i3, i4, i5, i6, i7) - base_ptr; -#endif if (d < offset) ++error_count; offset = d; } @@ -1151,12 +1137,8 @@ struct TestViewMapOperator { KOKKOS_INLINE_FUNCTION void test_right(size_t i0, int64_t& error_count) const { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - typename ViewType::value_type* const base_ptr = &v(0, 0, 0, 0, 0, 0, 0, 0); -#else typename ViewType::value_type* const base_ptr = &v.access(0, 0, 0, 0, 0, 0, 0, 0); -#endif const size_t n1 = v.extent(1); const size_t n2 = v.extent(2); const size_t n3 = v.extent(3); @@ -1174,13 +1156,8 @@ struct TestViewMapOperator { for (size_t i5 = 0; i5 < n5; ++i5) for (size_t i6 = 0; i6 < n6; ++i6) for (size_t i7 = 0; i7 < n7; ++i7) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int64_t d = - &v(i0, i1, i2, i3, i4, i5, i6, i7) - base_ptr; -#else const int64_t d = &v.access(i0, i1, i2, i3, i4, i5, i6, i7) - base_ptr; -#endif if (d < offset) ++error_count; offset = d; } @@ -1208,10 +1185,6 @@ struct TestViewMapOperator { enum { N6 = 4 }; enum { N7 = 3 }; -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - TestViewMapOperator() : v("Test", N0, N1, N2, N3, N4, N5, N6, N7) {} - -#else TestViewMapOperator() { const size_t dyn_rank = v.rank_dynamic; const std::string label("Test"); @@ -1229,7 +1202,6 @@ struct TestViewMapOperator { } } -#endif void run() { ASSERT_EQ(v.extent(0), (0 < ViewType::rank ? TestViewMapOperator::N0 : 1)); @@ -1262,7 +1234,7 @@ struct TestViewMapOperator { template void test_view_mapping_operator() { - typedef typename Space::execution_space ExecSpace; + using ExecSpace = typename Space::execution_space; { TestViewMapOperator > f; diff --git a/lib/kokkos/core/unit_test/TestViewMapping_b.hpp b/lib/kokkos/core/unit_test/TestViewMapping_b.hpp index 63ec635323..96eca79f6c 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping_b.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping_b.hpp @@ -56,13 +56,13 @@ namespace Test { template struct TestViewMappingAtomic { - typedef typename Space::execution_space ExecSpace; - typedef typename Space::memory_space MemSpace; + using ExecSpace = typename Space::execution_space; + using MemSpace = typename Space::memory_space; - typedef Kokkos::MemoryTraits mem_trait; + using mem_trait = Kokkos::MemoryTraits; - typedef Kokkos::View T; - typedef Kokkos::View T_atom; + using T = Kokkos::View; + using T_atom = Kokkos::View; T x; T_atom x_atom; @@ -166,7 +166,7 @@ struct MappingClassValueType { template void test_view_mapping_class_value() { - typedef typename Space::execution_space ExecSpace; + using ExecSpace = typename Space::execution_space; ExecSpace().fence(); { @@ -187,12 +187,12 @@ TEST(TEST_CATEGORY, view_mapping_class_value) { namespace Test { TEST(TEST_CATEGORY, view_mapping_assignable) { - typedef TEST_EXECSPACE exec_space; + using exec_space = TEST_EXECSPACE; { // Assignment of rank-0 Left = Right - typedef Kokkos::ViewTraits dst_traits; - typedef Kokkos::ViewTraits src_traits; - typedef Kokkos::Impl::ViewMapping mapping; + using dst_traits = Kokkos::ViewTraits; + using src_traits = Kokkos::ViewTraits; + using mapping = Kokkos::Impl::ViewMapping; static_assert(mapping::is_assignable, ""); Kokkos::View src; @@ -201,9 +201,9 @@ TEST(TEST_CATEGORY, view_mapping_assignable) { } { // Assignment of rank-0 Right = Left - typedef Kokkos::ViewTraits dst_traits; - typedef Kokkos::ViewTraits src_traits; - typedef Kokkos::Impl::ViewMapping mapping; + using dst_traits = Kokkos::ViewTraits; + using src_traits = Kokkos::ViewTraits; + using mapping = Kokkos::Impl::ViewMapping; static_assert(mapping::is_assignable, ""); Kokkos::View src; @@ -212,11 +212,11 @@ TEST(TEST_CATEGORY, view_mapping_assignable) { } { // Assignment of rank-1 Left = Right - typedef Kokkos::ViewTraits - dst_traits; - typedef Kokkos::ViewTraits - src_traits; - typedef Kokkos::Impl::ViewMapping mapping; + using dst_traits = + Kokkos::ViewTraits; + using src_traits = + Kokkos::ViewTraits; + using mapping = Kokkos::Impl::ViewMapping; static_assert(mapping::is_assignable, ""); Kokkos::View src; @@ -225,11 +225,11 @@ TEST(TEST_CATEGORY, view_mapping_assignable) { } { // Assignment of rank-1 Right = Left - typedef Kokkos::ViewTraits - dst_traits; - typedef Kokkos::ViewTraits - src_traits; - typedef Kokkos::Impl::ViewMapping mapping; + using dst_traits = + Kokkos::ViewTraits; + using src_traits = + Kokkos::ViewTraits; + using mapping = Kokkos::Impl::ViewMapping; static_assert(mapping::is_assignable, ""); Kokkos::View src; @@ -238,20 +238,20 @@ TEST(TEST_CATEGORY, view_mapping_assignable) { } { // Assignment of rank-2 Left = Right - typedef Kokkos::ViewTraits - dst_traits; - typedef Kokkos::ViewTraits - src_traits; - typedef Kokkos::Impl::ViewMapping mapping; + using dst_traits = + Kokkos::ViewTraits; + using src_traits = + Kokkos::ViewTraits; + using mapping = Kokkos::Impl::ViewMapping; static_assert(!mapping::is_assignable, ""); } { // Assignment of rank-2 Right = Left - typedef Kokkos::ViewTraits - dst_traits; - typedef Kokkos::ViewTraits - src_traits; - typedef Kokkos::Impl::ViewMapping mapping; + using dst_traits = + Kokkos::ViewTraits; + using src_traits = + Kokkos::ViewTraits; + using mapping = Kokkos::Impl::ViewMapping; static_assert(!mapping::is_assignable, ""); } } diff --git a/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp b/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp index d5e9ce7de1..c8300d9eab 100644 --- a/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp +++ b/lib/kokkos/core/unit_test/TestViewMapping_subview.hpp @@ -54,30 +54,30 @@ namespace Test { template struct TestViewMappingSubview { - typedef typename Space::execution_space ExecSpace; - typedef typename Space::memory_space MemSpace; + using ExecSpace = typename Space::execution_space; + using MemSpace = typename Space::memory_space; - typedef Kokkos::pair range; + using range = Kokkos::pair; enum { AN = 10 }; - typedef Kokkos::View AT; - typedef Kokkos::View ACT; - typedef Kokkos::Subview AS; + using AT = Kokkos::View; + using ACT = Kokkos::View; + using AS = Kokkos::Subview; enum { BN0 = 10, BN1 = 11, BN2 = 12 }; - typedef Kokkos::View BT; - typedef Kokkos::Subview BS; + using BT = Kokkos::View; + using BS = Kokkos::Subview; enum { CN0 = 10, CN1 = 11, CN2 = 12 }; - typedef Kokkos::View CT; - typedef Kokkos::Subview CS; + using CT = Kokkos::View; + using CS = Kokkos::Subview; enum { DN0 = 10, DN1 = 11, DN2 = 12, DN3 = 13, DN4 = 14 }; - typedef Kokkos::View DT; - typedef Kokkos::Subview DS; + using DT = Kokkos::View; + using DS = Kokkos::Subview; - typedef Kokkos::View DLT; - typedef Kokkos::Subview DLS1; + using DLT = Kokkos::View; + using DLS1 = Kokkos::Subview; #if !defined(KOKKOS_IMPL_CUDA_VERSION_9_WORKAROUND) static_assert( @@ -87,8 +87,8 @@ struct TestViewMappingSubview { "LayoutLeft"); #endif - typedef Kokkos::View DRT; - typedef Kokkos::Subview DRS1; + using DRT = Kokkos::View; + using DRS1 = Kokkos::Subview; #if !defined(KOKKOS_IMPL_CUDA_VERSION_9_WORKAROUND) static_assert( diff --git a/lib/kokkos/core/unit_test/TestViewResize.hpp b/lib/kokkos/core/unit_test/TestViewResize.hpp index 0f1e5188c8..9a378e5211 100644 --- a/lib/kokkos/core/unit_test/TestViewResize.hpp +++ b/lib/kokkos/core/unit_test/TestViewResize.hpp @@ -50,7 +50,7 @@ namespace Test { TEST(TEST_CATEGORY, view_resize) { - typedef TEST_EXECSPACE ExecSpace; + using ExecSpace = TEST_EXECSPACE; TestViewResize::testResize(); } diff --git a/lib/kokkos/core/unit_test/TestViewSubview.hpp b/lib/kokkos/core/unit_test/TestViewSubview.hpp index 48be58c2e9..a8af720ab9 100644 --- a/lib/kokkos/core/unit_test/TestViewSubview.hpp +++ b/lib/kokkos/core/unit_test/TestViewSubview.hpp @@ -133,8 +133,8 @@ struct getView { template struct fill_1D { - typedef typename Space::execution_space execution_space; - typedef typename ViewType::size_type size_type; + using execution_space = typename Space::execution_space; + using size_type = typename ViewType::size_type; ViewType a; double val; @@ -147,8 +147,8 @@ struct fill_1D { template struct fill_2D { - typedef typename Space::execution_space execution_space; - typedef typename ViewType::size_type size_type; + using execution_space = typename Space::execution_space; + using size_type = typename ViewType::size_type; ViewType a; double val; @@ -165,8 +165,8 @@ struct fill_2D { template void test_auto_1d() { - typedef Kokkos::View mv_type; - typedef typename mv_type::size_type size_type; + using mv_type = Kokkos::View; + using size_type = typename mv_type::size_type; const double ZERO = 0.0; const double ONE = 1.0; @@ -311,10 +311,20 @@ void test_1d_strided_assignment() { Space>(true, true, true, true, 17, 1); } +template +void make_subview(bool use_constructor, NewView& v, OrigView org, + Args... args) { + if (use_constructor) { + v = NewView(org, args...); + } else { + v = Kokkos::subview(org, args...); + } +} + template -void test_left_0() { - typedef Kokkos::View - view_static_8_type; +void test_left_0(bool constr) { + using view_static_8_type = + Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { @@ -322,22 +332,41 @@ void test_left_0() { ASSERT_TRUE(x_static_8.span_is_contiguous()); - Kokkos::View x0 = - Kokkos::subview(x_static_8, 0, 0, 0, 0, 0, 0, 0, 0); + Kokkos::View x0; + make_subview(constr, x0, x_static_8, 0, 0, 0, 0, 0, 0, 0, 0); ASSERT_TRUE(x0.span_is_contiguous()); + ASSERT_EQ(x0.span(), 1); ASSERT_TRUE(&x0() == &x_static_8(0, 0, 0, 0, 0, 0, 0, 0)); - Kokkos::View x1 = Kokkos::subview( - x_static_8, Kokkos::pair(0, 2), 1, 2, 3, 0, 1, 2, 3); + Kokkos::View x1; + make_subview(constr, x1, x_static_8, Kokkos::pair(0, 2), 1, 2, 3, + 0, 1, 2, 3); ASSERT_TRUE(x1.span_is_contiguous()); + ASSERT_EQ(x1.span(), 2); ASSERT_TRUE(&x1(0) == &x_static_8(0, 1, 2, 3, 0, 1, 2, 3)); ASSERT_TRUE(&x1(1) == &x_static_8(1, 1, 2, 3, 0, 1, 2, 3)); - Kokkos::View x2 = - Kokkos::subview(x_static_8, Kokkos::pair(0, 2), 1, 2, 3, - Kokkos::pair(0, 2), 1, 2, 3); + Kokkos::View x_deg1; + make_subview(constr, x_deg1, x_static_8, Kokkos::pair(0, 0), 1, 2, + 3, 0, 1, 2, 3); + + ASSERT_TRUE(x_deg1.span_is_contiguous()); + ASSERT_EQ(x_deg1.span(), 0); + ASSERT_EQ(x_deg1.data(), &x_static_8(0, 1, 2, 3, 0, 1, 2, 3)); + + Kokkos::View x_deg2; + make_subview(constr, x_deg2, x_static_8, Kokkos::pair(2, 2), 2, 3, + 4, 1, 2, 3, 4); + + ASSERT_TRUE(x_deg2.span_is_contiguous()); + ASSERT_EQ(x_deg2.span(), 0); + ASSERT_EQ(x_deg2.data(), x_static_8.data() + x_static_8.span()); + + Kokkos::View x2; + make_subview(constr, x2, x_static_8, Kokkos::pair(0, 2), 1, 2, 3, + Kokkos::pair(0, 2), 1, 2, 3); ASSERT_TRUE(!x2.span_is_contiguous()); ASSERT_TRUE(&x2(0, 0) == &x_static_8(0, 1, 2, 3, 0, 1, 2, 3)); @@ -346,9 +375,9 @@ void test_left_0() { ASSERT_TRUE(&x2(1, 1) == &x_static_8(1, 1, 2, 3, 1, 1, 2, 3)); // Kokkos::View< int**, Kokkos::LayoutLeft, Space > error_2 = - Kokkos::View sx2 = - Kokkos::subview(x_static_8, 1, Kokkos::pair(0, 2), 2, 3, - Kokkos::pair(0, 2), 1, 2, 3); + Kokkos::View sx2; + make_subview(constr, sx2, x_static_8, 1, Kokkos::pair(0, 2), 2, 3, + Kokkos::pair(0, 2), 1, 2, 3); ASSERT_TRUE(!sx2.span_is_contiguous()); ASSERT_TRUE(&sx2(0, 0) == &x_static_8(1, 0, 2, 3, 0, 1, 2, 3)); @@ -356,15 +385,16 @@ void test_left_0() { ASSERT_TRUE(&sx2(0, 1) == &x_static_8(1, 0, 2, 3, 1, 1, 2, 3)); ASSERT_TRUE(&sx2(1, 1) == &x_static_8(1, 1, 2, 3, 1, 1, 2, 3)); - Kokkos::View sx4 = - Kokkos::subview(x_static_8, 0, Kokkos::pair(0, 2) /* of [3] */ - , - 1, Kokkos::pair(1, 3) /* of [5] */ - , - 1, Kokkos::pair(0, 2) /* of [3] */ - , - 2, Kokkos::pair(2, 4) /* of [5] */ - ); + Kokkos::View sx4; + make_subview(constr, sx4, x_static_8, 0, + Kokkos::pair(0, 2) /* of [3] */ + , + 1, Kokkos::pair(1, 3) /* of [5] */ + , + 1, Kokkos::pair(0, 2) /* of [3] */ + , + 2, Kokkos::pair(2, 4) /* of [5] */ + ); ASSERT_TRUE(!sx4.span_is_contiguous()); @@ -380,9 +410,15 @@ void test_left_0() { } template -void test_left_1() { - typedef Kokkos::View - view_type; +void test_left_0() { + test_left_0(true); + test_left_0(false); +} + +template +void test_left_1(bool use_constr) { + using view_type = + Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { @@ -390,22 +426,39 @@ void test_left_1() { ASSERT_TRUE(x8.span_is_contiguous()); - Kokkos::View x0 = - Kokkos::subview(x8, 0, 0, 0, 0, 0, 0, 0, 0); + Kokkos::View x0; + make_subview(use_constr, x0, x8, 0, 0, 0, 0, 0, 0, 0, 0); ASSERT_TRUE(x0.span_is_contiguous()); ASSERT_TRUE(&x0() == &x8(0, 0, 0, 0, 0, 0, 0, 0)); - Kokkos::View x1 = - Kokkos::subview(x8, Kokkos::pair(0, 2), 1, 2, 3, 0, 1, 2, 3); + Kokkos::View x1; + make_subview(use_constr, x1, x8, Kokkos::pair(0, 2), 1, 2, 3, 0, + 1, 2, 3); ASSERT_TRUE(x1.span_is_contiguous()); ASSERT_TRUE(&x1(0) == &x8(0, 1, 2, 3, 0, 1, 2, 3)); ASSERT_TRUE(&x1(1) == &x8(1, 1, 2, 3, 0, 1, 2, 3)); - Kokkos::View x2 = - Kokkos::subview(x8, Kokkos::pair(0, 2), 1, 2, 3, - Kokkos::pair(0, 2), 1, 2, 3); + Kokkos::View x1_deg1; + make_subview(use_constr, x1_deg1, x8, Kokkos::pair(0, 0), 1, 2, 3, + 0, 1, 2, 3); + + ASSERT_TRUE(x1_deg1.span_is_contiguous()); + ASSERT_EQ(0, x1_deg1.span()); + ASSERT_EQ(x1_deg1.data(), &x8(0, 1, 2, 3, 0, 1, 2, 3)); + + Kokkos::View x1_deg2; + make_subview(use_constr, x1_deg2, x8, Kokkos::pair(2, 2), 2, 3, 4, + 1, 2, 3, 4); + + ASSERT_EQ(0, x1_deg2.span()); + ASSERT_TRUE(x1_deg2.span_is_contiguous()); + ASSERT_EQ(x1_deg2.data(), x8.data() + x8.span()); + + Kokkos::View x2; + make_subview(use_constr, x2, x8, Kokkos::pair(0, 2), 1, 2, 3, + Kokkos::pair(0, 2), 1, 2, 3); ASSERT_TRUE(!x2.span_is_contiguous()); ASSERT_TRUE(&x2(0, 0) == &x8(0, 1, 2, 3, 0, 1, 2, 3)); @@ -413,10 +466,15 @@ void test_left_1() { ASSERT_TRUE(&x2(0, 1) == &x8(0, 1, 2, 3, 1, 1, 2, 3)); ASSERT_TRUE(&x2(1, 1) == &x8(1, 1, 2, 3, 1, 1, 2, 3)); + Kokkos::View x2_deg2; + make_subview(use_constr, x2_deg2, x8, Kokkos::pair(2, 2), 2, 3, 4, + 1, 2, Kokkos::pair(2, 3), 4); + ASSERT_EQ(0, x2_deg2.span()); + // Kokkos::View< int**, Kokkos::LayoutLeft, Space > error_2 = - Kokkos::View sx2 = - Kokkos::subview(x8, 1, Kokkos::pair(0, 2), 2, 3, - Kokkos::pair(0, 2), 1, 2, 3); + Kokkos::View sx2; + make_subview(use_constr, sx2, x8, 1, Kokkos::pair(0, 2), 2, 3, + Kokkos::pair(0, 2), 1, 2, 3); ASSERT_TRUE(!sx2.span_is_contiguous()); ASSERT_TRUE(&sx2(0, 0) == &x8(1, 0, 2, 3, 0, 1, 2, 3)); @@ -424,15 +482,21 @@ void test_left_1() { ASSERT_TRUE(&sx2(0, 1) == &x8(1, 0, 2, 3, 1, 1, 2, 3)); ASSERT_TRUE(&sx2(1, 1) == &x8(1, 1, 2, 3, 1, 1, 2, 3)); - Kokkos::View sx4 = - Kokkos::subview(x8, 0, Kokkos::pair(0, 2) /* of [3] */ - , - 1, Kokkos::pair(1, 3) /* of [5] */ - , - 1, Kokkos::pair(0, 2) /* of [3] */ - , - 2, Kokkos::pair(2, 4) /* of [5] */ - ); + Kokkos::View sx2_deg; + make_subview(use_constr, sx2, x8, 1, Kokkos::pair(0, 0), 2, 3, + Kokkos::pair(0, 2), 1, 2, 3); + ASSERT_EQ(0, sx2_deg.span()); + + Kokkos::View sx4; + make_subview(use_constr, sx4, x8, 0, + Kokkos::pair(0, 2) /* of [3] */ + , + 1, Kokkos::pair(1, 3) /* of [5] */ + , + 1, Kokkos::pair(0, 2) /* of [3] */ + , + 2, Kokkos::pair(2, 4) /* of [5] */ + ); ASSERT_TRUE(!sx4.span_is_contiguous()); @@ -446,9 +510,15 @@ void test_left_1() { } } +template +void test_left_1() { + test_left_1(true); + test_left_1(false); +} + template void test_left_2() { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { @@ -514,7 +584,7 @@ void test_left_2() { template void test_left_3() { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { @@ -570,29 +640,31 @@ void test_left_3() { //---------------------------------------------------------------------------- template -void test_right_0() { - typedef Kokkos::View - view_static_8_type; +void test_right_0(bool use_constr) { + using view_static_8_type = + Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { view_static_8_type x_static_8("x_static_right_8"); - Kokkos::View x0 = - Kokkos::subview(x_static_8, 0, 0, 0, 0, 0, 0, 0, 0); + Kokkos::View x0; + make_subview(use_constr, x0, x_static_8, 0, 0, 0, 0, 0, 0, 0, 0); ASSERT_TRUE(&x0() == &x_static_8(0, 0, 0, 0, 0, 0, 0, 0)); - Kokkos::View x1 = Kokkos::subview( - x_static_8, 0, 1, 2, 3, 0, 1, 2, Kokkos::pair(1, 3)); + Kokkos::View x1; + make_subview(use_constr, x1, x_static_8, 0, 1, 2, 3, 0, 1, 2, + Kokkos::pair(1, 3)); ASSERT_TRUE(x1.extent(0) == 2); ASSERT_TRUE(&x1(0) == &x_static_8(0, 1, 2, 3, 0, 1, 2, 1)); ASSERT_TRUE(&x1(1) == &x_static_8(0, 1, 2, 3, 0, 1, 2, 2)); - Kokkos::View x2 = - Kokkos::subview(x_static_8, 0, 1, 2, Kokkos::pair(1, 3), 0, 1, - 2, Kokkos::pair(1, 3)); + Kokkos::View x2; + make_subview(use_constr, x2, x_static_8, 0, 1, 2, + Kokkos::pair(1, 3), 0, 1, 2, + Kokkos::pair(1, 3)); ASSERT_TRUE(x2.extent(0) == 2); ASSERT_TRUE(x2.extent(1) == 2); @@ -602,9 +674,9 @@ void test_right_0() { ASSERT_TRUE(&x2(1, 1) == &x_static_8(0, 1, 2, 2, 0, 1, 2, 2)); // Kokkos::View< int**, Kokkos::LayoutRight, Space > error_2 = - Kokkos::View sx2 = - Kokkos::subview(x_static_8, 1, Kokkos::pair(0, 2), 2, 3, - Kokkos::pair(0, 2), 1, 2, 3); + Kokkos::View sx2; + make_subview(use_constr, sx2, x_static_8, 1, Kokkos::pair(0, 2), + 2, 3, Kokkos::pair(0, 2), 1, 2, 3); ASSERT_TRUE(sx2.extent(0) == 2); ASSERT_TRUE(sx2.extent(1) == 2); @@ -613,15 +685,16 @@ void test_right_0() { ASSERT_TRUE(&sx2(0, 1) == &x_static_8(1, 0, 2, 3, 1, 1, 2, 3)); ASSERT_TRUE(&sx2(1, 1) == &x_static_8(1, 1, 2, 3, 1, 1, 2, 3)); - Kokkos::View sx4 = - Kokkos::subview(x_static_8, 0, Kokkos::pair(0, 2) /* of [3] */ - , - 1, Kokkos::pair(1, 3) /* of [5] */ - , - 1, Kokkos::pair(0, 2) /* of [3] */ - , - 2, Kokkos::pair(2, 4) /* of [5] */ - ); + Kokkos::View sx4; + make_subview(use_constr, sx4, x_static_8, 0, + Kokkos::pair(0, 2) /* of [3] */ + , + 1, Kokkos::pair(1, 3) /* of [5] */ + , + 1, Kokkos::pair(0, 2) /* of [3] */ + , + 2, Kokkos::pair(2, 4) /* of [5] */ + ); ASSERT_TRUE(sx4.extent(0) == 2); ASSERT_TRUE(sx4.extent(1) == 2); @@ -639,53 +712,76 @@ void test_right_0() { } template -void test_right_1() { - typedef Kokkos::View - view_type; +void test_right_0() { + test_right_0(true); + test_right_0(false); +} + +template +void test_right_1(bool use_constr) { + using view_type = + Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { view_type x8("x_right_8", 2, 3, 4, 5); - Kokkos::View x0 = - Kokkos::subview(x8, 0, 0, 0, 0, 0, 0, 0, 0); + Kokkos::View x0; + make_subview(use_constr, x0, x8, 0, 0, 0, 0, 0, 0, 0, 0); ASSERT_TRUE(&x0() == &x8(0, 0, 0, 0, 0, 0, 0, 0)); - Kokkos::View x1 = - Kokkos::subview(x8, 0, 1, 2, 3, 0, 1, 2, Kokkos::pair(1, 3)); + Kokkos::View x1; + make_subview(use_constr, x1, x8, 0, 1, 2, 3, 0, 1, 2, + Kokkos::pair(1, 3)); ASSERT_TRUE(&x1(0) == &x8(0, 1, 2, 3, 0, 1, 2, 1)); ASSERT_TRUE(&x1(1) == &x8(0, 1, 2, 3, 0, 1, 2, 2)); - Kokkos::View x2 = - Kokkos::subview(x8, 0, 1, 2, Kokkos::pair(1, 3), 0, 1, 2, - Kokkos::pair(1, 3)); + Kokkos::View x1_deg1; + make_subview(use_constr, x1_deg1, x8, 0, 1, 2, 3, 0, 1, 2, + Kokkos::pair(3, 3)); + ASSERT_EQ(0, x1_deg1.span()); + + Kokkos::View x2; + make_subview(use_constr, x2, x8, 0, 1, 2, Kokkos::pair(1, 3), 0, + 1, 2, Kokkos::pair(1, 3)); ASSERT_TRUE(&x2(0, 0) == &x8(0, 1, 2, 1, 0, 1, 2, 1)); ASSERT_TRUE(&x2(1, 0) == &x8(0, 1, 2, 2, 0, 1, 2, 1)); ASSERT_TRUE(&x2(0, 1) == &x8(0, 1, 2, 1, 0, 1, 2, 2)); ASSERT_TRUE(&x2(1, 1) == &x8(0, 1, 2, 2, 0, 1, 2, 2)); + Kokkos::View x2_deg2; + make_subview(use_constr, x2_deg2, x8, 0, 1, 2, Kokkos::pair(1, 3), + 0, 1, 2, Kokkos::pair(3, 3)); + ASSERT_EQ(0, x2_deg2.span()); + // Kokkos::View< int**, Kokkos::LayoutRight, Space > error_2 = - Kokkos::View sx2 = - Kokkos::subview(x8, 1, Kokkos::pair(0, 2), 2, 3, - Kokkos::pair(0, 2), 1, 2, 3); + Kokkos::View sx2; + make_subview(use_constr, sx2, x8, 1, Kokkos::pair(0, 2), 2, 3, + Kokkos::pair(0, 2), 1, 2, 3); ASSERT_TRUE(&sx2(0, 0) == &x8(1, 0, 2, 3, 0, 1, 2, 3)); ASSERT_TRUE(&sx2(1, 0) == &x8(1, 1, 2, 3, 0, 1, 2, 3)); ASSERT_TRUE(&sx2(0, 1) == &x8(1, 0, 2, 3, 1, 1, 2, 3)); ASSERT_TRUE(&sx2(1, 1) == &x8(1, 1, 2, 3, 1, 1, 2, 3)); - Kokkos::View sx4 = - Kokkos::subview(x8, 0, Kokkos::pair(0, 2) /* of [3] */ - , - 1, Kokkos::pair(1, 3) /* of [5] */ - , - 1, Kokkos::pair(0, 2) /* of [3] */ - , - 2, Kokkos::pair(2, 4) /* of [5] */ - ); + Kokkos::View sx2_deg; + make_subview(use_constr, sx2_deg, x8, 1, Kokkos::pair(0, 2), 2, 3, + 1, 1, 2, Kokkos::pair(3, 3)); + ASSERT_EQ(0, sx2_deg.span()); + + Kokkos::View sx4; + make_subview(use_constr, sx4, x8, 0, + Kokkos::pair(0, 2) /* of [3] */ + , + 1, Kokkos::pair(1, 3) /* of [5] */ + , + 1, Kokkos::pair(0, 2) /* of [3] */ + , + 2, Kokkos::pair(2, 4) /* of [5] */ + ); for (int i0 = 0; i0 < (int)sx4.extent(0); ++i0) for (int i1 = 0; i1 < (int)sx4.extent(1); ++i1) @@ -697,9 +793,15 @@ void test_right_1() { } } +template +void test_right_1() { + test_right_1(true); + test_right_1(false); +} + template void test_right_3() { - typedef Kokkos::View view_type; + using view_type = Kokkos::View; if (Kokkos::Impl::SpaceAccessibility< Kokkos::HostSpace, typename Space::memory_space>::accessible) { @@ -761,76 +863,360 @@ constexpr int N2 = 17; constexpr int N3 = 5; constexpr int N4 = 7; +template +struct FillView_1D { + using view_t = Kokkos::View; + view_t a; + using policy_t = Kokkos::RangePolicy; + + FillView_1D(view_t a_) : a(a_) {} + + void run() { + Kokkos::parallel_for("FillView_1D", policy_t(0, a.extent(0)), *this); + } + KOKKOS_INLINE_FUNCTION + void operator()(int i) const { a(i) = i; } +}; + +template +struct FillView_3D { + using exec_t = typename Space::execution_space; + using view_t = Kokkos::View; + using rank_t = Kokkos::Rank< + view_t::Rank, + std::is_same::value ? Kokkos::Iterate::Left + : Kokkos::Iterate::Right, + std::is_same::value ? Kokkos::Iterate::Left + : Kokkos::Iterate::Right>; + using policy_t = Kokkos::MDRangePolicy; + + view_t a; + + FillView_3D(view_t a_) : a(a_) {} + + void run() { + Kokkos::parallel_for( + "FillView_3D", + policy_t({0, 0, 0}, {a.extent(0), a.extent(1), a.extent(2)}), *this); + } + + KOKKOS_INLINE_FUNCTION + void operator()(int i0, int i1, int i2) const { + a(i0, i1, i2) = 1000000 * i0 + 1000 * i1 + i2; + } +}; + +template +struct FillView_4D { + using exec_t = typename Space::execution_space; + using view_t = Kokkos::View; + using rank_t = Kokkos::Rank< + view_t::Rank, + std::is_same::value ? Kokkos::Iterate::Left + : Kokkos::Iterate::Right, + std::is_same::value ? Kokkos::Iterate::Left + : Kokkos::Iterate::Right>; + using policy_t = Kokkos::MDRangePolicy; + + view_t a; + + FillView_4D(view_t a_) : a(a_) {} + + void run() { + Kokkos::parallel_for("FillView_4D", + policy_t({0, 0, 0, 0}, {a.extent(0), a.extent(1), + a.extent(2), a.extent(3)}), + *this); + } + + KOKKOS_INLINE_FUNCTION + void operator()(int i0, int i1, int i2, int i3) const { + a(i0, i1, i2, i3) = 1000000 * i0 + 10000 * i1 + 100 * i2 + i3; + } +}; + +template +struct FillView_5D { + using exec_t = typename Space::execution_space; + using view_t = Kokkos::View; + using rank_t = Kokkos::Rank< + view_t::Rank, + std::is_same::value ? Kokkos::Iterate::Left + : Kokkos::Iterate::Right, + std::is_same::value ? Kokkos::Iterate::Left + : Kokkos::Iterate::Right>; + using policy_t = Kokkos::MDRangePolicy; + + view_t a; + + FillView_5D(view_t a_) : a(a_) {} + + void run() { + Kokkos::parallel_for( + "FillView_5D", + policy_t({0, 0, 0, 0, 0}, {a.extent(0), a.extent(1), a.extent(2), + a.extent(3), a.extent(4)}), + *this); + } + + KOKKOS_INLINE_FUNCTION + void operator()(int i0, int i1, int i2, int i3, int i4) const { + a(i0, i1, i2, i3, i4) = 1000000 * i0 + 10000 * i1 + 100 * i2 + 10 * i3 + i4; + } +}; + +template +struct CheckSubviewCorrectness_1D_1D { + using policy_t = Kokkos::RangePolicy; + View a; + SubView b; + int offset; + + CheckSubviewCorrectness_1D_1D(View a_, SubView b_, int o) + : a(a_), b(b_), offset(o) {} + + void run() { + int errors = 0; + Kokkos::parallel_reduce("CheckSubView_1D_1D", policy_t(0, b.size()), *this, + errors); + ASSERT_TRUE(errors == 0); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const int& i, int& e) const { + if (a(i + offset) != b(i)) { + e++; + } + } +}; + +template +struct CheckSubviewCorrectness_1D_2D { + using policy_t = Kokkos::RangePolicy; + View a; + SubView b; + int i0; + int offset; + + CheckSubviewCorrectness_1D_2D(View a_, SubView b_, int i0_, int o) + : a(a_), b(b_), i0(i0_), offset(o) {} + + void run() { + int errors = 0; + Kokkos::parallel_reduce("CheckSubView_1D_2D", policy_t(0, b.size()), *this, + errors); + ASSERT_TRUE(errors == 0); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const int& i1, int& e) const { + if (a(i0, i1 + offset) != b(i1)) { + e++; + } + } +}; + +template +struct CheckSubviewCorrectness_2D_3D { + using policy_t = Kokkos::RangePolicy; + using layout = typename View::array_layout; + View a; + SubView b; + int i0; + int offset_1; + int offset_2; + + CheckSubviewCorrectness_2D_3D(View a_, SubView b_, int i0_, int o1, int o2) + : a(a_), b(b_), i0(i0_), offset_1(o1), offset_2(o2) {} + + void run() { + int errors = 0; + Kokkos::parallel_reduce("CheckSubView_2D_3D", policy_t(0, b.size()), *this, + errors); + ASSERT_TRUE(errors == 0); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const int& ii, int& e) const { + const int i1 = std::is_same::value + ? ii % b.extent(0) + : ii / b.extent(1); + + const int i2 = std::is_same::value + ? ii / b.extent(0) + : ii % b.extent(1); + + if (a(i0, i1 + offset_1, i2 + offset_2) != b(i1, i2)) { + e++; + } + } +}; + +template +struct CheckSubviewCorrectness_3D_3D { + using policy_t = Kokkos::RangePolicy; + using layout = typename View::array_layout; + View a; + SubView b; + int offset_0; + int offset_2; + + CheckSubviewCorrectness_3D_3D(View a_, SubView b_, int o0, int o2) + : a(a_), b(b_), offset_0(o0), offset_2(o2) {} + + void run() { + int errors = 0; + Kokkos::parallel_reduce("CheckSubView_3D_3D", policy_t(0, b.size()), *this, + errors); + ASSERT_TRUE(errors == 0); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const int& ii, int& e) const { + const int i0 = std::is_same::value + ? ii % b.extent(0) + : ii / (b.extent(1) * b.extent(2)); + + const int i1 = std::is_same::value + ? (ii / b.extent(0)) % b.extent(1) + : (ii / b.extent(2)) % b.extent(1); + + const int i2 = std::is_same::value + ? ii / (b.extent(0) * b.extent(1)) + : ii % b.extent(2); + + if (a(i0 + offset_0, i1, i2 + offset_2) != b(i0, i1, i2)) { + e++; + } + } +}; + +template +struct CheckSubviewCorrectness_3D_4D { + using policy_t = Kokkos::RangePolicy; + using layout = typename View::array_layout; + View a; + SubView b; + int index; + int offset_0, offset_2; + + CheckSubviewCorrectness_3D_4D(View a_, SubView b_, int index_, int o0, int o2) + : a(a_), b(b_), index(index_), offset_0(o0), offset_2(o2) {} + + void run() { + int errors = 0; + Kokkos::parallel_reduce("CheckSubView_3D_4D", policy_t(0, b.size()), *this, + errors); + ASSERT_TRUE(errors == 0); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const int& ii, int& e) const { + const int i = std::is_same::value + ? ii % b.extent(0) + : ii / (b.extent(1) * b.extent(2)); + + const int j = std::is_same::value + ? (ii / b.extent(0)) % b.extent(1) + : (ii / b.extent(2)) % b.extent(1); + + const int k = std::is_same::value + ? ii / (b.extent(0) * b.extent(1)) + : ii % b.extent(2); + + int i0, i1, i2, i3; + + if (std::is_same::value) { + i0 = i + offset_0; + i1 = j; + i2 = k + offset_2; + i3 = index; + } else { + i0 = index; + i1 = i + offset_0; + i2 = j; + i3 = k + offset_2; + } + + if (a(i0, i1, i2, i3) != b(i, j, k)) e++; + } +}; + +template +struct CheckSubviewCorrectness_3D_5D { + using policy_t = Kokkos::RangePolicy; + using layout = typename View::array_layout; + View a; + SubView b; + int i0, i1; + int offset_2, offset_3, offset_4; + + CheckSubviewCorrectness_3D_5D(View a_, SubView b_, int i0_, int i1_, int o2, + int o3, int o4) + : a(a_), + b(b_), + i0(i0_), + i1(i1_), + offset_2(o2), + offset_3(o3), + offset_4(o4) {} + + void run() { + int errors = 0; + Kokkos::parallel_reduce("CheckSubView_3D_5D", policy_t(0, b.size()), *this, + errors); + ASSERT_TRUE(errors == 0); + } + + KOKKOS_INLINE_FUNCTION + void operator()(const int& ii, int& e) const { + const int i2 = std::is_same::value + ? ii % b.extent(0) + : ii / (b.extent(1) * b.extent(2)); + + const int i3 = std::is_same::value + ? (ii / b.extent(0)) % b.extent(1) + : (ii / b.extent(2)) % b.extent(1); + + const int i4 = std::is_same::value + ? ii / (b.extent(0) * b.extent(1)) + : ii % b.extent(2); + + if (a(i0, i1, i2 + offset_2, i3 + offset_3, i4 + offset_4) != + b(i2, i3, i4)) { + e++; + } + } +}; + template -void test_Check1D(SubView a, View b, std::pair range) { - int errors = 0; - - for (int i = 0; i < range.second - range.first; i++) { - if (a(i) != b(i + range.first)) errors++; - } - - if (errors > 0) { - std::cout << "Error Suviews test_Check1D: " << errors << std::endl; - } - - ASSERT_TRUE(errors == 0); +void test_Check1D(SubView a, View b, Kokkos::pair range) { + CheckSubviewCorrectness_1D_1D check(b, a, range.first); + check.run(); } template void test_Check1D2D(SubView a, View b, int i0, std::pair range) { - int errors = 0; - - for (int i1 = 0; i1 < range.second - range.first; i1++) { - if (a(i1) != b(i0, i1 + range.first)) errors++; - } - - if (errors > 0) { - std::cout << "Error Suviews test_Check1D2D: " << errors << std::endl; - } - - ASSERT_TRUE(errors == 0); + CheckSubviewCorrectness_1D_2D check(b, a, i0, range.first); + check.run(); } template void test_Check2D3D(SubView a, View b, int i0, std::pair range1, std::pair range2) { - int errors = 0; - - for (int i1 = 0; i1 < range1.second - range1.first; i1++) { - for (int i2 = 0; i2 < range2.second - range2.first; i2++) { - if (a(i1, i2) != b(i0, i1 + range1.first, i2 + range2.first)) errors++; - } - } - - if (errors > 0) { - std::cout << "Error Suviews test_Check2D3D: " << errors << std::endl; - } - - ASSERT_TRUE(errors == 0); + CheckSubviewCorrectness_2D_3D check(b, a, i0, range1.first, + range2.first); + check.run(); } template void test_Check3D5D(SubView a, View b, int i0, int i1, - std::pair range2, std::pair range3, - std::pair range4) { - int errors = 0; - - for (int i2 = 0; i2 < range2.second - range2.first; i2++) { - for (int i3 = 0; i3 < range3.second - range3.first; i3++) { - for (int i4 = 0; i4 < range4.second - range4.first; i4++) { - if (a(i2, i3, i4) != b(i0, i1, i2 + range2.first, i3 + range3.first, - i4 + range4.first)) { - errors++; - } - } - } - } - - if (errors > 0) { - std::cout << "Error Suviews test_Check3D5D: " << errors << std::endl; - } - - ASSERT_TRUE(errors == 0); + Kokkos::pair range2, + Kokkos::pair range3, + Kokkos::pair range4) { + CheckSubviewCorrectness_3D_5D check( + b, a, i0, i1, range2.first, range3.first, range4.first); + check.run(); } template a_org("A", N0); Kokkos::View a(a_org); Kokkos::fence(); - for (int i = 0; i < N0; i++) a_org(i) = i; + + Impl::FillView_1D fill(a_org); + fill.run(); Kokkos::View a1(a); Kokkos::fence(); @@ -876,11 +1264,8 @@ void test_2d_subview_3d_impl_type() { Kokkos::View a_org("A", N0, N1, N2); Kokkos::View a(a_org); - for (int i0 = 0; i0 < N0; i0++) - for (int i1 = 0; i1 < N1; i1++) - for (int i2 = 0; i2 < N2; i2++) { - a_org(i0, i1, i2) = i0 * 1000000 + i1 * 1000 + i2; - } + Impl::FillView_3D fill(a_org); + fill.run(); Kokkos::View a1; a1 = Kokkos::subview(a, 3, Kokkos::ALL, Kokkos::ALL); @@ -961,14 +1346,8 @@ void test_3d_subview_5d_impl_type() { Kokkos::View a_org("A", N0, N1, N2, N3, N4); Kokkos::View a(a_org); - for (int i0 = 0; i0 < N0; i0++) - for (int i1 = 0; i1 < N1; i1++) - for (int i2 = 0; i2 < N2; i2++) - for (int i3 = 0; i3 < N3; i3++) - for (int i4 = 0; i4 < N4; i4++) { - a_org(i0, i1, i2, i3, i4) = - i0 * 1000000 + i1 * 10000 + i2 * 100 + i3 * 10 + i4; - } + Impl::FillView_5D fill(a_org); + fill.run(); Kokkos::View a1; a1 = Kokkos::subview(a, 3, 5, Kokkos::ALL, Kokkos::ALL, Kokkos::ALL); @@ -1245,7 +1624,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, int, @@ -1253,7 +1632,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::pair, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::pair, int, @@ -1261,7 +1640,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::pair, Kokkos::Impl::ALL_t, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::pair, Kokkos::Impl::ALL_t, int, @@ -1269,7 +1648,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::pair, Kokkos::pair, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, Kokkos::pair, Kokkos::pair, int, @@ -1278,7 +1657,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(1, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, @@ -1286,7 +1665,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::pair, @@ -1294,7 +1673,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::pair, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(1, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::pair, Kokkos::Impl::ALL_t, @@ -1302,7 +1681,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::pair, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 5, 0, int, int, Kokkos::pair, Kokkos::pair, @@ -1315,7 +1694,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(1, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::pair, Kokkos::Impl::ALL_t, @@ -1323,7 +1702,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::pair, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::Impl::ALL_t, Kokkos::pair, @@ -1331,7 +1710,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::Impl::ALL_t, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::pair, Kokkos::pair, @@ -1339,7 +1718,7 @@ inline void test_subview_legal_args_right() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutRight, Kokkos::LayoutRight, 3, 3, 0, Kokkos::pair, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); } inline void test_subview_legal_args_left() { @@ -1490,7 +1869,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, int, @@ -1498,7 +1877,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::pair, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::Impl::ALL_t, Kokkos::pair, int, @@ -1506,7 +1885,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::pair, Kokkos::Impl::ALL_t, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::pair, Kokkos::Impl::ALL_t, int, @@ -1514,7 +1893,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::pair, Kokkos::pair, int, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, Kokkos::pair, Kokkos::pair, int, @@ -1523,7 +1902,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::Impl::ALL_t, @@ -1531,7 +1910,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::Impl::ALL_t, Kokkos::pair, @@ -1539,7 +1918,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::pair, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::pair, Kokkos::Impl::ALL_t, @@ -1547,7 +1926,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::pair, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 5, 0, int, int, Kokkos::pair, Kokkos::pair, @@ -1557,7 +1936,7 @@ inline void test_subview_legal_args_left() { 1, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 3, 0, Kokkos::Impl::ALL_t, - Kokkos::Impl::ALL_t, Kokkos::pair >::value)); + Kokkos::Impl::ALL_t, Kokkos::pair>::value)); ASSERT_EQ( 1, (Kokkos::Impl::SubviewLegalArgsCompileTime< @@ -1566,7 +1945,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(1, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 3, 0, Kokkos::pair, Kokkos::Impl::ALL_t, - Kokkos::pair >::value)); + Kokkos::pair>::value)); ASSERT_EQ(1, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 3, 0, Kokkos::pair, Kokkos::Impl::ALL_t, @@ -1580,7 +1959,7 @@ inline void test_subview_legal_args_left() { 0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 3, 0, Kokkos::Impl::ALL_t, - Kokkos::pair, Kokkos::pair >::value)); + Kokkos::pair, Kokkos::pair>::value)); ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 3, 0, Kokkos::pair, Kokkos::pair, @@ -1588,7 +1967,7 @@ inline void test_subview_legal_args_left() { ASSERT_EQ(0, (Kokkos::Impl::SubviewLegalArgsCompileTime< Kokkos::LayoutLeft, Kokkos::LayoutLeft, 3, 3, 0, Kokkos::pair, Kokkos::pair, - Kokkos::pair >::value)); + Kokkos::pair>::value)); } } // namespace Impl @@ -1653,203 +2032,46 @@ void test_3d_subview_5d_left() { MemTraits>(); } -namespace Impl { - -template -struct FillView_3D { - Kokkos::View a; - - KOKKOS_INLINE_FUNCTION - void operator()(const int& ii) const { - const int i = std::is_same::value - ? ii % a.extent(0) - : ii / (a.extent(1) * a.extent(2)); - - const int j = std::is_same::value - ? (ii / a.extent(0)) % a.extent(1) - : (ii / a.extent(2)) % a.extent(1); - - const int k = std::is_same::value - ? ii / (a.extent(0) * a.extent(1)) - : ii % a.extent(2); - - a(i, j, k) = 1000000 * i + 1000 * j + k; - } -}; - -template -struct FillView_4D { - Kokkos::View a; - - KOKKOS_INLINE_FUNCTION - void operator()(const int& ii) const { - const int i = std::is_same::value - ? ii % a.extent(0) - : ii / (a.extent(1) * a.extent(2) * a.extent(3)); - - const int j = std::is_same::value - ? (ii / a.extent(0)) % a.extent(1) - : (ii / (a.extent(2) * a.extent(3)) % a.extent(1)); - - const int k = std::is_same::value - ? (ii / (a.extent(0) * a.extent(1))) % a.extent(2) - : (ii / a.extent(3)) % a.extent(2); - - const int l = std::is_same::value - ? ii / (a.extent(0) * a.extent(1) * a.extent(2)) - : ii % a.extent(3); - - a(i, j, k, l) = 1000000 * i + 10000 * j + 100 * k + l; - } -}; - -template -struct CheckSubviewCorrectness_3D_3D { - Kokkos::View a; - Kokkos::View b; - int offset_0, offset_2; - - KOKKOS_INLINE_FUNCTION - void operator()(const int& ii) const { - const int i = std::is_same::value - ? ii % b.extent(0) - : ii / (b.extent(1) * b.extent(2)); - - const int j = std::is_same::value - ? (ii / b.extent(0)) % b.extent(1) - : (ii / b.extent(2)) % b.extent(1); - - const int k = std::is_same::value - ? ii / (b.extent(0) * b.extent(1)) - : ii % b.extent(2); - - if (a(i + offset_0, j, k + offset_2) != b(i, j, k)) { - Kokkos::abort( - "Error: check_subview_correctness 3D-3D (LayoutLeft -> LayoutLeft or " - "LayoutRight -> LayoutRight)"); - } - } -}; - -template -struct CheckSubviewCorrectness_3D_4D { - Kokkos::View a; - Kokkos::View b; - int offset_0, offset_2, index; - - KOKKOS_INLINE_FUNCTION - void operator()(const int& ii) const { - const int i = std::is_same::value - ? ii % b.extent(0) - : ii / (b.extent(1) * b.extent(2)); - - const int j = std::is_same::value - ? (ii / b.extent(0)) % b.extent(1) - : (ii / b.extent(2)) % b.extent(1); - - const int k = std::is_same::value - ? ii / (b.extent(0) * b.extent(1)) - : ii % b.extent(2); - - int i0, i1, i2, i3; - - if (std::is_same::value) { - i0 = i + offset_0; - i1 = j; - i2 = k + offset_2; - i3 = index; - } else { - i0 = index; - i1 = i + offset_0; - i2 = j; - i3 = k + offset_2; - } - - if (a(i0, i1, i2, i3) != b(i, j, k)) { - Kokkos::abort( - "Error: check_subview_correctness 3D-4D (LayoutLeft -> LayoutLeft or " - "LayoutRight -> LayoutRight)"); - } - } -}; - -} // namespace Impl - template void test_layoutleft_to_layoutleft() { Impl::test_subview_legal_args_left(); + using view3D_t = Kokkos::View; + using view4D_t = Kokkos::View; { - Kokkos::View a("A", 100, 4, 3); - Kokkos::View b( - a, Kokkos::pair(16, 32), Kokkos::ALL, Kokkos::ALL); + view3D_t a("A", 100, 4, 3); + view3D_t b(a, Kokkos::pair(16, 32), Kokkos::ALL, Kokkos::ALL); - Impl::FillView_3D fill; - fill.a = a; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, a.extent(0) * a.extent(1) * a.extent(2)), - fill); + Impl::FillView_3D fill(a); + fill.run(); - Impl::CheckSubviewCorrectness_3D_3D - check; - check.a = a; - check.b = b; - check.offset_0 = 16; - check.offset_2 = 0; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, b.extent(0) * b.extent(1) * b.extent(2)), - check); - Kokkos::fence(); + Impl::CheckSubviewCorrectness_3D_3D check(a, b, 16, 0); + check.run(); } { - Kokkos::View a("A", 100, 4, 5); - Kokkos::View b( - a, Kokkos::pair(16, 32), Kokkos::ALL, - Kokkos::pair(1, 3)); + view3D_t a("A", 100, 4, 5); + view3D_t b(a, Kokkos::pair(16, 32), Kokkos::ALL, + Kokkos::pair(1, 3)); - Impl::FillView_3D fill; - fill.a = a; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, a.extent(0) * a.extent(1) * a.extent(2)), - fill); + Impl::FillView_3D fill(a); + fill.run(); - Impl::CheckSubviewCorrectness_3D_3D - check; - check.a = a; - check.b = b; - check.offset_0 = 16; - check.offset_2 = 1; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, b.extent(0) * b.extent(1) * b.extent(2)), - check); - Kokkos::fence(); + Impl::CheckSubviewCorrectness_3D_3D check(a, b, 16, 1); + check.run(); } { - Kokkos::View a("A", 100, 4, 5, 3); - Kokkos::View b( - a, Kokkos::pair(16, 32), Kokkos::ALL, - Kokkos::pair(1, 3), 1); + view4D_t a("A", 100, 4, 5, 3); + view3D_t b(a, Kokkos::pair(16, 32), Kokkos::ALL, + Kokkos::pair(1, 3), 1); - Impl::FillView_4D fill; - fill.a = a; - Kokkos::parallel_for( - Kokkos::RangePolicy( - 0, a.extent(0) * a.extent(1) * a.extent(2) * a.extent(3)), - fill); + Impl::FillView_4D fill(a); + fill.run(); - Impl::CheckSubviewCorrectness_3D_4D - check; - check.a = a; - check.b = b; - check.offset_0 = 16; - check.offset_2 = 1; - check.index = 1; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, b.extent(0) * b.extent(1) * b.extent(2)), - check); - Kokkos::fence(); + Impl::CheckSubviewCorrectness_3D_4D check(a, b, 1, 16, + 1); + check.run(); } } @@ -1857,55 +2079,30 @@ template void test_layoutright_to_layoutright() { Impl::test_subview_legal_args_right(); + using view3D_t = Kokkos::View; + using view4D_t = Kokkos::View; { - Kokkos::View a("A", 100, 4, 3); - Kokkos::View b( - a, Kokkos::pair(16, 32), Kokkos::ALL, Kokkos::ALL); + view3D_t a("A", 100, 4, 3); + view3D_t b(a, Kokkos::pair(16, 32), Kokkos::ALL, Kokkos::ALL); - Impl::FillView_3D fill; - fill.a = a; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, a.extent(0) * a.extent(1) * a.extent(2)), - fill); + Impl::FillView_3D fill(a); + fill.run(); - Impl::CheckSubviewCorrectness_3D_3D - check; - check.a = a; - check.b = b; - check.offset_0 = 16; - check.offset_2 = 0; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, b.extent(0) * b.extent(1) * b.extent(2)), - check); - Kokkos::fence(); + Impl::CheckSubviewCorrectness_3D_3D check(a, b, 16, 0); + check.run(); } - { - Kokkos::View a("A", 3, 4, 5, 100); - Kokkos::View b( - a, 1, Kokkos::pair(1, 3), Kokkos::ALL, Kokkos::ALL); + view4D_t a("A", 3, 4, 5, 100); + view3D_t b(a, 1, Kokkos::pair(1, 3), Kokkos::ALL, Kokkos::ALL); - Impl::FillView_4D fill; - fill.a = a; - Kokkos::parallel_for( - Kokkos::RangePolicy( - 0, a.extent(0) * a.extent(1) * a.extent(2) * a.extent(3)), - fill); + Impl::FillView_4D fill(a); + fill.run(); - Impl::CheckSubviewCorrectness_3D_4D - check; - check.a = a; - check.b = b; - check.offset_0 = 1; - check.offset_2 = 0; - check.index = 1; - Kokkos::parallel_for(Kokkos::RangePolicy( - 0, b.extent(0) * b.extent(1) * b.extent(2)), - check); - Kokkos::fence(); + Impl::CheckSubviewCorrectness_3D_4D check(a, b, 1, 1, + 0); + check.run(); } } - //---------------------------------------------------------------------------- template @@ -1940,7 +2137,7 @@ template struct get_view_type; template -struct get_view_type > { +struct get_view_type> { using type = T; }; diff --git a/lib/kokkos/core/unit_test/Test_InterOp_Streams.hpp b/lib/kokkos/core/unit_test/Test_InterOp_Streams.hpp new file mode 100644 index 0000000000..4c16147a36 --- /dev/null +++ b/lib/kokkos/core/unit_test/Test_InterOp_Streams.hpp @@ -0,0 +1,144 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include + +namespace Test { + +__global__ void offset_streams(int* p) { + int idx = blockIdx.x * blockDim.x + threadIdx.x; + if (idx < 100) { + p[idx] += idx; + } +} + +template +struct FunctorRange { + Kokkos::View> a; + FunctorRange( + Kokkos::View> + a_) + : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i) const { a(i) += 1; } +}; + +template +struct FunctorRangeReduce { + Kokkos::View> a; + FunctorRangeReduce( + Kokkos::View> + a_) + : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i, int& lsum) const { lsum += a(i); } +}; + +template +struct FunctorMDRange { + Kokkos::View> a; + FunctorMDRange( + Kokkos::View> + a_) + : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i, const int j) const { a(i * 10 + j) += 1; } +}; + +template +struct FunctorMDRangeReduce { + Kokkos::View> a; + FunctorMDRangeReduce( + Kokkos::View> + a_) + : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i, const int j, int& lsum) const { + lsum += a(i * 10 + j); + } +}; + +template +struct FunctorTeam { + Kokkos::View> a; + FunctorTeam( + Kokkos::View> + a_) + : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()( + typename Kokkos::TeamPolicy::member_type const& team) + const { + int i = team.league_rank(); + Kokkos::parallel_for(Kokkos::TeamThreadRange(team, 10), + [&](const int j) { a(i * 10 + j) += 1; }); + } +}; + +template +struct FunctorTeamReduce { + Kokkos::View> a; + FunctorTeamReduce( + Kokkos::View> + a_) + : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()( + typename Kokkos::TeamPolicy::member_type const& team, + int& lsum) const { + int i = team.league_rank(); + int team_sum; + Kokkos::parallel_reduce( + Kokkos::TeamThreadRange(team, 10), + [&](const int j, int& tsum) { tsum += a(i * 10 + j); }, team_sum); + Kokkos::single(Kokkos::PerTeam(team), [&]() { lsum += team_sum; }); + } +}; +} // namespace Test diff --git a/lib/kokkos/core/unit_test/UnitTestConfig.make b/lib/kokkos/core/unit_test/UnitTestConfig.make deleted file mode 100644 index 5c93bf69fb..0000000000 --- a/lib/kokkos/core/unit_test/UnitTestConfig.make +++ /dev/null @@ -1,52 +0,0 @@ -KOKKOS_PATH = ../.. - -# See $(KOKKOS_PATH)/Makefile.kokkos and $(KOKKOS_PATH)/generate_makefile.bash -KOKKOS_ARCH_OPTIONS="None AMDAVX ARMv80 ARMv81 ARMv8-ThunderX \ - BGQ Power7 Power8 Power9 \ - WSM SNB HSW BDW SKX KNC KNL \ - Kepler Kepler30 Kepler32 Kepler35 Kepler37 \ - Maxwell Maxwell50 Maxwell52 Maxwell53 Pascal60 Pascal61" -#KOKKOS_ARCH_OPTIONS="AMDAVX" - -KOKKOS_DEVICE_OPTIONS="Cuda ROCm OpenMP Pthread Serial" -#KOKKOS_DEVICE_OPTIONS="Cuda" - -# Configure paths to enable environment query in Makefile.kokkos to work -ROCM_HCC_PATH="config" -CXX="./config/cxx" -ipath=env CXX=$(CXX) env PATH=./config:$$PATH env ROCM_HCC_PATH=$(ROCM_HCC_PATH) - -# Defined in core/src/Makefile -- this should be consistent -KOKKOS_MAKEFILE=Makefile.kokkos -KOKKOS_CMAKEFILE=kokkos_generated_settings.cmake - -# Defined in Makefile.kokkos -- this should be consistent -KOKKOS_INTERNAL_CONFIG_TMP=KokkosCore_config.tmp -KOKKOS_CONFIG_HEADER=KokkosCore_config.h - -d='\#' - -# diff => 0 is no difference. if => 0 is false -testmake=if test "`testmake.sh $1 $2 $3`" = 'Passed'; then echo OK $d $1; else echo not OK $d $1; fi -testconf=if test "`diffconfig.sh $1`" = 'Passed'; then echo OK $d $1; else echo not OK $d $1; fi - -# testing tmp and cmakefile files is unnecessary here -test: - @for karch in "$(KOKKOS_ARCH_OPTIONS)"; do \ - for device in "$(KOKKOS_DEVICE_OPTIONS)"; do \ - $(ipath) KOKKOS_DEVICES=$$device KOKKOS_ARCH=$$karch make -e -f ../src/Makefile build-makefile-cmake-kokkos; \ - rm -f $(KOKKOS_INTERNAL_CONFIG_TMP) $(KOKKOS_CMAKEFILE); \ - prfx="$$karch"_"$$device"_; \ - newmake="$$prfx"$(KOKKOS_MAKEFILE); \ - newconf="$$prfx"$(KOKKOS_CONFIG_HEADER); \ - mv $(KOKKOS_MAKEFILE) config/tmpstore/$$newmake; \ - mv $(KOKKOS_CONFIG_HEADER) config/tmpstore/$$newconf; \ - $(call testmake,$$newmake,$$karch,$$device); \ - $(call testconf,$$newconf); \ - done; \ - done - -test-cmake: - @cd config/cmaketest; \ - cmake . ; \ - make test diff --git a/lib/kokkos/core/unit_test/config/bin/hcc-config b/lib/kokkos/core/unit_test/config/bin/hcc-config deleted file mode 100755 index fc09138bcc..0000000000 --- a/lib/kokkos/core/unit_test/config/bin/hcc-config +++ /dev/null @@ -1,2 +0,0 @@ -#!/bin/sh -echo "--foo --bar" diff --git a/lib/kokkos/core/unit_test/config/clang b/lib/kokkos/core/unit_test/config/clang deleted file mode 100755 index 34c6919410..0000000000 --- a/lib/kokkos/core/unit_test/config/clang +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -echo="Apple LLVM version 8.1.0 (clang-802.0.42)" -echo="Target: x86_64-apple-darwin16.7.0" -echo="Thread model: posix" -echo="InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin" diff --git a/lib/kokkos/core/unit_test/config/cmaketest/CMakeLists.txt b/lib/kokkos/core/unit_test/config/cmaketest/CMakeLists.txt deleted file mode 100644 index 5d59017394..0000000000 --- a/lib/kokkos/core/unit_test/config/cmaketest/CMakeLists.txt +++ /dev/null @@ -1,79 +0,0 @@ -cmake_minimum_required(VERSION 3.1 FATAL_ERROR) -project(Kokkos CXX) - -enable_testing() - -# Initialization -get_filename_component(KOKKOS_TESTDIR ${CMAKE_SOURCE_DIR}/../.. REALPATH) -get_filename_component(KOKKOS_SRCDIR ${CMAKE_SOURCE_DIR}/../../../.. REALPATH) -set(KOKKOS_SRC_PATH ${KOKKOS_SRCDIR}) -set(KOKKOS_PATH ${KOKKOS_SRC_PATH}) - -set(CXX ${KOKKOS_TESTDIR}/config/cxx) - -# Defined in core/src/Makefile -- this should be consistent -set(KOKKOS_MAKEFILE Makefile.kokkos) -set(KOKKOS_CMAKEFILE kokkos_generated_settings.cmake) - -# Defined in Makefile.kokkos -- this should be consistent -set(KOKKOS_INTERNAL_CONFIG_TMP KokkosCore_config.tmp) -set(KOKKOS_CONFIG_HEADER KokkosCore_config.h) - -include(${KOKKOS_SRCDIR}/cmake/kokkos_options.cmake) -foreach(KOKKOS_DEV ${KOKKOS_DEVICES_LIST}) -# Do some initialization: Want to turn everything off for testing - string(TOUPPER ${KOKKOS_DEV} KOKKOS_DEVUC) - set(KOKKOS_ENABLE_${KOKKOS_DEVUC} OFF) -endforeach() - - -#TEST set(KOKKOS_HOST_ARCH_LIST ARMv80) -#TEST set(KOKKOS_DEVICES_LIST Cuda) -#set(KOKKOS_HOST_ARCH_LIST AMDAVX) -#set(KOKKOS_DEVICES_LIST Cuda) - -foreach(KOKKOS_HOST_ARCH ${KOKKOS_HOST_ARCH_LIST}) - foreach(KOKKOS_DEV ${KOKKOS_DEVICES_LIST}) - string(TOUPPER ${KOKKOS_DEV} KOKKOS_DEVUC) - set(KOKKOS_ENABLE_${KOKKOS_DEVUC} On) - - set(KOKKOS_CMAKE_VERBOSE True) - include(${KOKKOS_SRCDIR}/cmake/kokkos_options.cmake) - set(KOKKOS_SETTINGS ${KOKKOS_SETTINGS} ROCM_HCC_PATH=${KOKKOS_TESTDIR}/config) - - #message(STATUS "${KOKKOS_SETTINGS} make -f ${KOKKOS_SRCDIR}/core/src/Makefile build-makefile-cmake-kokkos") - execute_process( - COMMAND ${KOKKOS_SETTINGS} make -f ${KOKKOS_SRCDIR}/core/src/Makefile build-makefile-cmake-kokkos - WORKING_DIRECTORY "${CMAKE_CURRENT_SOURCE_DIR}" - OUTPUT_FILE ${CMAKE_BINARY_DIR}/core_src_make.out - RESULT_VARIABLE res - ) - #message(STATUS "RESULT ${res}") - - file(REMOVE ${KOKKOS_INTERNAL_CONFIG_TMP} ${KOKKOS_MAKEFILE}) - set(PREFIX "${KOKKOS_HOST_ARCH}_${KOKKOS_DEV}_") - set(NEWCMAKE ${PREFIX}${KOKKOS_CMAKEFILE}) - set(NEWCONFH ${PREFIX}${KOKKOS_CONFIG_HEADER}) - file(RENAME ${KOKKOS_CMAKEFILE} ${NEWCMAKE}) - file(RENAME ${KOKKOS_CONFIG_HEADER} ${NEWCONFH}) - - add_test(NAME ${NEWCMAKE}-test - COMMAND ${KOKKOS_TESTDIR}/testmake.sh ${NEWCMAKE} ${KOKKOS_HOST_ARCH} ${KOKKOS_DEV} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - set_tests_properties(${NEWCMAKE}-test - PROPERTIES PASS_REGULAR_EXPRESSION Passed - TIMEOUT 15 - ) - add_test(NAME ${NEWCONFH}-test - COMMAND ${KOKKOS_TESTDIR}/diffconfig.sh ${NEWCONFH} - WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} - ) - set_tests_properties(${NEWCONFH}-test - PROPERTIES PASS_REGULAR_EXPRESSION Passed - TIMEOUT 15 - ) - set(KOKKOS_ENABLE_${KOKKOS_DEVUC} Off) - - endforeach() -endforeach() diff --git a/lib/kokkos/core/unit_test/config/cxx b/lib/kokkos/core/unit_test/config/cxx deleted file mode 100755 index f25d7714a5..0000000000 --- a/lib/kokkos/core/unit_test/config/cxx +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -echo "g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)" -echo "Copyright (C) 2016 Free Software Foundation, Inc." -echo "This is free software; see the source for copying conditions. There is NO" -echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." diff --git a/lib/kokkos/core/unit_test/config/mpic++ b/lib/kokkos/core/unit_test/config/mpic++ deleted file mode 100755 index f25d7714a5..0000000000 --- a/lib/kokkos/core/unit_test/config/mpic++ +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -echo "g++ (GCC) 6.3.1 20161221 (Red Hat 6.3.1-1)" -echo "Copyright (C) 2016 Free Software Foundation, Inc." -echo "This is free software; see the source for copying conditions. There is NO" -echo "warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." diff --git a/lib/kokkos/core/unit_test/config/nvcc b/lib/kokkos/core/unit_test/config/nvcc deleted file mode 100755 index b5bcbf234c..0000000000 --- a/lib/kokkos/core/unit_test/config/nvcc +++ /dev/null @@ -1,5 +0,0 @@ -#!/bin/sh -echo "nvcc: NVIDIA (R) Cuda compiler driver" -echo "Copyright (c) 2005-2016 NVIDIA Corporation" -echo "Built on Tue_Jan_10_13:22:03_CST_2017" -echo "Cuda compilation tools, release 8.0, V8.0.61" diff --git a/lib/kokkos/core/unit_test/config/results/AMDAVX_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/AMDAVX_Cuda_KokkosCore_config.h deleted file mode 100644 index 1a737a3b2f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/AMDAVX_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:09 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/AMDAVX_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/AMDAVX_OpenMP_KokkosCore_config.h deleted file mode 100644 index 7a704e4185..0000000000 --- a/lib/kokkos/core/unit_test/config/results/AMDAVX_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:10 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/AMDAVX_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/AMDAVX_Pthread_KokkosCore_config.h deleted file mode 100644 index c478a5c252..0000000000 --- a/lib/kokkos/core/unit_test/config/results/AMDAVX_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:10 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/AMDAVX_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/AMDAVX_ROCm_KokkosCore_config.h deleted file mode 100644 index 7b7e2b8153..0000000000 --- a/lib/kokkos/core/unit_test/config/results/AMDAVX_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:09 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/AMDAVX_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/AMDAVX_Serial_KokkosCore_config.h deleted file mode 100644 index 9930bacc47..0000000000 --- a/lib/kokkos/core/unit_test/config/results/AMDAVX_Serial_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:11 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Cuda_KokkosCore_config.h deleted file mode 100644 index 7f172c00e4..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:17 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 -#define KOKKOS_ARCH_ARMV8_THUNDERX 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_OpenMP_KokkosCore_config.h deleted file mode 100644 index d25b832ca2..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:18 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 -#define KOKKOS_ARCH_ARMV8_THUNDERX 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Pthread_KokkosCore_config.h deleted file mode 100644 index cd3a603092..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:19 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 -#define KOKKOS_ARCH_ARMV8_THUNDERX 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_ROCm_KokkosCore_config.h deleted file mode 100644 index 86b9f84585..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:18 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 -#define KOKKOS_ARCH_ARMV8_THUNDERX 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Serial_KokkosCore_config.h deleted file mode 100644 index 75ada8c01f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv8-ThunderX_Serial_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:19 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 -#define KOKKOS_ARCH_ARMV8_THUNDERX 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv80_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv80_Cuda_KokkosCore_config.h deleted file mode 100644 index 796c0aab65..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv80_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:12 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv80_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv80_OpenMP_KokkosCore_config.h deleted file mode 100644 index dcf7ff7ea2..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv80_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:13 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv80_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv80_Pthread_KokkosCore_config.h deleted file mode 100644 index 298966b6d4..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv80_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:14 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv80_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv80_ROCm_KokkosCore_config.h deleted file mode 100644 index c2b4f146cb..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv80_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:12 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv80_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv80_Serial_KokkosCore_config.h deleted file mode 100644 index fe5fe66445..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv80_Serial_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:14 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV80 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv81_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv81_Cuda_KokkosCore_config.h deleted file mode 100644 index 3d02142438..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv81_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:15 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV81 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv81_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv81_OpenMP_KokkosCore_config.h deleted file mode 100644 index aa194c77be..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv81_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:16 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV81 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv81_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv81_Pthread_KokkosCore_config.h deleted file mode 100644 index 6d2dbeeef4..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv81_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:16 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV81 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv81_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv81_ROCm_KokkosCore_config.h deleted file mode 100644 index 28a56596b4..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv81_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,18 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:15 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV81 1 diff --git a/lib/kokkos/core/unit_test/config/results/ARMv81_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/ARMv81_Serial_KokkosCore_config.h deleted file mode 100644 index 1d29fd1390..0000000000 --- a/lib/kokkos/core/unit_test/config/results/ARMv81_Serial_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:16 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_ARMV81 1 diff --git a/lib/kokkos/core/unit_test/config/results/BDW_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BDW_Cuda_KokkosCore_config.h deleted file mode 100644 index ce2582b23f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BDW_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:37 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/BDW_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BDW_OpenMP_KokkosCore_config.h deleted file mode 100644 index 118d1b225f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BDW_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:38 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/BDW_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BDW_Pthread_KokkosCore_config.h deleted file mode 100644 index 6d0215baf6..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BDW_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:38 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/BDW_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BDW_ROCm_KokkosCore_config.h deleted file mode 100644 index 3f86d055af..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BDW_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:37 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/BDW_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BDW_Serial_KokkosCore_config.h deleted file mode 100644 index fba671ab1a..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BDW_Serial_KokkosCore_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:39 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/BGQ_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BGQ_Cuda_KokkosCore_config.h deleted file mode 100644 index 93c74d41e2..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BGQ_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:43 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/BGQ_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BGQ_OpenMP_KokkosCore_config.h deleted file mode 100644 index 533da16028..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BGQ_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:43 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/BGQ_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BGQ_Pthread_KokkosCore_config.h deleted file mode 100644 index 9524c94f2b..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BGQ_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:44 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/BGQ_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BGQ_ROCm_KokkosCore_config.h deleted file mode 100644 index f5bc1f54a9..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BGQ_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:44 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/BGQ_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/BGQ_Serial_KokkosCore_config.h deleted file mode 100644 index 8372c00699..0000000000 --- a/lib/kokkos/core/unit_test/config/results/BGQ_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:44 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/HSW_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/HSW_Cuda_KokkosCore_config.h deleted file mode 100644 index 7bbe9fa84c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/HSW_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:34 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/HSW_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/HSW_OpenMP_KokkosCore_config.h deleted file mode 100644 index 17f75872f8..0000000000 --- a/lib/kokkos/core/unit_test/config/results/HSW_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:35 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/HSW_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/HSW_Pthread_KokkosCore_config.h deleted file mode 100644 index 5df1be17ad..0000000000 --- a/lib/kokkos/core/unit_test/config/results/HSW_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:35 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/HSW_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/HSW_ROCm_KokkosCore_config.h deleted file mode 100644 index 8e04801b86..0000000000 --- a/lib/kokkos/core/unit_test/config/results/HSW_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:35 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/HSW_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/HSW_Serial_KokkosCore_config.h deleted file mode 100644 index 99f76aff0b..0000000000 --- a/lib/kokkos/core/unit_test/config/results/HSW_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:36 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX2 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNC_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNC_Cuda_KokkosCore_config.h deleted file mode 100644 index bdc270fd0d..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNC_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:42 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_KNC -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KNC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNC_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNC_OpenMP_KokkosCore_config.h deleted file mode 100644 index f9b79f552d..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNC_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:43 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_KNC -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KNC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNC_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNC_Pthread_KokkosCore_config.h deleted file mode 100644 index 15d9d01a0a..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNC_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:44 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_KNC -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KNC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNC_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNC_ROCm_KokkosCore_config.h deleted file mode 100644 index 5991d3065f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNC_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:43 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_KNC -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KNC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNC_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNC_Serial_KokkosCore_config.h deleted file mode 100644 index 3a8ddecf14..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNC_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:44 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_KNC -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KNC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNL_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNL_Cuda_KokkosCore_config.h deleted file mode 100644 index bd7e2ca330..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNL_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:45 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512MIC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNL_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNL_OpenMP_KokkosCore_config.h deleted file mode 100644 index 0f567f241c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNL_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:46 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512MIC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNL_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNL_Pthread_KokkosCore_config.h deleted file mode 100644 index 1cf3f0997a..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNL_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:47 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512MIC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNL_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNL_ROCm_KokkosCore_config.h deleted file mode 100644 index ae2938e34a..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNL_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:46 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512MIC 1 diff --git a/lib/kokkos/core/unit_test/config/results/KNL_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/KNL_Serial_KokkosCore_config.h deleted file mode 100644 index 21f6e7e434..0000000000 --- a/lib/kokkos/core/unit_test/config/results/KNL_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:47 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512MIC 1 diff --git a/lib/kokkos/core/unit_test/config/results/Kepler30_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler30_Cuda_KokkosCore_config.h deleted file mode 100644 index 78e9335e24..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler30_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:48 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KEPLER 1 -#define KOKKOS_ARCH_KEPLER30 1 diff --git a/lib/kokkos/core/unit_test/config/results/Kepler30_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler30_OpenMP_KokkosCore_config.h deleted file mode 100644 index 769d9c8789..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler30_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:49 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler30_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler30_Pthread_KokkosCore_config.h deleted file mode 100644 index 2cc728a5e3..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler30_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:49 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler30_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler30_ROCm_KokkosCore_config.h deleted file mode 100644 index 34867aa91e..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler30_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:48 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler30_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler30_Serial_KokkosCore_config.h deleted file mode 100644 index 54943b244f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler30_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:50 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler32_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler32_Cuda_KokkosCore_config.h deleted file mode 100644 index c7e23d503c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler32_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:50 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KEPLER 1 -#define KOKKOS_ARCH_KEPLER32 1 diff --git a/lib/kokkos/core/unit_test/config/results/Kepler32_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler32_OpenMP_KokkosCore_config.h deleted file mode 100644 index fcfbf97ef2..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler32_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:51 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler32_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler32_Pthread_KokkosCore_config.h deleted file mode 100644 index 5cea100aa4..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler32_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:52 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler32_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler32_ROCm_KokkosCore_config.h deleted file mode 100644 index 0ae47b6976..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler32_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:51 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler32_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler32_Serial_KokkosCore_config.h deleted file mode 100644 index 0d20b1dc81..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler32_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:52 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler35_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler35_Cuda_KokkosCore_config.h deleted file mode 100644 index f7935927c3..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler35_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:53 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KEPLER 1 -#define KOKKOS_ARCH_KEPLER35 1 diff --git a/lib/kokkos/core/unit_test/config/results/Kepler35_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler35_OpenMP_KokkosCore_config.h deleted file mode 100644 index 02777df40a..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler35_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:54 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler35_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler35_Pthread_KokkosCore_config.h deleted file mode 100644 index f51f00ce95..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler35_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:55 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler35_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler35_ROCm_KokkosCore_config.h deleted file mode 100644 index 111bb09340..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler35_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:54 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler35_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler35_Serial_KokkosCore_config.h deleted file mode 100644 index da61dabb58..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler35_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:55 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler37_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler37_Cuda_KokkosCore_config.h deleted file mode 100644 index c70ce2e04c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler37_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:56 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KEPLER 1 -#define KOKKOS_ARCH_KEPLER37 1 diff --git a/lib/kokkos/core/unit_test/config/results/Kepler37_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler37_OpenMP_KokkosCore_config.h deleted file mode 100644 index d8c6c74832..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler37_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:57 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler37_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler37_Pthread_KokkosCore_config.h deleted file mode 100644 index b832ef36e5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler37_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:58 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler37_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler37_ROCm_KokkosCore_config.h deleted file mode 100644 index 6a661f8842..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler37_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:57 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler37_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler37_Serial_KokkosCore_config.h deleted file mode 100644 index 469f3d96a7..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler37_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:58 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler_Cuda_KokkosCore_config.h deleted file mode 100644 index 1ccf1bef54..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:50 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_KEPLER 1 -#define KOKKOS_ARCH_KEPLER35 1 diff --git a/lib/kokkos/core/unit_test/config/results/Kepler_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler_OpenMP_KokkosCore_config.h deleted file mode 100644 index 9d87c958a2..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:51 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler_Pthread_KokkosCore_config.h deleted file mode 100644 index 263870be9f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:51 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler_ROCm_KokkosCore_config.h deleted file mode 100644 index 2826fdfb88..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:52 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Kepler_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Kepler_Serial_KokkosCore_config.h deleted file mode 100644 index 69097e034d..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Kepler_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:52 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell50_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell50_Cuda_KokkosCore_config.h deleted file mode 100644 index fac64e9e98..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell50_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:59 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_MAXWELL 1 -#define KOKKOS_ARCH_MAXWELL50 1 diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell50_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell50_OpenMP_KokkosCore_config.h deleted file mode 100644 index 3f5b3eea13..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell50_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:00 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell50_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell50_Pthread_KokkosCore_config.h deleted file mode 100644 index b249c88be5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell50_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:01 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell50_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell50_ROCm_KokkosCore_config.h deleted file mode 100644 index ce9f67d5be..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell50_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:00 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell50_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell50_Serial_KokkosCore_config.h deleted file mode 100644 index f8c6be139e..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell50_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:02 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell52_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell52_Cuda_KokkosCore_config.h deleted file mode 100644 index ce28f3e4b7..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell52_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:03 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_MAXWELL 1 -#define KOKKOS_ARCH_MAXWELL52 1 diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell52_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell52_OpenMP_KokkosCore_config.h deleted file mode 100644 index 35635063a5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell52_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:04 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell52_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell52_Pthread_KokkosCore_config.h deleted file mode 100644 index 140740f81f..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell52_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:04 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell52_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell52_ROCm_KokkosCore_config.h deleted file mode 100644 index 06ff6935ca..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell52_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:03 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell52_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell52_Serial_KokkosCore_config.h deleted file mode 100644 index eac120d061..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell52_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:05 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell53_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell53_Cuda_KokkosCore_config.h deleted file mode 100644 index ad8344a099..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell53_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:06 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_MAXWELL 1 -#define KOKKOS_ARCH_MAXWELL53 1 diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell53_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell53_OpenMP_KokkosCore_config.h deleted file mode 100644 index ab1e801267..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell53_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:06 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell53_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell53_Pthread_KokkosCore_config.h deleted file mode 100644 index 0b1e3bf311..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell53_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:07 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell53_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell53_ROCm_KokkosCore_config.h deleted file mode 100644 index 82414cf358..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell53_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:06 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell53_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell53_Serial_KokkosCore_config.h deleted file mode 100644 index b10b80b3bc..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell53_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:07 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell_Cuda_KokkosCore_config.h deleted file mode 100644 index d81a715007..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:20:00 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_MAXWELL 1 -#define KOKKOS_ARCH_MAXWELL50 1 diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell_OpenMP_KokkosCore_config.h deleted file mode 100644 index 98e93c7b28..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:20:00 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell_Pthread_KokkosCore_config.h deleted file mode 100644 index 47a7ccb7a5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:20:00 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell_ROCm_KokkosCore_config.h deleted file mode 100644 index c438f4f7d5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:20:01 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Maxwell_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Maxwell_Serial_KokkosCore_config.h deleted file mode 100644 index d66c569084..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Maxwell_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:20:01 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/None_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/None_Cuda_KokkosCore_config.h deleted file mode 100644 index 6bf2755fd0..0000000000 --- a/lib/kokkos/core/unit_test/config/results/None_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:22 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/None_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/None_OpenMP_KokkosCore_config.h deleted file mode 100644 index 4dd2eed180..0000000000 --- a/lib/kokkos/core/unit_test/config/results/None_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:23 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/None_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/None_Pthread_KokkosCore_config.h deleted file mode 100644 index 1bdd29b6a5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/None_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:23 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/None_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/None_ROCm_KokkosCore_config.h deleted file mode 100644 index 74b0d7335c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/None_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:24 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/None_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/None_Serial_KokkosCore_config.h deleted file mode 100644 index a9d0b264b8..0000000000 --- a/lib/kokkos/core/unit_test/config/results/None_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Tue Sep 26 15:19:23 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal60_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal60_Cuda_KokkosCore_config.h deleted file mode 100644 index 8fe1aa698d..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal60_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:08 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_PASCAL 1 -#define KOKKOS_ARCH_PASCAL60 1 diff --git a/lib/kokkos/core/unit_test/config/results/Pascal60_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal60_OpenMP_KokkosCore_config.h deleted file mode 100644 index 93173f4e11..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal60_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:09 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal60_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal60_Pthread_KokkosCore_config.h deleted file mode 100644 index a05d5729e0..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal60_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:09 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal60_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal60_ROCm_KokkosCore_config.h deleted file mode 100644 index 9c04befef5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal60_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:09 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal60_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal60_Serial_KokkosCore_config.h deleted file mode 100644 index c6038c2965..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal60_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:10 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal61_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal61_Cuda_KokkosCore_config.h deleted file mode 100644 index 0de37df960..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal61_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,19 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:11 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_PASCAL 1 -#define KOKKOS_ARCH_PASCAL61 1 diff --git a/lib/kokkos/core/unit_test/config/results/Pascal61_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal61_OpenMP_KokkosCore_config.h deleted file mode 100644 index 2c392cc0df..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal61_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:12 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal61_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal61_Pthread_KokkosCore_config.h deleted file mode 100644 index f704aa9c81..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal61_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:12 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal61_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal61_ROCm_KokkosCore_config.h deleted file mode 100644 index 4a4d8cc683..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal61_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,17 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:11 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Pascal61_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Pascal61_Serial_KokkosCore_config.h deleted file mode 100644 index 6fb2cf9e9d..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Pascal61_Serial_KokkosCore_config.h +++ /dev/null @@ -1,16 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:23:12 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ diff --git a/lib/kokkos/core/unit_test/config/results/Power7_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power7_Cuda_KokkosCore_config.h deleted file mode 100644 index a78e1ffc8d..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power7_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:20 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCBE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER7 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power7_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power7_OpenMP_KokkosCore_config.h deleted file mode 100644 index bd856b80a5..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power7_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:21 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCBE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER7 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power7_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power7_Pthread_KokkosCore_config.h deleted file mode 100644 index 8b3ac2aff9..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power7_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:21 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCBE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER7 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power7_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power7_ROCm_KokkosCore_config.h deleted file mode 100644 index e16cfb37bd..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power7_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:20 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCBE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER7 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power7_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power7_Serial_KokkosCore_config.h deleted file mode 100644 index 6831f3ce25..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power7_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:22 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCBE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER7 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power8_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power8_Cuda_KokkosCore_config.h deleted file mode 100644 index 1ab0b04c6c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power8_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:23 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER8 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power8_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power8_OpenMP_KokkosCore_config.h deleted file mode 100644 index 54750405ca..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power8_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:24 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER8 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power8_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power8_Pthread_KokkosCore_config.h deleted file mode 100644 index 5d71338d23..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power8_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:24 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER8 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power8_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power8_ROCm_KokkosCore_config.h deleted file mode 100644 index f3fd70b0cf..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power8_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:24 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER8 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power8_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power8_Serial_KokkosCore_config.h deleted file mode 100644 index 7c0ecc22d3..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power8_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:25 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER8 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power9_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power9_Cuda_KokkosCore_config.h deleted file mode 100644 index 47d518f407..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power9_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:26 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER9 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power9_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power9_OpenMP_KokkosCore_config.h deleted file mode 100644 index 106bf33e44..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power9_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:27 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER9 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power9_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power9_Pthread_KokkosCore_config.h deleted file mode 100644 index 108e5eba47..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power9_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:27 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER9 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power9_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power9_ROCm_KokkosCore_config.h deleted file mode 100644 index 8b6a391d95..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power9_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:26 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER9 1 diff --git a/lib/kokkos/core/unit_test/config/results/Power9_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/Power9_Serial_KokkosCore_config.h deleted file mode 100644 index 6f7aefe62e..0000000000 --- a/lib/kokkos/core/unit_test/config/results/Power9_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:27 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_POWERPCLE -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_POWER9 1 diff --git a/lib/kokkos/core/unit_test/config/results/SKX_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SKX_Cuda_KokkosCore_config.h deleted file mode 100644 index 8f4380d992..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SKX_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:40 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512XEON 1 diff --git a/lib/kokkos/core/unit_test/config/results/SKX_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SKX_OpenMP_KokkosCore_config.h deleted file mode 100644 index 0a907a2ae1..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SKX_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:40 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512XEON 1 diff --git a/lib/kokkos/core/unit_test/config/results/SKX_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SKX_Pthread_KokkosCore_config.h deleted file mode 100644 index 50a95223c9..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SKX_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:41 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512XEON 1 diff --git a/lib/kokkos/core/unit_test/config/results/SKX_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SKX_ROCm_KokkosCore_config.h deleted file mode 100644 index 12293350a1..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SKX_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,24 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:40 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512XEON 1 diff --git a/lib/kokkos/core/unit_test/config/results/SKX_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SKX_Serial_KokkosCore_config.h deleted file mode 100644 index 4ea457aacf..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SKX_Serial_KokkosCore_config.h +++ /dev/null @@ -1,23 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:41 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_ENABLE_TM -#endif -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX512XEON 1 diff --git a/lib/kokkos/core/unit_test/config/results/SNB_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SNB_Cuda_KokkosCore_config.h deleted file mode 100644 index 34c9537834..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SNB_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:31 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/SNB_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SNB_OpenMP_KokkosCore_config.h deleted file mode 100644 index f7ed4d720c..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SNB_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:32 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/SNB_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SNB_Pthread_KokkosCore_config.h deleted file mode 100644 index 126c29ba77..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SNB_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:33 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/SNB_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SNB_ROCm_KokkosCore_config.h deleted file mode 100644 index 5c68008bea..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SNB_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:32 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/SNB_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/SNB_Serial_KokkosCore_config.h deleted file mode 100644 index 0278d0d079..0000000000 --- a/lib/kokkos/core/unit_test/config/results/SNB_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:33 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_AVX 1 diff --git a/lib/kokkos/core/unit_test/config/results/WSM_Cuda_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/WSM_Cuda_KokkosCore_config.h deleted file mode 100644 index 97389bb1bf..0000000000 --- a/lib/kokkos/core/unit_test/config/results/WSM_Cuda_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:28 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_CUDA 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_SSE42 1 diff --git a/lib/kokkos/core/unit_test/config/results/WSM_OpenMP_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/WSM_OpenMP_KokkosCore_config.h deleted file mode 100644 index dd5648f0c8..0000000000 --- a/lib/kokkos/core/unit_test/config/results/WSM_OpenMP_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:29 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_OPENMP 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_SSE42 1 diff --git a/lib/kokkos/core/unit_test/config/results/WSM_Pthread_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/WSM_Pthread_KokkosCore_config.h deleted file mode 100644 index c8a7adbd89..0000000000 --- a/lib/kokkos/core/unit_test/config/results/WSM_Pthread_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:30 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_PTHREAD 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_SSE42 1 diff --git a/lib/kokkos/core/unit_test/config/results/WSM_ROCm_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/WSM_ROCm_KokkosCore_config.h deleted file mode 100644 index 712b5686f0..0000000000 --- a/lib/kokkos/core/unit_test/config/results/WSM_ROCm_KokkosCore_config.h +++ /dev/null @@ -1,21 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:29 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_ENABLE_ROCM 1 -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_SSE42 1 diff --git a/lib/kokkos/core/unit_test/config/results/WSM_Serial_KokkosCore_config.h b/lib/kokkos/core/unit_test/config/results/WSM_Serial_KokkosCore_config.h deleted file mode 100644 index 5bac7c2660..0000000000 --- a/lib/kokkos/core/unit_test/config/results/WSM_Serial_KokkosCore_config.h +++ /dev/null @@ -1,20 +0,0 @@ -/* --------------------------------------------- -Makefile constructed configuration: -Fri Sep 22 17:22:30 MDT 2017 -----------------------------------------------*/ -#if !defined(KOKKOS_MACROS_HPP) || defined(KOKKOS_CORE_CONFIG_H) -#error "Do not include KokkosCore_config.h directly; include Kokkos_Macros.hpp instead." -#else -#define KOKKOS_CORE_CONFIG_H -#endif -/* Execution Spaces */ -#define KOKKOS_HAVE_SERIAL 1 -#ifndef __CUDA_ARCH__ -#define KOKKOS_USE_ISA_X86_64 -#endif -/* General Settings */ -#define KOKKOS_HAVE_CXX11 1 -#define KOKKOS_ENABLE_PROFILING -/* Optimization Settings */ -/* Cuda Settings */ -#define KOKKOS_ARCH_SSE42 1 diff --git a/lib/kokkos/core/unit_test/configuration/test-code/test_config_arch_list.bash b/lib/kokkos/core/unit_test/configuration/test-code/test_config_arch_list.bash index 696d345ff9..5ff781b96f 100755 --- a/lib/kokkos/core/unit_test/configuration/test-code/test_config_arch_list.bash +++ b/lib/kokkos/core/unit_test/configuration/test-code/test_config_arch_list.bash @@ -4,7 +4,7 @@ HostArch=(SNB HSW SKX KNL) DeviceArch=(Kepler35 Kepler37 Pascal60 Pascal61 Volta70) if [ ! -z "$KOKKOS_HOST_ARCH_TEST" ]; then export KOKKOS_ARCH_TEST=1 - HostArch=(WSM SNB HSW SKX WSM AMDAVX ARMv80 ARMv81 BDW KNC KNL BGQ Power7 Power8 Power9 Ryzen EPYC ARMv8_ThunderX ARMv8_ThunderX2) + HostArch=(WSM SNB HSW SKX WSM AMDAVX ARMv80 ARMv81 BDW KNC KNL BGQ Power7 Power8 Power9 Zen Zen2 ARMv8_ThunderX ARMv8_ThunderX2) DeviceArch=() fi diff --git a/lib/kokkos/core/unit_test/configuration/test-code/test_config_options_list.bash b/lib/kokkos/core/unit_test/configuration/test-code/test_config_options_list.bash index 1d72f28d23..59072b1a1d 100755 --- a/lib/kokkos/core/unit_test/configuration/test-code/test_config_options_list.bash +++ b/lib/kokkos/core/unit_test/configuration/test-code/test_config_options_list.bash @@ -1,7 +1,7 @@ SRC_DIR=${KOKKOS_PATH}/core/unit_test/configuration/test-code # List of parallel device types -Options=(deprecated_code aggressive_vectorization disable_profiling large_mem_tests) +Options=(aggressive_vectorization disable_profiling large_mem_tests) CudaOptions=(lambda relocatable_device_code uvm constexpr) if [ ! -z "$KOKKOS_ARCH_TEST" ]; then @@ -25,7 +25,6 @@ do fi #Renaming options as GNU Make expects them - option=${option/deprecated_code/enable_deprecated_code} option=${option/large_mem_tests/enable_large_mem_tests} if [ ! -z $CudaOptions ]; then diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp_Streams.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp_Streams.cpp index 3753ad9aec..57c0e454d3 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp_Streams.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_InterOp_Streams.cpp @@ -42,103 +42,10 @@ //@HEADER */ -#include #include +#include namespace Test { - -__global__ void offset_streams(int* p) { - int idx = blockIdx.x * blockDim.x + threadIdx.x; - if (idx < 100) { - p[idx] += idx; - } -} - -namespace { -struct FunctorRange { - Kokkos::View> - a; - FunctorRange(Kokkos::View> - a_) - : a(a_) {} - - KOKKOS_INLINE_FUNCTION - void operator()(const int i) const { a(i) += 1; } -}; -struct FunctorRangeReduce { - Kokkos::View> - a; - FunctorRangeReduce(Kokkos::View> - a_) - : a(a_) {} - - KOKKOS_INLINE_FUNCTION - void operator()(const int i, int& lsum) const { lsum += a(i); } -}; -struct FunctorMDRange { - Kokkos::View> - a; - FunctorMDRange(Kokkos::View> - a_) - : a(a_) {} - - KOKKOS_INLINE_FUNCTION - void operator()(const int i, const int j) const { a(i * 10 + j) += 1; } -}; -struct FunctorMDRangeReduce { - Kokkos::View> - a; - FunctorMDRangeReduce(Kokkos::View> - a_) - : a(a_) {} - - KOKKOS_INLINE_FUNCTION - void operator()(const int i, const int j, int& lsum) const { - lsum += a(i * 10 + j); - } -}; -struct FunctorTeam { - Kokkos::View> - a; - FunctorTeam(Kokkos::View> - a_) - : a(a_) {} - - KOKKOS_INLINE_FUNCTION - void operator()( - const Kokkos::TeamPolicy::member_type& team) const { - int i = team.league_rank(); - Kokkos::parallel_for(Kokkos::TeamThreadRange(team, 10), - [&](const int j) { a(i * 10 + j) += 1; }); - } -}; - -struct FunctorTeamReduce { - Kokkos::View> - a; - FunctorTeamReduce(Kokkos::View> - a_) - : a(a_) {} - - KOKKOS_INLINE_FUNCTION - void operator()(const Kokkos::TeamPolicy::member_type& team, - int& lsum) const { - int i = team.league_rank(); - int team_sum; - Kokkos::parallel_reduce( - Kokkos::TeamThreadRange(team, 10), - [&](const int j, int& tsum) { tsum += a(i * 10 + j); }, team_sum); - Kokkos::single(Kokkos::PerTeam(team), [&]() { lsum += team_sum; }); - } -}; -} // namespace - // Test Interoperability with Cuda Streams TEST(cuda, raw_cuda_streams) { cudaStream_t stream; @@ -147,45 +54,47 @@ TEST(cuda, raw_cuda_streams) { Kokkos::initialize(arguments); int* p; cudaMalloc(&p, sizeof(int) * 100); + using MemorySpace = typename TEST_EXECSPACE::memory_space; { - Kokkos::Cuda cuda0(stream); - Kokkos::View v(p, 100); - Kokkos::deep_copy(cuda0, v, 5); + TEST_EXECSPACE space0(stream); + Kokkos::View v(p, 100); + Kokkos::deep_copy(space0, v, 5); int sum; Kokkos::parallel_for("Test::cuda::raw_cuda_stream::Range", - Kokkos::RangePolicy(cuda0, 0, 100), - FunctorRange(v)); + Kokkos::RangePolicy(space0, 0, 100), + FunctorRange(v)); Kokkos::parallel_reduce( "Test::cuda::raw_cuda_stream::RangeReduce", - Kokkos::RangePolicy>(cuda0, - 0, 100), - FunctorRangeReduce(v), sum); - cuda0.fence(); + Kokkos::RangePolicy>( + space0, 0, 100), + FunctorRangeReduce(v), sum); + space0.fence(); ASSERT_EQ(600, sum); Kokkos::parallel_for("Test::cuda::raw_cuda_stream::MDRange", - Kokkos::MDRangePolicy>( - cuda0, {0, 0}, {10, 10}), - FunctorMDRange(v)); - Kokkos::parallel_reduce("Test::cuda::raw_cuda_stream::MDRangeReduce", - Kokkos::MDRangePolicy, - Kokkos::LaunchBounds<128, 2>>( - cuda0, {0, 0}, {10, 10}), - FunctorMDRangeReduce(v), sum); - cuda0.fence(); + Kokkos::MDRangePolicy>( + space0, {0, 0}, {10, 10}), + FunctorMDRange(v)); + Kokkos::parallel_reduce( + "Test::cuda::raw_cuda_stream::MDRangeReduce", + Kokkos::MDRangePolicy, + Kokkos::LaunchBounds<128, 2>>(space0, {0, 0}, + {10, 10}), + FunctorMDRangeReduce(v), sum); + space0.fence(); ASSERT_EQ(700, sum); Kokkos::parallel_for("Test::cuda::raw_cuda_stream::Team", - Kokkos::TeamPolicy(cuda0, 10, 10), - FunctorTeam(v)); + Kokkos::TeamPolicy(space0, 10, 10), + FunctorTeam(v)); Kokkos::parallel_reduce( "Test::cuda::raw_cuda_stream::Team", - Kokkos::TeamPolicy>(cuda0, - 10, 10), - FunctorTeamReduce(v), sum); - cuda0.fence(); + Kokkos::TeamPolicy>( + space0, 10, 10), + FunctorTeamReduce(v), sum); + space0.fence(); ASSERT_EQ(800, sum); } Kokkos::finalize(); @@ -193,7 +102,7 @@ TEST(cuda, raw_cuda_streams) { CUDA_SAFE_CALL(cudaDeviceSynchronize()); cudaStreamDestroy(stream); - int* h_p = new int[100]; + int h_p[100]; cudaMemcpy(h_p, p, sizeof(int) * 100, cudaMemcpyDefault); CUDA_SAFE_CALL(cudaDeviceSynchronize()); int64_t sum = 0; diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp index 1552261787..ba60569cad 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_Other.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp index 9b14ed7e82..c170e433d5 100644 --- a/lib/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp +++ b/lib/kokkos/core/unit_test/cuda/TestCuda_ViewLayoutStrideAssignment.cpp @@ -44,3 +44,4 @@ #include #include +#include diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ViewCopyETIDecl.hpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceDevelop.cpp similarity index 85% rename from lib/kokkos/core/src/Cuda/Kokkos_Cuda_ViewCopyETIDecl.hpp rename to lib/kokkos/core/unit_test/default/TestDefaultDeviceDevelop.cpp index 18e56aa32d..a80aded124 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ViewCopyETIDecl.hpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceDevelop.cpp @@ -1,3 +1,4 @@ + /* //@HEADER // ************************************************************************ @@ -42,16 +43,14 @@ //@HEADER */ -#ifndef KOKKOS_CUDA_VIEWETIDECL_HPP -#define KOKKOS_CUDA_VIEWETIDECL_HPP +#include -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Cuda +#include -#include +#include -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif +namespace Test { + +TEST(defaultdevicetype, development_test) {} + +} // namespace Test diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp index 02f3f7272a..e45c0754ff 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceType.cpp @@ -52,10 +52,10 @@ namespace Test { TEST(TEST_CATEGORY, host_space_access) { - typedef Kokkos::HostSpace::execution_space host_exec_space; - typedef Kokkos::Device device_space; - typedef Kokkos::Impl::HostMirror::Space - mirror_space; + using host_exec_space = Kokkos::HostSpace::execution_space; + using device_space = Kokkos::Device; + using mirror_space = + Kokkos::Impl::HostMirror::Space; static_assert(Kokkos::Impl::SpaceAccessibility::accessible, diff --git a/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp b/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp index df2bc44aa6..7f53034557 100644 --- a/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp +++ b/lib/kokkos/core/unit_test/default/TestDefaultDeviceTypeResize.cpp @@ -50,7 +50,7 @@ namespace Test { TEST(kokkosresize, host_space_access) { // Test with the default device type. using TestViewResize::testResize; - typedef Kokkos::View::device_type device_type; + using device_type = Kokkos::View::device_type; testResize(); } diff --git a/lib/kokkos/core/unit_test/headers_self_contained/CMakeLists.txt b/lib/kokkos/core/unit_test/headers_self_contained/CMakeLists.txt new file mode 100644 index 0000000000..7fcb9235c5 --- /dev/null +++ b/lib/kokkos/core/unit_test/headers_self_contained/CMakeLists.txt @@ -0,0 +1,20 @@ +# Create tests that contain each header separately. We do not run these tests +# but we just try to compile them. +if(NOT KOKKOS_HAS_TRILINOS) +# Globbing all the header filenames to test for self-containment and presence of header guards +SET(BASE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/../../../") +file(GLOB KOKKOS_CORE_HEADERS RELATIVE ${BASE_DIR}/core/src + ${BASE_DIR}/core/src/*.hpp ${BASE_DIR}/core/src/*.h) +file(GLOB KOKKOS_CONTAINERS_HEADERS RELATIVE ${BASE_DIR}/containers/src + ${BASE_DIR}/containers/src/*.hpp) +file(GLOB KOKKOS_ALGORITHMS_HEADERS RELATIVE ${BASE_DIR}/algorithms/src + ${BASE_DIR}/algorithms/src/*.hpp) + +foreach (_header ${KOKKOS_CORE_HEADERS} ${KOKKOS_CONTAINERS_HEADERS} ${KOKKOS_ALGORITHMS_HEADERS}) + string(REGEX REPLACE "[\./]" "_" header_test_name ${_header}) + set(header_test_name Kokkos_HeaderSelfContained_${header_test_name}) + add_executable(${header_test_name} tstHeader.cpp) + target_link_libraries(${header_test_name} PRIVATE Kokkos::kokkos) + target_compile_definitions(${header_test_name} PRIVATE KOKKOS_HEADER_TEST_NAME=${_header}) +endforeach() +endif() diff --git a/lib/kokkos/core/unit_test/headers_self_contained/tstHeader.cpp b/lib/kokkos/core/unit_test/headers_self_contained/tstHeader.cpp new file mode 100644 index 0000000000..d488f0fa36 --- /dev/null +++ b/lib/kokkos/core/unit_test/headers_self_contained/tstHeader.cpp @@ -0,0 +1,15 @@ +#define KOKKOS_HEADER_TEST_STRINGIZE_IMPL(x) #x +#define KOKKOS_HEADER_TEST_STRINGIZE(x) KOKKOS_HEADER_TEST_STRINGIZE_IMPL(x) + +#define KOKKOS_HEADER_TO_TEST \ + KOKKOS_HEADER_TEST_STRINGIZE(KOKKOS_HEADER_TEST_NAME) + +// include header twice to see if the include guards are set correctly +#include KOKKOS_HEADER_TO_TEST +#include KOKKOS_HEADER_TO_TEST + +#if !defined(KOKKOS_MACROS_HPP) +#error "This header does not include Kokkos_Macros.hpp" +#endif + +int main() { return 0; } diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Init.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Init.cpp index 0dc279fc78..3a42fcd3e6 100644 --- a/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Init.cpp +++ b/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Init.cpp @@ -48,7 +48,7 @@ namespace Test { __global__ void offset(int* p) { - int idx = hipBlockIdx_x * hipBlockDim_x + hipThreadIdx_x; + int idx = blockIdx.x * blockDim.x + threadIdx.x; if (idx < 100) { p[idx] += idx; } @@ -67,7 +67,7 @@ TEST(hip, raw_hip_interop) { Kokkos::finalize(); - hipLaunchKernelGGL(offset, dim3(100), dim3(100), 0, 0, p); + offset<<>>(p); HIP_SAFE_CALL(hipDeviceSynchronize()); int* h_p = new int[100]; diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Streams.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Streams.cpp new file mode 100644 index 0000000000..4f09ea45f4 --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_InterOp_Streams.cpp @@ -0,0 +1,115 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include + +namespace Test { +// Test Interoperability with HIP Streams +// The difference with the CUDA tests are: raw HIP vs raw CUDA and no launch +// bound in HIP due to an error when computing the block size. +TEST(hip, raw_hip_streams) { + hipStream_t stream; + hipStreamCreate(&stream); + Kokkos::InitArguments arguments{-1, -1, -1, false}; + Kokkos::initialize(arguments); + int* p; + hipMalloc(&p, sizeof(int) * 100); + using MemorySpace = typename TEST_EXECSPACE::memory_space; + + { + TEST_EXECSPACE space0(stream); + Kokkos::View v(p, 100); + Kokkos::deep_copy(space0, v, 5); + int sum; + + Kokkos::parallel_for("Test::hip::raw_hip_stream::Range", + Kokkos::RangePolicy(space0, 0, 100), + FunctorRange(v)); + Kokkos::parallel_reduce("Test::hip::raw_hip_stream::RangeReduce", + Kokkos::RangePolicy(space0, 0, 100), + FunctorRangeReduce(v), sum); + space0.fence(); + ASSERT_EQ(600, sum); + + Kokkos::parallel_for("Test::hip::raw_hip_stream::MDRange", + Kokkos::MDRangePolicy>( + space0, {0, 0}, {10, 10}), + FunctorMDRange(v)); + Kokkos::parallel_reduce( + "Test::hip::raw_hip_stream::MDRangeReduce", + Kokkos::MDRangePolicy>(space0, {0, 0}, + {10, 10}), + FunctorMDRangeReduce(v), sum); + space0.fence(); + ASSERT_EQ(700, sum); + + Kokkos::parallel_for("Test::hip::raw_hip_stream::Team", + Kokkos::TeamPolicy(space0, 10, 10), + FunctorTeam(v)); + Kokkos::parallel_reduce("Test::hip::raw_hip_stream::Team", + Kokkos::TeamPolicy(space0, 10, 10), + FunctorTeamReduce(v), + sum); + space0.fence(); + ASSERT_EQ(800, sum); + } + Kokkos::finalize(); + offset_streams<<<100, 64, 0, stream>>>(p); + HIP_SAFE_CALL(hipDeviceSynchronize()); + hipStreamDestroy(stream); + + int h_p[100]; + hipMemcpy(h_p, p, sizeof(int) * 100, hipMemcpyDefault); + HIP_SAFE_CALL(hipDeviceSynchronize()); + int64_t sum = 0; + int64_t sum_expect = 0; + for (int i = 0; i < 100; i++) { + sum += h_p[i]; + sum_expect += 8 + i; + } + + ASSERT_EQ(sum, sum_expect); +} +} // namespace Test diff --git a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ViewCopyETIAvail.hpp b/lib/kokkos/core/unit_test/hip/TestHIP_Other.cpp similarity index 85% rename from lib/kokkos/core/src/Cuda/Kokkos_Cuda_ViewCopyETIAvail.hpp rename to lib/kokkos/core/unit_test/hip/TestHIP_Other.cpp index 2fbfb67277..aa4aaef1e7 100644 --- a/lib/kokkos/core/src/Cuda/Kokkos_Cuda_ViewCopyETIAvail.hpp +++ b/lib/kokkos/core/unit_test/hip/TestHIP_Other.cpp @@ -1,3 +1,4 @@ + /* //@HEADER // ************************************************************************ @@ -42,16 +43,11 @@ //@HEADER */ -#ifndef KOKKOS_CUDA_VIEWETIAVAIL_HPP -#define KOKKOS_CUDA_VIEWETIAVAIL_HPP +#include +#include +#include +#include +#include -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Cuda - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif +#include +#include diff --git a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ViewCopyETIAvail.hpp b/lib/kokkos/core/unit_test/hip/TestHIP_Reductions_DeviceView.cpp similarity index 85% rename from lib/kokkos/core/src/ROCm/Kokkos_ROCm_ViewCopyETIAvail.hpp rename to lib/kokkos/core/unit_test/hip/TestHIP_Reductions_DeviceView.cpp index 018151b309..1c94e1a24b 100644 --- a/lib/kokkos/core/src/ROCm/Kokkos_ROCm_ViewCopyETIAvail.hpp +++ b/lib/kokkos/core/unit_test/hip/TestHIP_Reductions_DeviceView.cpp @@ -42,16 +42,5 @@ //@HEADER */ -#ifndef KOKKOS_ROCM_VIEWETIAVAIL_HPP -#define KOKKOS_ROCM_VIEWETIAVAIL_HPP - -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::ROCm - -#include - -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif +#include +#include diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_ScanUnit.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_ScanUnit.cpp index ea38596883..fd555daa9c 100644 --- a/lib/kokkos/core/unit_test/hip/TestHIP_ScanUnit.cpp +++ b/lib/kokkos/core/unit_test/hip/TestHIP_ScanUnit.cpp @@ -52,9 +52,10 @@ struct DummyFunctor { }; template -__global__ void start_intra_block_scan() { +__global__ void start_intra_block_scan() + __attribute__((amdgpu_flat_work_group_size(1, 1024))) { __shared__ DummyFunctor::value_type values[N]; - const int i = hipThreadIdx_y; + const int i = threadIdx.y; values[i] = i + 1; __syncthreads(); @@ -74,7 +75,7 @@ template void test_intra_block_scan() { dim3 grid(1, 1, 1); dim3 block(1, N, 1); - hipLaunchKernelGGL(start_intra_block_scan, grid, block, 0, 0); + start_intra_block_scan<<>>(); } TEST(TEST_CATEGORY, scan_unit) { @@ -90,8 +91,7 @@ TEST(TEST_CATEGORY, scan_unit) { test_intra_block_scan<64>(); test_intra_block_scan<128>(); test_intra_block_scan<256>(); - // FIXME_HIP block sizes larger than 256 give wrong results. - // test_intra_block_scan<512>(); - // test_intra_block_scan<1024>(); + test_intra_block_scan<512>(); + test_intra_block_scan<1024>(); } } diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_Team.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_Team.cpp new file mode 100644 index 0000000000..7f579e737f --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_Team.cpp @@ -0,0 +1,152 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include + +namespace Test { + +TEST(TEST_CATEGORY, team_for) { + TestTeamPolicy >::test_for( + 0); + TestTeamPolicy >::test_for( + 0); + + TestTeamPolicy >::test_for( + 2); + TestTeamPolicy >::test_for( + 2); + + TestTeamPolicy >::test_for( + 1000); + TestTeamPolicy >::test_for( + 1000); +} + +TEST(TEST_CATEGORY, team_reduce) { + TestTeamPolicy >::test_reduce(0); + TestTeamPolicy >::test_reduce(0); + TestTeamPolicy >::test_reduce(2); + TestTeamPolicy >::test_reduce(2); + TestTeamPolicy >::test_reduce(1000); + TestTeamPolicy >::test_reduce(1000); +} + +TEST(TEST_CATEGORY, team_broadcast_long) { + TestTeamBroadcast, + long>::test_teambroadcast(0, 1); + TestTeamBroadcast, + long>::test_teambroadcast(0, 1); + + TestTeamBroadcast, + long>::test_teambroadcast(2, 1); + TestTeamBroadcast, + long>::test_teambroadcast(2, 1); + + TestTeamBroadcast, + long>::test_teambroadcast(16, 1); + TestTeamBroadcast, + long>::test_teambroadcast(16, 1); +} + +TEST(TEST_CATEGORY, team_broadcast_char) { + TestTeamBroadcast, + unsigned char>::test_teambroadcast(0, 1); + TestTeamBroadcast, + unsigned char>::test_teambroadcast(0, 1); + + TestTeamBroadcast, + unsigned char>::test_teambroadcast(2, 1); + TestTeamBroadcast, + unsigned char>::test_teambroadcast(2, 1); + + TestTeamBroadcast, + unsigned char>::test_teambroadcast(16, 1); + TestTeamBroadcast, + unsigned char>::test_teambroadcast(16, 1); +} + +TEST(TEST_CATEGORY, team_broadcast_float) { + TestTeamBroadcast, + float>::test_teambroadcast(0, 1.3); + TestTeamBroadcast, + float>::test_teambroadcast(0, 1.3); + + TestTeamBroadcast, + float>::test_teambroadcast(2, 1.3); + TestTeamBroadcast, + float>::test_teambroadcast(2, 1.3); + + TestTeamBroadcast, + float>::test_teambroadcast(16, 1.3); + TestTeamBroadcast, + float>::test_teambroadcast(16, 1.3); +} + +TEST(TEST_CATEGORY, team_broadcast_double) { + TestTeamBroadcast, + double>::test_teambroadcast(0, 1.3); + TestTeamBroadcast, + double>::test_teambroadcast(0, 1.3); + + TestTeamBroadcast, + double>::test_teambroadcast(2, 1.3); + TestTeamBroadcast, + double>::test_teambroadcast(2, 1.3); + + TestTeamBroadcast, + double>::test_teambroadcast(16, 1.3); + TestTeamBroadcast, + double>::test_teambroadcast(16, 1.3); +} + +} // namespace Test + +#include diff --git a/lib/kokkos/core/src/Threads/Kokkos_Threads_ViewCopyETIDecl.hpp b/lib/kokkos/core/unit_test/hip/TestHIP_TeamReductionScan.cpp similarity index 54% rename from lib/kokkos/core/src/Threads/Kokkos_Threads_ViewCopyETIDecl.hpp rename to lib/kokkos/core/unit_test/hip/TestHIP_TeamReductionScan.cpp index eb287c0db7..2b63283c20 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_Threads_ViewCopyETIDecl.hpp +++ b/lib/kokkos/core/unit_test/hip/TestHIP_TeamReductionScan.cpp @@ -42,16 +42,41 @@ //@HEADER */ -#ifndef KOKKOS_THREADS_VIEWETIDECL_HPP -#define KOKKOS_THREADS_VIEWETIDECL_HPP +#include +#include -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Threads +namespace Test { -#include +TEST(TEST_CATEGORY, team_scan) { + TestScanTeam >(0); + TestScanTeam >(0); + TestScanTeam >(10); + TestScanTeam >(10); + // FIXME_HIP + // TestScanTeam >(10000); + // TestScanTeam >(10000); +} -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif +TEST(TEST_CATEGORY, team_long_reduce) { + TestReduceTeam >(0); + TestReduceTeam >(0); + TestReduceTeam >(3); + TestReduceTeam >(3); + TestReduceTeam >( + 100000); + TestReduceTeam >( + 100000); +} + +TEST(TEST_CATEGORY, team_double_reduce) { + TestReduceTeam >(0); + TestReduceTeam >(0); + TestReduceTeam >(3); + TestReduceTeam >(3); + TestReduceTeam >( + 100000); + TestReduceTeam >( + 100000); +} + +} // namespace Test diff --git a/lib/kokkos/core/src/Threads/Kokkos_Threads_ViewCopyETIAvail.hpp b/lib/kokkos/core/unit_test/hip/TestHIP_TeamScratch.cpp similarity index 58% rename from lib/kokkos/core/src/Threads/Kokkos_Threads_ViewCopyETIAvail.hpp rename to lib/kokkos/core/unit_test/hip/TestHIP_TeamScratch.cpp index c3c416c4cd..b4483adf4c 100644 --- a/lib/kokkos/core/src/Threads/Kokkos_Threads_ViewCopyETIAvail.hpp +++ b/lib/kokkos/core/unit_test/hip/TestHIP_TeamScratch.cpp @@ -42,16 +42,41 @@ //@HEADER */ -#ifndef KOKKOS_THREADS_VIEWETIAVAIL_HPP -#define KOKKOS_THREADS_VIEWETIAVAIL_HPP +#include +#include -namespace Kokkos { -namespace Impl { -#define KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE Kokkos::Threads +namespace Test { -#include +TEST(TEST_CATEGORY, team_shared_request) { + TestSharedTeam >(); + TestSharedTeam >(); +} -#undef KOKKOS_IMPL_VIEWCOPY_ETI_AVAIL_EXECSPACE -} // namespace Impl -} // namespace Kokkos -#endif +// FIXME_HIP the parallel_reduce in this test requires a team size larger than +// 256 +// TEST(TEST_CATEGORY, team_scratch_request) { +// TestScratchTeam >(); +// TestScratchTeam >(); +//} + +TEST(TEST_CATEGORY, team_lambda_shared_request) { + TestLambdaSharedTeam >(); + TestLambdaSharedTeam >(); +} + +TEST(TEST_CATEGORY, scratch_align) { TestScratchAlignment(); } + +TEST(TEST_CATEGORY, shmem_size) { TestShmemSize(); } + +// FIXME_HIP the parallel_for and the parallel_reduce in this test requires a +// team size larger than 256 +// TEST(TEST_CATEGORY, multi_level_scratch) { +// TestMultiLevelScratchTeam >(); +// TestMultiLevelScratchTeam >(); +//} + +} // namespace Test diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_UniqueToken.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_UniqueToken.cpp new file mode 100644 index 0000000000..89f23b01e3 --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_UniqueToken.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_a.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_a.cpp new file mode 100644 index 0000000000..30aa7e131c --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_a.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_b.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_b.cpp new file mode 100644 index 0000000000..8ec6d49347 --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_b.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_e.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_e.cpp new file mode 100644 index 0000000000..04afe806bc --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_ViewAPI_e.cpp @@ -0,0 +1,47 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include +#include diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_ViewLayoutStrideAssignment.cpp new file mode 100644 index 0000000000..53208b5257 --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_ViewLayoutStrideAssignment.cpp @@ -0,0 +1,47 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include +#include diff --git a/lib/kokkos/core/unit_test/hip/TestHIP_WorkGraph.cpp b/lib/kokkos/core/unit_test/hip/TestHIP_WorkGraph.cpp new file mode 100644 index 0000000000..5b92dc46c5 --- /dev/null +++ b/lib/kokkos/core/unit_test/hip/TestHIP_WorkGraph.cpp @@ -0,0 +1,46 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include diff --git a/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstances.cpp b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstances.cpp new file mode 100644 index 0000000000..a235e86ba4 --- /dev/null +++ b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstances.cpp @@ -0,0 +1,188 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include + +#include +#include + +#ifdef KOKKOS_ENABLE_HPX_ASYNC_DISPATCH +#ifndef HPX_COMPUTE_DEVICE_CODE + +namespace Test { + +namespace { +struct FunctorInitConstant { + Kokkos::View a; + int c; + FunctorInitConstant(Kokkos::View a_, int c_) + : a(a_), c(c_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i) const { a(i) = c; } +}; + +struct FunctorAdd { + Kokkos::View a; + Kokkos::View b; + int c; + FunctorAdd(Kokkos::View a_, + Kokkos::View b_, int c_) + : a(a_), b(b_), c(c_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i) const { b(i) += a(i) + c; } +}; + +struct FunctorAddIndex { + Kokkos::View a; + Kokkos::View b; + FunctorAddIndex(Kokkos::View a_, + Kokkos::View b_) + : a(a_), b(b_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i) const { b(i) += a(i) + i; } +}; + +struct FunctorPointwiseSum { + Kokkos::View a; + Kokkos::View b; + Kokkos::View c; + FunctorPointwiseSum(Kokkos::View a_, + Kokkos::View b_, + Kokkos::View c_) + : a(a_), b(b_), c(c_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i) const { c(i) = a(i) + b(i); } +}; + +struct FunctorReduce { + Kokkos::View a; + FunctorReduce(Kokkos::View a_) : a(a_) {} + + KOKKOS_INLINE_FUNCTION + void operator()(const int i, int &lsum) const { lsum += a(i); } +}; +} // namespace + +TEST(hpx, independent_instances) { + Kokkos::InitArguments arguments{-1, -1, -1, false}; + Kokkos::initialize(arguments); + + const int n = 100; + const int c = 1; + const int d = 3; + + { + Kokkos::View v1("v1", n); + Kokkos::View v2("v2", n); + Kokkos::View v3("v3", n); + Kokkos::View v4("v4", n); + Kokkos::View sum_v("sum_v"); + + Kokkos::Experimental::HPX hpx1( + Kokkos::Experimental::HPX::instance_mode::independent); + Kokkos::parallel_for( + "Test::hpx::independent_instances::init", + Kokkos::Experimental::require( + Kokkos::RangePolicy(hpx1, 0, n), + Kokkos::Experimental::WorkItemProperty::HintLightWeight), + FunctorInitConstant(v1, c)); + + Kokkos::Experimental::HPX hpx2(hpx1.impl_get_future()); + Kokkos::parallel_for( + "Test::hpx::independent_instances::add", + Kokkos::Experimental::require( + Kokkos::RangePolicy(hpx2, 0, n), + Kokkos::Experimental::WorkItemProperty::HintLightWeight), + FunctorAdd(v1, v2, d)); + + Kokkos::Experimental::HPX hpx3(hpx1.impl_get_future()); + Kokkos::parallel_for( + "Test::hpx::independent_instances::add_index", + Kokkos::Experimental::require( + Kokkos::RangePolicy(hpx3, 0, n), + Kokkos::Experimental::WorkItemProperty::HintLightWeight), + FunctorAddIndex(v1, v3)); + + // NOTE: This monstrosity is used to collapse a future, + // future>> (return type of when_all) into a future which is + // ready whenever the un-collapsed future would've been ready. HPX does not + // currently have the functionality to collapse this automatically. + Kokkos::Experimental::HPX hpx4(hpx::util::get<0>(hpx::split_future( + hpx::when_all(hpx2.impl_get_future(), hpx3.impl_get_future())))); + Kokkos::parallel_for( + "Test::hpx::independent_instances::pointwise_sum", + Kokkos::Experimental::require( + Kokkos::RangePolicy(hpx4, 0, n), + Kokkos::Experimental::WorkItemProperty::HintLightWeight), + FunctorPointwiseSum(v2, v3, v4)); + + Kokkos::parallel_reduce( + "Test::hpx::independent_instances::reduce", + Kokkos::Experimental::require( + Kokkos::RangePolicy(hpx4, 0, n), + Kokkos::Experimental::WorkItemProperty::HintLightWeight), + FunctorReduce(v4), Kokkos::Sum(sum_v)); + + hpx4.fence(); + + ASSERT_EQ(true, hpx1.impl_get_future().is_ready()); + ASSERT_EQ(true, hpx2.impl_get_future().is_ready()); + ASSERT_EQ(true, hpx3.impl_get_future().is_ready()); + ASSERT_EQ(true, hpx4.impl_get_future().is_ready()); + + const int expected_sum = n * (2 * c + d) + (n * (n - 1) / 2); + ASSERT_EQ(expected_sum, sum_v()); + } + + Kokkos::finalize(); +} +} // namespace Test + +#endif +#endif diff --git a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesDelayedExecution.cpp similarity index 66% rename from lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp rename to lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesDelayedExecution.cpp index a98a7aad2d..4f5569fc6b 100644 --- a/lib/kokkos/core/src/eti/Cuda/Kokkos_Cuda_ViewCopyETIInst_int64_t_int_LayoutLeft_Rank3.cpp +++ b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesDelayedExecution.cpp @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,15 +40,45 @@ // // ************************************************************************ //@HEADER +*/ -#define KOKKOS_IMPL_COMPILING_LIBRARY true #include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutRight, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutLeft, Cuda, int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int***, LayoutLeft, LayoutStride, Cuda, int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int***, LayoutLeft, Cuda, int64_t) +#include -} // namespace Impl -} // namespace Kokkos +#include + +#ifdef KOKKOS_ENABLE_HPX_ASYNC_DISPATCH + +namespace Test { + +TEST(hpx, delayed_execution) { + Kokkos::InitArguments arguments{-1, -1, -1, false}; + Kokkos::initialize(arguments); + + { + Kokkos::View ran("ran"); + hpx::lcos::local::promise p; + hpx::shared_future f = p.get_future(); + + Kokkos::Experimental::HPX hpx(f); + Kokkos::parallel_for( + "Test::hpx::independent_instances::delay_execution", + Kokkos::Experimental::require( + Kokkos::RangePolicy(hpx, 0, 1), + Kokkos::Experimental::WorkItemProperty::HintLightWeight), + KOKKOS_LAMBDA(int) { ran() = true; }); + + ASSERT_EQ(false, ran()); + ASSERT_EQ(false, hpx.impl_get_future().is_ready()); + + p.set_value(); + + hpx.fence(); + ASSERT_EQ(true, hpx.impl_get_future().is_ready()); + } + + Kokkos::finalize(); +} +} // namespace Test + +#endif diff --git a/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesInstanceIds.cpp b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesInstanceIds.cpp new file mode 100644 index 0000000000..26f419db86 --- /dev/null +++ b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesInstanceIds.cpp @@ -0,0 +1,99 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include + +#ifdef KOKKOS_ENABLE_HPX_ASYNC_DISPATCH + +namespace Test { + +TEST(hpx, instance_ids) { + Kokkos::InitArguments arguments{-1, -1, -1, false}; + Kokkos::initialize(arguments); + + { + Kokkos::Experimental::HPX hpx_global1; + Kokkos::Experimental::HPX hpx_global2 = hpx_global1; + Kokkos::Experimental::HPX hpx_global3{hpx_global1}; + Kokkos::Experimental::HPX hpx_global4( + Kokkos::Experimental::HPX::instance_mode::global); + + ASSERT_EQ(0, hpx_global1.impl_instance_id()); + ASSERT_EQ(0, hpx_global2.impl_instance_id()); + ASSERT_EQ(0, hpx_global3.impl_instance_id()); + ASSERT_EQ(0, hpx_global4.impl_instance_id()); + + Kokkos::Experimental::HPX hpx_independent1( + Kokkos::Experimental::HPX::instance_mode::independent); + Kokkos::Experimental::HPX hpx_independent2 = hpx_independent1; + Kokkos::Experimental::HPX hpx_independent3{hpx_independent1}; + + ASSERT_NE(hpx_global1.impl_instance_id(), + hpx_independent1.impl_instance_id()); + ASSERT_EQ(hpx_independent1.impl_instance_id(), + hpx_independent2.impl_instance_id()); + ASSERT_EQ(hpx_independent1.impl_instance_id(), + hpx_independent3.impl_instance_id()); + + hpx::shared_future f = hpx::make_ready_future(); + Kokkos::Experimental::HPX hpx_independent_future1(f); + Kokkos::Experimental::HPX hpx_independent_future2 = hpx_independent_future1; + Kokkos::Experimental::HPX hpx_independent_future3{hpx_independent_future1}; + + ASSERT_NE(hpx_global1.impl_instance_id(), + hpx_independent1.impl_instance_id()); + ASSERT_NE(hpx_independent1.impl_instance_id(), + hpx_independent_future1.impl_instance_id()); + ASSERT_EQ(hpx_independent_future1.impl_instance_id(), + hpx_independent_future2.impl_instance_id()); + ASSERT_EQ(hpx_independent_future1.impl_instance_id(), + hpx_independent_future3.impl_instance_id()); + } + + Kokkos::finalize(); +} +} // namespace Test + +#endif diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesRefCounting.cpp similarity index 62% rename from lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp rename to lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesRefCounting.cpp index 14a80d9a94..89b03dc367 100644 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int_float_LayoutRight_Rank2.cpp +++ b/lib/kokkos/core/unit_test/hpx/TestHPX_IndependentInstancesRefCounting.cpp @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,15 +40,56 @@ // // ************************************************************************ //@HEADER +*/ -#define KOKKOS_IMPL_COMPILING_LIBRARY true #include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutRight, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutLeft, Serial, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float**, LayoutRight, LayoutStride, Serial, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float**, LayoutRight, Serial, int) +#include -} // namespace Impl -} // namespace Kokkos +#ifdef KOKKOS_ENABLE_HPX_ASYNC_DISPATCH + +namespace Test { +namespace { +std::atomic dummy_count; + +struct dummy { + dummy() { ++dummy_count; } + dummy(dummy const &) { ++dummy_count; } + ~dummy() { --dummy_count; } + void f() const {} +}; +} // namespace +// This test makes sure the independent HPX instances don't hold on to captured +// data after destruction. +TEST(hpx, reference_counting) { + Kokkos::InitArguments arguments{-1, -1, -1, false}; + Kokkos::initialize(arguments); + + { + dummy d; + Kokkos::Experimental::HPX hpx( + Kokkos::Experimental::HPX::instance_mode::independent); + Kokkos::parallel_for( + "Test::hpx::reference_counting::dummy", + Kokkos::RangePolicy(hpx, 0, 1), + KOKKOS_LAMBDA(int) { + // Make sure dummy struct is captured. + d.f(); + }); + + // This attaches a continuation and releases the d captured above from the + // shared state of the internal future. + Kokkos::parallel_for( + "Test::hpx::reference_counting::dummy_clear", + Kokkos::RangePolicy(hpx, 0, 1), + KOKKOS_LAMBDA(int){}); + + hpx.fence(); + + ASSERT_EQ(1, dummy_count); + } + + Kokkos::finalize(); +} +} // namespace Test + +#endif diff --git a/lib/kokkos/core/unit_test/hpx/TestHPX_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/hpx/TestHPX_ViewLayoutStrideAssignment.cpp index eb91b558ef..22799842a7 100644 --- a/lib/kokkos/core/unit_test/hpx/TestHPX_ViewLayoutStrideAssignment.cpp +++ b/lib/kokkos/core/unit_test/hpx/TestHPX_ViewLayoutStrideAssignment.cpp @@ -44,3 +44,4 @@ #include #include +#include diff --git a/lib/kokkos/core/unit_test/incremental/Test01_execspace.hpp b/lib/kokkos/core/unit_test/incremental/Test01_execspace.hpp index 9f118bfb49..419486d7a8 100644 --- a/lib/kokkos/core/unit_test/incremental/Test01_execspace.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test01_execspace.hpp @@ -73,9 +73,9 @@ struct TestIncrExecSpaceTypedef { template struct TestIncrExecSpace { void testit() { - typedef typename ExecSpace::device_type device_type; - typedef typename device_type::memory_space memory_space; - typedef typename device_type::execution_space execution_space; + using device_type = typename ExecSpace::device_type; + using memory_space = typename device_type::memory_space; + using execution_space = typename device_type::execution_space; const bool passed = std::is_same #include -using value_type = double; - namespace Test { struct TestIncrAtomic { + using value_type = double; value_type value1 = 1.5, value2 = 0.5; void testExchange() { diff --git a/lib/kokkos/core/unit_test/incremental/Test04_ParallelFor_RangePolicy.hpp b/lib/kokkos/core/unit_test/incremental/Test04_ParallelFor_RangePolicy.hpp index 5e50b51dd1..840726d84e 100644 --- a/lib/kokkos/core/unit_test/incremental/Test04_ParallelFor_RangePolicy.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test04_ParallelFor_RangePolicy.hpp @@ -52,17 +52,18 @@ namespace Test { -using value_type = double; -int num_elements = 10; -const value_type value = 0.5; +using value_type = double; +int num_elements = 10; struct ParallelForFunctor { value_type *_data; + const value_type _value; - ParallelForFunctor(value_type *data) : _data(data) {} + ParallelForFunctor(value_type *data, const value_type value) + : _data(data), _value(value) {} KOKKOS_INLINE_FUNCTION - void operator()(const int i) const { _data[i] = (i + 1) * value; } + void operator()(const int i) const { _data[i] = (i + 1) * _value; } }; template @@ -72,6 +73,7 @@ struct TestParallel_For { using h_memspace_type = Kokkos::HostSpace; value_type *deviceData, *hostData; + const value_type value = 0.5; // Check if the array values are updated correctly. void correctness_check(value_type *data) { @@ -125,7 +127,7 @@ struct TestParallel_For { // parallel-for functor called for num_elements number of iterations. Kokkos::parallel_for("parallel_for", num_elements, - ParallelForFunctor(deviceData)); + ParallelForFunctor(deviceData, value)); Kokkos::fence(); // Checks if parallel_for gave the correct results. @@ -140,13 +142,13 @@ struct TestParallel_For { init(); // Creates a range policy that uses dynamic scheduling. - typedef Kokkos::RangePolicy > - range_policy_t; + using range_policy_t = + Kokkos::RangePolicy >; // parallel-for functor with range-policy from 0 to num_elements iterations. Kokkos::parallel_for("RangePolicy_ParallelFor", range_policy_t(0, num_elements), - ParallelForFunctor(deviceData)); + ParallelForFunctor(deviceData, value)); // Checks if parallel_for gave the correct results. // Free the allocated memory in init(). diff --git a/lib/kokkos/core/unit_test/incremental/Test05_ParallelReduce_RangePolicy.hpp b/lib/kokkos/core/unit_test/incremental/Test05_ParallelReduce_RangePolicy.hpp index 7c147e47cc..263ed3d731 100644 --- a/lib/kokkos/core/unit_test/incremental/Test05_ParallelReduce_RangePolicy.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test05_ParallelReduce_RangePolicy.hpp @@ -53,7 +53,7 @@ namespace Test { using value_type = double; -const double value = 0.5; +constexpr double value = 0.5; const int num_elements = 10; struct ReduceFunctor { @@ -134,8 +134,8 @@ struct TestReduction { init(); // Creates a range policy that uses dynamic schedule. - typedef Kokkos::RangePolicy > - range_policy; + using range_policy = + Kokkos::RangePolicy >; // parallel_reduce call with range policy over num_elements number of // iterations diff --git a/lib/kokkos/core/unit_test/incremental/Test06_ParallelFor_MDRangePolicy.hpp b/lib/kokkos/core/unit_test/incremental/Test06_ParallelFor_MDRangePolicy.hpp index d9e5a37b55..4adf9e058f 100644 --- a/lib/kokkos/core/unit_test/incremental/Test06_ParallelFor_MDRangePolicy.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test06_ParallelFor_MDRangePolicy.hpp @@ -52,34 +52,35 @@ // elements as a product of iterator indexes and a constant. At the end, we // check for correctness. -namespace Test04 { +namespace Test06 { -using value_type = double; -const int N = 10; -const int M = 10; -const value_type delta = 0.5; +using value_type = double; struct MDFunctor { value_type *_data; + const value_type _delta; + const int N = 10; + const int M = 10; - MDFunctor(value_type *data) : _data(data) {} + MDFunctor(value_type *data, const value_type delta) + : _data(data), _delta(delta) {} // 2D KOKKOS_INLINE_FUNCTION void operator()(const int i, const int j) const { - _data[i * M + j] = i * j * delta; + _data[i * M + j] = i * j * _delta; } // 3D KOKKOS_INLINE_FUNCTION void operator()(const int i, const int j, const int k) const { - _data[i * M * N + j * M + k] = i * j * k * delta; + _data[i * M * N + j * M + k] = i * j * k * _delta; } // 4D KOKKOS_INLINE_FUNCTION void operator()(const int i, const int j, const int k, const int l) const { - _data[i * M * N * M + j * M * N + k * M + l] = i * j * k * l * delta; + _data[i * M * N * M + j * M * N + k * M + l] = i * j * k * l * _delta; } }; @@ -106,6 +107,9 @@ struct TestMDRangePolicy { // Device and Host Data structure pointer value_type *deviceData, *hostData; + const value_type delta = 0.5; + const int N = 10; + const int M = 10; // Routine to allocate memory in a specific memory space. template @@ -160,7 +164,7 @@ struct TestMDRangePolicy { ASSERT_NE(hostData, nullptr); // parallel_for call - MDFunctor Functor_2D(deviceData); + MDFunctor Functor_2D(deviceData, delta); Kokkos::parallel_for("MDRange2D", mdPolicy_2D, Functor_2D); // Copy the data back to Host memory space @@ -191,7 +195,7 @@ struct TestMDRangePolicy { ASSERT_NE(hostData, nullptr); // parallel_for call - MDFunctor Functor_3D(deviceData); + MDFunctor Functor_3D(deviceData, delta); Kokkos::parallel_for("MDRange3D", mdPolicy_3D, Functor_3D); // Copy the data back to Host memory space @@ -222,7 +226,7 @@ struct TestMDRangePolicy { ASSERT_NE(hostData, nullptr); // parallel_for call - MDFunctor Functor_4D(deviceData); + MDFunctor Functor_4D(deviceData, delta); Kokkos::parallel_for("MDRange4D", mdPolicy_4D, Functor_4D); // Copy the data back to Host memory space @@ -238,25 +242,25 @@ struct TestMDRangePolicy { } }; -} // namespace Test04 +} // namespace Test06 namespace Test { // 2D MDRangePolicy TEST(TEST_CATEGORY, IncrTest_06_mdrange2D) { - Test04::TestMDRangePolicy test; + Test06::TestMDRangePolicy test; test.mdRange2D(); } // 3D MDRangePolicy TEST(TEST_CATEGORY, IncrTest_06_mdrange3D) { - Test04::TestMDRangePolicy test; + Test06::TestMDRangePolicy test; test.mdRange3D(); } // 4D MDRangePolicy TEST(TEST_CATEGORY, IncrTest_06_mdrange4D) { - Test04::TestMDRangePolicy test; + Test06::TestMDRangePolicy test; test.mdRange4D(); } diff --git a/lib/kokkos/core/unit_test/incremental/Test11a_ParallelFor_TeamThreadRange.hpp b/lib/kokkos/core/unit_test/incremental/Test11a_ParallelFor_TeamThreadRange.hpp index e36b8f9d3f..627c071c8c 100644 --- a/lib/kokkos/core/unit_test/incremental/Test11a_ParallelFor_TeamThreadRange.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test11a_ParallelFor_TeamThreadRange.hpp @@ -55,10 +55,10 @@ namespace Test { template struct Hierarchical_ForLoop_A { void run(const int pN, const int sX, const int sY) { - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; - typedef Kokkos::View viewDataType; + using viewDataType = Kokkos::View; viewDataType v("Matrix", sX, sY); Kokkos::parallel_for( @@ -71,7 +71,7 @@ struct Hierarchical_ForLoop_A { const int modDim1 = n == ls - 1 ? sX % ls : 0; Kokkos::parallel_for( - Kokkos::TeamThreadRange(team, v.extent(1)), [&](const int m) { + Kokkos::TeamThreadRange(team, v.extent(1)), [=](const int m) { for (int i = startDim1; i < (startDim1 + (int)(sX / ls) + modDim1); ++i) v(i, m) = i * v.extent(1) + m; diff --git a/lib/kokkos/core/unit_test/incremental/Test11b_ParallelFor_TeamVectorRange.hpp b/lib/kokkos/core/unit_test/incremental/Test11b_ParallelFor_TeamVectorRange.hpp index 7e4bb2aa3b..1765a04934 100644 --- a/lib/kokkos/core/unit_test/incremental/Test11b_ParallelFor_TeamVectorRange.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test11b_ParallelFor_TeamVectorRange.hpp @@ -55,10 +55,10 @@ namespace Test { template struct Hierarchical_ForLoop_B { void run(const int pN, const int sX, const int sY) { - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; - typedef Kokkos::View viewDataType; + using viewDataType = Kokkos::View; viewDataType v("Matrix", sX, sY); Kokkos::parallel_for( @@ -71,7 +71,7 @@ struct Hierarchical_ForLoop_B { const int modDim1 = n == ls - 1 ? sX % ls : 0; Kokkos::parallel_for( - Kokkos::TeamVectorRange(team, v.extent(1)), [&](const int m) { + Kokkos::TeamVectorRange(team, v.extent(1)), [=](const int m) { for (int i = startDim1; i < (startDim1 + (int)(sX / ls) + modDim1); ++i) v(i, m) = i * v.extent(1) + m; diff --git a/lib/kokkos/core/unit_test/incremental/Test11c_ParallelFor_ThreadVectorRange.hpp b/lib/kokkos/core/unit_test/incremental/Test11c_ParallelFor_ThreadVectorRange.hpp index c6998a5781..814ab5fda6 100644 --- a/lib/kokkos/core/unit_test/incremental/Test11c_ParallelFor_ThreadVectorRange.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test11c_ParallelFor_ThreadVectorRange.hpp @@ -55,10 +55,10 @@ namespace Test { template struct Hierarchical_ForLoop_C { void run(const int pN, const int sX, const int sY, const int sZ) { - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; - typedef Kokkos::View viewDataType; + using viewDataType = Kokkos::View; viewDataType v("Matrix", sX, sY, sZ); Kokkos::parallel_for( diff --git a/lib/kokkos/core/unit_test/incremental/Test13a_ParallelRed_TeamThreadRange.hpp b/lib/kokkos/core/unit_test/incremental/Test13a_ParallelRed_TeamThreadRange.hpp index b5467da921..e32b0ed0fc 100644 --- a/lib/kokkos/core/unit_test/incremental/Test13a_ParallelRed_TeamThreadRange.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test13a_ParallelRed_TeamThreadRange.hpp @@ -59,10 +59,10 @@ namespace Test { template struct Hierarchical_Red_A { void run(const int pN, const int sX) { - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; - typedef Kokkos::View viewDataType; + using viewDataType = Kokkos::View; viewDataType v("Vector", pN); Kokkos::parallel_for( diff --git a/lib/kokkos/core/unit_test/incremental/Test13b_ParallelRed_TeamVectorRange.hpp b/lib/kokkos/core/unit_test/incremental/Test13b_ParallelRed_TeamVectorRange.hpp index ada295591e..0d37703e2b 100644 --- a/lib/kokkos/core/unit_test/incremental/Test13b_ParallelRed_TeamVectorRange.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test13b_ParallelRed_TeamVectorRange.hpp @@ -57,10 +57,10 @@ namespace Test { template struct Hierarchical_Red_B { void run(const int pN, const int sX) { - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; - typedef Kokkos::View viewDataType; + using viewDataType = Kokkos::View; viewDataType v("Vector", pN); Kokkos::parallel_for( diff --git a/lib/kokkos/core/unit_test/incremental/Test13c_ParallelRed_ThreadVectorRange.hpp b/lib/kokkos/core/unit_test/incremental/Test13c_ParallelRed_ThreadVectorRange.hpp index 7df940c58d..26f9d00091 100644 --- a/lib/kokkos/core/unit_test/incremental/Test13c_ParallelRed_ThreadVectorRange.hpp +++ b/lib/kokkos/core/unit_test/incremental/Test13c_ParallelRed_ThreadVectorRange.hpp @@ -57,10 +57,10 @@ namespace Test { template struct Hierarchical_Red_C { void run(const int pN, const int sX, const int sY) { - typedef Kokkos::TeamPolicy team_policy; - typedef typename Kokkos::TeamPolicy::member_type member_type; + using team_policy = Kokkos::TeamPolicy; + using member_type = typename Kokkos::TeamPolicy::member_type; - typedef Kokkos::View viewDataType; + using viewDataType = Kokkos::View; viewDataType v("Vector", pN); Kokkos::parallel_for( diff --git a/lib/kokkos/core/unit_test/incremental/Test14_MDRangeReduce.hpp b/lib/kokkos/core/unit_test/incremental/Test14_MDRangeReduce.hpp new file mode 100644 index 0000000000..d227e834dc --- /dev/null +++ b/lib/kokkos/core/unit_test/incremental/Test14_MDRangeReduce.hpp @@ -0,0 +1,182 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +/// @Kokkos_Feature_Level_Required:14 +// Incremental test for MDRange reduction . +// Reduction is tested with scalar, view and a customized reduction. + +#include +#include + +namespace Test { +using value_type = double; +const int N = 10; +const int M = 10; + +// A structure for complex number. +struct MyComplex { + value_type _re, _im; + + MyComplex() = default; + + KOKKOS_INLINE_FUNCTION + MyComplex(value_type re, value_type im) : _re(re), _im(im) {} + + KOKKOS_INLINE_FUNCTION + MyComplex(const MyComplex& src) : _re(src._re), _im(src._im) {} + + KOKKOS_INLINE_FUNCTION + void operator+=(const MyComplex& src) { + _re += src._re; + _im += src._im; + } + + KOKKOS_INLINE_FUNCTION + void operator+=(const volatile MyComplex& src) volatile { + _re += src._re; + _im += src._im; + } +}; + +template +struct TestMDRangeReduce { + // 1D View of double + using View_1D = typename Kokkos::View; + + // 2D View of double + using View_2D = typename Kokkos::View; + + // Index Type for the iterator + using int_index = Kokkos::IndexType; + + // An MDRangePolicy for 2 nested loops + using MDPolicyType_2D = typename Kokkos::Experimental::MDRangePolicy< + ExecSpace, Kokkos::Experimental::Rank<2>, int_index>; + + // 1D - complex View + using Complex_View_1D = typename Kokkos::View; + + // Reduction when ExecPolicy = MDRangePolicy and ReducerArgument = + // scalar/1-element view + void reduce_MDRange() { + View_2D d_data("d_data", N, M); + + MDPolicyType_2D mdPolicy_2D({0, 0}, {N, M}); + + // Store the reduced value. + value_type d_result = 0.0, h_result = 0.0; + Kokkos::View d_resultView("result View"); + + // Compute reference solution on the host. + for (int i = 0; i < N; ++i) + for (int j = 0; j < M; ++j) h_result += i * j; + h_result *= 0.5; + + // Fill data. + Kokkos::parallel_for( + mdPolicy_2D, KOKKOS_LAMBDA(const int i, const int j) { + d_data(i, j) = i * j * 0.5; + }); + + // Parallel reduce on a scalar. + Kokkos::parallel_reduce( + mdPolicy_2D, + KOKKOS_LAMBDA(const int i, const int j, value_type& update_value) { + update_value += d_data(i, j); + }, + d_result); + + // Parallel reduce on a view. + Kokkos::parallel_reduce( + mdPolicy_2D, + KOKKOS_LAMBDA(const int i, const int j, value_type& update_value) { + update_value += d_data(i, j); + }, + d_resultView); + + // Check correctness. + ASSERT_EQ(h_result, d_result); + + // Copy view back to host. + value_type view_result = 0.0; + Kokkos::deep_copy(view_result, d_resultView); + ASSERT_EQ(h_result, view_result); + } + + // Custom Reduction + void reduce_custom() { + Complex_View_1D d_data("complex array", N); + MyComplex result(0.0, 0.0); + int sum = 0; + + // Fill data + Kokkos::parallel_for( + Kokkos::RangePolicy(0, N), KOKKOS_LAMBDA(const int i) { + d_data(i) = MyComplex(i * 0.5, -i * 0.5); + }); + + // Reduction for complex number. + Kokkos::parallel_reduce( + Kokkos::RangePolicy(0, N), + KOKKOS_LAMBDA(const int i, MyComplex& update_value) { + update_value += d_data(i); + }, + result); + + // Correctness Check + for (int i = 0; i < N; ++i) sum += i; + + ASSERT_EQ(result._re, sum * 0.5); + ASSERT_EQ(result._im, -sum * 0.5); + } +}; + +// Reductions tests for MDRange policy and customized reduction. +TEST(TEST_CATEGORY, incr_14_MDrangeReduce) { + TestMDRangeReduce test; + test.reduce_MDRange(); + test.reduce_custom(); +} + +} // namespace Test diff --git a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp b/lib/kokkos/core/unit_test/incremental/Test16_ParallelScan.hpp similarity index 60% rename from lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp rename to lib/kokkos/core/unit_test/incremental/Test16_ParallelScan.hpp index 24dc52eef4..e1f5e3767c 100644 --- a/lib/kokkos/core/src/eti/Threads/Kokkos_Threads_ViewCopyETIInst_int_float_LayoutRight_Rank1.cpp +++ b/lib/kokkos/core/unit_test/incremental/Test16_ParallelScan.hpp @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,15 +40,60 @@ // // ************************************************************************ //@HEADER +*/ -#define KOKKOS_IMPL_COMPILING_LIBRARY true #include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutRight, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutLeft, Threads, int) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(float*, LayoutRight, LayoutStride, Threads, int) -KOKKOS_IMPL_VIEWFILL_ETI_INST(float*, LayoutRight, Threads, int) +#include -} // namespace Impl -} // namespace Kokkos +/// @Kokkos_Feature_Level_Required:16 +// Incremental test for parallel_scan. +// perform scan on a 1D view of double's and check for correctness. + +namespace Test { + +using value_type = double; +const int N = 10; + +template +struct TestScan { + // 1D View of double + using View_1D = typename Kokkos::View; + + void parallel_scan() { + View_1D d_data("data", N); + + // Initialize data. + Kokkos::parallel_for( + Kokkos::RangePolicy(0, N), + KOKKOS_LAMBDA(const int i) { d_data(i) = i * 0.5; }); + + // Exclusive parallel_scan call. + Kokkos::parallel_scan( + Kokkos::RangePolicy(0, N), + KOKKOS_LAMBDA(const int i, value_type &update_value, const bool final) { + const value_type val_i = d_data(i); + if (final) d_data(i) = update_value; + + update_value += val_i; + }); + + // Copy back the data. + auto h_data = + Kokkos::create_mirror_view_and_copy(Kokkos::HostSpace(), d_data); + + // Check Correctness + ASSERT_EQ(h_data(0), 0.0); + value_type upd = h_data(0); + for (int i = 1; i < N; ++i) { + upd += (i - 1) * 0.5; + ASSERT_EQ(h_data(i), upd); + } + } +}; + +TEST(TEST_CATEGORY, IncrTest_16_parallelscan) { + TestScan test; + test.parallel_scan(); +} + +} // namespace Test diff --git a/lib/kokkos/core/unit_test/incremental/Test17_CompleteAtomic.hpp b/lib/kokkos/core/unit_test/incremental/Test17_CompleteAtomic.hpp new file mode 100644 index 0000000000..6ba5adc618 --- /dev/null +++ b/lib/kokkos/core/unit_test/incremental/Test17_CompleteAtomic.hpp @@ -0,0 +1,126 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include +#include +#include + +/// @Kokkos_Feature_Level_Required:17 +// Incremental test for atomic views. +// In this test we sort N integers into num_buckets number of buckets based on +// their rermainder, i.e., a histogram based on remainder. Since the number of +// integers is greater than the number of buckets, we use atomic views for the +// sorted histogram. + +namespace Test { + +using value_type = int; +const int N = 1000; +const int num_buckets = 10; + +template +struct TestAtomicView { + // 1D View of int + using View = typename Kokkos::View; + + // 1D atomic view + using atomic_view = + typename Kokkos::View >; + + void atomicView() { + // Use default_random_engine object to introduce randomness. + std::default_random_engine generator; + // Initialize uniform_int_distribution class. + std::uniform_int_distribution distribution(0, N); + + // Device and Host views of N number of integers + View d_data("deviceData_1D", N); + auto h_data = create_mirror_view(d_data); + + // Atomic Device and Host views of histogram + atomic_view d_hist("histogram", num_buckets); + auto h_hist = create_mirror_view(d_hist); + + // An array to store correct results for verification + std::array correct_results; + + // Initialize host side histogram arrays + for (int i = 0; i < num_buckets; ++i) { + h_hist(i) = 0; + correct_results[i] = 0; + } + + // Fill host data with integers from the distribution object. + for (int i = 0; i < N; ++i) h_data(i) = distribution(generator); + + // Copy data from host to device + Kokkos::deep_copy(d_data, h_data); + Kokkos::deep_copy(d_hist, h_hist); + + // Update histogram + Kokkos::parallel_for( + Kokkos::RangePolicy(0, N), + KOKKOS_LAMBDA(const int i) { d_hist(d_data(i) % num_buckets)++; }); + + // Perform the same computation on host for correctness test. + for (int i = 0; i < N; ++i) correct_results[h_data(i) % num_buckets]++; + + // Copy the histogram back to host + Kokkos::deep_copy(h_hist, d_hist); + + // Validate results + for (int i = 0; i < num_buckets; ++i) + ASSERT_EQ(correct_results[i], h_hist(i)); + } +}; + +// atomic view tests +TEST(TEST_CATEGORY, incr_17_atomicView) { + TestAtomicView test; + test.atomicView(); +} + +} // namespace Test diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp index 082657c28f..d76832ffee 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP.hpp @@ -56,7 +56,6 @@ #include -#include #include #include #include diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp index 7043432517..b2129f5c8e 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_Other.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include @@ -64,24 +63,14 @@ TEST(openmp, partition_master) { int errors = 0; auto master = [&errors, &mtx](int /*partition_id*/, int /*num_partitions*/) { - -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - const int pool_size = Kokkos::OpenMP::thread_pool_size(); -#else const int pool_size = Kokkos::OpenMP::impl_thread_pool_size(); -#endif { std::unique_lock lock(mtx); if (Kokkos::OpenMP::in_parallel()) { ++errors; } -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (Kokkos::OpenMP::thread_pool_rank() != 0) -#else - if (Kokkos::OpenMP::impl_thread_pool_rank() != 0) -#endif - { + if (Kokkos::OpenMP::impl_thread_pool_rank() != 0) { ++errors; } } @@ -91,12 +80,7 @@ TEST(openmp, partition_master) { Kokkos::parallel_reduce( Kokkos::RangePolicy(0, 1000), [pool_size](const int, int& errs) { -#ifdef KOKKOS_ENABLE_DEPRECATED_CODE - if (Kokkos::OpenMP::thread_pool_size() != pool_size) -#else - if (Kokkos::OpenMP::impl_thread_pool_size() != pool_size) -#endif - { + if (Kokkos::OpenMP::impl_thread_pool_size() != pool_size) { ++errs; } }, diff --git a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp index 90e90139c1..349da68900 100644 --- a/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp +++ b/lib/kokkos/core/unit_test/openmp/TestOpenMP_ViewLayoutStrideAssignment.cpp @@ -44,3 +44,4 @@ #include #include +#include diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp index 0e9ad3e24f..664b718b94 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget.hpp @@ -56,7 +56,6 @@ #include -#include //#include //#include //#include diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp index aba91aee2b..bdae00ef45 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Other.cpp @@ -48,4 +48,3 @@ #include #include #include -#include diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp index af1d06f0c1..687e52d43c 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_Reductions.cpp @@ -43,5 +43,6 @@ */ #include -#include +// WORKAROUND OPENMPTARGET: Not implemented +// #include #include diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp index e882cd1b2e..f544148a08 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_TeamReductionScan.cpp @@ -56,6 +56,8 @@ TEST(TEST_CATEGORY, team_scan) { TestScanTeam >(10000); } +// WORKAROUND OPENMPTARGET: not supported yet +/* TEST(TEST_CATEGORY, team_long_reduce) { TestReduceTeam >(0); TestReduceTeam >(0); @@ -77,5 +79,5 @@ TEST(TEST_CATEGORY, team_double_reduce) { TestReduceTeam >( 100000); } - +*/ } // namespace Test diff --git a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewLayoutStrideAssignment.cpp index e69de29bb2..a41d1bc88d 100644 --- a/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewLayoutStrideAssignment.cpp +++ b/lib/kokkos/core/unit_test/openmptarget/TestOpenMPTarget_ViewLayoutStrideAssignment.cpp @@ -0,0 +1,47 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +#include +#include +#include diff --git a/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp b/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp index b6240a1b5a..c9e7e31ace 100644 --- a/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp +++ b/lib/kokkos/core/unit_test/rocm/TestROCm_Other.cpp @@ -48,6 +48,5 @@ #include // include #include -#include #include diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp index ea4ac4e4cb..dacba23742 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_Other.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/lib/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp index 37c3126c50..16e8de7f51 100644 --- a/lib/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp +++ b/lib/kokkos/core/unit_test/serial/TestSerial_ViewLayoutStrideAssignment.cpp @@ -44,3 +44,4 @@ #include #include +#include diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp index 01a07896b3..b92e4005c8 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_Other.cpp @@ -48,7 +48,6 @@ #include #include #include -#include #include #include diff --git a/lib/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp b/lib/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp index 0b54784d95..9202511e34 100644 --- a/lib/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp +++ b/lib/kokkos/core/unit_test/threads/TestThreads_ViewLayoutStrideAssignment.cpp @@ -44,3 +44,4 @@ #include #include +#include diff --git a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp b/lib/kokkos/core/unit_test/tools/TestAllCalls.cpp similarity index 50% rename from lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp rename to lib/kokkos/core/unit_test/tools/TestAllCalls.cpp index a9b1b6d409..7e37816c5d 100644 --- a/lib/kokkos/core/src/eti/Serial/Kokkos_Serial_ViewCopyETIInst_int64_t_int_LayoutStride_Rank4.cpp +++ b/lib/kokkos/core/unit_test/tools/TestAllCalls.cpp @@ -1,3 +1,4 @@ +/* //@HEADER // ************************************************************************ // @@ -8,8 +9,6 @@ // Under the terms of Contract DE-NA0003525 with NTESS, // the U.S. Government retains certain rights in this software. // -// Kokkos is licensed under 3-clause BSD terms of use: -// // Redistribution and use in source and binary forms, with or without // modification, are permitted provided that the following conditions are // met: @@ -41,18 +40,50 @@ // // ************************************************************************ //@HEADER +*/ -#define KOKKOS_IMPL_COMPILING_LIBRARY true +// This file calls most of the basic Kokkos primitives. When combined with a +// testing library this tests that our shared-library loading based profiling +// mechanisms work + +#include #include -namespace Kokkos { -namespace Impl { -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutRight, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutLeft, Serial, - int64_t) -KOKKOS_IMPL_VIEWCOPY_ETI_INST(int****, LayoutStride, LayoutStride, Serial, - int64_t) -KOKKOS_IMPL_VIEWFILL_ETI_INST(int****, LayoutStride, Serial, int64_t) -} // namespace Impl -} // namespace Kokkos +int main() { + Kokkos::initialize(); + { + // This test only uses host kernel launch mechanisms. This is to allow for + // the test to run on platforms where CUDA lambda launch isn't supported. + // This is safe because this test only seeks to test that the dlsym-based + // tool loading mechanisms work, all of which happens completely + // independently of the enabled backends + using execution_space = Kokkos::DefaultHostExecutionSpace; + using memory_space = typename execution_space::memory_space; + Kokkos::View src_view("source", 10); + Kokkos::View dst_view("destination", 10); + Kokkos::deep_copy(dst_view, src_view); + Kokkos::parallel_for("parallel_for", + Kokkos::RangePolicy(0, 1), + [=](int i) { (void)i; }); + int result; + Kokkos::parallel_reduce( + "parallel_reduce", Kokkos::RangePolicy(0, 1), + [=](int i, int& hold_result) { hold_result += i; }, result); + Kokkos::parallel_scan("parallel_scan", + Kokkos::RangePolicy(0, 1), + [=](const int i, int& hold_result, const bool final) { + if (final) { + hold_result += i; + } + }); + Kokkos::Profiling::pushRegion("push_region"); + Kokkos::Profiling::popRegion(); + uint32_t sectionId; + Kokkos::Profiling::createProfileSection("created_section", §ionId); + Kokkos::Profiling::startSection(sectionId); + Kokkos::Profiling::stopSection(sectionId); + Kokkos::Profiling::destroyProfileSection(sectionId); + Kokkos::Profiling::markEvent("profiling_event"); + } + Kokkos::finalize(); +} diff --git a/lib/kokkos/core/unit_test/tools/TestCInterface.c b/lib/kokkos/core/unit_test/tools/TestCInterface.c new file mode 100644 index 0000000000..66e68154e9 --- /dev/null +++ b/lib/kokkos/core/unit_test/tools/TestCInterface.c @@ -0,0 +1,2 @@ +#include +int main(){} diff --git a/lib/kokkos/core/unit_test/tools/TestTuning.cpp b/lib/kokkos/core/unit_test/tools/TestTuning.cpp new file mode 100644 index 0000000000..1a002e2314 --- /dev/null +++ b/lib/kokkos/core/unit_test/tools/TestTuning.cpp @@ -0,0 +1,196 @@ +/* +//@HEADER +// ************************************************************************ +// +// Kokkos v. 3.0 +// Copyright (2020) National Technology & Engineering +// Solutions of Sandia, LLC (NTESS). +// +// Under the terms of Contract DE-NA0003525 with NTESS, +// the U.S. Government retains certain rights in this software. +// +// Redistribution and use in source and binary forms, with or without +// modification, are permitted provided that the following conditions are +// met: +// +// 1. Redistributions of source code must retain the above copyright +// notice, this list of conditions and the following disclaimer. +// +// 2. Redistributions in binary form must reproduce the above copyright +// notice, this list of conditions and the following disclaimer in the +// documentation and/or other materials provided with the distribution. +// +// 3. Neither the name of the Corporation nor the names of the +// contributors may be used to endorse or promote products derived from +// this software without specific prior written permission. +// +// THIS SOFTWARE IS PROVIDED BY NTESS "AS IS" AND ANY +// EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +// PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL NTESS OR THE +// CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +// EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR +// PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF +// LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING +// NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. +// +// Questions? Contact Christian R. Trott (crtrott@sandia.gov) +// +// ************************************************************************ +//@HEADER +*/ + +// This file tests the primitives of the Tuning system + +#include +#include +#include +#include +#include +#include + +static size_t expectedNumberOfContextVariables; +static int64_t expectedContextVariableValue; +static std::unordered_map + candidate_value_map; + +int main() { + Kokkos::initialize(); + { + auto context = Kokkos::Tools::Experimental::get_new_context_id(); + + Kokkos::Tools::Experimental::VariableInfo contextVariableInfo; + + contextVariableInfo.category = Kokkos::Tools::Experimental:: + StatisticalCategory::kokkos_value_categorical; + contextVariableInfo.type = + Kokkos::Tools::Experimental::ValueType::kokkos_value_int64; + contextVariableInfo.valueQuantity = + Kokkos::Tools::Experimental::CandidateValueType::kokkos_value_unbounded; + + Kokkos::Tools::Experimental::VariableInfo tuningVariableInfo; + + tuningVariableInfo.category = Kokkos::Tools::Experimental:: + StatisticalCategory::kokkos_value_categorical; + tuningVariableInfo.type = + Kokkos::Tools::Experimental::ValueType::kokkos_value_int64; + tuningVariableInfo.valueQuantity = + Kokkos::Tools::Experimental::CandidateValueType::kokkos_value_set; + + std::vector candidate_value_vector = {0, 1, 2, 3, 4, + 5, 6, 7, 8, 9}; + + Kokkos::Tools::Experimental::SetOrRange allowed_values = + Kokkos::Tools::Experimental::make_candidate_set( + candidate_value_vector.size(), candidate_value_vector.data()); + // test that ID's are transmitted to the tool + Kokkos::Tools::Experimental::set_declare_output_type_callback( + [](const char*, const size_t, + Kokkos::Tools::Experimental::VariableInfo* info) { + if (info->type != + Kokkos::Tools::Experimental::ValueType::kokkos_value_int64) { + throw(std::runtime_error("Tuning Variable has wrong type")); + } + }); + Kokkos::Tools::Experimental::set_declare_input_type_callback( + [](const char*, const size_t, + Kokkos::Tools::Experimental::VariableInfo* info) { + if (info->type != + Kokkos::Tools::Experimental::ValueType::kokkos_value_int64) { + throw(std::runtime_error("Context Variable has wrong type")); + } + }); + tuningVariableInfo.candidates = allowed_values; + auto contextVariableId = Kokkos::Tools::Experimental::declare_input_type( + "kokkos.testing.context_variable", contextVariableInfo); + auto tuningVariableId = Kokkos::Tools::Experimental::declare_output_type( + "kokkos.testing.tuning_variable", tuningVariableInfo); + + // test that we correctly pass context values, and receive tuning variables + // back in return + Kokkos::Tools::Experimental::VariableValue contextValues[] = { + Kokkos::Tools::Experimental::make_variable_value(contextVariableId, + int64_t(0))}; + Kokkos::Tools::Experimental::set_input_values(context, 1, contextValues); + + Kokkos::Tools::Experimental::set_request_output_values_callback( + [](const size_t, const size_t, + const Kokkos::Tools::Experimental::VariableValue* context_values, + const size_t, + Kokkos::Tools::Experimental::VariableValue* tuning_values) { + auto candidate_values = tuning_values[0].metadata->candidates; + if (context_values[0].value.int_value != + expectedContextVariableValue) { + throw std::runtime_error( + "Context variables not correctly passed to tuning callbacks"); + } + int tuningVariableSetSize = candidate_values.set.size; + std::cout << "Set of size " << tuningVariableSetSize << std::endl; + // tuning methodology via https://xkcd.com/221/ + tuning_values[0].value.int_value = + candidate_values.set.values.int_value[4 % tuningVariableSetSize]; + }); + + Kokkos::Tools::Experimental::VariableValue tuningValues[] = { + Kokkos::Tools::Experimental::make_variable_value(tuningVariableId, + int64_t(0))}; + + Kokkos::Tools::Experimental::request_output_values(context, 1, + tuningValues); + std::cout << tuningValues[0].value.int_value << "," + << candidate_value_vector[4] << std::endl; + if (tuningValues[0].value.int_value != candidate_value_vector[4]) { + throw std::runtime_error("Tuning value return is incorrect"); + } + + Kokkos::Tools::Experimental::end_context(context); + + // test nested contexts + auto outerContext = Kokkos::Tools::Experimental::get_new_context_id(); + auto innerContext = Kokkos::Tools::Experimental::get_new_context_id(); + + Kokkos::Tools::Experimental::VariableInfo secondContextVariableInfo; + + secondContextVariableInfo.category = Kokkos::Tools::Experimental:: + StatisticalCategory::kokkos_value_categorical; + secondContextVariableInfo.type = + Kokkos::Tools::Experimental::ValueType::kokkos_value_int64; + secondContextVariableInfo.valueQuantity = + Kokkos::Tools::Experimental::CandidateValueType::kokkos_value_unbounded; + auto secondContextVariableId = + Kokkos::Tools::Experimental::declare_output_type( + "kokkos.testing.second_context_variable", + secondContextVariableInfo); + + Kokkos::Tools::Experimental::VariableValue contextValueTwo[] = { + Kokkos::Tools::Experimental::make_variable_value( + secondContextVariableId, int64_t(1))}; + + Kokkos::Tools::Experimental::set_request_output_values_callback( + [](const size_t, const size_t num_context_variables, + const Kokkos::Tools::Experimental::VariableValue*, const size_t, + Kokkos::Tools::Experimental::VariableValue*) { + std::cout << "Expect " << expectedNumberOfContextVariables + << ", have " << num_context_variables << std::endl; + if (num_context_variables != expectedNumberOfContextVariables) { + throw( + std::runtime_error("Incorrect number of context variables in " + "nested tuning contexts")); + } + }); + Kokkos::Tools::Experimental::set_input_values(outerContext, 1, + contextValues); + expectedNumberOfContextVariables = 1; + Kokkos::Tools::Experimental::request_output_values(outerContext, 1, + tuningValues); + Kokkos::Tools::Experimental::set_input_values(innerContext, 1, + contextValueTwo); + expectedNumberOfContextVariables = 2; + Kokkos::Tools::Experimental::request_output_values(innerContext, 1, + tuningValues); + } // end Kokkos block + + Kokkos::finalize(); +} diff --git a/lib/kokkos/core/unit_test/tools/printing-tool.cpp b/lib/kokkos/core/unit_test/tools/printing-tool.cpp new file mode 100644 index 0000000000..c2abada0a9 --- /dev/null +++ b/lib/kokkos/core/unit_test/tools/printing-tool.cpp @@ -0,0 +1,118 @@ + +#include +#include + +struct Kokkos_Profiling_KokkosPDeviceInfo; + +struct SpaceHandle { + char name[64]; +}; + +const int parallel_for_id = 0; +const int parallel_reduce_id = 1; +const int parallel_scan_id = 2; + +extern "C" void kokkosp_init_library( + const int /*loadSeq*/, const uint64_t /*interfaceVer*/, + const uint32_t /*devInfoCount*/, + Kokkos_Profiling_KokkosPDeviceInfo* /* deviceInfo */) { + std::cout << "kokkosp_init_library::"; +} + +extern "C" void kokkosp_finalize_library() { + std::cout << "kokkosp_finalize_library::"; +} + +extern "C" void kokkosp_begin_parallel_for(const char* name, + const uint32_t devID, + uint64_t* kID) { + *kID = parallel_for_id; + std::cout << "kokkosp_begin_parallel_for:" << name << ":" << devID << ":" + << *kID << "::"; +} + +extern "C" void kokkosp_end_parallel_for(const uint64_t kID) { + std::cout << "kokkosp_end_parallel_for:" << kID << "::"; +} + +extern "C" void kokkosp_begin_parallel_scan(const char* name, + const uint32_t devID, + uint64_t* kID) { + *kID = parallel_scan_id; + std::cout << "kokkosp_begin_parallel_scan:" << name << ":" << devID << ":" + << *kID << "::"; +} + +extern "C" void kokkosp_end_parallel_scan(const uint64_t kID) { + std::cout << "kokkosp_end_parallel_scan:" << kID << "::"; +} + +extern "C" void kokkosp_begin_parallel_reduce(const char* name, + const uint32_t devID, + uint64_t* kID) { + *kID = parallel_reduce_id; + std::cout << "kokkosp_begin_parallel_reduce:" << name << ":" << devID << ":" + << *kID << "::"; +} + +extern "C" void kokkosp_end_parallel_reduce(const uint64_t kID) { + std::cout << "kokkosp_end_parallel_reduce:" << kID << "::"; +} + +extern "C" void kokkosp_push_profile_region(char* regionName) { + std::cout << "kokkosp_push_profile_region:" << regionName << "::"; +} + +extern "C" void kokkosp_pop_profile_region() { + std::cout << "kokkosp_pop_profile_region::"; +} + +extern "C" void kokkosp_allocate_data(SpaceHandle handle, const char* name, + void* ptr, uint64_t size) { + std::cout << "kokkosp_allocate_data:" << handle.name << ":" << name << ":" + << ptr << ":" << size << "::"; +} + +extern "C" void kokkosp_deallocate_data(SpaceHandle handle, const char* name, + void* ptr, uint64_t size) { + std::cout << "kokkosp_deallocate_data:" << handle.name << ":" << name << ":" + << ptr << ":" << size << "::"; +} + +extern "C" void kokkosp_begin_deep_copy(SpaceHandle dst_handle, + const char* dst_name, + const void* dst_ptr, + SpaceHandle src_handle, + const char* src_name, + const void* src_ptr, uint64_t size) { + std::cout << "kokkosp_begin_deep_copy:" << dst_handle.name << ":" << dst_name + << ":" << dst_ptr << ":" << src_handle.name << ":" << src_name + << ":" << src_ptr << ":" << size << "::"; +} + +extern "C" void kokkosp_end_deep_copy() { + std::cout << "kokkosp_end_deep_copy::"; +} + +uint32_t section_id = 3; +extern "C" void kokkosp_create_profile_section(const char* name, + uint32_t* sec_id) { + *sec_id = section_id; + std::cout << "kokkosp_create_profile_section:" << name << ":" << *sec_id + << "::"; +} + +extern "C" void kokkosp_start_profile_section(uint32_t sec_id) { + std::cout << "kokkosp_start_profile_section:" << sec_id << "::"; +} + +extern "C" void kokkosp_stop_profile_section(uint32_t sec_id) { + std::cout << "kokkosp_stop_profile_section:" << sec_id << "::"; +} +extern "C" void kokkosp_destroy_profile_section(uint32_t sec_id) { + std::cout << "kokkosp_destroy_profile_section:" << sec_id << "::"; +} + +extern "C" void kokkosp_profile_event(const char* name) { + std::cout << "kokkosp_profile_event:" << name << "::"; +} diff --git a/lib/kokkos/example/CMakeLists.txt b/lib/kokkos/example/CMakeLists.txt index 34157329d0..3db566f83f 100644 --- a/lib/kokkos/example/CMakeLists.txt +++ b/lib/kokkos/example/CMakeLists.txt @@ -5,8 +5,7 @@ KOKKOS_SUBPACKAGE(Example) KOKKOS_ADD_EXAMPLE_DIRECTORIES(query_device) -if(NOT Kokkos_ENABLE_CUDA) - KOKKOS_ADD_EXAMPLE_DIRECTORIES(tutorial) -endif() +KOKKOS_ADD_EXAMPLE_DIRECTORIES(tutorial) + KOKKOS_SUBPACKAGE_POSTPROCESS() diff --git a/lib/kokkos/example/build_cmake_in_tree/CMakeLists.txt b/lib/kokkos/example/build_cmake_in_tree/CMakeLists.txt index 8e1aa04727..7217807072 100644 --- a/lib/kokkos/example/build_cmake_in_tree/CMakeLists.txt +++ b/lib/kokkos/example/build_cmake_in_tree/CMakeLists.txt @@ -1,44 +1,19 @@ -# Kokkos requires CMake version 3.1 or higher and that you have the following -# line with a version of 3.1 or higher as the first line of your project: -# cmake_minimum_required(VERSION 3.1) -# -# The other CMake commands required to build Kokkos as part of your application -# are: -# add_subdirectory(path/to/kokkos) -# target_link_libraries(executable or library) -# -# If Kokkos is not a subdirectory of your project, you will also need to pass a -# binary directory to add_subdirectory(). We had to pass the binary directory -# for this example for that reason. Note that target_link_libraries() can be -# called on a target added by add_executable(), add_library(), or another -# similar command. -# -# All the flags, etc. required to build using the Kokkos library are -# transitively added to targets which depend on the library. -# -# The CMake variables CMAKE_CXX_STANDARD and CMAKE_CXX_EXTENSIONS are -# respected. We recommend that you set CMAKE_CXX_EXTENSIONS to OFF. -# Otherwise, CMake defaults to using extensions for the C++ standard, and the -# GNU extensions (-std=gnu++11) will be used for compilers that support it -# instead of standard C++11 (-std=c++11). -# -# A bunch of build options are added as variables (all starting with KOKKOS_) -# to the build. Check them out using ccmake or the CMake GUI. -# -# Building this example: -# 1. Create a build directory. -# 2. cd /path/to/build/directory -# 3. cmake /path/to/example -# 4. make +# Kokkos minimally requires 3.10 right now, +# but your project can set it higher +cmake_minimum_required(VERSION 3.10) -cmake_minimum_required(VERSION 3.1) -project(Example CXX C Fortran) - -list(APPEND CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -O3) +# Project can mix languages - must have C++ support +# Kokkos flags are only applied to C++ files +project(Example CXX) +# We build kokkos as a subdirectory of our project add_subdirectory(${Example_SOURCE_DIR}/../.. ${Example_BINARY_DIR}/kokkos) -include_directories(${Kokkos_INCLUDE_DIRS_RET}) +add_executable(example cmake_example.cpp) -add_executable(example cmake_example.cpp foo.f) -target_link_libraries(example kokkos) +# This is the only line required to set up all compiler/linker flags +target_link_libraries(example Kokkos::kokkos) + +# Adds a test for the executable +enable_testing() +add_test(NAME KokkosInTree_Verify COMMAND example 10) diff --git a/lib/kokkos/example/build_cmake_in_tree/cmake_example.cpp b/lib/kokkos/example/build_cmake_in_tree/cmake_example.cpp index 63875d013f..b0fd9822a4 100644 --- a/lib/kokkos/example/build_cmake_in_tree/cmake_example.cpp +++ b/lib/kokkos/example/build_cmake_in_tree/cmake_example.cpp @@ -45,8 +45,6 @@ #include #include -extern "C" void print_fortran_(); - int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); Kokkos::DefaultExecutionSpace::print_configuration(std::cout); @@ -84,8 +82,6 @@ int main(int argc, char* argv[]) { count_time = timer.seconds(); printf("Sequential: %ld %10.6f\n", seq_count, count_time); - print_fortran_(); - Kokkos::finalize(); return (count == seq_count) ? 0 : -1; diff --git a/lib/kokkos/example/build_cmake_in_tree/foo.f b/lib/kokkos/example/build_cmake_in_tree/foo.f deleted file mode 100644 index e618455283..0000000000 --- a/lib/kokkos/example/build_cmake_in_tree/foo.f +++ /dev/null @@ -1,4 +0,0 @@ - FUNCTION print_fortran() - PRINT *, 'Hello World from Fortran' - RETURN - END diff --git a/lib/kokkos/example/build_cmake_installed/CMakeLists.txt b/lib/kokkos/example/build_cmake_installed/CMakeLists.txt index 7fdb94d454..7998d2914d 100644 --- a/lib/kokkos/example/build_cmake_installed/CMakeLists.txt +++ b/lib/kokkos/example/build_cmake_installed/CMakeLists.txt @@ -1,42 +1,24 @@ -# Kokkos requires CMake version 3.1 or higher and that you have the following -# line with a version of 3.1 or higher as the first line of your project: -# cmake_minimum_required(VERSION 3.1) -# -# The other CMake commands required to build Kokkos as part of your application -# are: -# add_subdirectory(path/to/kokkos) -# target_link_libraries(executable or library) -# -# If Kokkos is not a subdirectory of your project, you will also need to pass a -# binary directory to add_subdirectory(). We had to pass the binary directory -# for this example for that reason. Note that target_link_libraries() can be -# called on a target added by add_executable(), add_library(), or another -# similar command. -# -# All the flags, etc. required to build using the Kokkos library are -# transitively added to targets which depend on the library. -# -# The CMake variables CMAKE_CXX_STANDARD and CMAKE_CXX_EXTENSIONS are -# respected. We recommend that you set CMAKE_CXX_EXTENSIONS to OFF. -# Otherwise, CMake defaults to using extensions for the C++ standard, and the -# GNU extensions (-std=gnu++11) will be used for compilers that support it -# instead of standard C++11 (-std=c++11). -# -# A bunch of build options are added as variables (all starting with KOKKOS_) -# to the build. Check them out using ccmake or the CMake GUI. -# -# Building this example: -# 1. Create a build directory. -# 2. cd /path/to/build/directory -# 3. cmake /path/to/example -# 4. make +# Kokkos minimally requires 3.10 right now, +# but your project can set it higher +cmake_minimum_required(VERSION 3.10) -cmake_minimum_required(VERSION 3.12) -project(Example CXX C Fortran) +# Projects can safely mix languages - must have C++ support +# Kokkos flags will only apply to C++ files +project(Example CXX Fortran) -list(APPEND CMAKE_CXX_FLAGS ${CMAKE_CXX_FLAGS} -O3) +# You need this for using Kokkos_ROOT variable +if(CMAKE_VERSION VERSION_GREATER_EQUAL "3.12.0") + message(STATUS "Setting policy CMP0074 to use _ROOT variables") + cmake_policy(SET CMP0074 NEW) +endif() -find_package(Kokkos) +# Look for an installed Kokkos +find_package(Kokkos REQUIRED) add_executable(example cmake_example.cpp foo.f) + +# This is the only thing required to set up compiler/linker flags target_link_libraries(example Kokkos::kokkos) + +enable_testing() +add_test(NAME KokkosInTree_Verify COMMAND example 10) diff --git a/lib/kokkos/example/build_cmake_installed/cmake_example.cpp b/lib/kokkos/example/build_cmake_installed/cmake_example.cpp index 63875d013f..fd05172cb8 100644 --- a/lib/kokkos/example/build_cmake_installed/cmake_example.cpp +++ b/lib/kokkos/example/build_cmake_installed/cmake_example.cpp @@ -47,6 +47,12 @@ extern "C" void print_fortran_(); +struct CountFunctor { + KOKKOS_FUNCTION void operator()(const long i, long& lcount) const { + lcount += (i % 2) == 0; + } +}; + int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); Kokkos::DefaultExecutionSpace::print_configuration(std::cout); @@ -66,9 +72,8 @@ int main(int argc, char* argv[]) { // Compute the number of even integers from 0 to n-1, in parallel. long count = 0; - Kokkos::parallel_reduce( - n, KOKKOS_LAMBDA(const long i, long& lcount) { lcount += (i % 2) == 0; }, - count); + CountFunctor functor; + Kokkos::parallel_reduce(n, functor, count); double count_time = timer.seconds(); printf(" Parallel: %ld %10.6f\n", count, count_time); diff --git a/lib/kokkos/example/make_buildlink/main.cpp b/lib/kokkos/example/make_buildlink/main.cpp index d963002034..2dbfb2687c 100644 --- a/lib/kokkos/example/make_buildlink/main.cpp +++ b/lib/kokkos/example/make_buildlink/main.cpp @@ -3,9 +3,9 @@ int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); { - int N = (argc > 1) ? atoi(argv[1]) : 10000; - int M = (argc > 2) ? atoi(argv[2]) : 10000; - int R = (argc > 3) ? atoi(argv[3]) : 10; + int N = (argc > 1) ? std::stoi(argv[1]) : 10000; + int M = (argc > 2) ? std::stoi(argv[2]) : 10000; + int R = (argc > 3) ? std::stoi(argv[3]) : 10; printf("Called with: %i %i %i\n", N, M, R); } diff --git a/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp b/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp index 00adbc78bc..bdb630a1ad 100644 --- a/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp +++ b/lib/kokkos/example/tutorial/01_hello_world/hello_world.cpp @@ -67,10 +67,10 @@ // instance method. struct hello_world { // If a functor has an "execution_space" (or "execution_space", for - // backwards compatibility) public typedef, parallel_* will only run + // backwards compatibility) public alias, parallel_* will only run // the functor in that execution space. That's a good way to mark a // functor as specific to an execution space. If the functor lacks - // this typedef, parallel_for will run it in the default execution + // this alias, parallel_for will run it in the default execution // space, unless you tell it otherwise (that's an advanced topic; // see "execution policies"). @@ -107,7 +107,7 @@ int main(int argc, char* argv[]) { // Run the above functor on the default Kokkos execution space in // parallel, with a parallel for loop count of 15. // - // The Kokkos::DefaultExecutionSpace typedef gives the default + // The Kokkos::DefaultExecutionSpace alias gives the default // execution space. Depending on how Kokkos was configured, this // could be OpenMP, Threads, Cuda, Serial, or even some other // execution space. diff --git a/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp b/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp index 01abd3d3bf..2b7668e515 100644 --- a/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp +++ b/lib/kokkos/example/tutorial/02_simple_reduce/simple_reduce.cpp @@ -63,8 +63,8 @@ // it defaults to binary operator+ (adding numbers together). struct squaresum { // Specify the type of the reduction value with a "value_type" - // typedef. In this case, the reduction value has type int. - typedef int value_type; + // alias. In this case, the reduction value has type int. + using value_type = int; // The reduction functor's operator() looks a little different than // the parallel_for functor's operator(). For the reduction, we diff --git a/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp b/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp index f4924c71fa..46cac62b9d 100644 --- a/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp +++ b/lib/kokkos/example/tutorial/03_simple_view/simple_view.cpp @@ -67,7 +67,7 @@ // // The first dimension of the View is the dimension over which it is // efficient for Kokkos to parallelize. -typedef Kokkos::View view_type; +using view_type = Kokkos::View; // parallel_for functor that fills the View given to its constructor. // The View must already have been allocated. @@ -102,8 +102,8 @@ struct ReduceFunctor { ReduceFunctor(view_type a_) : a(a_) {} // If you write a functor to do a reduction, you must specify the - // type of the reduction result via a public 'value_type' typedef. - typedef double value_type; + // type of the reduction result via a public 'value_type' alias. + using value_type = double; KOKKOS_INLINE_FUNCTION void operator()(int i, double& lsum) const { diff --git a/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp b/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp index d5590e5ccd..33b3a1a7db 100644 --- a/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp +++ b/lib/kokkos/example/tutorial/03_simple_view_lambda/simple_view_lambda.cpp @@ -66,7 +66,7 @@ // // The first dimension of the View is the dimension over which it is // efficient for Kokkos to parallelize. -typedef Kokkos::View view_type; +using view_type = Kokkos::View; int main(int argc, char* argv[]) { Kokkos::initialize(argc, argv); diff --git a/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp b/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp index 603d139df9..40ad6123e7 100644 --- a/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp +++ b/lib/kokkos/example/tutorial/04_simple_memoryspaces/simple_memoryspaces.cpp @@ -47,7 +47,7 @@ // The type of a two-dimensional N x 3 array of double. // It lives in Kokkos' default memory space. -typedef Kokkos::View view_type; +using view_type = Kokkos::View; // The "HostMirror" type corresponding to view_type above is also a // two-dimensional N x 3 array of double. However, it lives in the @@ -61,12 +61,12 @@ typedef Kokkos::View view_type; // performance penalties then it is its own host_mirror_space. This is // the case for HostSpace, CudaUVMSpace and CudaHostPinnedSpace. -typedef view_type::HostMirror host_view_type; +using host_view_type = view_type::HostMirror; struct ReduceFunctor { view_type a; ReduceFunctor(view_type a_) : a(a_) {} - typedef int value_type; // Specify type for reduction value, lsum + using value_type = int; // Specify type for reduction value, lsum KOKKOS_INLINE_FUNCTION void operator()(int i, int &lsum) const { diff --git a/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp b/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp index 396b396879..caacc828e5 100644 --- a/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp +++ b/lib/kokkos/example/tutorial/05_simple_atomics/simple_atomics.cpp @@ -48,8 +48,8 @@ #include // Type of a one-dimensional length-N array of int. -typedef Kokkos::View view_type; -typedef view_type::HostMirror host_view_type; +using view_type = Kokkos::View; +using host_view_type = view_type::HostMirror; // This is a "zero-dimensional" View, that is, a View of a single // value (an int, in this case). Access the value using operator() // with no arguments: e.g., 'count()'. @@ -57,8 +57,8 @@ typedef view_type::HostMirror host_view_type; // Zero-dimensional Views are useful for reduction results that stay // resident in device memory, as well as for irregularly updated // shared state. We use it for the latter in this example. -typedef Kokkos::View count_type; -typedef count_type::HostMirror host_count_type; +using count_type = Kokkos::View; +using host_count_type = count_type::HostMirror; // Functor for finding a list of primes in a given set of numbers. If // run in parallel, the order of results is nondeterministic, because @@ -118,7 +118,7 @@ int main() { host_view_type h_result = Kokkos::create_mirror_view(result); host_count_type h_count = Kokkos::create_mirror_view(count); - typedef view_type::size_type size_type; + using size_type = view_type::size_type; // Fill the 'data' array on the host with random numbers. We assume // that they come from some process which is only implemented on the // host, via some library. (That's true in this case.) diff --git a/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp b/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp index 62c087c32c..07b99087d4 100644 --- a/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp +++ b/lib/kokkos/example/tutorial/06_simple_mdrangepolicy/simple_mdrangepolicy.cpp @@ -62,7 +62,7 @@ // Simple functor for computing/storing the product of indices in a View v template struct MDFunctor { - typedef long value_type; + using value_type = long; ViewType v; size_t size; @@ -105,16 +105,16 @@ int main(int argc, char* argv[]) { // Bound(s) for MDRangePolicy const int n = 100; - // ViewType typedefs for Rank<2>, Rank<3> for example usage - typedef double ScalarType; - typedef typename Kokkos::View ViewType_2D; - typedef typename Kokkos::View ViewType_3D; + // ViewType aliases for Rank<2>, Rank<3> for example usage + using ScalarType = double; + using ViewType_2D = typename Kokkos::View; + using ViewType_3D = typename Kokkos::View; ///////////////////////////////////////////////////////////////////////////// // Explanation of MDRangePolicy usage, template parameters, constructor // arguments // - // MDRangePolicy typedefs for Rank<2>, Rank<3> cases + // MDRangePolicy aliases for Rank<2>, Rank<3> cases // Required template parameters: // Kokkos::Rank: where N=rank // @@ -126,7 +126,7 @@ int main(int argc, char* argv[]) { // tiles; // defaults based on the execution space similar to Kokkos::Layout // - // e.g. typedef Rank<2, Iterate::Left, Iterate::Left> rank2ll; + // e.g. using rank2ll = Rank<2, Iterate::Left, Iterate::Left>; // // // Optional template parameters to MDRangePolicy: @@ -160,9 +160,8 @@ int main(int argc, char* argv[]) { long incorrect_count_2d = 0; { // Rank<2> Case: Rank is provided, all other parameters are default - typedef typename Kokkos::Experimental::MDRangePolicy< - Kokkos::Experimental::Rank<2> > - MDPolicyType_2D; + using MDPolicyType_2D = typename Kokkos::Experimental::MDRangePolicy< + Kokkos::Experimental::Rank<2> >; // Construct 2D MDRangePolicy: lower and upper bounds provided, tile dims // defaulted @@ -186,10 +185,9 @@ int main(int argc, char* argv[]) { long incorrect_count_3d = 0; { // Rank<3> Case: Rank, inner iterate pattern, outer iterate pattern provided - typedef typename Kokkos::Experimental::MDRangePolicy< + using MDPolicyType_3D = typename Kokkos::Experimental::MDRangePolicy< Kokkos::Experimental::Rank<3, Kokkos::Experimental::Iterate::Left, - Kokkos::Experimental::Iterate::Left> > - MDPolicyType_3D; + Kokkos::Experimental::Iterate::Left> >; // Construct 3D MDRangePolicy: lower, upper bounds, tile dims provided MDPolicyType_3D mdpolicy_3d({{0, 0, 0}}, {{n, n, n}}, {{4, 4, 4}}); diff --git a/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp b/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp index 9bfa49456a..643ac87a86 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/01_data_layouts/data_layouts.cpp @@ -51,14 +51,14 @@ // which means "column major," the same as in Fortran, the BLAS, or // LAPACK. right_type has "layout right," which means "row major," // the same as in C, C++, or Java. -typedef Kokkos::View left_type; -typedef Kokkos::View right_type; +using left_type = Kokkos::View; +using right_type = Kokkos::View; // This is a one-dimensional View, so the layout matters less. // However, it still has a layout! Since its layout is not specified // explicitly in the type, its layout is a function of the memory // space. For example, the default Cuda layout is LayoutLeft, and the // default Host layout is LayoutRight. -typedef Kokkos::View view_type; +using view_type = Kokkos::View; // parallel_for functor that fills the given View with some data. It // expects to access the View by rows in parallel: each call i of @@ -114,7 +114,7 @@ struct contraction { struct dot { view_type a; dot(view_type a_) : a(a_) {} - typedef double value_type; // Specify type for reduction target, lsum + using value_type = double; // Specify type for reduction target, lsum KOKKOS_INLINE_FUNCTION void operator()(const view_type::size_type i, double& lsum) const { lsum += a(i) * a(i); diff --git a/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp b/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp index da6478a02e..cff215d0eb 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/02_memory_traits/memory_traits.cpp @@ -47,7 +47,7 @@ #include #include -typedef Kokkos::View view_type; +using view_type = Kokkos::View; // Kokkos::Views have an MemoryTraits template parameter which // allows users to specify usage scenarios of a View. // Some of those act simply as hints, which can be used to insert @@ -71,10 +71,10 @@ typedef Kokkos::View view_type; // data (i.e. const double* and double*). While these pointers can point to the // same data you should not use them together if that brakes the const guarantee // of the first pointer. -typedef Kokkos::View > - view_type_rnd; -typedef Kokkos::View idx_type; -typedef idx_type::HostMirror idx_type_host; +using view_type_rnd = + Kokkos::View >; +using idx_type = Kokkos::View; +using idx_type_host = idx_type::HostMirror; // We template this functor on the ViewTypes to show the effect of the // RandomAccess trait. diff --git a/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp b/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp index df6a09f828..ca2eeac416 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/03_subviews/subviews.cpp @@ -52,7 +52,7 @@ #include #include -typedef Kokkos::View mesh_type; +using mesh_type = Kokkos::View; // These View types represent subviews of the mesh. Some of the Views // have layout LayoutStride, meaning that they have run-time "strides" @@ -63,10 +63,10 @@ typedef Kokkos::View mesh_type; // may safely always use a LayoutStride layout when taking a subview // of a LayoutRight or LayoutLeft subview, but strided accesses may // cost a bit more, especially for 1-D Views. -typedef Kokkos::View xz_plane_type; -typedef Kokkos::View yz_plane_type; -typedef Kokkos::View xy_plane_type; -typedef Kokkos::View inner_mesh_type; +using xz_plane_type = Kokkos::View; +using yz_plane_type = Kokkos::View; +using xy_plane_type = Kokkos::View; +using inner_mesh_type = Kokkos::View; // Functor to set all entries of a boundary of the mesh to a constant // value. The functor is templated on ViewType because different @@ -98,7 +98,7 @@ struct set_inner { KOKKOS_INLINE_FUNCTION void operator()(const typename ViewType::size_type i) const { - typedef typename ViewType::size_type size_type; + using size_type = typename ViewType::size_type; for (size_type j = 0; j < a.extent(1); ++j) { for (size_type k = 0; k < a.extent(2); ++k) { a(i, j, k) = value; @@ -118,7 +118,7 @@ struct update { KOKKOS_INLINE_FUNCTION void operator()(typename ViewType::size_type i) const { - typedef typename ViewType::size_type size_type; + using size_type = typename ViewType::size_type; i++; for (size_type j = 1; j < a.extent(1) - 1; j++) { for (size_type k = 1; k < a.extent(2) - 1; k++) { @@ -134,7 +134,7 @@ int main(int narg, char* arg[]) { using Kokkos::pair; using Kokkos::parallel_for; using Kokkos::subview; - typedef mesh_type::size_type size_type; + using size_type = mesh_type::size_type; Kokkos::initialize(narg, arg); diff --git a/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp b/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp index 86fe016203..174d13d102 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/04_dualviews/dual_view.cpp @@ -66,30 +66,30 @@ // operations to help you manage memory take almost no time in that // case. This makes your code even more performance portable. -typedef Kokkos::DualView view_type; -typedef Kokkos::DualView idx_type; +using view_type = Kokkos::DualView; +using idx_type = Kokkos::DualView; template struct localsum { - // If the functor has a public 'execution_space' typedef, that defines + // If the functor has a public 'execution_space' alias, that defines // the functor's execution space (where it runs in parallel). This // overrides Kokkos' default execution space. - typedef ExecutionSpace execution_space; + using execution_space = ExecutionSpace; - typedef typename Kokkos::Impl::if_c< + using memory_space = typename Kokkos::Impl::if_c< std::is_same::value, - idx_type::memory_space, idx_type::host_mirror_space>::type memory_space; + idx_type::memory_space, idx_type::host_mirror_space>::type; // Get the view types on the particular device for which the functor // is instantiated. // - // "const_data_type" is a typedef in View (and DualView) which is + // "const_data_type" is an alias in View (and DualView) which is // the const version of the first template parameter of the View. // For example, the const_data_type version of double** is const // double**. Kokkos::View idx; - // "scalar_array_type" is a typedef in ViewTraits (and DualView) which is the + // "scalar_array_type" is an alias in ViewTraits (and DualView) which is the // array version of the value(s) stored in the View. Kokkos::View @@ -150,7 +150,7 @@ class ParticleType { protected: }; -typedef Kokkos::DualView ParticleTypes; +using ParticleTypes = Kokkos::DualView; int main(int narg, char* arg[]) { Kokkos::initialize(narg, arg); diff --git a/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp b/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp index 51b84cf184..a906ba1447 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/05_NVIDIA_UVM/uvm_example.cpp @@ -49,18 +49,18 @@ #include #ifdef KOKKOS_ENABLE_CUDA -typedef Kokkos::View view_type; -typedef Kokkos::View idx_type; +using view_type = Kokkos::View; +using idx_type = Kokkos::View; #else -typedef Kokkos::View view_type; -typedef Kokkos::View idx_type; +using view_type = Kokkos::View; +using idx_type = Kokkos::View; #endif template struct localsum { // Define the execution space for the functor (overrides the // DefaultExecutionSpace) - typedef Device execution_space; + using execution_space = Device; // Get the view types on the particular device the functor is instantiated for idx_type::const_type idx; diff --git a/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp b/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp index 4dac1c26e0..c582fa1704 100644 --- a/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp +++ b/lib/kokkos/example/tutorial/Advanced_Views/07_Overlapping_DeepCopy/overlapping_deepcopy.cpp @@ -106,7 +106,7 @@ struct MergeDevice { int main(int argc, char* argv[]) { int size = 100000000; Kokkos::initialize(); - int synch = atoi(argv[1]); + int synch = std::stoi(argv[1]); Kokkos::View d_a("Device A", size); Kokkos::View d_b("Device B", diff --git a/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp b/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp index a0771c4fca..9c5f2d62fc 100644 --- a/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp +++ b/lib/kokkos/example/tutorial/Algorithms/01_random_numbers/random_numbers.cpp @@ -48,7 +48,7 @@ #include #include -typedef Kokkos::HostSpace::execution_space DefaultHostType; +using DefaultHostType = Kokkos::HostSpace::execution_space; // Kokkos provides two different random number generators with a 64 bit and a // 1024 bit state. These generators are based on Vigna, Sebastiano (2014). "An @@ -108,8 +108,8 @@ int main(int argc, char* args[]) { } else { // Initialize Kokkos Kokkos::initialize(argc, args); - int size = atoi(args[1]); - int samples = atoi(args[2]); + int size = std::stoi(args[1]); + int samples = std::stoi(args[2]); // Create two random number generator pools one for 64bit states and one for // 1024 bit states Both take an 64 bit unsigned integer seed to initialize a diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp index 77a5b4ce91..9afc144752 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams/thread_teams.cpp @@ -57,12 +57,12 @@ // league_size) is not limited by physical constraints. Its a pure logical // number. -typedef Kokkos::TeamPolicy<> team_policy; -typedef team_policy::member_type team_member; +using team_policy = Kokkos::TeamPolicy<>; +using team_member = team_policy::member_type; // Define a functor which can be launched using the TeamPolicy struct hello_world { - typedef int value_type; // Specify value type for reduction target, sum + using value_type = int; // Specify value type for reduction target, sum // This is a reduction operator which now takes as first argument the // TeamPolicy member_type. Every member of the team contributes to the diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp index 6e29d5c3d6..a182b08b84 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/01_thread_teams_lambda/thread_teams_lambda.cpp @@ -56,8 +56,8 @@ int main(int narg, char* args[]) { using Kokkos::parallel_reduce; - typedef Kokkos::TeamPolicy<> team_policy; - typedef typename team_policy::member_type team_member; + using team_policy = Kokkos::TeamPolicy<>; + using team_member = typename team_policy::member_type; Kokkos::initialize(narg, args); diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp index 1c0b531c5c..29e23e904c 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/02_nested_parallel_for/nested_parallel_for.cpp @@ -46,11 +46,11 @@ #include // See 01_thread_teams for an explanation of a basic TeamPolicy -typedef Kokkos::TeamPolicy<> team_policy; -typedef typename team_policy::member_type team_member; +using team_policy = Kokkos::TeamPolicy<>; +using team_member = typename team_policy::member_type; struct hello_world { - typedef int value_type; // Specify value type for reduction target, sum + using value_type = int; // Specify value type for reduction target, sum KOKKOS_INLINE_FUNCTION void operator()(const team_member& thread, int& sum) const { sum += 1; diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp index cb679f7f5a..8f76110f08 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/03_vectorization/vectorization.cpp @@ -60,13 +60,13 @@ // a thread execute every line of the operator as long as there are no // restricitons on them. Code lines can be restricted using Kokkos::single to // either execute once PerThread or execute once PerTeam. -typedef typename Kokkos::TeamPolicy<>::member_type team_member; +using team_member = typename Kokkos::TeamPolicy<>::member_type; struct SomeCorrelation { - typedef int value_type; // Specify value type for reduction target, sum - typedef Kokkos::DefaultExecutionSpace::scratch_memory_space shared_space; - typedef Kokkos::View - shared_1d_int; + using value_type = int; // Specify value type for reduction target, sum + using shared_space = Kokkos::DefaultExecutionSpace::scratch_memory_space; + using shared_1d_int = + Kokkos::View; Kokkos::View data; Kokkos::View gsum; @@ -136,7 +136,7 @@ struct SomeCorrelation { // The functor needs to define how much shared memory it requests given a // team_size. - size_t team_shmem_size(int team_size) const { + size_t team_shmem_size(int /*team_size*/) const { return shared_1d_int::shmem_size(data.extent(1)); } }; diff --git a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp index 10c8971e5a..d360108925 100644 --- a/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp +++ b/lib/kokkos/example/tutorial/Hierarchical_Parallelism/04_team_scan/team_scan.cpp @@ -48,11 +48,11 @@ #include #include -typedef Kokkos::DefaultExecutionSpace Device; -typedef Kokkos::HostSpace::execution_space Host; +using Device = Kokkos::DefaultExecutionSpace; +using Host = Kokkos::HostSpace::execution_space; -typedef Kokkos::TeamPolicy team_policy; -typedef team_policy::member_type team_member; +using team_policy = Kokkos::TeamPolicy; +using team_member = team_policy::member_type; static const int TEAM_SIZE = 16; diff --git a/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp b/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp index 800904dbce..92f82111f9 100644 --- a/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp +++ b/lib/kokkos/example/tutorial/launch_bounds/launch_bounds_reduce.cpp @@ -60,7 +60,7 @@ struct collision { // one i. // This function was chosen as one that very simply can increase the // register count. - typedef int value_type; + using value_type = int; KOKKOS_INLINE_FUNCTION int hash(int q) const { diff --git a/lib/kokkos/generate_makefile.bash b/lib/kokkos/generate_makefile.bash index 555f0b30a1..f8455dd3e6 100755 --- a/lib/kokkos/generate_makefile.bash +++ b/lib/kokkos/generate_makefile.bash @@ -94,12 +94,13 @@ display_help_text() { echo "--arch=[OPT]: Set target architectures. Options are:" echo " [AMD]" echo " AMDAVX = AMD CPU" - echo " EPYC = AMD EPYC Zen-Core CPU" + echo " ZEN = AMD Zen-Core CPU" + echo " ZEN2 = AMD Zen2-Core CPU" echo " [ARM]" - echo " ARMv80 = ARMv8.0 Compatible CPU" - echo " ARMv81 = ARMv8.1 Compatible CPU" - echo " ARMv8-ThunderX = ARMv8 Cavium ThunderX CPU" - echo " ARMv8-TX2 = ARMv8 Cavium ThunderX2 CPU" + echo " ARMV80 = ARMv8.0 Compatible CPU" + echo " ARMV81 = ARMv8.1 Compatible CPU" + echo " ARMV8_THUNDERX = ARMv8 Cavium ThunderX CPU" + echo " ARMV8_THUNDERX2 = ARMv8 Cavium ThunderX2 CPU" echo " [IBM]" echo " BGQ = IBM Blue Gene Q" echo " Power7 = IBM POWER7 and POWER7+ CPUs" diff --git a/lib/kokkos/gnu_generate_makefile.bash b/lib/kokkos/gnu_generate_makefile.bash index 42b26bf4a4..5a23e1f978 100755 --- a/lib/kokkos/gnu_generate_makefile.bash +++ b/lib/kokkos/gnu_generate_makefile.bash @@ -2,8 +2,6 @@ KOKKOS_DEVICES="" -KOKKOS_DO_EXAMPLES="1" - while [[ $# > 0 ]] do key="$1" @@ -81,9 +79,6 @@ do echo "Warning: ${key} is deprecated" echo "Call make with appropriate -j flag" ;; - --no-examples) - KOKKOS_DO_EXAMPLES="0" - ;; --compiler*) COMPILER="${key#*=}" CNUM=$(command -v ${COMPILER} 2>&1 >/dev/null | grep "no ${COMPILER}" | wc -l) @@ -127,7 +122,8 @@ do echo "--arch=[OPT]: Set target architectures. Options are:" echo " [AMD]" echo " AMDAVX = AMD CPU" - echo " EPYC = AMD EPYC Zen-Core CPU" + echo " ZEN = AMD Zen-Core CPU" + echo " ZEN2 = AMD Zen2-Core CPU" echo " [ARM]" echo " ARMv80 = ARMv8.0 Compatible CPU" echo " ARMv81 = ARMv8.1 Compatible CPU" @@ -309,12 +305,6 @@ mkdir -p containers/performance_tests mkdir -p algorithms mkdir -p algorithms/unit_tests mkdir -p algorithms/performance_tests -mkdir -p example -mkdir -p example/fixture -mkdir -p example/feint -mkdir -p example/fenl -mkdir -p example/make_buildlink -mkdir -p example/tutorial KOKKOS_SETTINGS="${KOKKOS_SETTINGS_NO_KOKKOS_PATH} KOKKOS_PATH=${KOKKOS_PATH}" @@ -374,61 +364,6 @@ echo "" >> algorithms/unit_tests/Makefile echo "clean:" >> algorithms/unit_tests/Makefile echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/algorithms/unit_tests/Makefile ${KOKKOS_SETTINGS} clean" >> algorithms/unit_tests/Makefile -echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/fixture/Makefile -echo "" >> example/fixture/Makefile -echo "all:" >> example/fixture/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS}" >> example/fixture/Makefile -echo "" >> example/fixture/Makefile -echo "test: all" >> example/fixture/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS} test" >> example/fixture/Makefile -echo "" >> example/fixture/Makefile -echo "clean:" >> example/fixture/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/fixture/Makefile ${KOKKOS_SETTINGS} clean" >> example/fixture/Makefile - -echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/feint/Makefile -echo "" >> example/feint/Makefile -echo "all:" >> example/feint/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS}" >> example/feint/Makefile -echo "" >> example/feint/Makefile -echo "test: all" >> example/feint/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS} test" >> example/feint/Makefile -echo "" >> example/feint/Makefile -echo "clean:" >> example/feint/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/feint/Makefile ${KOKKOS_SETTINGS} clean" >> example/feint/Makefile - -echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/fenl/Makefile -echo "" >> example/fenl/Makefile -echo "all:" >> example/fenl/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS}" >> example/fenl/Makefile -echo "" >> example/fenl/Makefile -echo "test: all" >> example/fenl/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS} test" >> example/fenl/Makefile -echo "" >> example/fenl/Makefile -echo "clean:" >> example/fenl/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/fenl/Makefile ${KOKKOS_SETTINGS} clean" >> example/fenl/Makefile - -echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/make_buildlink/Makefile -echo "" >> example/make_buildlink/Makefile -echo "build:" >> example/make_buildlink/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/make_buildlink/Makefile ${KOKKOS_SETTINGS} build" >> example/make_buildlink/Makefile -echo "" >> example/make_buildlink/Makefile -echo "test: build" >> example/make_buildlink/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/make_buildlink/Makefile ${KOKKOS_SETTINGS} test" >> example/make_buildlink/Makefile -echo "" >> example/make_buildlink/Makefile -echo "clean:" >> example/make_buildlink/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/make_buildlink/Makefile ${KOKKOS_SETTINGS} clean" >> example/make_buildlink/Makefile - -echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > example/tutorial/Makefile -echo "" >> example/tutorial/Makefile -echo "build:" >> example/tutorial/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} build">> example/tutorial/Makefile -echo "" >> example/tutorial/Makefile -echo "test: build" >> example/tutorial/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} test" >> example/tutorial/Makefile -echo "" >> example/tutorial/Makefile -echo "clean:" >> example/tutorial/Makefile -echo -e "\t\$(MAKE) -f ${KOKKOS_PATH}/example/tutorial/Makefile KOKKOS_SETTINGS='${KOKKOS_SETTINGS}' KOKKOS_PATH=${KOKKOS_PATH} clean" >> example/tutorial/Makefile - # Generate top level directory makefile. echo "Generating Makefiles with options " ${KOKKOS_SETTINGS} echo "KOKKOS_SETTINGS=${KOKKOS_SETTINGS}" > Makefile @@ -439,14 +374,6 @@ echo -e "\t\$(MAKE) -C core/perf_test" >> Makefile echo -e "\t\$(MAKE) -C containers/unit_tests" >> Makefile echo -e "\t\$(MAKE) -C containers/performance_tests" >> Makefile echo -e "\t\$(MAKE) -C algorithms/unit_tests" >> Makefile -if [ ${KOKKOS_DO_EXAMPLES} -gt 0 ]; then -$() -echo -e "\t\$(MAKE) -C example/fixture" >> Makefile -echo -e "\t\$(MAKE) -C example/feint" >> Makefile -echo -e "\t\$(MAKE) -C example/fenl" >> Makefile -echo -e "\t\$(MAKE) -C example/make_buildlink build" >> Makefile -echo -e "\t\$(MAKE) -C example/tutorial build" >> Makefile -fi echo "" >> Makefile echo "test: build-test" >> Makefile echo -e "\t\$(MAKE) -C core/unit_test test" >> Makefile @@ -454,13 +381,6 @@ echo -e "\t\$(MAKE) -C core/perf_test test" >> Makefile echo -e "\t\$(MAKE) -C containers/unit_tests test" >> Makefile echo -e "\t\$(MAKE) -C containers/performance_tests test" >> Makefile echo -e "\t\$(MAKE) -C algorithms/unit_tests test" >> Makefile -if [ ${KOKKOS_DO_EXAMPLES} -gt 0 ]; then -echo -e "\t\$(MAKE) -C example/fixture test" >> Makefile -echo -e "\t\$(MAKE) -C example/feint test" >> Makefile -echo -e "\t\$(MAKE) -C example/fenl test" >> Makefile -echo -e "\t\$(MAKE) -C example/make_buildlink test" >> Makefile -echo -e "\t\$(MAKE) -C example/tutorial test" >> Makefile -fi echo "" >> Makefile echo "unit-tests-only:" >> Makefile echo -e "\t\$(MAKE) -C core/unit_test test" >> Makefile @@ -474,11 +394,4 @@ echo -e "\t\$(MAKE) -C core/perf_test clean" >> Makefile echo -e "\t\$(MAKE) -C containers/unit_tests clean" >> Makefile echo -e "\t\$(MAKE) -C containers/performance_tests clean" >> Makefile echo -e "\t\$(MAKE) -C algorithms/unit_tests clean" >> Makefile -if [ ${KOKKOS_DO_EXAMPLES} -gt 0 ]; then -echo -e "\t\$(MAKE) -C example/fixture clean" >> Makefile -echo -e "\t\$(MAKE) -C example/feint clean" >> Makefile -echo -e "\t\$(MAKE) -C example/fenl clean" >> Makefile -echo -e "\t\$(MAKE) -C example/make_buildlink clean" >> Makefile -echo -e "\t\$(MAKE) -C example/tutorial clean" >> Makefile -fi diff --git a/lib/kokkos/master_history.txt b/lib/kokkos/master_history.txt index 11e803e760..cae5e9c22e 100644 --- a/lib/kokkos/master_history.txt +++ b/lib/kokkos/master_history.txt @@ -19,4 +19,5 @@ tag: 2.8.00 date: 02:05:2019 master: 34931a36 develop: d1659d1d tag: 2.9.00 date: 06:24:2019 master: 5d6e7fb3 develop: 4c6cb80a tag: 3.0.00 date: 01:31:2020 master: 2983b80d release-candidate-3.0: fdc904a6 tag: 3.1.00 date: 04:14:2020 master: cd1b1d0a develop: fd90af43 -tag: 3.1.1 date: 05:04:2020 master: 785d19f2 release: 2be028bc +tag: 3.1.01 date: 05:04:2020 master: 785d19f2 release: 2be028bc +tag: 3.2.00 date: 08:19:2020 master: 3b2fdc7e release: 5dc6d303 diff --git a/lib/message/cslib/src/STUBS_ZMQ/zmq.h b/lib/message/cslib/src/STUBS_ZMQ/zmq.h index a335ee5e01..98cb937ed1 100644 --- a/lib/message/cslib/src/STUBS_ZMQ/zmq.h +++ b/lib/message/cslib/src/STUBS_ZMQ/zmq.h @@ -24,10 +24,10 @@ namespace CSLIB_NS { #define ZMQ_REQ 0 #define ZMQ_REP 0 -static void *zmq_ctx_new() {return NULL;} -static void *zmq_connect(void *, char *) {return NULL;} +static void *zmq_ctx_new() {return nullptr;} +static void *zmq_connect(void *, char *) {return nullptr;} static int zmq_bind(void *, char *) {return 0;} -static void *zmq_socket(void *,int) {return NULL;} +static void *zmq_socket(void *,int) {return nullptr;} static void zmq_close(void *) {} static void zmq_ctx_destroy(void *) {} static void zmq_send(void *, void *, int, int) {} diff --git a/lib/message/cslib/src/cslib.cpp b/lib/message/cslib/src/cslib.cpp index 7c75a39929..20292329ac 100644 --- a/lib/message/cslib/src/cslib.cpp +++ b/lib/message/cslib/src/cslib.cpp @@ -57,7 +57,7 @@ CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) else if (csflag == 1) server = 1; else error_all("constructor(): Invalid client/server arg"); - if (pcomm == NULL) { + if (pcomm == nullptr) { me = 0; nprocs = 1; @@ -82,19 +82,19 @@ CSlib::CSlib(int csflag, const char *mode, const void *ptr, const void *pcomm) } maxfield = 0; - fieldID = fieldtype = fieldlen = fieldoffset = NULL; + fieldID = fieldtype = fieldlen = fieldoffset = nullptr; maxheader = 0; - header = NULL; + header = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; - recvcounts = displs = NULL; + recvcounts = displs = nullptr; maxglobal = 0; - allids = NULL; + allids = nullptr; maxfieldbytes = 0; - fielddata = NULL; + fielddata = nullptr; - pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing NULL + pad = "\0\0\0\0\0\0\0"; // just length 7 since will have trailing nullptr nsend = nrecv = 0; } @@ -218,7 +218,7 @@ void CSlib::pack_parallel(int id, int ftype, // nlocal datums, each of nper length, from all procs // final data in buf = datums for all natoms, ordered by ids - if (recvcounts == NULL) { + if (recvcounts == nullptr) { recvcounts = (int *) smalloc(nprocs*sizeof(int)); displs = (int *) smalloc(nprocs*sizeof(int)); } @@ -706,9 +706,9 @@ void CSlib::deallocate_fields() void *CSlib::smalloc(int nbytes) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; void *ptr = malloc(nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"malloc(): Failed to allocate %d bytes",nbytes); error_one(str); @@ -722,11 +722,11 @@ void *CSlib::srealloc(void *ptr, int nbytes) { if (nbytes == 0) { sfree(ptr); - return NULL; + return nullptr; } ptr = realloc(ptr,nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"realloc(): Failed to reallocate %d bytes",nbytes); error_one(str); @@ -738,7 +738,7 @@ void *CSlib::srealloc(void *ptr, int nbytes) void CSlib::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; free(ptr); } diff --git a/lib/message/cslib/src/cslib_wrap.cpp b/lib/message/cslib/src/cslib_wrap.cpp index 64b4d53b25..cb132c2382 100644 --- a/lib/message/cslib/src/cslib_wrap.cpp +++ b/lib/message/cslib/src/cslib_wrap.cpp @@ -44,7 +44,7 @@ void cslib_open_fortran(int csflag, const char *mode, const char *str, const void *pcomm, void **csptr) { MPI_Comm ccomm; - void *pccomm = NULL; + void *pccomm = nullptr; if (pcomm) { MPI_Fint *fcomm = (MPI_Fint *) pcomm; diff --git a/lib/message/cslib/src/msg.cpp b/lib/message/cslib/src/msg.cpp index ff654ecbcf..dcd78fb739 100644 --- a/lib/message/cslib/src/msg.cpp +++ b/lib/message/cslib/src/msg.cpp @@ -80,9 +80,9 @@ void Msg::allocate(int nheader, int &maxheader, int *&header, void *Msg::smalloc(int nbytes) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; void *ptr = (void *) malloc(nbytes); - if (ptr == NULL) { + if (ptr == nullptr) { char str[128]; sprintf(str,"Failed to allocate %d bytes",nbytes); } @@ -93,7 +93,7 @@ void *Msg::smalloc(int nbytes) void Msg::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; free(ptr); } diff --git a/lib/message/cslib/src/msg_mpi_two.cpp b/lib/message/cslib/src/msg_mpi_two.cpp index 2a4fa65ff7..d365e20849 100644 --- a/lib/message/cslib/src/msg_mpi_two.cpp +++ b/lib/message/cslib/src/msg_mpi_two.cpp @@ -52,7 +52,7 @@ void MsgMPITwo::init(char *filename) { if (client) { if (me == 0) { - FILE *fp = NULL; + FILE *fp = nullptr; while (!fp) { fp = fopen(filename,"r"); if (!fp) sleep(1); diff --git a/lib/message/cslib/src/msg_zmq.cpp b/lib/message/cslib/src/msg_zmq.cpp index 8bee3aebde..07920c6b5c 100644 --- a/lib/message/cslib/src/msg_zmq.cpp +++ b/lib/message/cslib/src/msg_zmq.cpp @@ -99,12 +99,12 @@ void MsgZMQ::send(int nheader, int *header, int nbuf, char *buf) if (me == 0) { zmq_send(socket,lengths,2*sizeof(int),0); - zmq_recv(socket,NULL,0,0); + zmq_recv(socket,nullptr,0,0); } if (me == 0) { zmq_send(socket,header,nheader*sizeof(int),0); - zmq_recv(socket,NULL,0,0); + zmq_recv(socket,nullptr,0,0); } if (me == 0) zmq_send(socket,buf,nbuf,0); @@ -125,7 +125,7 @@ void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) { if (me == 0) { zmq_recv(socket,lengths,2*sizeof(int),0); - zmq_send(socket,NULL,0,0); + zmq_send(socket,nullptr,0,0); } if (nprocs > 1) MPI_Bcast(lengths,2,MPI_INT,0,world); @@ -135,7 +135,7 @@ void MsgZMQ::recv(int &maxheader, int *&header, int &maxbuf, char *&buf) if (me == 0) { zmq_recv(socket,header,nheader*sizeof(int),0); - zmq_send(socket,NULL,0,0); + zmq_send(socket,nullptr,0,0); } if (nprocs > 1) MPI_Bcast(header,nheader,MPI_INT,0,world); diff --git a/lib/molfile/molfile_plugin.h b/lib/molfile/molfile_plugin.h index 057c403369..491cd375bb 100644 --- a/lib/molfile/molfile_plugin.h +++ b/lib/molfile/molfile_plugin.h @@ -11,7 +11,7 @@ * * $RCSfile: molfile_plugin.h,v $ * $Author: johns $ $Locker: $ $State: Exp $ - * $Revision: 1.108 $ $Date: 2016/02/26 03:17:01 $ + * $Revision: 1.112 $ $Date: 2019/10/17 06:12:24 $ * ***************************************************************************/ @@ -111,7 +111,7 @@ typedef struct { char resname[8]; /**< required residue name string */ int resid; /**< required integer residue ID */ char segid[8]; /**< required segment name string, or "" */ -#if 0 && vmdplugin_ABIVERSION > 17 +#if 0 && vmdplugin_ABIVERSION > 10000 /* The new PDB file formats allows for much larger structures, */ /* which can therefore require longer chain ID strings. The */ /* new PDBx/mmCIF file formats do not have length limits on */ @@ -187,8 +187,53 @@ typedef struct molfile_timestep_metadata { int has_velocities; /**< if timesteps have velocities */ } molfile_timestep_metadata_t; + /* - * Per-timestep atom coordinates and periodic cell information + * + * Per-timestep atom coordinates, velocities, forces, energies, + * and periodic cell information + * + */ + +#if 0 +/** + * Periodically stored energies of various kinds + */ +typedef struct { + int energyflags; // XXX indicate use and semantics of data fields + + double total_energy; // XXX these copied from DESRES_READ_TIMESTEP2 case + double potential_energy; + double kinetic_energy; + double extended_energy; + double force_energy; + double total_pressure; + + // Alchemical free energy methods need to store individual energy samples. + // We don't really want pre-averaged quantities, they lead to problems later. + double lambda; // data gen sim parm: + aux scheduling + soft core parm + double temperature; // temp set by thermostat + // either we use deltaU, or we store U and Uprime... + double deltaU; // Ulambda - Ulambdaprime + double Ulambda; // U for lambda + double Ulambdaprime; // U for lambdaprime + + // IDWS methods + // XXX both values of lambdaprime and required de-interleaving information + + // Replica exchange methods + // XXX rectangle sample params? + + // REST2 method + // XXX + +} molfile_energies_t; +#endif + + +/** + * Per-timestep atom coordinates, velocities, time, energies + * and periodic cell info */ typedef struct { float *coords; /**< coordinates of all atoms, arranged xyzxyzxyz */ @@ -662,7 +707,7 @@ typedef struct { int **bondtype, int *nbondtypes, char ***bondtypename); /** - * XXX this function will be augmented and possibly superseded by a + * XXX this function will be augmented and possibly superceded by a * new QM-capable version named read_timestep(), when finished. * * Read the next timestep from the file. Return MOLFILE_SUCCESS, or @@ -839,6 +884,29 @@ typedef struct { int (* read_qm_rundata)(void *, molfile_qm_t *qmdata); + /** + * Query the molfile plugin to determine whether or not memory + * allocations used for atomic coordinates and PBC unit cell information + * need to be aligned to a particular virtual memory or filesystem + * page size boundary to facilitate kernel-bypass unbuffered I/O, + * e.g., as used by jsplugin. This API should be called prior to the + * first call to read a timestep. The required page alignment size + * (in bytes) is returned to the caller. If this API has not been + * called, then the molfile plugin should revert to standard + * kernel-buffered I/O and suffer the associated performance loss. + * The caller can be assured that the plugin will not request any + * page alignment size that is greater than the value of + * MOLFILE_DIRECTIO_MAX_BLOCK_SIZE, both as a runtime sanity check, + * and to ensure that a caller that is unable to perform the max + * aligned allocation doesn't call the API in the first place. + * If a page-aligned allocation is not required for the file being read, + * the plugin will return an alignment size of 1. + */ +#if vmdplugin_ABIVERSION > 17 + int (* read_timestep_pagealign_size)(void *, int *pagealignsize); +#endif + + /** * Read the next timestep from the file. Return MOLFILE_SUCCESS, or * MOLFILE_EOF on EOF. If the molfile_timestep_t or molfile_qm_metadata_t @@ -862,6 +930,25 @@ typedef struct { int (* read_timestep_metadata)(void *, molfile_timestep_metadata_t *); int (* read_qm_timestep_metadata)(void *, molfile_qm_timestep_metadata_t *); + +#if defined(EXPERIMENTAL_DIRECTIO_APIS) + /** + * Calculate file offsets and I/O lengths for performing + * kernel-bypass direct I/O or using GPU-Direct Storage APIs, + * thereby enabling peak I/O rates to be achieved for analysis + * worksloads like clustering of trajectories. + */ + int (* calc_fileoffsets_timestep)(void *, + molfile_ssize_t frameindex, + int firstatom, + int lastatom, + int *firstatom, + int *pageoffset, + molfile_ssize_t *startoffset, + molfile_ssize_t *readlen); +#endif + + #if defined(DESRES_READ_TIMESTEP2) /** * Read a specified timestep! diff --git a/lib/molfile/vmdplugin.h b/lib/molfile/vmdplugin.h index 842d1e431c..7afc358e97 100644 --- a/lib/molfile/vmdplugin.h +++ b/lib/molfile/vmdplugin.h @@ -11,7 +11,7 @@ * * $RCSfile: vmdplugin.h,v $ * $Author: johns $ $Locker: $ $State: Exp $ - * $Revision: 1.33 $ $Date: 2015/10/29 05:10:54 $ + * $Revision: 1.34 $ $Date: 2018/05/02 03:12:56 $ * ***************************************************************************/ @@ -144,7 +144,7 @@ typedef struct { /** * Use this macro to initialize the abiversion member of each plugin */ -#define vmdplugin_ABIVERSION 17 +#define vmdplugin_ABIVERSION 18 /*@{*/ /** Use this macro to indicate a plugin's thread-safety at registration time */ diff --git a/lib/plumed/Install.py b/lib/plumed/Install.py index b6b00d1511..33bb40c9d9 100644 --- a/lib/plumed/Install.py +++ b/lib/plumed/Install.py @@ -17,7 +17,7 @@ parser = ArgumentParser(prog='Install.py', # settings -version = "2.6.0" +version = "2.6.1" mode = "static" # help message @@ -48,6 +48,7 @@ checksums = { \ '2.5.3' : 'de30d6e7c2dcc0973298e24a6da24286', \ '2.5.4' : 'f31b7d16a4be2e30aa7d5c19c3d37853', \ '2.6.0' : '204d2edae58d9b10ba3ad460cad64191', \ + '2.6.1' : '89a9a450fc6025299fe16af235957163', \ } # parse and process arguments diff --git a/lib/poems/SystemProcessor.h b/lib/poems/SystemProcessor.h index 4fc8785dd7..f009794f66 100644 --- a/lib/poems/SystemProcessor.h +++ b/lib/poems/SystemProcessor.h @@ -110,21 +110,21 @@ void SystemProcessor::processArray(int** links, int numLinks) do { currentNode = findSingleLink(temp); //find the start of the next available chain - if(currentNode != NULL) + if(currentNode != nullptr) { headsOfSystems.Append(AddNewChain(currentNode)); //and add it to the headsOfSystems list of chains } } - while(currentNode != NULL); //repeat this until all chains have been added + while(currentNode != nullptr); //repeat this until all chains have been added } POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ - if(currentNode == NULL) //Termination condition; if the currentNode is null, then return null + if(currentNode == nullptr) //Termination condition; if the currentNode is null, then return null { - return NULL; + return nullptr; } int * tmp; - POEMSNode * nextNode = NULL; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. + POEMSNode * nextNode = nullptr; //nextNode stores the proposed next node to add to the chain. this will be checked to make sure no backtracking is occurring before being assigned as the current node. POEMSChain * newChain = new POEMSChain; //make a new POEMSChain object. This will be the object returned if(currentNode->links.GetNumElements() == 0) //if we have no links from this node, then the whole chain is only one node. Add this node to the chain and return it; mark node as visited for future reference @@ -168,8 +168,8 @@ POEMSChain * SystemProcessor::AddNewChain(POEMSNode * currentNode){ newChain->listOfNodes.Append(tmp); //append the last node before branch (node shared jointly with branch chains) //re-mark as visited, just to make sure ListElement * tempNode = currentNode->links.GetHeadElement(); //go through all of the links, one at a time that branch - POEMSChain * tempChain = NULL; //temporary variable to hold data - while(tempNode != NULL) //when we have followed all links, stop + POEMSChain * tempChain = nullptr; //temporary variable to hold data + while(tempNode != nullptr) //when we have followed all links, stop { if(setLinkVisited(tempNode->value, currentNode)) //dont backtrack, or create closed loops { @@ -187,12 +187,12 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) //This function takes the root of a search tree containing POEMSNodes and returns a POEMSNode corresponding to the start of a chain in the //system. It finds a node that has not been visited before, and only has one link; this node will be used as the head of the chain. { - if(aNode == NULL) + if(aNode == nullptr) { - return NULL; + return nullptr; } POEMSNode * returnVal = (POEMSNode *)aNode->GetAuxData(); //get the poemsnode data out of the treenode - POEMSNode * detectLoneLoops = NULL; //is used to handle a loop that has no protruding chains + POEMSNode * detectLoneLoops = nullptr; //is used to handle a loop that has no protruding chains if(returnVal->visited == false) { detectLoneLoops = returnVal; //if we find any node that has not been visited yet, save it @@ -202,15 +202,15 @@ POEMSNode * SystemProcessor::findSingleLink(TreeNode * aNode) return returnVal; //return the node is it meets this criteria } returnVal = findSingleLink(aNode->Left()); //otherwise, check the left subtree - if(returnVal == NULL) //and if we find nothing... + if(returnVal == nullptr) //and if we find nothing... { returnVal = findSingleLink(aNode->Right()); //check the right subtree } - if(returnVal == NULL) //if we could not find any chains + if(returnVal == nullptr) //if we could not find any chains { returnVal = detectLoneLoops; //see if we found any nodes at all that havent been processed } - return returnVal; //return what we find (will be NULL if no new chains are + return returnVal; //return what we find (will be a null pointer if no new chains are //found) } @@ -226,7 +226,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo //cout << "Checking link between nodes " << firstNode->idNumber << " and " << secondNode->idNumber << "... "; ListElement * tmp = firstNode->links.GetHeadElement(); //get the head element of the list of pointers for node 1 ListElement * tmp2 = firstNode->taken.GetHeadElement(); //get the head element of the list of bool isVisited flags for node 1 - while(tmp->value != NULL || tmp2->value != NULL) //go through until we reach the end of the lists + while(tmp->value != nullptr || tmp2->value != nullptr) //go through until we reach the end of the lists { if(tmp->value == secondNode) //if we find the link to the other node { @@ -248,7 +248,7 @@ bool SystemProcessor::setLinkVisited(POEMSNode * firstNode, POEMSNode * secondNo tmp = secondNode->links.GetHeadElement(); //now, if the link was unvisited, we need to go set the other node's list such that //it also knows this link is being visited tmp2 = secondNode->taken.GetHeadElement(); - while(tmp->value != NULL || tmp2->value != NULL) //go through the list + while(tmp->value != nullptr || tmp2->value != nullptr) //go through the list { if(tmp->value == firstNode) //if we find the link { diff --git a/lib/poems/poemsnodelib.h b/lib/poems/poemsnodelib.h index 446fa2013f..04f0f4b79b 100644 --- a/lib/poems/poemsnodelib.h +++ b/lib/poems/poemsnodelib.h @@ -23,7 +23,7 @@ using namespace std; -TreeNode *GetTreeNode(int item,TreeNode *lptr = NULL,TreeNode *rptr =NULL); +TreeNode *GetTreeNode(int item,TreeNode *lptr = nullptr,TreeNode *rptr =nullptr); void FreeTreeNode(TreeNode *p); @@ -46,7 +46,7 @@ void PrintTree (TreeNode *t, int level); void Postorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { Postorder(t->Left(), visit); // descend left Postorder(t->Right(), visit); // descend right @@ -59,7 +59,7 @@ void Postorder (TreeNode *t, void visit(TreeNode* &t)) void Preorder (TreeNode *t, void visit(TreeNode* &t)) { // the recursive scan terminates on a empty subtree - if (t != NULL) + if (t != nullptr) { visit(t); // visit the node Preorder(t->Left(), visit); // descend left @@ -69,7 +69,7 @@ void Preorder (TreeNode *t, void visit(TreeNode* &t)) //create TreeNode object with pointer fields lptr and rptr -// The pointers have default value NULL +// The pointers have default value nullptr TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) { TreeNode *p; @@ -79,7 +79,7 @@ TreeNode *GetTreeNode(int item,TreeNode *lptr,TreeNode *rptr) p = new TreeNode(item, lptr, rptr); // if insufficient memory, terminatewith an error message - if (p == NULL) + if (p == nullptr) { cerr << "Memory allocation failure!\n"; exit(1); @@ -103,14 +103,14 @@ void FreeTreeNode(TreeNode *p) void CountLeaf (TreeNode *t, int& count) { //use postorder descent - if(t !=NULL) + if(t !=nullptr) { CountLeaf(t->Left(), count); // descend left CountLeaf(t->Right(), count); // descend right // check if node t is a leaf node (no descendants) // if so, increment the variable count - if (t->Left() == NULL && t->Right() == NULL) + if (t->Left() == nullptr && t->Right() == nullptr) count++; } } @@ -124,7 +124,7 @@ int Depth (TreeNode *t) { int depthLeft, depthRight, depthval; - if (t == NULL) + if (t == nullptr) depthval = -1; else { @@ -145,8 +145,8 @@ void IndentBlanks(int num) void PrintTree (TreeNode *t, int level) { - //print tree with root t, as long as t!=NULL - if (t != NULL) + //print tree with root t, as long as t!=nullptr + if (t != nullptr) { int indentUnit = 5; // print right branch of tree t diff --git a/lib/poems/poemstree.h b/lib/poems/poemstree.h index ee07a33255..cb9499cfd4 100644 --- a/lib/poems/poemstree.h +++ b/lib/poems/poemstree.h @@ -82,7 +82,7 @@ public: DeleteAuxData = callback; } - void Insert(const int& item, const int& data, void * AuxData = NULL); + void Insert(const int& item, const int& data, void * AuxData = nullptr); void Delete(const int& item); void AVLInsert(TreeNode* &tree, TreeNode* newNode, int &reviseBalanceFactor); void ClearList(void); @@ -99,7 +99,7 @@ Tree::Tree(void) root = 0; current = 0; size = 0; - DeleteAuxData = NULL; + DeleteAuxData = nullptr; } @@ -131,18 +131,18 @@ Tree& Tree::operator = (const Tree& rhs) } // search for data item in the tree. if found, return its node -// address and a pointer to its parent; otherwise, return NULL +// address and a pointer to its parent; otherwise, return a null pointer TreeNode *Tree::FindNode(const int& item, TreeNode* & parent) const { // cycle t through the tree starting with root TreeNode *t = root; - // the parent of the root is NULL - parent = NULL; + // the parent of the root is a null pointer + parent = nullptr; // terminate on empty subtree - while(t != NULL) + while(t != nullptr) { // stop on a match if (item == t->data) @@ -158,7 +158,7 @@ TreeNode *Tree::FindNode(const int& item, } } - // return pointer to node; NULL if not found + // return pointer to node; a null pointer if not found return t; } @@ -172,14 +172,14 @@ void * Tree::Find(int& item) current = FindNode (item, parent); // if item found, assign data to item and return True - if (current != NULL) + if (current != nullptr) { item = current->data; return current->GetAuxData(); } else - // item not found in the tree. return False - return NULL; + // item not found in the tree. return a null pointer + return nullptr; } @@ -194,7 +194,7 @@ void Tree::Insert(const int& item, const int& data, void * AuxData) int reviseBalanceFactor = 0; // get a new AVL tree node with empty pointer fields - newNode = GetTreeNode(item,NULL,NULL); + newNode = GetTreeNode(item,nullptr,nullptr); newNode->data = data; newNode->SetAuxData(AuxData); // call recursive routine to actually insert the element @@ -213,7 +213,7 @@ void Tree::AVLInsert(TreeNode *&tree, TreeNode *newNode, int &reviseBalanceFacto int rebalanceCurrNode; // scan reaches an empty tree; time to insert the new node - if (tree == NULL) + if (tree == nullptr) { // update the parent to point at newNode tree = newNode; @@ -456,16 +456,16 @@ void Tree::Delete(const int& item) // search for a node containing data value item. obtain its // node address and that of its parent - if ((DNodePtr = FindNode (item, PNodePtr)) == NULL) + if ((DNodePtr = FindNode (item, PNodePtr)) == nullptr) return; - // If D has NULL pointer, the + // If D has null pointer, the // replacement node is the one on the other branch - if (DNodePtr->right == NULL) + if (DNodePtr->right == nullptr) RNodePtr = DNodePtr->left; - else if (DNodePtr->left == NULL) + else if (DNodePtr->left == nullptr) RNodePtr = DNodePtr->right; - // Both pointers of DNodePtr are non-NULL + // Both pointers of DNodePtr are non-null pointers else { // Find and unlink replacement node for D @@ -483,7 +483,7 @@ void Tree::Delete(const int& item) // descend down right subtree of the left child of D // keeping a record of current node and its parent. // when we stop, we have found the replacement - while (RNodePtr->right != NULL) + while (RNodePtr->right != nullptr) { PofRNodePtr = RNodePtr; RNodePtr = RNodePtr; @@ -508,7 +508,7 @@ void Tree::Delete(const int& item) // complete the link to the parent node // deleting the root node. assign new root - if (PNodePtr == NULL) + if (PNodePtr == nullptr) root = RNodePtr; // attach R to the correct branch of P else if (DNodePtr->data < PNodePtr->data) @@ -529,7 +529,7 @@ void Tree::Delete(const int& item) // assign node value to item; otherwise, insert item in tree void Tree::Update(const int& item) { - if (current !=NULL && current->data == item) + if (current !=nullptr && current->data == item) current->data = item; else Insert(item, item); @@ -545,25 +545,25 @@ TreeNode *Tree::CopyTree(TreeNode *t) TreeNode *newlptr, *newrptr, *newnode; // stop the recursive scan when we arrive at an empty tree - if (t == NULL) - return NULL; + if (t == nullptr) + return nullptr; // CopyTree builds a new tree by scanning the nodes of t. // At each node in t, CopyTree checks for a left child. if - // present it makes a copy of left child or returns NULL. + // present it makes a copy of left child or returns a null pointer. // the algorithm similarly checks for a right child. // CopyTree builds a copy of node using GetTreeNode and // appends copy of left and right children to node. - if (t->Left() !=NULL) + if (t->Left() !=nullptr) newlptr = CopyTree(t->Left()); else - newlptr = NULL; + newlptr = nullptr; - if (t->Right() !=NULL) + if (t->Right() !=nullptr) newrptr = CopyTree(t->Right()); else - newrptr = NULL; + newrptr = nullptr; // Build new tree from the bottom up by building the two @@ -579,12 +579,12 @@ TreeNode *Tree::CopyTree(TreeNode *t) // the tree and delete each node at the visit operation void Tree::DeleteTree(TreeNode *t) { - if (t != NULL) { + if (t != nullptr) { DeleteTree(t->Left()); DeleteTree(t->Right()); void *aux = t->GetAuxData(); - if (aux != NULL) { - if (DeleteAuxData != NULL) { + if (aux != nullptr) { + if (DeleteAuxData != nullptr) { (*DeleteAuxData)(aux); } else { delete (TreeNode *) aux; @@ -595,11 +595,11 @@ void Tree::DeleteTree(TreeNode *t) } // call the function DeleteTree to deallocate the nodes. then -// set the root pointer back to NULL +// set the root pointer back to a null pointer void Tree::ClearTree(TreeNode * &t) { DeleteTree(t); - t = NULL; // root now NULL + t = nullptr; // root now a null pointer } // delete all nodes in list diff --git a/lib/poems/poemstreenode.cpp b/lib/poems/poemstreenode.cpp index 051e13d6e0..0b475c0a85 100644 --- a/lib/poems/poemstreenode.cpp +++ b/lib/poems/poemstreenode.cpp @@ -18,7 +18,7 @@ #include "poemstreenode.h" // constructor; initialize the data and pointer fields -// The pointer value NULL assigns a empty subtree +// A null pointer value assigns a empty subtree TreeNode::TreeNode (const int & item, TreeNode *lptr,TreeNode *rptr, int balfac):data(item), left(lptr), right(rptr), balanceFactor(balfac) { diff --git a/lib/poems/solver.cpp b/lib/poems/solver.cpp index 67f5b607e3..7b1e718b93 100644 --- a/lib/poems/solver.cpp +++ b/lib/poems/solver.cpp @@ -45,7 +45,7 @@ Solver * Solver::GetSolver(SolverType solverToMake) //returning a pointer to a n switch((int)solverToMake) { case ONSOLVER: return new OnSolver(); - default: return NULL; + default: return nullptr; } } diff --git a/lib/poems/system.cpp b/lib/poems/system.cpp index 369213f7d0..23554f4117 100644 --- a/lib/poems/system.cpp +++ b/lib/poems/system.cpp @@ -23,7 +23,7 @@ System::System(){ - mappings = NULL; + mappings = nullptr; } System::~System(){ @@ -238,7 +238,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota //-------------------------------------------------------------------------// // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -246,7 +246,7 @@ void System::Create_DegenerateSystem(int& nfree, int*freelist, double *&masstota Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; @@ -391,7 +391,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, // Declaring Temporary Entities //-------------------------------------------------------------------------// - Body* body = NULL; + Body* body = nullptr; Body* prev; Body* Inertial; Point* origin; @@ -399,7 +399,7 @@ void System::Create_System_LAMMPS(int numbodies, double *mass,double **inertia, Point* point_CM; Point* point_p; Point* point_k; - Point* point_ch = NULL; + Point* point_ch = nullptr; Vect3 r1,r2,r3,v1,v2,v3; Mat3x3 IM, N, PKCK,PKCN ; ColMatrix qo, uo, q, qdot,w; diff --git a/lib/poems/workspace.cpp b/lib/poems/workspace.cpp index 2b3257b0dd..21819d4c02 100644 --- a/lib/poems/workspace.cpp +++ b/lib/poems/workspace.cpp @@ -52,7 +52,7 @@ void Workspace::allocateNewSystem() { Workspace::Workspace(){ currentIndex = -1; maxAlloc = 0; - system = NULL; + system = nullptr; } Workspace::~Workspace(){ @@ -133,7 +133,7 @@ if(njoint){ int ttk = 0; - while(NodeValue != NULL) { + while(NodeValue != nullptr) { array = new int[NodeValue->value->listOfNodes.GetNumElements()]; arrayFromChain = NodeValue->value->listOfNodes.CreateArray(); numElementsInSystem = NodeValue->value->listOfNodes.GetNumElements(); @@ -200,7 +200,7 @@ System* Workspace::GetSystem(int index){ } } else{ - return NULL; + return nullptr; } } diff --git a/lib/smd/Install.py b/lib/smd/Install.py index 40a8bca523..16dd3038a8 100644 --- a/lib/smd/Install.py +++ b/lib/smd/Install.py @@ -22,12 +22,10 @@ tarball = "eigen.tar.gz" # known checksums for different Eigen versions. used to validate the download. checksums = { \ - '3.3.4' : '1a47e78efe365a97de0c022d127607c3', \ - '3.3.5' : 'ee48cafede2f51fe33984ff5c9f48026', \ - '3.3.6' : 'd1be14064b50310b0eb2b49e402c64d7', \ - '3.3.7' : 'f2a417d083fe8ca4b8ed2bc613d20f07' \ + '3.3.7' : '9e30f67e8531477de4117506fe44669b' \ } + # help message HELP = """ @@ -36,7 +34,7 @@ Syntax from src dir: make lib-smd args="-b" Syntax from lib dir: python Install.py -b or: python Install.py -p /usr/include/eigen3" - or: python Install.py -v 3.3.4 -b + or: python Install.py -v 3.3.7 -b Example: @@ -78,7 +76,7 @@ if pathflag: if buildflag: print("Downloading Eigen ...") eigentar = os.path.join(homepath, tarball) - url = "https://bitbucket.org/eigen/eigen/get/%s.tar.gz" % version + url = "https://gitlab.com/libeigen/eigen/-/archive/%s/eigen-%s.tar.gz" % (version,version) geturl(url, eigentar) # verify downloaded archive integrity via md5 checksum, if known. @@ -89,7 +87,7 @@ if buildflag: print("Cleaning up old folders ...") - edir = glob.glob(os.path.join(homepath, "eigen-eigen-*")) + edir = glob.glob(os.path.join(homepath, "eigen-*")) edir.append(eigenpath) for one in edir: if os.path.isdir(one): @@ -102,8 +100,8 @@ if buildflag: os.remove(eigentar) else: sys.exit("File %s is not a supported archive" % eigentar) - edir = glob.glob(os.path.join(homepath, "eigen-eigen-*")) - os.rename(edir[0], eigenpath) + edir = os.path.join(homepath, "eigen-%s" % version) + os.rename(edir, eigenpath) # create link in lib/smd to Eigen src dir diff --git a/python/examples/demo.py b/python/examples/demo.py index 5d2b62fee3..0bd2c8f054 100755 --- a/python/examples/demo.py +++ b/python/examples/demo.py @@ -16,7 +16,7 @@ if len(argv) != 1: print("Syntax: demo.py") sys.exit() -from lammps import lammps +from lammps import lammps, LAMMPS_INT, LMP_STYLE_GLOBAL, LMP_VAR_EQUAL, LMP_VAR_ATOM lmp = lammps() # test out various library functions after running in.demo @@ -25,18 +25,18 @@ lmp.file("in.demo") print("\nPython output:") -natoms = lmp.extract_global("natoms",0) -mass = lmp.extract_atom("mass",2) -x = lmp.extract_atom("x",3) +natoms = lmp.extract_global("natoms") +mass = lmp.extract_atom("mass") +x = lmp.extract_atom("x") print("Natoms, mass, x[0][0] coord =",natoms,mass[1],x[0][0]) -temp = lmp.extract_compute("thermo_temp",0,0) +temp = lmp.extract_compute("thermo_temp", LMP_STYLE_GLOBAL, LAMMPS_INT) print("Temperature from compute =",temp) -eng = lmp.extract_variable("eng",None,0) +eng = lmp.extract_variable("eng",None, LMP_VAR_EQUAL) print("Energy from equal-style variable =",eng) -vy = lmp.extract_variable("vy","all",1) +vy = lmp.extract_variable("vy","all", LMP_VAR_ATOM) print("Velocity component from atom-style variable =",vy[1]) vol = lmp.get_thermo("vol") diff --git a/python/examples/mc.py b/python/examples/mc.py index fb2bfabab9..fe7f6838c8 100755 --- a/python/examples/mc.py +++ b/python/examples/mc.py @@ -27,7 +27,7 @@ if len(argv) != 2: infile = sys.argv[1] -from lammps import lammps +from lammps import lammps, LAMMPS_INT, LMP_STYLE_GLOBAL, LMP_VAR_EQUAL lmp = lammps() # run infile one line at a time @@ -42,14 +42,14 @@ lmp.command("variable e equal pe") lmp.command("run 0") -natoms = lmp.extract_global("natoms",0) -emin = lmp.extract_compute("thermo_pe",0,0) / natoms +natoms = lmp.extract_global("natoms") +emin = lmp.extract_compute("thermo_pe",LMP_STYLE_GLOBAL,LAMMPS_INT) / natoms lmp.command("variable emin equal $e") # disorder the system # estart = initial energy -x = lmp.extract_atom("x",3) +x = lmp.extract_atom("x") for i in range(natoms): x[i][0] += deltaperturb * (2*random.random()-1) @@ -58,10 +58,10 @@ for i in range(natoms): lmp.command("variable elast equal $e") lmp.command("thermo_style custom step v_emin v_elast pe") lmp.command("run 0") -x = lmp.extract_atom("x",3) +x = lmp.extract_atom("x") lmp.command("variable elast equal $e") -estart = lmp.extract_compute("thermo_pe",0,0) / natoms +estart = lmp.extract_compute("thermo_pe", LMP_STYLE_GLOBAL, LAMMPS_INT) / natoms # loop over Monte Carlo moves # extract x after every run, in case reneighboring changed ptr in LAMMPS @@ -78,8 +78,8 @@ for i in range(nloop): x[iatom][1] += deltamove * (2*random.random()-1) lmp.command("run 1 pre no post no") - x = lmp.extract_atom("x",3) - e = lmp.extract_compute("thermo_pe",0,0) / natoms + x = lmp.extract_atom("x") + e = lmp.extract_compute("thermo_pe", LMP_STYLE_GLOBAL, LAMMPS_INT) / natoms if e <= elast: elast = e @@ -96,10 +96,10 @@ for i in range(nloop): # final energy and stats lmp.command("variable nbuild equal nbuild") -nbuild = lmp.extract_variable("nbuild",None,0) +nbuild = lmp.extract_variable("nbuild", None, LMP_VAR_EQUAL) lmp.command("run 0") -estop = lmp.extract_compute("thermo_pe",0,0) / natoms +estop = lmp.extract_compute("thermo_pe", LMP_STYLE_GLOBAL, LAMMPS_INT) / natoms print("MC stats:") print(" starting energy =",estart) diff --git a/python/examples/simple.py b/python/examples/simple.py index 632dde9ed3..9f85d8b4df 100755 --- a/python/examples/simple.py +++ b/python/examples/simple.py @@ -61,7 +61,7 @@ lmp.command("run 1"); # extract force on single atom two different ways -f = lmp.extract_atom("f",3) +f = lmp.extract_atom("f") print("Force on 1 atom via extract_atom: ",f[0][0]) fx = lmp.extract_variable("fx","all",1) diff --git a/python/examples/split.py b/python/examples/split.py index 77e605092e..bd2896c004 100755 --- a/python/examples/split.py +++ b/python/examples/split.py @@ -57,7 +57,7 @@ if color == 0: lmp.scatter_atoms("x",1,3,x) lmp.command("run 1"); - f = lmp.extract_atom("f",3) + f = lmp.extract_atom("f") print("Force on 1 atom via extract_atom: ",f[0][0]) fx = lmp.extract_variable("fx","all",1) diff --git a/python/lammps.py b/python/lammps.py index 8bd1fc693b..59f2dce012 100644 --- a/python/lammps.py +++ b/python/lammps.py @@ -10,16 +10,16 @@ # # See the README file in the top-level LAMMPS directory. # ------------------------------------------------------------------------- +# Python wrappers for the LAMMPS library via ctypes -# Python wrappers on LAMMPS library via ctypes - -# for python3 compatibility +# for python2/3 compatibility from __future__ import print_function # imports for simple LAMMPS python wrapper module "lammps" import sys,traceback,types +import warnings from ctypes import * from os.path import dirname,abspath,join from inspect import getsourcefile @@ -32,10 +32,33 @@ import select import re import sys +# various symbolic constants to be used +# in certain calls to select data formats +LAMMPS_AUTODETECT = None LAMMPS_INT = 0 -LAMMPS_DOUBLE = 1 -LAMMPS_BIGINT = 2 -LAMMPS_TAGINT = 3 +LAMMPS_INT_2D = 1 +LAMMPS_DOUBLE = 2 +LAMMPS_DOUBLE_2D = 3 +LAMMPS_INT64 = 4 +LAMMPS_INT64_2D = 5 +LAMMPS_STRING = 6 + +# these must be kept in sync with the enums in library.h +LMP_STYLE_GLOBAL = 0 +LMP_STYLE_ATOM = 1 +LMP_STYLE_LOCAL = 2 + +LMP_TYPE_SCALAR = 0 +LMP_TYPE_VECTOR = 1 +LMP_TYPE_ARRAY = 2 +LMP_SIZE_VECTOR = 3 +LMP_SIZE_ROWS = 4 +LMP_SIZE_COLS = 5 + +LMP_VAR_EQUAL = 0 +LMP_VAR_ATOM = 1 + +# ------------------------------------------------------------------------- def get_ctypes_int(size): if size == 4: @@ -44,6 +67,8 @@ def get_ctypes_int(size): return c_int64 return c_int +# ------------------------------------------------------------------------- + class MPIAbortException(Exception): def __init__(self, message): self.message = message @@ -51,14 +76,16 @@ class MPIAbortException(Exception): def __str__(self): return repr(self.message) +# ------------------------------------------------------------------------- + class NeighList: - """This is a wrapper class that exposes the contents of a neighbor list + """This is a wrapper class that exposes the contents of a neighbor list. It can be used like a regular Python list. Internally it uses the lower-level LAMMPS C-library interface. - :param lmp: reference to instance of :class:`lammps` + :param lmp: reference to instance of :py:class:`lammps` :type lmp: lammps :param idx: neighbor list index :type idx: int @@ -102,32 +129,56 @@ class NeighList: for ii in range(inum): yield self.get(ii) +# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- + class lammps(object): + """Create an instance of the LAMMPS Python class. - # detect if Python is using version of mpi4py that can pass a communicator + .. _mpi4py_docs: https://mpi4py.readthedocs.io/ - has_mpi4py = False - try: - from mpi4py import MPI - from mpi4py import __version__ as mpi4py_version - if mpi4py_version.split('.')[0] in ['2','3']: has_mpi4py = True - except: - pass + This is a Python wrapper class that exposes the LAMMPS C-library + interface to Python. It either requires that LAMMPS has been compiled + as shared library which is then dynamically loaded via the ctypes + Python module or that this module called from a Python function that + is called from a Python interpreter embedded into a LAMMPS executable, + for example through the :doc:`python invoke ` command. + When the class is instantiated it calls the :cpp:func:`lammps_open` + function of the LAMMPS C-library interface, which in + turn will create an instance of the :cpp:class:`LAMMPS ` + C++ class. The handle to this C++ class is stored internally + and automatically passed to the calls to the C library interface. - # create instance of LAMMPS + :param name: "machine" name of the shared LAMMPS library ("mpi" loads ``liblammps_mpi.so``, "" loads ``liblammps.so``) + :type name: string + :param cmdargs: list of command line arguments to be passed to the :cpp:func:`lammps_open` function. The executable name is automatically added. + :type cmdargs: list + :param ptr: pointer to a LAMMPS C++ class instance when called from an embedded Python interpreter. None means load symbols from shared library. + :type ptr: pointer + :param comm: MPI communicator (as provided by `mpi4py `_). ``None`` means use ``MPI_COMM_WORLD`` implicitly. + :type comm: MPI_Comm + """ - def __init__(self,name="",cmdargs=None,ptr=None,comm=None): + # ------------------------------------------------------------------------- + # create an instance of LAMMPS + + def __init__(self,name='',cmdargs=None,ptr=None,comm=None): self.comm = comm self.opened = 0 - # determine module location + # determine module file location modpath = dirname(abspath(getsourcefile(lambda:0))) + # for windows installers the shared library is in a different folder + winpath = abspath(os.path.join(modpath,'..','bin')) self.lib = None self.lmp = None - # if a pointer to a LAMMPS object is handed in, - # all symbols should already be available + # if a pointer to a LAMMPS object is handed in + # when being called from a Python interpreter + # embedded into a LAMMPS executable, all library + # symbols should already be available so we do not + # load a shared object. try: if ptr: self.lib = CDLL("",RTLD_GLOBAL) @@ -142,23 +193,61 @@ class lammps(object): # fall back to loading with a relative path, # typically requires LD_LIBRARY_PATH to be set appropriately - if any([f.startswith('liblammps') and f.endswith('.dylib') for f in os.listdir(modpath)]): + if any([f.startswith('liblammps') and f.endswith('.dylib') + for f in os.listdir(modpath)]): lib_ext = ".dylib" + elif any([f.startswith('liblammps') and f.endswith('.dll') + for f in os.listdir(modpath)]): + lib_ext = ".dll" + elif os.path.exists(winpath) and any([f.startswith('liblammps') and f.endswith('.dll') + for f in os.listdir(winpath)]): + lib_ext = ".dll" + modpath = winpath else: lib_ext = ".so" if not self.lib: try: - if not name: self.lib = CDLL(join(modpath,"liblammps" + lib_ext),RTLD_GLOBAL) - else: self.lib = CDLL(join(modpath,"liblammps_%s" % name + lib_ext), - RTLD_GLOBAL) + if not name: + self.lib = CDLL(join(modpath,"liblammps" + lib_ext),RTLD_GLOBAL) + else: + self.lib = CDLL(join(modpath,"liblammps_%s" % name + lib_ext), + RTLD_GLOBAL) except: - if not name: self.lib = CDLL("liblammps" + lib_ext,RTLD_GLOBAL) - else: self.lib = CDLL("liblammps_%s" % name + lib_ext,RTLD_GLOBAL) + if not name: + self.lib = CDLL("liblammps" + lib_ext,RTLD_GLOBAL) + else: + self.lib = CDLL("liblammps_%s" % name + lib_ext,RTLD_GLOBAL) - # define ctypes API for each library method - # NOTE: should add one of these for each lib function + # declare all argument and return types for all library methods here. + # exceptions are where the arguments depend on certain conditions and + # then are defined where the functions are used. + self.lib.lammps_extract_setting.argtypes = [c_void_p, c_char_p] + self.lib.lammps_extract_setting.restype = c_int + + # set default types + # needed in later declarations + self.c_bigint = get_ctypes_int(self.extract_setting("bigint")) + self.c_tagint = get_ctypes_int(self.extract_setting("tagint")) + self.c_imageint = get_ctypes_int(self.extract_setting("imageint")) + + self.lib.lammps_open.restype = c_void_p + self.lib.lammps_open_no_mpi.restype = c_void_p + self.lib.lammps_close.argtypes = [c_void_p] + self.lib.lammps_free.argtypes = [c_void_p] + + self.lib.lammps_file.argtypes = [c_void_p, c_char_p] + self.lib.lammps_file.restype = None + + self.lib.lammps_command.argtypes = [c_void_p, c_char_p] + self.lib.lammps_command.restype = c_char_p + self.lib.lammps_commands_list.restype = None + self.lib.lammps_commands_string.argtypes = [c_void_p, c_char_p] + self.lib.lammps_commands_string.restype = None + + self.lib.lammps_get_natoms.argtypes = [c_void_p] + self.lib.lammps_get_natoms.restype = c_double self.lib.lammps_extract_box.argtypes = \ [c_void_p,POINTER(c_double),POINTER(c_double), POINTER(c_double),POINTER(c_double),POINTER(c_double), @@ -189,6 +278,27 @@ class lammps(object): [c_void_p,c_char_p,c_int,c_int,c_int,POINTER(c_int),c_void_p] self.lib.lammps_scatter_atoms_subset.restype = None + self.lib.lammps_gather.argtypes = \ + [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_gather.restype = None + + self.lib.lammps_gather_concat.argtypes = \ + [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_gather_concat.restype = None + + self.lib.lammps_gather_subset.argtypes = \ + [c_void_p,c_char_p,c_int,c_int,c_int,POINTER(c_int),c_void_p] + self.lib.lammps_gather_subset.restype = None + + self.lib.lammps_scatter.argtypes = \ + [c_void_p,c_char_p,c_int,c_int,c_void_p] + self.lib.lammps_scatter.restype = None + + self.lib.lammps_scatter_subset.argtypes = \ + [c_void_p,c_char_p,c_int,c_int,c_int,POINTER(c_int),c_void_p] + self.lib.lammps_scatter_subset.restype = None + + self.lib.lammps_find_pair_neighlist.argtypes = [c_void_p, c_char_p, c_int, c_int, c_int] self.lib.lammps_find_pair_neighlist.restype = c_int @@ -210,6 +320,54 @@ class lammps(object): self.lib.lammps_get_last_error_message.argtypes = [c_void_p, c_char_p, c_int] self.lib.lammps_get_last_error_message.restype = c_int + self.lib.lammps_extract_global.argtypes = [c_void_p, c_char_p] + self.lib.lammps_extract_global_datatype.argtypes = [c_void_p, c_char_p] + self.lib.lammps_extract_global_datatype.restype = c_int + self.lib.lammps_extract_compute.argtypes = [c_void_p, c_char_p, c_int, c_int] + + self.lib.lammps_get_thermo.argtypes = [c_void_p, c_char_p] + self.lib.lammps_get_thermo.restype = c_double + + self.lib.lammps_encode_image_flags.restype = self.c_imageint + + self.lib.lammps_config_package_name.argtypes = [c_int, c_char_p, c_int] + + self.lib.lammps_has_style.argtypes = [c_void_p, c_char_p, c_char_p] + + self.lib.lammps_set_variable.argtypes = [c_void_p, c_char_p, c_char_p] + + self.lib.lammps_style_count.argtypes = [c_void_p, c_char_p] + + self.lib.lammps_style_name.argtypes = [c_void_p, c_char_p, c_int, c_char_p, c_int] + + self.lib.lammps_version.argtypes = [c_void_p] + + self.lib.lammps_get_mpi_comm.argtypes = [c_void_p] + + self.lib.lammps_decode_image_flags.argtypes = [self.c_imageint, POINTER(c_int*3)] + + self.lib.lammps_extract_atom.argtypes = [c_void_p, c_char_p] + self.lib.lammps_extract_atom_datatype.argtypes = [c_void_p, c_char_p] + self.lib.lammps_extract_atom_datatype.restype = c_int + + self.lib.lammps_extract_fix.argtypes = [c_void_p, c_char_p, c_int, c_int, c_int, c_int] + + self.lib.lammps_extract_variable.argtypes = [c_void_p, c_char_p, c_char_p] + + # TODO: NOT IMPLEMENTED IN PYTHON WRAPPER + self.lib.lammps_fix_external_set_energy_global = [c_void_p, c_char_p, c_double] + self.lib.lammps_fix_external_set_virial_global = [c_void_p, c_char_p, POINTER(c_double)] + + # detect if Python is using version of mpi4py that can pass a communicator + + self.has_mpi4py = False + try: + from mpi4py import __version__ as mpi4py_version + # tested to work with mpi4py versions 2 and 3 + self.has_mpi4py = mpi4py_version.split('.')[0] in ['2','3'] + except: + pass + # if no ptr provided, create an instance of LAMMPS # don't know how to pass an MPI communicator from PyPar # but we can pass an MPI communicator from mpi4py v2.0.0 and later @@ -224,17 +382,22 @@ class lammps(object): # with mpi4py v2, can pass MPI communicator to LAMMPS # need to adjust for type of MPI communicator object # allow for int (like MPICH) or void* (like OpenMPI) + if self.has_mpi4py and self.has_mpi_support: + from mpi4py import MPI + self.MPI = MPI if comm: - if not lammps.has_mpi4py: + if not self.has_mpi4py: raise Exception('Python mpi4py version is not 2 or 3') - if lammps.MPI._sizeof(lammps.MPI.Comm) == sizeof(c_int): + if not self.has_mpi_support: + raise Exception('LAMMPS not compiled with real MPI library') + if self.MPI._sizeof(self.MPI.Comm) == sizeof(c_int): MPI_Comm = c_int else: MPI_Comm = c_void_p narg = 0 - cargs = 0 + cargs = None if cmdargs: cmdargs.insert(0,"lammps.py") narg = len(cmdargs) @@ -243,22 +406,19 @@ class lammps(object): cmdargs[i] = cmdargs[i].encode() cargs = (c_char_p*narg)(*cmdargs) self.lib.lammps_open.argtypes = [c_int, c_char_p*narg, \ - MPI_Comm, c_void_p()] + MPI_Comm, c_void_p] else: - self.lib.lammps_open.argtypes = [c_int, c_int, \ - MPI_Comm, c_void_p()] + self.lib.lammps_open.argtypes = [c_int, c_char_p, \ + MPI_Comm, c_void_p] - self.lib.lammps_open.restype = None self.opened = 1 - self.lmp = c_void_p() - comm_ptr = lammps.MPI._addressof(comm) + comm_ptr = self.MPI._addressof(comm) comm_val = MPI_Comm.from_address(comm_ptr) - self.lib.lammps_open(narg,cargs,comm_val,byref(self.lmp)) + self.lmp = c_void_p(self.lib.lammps_open(narg,cargs,comm_val,None)) else: - if lammps.has_mpi4py: - from mpi4py import MPI - self.comm = MPI.COMM_WORLD + if self.has_mpi4py and self.has_mpi_support: + self.comm = self.MPI.COMM_WORLD self.opened = 1 if cmdargs: cmdargs.insert(0,"lammps.py") @@ -267,13 +427,12 @@ class lammps(object): if type(cmdargs[i]) is str: cmdargs[i] = cmdargs[i].encode() cargs = (c_char_p*narg)(*cmdargs) - self.lmp = c_void_p() - self.lib.lammps_open_no_mpi(narg,cargs,byref(self.lmp)) + self.lib.lammps_open_no_mpi.argtypes = [c_int, c_char_p*narg, \ + c_void_p] + self.lmp = c_void_p(self.lib.lammps_open_no_mpi(narg,cargs,None)) else: - self.lmp = c_void_p() - self.lib.lammps_open_no_mpi(0,None,byref(self.lmp)) - # could use just this if LAMMPS lib interface supported it - # self.lmp = self.lib.lammps_open_no_mpi(0,None) + self.lib.lammps_open_no_mpi.argtypes = [c_int, c_char_p, c_void_p] + self.lmp = c_void_p(self.lib.lammps_open_no_mpi(0,None,None)) else: # magic to convert ptr to ctypes ptr @@ -291,10 +450,6 @@ class lammps(object): # optional numpy support (lazy loading) self._numpy = None - # set default types - self.c_bigint = get_ctypes_int(self.extract_setting("bigint")) - self.c_tagint = get_ctypes_int(self.extract_setting("tagint")) - self.c_imageint = get_ctypes_int(self.extract_setting("imageint")) self._installed_packages = None self._available_styles = None @@ -304,6 +459,7 @@ class lammps(object): self.lib.lammps_set_fix_external_callback.argtypes = [c_void_p, c_char_p, self.FIX_EXTERNAL_CALLBACK_FUNC, py_object] self.lib.lammps_set_fix_external_callback.restype = None + # ------------------------------------------------------------------------- # shut-down LAMMPS instance def __del__(self): @@ -311,114 +467,11 @@ class lammps(object): self.lib.lammps_close(self.lmp) self.opened = 0 - def close(self): - if self.opened: self.lib.lammps_close(self.lmp) - self.lmp = None - self.opened = 0 - - def version(self): - return self.lib.lammps_version(self.lmp) - - def file(self,file): - if file: file = file.encode() - self.lib.lammps_file(self.lmp,file) - - # send a single command - - def command(self,cmd): - if cmd: cmd = cmd.encode() - self.lib.lammps_command(self.lmp,cmd) - - if self.has_exceptions and self.lib.lammps_has_error(self.lmp): - sb = create_string_buffer(100) - error_type = self.lib.lammps_get_last_error_message(self.lmp, sb, 100) - error_msg = sb.value.decode().strip() - - if error_type == 2: - raise MPIAbortException(error_msg) - raise Exception(error_msg) - - # send a list of commands - - def commands_list(self,cmdlist): - cmds = [x.encode() for x in cmdlist if type(x) is str] - args = (c_char_p * len(cmdlist))(*cmds) - self.lib.lammps_commands_list(self.lmp,len(cmdlist),args) - - # send a string of commands - - def commands_string(self,multicmd): - if type(multicmd) is str: multicmd = multicmd.encode() - self.lib.lammps_commands_string(self.lmp,c_char_p(multicmd)) - - # extract lammps type byte sizes - - def extract_setting(self, name): - if name: name = name.encode() - self.lib.lammps_extract_setting.restype = c_int - return int(self.lib.lammps_extract_setting(self.lmp,name)) - - # extract global info - - def extract_global(self,name,type): - if name: name = name.encode() - if type == LAMMPS_INT: - self.lib.lammps_extract_global.restype = POINTER(c_int) - elif type == LAMMPS_DOUBLE: - self.lib.lammps_extract_global.restype = POINTER(c_double) - elif type == LAMMPS_BIGINT: - self.lib.lammps_extract_global.restype = POINTER(self.c_bigint) - elif type == LAMMPS_TAGINT: - self.lib.lammps_extract_global.restype = POINTER(self.c_tagint) - else: return None - ptr = self.lib.lammps_extract_global(self.lmp,name) - return ptr[0] - - # extract global info - - def extract_box(self): - boxlo = (3*c_double)() - boxhi = (3*c_double)() - xy = c_double() - yz = c_double() - xz = c_double() - periodicity = (3*c_int)() - box_change = c_int() - - self.lib.lammps_extract_box(self.lmp,boxlo,boxhi, - byref(xy),byref(yz),byref(xz), - periodicity,byref(box_change)) - - boxlo = boxlo[:3] - boxhi = boxhi[:3] - xy = xy.value - yz = yz.value - xz = xz.value - periodicity = periodicity[:3] - box_change = box_change.value - - return boxlo,boxhi,xy,yz,xz,periodicity,box_change - - # extract per-atom info - # NOTE: need to insure are converting to/from correct Python type - # e.g. for Python list or NumPy or ctypes - - def extract_atom(self,name,type): - if name: name = name.encode() - if type == 0: - self.lib.lammps_extract_atom.restype = POINTER(c_int) - elif type == 1: - self.lib.lammps_extract_atom.restype = POINTER(POINTER(c_int)) - elif type == 2: - self.lib.lammps_extract_atom.restype = POINTER(c_double) - elif type == 3: - self.lib.lammps_extract_atom.restype = POINTER(POINTER(c_double)) - else: return None - ptr = self.lib.lammps_extract_atom(self.lmp,name) - return ptr + # ------------------------------------------------------------------------- @property def numpy(self): + "Convert between ctypes arrays and numpy arrays" if not self._numpy: import numpy as np class LammpsNumpyWrapper: @@ -432,7 +485,73 @@ class lammps(object): return np.int64 return np.intc + def extract_atom(self, name, dtype=LAMMPS_AUTODETECT, nelem=LAMMPS_AUTODETECT, dim=LAMMPS_AUTODETECT): + """Retrieve per-atom properties from LAMMPS as NumPy arrays + + This is a wrapper around the :cpp:func:`lammps_extract_atom` + function of the C-library interface. Its documentation includes a + list of the supported keywords and their data types. + Since Python needs to know the data type to be able to interpret + the result, by default, this function will try to auto-detect the data + type by asking the library. You can also force a specific data type. + For that purpose the :py:mod:`lammps` module contains the constants + ``LAMMPS_INT``, ``LAMMPS_INT_2D``, ``LAMMPS_DOUBLE``, + ``LAMMPS_DOUBLE_2D``, ``LAMMPS_INT64``, ``LAMMPS_INT64_2D``, and + ``LAMMPS_STRING``. + This function returns ``None`` if either the keyword is not + recognized, or an invalid data type constant is used. + + .. note:: + + While the returned arrays of per-atom data are dimensioned + for the range [0:nmax] - as is the underlying storage - + the data is usually only valid for the range of [0:nlocal], + unless the property of interest is also updated for ghost + atoms. In some cases, this depends on a LAMMPS setting, see + for example :doc:`comm_modify vel yes `. + + :param name: name of the property + :type name: string + :param dtype: type of the returned data (see :ref:`py_data_constants`) + :type dtype: int, optional + :param nelem: number of elements in array + :type nelem: int, optional + :param dim: dimension of each element + :type dim: int, optional + :return: requested data as NumPy array with direct access to C data + :rtype: numpy.array + """ + if dtype == LAMMPS_AUTODETECT: + dtype = self.lmp.extract_atom_datatype(name) + + if nelem == LAMMPS_AUTODETECT: + if name == "mass": + nelem = self.lmp.extract_global("ntypes") + 1 + else: + nelem = self.lmp.extract_global("nlocal") + if dim == LAMMPS_AUTODETECT: + if dtype in (LAMMPS_INT_2D, LAMMPS_DOUBLE_2D, LAMMPS_INT64_2D): + # TODO add other fields + if name in ("x", "v", "f", "angmom", "torque", "csforce", "vforce"): + dim = 3 + else: + dim = 2 + else: + dim = 1 + + raw_ptr = self.lmp.extract_atom(name, dtype) + + if dtype in (LAMMPS_DOUBLE, LAMMPS_DOUBLE_2D): + return self.darray(raw_ptr, nelem, dim) + elif dtype in (LAMMPS_INT, LAMMPS_INT_2D): + return self.iarray(c_int32, raw_ptr, nelem, dim) + elif dtype in (LAMMPS_INT64, LAMMPS_INT64_2D): + return self.iarray(c_int64, raw_ptr, nelem, dim) + return raw_ptr + def extract_atom_iarray(self, name, nelem, dim=1): + warnings.warn("deprecated, use extract_atom instead", DeprecationWarning) + if name in ['id', 'molecule']: c_int_type = self.lmp.c_tagint elif name in ['image']: @@ -441,20 +560,69 @@ class lammps(object): c_int_type = c_int if dim == 1: - raw_ptr = self.lmp.extract_atom(name, 0) + raw_ptr = self.lmp.extract_atom(name, LAMMPS_INT) else: - raw_ptr = self.lmp.extract_atom(name, 1) + raw_ptr = self.lmp.extract_atom(name, LAMMPS_INT_2D) return self.iarray(c_int_type, raw_ptr, nelem, dim) def extract_atom_darray(self, name, nelem, dim=1): + warnings.warn("deprecated, use extract_atom instead", DeprecationWarning) + if dim == 1: - raw_ptr = self.lmp.extract_atom(name, 2) + raw_ptr = self.lmp.extract_atom(name, LAMMPS_DOUBLE) else: - raw_ptr = self.lmp.extract_atom(name, 3) + raw_ptr = self.lmp.extract_atom(name, LAMMPS_DOUBLE_2D) return self.darray(raw_ptr, nelem, dim) + def extract_compute(self, cid, style, datatype): + value = self.lmp.extract_compute(cid, style, datatype) + + if style in (LMP_STYLE_GLOBAL, LMP_STYLE_LOCAL): + if datatype == LMP_TYPE_VECTOR: + nrows = self.lmp.extract_compute(cid, style, LMP_SIZE_VECTOR) + return self.darray(value, nrows) + elif datatype == LMP_TYPE_ARRAY: + nrows = self.lmp.extract_compute(cid, style, LMP_SIZE_ROWS) + ncols = self.lmp.extract_compute(cid, style, LMP_SIZE_COLS) + return self.darray(value, nrows, ncols) + elif style == LMP_STYLE_ATOM: + if datatype == LMP_TYPE_VECTOR: + nlocal = self.lmp.extract_global("nlocal", LAMMPS_INT) + return self.darray(value, nlocal) + elif datatype == LMP_TYPE_ARRAY: + nlocal = self.lmp.extract_global("nlocal", LAMMPS_INT) + ncols = self.lmp.extract_compute(cid, style, LMP_SIZE_COLS) + return self.darray(value, nlocal, ncols) + return value + + def extract_fix(self, fid, style, datatype, nrow=0, ncol=0): + value = self.lmp.extract_fix(fid, style, datatype, nrow, ncol) + if style == LMP_STYLE_ATOM: + if datatype == LMP_TYPE_VECTOR: + nlocal = self.lmp.extract_global("nlocal", LAMMPS_INT) + return self.darray(value, nlocal) + elif datatype == LMP_TYPE_ARRAY: + nlocal = self.lmp.extract_global("nlocal", LAMMPS_INT) + ncols = self.lmp.extract_fix(fid, style, LMP_SIZE_COLS, 0, 0) + return self.darray(value, nlocal, ncols) + elif style == LMP_STYLE_LOCAL: + if datatype == LMP_TYPE_VECTOR: + nrows = self.lmp.extract_fix(fid, style, LMP_SIZE_ROWS, 0, 0) + return self.darray(value, nrows) + elif datatype == LMP_TYPE_ARRAY: + nrows = self.lmp.extract_fix(fid, style, LMP_SIZE_ROWS, 0, 0) + ncols = self.lmp.extract_fix(fid, style, LMP_SIZE_COLS, 0, 0) + return self.darray(value, nrows, ncols) + return value + + def extract_variable(self, name, group=None, datatype=LMP_VAR_EQUAL): + value = self.lmp.extract_variable(name, group, datatype) + if datatype == LMP_VAR_ATOM: + return np.ctypeslib.as_array(value) + return value + def iarray(self, c_int_type, raw_ptr, nelem, dim=1): np_int_type = self._ctype_to_numpy_int(c_int_type) @@ -480,74 +648,599 @@ class lammps(object): self._numpy = LammpsNumpyWrapper(self) return self._numpy - # extract compute info + # ------------------------------------------------------------------------- + + def close(self): + """Explicitly delete a LAMMPS instance through the C-library interface. + + This is a wrapper around the :cpp:func:`lammps_close` function of the C-library interface. + """ + if self.opened: self.lib.lammps_close(self.lmp) + self.lmp = None + self.opened = 0 + + # ------------------------------------------------------------------------- + + def finalize(self): + """Shut down the MPI communication through the library interface by calling :cpp:func:`lammps_finalize`. + """ + if self.opened: self.lib.lammps_close(self.lmp) + self.lmp = None + self.opened = 0 + self.lib.lammps_finalize() + + # ------------------------------------------------------------------------- + + def version(self): + """Return a numerical representation of the LAMMPS version in use. + + This is a wrapper around the :cpp:func:`lammps_version` function of the C-library interface. + + :return: version number + :rtype: int + """ + return self.lib.lammps_version(self.lmp) + + # ------------------------------------------------------------------------- + + def get_mpi_comm(self): + """Get the MPI communicator in use by the current LAMMPS instance + + This is a wrapper around the :cpp:func:`lammps_get_mpi_comm` function + of the C-library interface. It will return ``None`` if either the + LAMMPS library was compiled without MPI support or the mpi4py + Python module is not available. + + :return: MPI communicator + :rtype: MPI_Comm + """ + + if self.has_mpi4py and self.has_mpi_support: + from mpi4py import MPI + f_comm = self.lib.lammps_get_mpi_comm(self.lmp) + c_comm = MPI.Comm.f2py(f_comm) + return c_comm + else: + return None + + # ------------------------------------------------------------------------- + + def file(self, path): + """Read LAMMPS commands from a file. + + This is a wrapper around the :cpp:func:`lammps_file` function of the C-library interface. + It will open the file with the name/path `file` and process the LAMMPS commands line by line until + the end. The function will return when the end of the file is reached. + + :param path: Name of the file/path with LAMMPS commands + :type path: string + """ + if path: path = path.encode() + else: return + self.lib.lammps_file(self.lmp, path) + + # ------------------------------------------------------------------------- + + def command(self,cmd): + """Process a single LAMMPS input command from a string. + + This is a wrapper around the :cpp:func:`lammps_command` + function of the C-library interface. + + :param cmd: a single lammps command + :type cmd: string + """ + if cmd: cmd = cmd.encode() + else: return + self.lib.lammps_command(self.lmp,cmd) + + if self.has_exceptions and self.lib.lammps_has_error(self.lmp): + sb = create_string_buffer(100) + error_type = self.lib.lammps_get_last_error_message(self.lmp, sb, 100) + error_msg = sb.value.decode().strip() + + if error_type == 2: + raise MPIAbortException(error_msg) + raise Exception(error_msg) + + # ------------------------------------------------------------------------- + + def commands_list(self,cmdlist): + """Process multiple LAMMPS input commands from a list of strings. + + This is a wrapper around the + :cpp:func:`lammps_commands_list` function of + the C-library interface. + + :param cmdlist: a single lammps command + :type cmdlist: list of strings + """ + cmds = [x.encode() for x in cmdlist if type(x) is str] + narg = len(cmdlist) + args = (c_char_p * narg)(*cmds) + self.lib.lammps_commands_list.argtypes = [c_void_p, c_int, c_char_p * narg] + self.lib.lammps_commands_list(self.lmp,narg,args) + + # ------------------------------------------------------------------------- + + def commands_string(self,multicmd): + """Process a block of LAMMPS input commands from a string. + + This is a wrapper around the + :cpp:func:`lammps_commands_string` + function of the C-library interface. + + :param multicmd: text block of lammps commands + :type multicmd: string + """ + if type(multicmd) is str: multicmd = multicmd.encode() + self.lib.lammps_commands_string(self.lmp,c_char_p(multicmd)) + + # ------------------------------------------------------------------------- + + def get_natoms(self): + """Get the total number of atoms in the LAMMPS instance. + + Will be precise up to 53-bit signed integer due to the + underlying :cpp:func:`lammps_get_natoms` function returning a double. + + :return: number of atoms + :rtype: int + """ + return int(self.lib.lammps_get_natoms(self.lmp)) + + # ------------------------------------------------------------------------- + + def extract_box(self): + """Extract simulation box parameters + + This is a wrapper around the :cpp:func:`lammps_extract_box` function + of the C-library interface. Unlike in the C function, the result is + returned as a list. + + :return: list of the extracted data: boxlo, boxhi, xy, yz, xz, periodicity, box_change + :rtype: [ 3*double, 3*double, double, double, 3*int, int] + """ + boxlo = (3*c_double)() + boxhi = (3*c_double)() + xy = c_double() + yz = c_double() + xz = c_double() + periodicity = (3*c_int)() + box_change = c_int() + + self.lib.lammps_extract_box(self.lmp,boxlo,boxhi, + byref(xy),byref(yz),byref(xz), + periodicity,byref(box_change)) + + boxlo = boxlo[:3] + boxhi = boxhi[:3] + xy = xy.value + yz = yz.value + xz = xz.value + periodicity = periodicity[:3] + box_change = box_change.value + + return boxlo,boxhi,xy,yz,xz,periodicity,box_change + + # ------------------------------------------------------------------------- + + def reset_box(self,boxlo,boxhi,xy,yz,xz): + """Reset simulation box parameters + + This is a wrapper around the :cpp:func:`lammps_reset_box` function + of the C-library interface. + + :param boxlo: new lower box boundaries + :type boxlo: list of 3 floating point numbers + :param boxhi: new upper box boundaries + :type boxhi: list of 3 floating point numbers + :param xy: xy tilt factor + :type xy: float + :param yz: yz tilt factor + :type yz: float + :param xz: xz tilt factor + :type xz: float + """ + cboxlo = (3*c_double)(*boxlo) + cboxhi = (3*c_double)(*boxhi) + self.lib.lammps_reset_box(self.lmp,cboxlo,cboxhi,xy,yz,xz) + + # ------------------------------------------------------------------------- + + def get_thermo(self,name): + """Get current value of a thermo keyword + + This is a wrapper around the :cpp:func:`lammps_get_thermo` + function of the C-library interface. + + :param name: name of thermo keyword + :type name: string + :return: value of thermo keyword + :rtype: double or None + """ + if name: name = name.encode() + else: return None + return self.lib.lammps_get_thermo(self.lmp,name) + + # ------------------------------------------------------------------------- + + def extract_setting(self, name): + """Query LAMMPS about global settings that can be expressed as an integer. + + This is a wrapper around the :cpp:func:`lammps_extract_setting` + function of the C-library interface. Its documentation includes + a list of the supported keywords. + + :param name: name of the setting + :type name: string + :return: value of the setting + :rtype: int + """ + if name: name = name.encode() + else: return None + return int(self.lib.lammps_extract_setting(self.lmp,name)) + + # ------------------------------------------------------------------------- + # extract global info datatype + + def extract_global_datatype(self, name): + """Retrieve global property datatype from LAMMPS + + This is a wrapper around the :cpp:func:`lammps_extract_global_datatype` + function of the C-library interface. Its documentation includes a + list of the supported keywords. + This function returns ``None`` if the keyword is not + recognized. Otherwise it will return a positive integer value that + corresponds to one of the constants define in the :py:mod:`lammps` module: + ``LAMMPS_INT``, ``LAMMPS_INT_2D``, ``LAMMPS_DOUBLE``, ``LAMMPS_DOUBLE_2D``, + ``LAMMPS_INT64``, ``LAMMPS_INT64_2D``, and ``LAMMPS_STRING``. These values + are equivalent to the ones defined in :cpp:enum:`_LMP_DATATYPE_CONST`. + + :param name: name of the property + :type name: string + :return: datatype of global property + :rtype: int + """ + if name: name = name.encode() + else: return None + return self.lib.lammps_extract_global_datatype(self.lmp, name) + + # ------------------------------------------------------------------------- + # extract global info + + def extract_global(self, name, dtype=LAMMPS_AUTODETECT): + """Query LAMMPS about global settings of different types. + + This is a wrapper around the :cpp:func:`lammps_extract_global` + function of the C-library interface. Unlike the C function + this method returns the value and not a pointer and thus can + only return the first value for keywords representing a list + of values. The :cpp:func:`lammps_extract_global` documentation + includes a list of the supported keywords and their data types. + Since Python needs to know the data type to be able to interpret + the result, by default, this function will try to auto-detect the data type + by asking the library. You can also force a specific data type. For that + purpose the :py:mod:`lammps` module contains the constants ``LAMMPS_INT``, + ``LAMMPS_DOUBLE``, ``LAMMPS_INT64``, and ``LAMMPS_STRING``. These values + are equivalent to the ones defined in :cpp:enum:`_LMP_DATATYPE_CONST`. + This function returns ``None`` if either the keyword is not recognized, + or an invalid data type constant is used. + + :param name: name of the property + :type name: string + :param dtype: data type of the returned data (see :ref:`py_data_constants`) + :type dtype: int, optional + :return: value of the property or None + :rtype: int, float, or NoneType + """ + if dtype == LAMMPS_AUTODETECT: + dtype = self.extract_global_datatype(name) + + if name: name = name.encode() + else: return None + + if dtype == LAMMPS_INT: + self.lib.lammps_extract_global.restype = POINTER(c_int32) + target_type = int + elif dtype == LAMMPS_INT64: + self.lib.lammps_extract_global.restype = POINTER(c_int64) + target_type = int + elif dtype == LAMMPS_DOUBLE: + self.lib.lammps_extract_global.restype = POINTER(c_double) + target_type = float + elif dtype == LAMMPS_STRING: + self.lib.lammps_extract_global.restype = c_char_p + target_type = lambda x: str(x, 'ascii') + + ptr = self.lib.lammps_extract_global(self.lmp, name) + if ptr: + return target_type(ptr[0]) + return None + + + # ------------------------------------------------------------------------- + # extract per-atom info datatype + + def extract_atom_datatype(self, name): + """Retrieve per-atom property datatype from LAMMPS + + This is a wrapper around the :cpp:func:`lammps_extract_atom_datatype` + function of the C-library interface. Its documentation includes a + list of the supported keywords. + This function returns ``None`` if the keyword is not + recognized. Otherwise it will return an integer value that + corresponds to one of the constants define in the :py:mod:`lammps` module: + ``LAMMPS_INT``, ``LAMMPS_INT_2D``, ``LAMMPS_DOUBLE``, ``LAMMPS_DOUBLE_2D``, + ``LAMMPS_INT64``, ``LAMMPS_INT64_2D``, and ``LAMMPS_STRING``. These values + are equivalent to the ones defined in :cpp:enum:`_LMP_DATATYPE_CONST`. + + :param name: name of the property + :type name: string + :return: data type of per-atom property (see :ref:`py_data_constants`) + :rtype: int + """ + if name: name = name.encode() + else: return None + return self.lib.lammps_extract_atom_datatype(self.lmp, name) + + # ------------------------------------------------------------------------- + # extract per-atom info + + def extract_atom(self, name, dtype=LAMMPS_AUTODETECT): + """Retrieve per-atom properties from LAMMPS + + This is a wrapper around the :cpp:func:`lammps_extract_atom` + function of the C-library interface. Its documentation includes a + list of the supported keywords and their data types. + Since Python needs to know the data type to be able to interpret + the result, by default, this function will try to auto-detect the data type + by asking the library. You can also force a specific data type. For + that purpose the :py:mod:`lammps` module contains the constants + ``LAMMPS_INT``, ``LAMMPS_INT_2D``, ``LAMMPS_DOUBLE``, ``LAMMPS_DOUBLE_2D``, + ``LAMMPS_INT64``, ``LAMMPS_INT64_2D``, and ``LAMMPS_STRING``. These values + are equivalent to the ones defined in :cpp:enum:`_LMP_DATATYPE_CONST`. + This function returns ``None`` if either the keyword is not + recognized, or an invalid data type constant is used. + + .. note:: + + While the returned arrays of per-atom data are dimensioned + for the range [0:nmax] - as is the underlying storage - + the data is usually only valid for the range of [0:nlocal], + unless the property of interest is also updated for ghost + atoms. In some cases, this depends on a LAMMPS setting, see + for example :doc:`comm_modify vel yes `. + + :param name: name of the property + :type name: string + :param dtype: data type of the returned data (see :ref:`py_data_constants`) + :type dtype: int, optional + :return: requested data or ``None`` + :rtype: ctypes.POINTER(ctypes.c_int32), ctypes.POINTER(ctypes.POINTER(ctypes.c_int32)), + ctypes.POINTER(ctypes.c_int64), ctypes.POINTER(ctypes.POINTER(ctypes.c_int64)), + ctypes.POINTER(ctypes.c_double), ctypes.POINTER(ctypes.POINTER(ctypes.c_double)), + or NoneType + """ + if dtype == LAMMPS_AUTODETECT: + dtype = self.extract_atom_datatype(name) + + if name: name = name.encode() + else: return None + + if dtype == LAMMPS_INT: + self.lib.lammps_extract_atom.restype = POINTER(c_int32) + elif dtype == LAMMPS_INT_2D: + self.lib.lammps_extract_atom.restype = POINTER(POINTER(c_int32)) + elif dtype == LAMMPS_DOUBLE: + self.lib.lammps_extract_atom.restype = POINTER(c_double) + elif dtype == LAMMPS_DOUBLE_2D: + self.lib.lammps_extract_atom.restype = POINTER(POINTER(c_double)) + elif dtype == LAMMPS_INT64: + self.lib.lammps_extract_atom.restype = POINTER(c_int64) + elif dtype == LAMMPS_INT64_2D: + self.lib.lammps_extract_atom.restype = POINTER(POINTER(c_int64)) + else: return None + ptr = self.lib.lammps_extract_atom(self.lmp, name) + if ptr: return ptr + else: return None + + + # ------------------------------------------------------------------------- def extract_compute(self,id,style,type): + """Retrieve data from a LAMMPS compute + + This is a wrapper around the :cpp:func:`lammps_extract_compute` + function of the C-library interface. + This function returns ``None`` if either the compute id is not + recognized, or an invalid combination of :ref:`style ` + and :ref:`type ` constants is used. The + names and functionality of the constants are the same as for + the corresponding C-library function. For requests to return + a scalar or a size, the value is returned, otherwise a pointer. + + :param id: compute ID + :type id: string + :param style: style of the data retrieve (global, atom, or local) + :type style: int + :param type: type or size of the returned data (scalar, vector, or array) + :type type: int + :return: requested data + :rtype: integer or double or pointer to 1d or 2d double array or None + """ if id: id = id.encode() - if type == 0: - if style == 0: + else: return None + + if type == LMP_TYPE_SCALAR: + if style == LMP_STYLE_GLOBAL: self.lib.lammps_extract_compute.restype = POINTER(c_double) ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) return ptr[0] - elif style == 1: + elif style == LMP_STYLE_ATOM: return None - elif style == 2: + elif style == LMP_STYLE_LOCAL: self.lib.lammps_extract_compute.restype = POINTER(c_int) ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) return ptr[0] - if type == 1: + + if type == LMP_TYPE_VECTOR: self.lib.lammps_extract_compute.restype = POINTER(c_double) ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) return ptr - if type == 2: + + if type == LMP_TYPE_ARRAY: self.lib.lammps_extract_compute.restype = POINTER(POINTER(c_double)) ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) return ptr + + if type == LMP_SIZE_COLS: + if style == LMP_STYLE_GLOBAL \ + or style == LMP_STYLE_ATOM \ + or style == LMP_STYLE_LOCAL: + self.lib.lammps_extract_compute.restype = POINTER(c_int) + ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) + return ptr[0] + + if type == LMP_SIZE_VECTOR \ + or type == LMP_SIZE_ROWS: + if style == LMP_STYLE_GLOBAL \ + or style == LMP_STYLE_LOCAL: + self.lib.lammps_extract_compute.restype = POINTER(c_int) + ptr = self.lib.lammps_extract_compute(self.lmp,id,style,type) + return ptr[0] + return None + # ------------------------------------------------------------------------- # extract fix info - # in case of global datum, free memory for 1 double via lammps_free() + # in case of global data, free memory for 1 double via lammps_free() # double was allocated by library interface function - def extract_fix(self,id,style,type,i=0,j=0): + def extract_fix(self,id,style,type,nrow=0,ncol=0): + """Retrieve data from a LAMMPS fix + + This is a wrapper around the :cpp:func:`lammps_extract_fix` + function of the C-library interface. + This function returns ``None`` if either the fix id is not + recognized, or an invalid combination of :ref:`style ` + and :ref:`type ` constants is used. The + names and functionality of the constants are the same as for + the corresponding C-library function. For requests to return + a scalar or a size, the value is returned, also when accessing + global vectors or arrays, otherwise a pointer. + + :param id: fix ID + :type id: string + :param style: style of the data retrieve (global, atom, or local) + :type style: int + :param type: type or size of the returned data (scalar, vector, or array) + :type type: int + :param nrow: index of global vector element or row index of global array element + :type nrow: int + :param ncol: column index of global array element + :type ncol: int + :return: requested data + :rtype: integer or double value, pointer to 1d or 2d double array or None + + """ if id: id = id.encode() - if style == 0: - self.lib.lammps_extract_fix.restype = POINTER(c_double) - ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,i,j) - result = ptr[0] - self.lib.lammps_free(ptr) - return result - elif (style == 2) and (type == 0): - self.lib.lammps_extract_fix.restype = POINTER(c_int) - ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,i,j) - return ptr[0] - elif (style == 1) or (style == 2): - if type == 1: + else: return None + + if style == LMP_STYLE_GLOBAL: + if type == LMP_TYPE_SCALAR \ + or type == LMP_TYPE_VECTOR \ + or type == LMP_TYPE_ARRAY: self.lib.lammps_extract_fix.restype = POINTER(c_double) - elif type == 2: - self.lib.lammps_extract_fix.restype = POINTER(POINTER(c_double)) + ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,nrow,ncol) + result = ptr[0] + self.lib.lammps_free(ptr) + return result + elif type == LMP_SIZE_VECTOR \ + or type == LMP_SIZE_ROWS \ + or type == LMP_SIZE_COLS: + self.lib.lammps_extract_fix.restype = POINTER(c_int) + ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,nrow,ncol) + return ptr[0] else: return None - ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,i,j) - return ptr + + elif style == LMP_STYLE_ATOM: + if type == LMP_TYPE_VECTOR: + self.lib.lammps_extract_fix.restype = POINTER(c_double) + elif type == LMP_TYPE_ARRAY: + self.lib.lammps_extract_fix.restype = POINTER(POINTER(c_double)) + elif type == LMP_SIZE_COLS: + self.lib.lammps_extract_fix.restype = POINTER(c_int) + else: + return None + ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,nrow,ncol) + if type == LMP_SIZE_COLS: + return ptr[0] + else: + return ptr + + elif style == LMP_STYLE_LOCAL: + if type == LMP_TYPE_VECTOR: + self.lib.lammps_extract_fix.restype = POINTER(c_double) + elif type == LMP_TYPE_ARRAY: + self.lib.lammps_extract_fix.restype = POINTER(POINTER(c_double)) + elif type == LMP_TYPE_SCALAR \ + or type == LMP_SIZE_VECTOR \ + or type == LMP_SIZE_ROWS \ + or type == LMP_SIZE_COLS: + self.lib.lammps_extract_fix.restype = POINTER(c_int) + else: + return None + ptr = self.lib.lammps_extract_fix(self.lmp,id,style,type,nrow,ncol) + if type == LMP_TYPE_VECTOR or type == LMP_TYPE_ARRAY: + return ptr + else: + return ptr[0] else: return None + # ------------------------------------------------------------------------- # extract variable info # free memory for 1 double or 1 vector of doubles via lammps_free() # for vector, must copy nlocal returned values to local c_double vector # memory was allocated by library interface function - def extract_variable(self,name,group,type): + def extract_variable(self,name,group=None,type=LMP_VAR_EQUAL): + """ Evaluate a LAMMPS variable and return its data + + This function is a wrapper around the function + :cpp:func:`lammps_extract_variable` of the C-library interface, + evaluates variable name and returns a copy of the computed data. + The memory temporarily allocated by the C-interface is deleted + after the data is copied to a python variable or list. + The variable must be either an equal-style (or equivalent) + variable or an atom-style variable. The variable type has to + provided as type parameter which may be two constants: + ``LMP_VAR_EQUAL`` or ``LMP_VAR_STRING``; it defaults to + equal-style variables. + The group parameter is only used for atom-style variables and + defaults to the group "all" if set to ``None``, which is the default. + + :param name: name of the variable to execute + :type name: string + :param group: name of group for atom style variable + :type group: string + :param type: type of variable + :type type: int + :return: the requested data + :rtype: double, array of doubles, or None + """ if name: name = name.encode() + else: return None if group: group = group.encode() - if type == 0: + if type == LMP_VAR_EQUAL: self.lib.lammps_extract_variable.restype = POINTER(c_double) ptr = self.lib.lammps_extract_variable(self.lmp,name,group) result = ptr[0] self.lib.lammps_free(ptr) return result - if type == 1: + if type == LMP_VAR_ATOM: self.lib.lammps_extract_global.restype = POINTER(c_int) nlocalptr = self.lib.lammps_extract_global(self.lmp,"nlocal".encode()) nlocal = nlocalptr[0] @@ -559,33 +1252,28 @@ class lammps(object): return result return None - # return current value of thermo keyword - - def get_thermo(self,name): - if name: name = name.encode() - self.lib.lammps_get_thermo.restype = c_double - return self.lib.lammps_get_thermo(self.lmp,name) - - # return total number of atoms in system - - def get_natoms(self): - return self.lib.lammps_get_natoms(self.lmp) - - # set variable value - # value is converted to string - # returns 0 for success, -1 if failed + # ------------------------------------------------------------------------- def set_variable(self,name,value): + """Set a new value for a LAMMPS string style variable + + This is a wrapper around the :cpp:func:`lammps_set_variable` + function of the C-library interface. + + :param name: name of the variable + :type name: string + :param value: new variable value + :type value: any. will be converted to a string + :return: either 0 on success or -1 on failure + :rtype: int + """ if name: name = name.encode() + else: return -1 if value: value = str(value).encode() + else: return -1 return self.lib.lammps_set_variable(self.lmp,name,value) - # reset simulation box size - - def reset_box(self,boxlo,boxhi,xy,yz,xz): - cboxlo = (3*c_double)(*boxlo) - cboxhi = (3*c_double)(*boxhi) - self.lib.lammps_reset_box(self.lmp,cboxlo,cboxhi,xy,yz,xz) + # ------------------------------------------------------------------------- # return vector of atom properties gathered across procs # 3 variants to match src/library.cpp @@ -598,7 +1286,7 @@ class lammps(object): def gather_atoms(self,name,type,count): if name: name = name.encode() - natoms = self.lib.lammps_get_natoms(self.lmp) + natoms = self.get_natoms() if type == 0: data = ((count*natoms)*c_int)() self.lib.lammps_gather_atoms(self.lmp,name,type,count,data) @@ -608,9 +1296,11 @@ class lammps(object): else: return None return data + # ------------------------------------------------------------------------- + def gather_atoms_concat(self,name,type,count): if name: name = name.encode() - natoms = self.lib.lammps_get_natoms(self.lmp) + natoms = self.get_natoms() if type == 0: data = ((count*natoms)*c_int)() self.lib.lammps_gather_atoms_concat(self.lmp,name,type,count,data) @@ -631,6 +1321,8 @@ class lammps(object): else: return None return data + # ------------------------------------------------------------------------- + # scatter vector of atom properties across procs # 2 variants to match src/library.cpp # name = atom property recognized by LAMMPS in atom->extract() @@ -644,10 +1336,113 @@ class lammps(object): if name: name = name.encode() self.lib.lammps_scatter_atoms(self.lmp,name,type,count,data) + # ------------------------------------------------------------------------- + def scatter_atoms_subset(self,name,type,count,ndata,ids,data): if name: name = name.encode() self.lib.lammps_scatter_atoms_subset(self.lmp,name,type,count,ndata,ids,data) + # return vector of atom/compute/fix properties gathered across procs + # 3 variants to match src/library.cpp + # name = atom property recognized by LAMMPS in atom->extract() + # type = 0 for integer values, 1 for double values + # count = number of per-atom valus, 1 for type or charge, 3 for x or f + # returned data is a 1d vector - doc how it is ordered? + # NOTE: need to insure are converting to/from correct Python type + # e.g. for Python list or NumPy or ctypes + def gather(self,name,type,count): + if name: name = name.encode() + natoms = self.get_natoms() + if type == 0: + data = ((count*natoms)*c_int)() + self.lib.lammps_gather(self.lmp,name,type,count,data) + elif type == 1: + data = ((count*natoms)*c_double)() + self.lib.lammps_gather(self.lmp,name,type,count,data) + else: return None + return data + + def gather_concat(self,name,type,count): + if name: name = name.encode() + natoms = self.get_natoms() + if type == 0: + data = ((count*natoms)*c_int)() + self.lib.lammps_gather_concat(self.lmp,name,type,count,data) + elif type == 1: + data = ((count*natoms)*c_double)() + self.lib.lammps_gather_concat(self.lmp,name,type,count,data) + else: return None + return data + + def gather_subset(self,name,type,count,ndata,ids): + if name: name = name.encode() + if type == 0: + data = ((count*ndata)*c_int)() + self.lib.lammps_gather_subset(self.lmp,name,type,count,ndata,ids,data) + elif type == 1: + data = ((count*ndata)*c_double)() + self.lib.lammps_gather_subset(self.lmp,name,type,count,ndata,ids,data) + else: return None + return data + + # scatter vector of atom/compute/fix properties across procs + # 2 variants to match src/library.cpp + # name = atom property recognized by LAMMPS in atom->extract() + # type = 0 for integer values, 1 for double values + # count = number of per-atom valus, 1 for type or charge, 3 for x or f + # assume data is of correct type and length, as created by gather_atoms() + # NOTE: need to insure are converting to/from correct Python type + # e.g. for Python list or NumPy or ctypes + + def scatter(self,name,type,count,data): + if name: name = name.encode() + self.lib.lammps_scatter(self.lmp,name,type,count,data) + + def scatter_subset(self,name,type,count,ndata,ids,data): + if name: name = name.encode() + self.lib.lammps_scatter_subset(self.lmp,name,type,count,ndata,ids,data) + + # ------------------------------------------------------------------------- + + def encode_image_flags(self,ix,iy,iz): + """ convert 3 integers with image flags for x-, y-, and z-direction + into a single integer like it is used internally in LAMMPS + + This method is a wrapper around the :cpp:func:`lammps_encode_image_flags` + function of library interface. + + :param ix: x-direction image flag + :type ix: int + :param iy: y-direction image flag + :type iy: int + :param iz: z-direction image flag + :type iz: int + :return: encoded image flags + :rtype: lammps.c_imageint + """ + return self.lib.lammps_encode_image_flags(ix,iy,iz) + + # ------------------------------------------------------------------------- + + def decode_image_flags(self,image): + """ Convert encoded image flag integer into list of three regular integers. + + This method is a wrapper around the :cpp:func:`lammps_decode_image_flags` + function of library interface. + + :param image: encoded image flags + :type image: lammps.c_imageint + :return: list of three image flags in x-, y-, and z- direction + :rtype: list of 3 int + """ + + flags = (c_int*3)() + self.lib.lammps_decode_image_flags(image,byref(flags)) + + return [int(i) for i in flags] + + # ------------------------------------------------------------------------- + # create N atoms on all procs # N = global number of atoms # id = ID of each atom (optional, can be None) @@ -658,47 +1453,192 @@ class lammps(object): # e.g. for Python list or NumPy, etc # ditto for gather_atoms() above - def create_atoms(self,n,id,type,x,v,image=None,shrinkexceed=False): + def create_atoms(self,n,id,type,x,v=None,image=None,shrinkexceed=False): + """ + Create N atoms from list of coordinates and properties + + This function is a wrapper around the :cpp:func:`lammps_create_atoms` + function of the C-library interface, and the behavior is similar except + that the *v*, *image*, and *shrinkexceed* arguments are optional and + default to *None*, *None*, and *False*, respectively. With none being + equivalent to a ``NULL`` pointer in C. + + The lists of coordinates, types, atom IDs, velocities, image flags can + be provided in any format that may be converted into the required + internal data types. Also the list may contain more than *N* entries, + but not fewer. In the latter case, the function will return without + attempting to create atoms. You may use the :py:func:`encode_image_flags + ` method to properly combine three integers + with image flags into a single integer. + + :param n: number of atoms for which data is provided + :type n: int + :param id: list of atom IDs with at least n elements or None + :type id: list of lammps.tagint + :param type: list of atom types + :type type: list of int + :param x: list of coordinates for x-, y-, and z (flat list of 3n entries) + :type x: list of float + :param v: list of velocities for x-, y-, and z (flat list of 3n entries) or None (optional) + :type v: list of float + :param image: list of encoded image flags (optional) + :type image: list of lammps.imageint + :param shrinkexceed: whether to expand shrink-wrap boundaries if atoms are outside the box (optional) + :type shrinkexceed: bool + :return: number of atoms created. 0 if insufficient or invalid data + :rtype: int + """ if id: - id_lmp = (c_int * n)() - id_lmp[:] = id + id_lmp = (self.c_tagint*n)() + try: + id_lmp[:] = id[0:n] + except: + return 0 else: - id_lmp = id + id_lmp = None + + type_lmp = (c_int*n)() + try: + type_lmp[:] = type[0:n] + except: + return 0 + + three_n = 3*n + x_lmp = (c_double*three_n)() + try: + x_lmp[:] = x[0:three_n] + except: + return 0 + + if v: + v_lmp = (c_double*(three_n))() + try: + v_lmp[:] = v[0:three_n] + except: + return 0 + else: + v_lmp = None if image: - image_lmp = (c_int * n)() - image_lmp[:] = image + img_lmp = (self.c_imageint*n)() + try: + img_lmp[:] = image[0:n] + except: + return 0 else: - image_lmp = image + img_lmp = None - type_lmp = (c_int * n)() - type_lmp[:] = type - self.lib.lammps_create_atoms(self.lmp,n,id_lmp,type_lmp,x,v,image_lmp, - shrinkexceed) + if shrinkexceed: + se_lmp = 1 + else: + se_lmp = 0 + + self.lib.lammps_create_atoms.argtypes = [c_void_p, c_int, POINTER(self.c_tagint*n), + POINTER(c_int*n), POINTER(c_double*three_n), + POINTER(c_double*three_n), + POINTER(self.c_imageint*n), c_int] + return self.lib.lammps_create_atoms(self.lmp, n, id_lmp, type_lmp, x_lmp, v_lmp, img_lmp, se_lmp) + + # ------------------------------------------------------------------------- + + @property + def has_mpi_support(self): + """ Report whether the LAMMPS shared library was compiled with a + real MPI library or in serial. + + This is a wrapper around the :cpp:func:`lammps_config_has_mpi_support` + function of the library interface. + + :return: False when compiled with MPI STUBS, otherwise True + :rtype: bool + """ + return self.lib.lammps_config_has_mpi_support() != 0 + + # ------------------------------------------------------------------------- @property def has_exceptions(self): - """ Return whether the LAMMPS shared library was compiled with C++ exceptions handling enabled """ + """ Report whether the LAMMPS shared library was compiled with C++ + exceptions handling enabled + + This is a wrapper around the :cpp:func:`lammps_config_has_exceptions` + function of the library interface. + + :return: state of C++ exception support + :rtype: bool + """ return self.lib.lammps_config_has_exceptions() != 0 + # ------------------------------------------------------------------------- + @property def has_gzip_support(self): + """ Report whether the LAMMPS shared library was compiled with support + for reading and writing compressed files through ``gzip``. + + This is a wrapper around the :cpp:func:`lammps_config_has_gzip_support` + function of the library interface. + + :return: state of gzip support + :rtype: bool + """ return self.lib.lammps_config_has_gzip_support() != 0 + # ------------------------------------------------------------------------- + @property def has_png_support(self): + """ Report whether the LAMMPS shared library was compiled with support + for writing images in PNG format. + + This is a wrapper around the :cpp:func:`lammps_config_has_png_support` + function of the library interface. + + :return: state of PNG support + :rtype: bool + """ return self.lib.lammps_config_has_png_support() != 0 + # ------------------------------------------------------------------------- + @property def has_jpeg_support(self): + """ Report whether the LAMMPS shared library was compiled with support + for writing images in JPEG format. + + This is a wrapper around the :cpp:func:`lammps_config_has_jpeg_support` + function of the library interface. + + :return: state of JPEG support + :rtype: bool + """ return self.lib.lammps_config_has_jpeg_support() != 0 + # ------------------------------------------------------------------------- + @property def has_ffmpeg_support(self): + """ State of support for writing movies with ``ffmpeg`` in the LAMMPS shared library + + This is a wrapper around the :cpp:func:`lammps_config_has_ffmpeg_support` + function of the library interface. + + :return: state of ffmpeg support + :rtype: bool + """ return self.lib.lammps_config_has_ffmpeg_support() != 0 + # ------------------------------------------------------------------------- + @property def installed_packages(self): + """ List of the names of enabled packages in the LAMMPS shared library + + This is a wrapper around the functions :cpp:func:`lammps_config_package_count` + and :cpp:func`lammps_config_package_name` of the library interface. + + :return + """ if self._installed_packages is None: self._installed_packages = [] npackages = self.lib.lammps_config_package_count() @@ -708,23 +1648,35 @@ class lammps(object): self._installed_packages.append(sb.value.decode()) return self._installed_packages + # ------------------------------------------------------------------------- + def has_style(self, category, name): """Returns whether a given style name is available in a given category + This is a wrapper around the function :cpp:func:`lammps_has_style` + of the library interface. + :param category: name of category :type category: string :param name: name of the style :type name: string + :return: true if style is available in given category :rtype: bool """ return self.lib.lammps_has_style(self.lmp, category.encode(), name.encode()) != 0 + # ------------------------------------------------------------------------- + def available_styles(self, category): """Returns a list of styles available for a given category + This is a wrapper around the functions :cpp:func:`lammps_style_count()` + and :cpp:func:`lammps_style_name()` of the library interface. + :param category: name of category :type category: string + :return: list of style names in given category :rtype: list """ @@ -740,8 +1692,11 @@ class lammps(object): self._available_styles[category].append(sb.value.decode()) return self._available_styles[category] + # ------------------------------------------------------------------------- + def set_fix_external_callback(self, fix_name, callback, caller=None): import numpy as np + def _ctype_to_numpy_int(ctype_int): if ctype_int == c_int32: return np.int32 @@ -759,9 +1714,10 @@ class lammps(object): cCaller = caller self.callback[fix_name] = { 'function': cFunc, 'caller': caller } - self.lib.lammps_set_fix_external_callback(self.lmp, fix_name.encode(), cFunc, cCaller) + # ------------------------------------------------------------------------- + def get_neighlist(self, idx): """Returns an instance of :class:`NeighList` which wraps access to the neighbor list with the given index @@ -774,6 +1730,8 @@ class lammps(object): return None return NeighList(self, idx) + # ------------------------------------------------------------------------- + def find_pair_neighlist(self, style, exact=True, nsub=0, request=0): """Find neighbor list index of pair style neighbor list @@ -802,6 +1760,8 @@ class lammps(object): idx = self.lib.lammps_find_pair_neighlist(self.lmp, style, exact, nsub, request) return self.get_neighlist(idx) + # ------------------------------------------------------------------------- + def find_fix_neighlist(self, fixid, request=0): """Find neighbor list index of fix neighbor list @@ -816,6 +1776,8 @@ class lammps(object): idx = self.lib.lammps_find_fix_neighlist(self.lmp, fixid, request) return self.get_neighlist(idx) + # ------------------------------------------------------------------------- + def find_compute_neighlist(self, computeid, request=0): """Find neighbor list index of compute neighbor list @@ -830,6 +1792,8 @@ class lammps(object): idx = self.lib.lammps_find_compute_neighlist(self.lmp, computeid, request) return self.get_neighlist(idx) + # ------------------------------------------------------------------------- + def get_neighlist_size(self, idx): """Return the number of elements in neighbor list with the given index @@ -840,6 +1804,8 @@ class lammps(object): """ return self.lib.lammps_neighlist_num_elements(self.lmp, idx) + # ------------------------------------------------------------------------- + def get_neighlist_element_neighbors(self, idx, element): """Return data of neighbor list entry @@ -900,10 +1866,11 @@ class OutputCapture(object): def output(self): return self.read_pipe(self.stdout_pipe_read) +# ------------------------------------------------------------------------- class Variable(object): - def __init__(self, lammps_wrapper_instance, name, style, definition): - self.wrapper = lammps_wrapper_instance + def __init__(self, pylammps_instance, name, style, definition): + self._pylmp = pylammps_instance self.name = name self.style = style self.definition = definition.split() @@ -911,112 +1878,149 @@ class Variable(object): @property def value(self): if self.style == 'atom': - return list(self.wrapper.lmp.extract_variable(self.name, "all", 1)) + return list(self._pylmp.lmp.extract_variable(self.name, "all", 1)) else: - value = self.wrapper.lmp_print('"${%s}"' % self.name).strip() + value = self._pylmp.lmp_print('"${%s}"' % self.name).strip() try: return float(value) except ValueError: return value +# ------------------------------------------------------------------------- class AtomList(object): - def __init__(self, lammps_wrapper_instance): - self.lmp = lammps_wrapper_instance - self.natoms = self.lmp.system.natoms - self.dimensions = self.lmp.system.dimensions + """ + A dynamic list of atoms that returns either an Atom or Atom2D instance for + each atom. Instances are only allocated when accessed. + + :ivar natoms: total number of atoms + :ivar dimensions: number of dimensions in system + """ + def __init__(self, pylammps_instance): + self._pylmp = pylammps_instance + self.natoms = self._pylmp.system.natoms + self.dimensions = self._pylmp.system.dimensions + self._loaded = {} def __getitem__(self, index): - if self.dimensions == 2: - return Atom2D(self.lmp, index + 1) - return Atom(self.lmp, index + 1) + """ + Return Atom with given local index + :param index: Local index of atom + :type index: int + :rtype: Atom or Atom2D + """ + if index not in self._loaded: + if self.dimensions == 2: + atom = Atom2D(self._pylmp, index + 1) + else: + atom = Atom(self._pylmp, index + 1) + self._loaded[index] = atom + return self._loaded[index] + + def __len__(self): + return self.natoms + + +# ------------------------------------------------------------------------- class Atom(object): - def __init__(self, lammps_wrapper_instance, index): - self.lmp = lammps_wrapper_instance + """ + A wrapper class then represents a single atom inside of LAMMPS + + It provides access to properties of the atom and allows you to change some of them. + """ + def __init__(self, pylammps_instance, index): + self._pylmp = pylammps_instance self.index = index @property def id(self): - return int(self.lmp.eval("id[%d]" % self.index)) + return int(self._pylmp.eval("id[%d]" % self.index)) @property def type(self): - return int(self.lmp.eval("type[%d]" % self.index)) + return int(self._pylmp.eval("type[%d]" % self.index)) @property def mol(self): - return self.lmp.eval("mol[%d]" % self.index) + return self._pylmp.eval("mol[%d]" % self.index) @property def mass(self): - return self.lmp.eval("mass[%d]" % self.index) + return self._pylmp.eval("mass[%d]" % self.index) @property def position(self): - return (self.lmp.eval("x[%d]" % self.index), - self.lmp.eval("y[%d]" % self.index), - self.lmp.eval("z[%d]" % self.index)) + return (self._pylmp.eval("x[%d]" % self.index), + self._pylmp.eval("y[%d]" % self.index), + self._pylmp.eval("z[%d]" % self.index)) @position.setter def position(self, value): - self.lmp.set("atom", self.index, "x", value[0]) - self.lmp.set("atom", self.index, "y", value[1]) - self.lmp.set("atom", self.index, "z", value[2]) + self._pylmp.set("atom", self.index, "x", value[0]) + self._pylmp.set("atom", self.index, "y", value[1]) + self._pylmp.set("atom", self.index, "z", value[2]) @property def velocity(self): - return (self.lmp.eval("vx[%d]" % self.index), - self.lmp.eval("vy[%d]" % self.index), - self.lmp.eval("vz[%d]" % self.index)) + return (self._pylmp.eval("vx[%d]" % self.index), + self._pylmp.eval("vy[%d]" % self.index), + self._pylmp.eval("vz[%d]" % self.index)) @velocity.setter def velocity(self, value): - self.lmp.set("atom", self.index, "vx", value[0]) - self.lmp.set("atom", self.index, "vy", value[1]) - self.lmp.set("atom", self.index, "vz", value[2]) + self._pylmp.set("atom", self.index, "vx", value[0]) + self._pylmp.set("atom", self.index, "vy", value[1]) + self._pylmp.set("atom", self.index, "vz", value[2]) @property def force(self): - return (self.lmp.eval("fx[%d]" % self.index), - self.lmp.eval("fy[%d]" % self.index), - self.lmp.eval("fz[%d]" % self.index)) + return (self._pylmp.eval("fx[%d]" % self.index), + self._pylmp.eval("fy[%d]" % self.index), + self._pylmp.eval("fz[%d]" % self.index)) @property def charge(self): - return self.lmp.eval("q[%d]" % self.index) + return self._pylmp.eval("q[%d]" % self.index) +# ------------------------------------------------------------------------- class Atom2D(Atom): - def __init__(self, lammps_wrapper_instance, index): - super(Atom2D, self).__init__(lammps_wrapper_instance, index) + """ + A wrapper class then represents a single 2D atom inside of LAMMPS + + It provides access to properties of the atom and allows you to change some of them. + """ + def __init__(self, pylammps_instance, index): + super(Atom2D, self).__init__(pylammps_instance, index) @property def position(self): - return (self.lmp.eval("x[%d]" % self.index), - self.lmp.eval("y[%d]" % self.index)) + return (self._pylmp.eval("x[%d]" % self.index), + self._pylmp.eval("y[%d]" % self.index)) @position.setter def position(self, value): - self.lmp.set("atom", self.index, "x", value[0]) - self.lmp.set("atom", self.index, "y", value[1]) + self._pylmp.set("atom", self.index, "x", value[0]) + self._pylmp.set("atom", self.index, "y", value[1]) @property def velocity(self): - return (self.lmp.eval("vx[%d]" % self.index), - self.lmp.eval("vy[%d]" % self.index)) + return (self._pylmp.eval("vx[%d]" % self.index), + self._pylmp.eval("vy[%d]" % self.index)) @velocity.setter def velocity(self, value): - self.lmp.set("atom", self.index, "vx", value[0]) - self.lmp.set("atom", self.index, "vy", value[1]) + self._pylmp.set("atom", self.index, "vx", value[0]) + self._pylmp.set("atom", self.index, "vy", value[1]) @property def force(self): - return (self.lmp.eval("fx[%d]" % self.index), - self.lmp.eval("fy[%d]" % self.index)) + return (self._pylmp.eval("fx[%d]" % self.index), + self._pylmp.eval("fy[%d]" % self.index)) +# ------------------------------------------------------------------------- class variable_set: def __init__(self, name, variable_dict): @@ -1041,6 +2045,7 @@ class variable_set: def __repr__(self): return self.__str__() +# ------------------------------------------------------------------------- def get_thermo_data(output): """ traverse output of runs and extract thermo data columns """ @@ -1088,13 +2093,46 @@ def get_thermo_data(output): return runs +# ------------------------------------------------------------------------- +# ------------------------------------------------------------------------- + class PyLammps(object): """ - More Python-like wrapper for LAMMPS (e.g., for iPython) - See examples/ipython for usage + This is a Python wrapper class around the lower-level + :py:class:`lammps` class, exposing a more Python-like, + object-oriented interface for prototyping system inside of IPython and + Jupyter notebooks. + + It either creates its own instance of :py:class:`lammps` or can be + initialized with an existing instance. The arguments are the same of the + lower-level interface. The original interface can still be accessed via + :py:attr:`PyLammps.lmp`. + + :param name: "machine" name of the shared LAMMPS library ("mpi" loads ``liblammps_mpi.so``, "" loads ``liblammps.so``) + :type name: string + :param cmdargs: list of command line arguments to be passed to the :cpp:func:`lammps_open` function. The executable name is automatically added. + :type cmdargs: list + :param ptr: pointer to a LAMMPS C++ class instance when called from an embedded Python interpreter. None means load symbols from shared library. + :type ptr: pointer + :param comm: MPI communicator (as provided by `mpi4py `_). ``None`` means use ``MPI_COMM_WORLD`` implicitly. + :type comm: MPI_Comm + + :ivar lmp: instance of original LAMMPS Python interface + :vartype lmp: :py:class:`lammps` + + :ivar runs: list of completed runs, each storing the thermo output + :vartype run: list """ - def __init__(self,name="",cmdargs=None,ptr=None,comm=None): + def __init__(self, name="", cmdargs=None, ptr=None, comm=None): + self.has_echo = False + + if cmdargs: + if '-echo' in cmdargs: + idx = cmdargs.index('-echo') + # ensures that echo line is ignored during output capture + self.has_echo = idx+1 < len(cmdargs) and cmdargs[idx+1] in ('screen', 'both') + if ptr: if isinstance(ptr,PyLammps): self.lmp = ptr.lmp @@ -1113,29 +2151,69 @@ class PyLammps(object): self.lmp = None def close(self): + """Explicitly delete a LAMMPS instance + + This is a wrapper around the :py:meth:`lammps.close` of the Python interface. + """ if self.lmp: self.lmp.close() self.lmp = None def version(self): + """Return a numerical representation of the LAMMPS version in use. + + This is a wrapper around the :py:meth:`lammps.version` function of the Python interface. + + :return: version number + :rtype: int + """ return self.lmp.version() - def file(self,file): + def file(self, file): + """Read LAMMPS commands from a file. + + This is a wrapper around the :py:meth:`lammps.file` function of the Python interface. + + :param path: Name of the file/path with LAMMPS commands + :type path: string + """ self.lmp.file(file) - def write_script(self,filename): - """ Write LAMMPS script file containing all commands executed up until now """ - with open(filename, "w") as f: - for cmd in self._cmd_history: - f.write("%s\n" % cmd) + def write_script(self, filepath): + """ + Write LAMMPS script file containing all commands executed up until now - def command(self,cmd): + :param filepath: path to script file that should be written + :type filepath: string + """ + with open(filepath, "w") as f: + for cmd in self._cmd_history: + print(cmd, file=f) + + def command(self, cmd): + """ + Execute LAMMPS command + + All commands executed will be stored in a command history which can be + written to a file using :py:meth:`PyLammps.write_script()` + + :param cmd: command string that should be executed + :type: cmd: string + """ self.lmp.command(cmd) self._cmd_history.append(cmd) def run(self, *args, **kwargs): + """ + Execute LAMMPS run command with given arguments + + All thermo output during the run is captured and saved as new entry in + :py:attr:`PyLammps.runs`. The latest run can be retrieved by + :py:attr:`PyLammps.last_run`. + """ output = self.__getattr__('run')(*args, **kwargs) - if(lammps.has_mpi4py): + comm = self.lmp.get_mpi_comm() + if comm: output = self.lmp.comm.bcast(output, root=0) self.runs += get_thermo_data(output) @@ -1143,48 +2221,102 @@ class PyLammps(object): @property def last_run(self): + """ + Return data produced of last completed run command + + :getter: Returns an object containing information about the last run command + :type: dict + """ if len(self.runs) > 0: return self.runs[-1] return None @property def atoms(self): + """ + All atoms of this LAMMPS instance + + :getter: Returns a list of atoms currently in the system + :type: AtomList + """ return AtomList(self) @property def system(self): + """ + The system state of this LAMMPS instance + + :getter: Returns an object with properties storing the current system state + :type: namedtuple + """ output = self.info("system") d = self._parse_info_system(output) return namedtuple('System', d.keys())(*d.values()) @property def communication(self): + """ + The communication state of this LAMMPS instance + + :getter: Returns an object with properties storing the current communication state + :type: namedtuple + """ output = self.info("communication") d = self._parse_info_communication(output) return namedtuple('Communication', d.keys())(*d.values()) @property def computes(self): + """ + The list of active computes of this LAMMPS instance + + :getter: Returns a list of computes that are currently active in this LAMMPS instance + :type: list + """ output = self.info("computes") return self._parse_element_list(output) @property def dumps(self): + """ + The list of active dumps of this LAMMPS instance + + :getter: Returns a list of dumps that are currently active in this LAMMPS instance + :type: list + """ output = self.info("dumps") return self._parse_element_list(output) @property def fixes(self): + """ + The list of active fixes of this LAMMPS instance + + :getter: Returns a list of fixes that are currently active in this LAMMPS instance + :type: list + """ output = self.info("fixes") return self._parse_element_list(output) @property def groups(self): + """ + The list of active atom groups of this LAMMPS instance + + :getter: Returns a list of atom groups that are currently active in this LAMMPS instance + :type: list + """ output = self.info("groups") return self._parse_groups(output) @property def variables(self): + """ + Returns a dictionary of all variables defined in the current LAMMPS instance + + :getter: Returns a dictionary of all variables that are defined in this LAMMPS instance + :type: dict + """ output = self.info("variables") vars = {} for v in self._parse_element_list(output): @@ -1192,6 +2324,15 @@ class PyLammps(object): return vars def eval(self, expr): + """ + Evaluate expression + + :param expr: the expression string that should be evaluated inside of LAMMPS + :type expr: string + + :return: the value of the evaluated expression + :rtype: float if numeric, string otherwise + """ value = self.lmp_print('"$(%s)"' % expr).strip() try: return float(value) @@ -1327,11 +2468,23 @@ class PyLammps(object): 'variable', 'velocity', 'write_restart'] def __getattr__(self, name): + """ + This method is where the Python 'magic' happens. If a method is not + defined by the class PyLammps, it assumes it is a LAMMPS command. It takes + all the arguments, concatinates them to a single string, and executes it using + :py:meth:`lammps.PyLammps.command()`. + + :param verbose: Print output of command + :type verbose: bool + :return: line or list of lines of output, None if no output + :rtype: list or string + """ def handler(*args, **kwargs): cmd_args = [name] + [str(x) for x in args] with OutputCapture() as capture: - self.command(' '.join(cmd_args)) + cmd = ' '.join(cmd_args) + self.command(cmd) output = capture.output if 'verbose' in kwargs and kwargs['verbose']: @@ -1339,6 +2492,9 @@ class PyLammps(object): lines = output.splitlines() + if self.has_echo: + lines = lines[1:] + if len(lines) > 1: return lines elif len(lines) == 1: @@ -1350,14 +2506,56 @@ class PyLammps(object): class IPyLammps(PyLammps): """ - iPython wrapper for LAMMPS which adds embedded graphics capabilities + IPython wrapper for LAMMPS which adds embedded graphics capabilities to PyLammmps interface + + It either creates its own instance of :py:class:`lammps` or can be + initialized with an existing instance. The arguments are the same of the + lower-level interface. The original interface can still be accessed via + :py:attr:`PyLammps.lmp`. + + :param name: "machine" name of the shared LAMMPS library ("mpi" loads ``liblammps_mpi.so``, "" loads ``liblammps.so``) + :type name: string + :param cmdargs: list of command line arguments to be passed to the :cpp:func:`lammps_open` function. The executable name is automatically added. + :type cmdargs: list + :param ptr: pointer to a LAMMPS C++ class instance when called from an embedded Python interpreter. None means load symbols from shared library. + :type ptr: pointer + :param comm: MPI communicator (as provided by `mpi4py `_). ``None`` means use ``MPI_COMM_WORLD`` implicitly. + :type comm: MPI_Comm """ def __init__(self,name="",cmdargs=None,ptr=None,comm=None): super(IPyLammps, self).__init__(name=name,cmdargs=cmdargs,ptr=ptr,comm=comm) def image(self, filename="snapshot.png", group="all", color="type", diameter="type", - size=None, view=None, center=None, up=None, zoom=1.0): + size=None, view=None, center=None, up=None, zoom=1.0, background_color="white"): + """ Generate image using write_dump command and display it + + See :doc:`dump image ` for more information. + + :param filename: Name of the image file that should be generated. The extension determines whether it is PNG or JPEG + :type filename: string + :param group: the group of atoms write_image should use + :type group: string + :param color: name of property used to determine color + :type color: string + :param diameter: name of property used to determine atom diameter + :type diameter: string + :param size: dimensions of image + :type size: tuple (width, height) + :param view: view parameters + :type view: tuple (theta, phi) + :param center: center parameters + :type center: tuple (flag, center_x, center_y, center_z) + :param up: vector pointing to up direction + :type up: tuple (up_x, up_y, up_z) + :param zoom: zoom factor + :type zoom: float + :param background_color: background color of scene + :type background_color: string + + :return: Image instance used to display image in notebook + :rtype: :py:class:`IPython.core.display.Image` + """ cmd_args = [group, "image", filename, color, diameter] if size: @@ -1386,12 +2584,22 @@ class IPyLammps(PyLammps): if zoom: cmd_args += ["zoom", zoom] - cmd_args.append("modify backcolor white") + cmd_args.append("modify backcolor " + background_color) self.write_dump(*cmd_args) from IPython.core.display import Image - return Image('snapshot.png') + return Image(filename) def video(self, filename): + """ + Load video from file + + Can be used to visualize videos from :doc:`dump movie `. + + :param filename: Path to video file + :type filename: string + :return: HTML Video Tag used by notebook to embed a video + :rtype: :py:class:`IPython.display.HTML` + """ from IPython.display import HTML return HTML("") diff --git a/src/.gitignore b/src/.gitignore index 2fcbc5b80f..ebeb7076da 100644 --- a/src/.gitignore +++ b/src/.gitignore @@ -32,6 +32,8 @@ /pair_kim.cpp /pair_kim.h +/superpose3d.h + /kokkos.cpp /kokkos.h /kokkos_type.h @@ -49,6 +51,13 @@ /pair_meamc.cpp /pair_meamc.h +/compute_mliap.cpp +/compute_mliap.h +/mliap_*.cpp +/mliap_*.h +/pair_mliap.cpp +/pair_mliap.h + /ptm_*.cpp /ptm_*.h /compute_ptm.cpp @@ -60,6 +69,9 @@ /fix_*cauchy.cpp /fix_*cauchy.h +/fix_pafi*.cpp +/fix_pafi*.h + /compute_test_nbl.cpp /compute_test_nbl.h /pair_multi_lucy.cpp @@ -305,6 +317,8 @@ /bond_oxrna2_fene.h /bond_quartic.cpp /bond_quartic.h +/bond_special.cpp +/bond_special.h /bond_table.cpp /bond_table.h /cg_cmm_parms.cpp @@ -589,6 +603,8 @@ /fix_meso_move.h /fix_meso_stationary.cpp /fix_meso_stationary.h +/fix_momentum_chunk.cpp +/fix_momentum_chunk.h /fix_mscg.cpp /fix_mscg.h /fix_msst.cpp @@ -750,6 +766,8 @@ /fix_wall_piston.h /fix_wall_srd.cpp /fix_wall_srd.h +/fix_widom.cpp +/fix_widom.h /gpu_extra.h /gridcomm.cpp /gridcomm.h diff --git a/src/ASPHERE/compute_erotate_asphere.cpp b/src/ASPHERE/compute_erotate_asphere.cpp index 3cf23b87eb..945b91fbbd 100644 --- a/src/ASPHERE/compute_erotate_asphere.cpp +++ b/src/ASPHERE/compute_erotate_asphere.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_erotate_asphere.h" -#include + #include "math_extra.h" #include "atom.h" #include "atom_vec_ellipsoid.h" diff --git a/src/ASPHERE/compute_temp_asphere.cpp b/src/ASPHERE/compute_temp_asphere.cpp index 4350678bbd..2242fba026 100644 --- a/src/ASPHERE/compute_temp_asphere.cpp +++ b/src/ASPHERE/compute_temp_asphere.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_asphere.h" -#include + #include #include "math_extra.h" #include "atom.h" @@ -38,7 +38,7 @@ enum{ROTATE,ALL}; ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_bias(NULL), tbias(NULL), avec(NULL) + id_bias(nullptr), tbias(nullptr), avec(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/asphere command"); @@ -49,7 +49,7 @@ ComputeTempAsphere::ComputeTempAsphere(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; + id_bias = nullptr; mode = ALL; int iarg = 3; diff --git a/src/ASPHERE/fix_nph_asphere.cpp b/src/ASPHERE/fix_nph_asphere.cpp index 0501ea1e8a..6d1727ce45 100644 --- a/src/ASPHERE/fix_nph_asphere.cpp +++ b/src/ASPHERE/fix_nph_asphere.cpp @@ -13,7 +13,7 @@ #include "fix_nph_asphere.h" #include -#include + #include "modify.h" #include "error.h" diff --git a/src/ASPHERE/fix_npt_asphere.cpp b/src/ASPHERE/fix_npt_asphere.cpp index f7f253f40b..064a20d55b 100644 --- a/src/ASPHERE/fix_npt_asphere.cpp +++ b/src/ASPHERE/fix_npt_asphere.cpp @@ -13,7 +13,7 @@ #include "fix_npt_asphere.h" #include -#include + #include "modify.h" #include "error.h" diff --git a/src/ASPHERE/fix_nvt_asphere.cpp b/src/ASPHERE/fix_nvt_asphere.cpp index e0275d4acf..d439d947bf 100644 --- a/src/ASPHERE/fix_nvt_asphere.cpp +++ b/src/ASPHERE/fix_nvt_asphere.cpp @@ -13,11 +13,11 @@ #include "fix_nvt_asphere.h" #include -#include + #include "group.h" #include "modify.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/ASPHERE/pair_gayberne.cpp b/src/ASPHERE/pair_gayberne.cpp index 51896aab85..3878f7e4de 100644 --- a/src/ASPHERE/pair_gayberne.cpp +++ b/src/ASPHERE/pair_gayberne.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_gayberne.h" -#include + #include #include "math_extra.h" #include "atom.h" @@ -28,7 +28,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -268,10 +268,10 @@ void PairGayBerne::settings(int narg, char **arg) { if (narg != 4) error->all(FLERR,"Illegal pair_style command"); - gamma = force->numeric(FLERR,arg[0]); - upsilon = force->numeric(FLERR,arg[1])/2.0; - mu = force->numeric(FLERR,arg[2]); - cut_global = force->numeric(FLERR,arg[3]); + gamma = utils::numeric(FLERR,arg[0],false,lmp); + upsilon = utils::numeric(FLERR,arg[1],false,lmp)/2.0; + mu = utils::numeric(FLERR,arg[2],false,lmp); + cut_global = utils::numeric(FLERR,arg[3],false,lmp); // reset cutoffs that have been explicitly set @@ -294,20 +294,20 @@ void PairGayBerne::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double eia_one = force->numeric(FLERR,arg[4]); - double eib_one = force->numeric(FLERR,arg[5]); - double eic_one = force->numeric(FLERR,arg[6]); - double eja_one = force->numeric(FLERR,arg[7]); - double ejb_one = force->numeric(FLERR,arg[8]); - double ejc_one = force->numeric(FLERR,arg[9]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double eia_one = utils::numeric(FLERR,arg[4],false,lmp); + double eib_one = utils::numeric(FLERR,arg[5],false,lmp); + double eic_one = utils::numeric(FLERR,arg[6],false,lmp); + double eja_one = utils::numeric(FLERR,arg[7],false,lmp); + double ejb_one = utils::numeric(FLERR,arg[8],false,lmp); + double ejc_one = utils::numeric(FLERR,arg[9],false,lmp); double cut_one = cut_global; - if (narg == 11) cut_one = force->numeric(FLERR,arg[10]); + if (narg == 11) cut_one = utils::numeric(FLERR,arg[10],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -461,20 +461,20 @@ void PairGayBerne::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setwell[i],1,MPI_INT,0,world); if (setwell[i]) { - if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,nullptr,error); MPI_Bcast(&well[i][0],3,MPI_DOUBLE,0,world); } for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -506,12 +506,12 @@ void PairGayBerne::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&gamma,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&upsilon,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&gamma,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&upsilon,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&gamma,1,MPI_DOUBLE,0,world); MPI_Bcast(&upsilon,1,MPI_DOUBLE,0,world); diff --git a/src/ASPHERE/pair_line_lj.cpp b/src/ASPHERE/pair_line_lj.cpp index fdeb09aac4..7e6979f0a5 100644 --- a/src/ASPHERE/pair_line_lj.cpp +++ b/src/ASPHERE/pair_line_lj.cpp @@ -21,6 +21,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; #define DELTA 10000 @@ -30,8 +31,8 @@ using namespace LAMMPS_NS; PairLineLJ::PairLineLJ(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; @@ -73,7 +74,6 @@ void PairLineLJ::compute(int eflag, int vflag) double xi[2],xj[2],fi[2],dxi,dxj,dyi,dyj; int *ilist,*jlist,*numneigh,**firstneigh; - evdwl = 0.0; ev_init(eflag,vflag); double **x = atom->x; @@ -344,7 +344,7 @@ void PairLineLJ::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -367,17 +367,17 @@ void PairLineLJ::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double size_itype = force->numeric(FLERR,arg[2]); - double size_jtype = force->numeric(FLERR,arg[3]); - double epsilon_one = force->numeric(FLERR,arg[4]); - double sigma_one = force->numeric(FLERR,arg[5]); - double cutsub_one = force->numeric(FLERR,arg[6]); + double size_itype = utils::numeric(FLERR,arg[2],false,lmp); + double size_jtype = utils::numeric(FLERR,arg[3],false,lmp); + double epsilon_one = utils::numeric(FLERR,arg[4],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[5],false,lmp); + double cutsub_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/ASPHERE/pair_resquared.cpp b/src/ASPHERE/pair_resquared.cpp index dd4b11935e..c234ce27bf 100644 --- a/src/ASPHERE/pair_resquared.cpp +++ b/src/ASPHERE/pair_resquared.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_resquared.h" -#include + #include #include "math_extra.h" #include "atom.h" @@ -27,7 +27,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -243,7 +243,7 @@ void PairRESquared::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -266,20 +266,20 @@ void PairRESquared::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double eia_one = force->numeric(FLERR,arg[4]); - double eib_one = force->numeric(FLERR,arg[5]); - double eic_one = force->numeric(FLERR,arg[6]); - double eja_one = force->numeric(FLERR,arg[7]); - double ejb_one = force->numeric(FLERR,arg[8]); - double ejc_one = force->numeric(FLERR,arg[9]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double eia_one = utils::numeric(FLERR,arg[4],false,lmp); + double eib_one = utils::numeric(FLERR,arg[5],false,lmp); + double eic_one = utils::numeric(FLERR,arg[6],false,lmp); + double eja_one = utils::numeric(FLERR,arg[7],false,lmp); + double ejb_one = utils::numeric(FLERR,arg[8],false,lmp); + double ejc_one = utils::numeric(FLERR,arg[9],false,lmp); double cut_one = cut_global; - if (narg == 11) cut_one = force->numeric(FLERR,arg[10]); + if (narg == 11) cut_one = utils::numeric(FLERR,arg[10],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -439,20 +439,20 @@ void PairRESquared::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setwell[i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setwell[i],1,MPI_INT,0,world); if (setwell[i]) { - if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&well[i][0],sizeof(double),3,fp,nullptr,error); MPI_Bcast(&well[i][0],3,MPI_DOUBLE,0,world); } for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -480,8 +480,8 @@ void PairRESquared::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/ASPHERE/pair_tri_lj.cpp b/src/ASPHERE/pair_tri_lj.cpp index 0984b0a30c..5f62d211db 100644 --- a/src/ASPHERE/pair_tri_lj.cpp +++ b/src/ASPHERE/pair_tri_lj.cpp @@ -22,6 +22,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; #define DELTA 20 @@ -31,8 +32,8 @@ using namespace LAMMPS_NS; PairTriLJ::PairTriLJ(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; @@ -73,7 +74,6 @@ void PairTriLJ::compute(int eflag, int vflag) double dc1[3],dc2[3],dc3[3]; int *ilist,*jlist,*numneigh,**firstneigh; - evdwl = 0.0; ev_init(eflag,vflag); AtomVecTri::Bonus *bonus = avec->bonus; @@ -415,7 +415,7 @@ void PairTriLJ::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -438,14 +438,14 @@ void PairTriLJ::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/BODY/body_nparticle.cpp b/src/BODY/body_nparticle.cpp index 73a85386bd..bfbb004ad5 100644 --- a/src/BODY/body_nparticle.cpp +++ b/src/BODY/body_nparticle.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "body_nparticle.h" -#include -#include -#include "my_pool_chunk.h" -#include "math_extra.h" -#include "atom_vec_body.h" + #include "atom.h" -#include "force.h" -#include "memory.h" +#include "atom_vec_body.h" #include "error.h" -#include "fmt/format.h" +#include "math_extra.h" +#include "math_eigen.h" +#include "memory.h" +#include "my_pool_chunk.h" + +#include using namespace LAMMPS_NS; @@ -31,12 +31,12 @@ enum{SPHERE,LINE,TRI}; // also in DumpImage /* ---------------------------------------------------------------------- */ BodyNparticle::BodyNparticle(LAMMPS *lmp, int narg, char **arg) : - Body(lmp, narg, arg), imflag(NULL), imdata(NULL) + Body(lmp, narg, arg), imflag(nullptr), imdata(nullptr) { if (narg != 3) error->all(FLERR,"Invalid body nparticle command"); - int nmin = force->inumeric(FLERR,arg[1]); - int nmax = force->inumeric(FLERR,arg[2]); + int nmin = utils::inumeric(FLERR,arg[1],false,lmp); + int nmax = utils::inumeric(FLERR,arg[2],false,lmp); if (nmin <= 0 || nmin > nmax) error->all(FLERR,"Invalid body nparticle command"); @@ -137,7 +137,7 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, double *inertia = bonus->inertia; double evectors[3][3]; - int ierror = MathExtra::jacobi(tensor,inertia,evectors); + int ierror = MathEigen::jacobi3(tensor,inertia,evectors); if (ierror) error->one(FLERR, "Insufficient Jacobi rotations for body nparticle"); @@ -195,7 +195,7 @@ void BodyNparticle::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int BodyNparticle::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polygon.cpp b/src/BODY/body_rounded_polygon.cpp index d8ac81b2e6..0787708a9d 100644 --- a/src/BODY/body_rounded_polygon.cpp +++ b/src/BODY/body_rounded_polygon.cpp @@ -16,17 +16,18 @@ ------------------------------------------------------------------------- */ #include "body_rounded_polygon.h" + +#include "atom.h" +#include "atom_vec_body.h" +#include "domain.h" +#include "error.h" +#include "math_extra.h" +#include "math_eigen.h" +#include "memory.h" +#include "my_pool_chunk.h" + #include #include -#include "my_pool_chunk.h" -#include "atom_vec_body.h" -#include "atom.h" -#include "force.h" -#include "domain.h" -#include "math_extra.h" -#include "memory.h" -#include "error.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -46,8 +47,8 @@ BodyRoundedPolygon::BodyRoundedPolygon(LAMMPS *lmp, int narg, char **arg) : // nmin and nmax are minimum and maximum number of vertices - int nmin = force->inumeric(FLERR,arg[1]); - int nmax = force->inumeric(FLERR,arg[2]); + int nmin = utils::inumeric(FLERR,arg[1],false,lmp); + int nmax = utils::inumeric(FLERR,arg[2],false,lmp); if (nmin <= 0 || nmin > nmax) error->all(FLERR,"Invalid body rounded/polygon command"); @@ -198,7 +199,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, double *inertia = bonus->inertia; double evectors[3][3]; - int ierror = MathExtra::jacobi(tensor,inertia,evectors); + int ierror = MathEigen::jacobi3(tensor,inertia,evectors); if (ierror) error->one(FLERR, "Insufficient Jacobi rotations for body nparticle"); @@ -321,7 +322,7 @@ void BodyRoundedPolygon::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolygon::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/body_rounded_polyhedron.cpp b/src/BODY/body_rounded_polyhedron.cpp index b6646cc116..1a4359f39a 100644 --- a/src/BODY/body_rounded_polyhedron.cpp +++ b/src/BODY/body_rounded_polyhedron.cpp @@ -16,17 +16,17 @@ ------------------------------------------------------------------------- */ #include "body_rounded_polyhedron.h" + +#include "atom.h" +#include "atom_vec_body.h" +#include "error.h" +#include "math_extra.h" +#include "math_eigen.h" +#include "memory.h" +#include "my_pool_chunk.h" + #include #include -#include -#include "my_pool_chunk.h" -#include "atom_vec_body.h" -#include "atom.h" -#include "force.h" -#include "math_extra.h" -#include "memory.h" -#include "error.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -44,8 +44,8 @@ BodyRoundedPolyhedron::BodyRoundedPolyhedron(LAMMPS *lmp, int narg, char **arg) // nmin and nmax are minimum and maximum number of vertices - int nmin = force->inumeric(FLERR,arg[1]); - int nmax = force->inumeric(FLERR,arg[2]); + int nmin = utils::inumeric(FLERR,arg[1],false,lmp); + int nmax = utils::inumeric(FLERR,arg[2],false,lmp); if (nmin <= 0 || nmin > nmax) error->all(FLERR,"Invalid body rounded/polyhedron command"); @@ -123,7 +123,7 @@ int BodyRoundedPolyhedron::nfaces(AtomVecBody::Bonus *bonus) double *BodyRoundedPolyhedron::faces(AtomVecBody::Bonus *bonus) { int nvertices = bonus->ivalue[0]; - if (nvertices == 1 || nvertices == 2) return NULL; + if (nvertices == 1 || nvertices == 2) return nullptr; return bonus->dvalue+3*nsub(bonus)+2*nedges(bonus); } @@ -243,7 +243,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, double *inertia = bonus->inertia; double evectors[3][3]; - int ierror = MathExtra::jacobi(tensor,inertia,evectors); + int ierror = MathEigen::jacobi3(tensor,inertia,evectors); if (ierror) error->one(FLERR, "Insufficient Jacobi rotations for body nparticle"); @@ -374,7 +374,7 @@ void BodyRoundedPolyhedron::data_body(int ibonus, int ninteger, int ndouble, /* ---------------------------------------------------------------------- pack data struct for one body into buf for writing to data file - if buf is NULL, just return buffer size + if buf is a null pointer, just return buffer size ------------------------------------------------------------------------- */ int BodyRoundedPolyhedron::pack_data_body(tagint atomID, int ibonus, double *buf) diff --git a/src/BODY/compute_body_local.cpp b/src/BODY/compute_body_local.cpp index c12502df42..6443f95325 100644 --- a/src/BODY/compute_body_local.cpp +++ b/src/BODY/compute_body_local.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "compute_body_local.h" -#include -#include + #include "atom.h" #include "atom_vec_body.h" #include "body.h" -#include "update.h" -#include "force.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -31,7 +31,7 @@ enum{ID,TYPE,INDEX}; /* ---------------------------------------------------------------------- */ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), which(NULL), index(NULL), avec(NULL), bptr(NULL) + Compute(lmp, narg, arg), which(nullptr), index(nullptr), avec(nullptr), bptr(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute body/local command"); @@ -47,7 +47,7 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg],"type") == 0) which[nvalues++] = TYPE; else { which[nvalues] = INDEX; - index[nvalues] = force->inumeric(FLERR,arg[iarg]) - 1; + index[nvalues] = utils::inumeric(FLERR,arg[iarg],false,lmp) - 1; nvalues++; } } @@ -66,8 +66,8 @@ ComputeBodyLocal::ComputeBodyLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -123,7 +123,7 @@ void ComputeBodyLocal::compute_local() int ncount = compute_body(0); if (ncount > nmax) reallocate(ncount); size_local_rows = ncount; - ncount = compute_body(1); + compute_body(1); } /* ---------------------------------------------------------------------- diff --git a/src/BODY/compute_temp_body.cpp b/src/BODY/compute_temp_body.cpp index 4cf9ac5009..210bb07417 100644 --- a/src/BODY/compute_temp_body.cpp +++ b/src/BODY/compute_temp_body.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_body.h" -#include + #include #include "math_extra.h" #include "atom.h" @@ -36,7 +36,7 @@ enum{ROTATE,ALL}; /* ---------------------------------------------------------------------- */ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_bias(NULL), tbias(NULL), avec(NULL) + Compute(lmp, narg, arg), id_bias(nullptr), tbias(nullptr), avec(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/body command"); @@ -47,7 +47,7 @@ ComputeTempBody::ComputeTempBody(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 0; - id_bias = NULL; + id_bias = nullptr; mode = ALL; int iarg = 3; @@ -343,7 +343,6 @@ void ComputeTempBody::compute_vector() inertia = bonus[body[i]].inertia; quat = bonus[body[i]].quat; - massone = rmass[i]; // wbody = angular velocity in body frame diff --git a/src/BODY/fix_nph_body.cpp b/src/BODY/fix_nph_body.cpp index 1e8cc88e7c..f198919ad8 100644 --- a/src/BODY/fix_nph_body.cpp +++ b/src/BODY/fix_nph_body.cpp @@ -17,11 +17,11 @@ #include "fix_nph_body.h" #include -#include + #include "group.h" #include "modify.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/fix_npt_body.cpp b/src/BODY/fix_npt_body.cpp index 295777753f..23194bc8ca 100644 --- a/src/BODY/fix_npt_body.cpp +++ b/src/BODY/fix_npt_body.cpp @@ -17,11 +17,11 @@ #include "fix_npt_body.h" #include -#include + #include "group.h" #include "modify.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/fix_nvt_body.cpp b/src/BODY/fix_nvt_body.cpp index 458ff1ab14..3cab4416b0 100644 --- a/src/BODY/fix_nvt_body.cpp +++ b/src/BODY/fix_nvt_body.cpp @@ -17,11 +17,11 @@ #include "fix_nvt_body.h" #include -#include + #include "group.h" #include "modify.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/BODY/fix_wall_body_polygon.cpp b/src/BODY/fix_wall_body_polygon.cpp index e51476de60..2e69f70af7 100644 --- a/src/BODY/fix_wall_body_polygon.cpp +++ b/src/BODY/fix_wall_body_polygon.cpp @@ -62,11 +62,11 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : // wall/particle coefficients - kn = force->numeric(FLERR,arg[3]); + kn = utils::numeric(FLERR,arg[3],false,lmp); - c_n = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) c_t = 0.5 * c_n; - else c_t = force->numeric(FLERR,arg[5]); + else c_t = utils::numeric(FLERR,arg[5],false,lmp); if (kn < 0.0 || c_n < 0.0 || c_t < 0.0) error->all(FLERR,"Illegal fix wall/body/polygon command"); @@ -78,23 +78,23 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polygon command"); wallstyle = XPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polygon command"); wallstyle = YPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zcylinder") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/body/polygon command"); wallstyle = ZCYLINDER; lo = hi = 0.0; - cylradius = force->numeric(FLERR,arg[iarg+1]); + cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } @@ -109,8 +109,8 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/body/polygon command"); - amplitude = force->numeric(FLERR,arg[iarg+2]); - period = force->numeric(FLERR,arg[iarg+3]); + amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + period = utils::numeric(FLERR,arg[iarg+3],false,lmp); wiggle = 1; iarg += 4; } else error->all(FLERR,"Illegal fix wall/body/polygon command"); @@ -133,15 +133,15 @@ FixWallBodyPolygon::FixWallBodyPolygon(LAMMPS *lmp, int narg, char **arg) : time_origin = update->ntimestep; dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; } /* ---------------------------------------------------------------------- */ @@ -226,7 +226,7 @@ void FixWallBodyPolygon::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/fix_wall_body_polyhedron.cpp b/src/BODY/fix_wall_body_polyhedron.cpp index 42c62de436..472fe5fb21 100644 --- a/src/BODY/fix_wall_body_polyhedron.cpp +++ b/src/BODY/fix_wall_body_polyhedron.cpp @@ -62,11 +62,11 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) // wall/particle coefficients - kn = force->numeric(FLERR,arg[3]); + kn = utils::numeric(FLERR,arg[3],false,lmp); - c_n = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) c_t = 0.5 * c_n; - else c_t = force->numeric(FLERR,arg[5]); + else c_t = utils::numeric(FLERR,arg[5],false,lmp); if (kn < 0.0 || c_n < 0.0 || c_t < 0.0) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); @@ -78,25 +78,25 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); wallstyle = XPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); wallstyle = YPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/body/polyhedron command"); wallstyle = ZPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } @@ -111,8 +111,8 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/body/polyhedron command"); - amplitude = force->numeric(FLERR,arg[iarg+2]); - period = force->numeric(FLERR,arg[iarg+3]); + amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + period = utils::numeric(FLERR,arg[iarg+3],false,lmp); wiggle = 1; iarg += 4; } else error->all(FLERR,"Illegal fix wall/body/polyhedron command"); @@ -132,19 +132,19 @@ FixWallBodyPolyhedron::FixWallBodyPolyhedron(LAMMPS *lmp, int narg, char **arg) time_origin = update->ntimestep; dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; facmax = facnummax = 0; - face = NULL; - facnum = facfirst = NULL; + face = nullptr; + facnum = facfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; } /* ---------------------------------------------------------------------- */ @@ -233,7 +233,7 @@ void FixWallBodyPolyhedron::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential diff --git a/src/BODY/pair_body_nparticle.cpp b/src/BODY/pair_body_nparticle.cpp index bd7aba5455..92ae392cd7 100644 --- a/src/BODY/pair_body_nparticle.cpp +++ b/src/BODY/pair_body_nparticle.cpp @@ -24,6 +24,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; #define DELTA 10000 @@ -33,8 +34,8 @@ using namespace LAMMPS_NS; PairBodyNparticle::PairBodyNparticle(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; single_enable = 0; restartinfo = 0; @@ -362,7 +363,7 @@ void PairBodyNparticle::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -385,14 +386,14 @@ void PairBodyNparticle::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/BODY/pair_body_rounded_polygon.cpp b/src/BODY/pair_body_rounded_polygon.cpp index 22a6d82b44..b7fa88b740 100644 --- a/src/BODY/pair_body_rounded_polygon.cpp +++ b/src/BODY/pair_body_rounded_polygon.cpp @@ -19,7 +19,7 @@ ------------------------------------------------------------------------- */ #include "pair_body_rounded_polygon.h" -#include + #include #include #include "math_extra.h" @@ -35,6 +35,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; #define DELTA 10000 @@ -52,16 +53,16 @@ enum {INVALID=0,NONE=1,VERTEXI=2,VERTEXJ=3,EDGE=4}; PairBodyRoundedPolygon::PairBodyRoundedPolygon(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; - maxerad = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; + maxerad = nullptr; single_enable = 0; restartinfo = 0; @@ -365,11 +366,11 @@ void PairBodyRoundedPolygon::settings(int narg, char **arg) { if (narg < 5) error->all(FLERR,"Illegal pair_style command"); - c_n = force->numeric(FLERR,arg[0]); - c_t = force->numeric(FLERR,arg[1]); - mu = force->numeric(FLERR,arg[2]); - delta_ua = force->numeric(FLERR,arg[3]); - cut_inner = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[0],false,lmp); + c_t = utils::numeric(FLERR,arg[1],false,lmp); + mu = utils::numeric(FLERR,arg[2],false,lmp); + delta_ua = utils::numeric(FLERR,arg[3],false,lmp); + cut_inner = utils::numeric(FLERR,arg[4],false,lmp); if (delta_ua < 0) delta_ua = 1; } @@ -385,11 +386,11 @@ void PairBodyRoundedPolygon::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double k_n_one = force->numeric(FLERR,arg[2]); - double k_na_one = force->numeric(FLERR,arg[3]); + double k_n_one = utils::numeric(FLERR,arg[2],false,lmp); + double k_na_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -457,7 +458,7 @@ void PairBodyRoundedPolygon::init_style() for (i = 0; i < nlocal; i++) dnum[i] = ednum[i] = 0; - double *merad = NULL; + double *merad = nullptr; memory->create(merad,ntypes+1,"pair:merad"); for (i = 1; i <= ntypes; i++) maxerad[i] = merad[i] = 0; diff --git a/src/BODY/pair_body_rounded_polyhedron.cpp b/src/BODY/pair_body_rounded_polyhedron.cpp index ff7e7fc25e..a3cffef9cc 100644 --- a/src/BODY/pair_body_rounded_polyhedron.cpp +++ b/src/BODY/pair_body_rounded_polyhedron.cpp @@ -21,7 +21,7 @@ ------------------------------------------------------------------------- */ #include "pair_body_rounded_polyhedron.h" -#include + #include #include #include "atom.h" @@ -38,6 +38,7 @@ #include "math_extra.h" #include "math_const.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -57,20 +58,20 @@ enum {EF_INVALID=0,EF_NONE,EF_PARALLEL,EF_SAME_SIDE_OF_FACE, PairBodyRoundedPolyhedron::PairBodyRoundedPolyhedron(LAMMPS *lmp) : Pair(lmp) { dmax = nmax = 0; - discrete = NULL; - dnum = dfirst = NULL; + discrete = nullptr; + dnum = dfirst = nullptr; edmax = ednummax = 0; - edge = NULL; - ednum = edfirst = NULL; + edge = nullptr; + ednum = edfirst = nullptr; facmax = facnummax = 0; - face = NULL; - facnum = facfirst = NULL; + face = nullptr; + facnum = facfirst = nullptr; - enclosing_radius = NULL; - rounded_radius = NULL; - maxerad = NULL; + enclosing_radius = nullptr; + rounded_radius = nullptr; + maxerad = nullptr; single_enable = 0; restartinfo = 0; @@ -80,8 +81,8 @@ PairBodyRoundedPolyhedron::PairBodyRoundedPolyhedron(LAMMPS *lmp) : Pair(lmp) mu = 0.0; A_ua = 1.0; - k_n = NULL; - k_na = NULL; + k_n = nullptr; + k_na = nullptr; } /* ---------------------------------------------------------------------- */ @@ -343,11 +344,11 @@ void PairBodyRoundedPolyhedron::settings(int narg, char **arg) { if (narg < 5) error->all(FLERR,"Illegal pair_style command"); - c_n = force->numeric(FLERR,arg[0]); - c_t = force->numeric(FLERR,arg[1]); - mu = force->numeric(FLERR,arg[2]); - A_ua = force->numeric(FLERR,arg[3]); - cut_inner = force->numeric(FLERR,arg[4]); + c_n = utils::numeric(FLERR,arg[0],false,lmp); + c_t = utils::numeric(FLERR,arg[1],false,lmp); + mu = utils::numeric(FLERR,arg[2],false,lmp); + A_ua = utils::numeric(FLERR,arg[3],false,lmp); + cut_inner = utils::numeric(FLERR,arg[4],false,lmp); if (A_ua < 0) A_ua = 1; } @@ -363,11 +364,11 @@ void PairBodyRoundedPolyhedron::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double k_n_one = force->numeric(FLERR,arg[2]); - double k_na_one = force->numeric(FLERR,arg[3]); + double k_n_one = utils::numeric(FLERR,arg[2],false,lmp); + double k_na_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -439,7 +440,7 @@ void PairBodyRoundedPolyhedron::init_style() for (i = 0; i < nlocal; i++) dnum[i] = ednum[i] = facnum[i] = 0; - double *merad = NULL; + double *merad = nullptr; memory->create(merad,ntypes+1,"pair:merad"); for (i = 1; i <= ntypes; i++) maxerad[i] = merad[i] = 0; @@ -883,7 +884,7 @@ void PairBodyRoundedPolyhedron::sphere_against_face(int ibody, int jbody, project_pt_plane(x[jbody], xi1, xi2, xi3, h, d, inside); - inside_polygon(ibody, ni, x[ibody], h, NULL, inside, tmp); + inside_polygon(ibody, ni, x[ibody], h, nullptr, inside, tmp); if (inside == 0) continue; delx = h[0] - x[jbody][0]; @@ -1879,7 +1880,7 @@ void PairBodyRoundedPolyhedron::project_pt_plane(const double* q, face_index = face index of the body xmi = atom i's coordinates q1 = tested point on the face (e.g. the projection of a point) - q2 = another point (can be NULL) for face-edge intersection + q2 = another point (can be a null pointer) for face-edge intersection Output: inside1 = 1 if q1 is inside the polygon, 0 otherwise inside2 = 1 if q2 is inside the polygon, 0 otherwise @@ -1928,7 +1929,7 @@ void PairBodyRoundedPolyhedron::inside_polygon(int ibody, int face_index, anglesum1 += acos(costheta); } - if (q2 != NULL) { + if (q2 != nullptr) { MathExtra::sub3(xi1,q2,u); MathExtra::sub3(xi2,q2,v); magu = MathExtra::len3(u); @@ -1944,7 +1945,7 @@ void PairBodyRoundedPolyhedron::inside_polygon(int ibody, int face_index, if (fabs(anglesum1 - MY_2PI) < EPSILON) inside1 = 1; else inside1 = 0; - if (q2 != NULL) { + if (q2 != nullptr) { if (fabs(anglesum2 - MY_2PI) < EPSILON) inside2 = 1; else inside2 = 0; } diff --git a/src/CLASS2/angle_class2.cpp b/src/CLASS2/angle_class2.cpp index fe567ead34..616d191d1c 100644 --- a/src/CLASS2/angle_class2.cpp +++ b/src/CLASS2/angle_class2.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_class2.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -273,16 +273,16 @@ void AngleClass2::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); int count = 0; if (strcmp(arg[1],"bb") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); - double bb_k_one = force->numeric(FLERR,arg[2]); - double bb_r1_one = force->numeric(FLERR,arg[3]); - double bb_r2_one = force->numeric(FLERR,arg[4]); + double bb_k_one = utils::numeric(FLERR,arg[2],false,lmp); + double bb_r1_one = utils::numeric(FLERR,arg[3],false,lmp); + double bb_r2_one = utils::numeric(FLERR,arg[4],false,lmp); for (int i = ilo; i <= ihi; i++) { bb_k[i] = bb_k_one; @@ -295,10 +295,10 @@ void AngleClass2::coeff(int narg, char **arg) } else if (strcmp(arg[1],"ba") == 0) { if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients"); - double ba_k1_one = force->numeric(FLERR,arg[2]); - double ba_k2_one = force->numeric(FLERR,arg[3]); - double ba_r1_one = force->numeric(FLERR,arg[4]); - double ba_r2_one = force->numeric(FLERR,arg[5]); + double ba_k1_one = utils::numeric(FLERR,arg[2],false,lmp); + double ba_k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double ba_r1_one = utils::numeric(FLERR,arg[4],false,lmp); + double ba_r2_one = utils::numeric(FLERR,arg[5],false,lmp); for (int i = ilo; i <= ihi; i++) { ba_k1[i] = ba_k1_one; @@ -312,10 +312,10 @@ void AngleClass2::coeff(int narg, char **arg) } else { if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); - double theta0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0 from degrees to radians @@ -373,19 +373,19 @@ void AngleClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); - utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); - utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); @@ -447,10 +447,6 @@ double AngleClass2::single(int type, int i1, int i2, int i3) if (c > 1.0) c = 1.0; if (c < -1.0) c = -1.0; - double s = sqrt(1.0 - c*c); - if (s < SMALL) s = SMALL; - s = 1.0/s; - double dtheta = acos(c) - theta0[type]; double dtheta2 = dtheta*dtheta; double dtheta3 = dtheta2*dtheta; diff --git a/src/CLASS2/bond_class2.cpp b/src/CLASS2/bond_class2.cpp index 7feec1a4b3..8a84717228 100644 --- a/src/CLASS2/bond_class2.cpp +++ b/src/CLASS2/bond_class2.cpp @@ -17,7 +17,7 @@ #include #include "bond_class2.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -25,7 +25,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -134,12 +134,12 @@ void BondClass2::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double r0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double r0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -184,10 +184,10 @@ void BondClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&k2[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -228,5 +228,5 @@ void *BondClass2::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/CLASS2/dihedral_class2.cpp b/src/CLASS2/dihedral_class2.cpp index 73b6a420e8..5a0300359d 100644 --- a/src/CLASS2/dihedral_class2.cpp +++ b/src/CLASS2/dihedral_class2.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_class2.h" -#include + #include #include #include "atom.h" @@ -27,8 +27,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace MathConst; @@ -639,17 +639,17 @@ void DihedralClass2::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); int count = 0; if (strcmp(arg[1],"mbt") == 0) { if (narg != 6) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double f1_one = force->numeric(FLERR,arg[2]); - double f2_one = force->numeric(FLERR,arg[3]); - double f3_one = force->numeric(FLERR,arg[4]); - double r0_one = force->numeric(FLERR,arg[5]); + double f1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_one = utils::numeric(FLERR,arg[4],false,lmp); + double r0_one = utils::numeric(FLERR,arg[5],false,lmp); for (int i = ilo; i <= ihi; i++) { mbt_f1[i] = f1_one; @@ -664,14 +664,14 @@ void DihedralClass2::coeff(int narg, char **arg) if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double f1_1_one = force->numeric(FLERR,arg[2]); - double f2_1_one = force->numeric(FLERR,arg[3]); - double f3_1_one = force->numeric(FLERR,arg[4]); - double f1_2_one = force->numeric(FLERR,arg[5]); - double f2_2_one = force->numeric(FLERR,arg[6]); - double f3_2_one = force->numeric(FLERR,arg[7]); - double r0_1_one = force->numeric(FLERR,arg[8]); - double r0_2_one = force->numeric(FLERR,arg[9]); + double f1_1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_1_one = utils::numeric(FLERR,arg[4],false,lmp); + double f1_2_one = utils::numeric(FLERR,arg[5],false,lmp); + double f2_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double f3_2_one = utils::numeric(FLERR,arg[7],false,lmp); + double r0_1_one = utils::numeric(FLERR,arg[8],false,lmp); + double r0_2_one = utils::numeric(FLERR,arg[9],false,lmp); for (int i = ilo; i <= ihi; i++) { ebt_f1_1[i] = f1_1_one; @@ -690,14 +690,14 @@ void DihedralClass2::coeff(int narg, char **arg) if (narg != 10) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double f1_1_one = force->numeric(FLERR,arg[2]); - double f2_1_one = force->numeric(FLERR,arg[3]); - double f3_1_one = force->numeric(FLERR,arg[4]); - double f1_2_one = force->numeric(FLERR,arg[5]); - double f2_2_one = force->numeric(FLERR,arg[6]); - double f3_2_one = force->numeric(FLERR,arg[7]); - double theta0_1_one = force->numeric(FLERR,arg[8]); - double theta0_2_one = force->numeric(FLERR,arg[9]); + double f1_1_one = utils::numeric(FLERR,arg[2],false,lmp); + double f2_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double f3_1_one = utils::numeric(FLERR,arg[4],false,lmp); + double f1_2_one = utils::numeric(FLERR,arg[5],false,lmp); + double f2_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double f3_2_one = utils::numeric(FLERR,arg[7],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[8],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[9],false,lmp); // convert theta0's from degrees to radians @@ -717,9 +717,9 @@ void DihedralClass2::coeff(int narg, char **arg) } else if (strcmp(arg[1],"aat") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double k_one = force->numeric(FLERR,arg[2]); - double theta0_1_one = force->numeric(FLERR,arg[3]); - double theta0_2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0's from degrees to radians @@ -734,9 +734,9 @@ void DihedralClass2::coeff(int narg, char **arg) } else if (strcmp(arg[1],"bb13") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double k_one = force->numeric(FLERR,arg[2]); - double r10_one = force->numeric(FLERR,arg[3]); - double r30_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double r10_one = utils::numeric(FLERR,arg[3],false,lmp); + double r30_one = utils::numeric(FLERR,arg[4],false,lmp); for (int i = ilo; i <= ihi; i++) { bb13t_k[i] = k_one; @@ -749,12 +749,12 @@ void DihedralClass2::coeff(int narg, char **arg) } else { if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients"); - double k1_one = force->numeric(FLERR,arg[1]); - double phi1_one = force->numeric(FLERR,arg[2]); - double k2_one = force->numeric(FLERR,arg[3]); - double phi2_one = force->numeric(FLERR,arg[4]); - double k3_one = force->numeric(FLERR,arg[5]); - double phi3_one = force->numeric(FLERR,arg[6]); + double k1_one = utils::numeric(FLERR,arg[1],false,lmp); + double phi1_one = utils::numeric(FLERR,arg[2],false,lmp); + double k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double phi2_one = utils::numeric(FLERR,arg[4],false,lmp); + double k3_one = utils::numeric(FLERR,arg[5],false,lmp); + double phi3_one = utils::numeric(FLERR,arg[6],false,lmp); // convert phi's from degrees to radians @@ -834,45 +834,45 @@ void DihedralClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&mbt_f1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_f3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&mbt_r0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&ebt_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&ebt_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&ebt_r0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&at_f1_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&at_f1_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f2_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_f3_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&at_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&aat_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&aat_theta0_2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); - utils::sfread(FLERR,&bb13t_k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&bb13t_k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r10[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bb13t_r30[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/improper_class2.cpp b/src/CLASS2/improper_class2.cpp index 2d5918fdef..801c21c3b4 100644 --- a/src/CLASS2/improper_class2.cpp +++ b/src/CLASS2/improper_class2.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "improper_class2.h" -#include + #include #include #include "atom.h" @@ -27,8 +27,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace MathConst; @@ -523,19 +523,19 @@ void ImproperClass2::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); int count = 0; if (strcmp(arg[1],"aa") == 0) { if (narg != 8) error->all(FLERR,"Incorrect args for improper coefficients"); - double k1_one = force->numeric(FLERR,arg[2]); - double k2_one = force->numeric(FLERR,arg[3]); - double k3_one = force->numeric(FLERR,arg[4]); - double theta0_1_one = force->numeric(FLERR,arg[5]); - double theta0_2_one = force->numeric(FLERR,arg[6]); - double theta0_3_one = force->numeric(FLERR,arg[7]); + double k1_one = utils::numeric(FLERR,arg[2],false,lmp); + double k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double k3_one = utils::numeric(FLERR,arg[4],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[5],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[6],false,lmp); + double theta0_3_one = utils::numeric(FLERR,arg[7],false,lmp); // convert theta0's from degrees to radians @@ -553,8 +553,8 @@ void ImproperClass2::coeff(int narg, char **arg) } else { if (narg != 3) error->all(FLERR,"Incorrect args for improper coefficients"); - double k0_one = force->numeric(FLERR,arg[1]); - double chi0_one = force->numeric(FLERR,arg[2]); + double k0_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi0 from degrees to radians @@ -598,15 +598,15 @@ void ImproperClass2::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); - utils::sfread(FLERR,&aa_k1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_k2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_k3[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&aa_theta0_3[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&aa_k1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_k2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_k3[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&aa_theta0_3[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/CLASS2/pair_lj_class2.cpp b/src/CLASS2/pair_lj_class2.cpp index 47b3185bbf..fdfaf158ef 100644 --- a/src/CLASS2/pair_lj_class2.cpp +++ b/src/CLASS2/pair_lj_class2.cpp @@ -10,7 +10,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2.h" -#include + #include #include #include "atom.h" @@ -24,7 +24,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -435,7 +435,7 @@ void PairLJClass2::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -457,14 +457,14 @@ void PairLJClass2::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -509,7 +509,7 @@ void PairLJClass2::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -612,13 +612,13 @@ void PairLJClass2::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -647,10 +647,10 @@ void PairLJClass2::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -707,5 +707,5 @@ void *PairLJClass2::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_cut.cpp b/src/CLASS2/pair_lj_class2_coul_cut.cpp index 3635c21c8c..df0019c251 100644 --- a/src/CLASS2/pair_lj_class2_coul_cut.cpp +++ b/src/CLASS2/pair_lj_class2_coul_cut.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2_coul_cut.h" -#include + #include #include #include "atom.h" @@ -23,7 +23,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -194,9 +194,9 @@ void PairLJClass2CoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -223,16 +223,16 @@ void PairLJClass2CoulCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 6) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 5) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 6) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -364,14 +364,14 @@ void PairLJClass2CoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -401,11 +401,11 @@ void PairLJClass2CoulCut::write_restart_settings(FILE *fp) void PairLJClass2CoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -478,6 +478,6 @@ void *PairLJClass2CoulCut::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/CLASS2/pair_lj_class2_coul_long.cpp b/src/CLASS2/pair_lj_class2_coul_long.cpp index 0bb802579c..68a5bd2171 100644 --- a/src/CLASS2/pair_lj_class2_coul_long.cpp +++ b/src/CLASS2/pair_lj_class2_coul_long.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2_coul_long.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -47,8 +47,8 @@ PairLJClass2CoulLong::PairLJClass2CoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - cut_respa = NULL; + ftable = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -607,9 +607,9 @@ void PairLJClass2CoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -633,14 +633,14 @@ void PairLJClass2CoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -691,11 +691,11 @@ void PairLJClass2CoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -807,13 +807,13 @@ void PairLJClass2CoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -844,13 +844,13 @@ void PairLJClass2CoulLong::write_restart_settings(FILE *fp) void PairLJClass2CoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -956,5 +956,5 @@ void *PairLJClass2CoulLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/COLLOID/fix_wall_colloid.cpp b/src/COLLOID/fix_wall_colloid.cpp index 58593a99b1..ef5bfb72e1 100644 --- a/src/COLLOID/fix_wall_colloid.cpp +++ b/src/COLLOID/fix_wall_colloid.cpp @@ -16,10 +16,9 @@ ------------------------------------------------------------------------- */ #include "fix_wall_colloid.h" -#include + #include #include "atom.h" -#include "atom_vec.h" #include "error.h" using namespace LAMMPS_NS; diff --git a/src/COLLOID/pair_brownian.cpp b/src/COLLOID/pair_brownian.cpp index d73789d890..9ec25eeccd 100644 --- a/src/COLLOID/pair_brownian.cpp +++ b/src/COLLOID/pair_brownian.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_brownian.h" -#include + #include #include #include "atom.h" @@ -36,7 +36,7 @@ #include "math_special.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -51,7 +51,7 @@ enum{EDGE,CONSTANT,VARIABLE}; PairBrownian::PairBrownian(LAMMPS *lmp) : Pair(lmp) { single_enable = 0; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -370,18 +370,18 @@ void PairBrownian::settings(int narg, char **arg) { if (narg != 7 && narg != 9) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - flagfld = force->inumeric(FLERR,arg[2]); - cut_inner_global = force->numeric(FLERR,arg[3]); - cut_global = force->numeric(FLERR,arg[4]); - t_target = force->numeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + flagfld = utils::inumeric(FLERR,arg[2],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[3],false,lmp); + cut_global = utils::numeric(FLERR,arg[4],false,lmp); + t_target = utils::numeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); flagHI = flagVF = 1; if (narg == 9) { - flagHI = force->inumeric(FLERR,arg[7]); - flagVF = force->inumeric(FLERR,arg[8]); + flagHI = utils::inumeric(FLERR,arg[7],false,lmp); + flagVF = utils::inumeric(FLERR,arg[8],false,lmp); } if (flaglog == 1 && flagHI == 0) { @@ -419,15 +419,15 @@ void PairBrownian::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 4) { - cut_inner_one = force->numeric(FLERR,arg[2]); - cut_one = force->numeric(FLERR,arg[3]); + cut_inner_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_one = utils::numeric(FLERR,arg[3],false,lmp); } int count = 0; @@ -497,7 +497,7 @@ void PairBrownian::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); @@ -603,12 +603,12 @@ void PairBrownian::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -643,17 +643,17 @@ void PairBrownian::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&t_target, sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed, sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&t_target, sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed, sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_brownian_poly.cpp b/src/COLLOID/pair_brownian_poly.cpp index c3eb4f28a5..c71c0aa3ef 100644 --- a/src/COLLOID/pair_brownian_poly.cpp +++ b/src/COLLOID/pair_brownian_poly.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_brownian_poly.h" -#include + #include #include #include "atom.h" @@ -358,7 +358,7 @@ void PairBrownianPoly::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair brownian"); diff --git a/src/COLLOID/pair_colloid.cpp b/src/COLLOID/pair_colloid.cpp index d1c6e4594f..3ac4d8f2b1 100644 --- a/src/COLLOID/pair_colloid.cpp +++ b/src/COLLOID/pair_colloid.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_colloid.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "math_special.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathSpecial; @@ -246,7 +246,7 @@ void PairColloid::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -269,16 +269,16 @@ void PairColloid::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a12_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double d1_one = force->numeric(FLERR,arg[4]); - double d2_one = force->numeric(FLERR,arg[5]); + double a12_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double d1_one = utils::numeric(FLERR,arg[4],false,lmp); + double d2_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); if (d1_one < 0.0 || d2_one < 0.0) error->all(FLERR,"Invalid d1 or d2 value for pair colloid coeff"); @@ -395,15 +395,15 @@ void PairColloid::read_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (comm->me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (comm->me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (comm->me == 0) { - utils::sfread(FLERR,&a12[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a12[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a12[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -433,9 +433,9 @@ void PairColloid::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricate.cpp b/src/COLLOID/pair_lubricate.cpp index a72eaef679..4e0bf33442 100644 --- a/src/COLLOID/pair_lubricate.cpp +++ b/src/COLLOID/pair_lubricate.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lubricate.h" -#include + #include #include #include "atom.h" @@ -35,7 +35,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -459,16 +459,16 @@ void PairLubricate::settings(int narg, char **arg) { if (narg != 5 && narg != 7) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - flagfld = force->inumeric(FLERR,arg[2]); - cut_inner_global = force->numeric(FLERR,arg[3]); - cut_global = force->numeric(FLERR,arg[4]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + flagfld = utils::inumeric(FLERR,arg[2],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[3],false,lmp); + cut_global = utils::numeric(FLERR,arg[4],false,lmp); flagHI = flagVF = 1; if (narg == 7) { - flagHI = force->inumeric(FLERR,arg[5]); - flagVF = force->inumeric(FLERR,arg[6]); + flagHI = utils::inumeric(FLERR,arg[5],false,lmp); + flagVF = utils::inumeric(FLERR,arg[6],false,lmp); } if (flaglog == 1 && flagHI == 0) { @@ -501,14 +501,14 @@ void PairLubricate::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 4) { - cut_inner_one = force->numeric(FLERR,arg[2]); - cut_one = force->numeric(FLERR,arg[3]); + cut_inner_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_one = utils::numeric(FLERR,arg[3],false,lmp); } int count = 0; @@ -566,7 +566,7 @@ void PairLubricate::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with pair lubricate"); @@ -683,12 +683,12 @@ void PairLubricate::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -721,15 +721,15 @@ void PairLubricate::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagfld,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricateU.cpp b/src/COLLOID/pair_lubricateU.cpp index b0e21256ac..b3420154fb 100644 --- a/src/COLLOID/pair_lubricateU.cpp +++ b/src/COLLOID/pair_lubricateU.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lubricateU.h" -#include + #include #include #include "atom.h" @@ -34,7 +34,7 @@ #include "variable.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -58,10 +58,10 @@ PairLubricateU::PairLubricateU(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; nmax = 0; - fl = Tl = xl = NULL; + fl = Tl = xl = nullptr; cgmax = 0; - bcg = xcg = rcg = rcg1 = pcg = RU = NULL; + bcg = xcg = rcg = rcg1 = pcg = RU = nullptr; // set comm size needed by this Pair @@ -1679,16 +1679,16 @@ void PairLubricateU::settings(int narg, char **arg) { if (narg != 5 && narg != 7) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - cut_inner_global = force->numeric(FLERR,arg[2]); - cut_global = force->numeric(FLERR,arg[3]); - gdot = force->numeric(FLERR,arg[4]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[2],false,lmp); + cut_global = utils::numeric(FLERR,arg[3],false,lmp); + gdot = utils::numeric(FLERR,arg[4],false,lmp); flagHI = flagVF = 1; if (narg == 7) { - flagHI = force->inumeric(FLERR,arg[5]); - flagVF = force->inumeric(FLERR,arg[6]); + flagHI = utils::inumeric(FLERR,arg[5],false,lmp); + flagVF = utils::inumeric(FLERR,arg[6],false,lmp); } if (flaglog == 1 && flagHI == 0) { @@ -1734,14 +1734,14 @@ void PairLubricateU::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 4) { - cut_inner_one = force->numeric(FLERR,arg[2]); - cut_one = force->numeric(FLERR,arg[3]); + cut_inner_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_one = utils::numeric(FLERR,arg[3],false,lmp); } int count = 0; @@ -1794,7 +1794,7 @@ void PairLubricateU::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL) { + else if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " @@ -1909,12 +1909,12 @@ void PairLubricateU::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_inner[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -1946,14 +1946,14 @@ void PairLubricateU::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&flaglog,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagHI,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&flagVF,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mu,1,MPI_DOUBLE,0,world); MPI_Bcast(&flaglog,1,MPI_INT,0,world); diff --git a/src/COLLOID/pair_lubricateU_poly.cpp b/src/COLLOID/pair_lubricateU_poly.cpp index 6b6727172d..501977187b 100644 --- a/src/COLLOID/pair_lubricateU_poly.cpp +++ b/src/COLLOID/pair_lubricateU_poly.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_lubricateU_poly.h" -#include + #include #include #include "atom.h" @@ -1077,15 +1077,15 @@ void PairLubricateUPoly::settings(int narg, char **arg) { if (narg < 5 || narg > 7) error->all(FLERR,"Illegal pair_style command"); - mu = force->numeric(FLERR,arg[0]); - flaglog = force->inumeric(FLERR,arg[1]); - cut_inner_global = force->numeric(FLERR,arg[2]); - cut_global = force->numeric(FLERR,arg[3]); - gdot = force->numeric(FLERR,arg[4]); + mu = utils::numeric(FLERR,arg[0],false,lmp); + flaglog = utils::inumeric(FLERR,arg[1],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[2],false,lmp); + cut_global = utils::numeric(FLERR,arg[3],false,lmp); + gdot = utils::numeric(FLERR,arg[4],false,lmp); flagHI = flagVF = 1; - if (narg >= 6) flagHI = force->inumeric(FLERR,arg[5]); - if (narg == 7) flagVF = force->inumeric(FLERR,arg[6]); + if (narg >= 6) flagHI = utils::inumeric(FLERR,arg[5],false,lmp); + if (narg == 7) flagVF = utils::inumeric(FLERR,arg[6],false,lmp); if (flaglog == 1 && flagHI == 0) { error->warning(FLERR,"Cannot include log terms without 1/r terms; " @@ -1158,7 +1158,7 @@ void PairLubricateUPoly::init_style() for (int i = 0; i < modify->nfix; i++){ if (strcmp(modify->fix[i]->style,"deform") == 0) flagdeform = 1; - else if (strstr(modify->fix[i]->style,"wall") != NULL){ + else if (strstr(modify->fix[i]->style,"wall") != nullptr){ if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " diff --git a/src/COLLOID/pair_lubricate_poly.cpp b/src/COLLOID/pair_lubricate_poly.cpp index e347441cf4..244b37457b 100644 --- a/src/COLLOID/pair_lubricate_poly.cpp +++ b/src/COLLOID/pair_lubricate_poly.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_lubricate_poly.h" -#include + #include #include #include "atom.h" @@ -468,7 +468,7 @@ void PairLubricatePoly::init_style() error->all(FLERR,"Using pair lubricate with inconsistent " "fix deform remap option"); } - if (strstr(modify->fix[i]->style,"wall") != NULL) { + if (strstr(modify->fix[i]->style,"wall") != nullptr) { if (flagwall) error->all(FLERR, "Cannot use multiple fix wall commands with " @@ -478,7 +478,7 @@ void PairLubricatePoly::init_style() if (wallfix->xflag) flagwall = 2; // Moving walls exist } - if (strstr(modify->fix[i]->style,"wall") != NULL){ + if (strstr(modify->fix[i]->style,"wall") != nullptr){ flagwall = 1; // Walls exist if (((FixWall *) modify->fix[i])->xflag ) { flagwall = 2; // Moving walls exist diff --git a/src/COMPRESS/README b/src/COMPRESS/README index 1a31445d0b..617757c476 100644 --- a/src/COMPRESS/README +++ b/src/COMPRESS/README @@ -10,5 +10,9 @@ alternative for compressed file I/O on systems where using a pipe can cause problems, e.g. when using RDMA communication with pinned memory like clusters with Infiniband or Myrinet. +Update 08/2020: Added variants that use the Zstd compression library instead +of zlib. To enable, set -DLAMMPS_ZSTD. These provide a wider range of +compression levels. See http://facebook.github.io/zstd/ for more details. + Currently a few selected dump styles are supported for writing via this packaging. diff --git a/src/COMPRESS/dump_atom_gz.cpp b/src/COMPRESS/dump_atom_gz.cpp index 9be8d17b06..9cc1439e66 100644 --- a/src/COMPRESS/dump_atom_gz.cpp +++ b/src/COMPRESS/dump_atom_gz.cpp @@ -16,14 +16,18 @@ #include "error.h" #include "update.h" + #include + using namespace LAMMPS_NS; DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtom(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; + + compression_level = Z_BEST_COMPRESSION; if (!compressed) error->all(FLERR,"Dump atom/gz only writes compressed files"); @@ -34,8 +38,8 @@ DumpAtomGZ::DumpAtomGZ(LAMMPS *lmp, int narg, char **arg) : DumpAtomGZ::~DumpAtomGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -89,14 +93,17 @@ void DumpAtomGZ::openfile() // each proc with filewriter = 1 opens a file if (filewriter) { + std::string mode; if (append_flag) { - gzFp = gzopen(filecurrent,"ab9"); + mode = fmt::format("ab{}", compression_level); } else { - gzFp = gzopen(filecurrent,"wb9"); + mode = fmt::format("wb{}", compression_level); } - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + gzFp = gzopen(filecurrent, mode.c_str()); + + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -120,14 +127,14 @@ void DumpAtomGZ::write_header(bigint ndump) gzprintf(gzFp,BIGINT_FORMAT "\n",ndump); if (domain->triclinic == 0) { gzprintf(gzFp,"ITEM: BOX BOUNDS %s\n",boundstr); - gzprintf(gzFp,"%g %g\n",boxxlo,boxxhi); - gzprintf(gzFp,"%g %g\n",boxylo,boxyhi); - gzprintf(gzFp,"%g %g\n",boxzlo,boxzhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxylo,boxyhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); } else { gzprintf(gzFp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - gzprintf(gzFp,"%g %g %g\n",boxxlo,boxxhi,boxxy); - gzprintf(gzFp,"%g %g %g\n",boxylo,boxyhi,boxxz); - gzprintf(gzFp,"%g %g %g\n",boxzlo,boxzhi,boxyz); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); } gzprintf(gzFp,"ITEM: ATOMS %s\n",columns); } @@ -148,7 +155,7 @@ void DumpAtomGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); @@ -156,3 +163,21 @@ void DumpAtomGZ::write() } } +/* ---------------------------------------------------------------------- */ + +int DumpAtomGZ::modify_param(int narg, char **arg) +{ + int consumed = DumpAtom::modify_param(narg, arg); + if(consumed == 0) { + if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int min_level = Z_DEFAULT_COMPRESSION; + int max_level = Z_BEST_COMPRESSION; + compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + if (compression_level < min_level || compression_level > max_level) + error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); + return 2; + } + } + return consumed; +} diff --git a/src/COMPRESS/dump_atom_gz.h b/src/COMPRESS/dump_atom_gz.h index bd0ed792f8..0c0b95974f 100644 --- a/src/COMPRESS/dump_atom_gz.h +++ b/src/COMPRESS/dump_atom_gz.h @@ -31,12 +31,15 @@ class DumpAtomGZ : public DumpAtom { virtual ~DumpAtomGZ(); protected: + int compression_level; gzFile gzFp; // file pointer for the compressed output stream virtual void openfile(); virtual void write_header(bigint); virtual void write_data(int, double *); virtual void write(); + + virtual int modify_param(int, char **); }; } diff --git a/src/COMPRESS/dump_atom_zstd.cpp b/src/COMPRESS/dump_atom_zstd.cpp new file mode 100644 index 0000000000..1ea21292e8 --- /dev/null +++ b/src/COMPRESS/dump_atom_zstd.cpp @@ -0,0 +1,195 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#include "domain.h" +#include "dump_atom_zstd.h" +#include "error.h" +#include "file_writer.h" +#include "update.h" + +#include + + +using namespace LAMMPS_NS; + +DumpAtomZstd::DumpAtomZstd(LAMMPS *lmp, int narg, char **arg) : + DumpAtom(lmp, narg, arg) +{ + if (!compressed) + error->all(FLERR,"Dump atom/zstd only writes compressed files"); +} + +/* ---------------------------------------------------------------------- */ + +DumpAtomZstd::~DumpAtomZstd() +{ +} + +/* ---------------------------------------------------------------------- + generic opening of a dump file + ASCII or binary or zstdipped + some derived classes override this function +------------------------------------------------------------------------- */ + +void DumpAtomZstd::openfile() +{ + // single file, already opened, so just return + + if (singlefile_opened) return; + if (multifile == 0) singlefile_opened = 1; + + // if one file per timestep, replace '*' with current timestep + + char *filecurrent = filename; + if (multiproc) filecurrent = multiname; + + if (multifile) { + char *filestar = filecurrent; + filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar,'*'); + *ptr = '\0'; + if (padflag == 0) + sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", + filestar,update->ntimestep,ptr+1); + else { + char bif[8],pad[16]; + strcpy(bif,BIGINT_FORMAT); + sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); + sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); + } + *ptr = '*'; + if (maxfiles > 0) { + if (numfiles < maxfiles) { + nameslist[numfiles] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[numfiles],filecurrent); + ++numfiles; + } else { + remove(nameslist[fileidx]); + delete[] nameslist[fileidx]; + nameslist[fileidx] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[fileidx],filecurrent); + fileidx = (fileidx + 1) % maxfiles; + } + } + } + + // each proc with filewriter = 1 opens a file + + if (filewriter) { + if (append_flag) { + error->one(FLERR, "dump/zstd currently doesn't support append"); + } + + try { + writer.open(filecurrent); + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + + // delete string with timestep replaced + + if (multifile) delete [] filecurrent; +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtomZstd::write_header(bigint ndump) +{ + std::string header; + + if ((multiproc) || (!multiproc && me == 0)) { + if (unit_flag && !unit_count) { + ++unit_count; + header = fmt::format("ITEM: UNITS\n{}\n",update->unit_style); + } + + if (time_flag) { + header += fmt::format("ITEM: TIME\n{0:.16g}\n", compute_time()); + } + + header += fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + header += fmt::format("ITEM: NUMBER OF ATOMS\n{}\n", ndump); + if (domain->triclinic == 0) { + header += fmt::format("ITEM: BOX BOUNDS {}\n", boundstr); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxxlo, boxxhi); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxylo, boxyhi); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxzlo, boxzhi); + } else { + header += fmt::format("ITEM: BOX BOUNDS xy xz yz {}\n", boundstr); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxxlo, boxxhi, boxxy); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxylo, boxyhi, boxxz); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxzlo, boxzhi, boxyz); + } + header += fmt::format("ITEM: ATOMS {}\n", columns); + + writer.write(header.c_str(), header.length()); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtomZstd::write_data(int n, double *mybuf) +{ + writer.write(mybuf, n); +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtomZstd::write() +{ + DumpAtom::write(); + if (filewriter) { + if (multifile) { + writer.close(); + } else { + if (flush_flag && writer.isopen()) { + writer.flush(); + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +int DumpAtomZstd::modify_param(int narg, char **arg) +{ + int consumed = DumpAtom::modify_param(narg, arg); + if(consumed == 0) { + try { + if (strcmp(arg[0],"checksum") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[1],"yes") == 0) writer.setChecksum(true); + else if (strcmp(arg[1],"no") == 0) writer.setChecksum(false); + else error->all(FLERR,"Illegal dump_modify command"); + return 2; + } else if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + writer.setCompressionLevel(compression_level); + return 2; + } + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + return consumed; +} + +#endif diff --git a/src/COMPRESS/dump_atom_zstd.h b/src/COMPRESS/dump_atom_zstd.h new file mode 100644 index 0000000000..30108eeee9 --- /dev/null +++ b/src/COMPRESS/dump_atom_zstd.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#ifdef DUMP_CLASS + +DumpStyle(atom/zstd,DumpAtomZstd) + +#else + +#ifndef LMP_DUMP_ATOM_ZSTD_H +#define LMP_DUMP_ATOM_ZSTD_H + +#include "dump_atom.h" +#include "zstd_file_writer.h" + +namespace LAMMPS_NS { + +class DumpAtomZstd : public DumpAtom { + public: + DumpAtomZstd(class LAMMPS *, int, char **); + virtual ~DumpAtomZstd(); + + protected: + ZstdFileWriter writer; + + virtual void openfile(); + virtual void write_header(bigint); + virtual void write_data(int, double *); + virtual void write(); + + virtual int modify_param(int, char **); +}; + +} + +#endif +#endif +#endif + +/* ERROR/WARNING messages: + +E: Dump atom/zstd only writes compressed files + +The dump atom/zstd output file name must have a .zst suffix. + +E: Cannot open dump file + +Self-explanatory. + +*/ diff --git a/src/COMPRESS/dump_cfg_gz.cpp b/src/COMPRESS/dump_cfg_gz.cpp index aaeb878584..b6a94e587d 100644 --- a/src/COMPRESS/dump_cfg_gz.cpp +++ b/src/COMPRESS/dump_cfg_gz.cpp @@ -17,15 +17,19 @@ #include "error.h" #include "update.h" + #include + using namespace LAMMPS_NS; #define UNWRAPEXPAND 10.0 DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFG(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; + + compression_level = Z_BEST_COMPRESSION; if (!compressed) error->all(FLERR,"Dump cfg/gz only writes compressed files"); @@ -37,8 +41,8 @@ DumpCFGGZ::DumpCFGGZ(LAMMPS *lmp, int narg, char **arg) : DumpCFGGZ::~DumpCFGGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -93,14 +97,17 @@ void DumpCFGGZ::openfile() // each proc with filewriter = 1 opens a file if (filewriter) { + std::string mode; if (append_flag) { - gzFp = gzopen(filecurrent,"ab9"); + mode = fmt::format("ab{}", compression_level); } else { - gzFp = gzopen(filecurrent,"wb9"); + mode = fmt::format("wb{}", compression_level); } - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + gzFp = gzopen(filecurrent, mode.c_str()); + + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -156,7 +163,7 @@ void DumpCFGGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); @@ -164,3 +171,22 @@ void DumpCFGGZ::write() } } +/* ---------------------------------------------------------------------- */ + +int DumpCFGGZ::modify_param(int narg, char **arg) +{ + int consumed = DumpCFG::modify_param(narg, arg); + if(consumed == 0) { + if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int min_level = Z_DEFAULT_COMPRESSION; + int max_level = Z_BEST_COMPRESSION; + compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + if (compression_level < min_level || compression_level > max_level) + error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); + return 2; + } + } + return consumed; +} + diff --git a/src/COMPRESS/dump_cfg_gz.h b/src/COMPRESS/dump_cfg_gz.h index aefde431cf..0c6ed24f06 100644 --- a/src/COMPRESS/dump_cfg_gz.h +++ b/src/COMPRESS/dump_cfg_gz.h @@ -31,12 +31,15 @@ class DumpCFGGZ : public DumpCFG { virtual ~DumpCFGGZ(); protected: + int compression_level; gzFile gzFp; // file pointer for the compressed output stream virtual void openfile(); virtual void write_header(bigint); virtual void write_data(int, double *); virtual void write(); + + virtual int modify_param(int, char **); }; } diff --git a/src/COMPRESS/dump_cfg_zstd.cpp b/src/COMPRESS/dump_cfg_zstd.cpp new file mode 100644 index 0000000000..3f2ae5425b --- /dev/null +++ b/src/COMPRESS/dump_cfg_zstd.cpp @@ -0,0 +1,196 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#include "atom.h" +#include "domain.h" +#include "dump_cfg_zstd.h" +#include "error.h" +#include "file_writer.h" +#include "update.h" + +#include + +using namespace LAMMPS_NS; +#define UNWRAPEXPAND 10.0 + +DumpCFGZstd::DumpCFGZstd(LAMMPS *lmp, int narg, char **arg) : + DumpCFG(lmp, narg, arg) +{ + if (!compressed) + error->all(FLERR,"Dump cfg/zstd only writes compressed files"); +} + + +/* ---------------------------------------------------------------------- */ + +DumpCFGZstd::~DumpCFGZstd() +{ +} + + +/* ---------------------------------------------------------------------- + generic opening of a dump file + ASCII or binary or zstdipped + some derived classes override this function +------------------------------------------------------------------------- */ + +void DumpCFGZstd::openfile() +{ + // single file, already opened, so just return + + if (singlefile_opened) return; + if (multifile == 0) singlefile_opened = 1; + + // if one file per timestep, replace '*' with current timestep + + char *filecurrent = filename; + if (multiproc) filecurrent = multiname; + + if (multifile) { + char *filestar = filecurrent; + filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar,'*'); + *ptr = '\0'; + if (padflag == 0) + sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", + filestar,update->ntimestep,ptr+1); + else { + char bif[8],pad[16]; + strcpy(bif,BIGINT_FORMAT); + sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); + sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); + } + *ptr = '*'; + if (maxfiles > 0) { + if (numfiles < maxfiles) { + nameslist[numfiles] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[numfiles],filecurrent); + ++numfiles; + } else { + remove(nameslist[fileidx]); + delete[] nameslist[fileidx]; + nameslist[fileidx] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[fileidx],filecurrent); + fileidx = (fileidx + 1) % maxfiles; + } + } + } + + // each proc with filewriter = 1 opens a file + + if (filewriter) { + if (append_flag) { + error->one(FLERR, "dump cfg/zstd currently doesn't support append"); + } + + try { + writer.open(filecurrent); + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + + // delete string with timestep replaced + + if (multifile) delete [] filecurrent; +} + +/* ---------------------------------------------------------------------- */ + +void DumpCFGZstd::write_header(bigint n) +{ + // set scale factor used by AtomEye for CFG viz + // default = 1.0 + // for peridynamics, set to pre-computed PD scale factor + // so PD particles mimic C atoms + // for unwrapped coords, set to UNWRAPEXPAND (10.0) + // so molecules are not split across periodic box boundaries + + double scale = 1.0; + if (atom->peri_flag) scale = atom->pdscale; + else if (unwrapflag == 1) scale = UNWRAPEXPAND; + + std::string header = fmt::format("Number of particles = {}\n", n); + header += fmt::format("A = {0:g} Angstrom (basic length-scale)\n", scale); + header += fmt::format("H0(1,1) = {0:g} A\n",domain->xprd); + header += fmt::format("H0(1,2) = 0 A \n"); + header += fmt::format("H0(1,3) = 0 A \n"); + header += fmt::format("H0(2,1) = {0:g} A \n",domain->xy); + header += fmt::format("H0(2,2) = {0:g} A\n",domain->yprd); + header += fmt::format("H0(2,3) = 0 A \n"); + header += fmt::format("H0(3,1) = {0:g} A \n",domain->xz); + header += fmt::format("H0(3,2) = {0:g} A \n",domain->yz); + header += fmt::format("H0(3,3) = {0:g} A\n",domain->zprd); + header += fmt::format(".NO_VELOCITY.\n"); + header += fmt::format("entry_count = {}\n",nfield-2); + for (int i = 0; i < nfield-5; i++) + header += fmt::format("auxiliary[{}] = {}\n",i,auxname[i]); + + writer.write(header.c_str(), header.length()); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCFGZstd::write_data(int n, double *mybuf) +{ + writer.write(mybuf, n); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCFGZstd::write() +{ + DumpCFG::write(); + if (filewriter) { + if (multifile) { + writer.close(); + } else { + if (flush_flag && writer.isopen()) { + writer.flush(); + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +int DumpCFGZstd::modify_param(int narg, char **arg) +{ + int consumed = DumpCFG::modify_param(narg, arg); + if(consumed == 0) { + try { + if (strcmp(arg[0],"checksum") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[1],"yes") == 0) writer.setChecksum(true); + else if (strcmp(arg[1],"no") == 0) writer.setChecksum(false); + else error->all(FLERR,"Illegal dump_modify command"); + return 2; + } else if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + writer.setCompressionLevel(compression_level); + return 2; + } + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + return consumed; +} +#endif diff --git a/src/COMPRESS/dump_cfg_zstd.h b/src/COMPRESS/dump_cfg_zstd.h new file mode 100644 index 0000000000..6f4fe8face --- /dev/null +++ b/src/COMPRESS/dump_cfg_zstd.h @@ -0,0 +1,65 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD +#ifdef DUMP_CLASS + +DumpStyle(cfg/zstd,DumpCFGZstd) + +#else + +#ifndef LMP_DUMP_CFG_ZSTD_H +#define LMP_DUMP_CFG_ZSTD_H + +#include "dump_cfg.h" +#include "zstd_file_writer.h" + +namespace LAMMPS_NS { + +class DumpCFGZstd : public DumpCFG { + public: + DumpCFGZstd(class LAMMPS *, int, char **); + virtual ~DumpCFGZstd(); + + protected: + ZstdFileWriter writer; + + virtual void openfile(); + virtual void write_header(bigint); + virtual void write_data(int, double *); + virtual void write(); + + virtual int modify_param(int, char **); +}; + +} + +#endif +#endif +#endif + +/* ERROR/WARNING messages: + +E: Dump cfg/zstd only writes compressed files + +The dump cfg/zstd output file name must have a .zstd suffix. + +E: Cannot open dump file + +Self-explanatory. + +*/ diff --git a/src/COMPRESS/dump_custom_gz.cpp b/src/COMPRESS/dump_custom_gz.cpp index 58ce98ad06..af37ff0a1d 100644 --- a/src/COMPRESS/dump_custom_gz.cpp +++ b/src/COMPRESS/dump_custom_gz.cpp @@ -16,14 +16,18 @@ #include "error.h" #include "update.h" + #include + using namespace LAMMPS_NS; DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustom(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; + + compression_level = Z_BEST_COMPRESSION; if (!compressed) error->all(FLERR,"Dump custom/gz only writes compressed files"); @@ -35,8 +39,8 @@ DumpCustomGZ::DumpCustomGZ(LAMMPS *lmp, int narg, char **arg) : DumpCustomGZ::~DumpCustomGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -91,14 +95,17 @@ void DumpCustomGZ::openfile() // each proc with filewriter = 1 opens a file if (filewriter) { + std::string mode; if (append_flag) { - gzFp = gzopen(filecurrent,"ab9"); + mode = fmt::format("ab{}", compression_level); } else { - gzFp = gzopen(filecurrent,"wb9"); + mode = fmt::format("wb{}", compression_level); } - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + gzFp = gzopen(filecurrent, mode.c_str()); + + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -120,14 +127,14 @@ void DumpCustomGZ::write_header(bigint ndump) gzprintf(gzFp,BIGINT_FORMAT "\n",ndump); if (domain->triclinic == 0) { gzprintf(gzFp,"ITEM: BOX BOUNDS %s\n",boundstr); - gzprintf(gzFp,"%-1.16g %-1.16g\n",boxxlo,boxxhi); - gzprintf(gzFp,"%-1.16g %-1.16g\n",boxylo,boxyhi); - gzprintf(gzFp,"%-1.16g %-1.16g\n",boxzlo,boxzhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxylo,boxyhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); } else { gzprintf(gzFp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxxlo,boxxhi,boxxy); - gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxylo,boxyhi,boxxz); - gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxzlo,boxzhi,boxyz); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); } gzprintf(gzFp,"ITEM: ATOMS %s\n",columns); } @@ -148,7 +155,7 @@ void DumpCustomGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); @@ -156,3 +163,21 @@ void DumpCustomGZ::write() } } +/* ---------------------------------------------------------------------- */ + +int DumpCustomGZ::modify_param(int narg, char **arg) +{ + int consumed = DumpCustom::modify_param(narg, arg); + if(consumed == 0) { + if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int min_level = Z_DEFAULT_COMPRESSION; + int max_level = Z_BEST_COMPRESSION; + compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + if (compression_level < min_level || compression_level > max_level) + error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); + return 2; + } + } + return consumed; +} diff --git a/src/COMPRESS/dump_custom_gz.h b/src/COMPRESS/dump_custom_gz.h index 3a75673ab5..184f3563f1 100644 --- a/src/COMPRESS/dump_custom_gz.h +++ b/src/COMPRESS/dump_custom_gz.h @@ -31,12 +31,15 @@ class DumpCustomGZ : public DumpCustom { virtual ~DumpCustomGZ(); protected: + int compression_level; gzFile gzFp; // file pointer for the compressed output stream virtual void openfile(); virtual void write_header(bigint); virtual void write_data(int, double *); virtual void write(); + + virtual int modify_param(int, char **); }; } diff --git a/src/COMPRESS/dump_custom_zstd.cpp b/src/COMPRESS/dump_custom_zstd.cpp new file mode 100644 index 0000000000..0925652455 --- /dev/null +++ b/src/COMPRESS/dump_custom_zstd.cpp @@ -0,0 +1,195 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#include "domain.h" +#include "dump_custom_zstd.h" +#include "error.h" +#include "file_writer.h" +#include "update.h" + +#include + + +using namespace LAMMPS_NS; + +DumpCustomZstd::DumpCustomZstd(LAMMPS *lmp, int narg, char **arg) : + DumpCustom(lmp, narg, arg) +{ + if (!compressed) + error->all(FLERR,"Dump custom/zstd only writes compressed files"); +} + +/* ---------------------------------------------------------------------- */ + +DumpCustomZstd::~DumpCustomZstd() +{ +} + +/* ---------------------------------------------------------------------- + generic opening of a dump file + ASCII or binary or gzipped + some derived classes override this function +------------------------------------------------------------------------- */ + +void DumpCustomZstd::openfile() +{ + // single file, already opened, so just return + + if (singlefile_opened) return; + if (multifile == 0) singlefile_opened = 1; + + // if one file per timestep, replace '*' with current timestep + + char *filecurrent = filename; + if (multiproc) filecurrent = multiname; + + if (multifile) { + char *filestar = filecurrent; + filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar,'*'); + *ptr = '\0'; + if (padflag == 0) + sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", + filestar,update->ntimestep,ptr+1); + else { + char bif[8],pad[16]; + strcpy(bif,BIGINT_FORMAT); + sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); + sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); + } + *ptr = '*'; + if (maxfiles > 0) { + if (numfiles < maxfiles) { + nameslist[numfiles] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[numfiles],filecurrent); + ++numfiles; + } else { + remove(nameslist[fileidx]); + delete[] nameslist[fileidx]; + nameslist[fileidx] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[fileidx],filecurrent); + fileidx = (fileidx + 1) % maxfiles; + } + } + } + + // each proc with filewriter = 1 opens a file + + if (filewriter) { + if (append_flag) { + error->one(FLERR, "dump/zstd currently doesn't support append"); + } + + try { + writer.open(filecurrent); + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + + // delete string with timestep replaced + + if (multifile) delete [] filecurrent; +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustomZstd::write_header(bigint ndump) +{ + std::string header; + + if ((multiproc) || (!multiproc && me == 0)) { + if (unit_flag && !unit_count) { + ++unit_count; + header = fmt::format("ITEM: UNITS\n{}\n",update->unit_style); + } + + if (time_flag) { + header += fmt::format("ITEM: TIME\n{0:.16g}\n", compute_time()); + } + + header += fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + header += fmt::format("ITEM: NUMBER OF ATOMS\n{}\n", ndump); + if (domain->triclinic == 0) { + header += fmt::format("ITEM: BOX BOUNDS {}\n", boundstr); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxxlo, boxxhi); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxylo, boxyhi); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxzlo, boxzhi); + } else { + header += fmt::format("ITEM: BOX BOUNDS xy xz yz {}\n", boundstr); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxxlo, boxxhi, boxxy); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxylo, boxyhi, boxxz); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxzlo, boxzhi, boxyz); + } + header += fmt::format("ITEM: ATOMS {}\n", columns); + + writer.write(header.c_str(), header.length()); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustomZstd::write_data(int n, double *mybuf) +{ + writer.write(mybuf, n); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustomZstd::write() +{ + DumpCustom::write(); + if (filewriter) { + if (multifile) { + writer.close(); + } else { + if (flush_flag && writer.isopen()) { + writer.flush(); + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +int DumpCustomZstd::modify_param(int narg, char **arg) +{ + int consumed = DumpCustom::modify_param(narg, arg); + if(consumed == 0) { + try { + if (strcmp(arg[0],"checksum") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[1],"yes") == 0) writer.setChecksum(true); + else if (strcmp(arg[1],"no") == 0) writer.setChecksum(false); + else error->all(FLERR,"Illegal dump_modify command"); + return 2; + } else if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + writer.setCompressionLevel(compression_level); + return 2; + } + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + return consumed; +} + +#endif diff --git a/src/COMPRESS/dump_custom_zstd.h b/src/COMPRESS/dump_custom_zstd.h new file mode 100644 index 0000000000..ce3f1325c5 --- /dev/null +++ b/src/COMPRESS/dump_custom_zstd.h @@ -0,0 +1,67 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#ifdef DUMP_CLASS + +DumpStyle(custom/zstd,DumpCustomZstd) + +#else + +#ifndef LMP_DUMP_CUSTOM_ZSTD_H +#define LMP_DUMP_CUSTOM_ZSTD_H + +#include "dump_custom.h" +#include "zstd_file_writer.h" +#include + +namespace LAMMPS_NS { + +class DumpCustomZstd : public DumpCustom { + public: + DumpCustomZstd(class LAMMPS *, int, char **); + virtual ~DumpCustomZstd(); + + protected: + ZstdFileWriter writer; + + virtual void openfile(); + virtual void write_header(bigint); + virtual void write_data(int, double *); + virtual void write(); + + virtual int modify_param(int, char **); +}; + +} + +#endif +#endif +#endif + +/* ERROR/WARNING messages: + +E: Dump custom/zstd only writes compressed files + +The dump custom/zstd output file name must have a .zst suffix. + +E: Cannot open dump file + +Self-explanatory. + +*/ diff --git a/src/COMPRESS/dump_local_gz.cpp b/src/COMPRESS/dump_local_gz.cpp index c27c795f75..fc7b534727 100644 --- a/src/COMPRESS/dump_local_gz.cpp +++ b/src/COMPRESS/dump_local_gz.cpp @@ -16,14 +16,18 @@ #include "error.h" #include "update.h" + #include + using namespace LAMMPS_NS; DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocal(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; + + compression_level = Z_BEST_COMPRESSION; if (!compressed) error->all(FLERR,"Dump local/gz only writes compressed files"); @@ -35,8 +39,8 @@ DumpLocalGZ::DumpLocalGZ(LAMMPS *lmp, int narg, char **arg) : DumpLocalGZ::~DumpLocalGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -91,14 +95,17 @@ void DumpLocalGZ::openfile() // each proc with filewriter = 1 opens a file if (filewriter) { + std::string mode; if (append_flag) { - gzFp = gzopen(filecurrent,"ab9"); + mode = fmt::format("ab{}", compression_level); } else { - gzFp = gzopen(filecurrent,"wb9"); + mode = fmt::format("wb{}", compression_level); } - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + gzFp = gzopen(filecurrent, mode.c_str()); + + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -116,18 +123,18 @@ void DumpLocalGZ::write_header(bigint ndump) gzprintf(gzFp,"ITEM: TIMESTEP\n"); gzprintf(gzFp,BIGINT_FORMAT "\n",update->ntimestep); - gzprintf(gzFp,"ITEM: NUMBER OF ATOMS\n"); + gzprintf(gzFp,"ITEM: NUMBER OF %s\n",label); gzprintf(gzFp,BIGINT_FORMAT "\n",ndump); - if (domain->triclinic == 0) { - gzprintf(gzFp,"ITEM: BOX BOUNDS %s\n",boundstr); - gzprintf(gzFp,"%-1.16g %-1.16g\n",boxxlo,boxxhi); - gzprintf(gzFp,"%-1.16g %-1.16g\n",boxylo,boxyhi); - gzprintf(gzFp,"%-1.16g %-1.16g\n",boxzlo,boxzhi); - } else { + if (domain->triclinic) { gzprintf(gzFp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxxlo,boxxhi,boxxy); - gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxylo,boxyhi,boxxz); - gzprintf(gzFp,"%-1.16g %-1.16g %-1.16g\n",boxzlo,boxzhi,boxyz); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); + gzprintf(gzFp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); + } else { + gzprintf(gzFp,"ITEM: BOX BOUNDS %s\n",boundstr); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxylo,boxyhi); + gzprintf(gzFp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); } gzprintf(gzFp,"ITEM: %s %s\n",label,columns); } @@ -163,7 +170,7 @@ void DumpLocalGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); @@ -171,3 +178,21 @@ void DumpLocalGZ::write() } } +/* ---------------------------------------------------------------------- */ + +int DumpLocalGZ::modify_param(int narg, char **arg) +{ + int consumed = DumpLocal::modify_param(narg, arg); + if(consumed == 0) { + if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int min_level = Z_DEFAULT_COMPRESSION; + int max_level = Z_BEST_COMPRESSION; + compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + if (compression_level < min_level || compression_level > max_level) + error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); + return 2; + } + } + return consumed; +} diff --git a/src/COMPRESS/dump_local_gz.h b/src/COMPRESS/dump_local_gz.h index cc788863de..b3f7c7dcf8 100644 --- a/src/COMPRESS/dump_local_gz.h +++ b/src/COMPRESS/dump_local_gz.h @@ -31,12 +31,15 @@ class DumpLocalGZ : public DumpLocal { virtual ~DumpLocalGZ(); protected: + int compression_level; gzFile gzFp; // file pointer for the compressed output stream virtual void openfile(); virtual void write_header(bigint); virtual void write_data(int, double *); virtual void write(); + + virtual int modify_param(int, char **); }; } diff --git a/src/COMPRESS/dump_local_zstd.cpp b/src/COMPRESS/dump_local_zstd.cpp new file mode 100644 index 0000000000..9c7c2fed34 --- /dev/null +++ b/src/COMPRESS/dump_local_zstd.cpp @@ -0,0 +1,195 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#include "dump_local_zstd.h" +#include "domain.h" +#include "error.h" +#include "update.h" + + +#include + + +using namespace LAMMPS_NS; + +DumpLocalZstd::DumpLocalZstd(LAMMPS *lmp, int narg, char **arg) : + DumpLocal(lmp, narg, arg) +{ + if (!compressed) + error->all(FLERR,"Dump local/zstd only writes compressed files"); +} + + +/* ---------------------------------------------------------------------- */ + +DumpLocalZstd::~DumpLocalZstd() +{ +} + + +/* ---------------------------------------------------------------------- + generic opening of a dump file + ASCII or binary or gzipped + some derived classes override this function +------------------------------------------------------------------------- */ + +void DumpLocalZstd::openfile() +{ + // single file, already opened, so just return + + if (singlefile_opened) return; + if (multifile == 0) singlefile_opened = 1; + + // if one file per timestep, replace '*' with current timestep + + char *filecurrent = filename; + if (multiproc) filecurrent = multiname; + + if (multifile) { + char *filestar = filecurrent; + filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar,'*'); + *ptr = '\0'; + if (padflag == 0) + sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", + filestar,update->ntimestep,ptr+1); + else { + char bif[8],pad[16]; + strcpy(bif,BIGINT_FORMAT); + sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); + sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); + } + *ptr = '*'; + if (maxfiles > 0) { + if (numfiles < maxfiles) { + nameslist[numfiles] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[numfiles],filecurrent); + ++numfiles; + } else { + remove(nameslist[fileidx]); + delete[] nameslist[fileidx]; + nameslist[fileidx] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[fileidx],filecurrent); + fileidx = (fileidx + 1) % maxfiles; + } + } + } + + // each proc with filewriter = 1 opens a file + + if (filewriter) { + if (append_flag) { + error->one(FLERR, "dump cfg/zstd currently doesn't support append"); + } + + try { + writer.open(filecurrent); + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + + // delete string with timestep replaced + + if (multifile) delete [] filecurrent; +} + +void DumpLocalZstd::write_header(bigint ndump) +{ + std::string header; + + if ((multiproc) || (!multiproc && me == 0)) { + if (unit_flag && !unit_count) { + ++unit_count; + header = fmt::format("ITEM: UNITS\n{}\n",update->unit_style); + } + + if (time_flag) { + header += fmt::format("ITEM: TIME\n{0:.16g}\n", compute_time()); + } + + header += fmt::format("ITEM: TIMESTEP\n{}\n", update->ntimestep); + header += fmt::format("ITEM: NUMBER OF {}\n{}\n", label, ndump); + if (domain->triclinic == 0) { + header += fmt::format("ITEM: BOX BOUNDS {}\n", boundstr); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxxlo, boxxhi); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxylo, boxyhi); + header += fmt::format("{0:-1.16e} {1:-1.16e}\n", boxzlo, boxzhi); + } else { + header += fmt::format("ITEM: BOX BOUNDS xy xz yz {}\n", boundstr); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxxlo, boxxhi, boxxy); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxylo, boxyhi, boxxz); + header += fmt::format("{0:-1.16e} {1:-1.16e} {2:-1.16e}\n", boxzlo, boxzhi, boxyz); + } + header += fmt::format("ITEM: {} {}\n", label, columns); + + writer.write(header.c_str(), header.length()); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpLocalZstd::write_data(int n, double *mybuf) +{ + writer.write(mybuf, sizeof(char)*n); +} + +/* ---------------------------------------------------------------------- */ + +void DumpLocalZstd::write() +{ + DumpLocal::write(); + if (filewriter) { + if (multifile) { + writer.close(); + } else { + if (flush_flag && writer.isopen()) { + writer.flush(); + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +int DumpLocalZstd::modify_param(int narg, char **arg) +{ + int consumed = DumpLocal::modify_param(narg, arg); + if(consumed == 0) { + try { + if (strcmp(arg[0],"checksum") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[1],"yes") == 0) writer.setChecksum(true); + else if (strcmp(arg[1],"no") == 0) writer.setChecksum(false); + else error->all(FLERR,"Illegal dump_modify command"); + return 2; + } else if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + writer.setCompressionLevel(compression_level); + return 2; + } + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + return consumed; +} + +#endif diff --git a/src/COMPRESS/dump_local_zstd.h b/src/COMPRESS/dump_local_zstd.h new file mode 100644 index 0000000000..398b1c3337 --- /dev/null +++ b/src/COMPRESS/dump_local_zstd.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#ifdef DUMP_CLASS + +DumpStyle(local/zstd,DumpLocalZstd) + +#else + +#ifndef LMP_DUMP_LOCAL_ZSTD_H +#define LMP_DUMP_LOCAL_ZSTD_H + +#include "dump_local.h" +#include "zstd_file_writer.h" + +namespace LAMMPS_NS { + +class DumpLocalZstd : public DumpLocal { + public: + DumpLocalZstd(class LAMMPS *, int, char **); + virtual ~DumpLocalZstd(); + + protected: + ZstdFileWriter writer; + + virtual void openfile(); + virtual void write_header(bigint); + virtual void write_data(int, double *); + virtual void write(); + + virtual int modify_param(int, char **); +}; + +} + +#endif +#endif +#endif + +/* ERROR/WARNING messages: + +E: Dump local/zstd only writes compressed files + +The dump local/zstd output file name must have a .zst suffix. + +E: Cannot open dump file + +Self-explanatory. + +*/ diff --git a/src/COMPRESS/dump_xyz_gz.cpp b/src/COMPRESS/dump_xyz_gz.cpp index c76b7afa17..24b4a7a070 100644 --- a/src/COMPRESS/dump_xyz_gz.cpp +++ b/src/COMPRESS/dump_xyz_gz.cpp @@ -15,14 +15,18 @@ #include "error.h" #include "update.h" + #include + using namespace LAMMPS_NS; DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZ(lmp, narg, arg) { - gzFp = NULL; + gzFp = nullptr; + + compression_level = Z_BEST_COMPRESSION; if (!compressed) error->all(FLERR,"Dump xyz/gz only writes compressed files"); @@ -34,8 +38,8 @@ DumpXYZGZ::DumpXYZGZ(LAMMPS *lmp, int narg, char **arg) : DumpXYZGZ::~DumpXYZGZ() { if (gzFp) gzclose(gzFp); - gzFp = NULL; - fp = NULL; + gzFp = nullptr; + fp = nullptr; } @@ -90,14 +94,17 @@ void DumpXYZGZ::openfile() // each proc with filewriter = 1 opens a file if (filewriter) { + std::string mode; if (append_flag) { - gzFp = gzopen(filecurrent,"ab9"); + mode = fmt::format("ab{}", compression_level); } else { - gzFp = gzopen(filecurrent,"wb9"); + mode = fmt::format("wb{}", compression_level); } - if (gzFp == NULL) error->one(FLERR,"Cannot open dump file"); - } else gzFp = NULL; + gzFp = gzopen(filecurrent, mode.c_str()); + + if (gzFp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else gzFp = nullptr; // delete string with timestep replaced @@ -127,10 +134,29 @@ void DumpXYZGZ::write() if (filewriter) { if (multifile) { gzclose(gzFp); - gzFp = NULL; + gzFp = nullptr; } else { if (flush_flag) gzflush(gzFp,Z_SYNC_FLUSH); } } } + +/* ---------------------------------------------------------------------- */ + +int DumpXYZGZ::modify_param(int narg, char **arg) +{ + int consumed = DumpXYZ::modify_param(narg, arg); + if(consumed == 0) { + if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int min_level = Z_DEFAULT_COMPRESSION; + int max_level = Z_BEST_COMPRESSION; + compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + if (compression_level < min_level || compression_level > max_level) + error->all(FLERR, fmt::format("Illegal dump_modify command: compression level must in the range of [{}, {}]", min_level, max_level)); + return 2; + } + } + return consumed; +} diff --git a/src/COMPRESS/dump_xyz_gz.h b/src/COMPRESS/dump_xyz_gz.h index 45d5456ddb..834db488a5 100644 --- a/src/COMPRESS/dump_xyz_gz.h +++ b/src/COMPRESS/dump_xyz_gz.h @@ -31,12 +31,15 @@ class DumpXYZGZ : public DumpXYZ { virtual ~DumpXYZGZ(); protected: + int compression_level; gzFile gzFp; // file pointer for the compressed output stream virtual void openfile(); virtual void write_header(bigint); virtual void write_data(int, double *); virtual void write(); + + virtual int modify_param(int, char **); }; } diff --git a/src/COMPRESS/dump_xyz_zstd.cpp b/src/COMPRESS/dump_xyz_zstd.cpp new file mode 100644 index 0000000000..5e871d7d87 --- /dev/null +++ b/src/COMPRESS/dump_xyz_zstd.cpp @@ -0,0 +1,169 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#include "dump_xyz_zstd.h" +#include "error.h" +#include "file_writer.h" +#include "update.h" + +#include + +using namespace LAMMPS_NS; + +DumpXYZZstd::DumpXYZZstd(LAMMPS *lmp, int narg, char **arg) : + DumpXYZ(lmp, narg, arg) +{ + if (!compressed) + error->all(FLERR,"Dump xyz/zstd only writes compressed files"); +} + + +/* ---------------------------------------------------------------------- */ + +DumpXYZZstd::~DumpXYZZstd() +{ +} + + +/* ---------------------------------------------------------------------- + generic opening of a dump file + ASCII or binary or gzipped + some derived classes override this function +------------------------------------------------------------------------- */ + +void DumpXYZZstd::openfile() +{ + // single file, already opened, so just return + + if (singlefile_opened) return; + if (multifile == 0) singlefile_opened = 1; + + // if one file per timestep, replace '*' with current timestep + + char *filecurrent = filename; + if (multiproc) filecurrent = multiname; + + if (multifile) { + char *filestar = filecurrent; + filecurrent = new char[strlen(filestar) + 16]; + char *ptr = strchr(filestar,'*'); + *ptr = '\0'; + if (padflag == 0) + sprintf(filecurrent,"%s" BIGINT_FORMAT "%s", + filestar,update->ntimestep,ptr+1); + else { + char bif[8],pad[16]; + strcpy(bif,BIGINT_FORMAT); + sprintf(pad,"%%s%%0%d%s%%s",padflag,&bif[1]); + sprintf(filecurrent,pad,filestar,update->ntimestep,ptr+1); + } + *ptr = '*'; + if (maxfiles > 0) { + if (numfiles < maxfiles) { + nameslist[numfiles] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[numfiles],filecurrent); + ++numfiles; + } else { + remove(nameslist[fileidx]); + delete[] nameslist[fileidx]; + nameslist[fileidx] = new char[strlen(filecurrent)+1]; + strcpy(nameslist[fileidx],filecurrent); + fileidx = (fileidx + 1) % maxfiles; + } + } + } + + // each proc with filewriter = 1 opens a file + + if (filewriter) { + if (append_flag) { + error->one(FLERR, "dump cfg/zstd currently doesn't support append"); + } + + try { + writer.open(filecurrent); + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + + // delete string with timestep replaced + + if (multifile) delete [] filecurrent; +} + +void DumpXYZZstd::write_header(bigint ndump) +{ + if (me == 0) { + std::string header = fmt::format("{}\n", ndump); + header += fmt::format("Atoms. Timestep: {}\n", update->ntimestep); + writer.write(header.c_str(), header.length()); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpXYZZstd::write_data(int n, double *mybuf) +{ + writer.write(mybuf, n); +} + +/* ---------------------------------------------------------------------- */ + +void DumpXYZZstd::write() +{ + DumpXYZ::write(); + if (filewriter) { + if (multifile) { + writer.close(); + } else { + if (flush_flag && writer.isopen()) { + writer.flush(); + } + } + } +} + +/* ---------------------------------------------------------------------- */ + +int DumpXYZZstd::modify_param(int narg, char **arg) +{ + int consumed = DumpXYZ::modify_param(narg, arg); + if(consumed == 0) { + try { + if (strcmp(arg[0],"checksum") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + if (strcmp(arg[1],"yes") == 0) writer.setChecksum(true); + else if (strcmp(arg[1],"no") == 0) writer.setChecksum(false); + else error->all(FLERR,"Illegal dump_modify command"); + return 2; + } else if (strcmp(arg[0],"compression_level") == 0) { + if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); + int compression_level = utils::inumeric(FLERR, arg[1], false, lmp); + writer.setCompressionLevel(compression_level); + return 2; + } + } catch (FileWriterException &e) { + error->one(FLERR, e.what()); + } + } + return consumed; +} + +#endif diff --git a/src/COMPRESS/dump_xyz_zstd.h b/src/COMPRESS/dump_xyz_zstd.h new file mode 100644 index 0000000000..2422341557 --- /dev/null +++ b/src/COMPRESS/dump_xyz_zstd.h @@ -0,0 +1,66 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#ifdef DUMP_CLASS + +DumpStyle(xyz/zstd,DumpXYZZstd) + +#else + +#ifndef LMP_DUMP_XYZ_ZSTD_H +#define LMP_DUMP_XYZ_ZSTD_H + +#include "dump_xyz.h" +#include "zstd_file_writer.h" + +namespace LAMMPS_NS { + +class DumpXYZZstd : public DumpXYZ { + public: + DumpXYZZstd(class LAMMPS *, int, char **); + virtual ~DumpXYZZstd(); + + protected: + ZstdFileWriter writer; + + virtual void openfile(); + virtual void write_header(bigint); + virtual void write_data(int, double *); + virtual void write(); + + virtual int modify_param(int, char **); +}; + +} + +#endif +#endif +#endif + +/* ERROR/WARNING messages: + +E: Dump xyz/zstd only writes compressed files + +The dump xyz/zstd output file name must have a .zst suffix. + +E: Cannot open dump file + +Self-explanatory. + +*/ diff --git a/src/COMPRESS/zstd_file_writer.cpp b/src/COMPRESS/zstd_file_writer.cpp new file mode 100644 index 0000000000..68ac1217f5 --- /dev/null +++ b/src/COMPRESS/zstd_file_writer.cpp @@ -0,0 +1,162 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#include "zstd_file_writer.h" +#include +#include "fmt/format.h" + +using namespace LAMMPS_NS; + +ZstdFileWriter::ZstdFileWriter() : FileWriter(), + compression_level(0), + checksum_flag(1), + cctx(nullptr), + fp(nullptr) +{ + out_buffer_size = ZSTD_CStreamOutSize(); + out_buffer = new char[out_buffer_size]; +} + +/* ---------------------------------------------------------------------- */ + +ZstdFileWriter::~ZstdFileWriter() +{ + close(); + + delete [] out_buffer; + out_buffer = nullptr; + out_buffer_size = 0; +} + +/* ---------------------------------------------------------------------- */ + +void ZstdFileWriter::open(const std::string &path) +{ + if(isopen()) return; + + fp = fopen(path.c_str(), "wb"); + + if (!fp) { + throw FileWriterException(fmt::format("Could not open file '{}'", path)); + } + + cctx = ZSTD_createCCtx(); + + if (!cctx) { + fclose(fp); + fp = nullptr; + throw FileWriterException("Could not create Zstd context"); + } + + ZSTD_CCtx_setParameter(cctx, ZSTD_c_compressionLevel, compression_level); + ZSTD_CCtx_setParameter(cctx, ZSTD_c_checksumFlag, checksum_flag); +} + +/* ---------------------------------------------------------------------- */ + +size_t ZstdFileWriter::write(const void * buffer, size_t length) +{ + if(!isopen()) return 0; + + ZSTD_inBuffer input = { buffer, length, 0 }; + ZSTD_EndDirective mode = ZSTD_e_continue; + + do { + ZSTD_outBuffer output = { out_buffer, out_buffer_size, 0 }; + size_t const remaining = ZSTD_compressStream2(cctx, &output, &input, mode); + fwrite(out_buffer, sizeof(char), output.pos, fp); + } while(input.pos < input.size); + + return length; +} + +/* ---------------------------------------------------------------------- */ + +void ZstdFileWriter::flush() +{ + if(!isopen()) return; + + size_t remaining; + ZSTD_inBuffer input = { nullptr, 0, 0 }; + ZSTD_EndDirective mode = ZSTD_e_flush; + + do { + ZSTD_outBuffer output = { out_buffer, out_buffer_size, 0 }; + remaining = ZSTD_compressStream2(cctx, &output, &input, mode); + fwrite(out_buffer, sizeof(char), output.pos, fp); + } while(remaining); + + fflush(fp); +} + +/* ---------------------------------------------------------------------- */ + +void ZstdFileWriter::close() +{ + if(!isopen()) return; + + size_t remaining; + ZSTD_inBuffer input = { nullptr, 0, 0 }; + ZSTD_EndDirective mode = ZSTD_e_end; + + do { + ZSTD_outBuffer output = { out_buffer, out_buffer_size, 0 }; + remaining = ZSTD_compressStream2(cctx, &output, &input, mode); + fwrite(out_buffer, sizeof(char), output.pos, fp); + } while(remaining); + + ZSTD_freeCCtx(cctx); + cctx = nullptr; + fclose(fp); + fp = nullptr; +} + +/* ---------------------------------------------------------------------- */ + +bool ZstdFileWriter::isopen() const +{ + return fp && cctx; +} + +/* ---------------------------------------------------------------------- */ + +void ZstdFileWriter::setCompressionLevel(int level) +{ + if (isopen()) + throw FileWriterException("Compression level can not be changed while file is open"); + + const int min_level = ZSTD_minCLevel(); + const int max_level = ZSTD_maxCLevel(); + + if(level < min_level || level > max_level) + throw FileWriterException(fmt::format("Compression level must in the range of [{}, {}]", min_level, max_level)); + + compression_level = level; +} + +/* ---------------------------------------------------------------------- */ + +void ZstdFileWriter::setChecksum(bool enabled) +{ + if (isopen()) + throw FileWriterException("Checksum flag can not be changed while file is open"); + checksum_flag = enabled ? 1 : 0; +} + +#endif diff --git a/src/COMPRESS/zstd_file_writer.h b/src/COMPRESS/zstd_file_writer.h new file mode 100644 index 0000000000..30afc86994 --- /dev/null +++ b/src/COMPRESS/zstd_file_writer.h @@ -0,0 +1,55 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifdef LAMMPS_ZSTD + +#ifndef LMP_ZSTD_FILE_WRITER_H +#define LMP_ZSTD_FILE_WRITER_H + +#include "file_writer.h" +#include +#include +#include + +namespace LAMMPS_NS { + +class ZstdFileWriter : public FileWriter { + int compression_level; + int checksum_flag; + + ZSTD_CCtx * cctx; + FILE * fp; + char * out_buffer; + size_t out_buffer_size; +public: + ZstdFileWriter(); + virtual ~ZstdFileWriter(); + virtual void open(const std::string &path) override; + virtual void close() override; + virtual void flush() override; + virtual size_t write(const void * buffer, size_t length) override; + virtual bool isopen() const override; + + void setCompressionLevel(int level); + void setChecksum(bool enabled); +}; + + +} + +#endif +#endif diff --git a/src/CORESHELL/compute_temp_cs.cpp b/src/CORESHELL/compute_temp_cs.cpp index d8f952551d..06754003f6 100644 --- a/src/CORESHELL/compute_temp_cs.cpp +++ b/src/CORESHELL/compute_temp_cs.cpp @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #include "compute_temp_cs.h" -#include + #include -#include + #include "atom.h" #include "atom_vec.h" #include "domain.h" @@ -31,14 +31,14 @@ #include "comm.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), vint(NULL), id_fix(NULL), fix(NULL) + Compute(lmp, narg, arg), vint(nullptr), id_fix(nullptr), fix(nullptr) { if (narg != 5) error->all(FLERR,"Illegal compute temp/cs command"); @@ -94,7 +94,7 @@ ComputeTempCS::ComputeTempCS(LAMMPS *lmp, int narg, char **arg) : vector = new double[size_vector]; maxatom = 0; - vint = NULL; + vint = nullptr; // set comm size needed by this Compute diff --git a/src/CORESHELL/pair_born_coul_long_cs.cpp b/src/CORESHELL/pair_born_coul_long_cs.cpp index d50138145a..58f58db1bf 100644 --- a/src/CORESHELL/pair_born_coul_long_cs.cpp +++ b/src/CORESHELL/pair_born_coul_long_cs.cpp @@ -42,7 +42,7 @@ PairBornCoulLongCS::PairBornCoulLongCS(LAMMPS *lmp) : PairBornCoulLong(lmp) { ewaldflag = pppmflag = 1; single_enable = 0; // TODO: single function does not match compute - ftable = NULL; + ftable = nullptr; writedata = 1; } diff --git a/src/CORESHELL/pair_buck_coul_long_cs.cpp b/src/CORESHELL/pair_buck_coul_long_cs.cpp index dd43f7f4bd..f8a00a3489 100644 --- a/src/CORESHELL/pair_buck_coul_long_cs.cpp +++ b/src/CORESHELL/pair_buck_coul_long_cs.cpp @@ -43,7 +43,7 @@ PairBuckCoulLongCS::PairBuckCoulLongCS(LAMMPS *lmp) : PairBuckCoulLong(lmp) ewaldflag = pppmflag = 1; writedata = 1; single_enable = 0; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/CORESHELL/pair_coul_long_cs.cpp b/src/CORESHELL/pair_coul_long_cs.cpp index ee03780a02..6a2117149f 100644 --- a/src/CORESHELL/pair_coul_long_cs.cpp +++ b/src/CORESHELL/pair_coul_long_cs.cpp @@ -42,7 +42,7 @@ PairCoulLongCS::PairCoulLongCS(LAMMPS *lmp) : PairCoulLong(lmp) { ewaldflag = pppmflag = 1; single_enable = 0; // TODO: single function does not match compute - ftable = NULL; + ftable = nullptr; qdist = 0.0; } diff --git a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp index 75e3f5ed17..81336e6810 100644 --- a/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_class2_coul_long_cs.cpp @@ -40,7 +40,7 @@ PairLJClass2CoulLongCS::PairLJClass2CoulLongCS(LAMMPS *lmp) : PairLJClass2CoulLo respa_enable = 0; // TODO: r-RESPA handling is inconsistent and thus disabled until fixed single_enable = 0; // TODO: single function does not match compute writedata = 1; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp index 9d60dfdbf6..89523032a0 100644 --- a/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp +++ b/src/CORESHELL/pair_lj_cut_coul_long_cs.cpp @@ -44,7 +44,7 @@ PairLJCutCoulLongCS::PairLJCutCoulLongCS(LAMMPS *lmp) : PairLJCutCoulLong(lmp) respa_enable = 0; // TODO: r-RESPA handling is inconsistent and thus disabled until fixed single_enable = 0; // TODO: single function does not match compute writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } diff --git a/src/DIPOLE/atom_vec_dipole.cpp b/src/DIPOLE/atom_vec_dipole.cpp index b6895be301..10aaff0ab2 100644 --- a/src/DIPOLE/atom_vec_dipole.cpp +++ b/src/DIPOLE/atom_vec_dipole.cpp @@ -12,15 +12,10 @@ ------------------------------------------------------------------------- */ #include "atom_vec_dipole.h" -#include + #include "atom.h" -#include "comm.h" -#include "domain.h" -#include "modify.h" -#include "fix.h" -#include "memory.h" -#include "error.h" -#include "utils.h" + +#include using namespace LAMMPS_NS; @@ -28,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecDipole::AtomVecDipole(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->q_flag = atom->mu_flag = 1; diff --git a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp index 9f9e897357..d7f3201805 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_cut.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_cut.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_dipole_cut.h" -#include + #include #include #include "atom.h" @@ -23,7 +23,7 @@ #include "memory.h" #include "error.h" #include "update.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -298,9 +298,9 @@ void PairLJCutDipoleCut::settings(int narg, char **arg) if (strcmp(update->unit_style,"electron") == 0) error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -326,16 +326,16 @@ void PairLJCutDipoleCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 6) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 5) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 6) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -438,14 +438,14 @@ void PairLJCutDipoleCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -474,10 +474,10 @@ void PairLJCutDipoleCut::write_restart_settings(FILE *fp) void PairLJCutDipoleCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/DIPOLE/pair_lj_cut_dipole_long.cpp b/src/DIPOLE/pair_lj_cut_dipole_long.cpp index 7fc03005b5..e6fe0e8dca 100644 --- a/src/DIPOLE/pair_lj_cut_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_cut_dipole_long.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_dipole_long.h" -#include + #include #include #include "atom.h" @@ -25,7 +25,7 @@ #include "memory.h" #include "error.h" #include "update.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -348,9 +348,9 @@ void PairLJCutDipoleLong::settings(int narg, char **arg) if (narg < 1 || narg > 2) error->all(FLERR,"Incorrect args in pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -373,14 +373,14 @@ void PairLJCutDipoleLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -446,7 +446,7 @@ void PairLJCutDipoleLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -490,13 +490,13 @@ void PairLJCutDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -524,10 +524,10 @@ void PairLJCutDipoleLong::write_restart_settings(FILE *fp) void PairLJCutDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -552,5 +552,5 @@ void *PairLJCutDipoleLong::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } diff --git a/src/DIPOLE/pair_lj_long_dipole_long.cpp b/src/DIPOLE/pair_lj_long_dipole_long.cpp index 7dc596eccb..33ee57b83d 100644 --- a/src/DIPOLE/pair_lj_long_dipole_long.cpp +++ b/src/DIPOLE/pair_lj_long_dipole_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_long_dipole_long.h" -#include + #include #include #include "math_const.h" @@ -30,7 +30,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -58,7 +58,7 @@ PairLJLongDipoleLong::PairLJLongDipoleLong(LAMMPS *lmp) : Pair(lmp) void PairLJLongDipoleLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style lj/long/dipole/long command"); @@ -90,10 +90,10 @@ void PairLJLongDipoleLong::settings(int narg, char **arg) if (!((ewald_order^ewald_off)&(1<<3))) error->all(FLERR, "Coulombic cut not supported in pair_style lj/long/dipole/long"); - cut_lj_global = force->numeric(FLERR,*(arg++)); + cut_lj_global = utils::numeric(FLERR,*(arg++),false,lmp); if (narg == 4 && (ewald_order==74)) error->all(FLERR,"Only one cut-off allowed when requesting all long"); - if (narg == 4) cut_coul = force->numeric(FLERR,*(arg++)); + if (narg == 4) cut_coul = utils::numeric(FLERR,*(arg++),false,lmp); else cut_coul = cut_lj_global; if (allocated) { // reset explicit cuts @@ -168,10 +168,10 @@ void *PairLJLongDipoleLong::extract(const char *id, int &dim) { const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", - "cut_coul", "cut_vdwl", NULL}; + "cut_coul", "cut_vdwl", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, &cut_coul, - &cut_lj_global, NULL}; + &cut_lj_global, nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -191,14 +191,14 @@ void PairLJLongDipoleLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -220,8 +220,8 @@ void PairLJLongDipoleLong::coeff(int narg, char **arg) void PairLJLongDipoleLong::init_style() { - const char *style3[] = {"ewald/disp", NULL}; - const char *style6[] = {"ewald/disp", NULL}; + const char *style3[] = {"ewald/disp", nullptr}; + const char *style6[] = {"ewald/disp", nullptr}; int i; if (strcmp(update->unit_style,"electron") == 0) @@ -242,14 +242,14 @@ void PairLJLongDipoleLong::init_style() // ensure use of KSpace long-range solver, set g_ewald if (ewald_order&(1<<3)) { // r^-1 kspace - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); for (i=0; style3[i]&&strcmp(force->kspace_style, style3[i]); ++i); if (!style3[i]) error->all(FLERR,"Pair style requires use of kspace_style ewald/disp"); } if (ewald_order&(1<<6)) { // r^-6 kspace - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); for (i=0; style6[i]&&strcmp(force->kspace_style, style6[i]); ++i); if (!style6[i]) @@ -343,13 +343,13 @@ void PairLJLongDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); @@ -378,11 +378,11 @@ void PairLJLongDipoleLong::write_restart_settings(FILE *fp) void PairLJLongDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/GPU/fix_gpu.cpp b/src/GPU/fix_gpu.cpp index ecde8ea093..7928d16e67 100644 --- a/src/GPU/fix_gpu.cpp +++ b/src/GPU/fix_gpu.cpp @@ -13,7 +13,7 @@ #include "fix_gpu.h" #include -#include + #include "atom.h" #include "force.h" #include "pair.h" @@ -30,7 +30,7 @@ #include "neighbor.h" #include "citeme.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -118,7 +118,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : int newtonflag = 0; int threads_per_atom = -1; double binsize = 0.0; - char *opencl_flags = NULL; + char *opencl_flags = nullptr; int block_pair = -1; int iarg = 4; @@ -138,27 +138,27 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - binsize = force->numeric(FLERR,arg[iarg+1]); + binsize = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (binsize <= 0.0) error->all(FLERR,"Illegal fix GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"split") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - _particle_split = force->numeric(FLERR,arg[iarg+1]); + _particle_split = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (_particle_split == 0.0 || _particle_split > 1.0) error->all(FLERR,"Illegal package GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"gpuID") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal package gpu command"); - first_gpu = force->inumeric(FLERR,arg[iarg+1]); - last_gpu = force->inumeric(FLERR,arg[iarg+2]); + first_gpu = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + last_gpu = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"tpa") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - threads_per_atom = force->inumeric(FLERR,arg[iarg+1]); + threads_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"nthreads") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - nthreads = force->inumeric(FLERR,arg[iarg+1]); + nthreads = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nthreads < 1) error->all(FLERR,"Illegal fix GPU command"); iarg += 2; } else if (strcmp(arg[iarg],"device") == 0) { @@ -167,7 +167,7 @@ FixGPU::FixGPU(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"blocksize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package gpu command"); - block_pair = force->inumeric(FLERR,arg[iarg+1]); + block_pair = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal package gpu command"); } @@ -221,7 +221,7 @@ void FixGPU::init() { // GPU package cannot be used with atom_style template - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"GPU package does not (yet) work with " "atom_style template"); @@ -232,7 +232,7 @@ void FixGPU::init() // make sure fdotr virial is not accumulated multiple times - if (force->pair_match("^hybrid",0) != NULL) { + if (force->pair_match("^hybrid",0) != nullptr) { PairHybrid *hybrid = (PairHybrid *) force->pair; for (int i = 0; i < hybrid->nstyles; i++) if (!utils::strmatch(hybrid->keywords[i],"/gpu$")) diff --git a/src/GPU/pair_beck_gpu.cpp b/src/GPU/pair_beck_gpu.cpp index 28386f5fd5..86467f49c0 100644 --- a/src/GPU/pair_beck_gpu.cpp +++ b/src/GPU/pair_beck_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_beck_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_born_coul_long_cs_gpu.cpp b/src/GPU/pair_born_coul_long_cs_gpu.cpp index 8bc99a3d49..dbcb3bcf3f 100644 --- a/src/GPU/pair_born_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_long_cs_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_born_coul_long_cs_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -189,7 +189,7 @@ void PairBornCoulLongCSGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_born_coul_long_gpu.cpp b/src/GPU/pair_born_coul_long_gpu.cpp index 5dd4c3421f..3a6808d43c 100644 --- a/src/GPU/pair_born_coul_long_gpu.cpp +++ b/src/GPU/pair_born_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_born_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -184,7 +184,7 @@ void PairBornCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp index 4ba28c25aa..cf54b72cf5 100644 --- a/src/GPU/pair_born_coul_wolf_cs_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_cs_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_born_coul_wolf_cs_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_born_coul_wolf_gpu.cpp b/src/GPU/pair_born_coul_wolf_gpu.cpp index b5e0edea6d..e9aa951236 100644 --- a/src/GPU/pair_born_coul_wolf_gpu.cpp +++ b/src/GPU/pair_born_coul_wolf_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_born_coul_wolf_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_born_gpu.cpp b/src/GPU/pair_born_gpu.cpp index a5e94389b6..5a5a6d2a36 100644 --- a/src/GPU/pair_born_gpu.cpp +++ b/src/GPU/pair_born_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_born_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_buck_coul_cut_gpu.cpp b/src/GPU/pair_buck_coul_cut_gpu.cpp index 1a5479ea1d..de9f0d1eba 100644 --- a/src/GPU/pair_buck_coul_cut_gpu.cpp +++ b/src/GPU/pair_buck_coul_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_buck_coul_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_buck_coul_long_gpu.cpp b/src/GPU/pair_buck_coul_long_gpu.cpp index 221e178b57..aa25fb4cbb 100644 --- a/src/GPU/pair_buck_coul_long_gpu.cpp +++ b/src/GPU/pair_buck_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_buck_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -180,7 +180,7 @@ void PairBuckCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_buck_gpu.cpp b/src/GPU/pair_buck_gpu.cpp index 07107750e6..1f7abc06bc 100644 --- a/src/GPU/pair_buck_gpu.cpp +++ b/src/GPU/pair_buck_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_buck_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_colloid_gpu.cpp b/src/GPU/pair_colloid_gpu.cpp index a7cafbe75a..0ced57d285 100644 --- a/src/GPU/pair_colloid_gpu.cpp +++ b/src/GPU/pair_colloid_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_colloid_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -158,7 +158,7 @@ void PairColloidGPU::init_style() } double cell_size = sqrt(maxcut) + neighbor->skin; - int **_form = NULL; + int **_form = nullptr; int n=atom->ntypes; memory->create(_form,n+1,n+1,"colloid/gpu:_form"); for (int i = 1; i <= n; i++) { diff --git a/src/GPU/pair_coul_cut_gpu.cpp b/src/GPU/pair_coul_cut_gpu.cpp index bacbdbb1a0..34a76c1dff 100644 --- a/src/GPU/pair_coul_cut_gpu.cpp +++ b/src/GPU/pair_coul_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_coul_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_coul_debye_gpu.cpp b/src/GPU/pair_coul_debye_gpu.cpp index 96be67a1fa..40fb359484 100644 --- a/src/GPU/pair_coul_debye_gpu.cpp +++ b/src/GPU/pair_coul_debye_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_coul_debye_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_coul_dsf_gpu.cpp b/src/GPU/pair_coul_dsf_gpu.cpp index 244941c117..8c05d14aef 100644 --- a/src/GPU/pair_coul_dsf_gpu.cpp +++ b/src/GPU/pair_coul_dsf_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_coul_dsf_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_coul_long_cs_gpu.cpp b/src/GPU/pair_coul_long_cs_gpu.cpp index bcbf7216e2..3eb678fc79 100644 --- a/src/GPU/pair_coul_long_cs_gpu.cpp +++ b/src/GPU/pair_coul_long_cs_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_coul_long_cs_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -154,7 +154,7 @@ void PairCoulLongCSGPU::compute(int eflag, int vflag) void PairCoulLongCSGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style coul/long/cs/gpu requires atom attribute q"); @@ -175,7 +175,7 @@ void PairCoulLongCSGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_coul_long_gpu.cpp b/src/GPU/pair_coul_long_gpu.cpp index fcfb20f3ce..7eb5029558 100644 --- a/src/GPU/pair_coul_long_gpu.cpp +++ b/src/GPU/pair_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -149,7 +149,7 @@ void PairCoulLongGPU::compute(int eflag, int vflag) void PairCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style coul/long/gpu requires atom attribute q"); @@ -170,7 +170,7 @@ void PairCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_dpd_gpu.cpp b/src/GPU/pair_dpd_gpu.cpp index a2e20d016c..d41be6d8c2 100644 --- a/src/GPU/pair_dpd_gpu.cpp +++ b/src/GPU/pair_dpd_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_dpd_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_dpd_tstat_gpu.cpp b/src/GPU/pair_dpd_tstat_gpu.cpp index 991c6d900f..33d7178faa 100644 --- a/src/GPU/pair_dpd_tstat_gpu.cpp +++ b/src/GPU/pair_dpd_tstat_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_dpd_tstat_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_eam_alloy_gpu.cpp b/src/GPU/pair_eam_alloy_gpu.cpp index 08ffaef978..dabf4c6f57 100644 --- a/src/GPU/pair_eam_alloy_gpu.cpp +++ b/src/GPU/pair_eam_alloy_gpu.cpp @@ -17,7 +17,7 @@ #include "pair_eam_alloy_gpu.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -29,7 +29,7 @@ #include "neigh_request.h" #include "gpu_extra.h" #include "domain.h" -#include "utils.h" + #include "suffix.h" #include "tokenizer.h" #include "potential_file_reader.h" @@ -143,7 +143,7 @@ void PairEAMAlloyGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_alloy_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_alloy_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_alloy_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } @@ -324,7 +324,7 @@ void PairEAMAlloyGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -438,7 +438,7 @@ void PairEAMAlloyGPU::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/GPU/pair_eam_alloy_gpu.h b/src/GPU/pair_eam_alloy_gpu.h index 14d9a95c30..3cd78ea511 100644 --- a/src/GPU/pair_eam_alloy_gpu.h +++ b/src/GPU/pair_eam_alloy_gpu.h @@ -33,7 +33,7 @@ public: void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_eam_fs_gpu.cpp b/src/GPU/pair_eam_fs_gpu.cpp index a82107749b..e2d2dc6bdf 100644 --- a/src/GPU/pair_eam_fs_gpu.cpp +++ b/src/GPU/pair_eam_fs_gpu.cpp @@ -17,7 +17,7 @@ #include "pair_eam_fs_gpu.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -30,7 +30,7 @@ #include "gpu_extra.h" #include "domain.h" #include "suffix.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -143,7 +143,7 @@ void PairEAMFSGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_fs_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_fs_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_fs_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } @@ -324,7 +324,7 @@ void PairEAMFSGPU::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -441,7 +441,7 @@ void PairEAMFSGPU::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/GPU/pair_eam_fs_gpu.h b/src/GPU/pair_eam_fs_gpu.h index 70edf2164e..53825f2e8a 100644 --- a/src/GPU/pair_eam_fs_gpu.h +++ b/src/GPU/pair_eam_fs_gpu.h @@ -33,7 +33,7 @@ public: void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_eam_gpu.cpp b/src/GPU/pair_eam_gpu.cpp index 1aac379c35..d8058f11ae 100644 --- a/src/GPU/pair_eam_gpu.cpp +++ b/src/GPU/pair_eam_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_eam_gpu.h" #include #include -#include + #include #include "atom.h" #include "force.h" @@ -145,7 +145,7 @@ void PairEAMGPU::compute(int eflag, int vflag) // compute forces on each atom on GPU if (gpu_mode != GPU_FORCE) - eam_gpu_compute_force(NULL, eflag, vflag, eflag_atom, vflag_atom); + eam_gpu_compute_force(nullptr, eflag, vflag, eflag_atom, vflag_atom); else eam_gpu_compute_force(ilist, eflag, vflag, eflag_atom, vflag_atom); } diff --git a/src/GPU/pair_eam_gpu.h b/src/GPU/pair_eam_gpu.h index e4742a3bef..09566f7de9 100644 --- a/src/GPU/pair_eam_gpu.h +++ b/src/GPU/pair_eam_gpu.h @@ -33,7 +33,7 @@ class PairEAMGPU : public PairEAM { void init_style(); double single(int, int, int, int, double, double, double, double &); double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } int pack_forward_comm(int, int *, double *, int, int *); void unpack_forward_comm(int, int, double *); diff --git a/src/GPU/pair_gauss_gpu.cpp b/src/GPU/pair_gauss_gpu.cpp index eb83d5af44..51d4851dc5 100644 --- a/src/GPU/pair_gauss_gpu.cpp +++ b/src/GPU/pair_gauss_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_gauss_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_gayberne_gpu.cpp b/src/GPU/pair_gayberne_gpu.cpp index 83b24f8774..58414f4e30 100644 --- a/src/GPU/pair_gayberne_gpu.cpp +++ b/src/GPU/pair_gayberne_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_gayberne_gpu.h" #include #include -#include + #include #include "math_extra.h" #include "atom.h" @@ -74,7 +74,7 @@ PairGayBerneGPU::PairGayBerneGPU(LAMMPS *lmp) : PairGayBerne(lmp), { quat_nmax = 0; reinitflag = 0; - quat = NULL; + quat = nullptr; suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/GPU/pair_lj96_cut_gpu.cpp b/src/GPU/pair_lj96_cut_gpu.cpp index 7b0d45a437..e4d20e23ad 100644 --- a/src/GPU/pair_lj96_cut_gpu.cpp +++ b/src/GPU/pair_lj96_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj96_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -135,7 +135,7 @@ void PairLJ96CutGPU::compute(int eflag, int vflag) void PairLJ96CutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj96/cut/gpu pair style"); diff --git a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp index b08ad5e232..9210188539 100644 --- a/src/GPU/pair_lj_charmm_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_charmm_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_charmm_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -154,7 +154,7 @@ void PairLJCharmmCoulLongGPU::compute(int eflag, int vflag) void PairLJCharmmCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/charmm/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJCharmmCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_class2_coul_long_gpu.cpp b/src/GPU/pair_lj_class2_coul_long_gpu.cpp index 46ecaea9b8..264ada0fd3 100644 --- a/src/GPU/pair_lj_class2_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_class2_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_class2_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -177,7 +177,7 @@ void PairLJClass2CoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_class2_gpu.cpp b/src/GPU/pair_lj_class2_gpu.cpp index a7ca661927..fbd6aea08c 100644 --- a/src/GPU/pair_lj_class2_gpu.cpp +++ b/src/GPU/pair_lj_class2_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_class2_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_cubic_gpu.cpp b/src/GPU/pair_lj_cubic_gpu.cpp index 38f6e1f908..28e74d8f39 100644 --- a/src/GPU/pair_lj_cubic_gpu.cpp +++ b/src/GPU/pair_lj_cubic_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cubic_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp index 54f0e92bd5..48770d2713 100644 --- a/src/GPU/pair_lj_cut_coul_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_coul_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp index e7b1ac5002..45c3cc82a0 100644 --- a/src/GPU/pair_lj_cut_coul_debye_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_debye_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_coul_debye_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp index 5d1f4f70be..784c0e379d 100644 --- a/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_dsf_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_coul_dsf_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_cut_coul_long_gpu.cpp b/src/GPU/pair_lj_cut_coul_long_gpu.cpp index dff2ba28d4..135a2a7dd9 100644 --- a/src/GPU/pair_lj_cut_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -154,7 +154,7 @@ void PairLJCutCoulLongGPU::compute(int eflag, int vflag) void PairLJCutCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJCutCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp index 2f965d6476..f8f4af5dee 100644 --- a/src/GPU/pair_lj_cut_coul_msm_gpu.cpp +++ b/src/GPU/pair_lj_cut_coul_msm_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_coul_msm_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -143,7 +143,7 @@ void PairLJCutCoulMSMGPU::compute(int eflag, int vflag) void PairLJCutCoulMSMGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj/cut/coul/msm/gpu pair style"); diff --git a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp index 43c2a1e9b7..ac053037d8 100644 --- a/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_dipole_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp index 9416ede516..896a0b9d4d 100644 --- a/src/GPU/pair_lj_cut_dipole_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_dipole_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_dipole_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -185,13 +185,13 @@ void PairLJCutDipoleLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); int maxspecial=0; if (atom->molecular) diff --git a/src/GPU/pair_lj_cut_gpu.cpp b/src/GPU/pair_lj_cut_gpu.cpp index 27924361f2..3fc727a4f7 100644 --- a/src/GPU/pair_lj_cut_gpu.cpp +++ b/src/GPU/pair_lj_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -139,7 +139,7 @@ void PairLJCutGPU::compute(int eflag, int vflag) void PairLJCutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with lj/cut/gpu pair style"); diff --git a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp index 7c1bb74158..3876820358 100644 --- a/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp +++ b/src/GPU/pair_lj_cut_tip4p_long_gpu.cpp @@ -17,7 +17,7 @@ #include #include -#include + #include #include "pair_lj_cut_tip4p_long_gpu.h" #include "atom.h" @@ -168,20 +168,20 @@ void PairLJCutTIP4PLongGPU::compute(int eflag, int vflag) void PairLJCutTIP4PLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (atom->tag_enable == 0) error->all(FLERR,"Pair style lj/cut/tip4p/long/gpu requires atom IDs"); if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long/gpu requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); - if (atom->map_style == 2) + if (atom->map_style == Atom::MAP_HASH) error->all(FLERR,"GPU-accelerated lj/cut/tip4p/long currently" - " requires map style 'array' (atom_modify map array)"); + " requires 'array' style atom map (atom_modify map array)"); //PairLJCutCoulLong::init_style(); // Repeat cutsq calculation because done after call to init_style @@ -202,7 +202,7 @@ void PairLJCutTIP4PLongGPU::init_style() double cell_size = sqrt(maxcut) + neighbor->skin; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_expand_coul_long_gpu.cpp b/src/GPU/pair_lj_expand_coul_long_gpu.cpp index 54eb4d47e6..86ff980c7e 100644 --- a/src/GPU/pair_lj_expand_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_expand_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_expand_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -154,7 +154,7 @@ void PairLJExpandCoulLongGPU::compute(int eflag, int vflag) void PairLJExpandCoulLongGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (!atom->q_flag) error->all(FLERR,"Pair style lj/cut/coul/long/gpu requires atom attribute q"); @@ -182,7 +182,7 @@ void PairLJExpandCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; diff --git a/src/GPU/pair_lj_expand_gpu.cpp b/src/GPU/pair_lj_expand_gpu.cpp index 32c35420a2..bdfa30b965 100644 --- a/src/GPU/pair_lj_expand_gpu.cpp +++ b/src/GPU/pair_lj_expand_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_expand_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_gromacs_gpu.cpp b/src/GPU/pair_lj_gromacs_gpu.cpp index d7122cb5f3..6d6abdb40d 100644 --- a/src/GPU/pair_lj_gromacs_gpu.cpp +++ b/src/GPU/pair_lj_gromacs_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_gromacs_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp index cd76bbd2e9..d04a490caf 100644 --- a/src/GPU/pair_lj_sdk_coul_long_gpu.cpp +++ b/src/GPU/pair_lj_sdk_coul_long_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_sdk_coul_long_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -186,13 +186,13 @@ void PairLJSDKCoulLongGPU::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style is incompatible with KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); int maxspecial=0; if (atom->molecular) diff --git a/src/GPU/pair_lj_sdk_gpu.cpp b/src/GPU/pair_lj_sdk_gpu.cpp index 5f07bdbb6c..2016d1db2c 100644 --- a/src/GPU/pair_lj_sdk_gpu.cpp +++ b/src/GPU/pair_lj_sdk_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_sdk_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp index a9ddf81bf0..e6834298f3 100644 --- a/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp +++ b/src/GPU/pair_lj_sf_dipole_sf_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_lj_sf_dipole_sf_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_mie_cut_gpu.cpp b/src/GPU/pair_mie_cut_gpu.cpp index 4db07ab79e..70e8752918 100644 --- a/src/GPU/pair_mie_cut_gpu.cpp +++ b/src/GPU/pair_mie_cut_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_mie_cut_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -136,7 +136,7 @@ void PairMIECutGPU::compute(int eflag, int vflag) void PairMIECutGPU::init_style() { - cut_respa = NULL; + cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with mie/cut/gpu pair style"); diff --git a/src/GPU/pair_morse_gpu.cpp b/src/GPU/pair_morse_gpu.cpp index fc966f6533..a256f500ce 100644 --- a/src/GPU/pair_morse_gpu.cpp +++ b/src/GPU/pair_morse_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_morse_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_resquared_gpu.cpp b/src/GPU/pair_resquared_gpu.cpp index 0bcabb451c..4ce9730e0c 100644 --- a/src/GPU/pair_resquared_gpu.cpp +++ b/src/GPU/pair_resquared_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_resquared_gpu.h" #include #include -#include + #include #include "math_extra.h" #include "atom.h" @@ -76,7 +76,7 @@ PairRESquaredGPU::PairRESquaredGPU(LAMMPS *lmp) : PairRESquared(lmp), if (!avec) error->all(FLERR,"Pair resquared/gpu requires atom style ellipsoid"); quat_nmax = 0; - quat = NULL; + quat = nullptr; suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); } diff --git a/src/GPU/pair_soft_gpu.cpp b/src/GPU/pair_soft_gpu.cpp index 48a4f689ff..49c27f515d 100644 --- a/src/GPU/pair_soft_gpu.cpp +++ b/src/GPU/pair_soft_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_soft_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_sw_gpu.cpp b/src/GPU/pair_sw_gpu.cpp index 4c4502828d..54312e4115 100644 --- a/src/GPU/pair_sw_gpu.cpp +++ b/src/GPU/pair_sw_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_sw_gpu.h" #include #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -76,7 +76,7 @@ PairSWGPU::PairSWGPU(LAMMPS *lmp) : PairSW(lmp), gpu_mode(GPU_FORCE) suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -162,9 +162,9 @@ void PairSWGPU::init_style() double *epsilon, *sigma, *lambda, *gamma; double *biga, *bigb, *powerp, *powerq; double *_cut, *_cutsq, *costheta; - epsilon = sigma = lambda = gamma = NULL; - biga = bigb = powerp = powerq = NULL; - _cut = _cutsq = costheta = NULL; + epsilon = sigma = lambda = gamma = nullptr; + biga = bigb = powerp = powerq = nullptr; + _cut = _cutsq = costheta = nullptr; memory->create(epsilon,nparams,"pair:epsilon"); memory->create(sigma,nparams,"pair:sigma"); diff --git a/src/GPU/pair_table_gpu.cpp b/src/GPU/pair_table_gpu.cpp index 858a2107dc..20d21615a9 100644 --- a/src/GPU/pair_table_gpu.cpp +++ b/src/GPU/pair_table_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_table_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -165,8 +165,8 @@ void PairTableGPU::init_style() double cell_size = sqrt(maxcut) + neighbor->skin; // pack tables and send them to device - double ***table_coeffs = NULL; - double **table_data = NULL; + double ***table_coeffs = nullptr; + double **table_data = nullptr; memory->create(table_coeffs, ntypes+1, ntypes+1, 6, "table:coeffs"); Table *tb; diff --git a/src/GPU/pair_tersoff_gpu.cpp b/src/GPU/pair_tersoff_gpu.cpp index d7b1ef5dd5..b76bf99d5d 100644 --- a/src/GPU/pair_tersoff_gpu.cpp +++ b/src/GPU/pair_tersoff_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_tersoff_gpu.h" #include #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -80,7 +80,7 @@ PairTersoffGPU::PairTersoffGPU(LAMMPS *lmp) : PairTersoff(lmp), gpu_mode(GPU_FOR suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -168,11 +168,11 @@ void PairTersoffGPU::init_style() double *c1, *c2, *c3, *c4; double *c, *d, *h, *gamma; double *beta, *powern, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - c1 = c2 = c3 = c4 = NULL; - c = d = h = gamma = NULL; - beta = powern = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + c1 = c2 = c3 = c4 = nullptr; + c = d = h = gamma = nullptr; + beta = powern = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_tersoff_mod_gpu.cpp b/src/GPU/pair_tersoff_mod_gpu.cpp index 1b35045902..57e13bb299 100644 --- a/src/GPU/pair_tersoff_mod_gpu.cpp +++ b/src/GPU/pair_tersoff_mod_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_tersoff_mod_gpu.h" #include #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -73,7 +73,7 @@ PairTersoffMODGPU::PairTersoffMODGPU(LAMMPS *lmp) : PairTersoffMOD(lmp), suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -160,11 +160,11 @@ void PairTersoffMODGPU::init_style() double *biga, *bigb, *bigr, *bigd; double *c1, *c2, *c3, *c4, *c5, *h; double *beta, *powern, *ca1, *powern_del, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - powern_del = ca1 = NULL; - c1 = c2 = c3 = c4 = c5 = h = NULL; - beta = powern = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + powern_del = ca1 = nullptr; + c1 = c2 = c3 = c4 = c5 = h = nullptr; + beta = powern = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_tersoff_zbl_gpu.cpp b/src/GPU/pair_tersoff_zbl_gpu.cpp index ae50552f14..5facd86254 100644 --- a/src/GPU/pair_tersoff_zbl_gpu.cpp +++ b/src/GPU/pair_tersoff_zbl_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_tersoff_zbl_gpu.h" #include #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -81,7 +81,7 @@ PairTersoffZBLGPU::PairTersoffZBLGPU(LAMMPS *lmp) : PairTersoffZBL(lmp), suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -169,11 +169,11 @@ void PairTersoffZBLGPU::init_style() double *c1, *c2, *c3, *c4; double *c, *d, *h, *gamma; double *beta, *powern, *Z_i, *Z_j, *ZBLcut, *ZBLexpscale, *_cutsq; - lam1 = lam2 = lam3 = powermint = NULL; - biga = bigb = bigr = bigd = NULL; - c1 = c2 = c3 = c4 = NULL; - c = d = h = gamma = NULL; - beta = powern = Z_i = Z_j = ZBLcut = ZBLexpscale = _cutsq = NULL; + lam1 = lam2 = lam3 = powermint = nullptr; + biga = bigb = bigr = bigd = nullptr; + c1 = c2 = c3 = c4 = nullptr; + c = d = h = gamma = nullptr; + beta = powern = Z_i = Z_j = ZBLcut = ZBLexpscale = _cutsq = nullptr; memory->create(lam1,nparams,"pair:lam1"); memory->create(lam2,nparams,"pair:lam2"); diff --git a/src/GPU/pair_ufm_gpu.cpp b/src/GPU/pair_ufm_gpu.cpp index 2b4cc2269f..f462e579c5 100644 --- a/src/GPU/pair_ufm_gpu.cpp +++ b/src/GPU/pair_ufm_gpu.cpp @@ -20,7 +20,7 @@ #include "pair_ufm_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" @@ -141,7 +141,7 @@ void PairUFMGPU::compute(int eflag, int vflag) void PairUFMGPU::init_style() { -// cut_respa = NULL; +// cut_respa = nullptr; if (force->newton_pair) error->all(FLERR,"Cannot use newton pair with ufm/gpu pair style"); diff --git a/src/GPU/pair_vashishta_gpu.cpp b/src/GPU/pair_vashishta_gpu.cpp index ccd2773130..99a763bfbc 100644 --- a/src/GPU/pair_vashishta_gpu.cpp +++ b/src/GPU/pair_vashishta_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_vashishta_gpu.h" #include #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -77,7 +77,7 @@ PairVashishtaGPU::PairVashishtaGPU(LAMMPS *lmp) : PairVashishta(lmp), gpu_mode(G suffix_flag |= Suffix::GPU; GPU_EXTRA::gpu_ready(lmp->modify, lmp->error); - cutghost = NULL; + cutghost = nullptr; ghostneigh = 1; } @@ -169,11 +169,11 @@ void PairVashishtaGPU::init_style() double *bigw, *c0, *costheta, *bigb; double *big2b, *bigc; - cutsq = r0 = gamma = eta = NULL; - lam1inv = lam4inv = zizj = mbigd = NULL; - dvrc = big6w = heta = bigh = NULL; - bigw = c0 = costheta = bigb = NULL; - big2b = bigc = NULL; + cutsq = r0 = gamma = eta = nullptr; + lam1inv = lam4inv = zizj = mbigd = nullptr; + dvrc = big6w = heta = bigh = nullptr; + bigw = c0 = costheta = bigb = nullptr; + big2b = bigc = nullptr; memory->create(cutsq,nparams,"pair:cutsq"); memory->create(r0,nparams,"pair:r0"); diff --git a/src/GPU/pair_yukawa_colloid_gpu.cpp b/src/GPU/pair_yukawa_colloid_gpu.cpp index c3439e3306..3c7b2f5ba7 100644 --- a/src/GPU/pair_yukawa_colloid_gpu.cpp +++ b/src/GPU/pair_yukawa_colloid_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_yukawa_colloid_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_yukawa_gpu.cpp b/src/GPU/pair_yukawa_gpu.cpp index b9b9d6e0a4..8147609f45 100644 --- a/src/GPU/pair_yukawa_gpu.cpp +++ b/src/GPU/pair_yukawa_gpu.cpp @@ -18,7 +18,7 @@ #include "pair_yukawa_gpu.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pair_zbl_gpu.cpp b/src/GPU/pair_zbl_gpu.cpp index d0cbfa1d7c..0472d9b7c1 100644 --- a/src/GPU/pair_zbl_gpu.cpp +++ b/src/GPU/pair_zbl_gpu.cpp @@ -19,7 +19,7 @@ #include "lmptype.h" #include #include -#include + #include #include "atom.h" #include "atom_vec.h" diff --git a/src/GPU/pppm_gpu.cpp b/src/GPU/pppm_gpu.cpp index 7c58f6d406..a2e3e3ab98 100644 --- a/src/GPU/pppm_gpu.cpp +++ b/src/GPU/pppm_gpu.cpp @@ -91,7 +91,7 @@ void PPPM_GPU_API(forces)(double **f); PPPMGPU::PPPMGPU(LAMMPS *lmp) : PPPM(lmp) { - density_brick_gpu = vd_brick = NULL; + density_brick_gpu = vd_brick = nullptr; kspace_split = false; im_real_space = false; @@ -117,11 +117,11 @@ void PPPMGPU::init() // thru its deallocate(), allocate() // NOTE: could free density_brick and vdxyz_brick after PPPM allocates them, // before allocating db_gpu and vd_brick down below, if don't need, - // if do this, make sure to set them to NULL + // if do this, make sure to set them to a null pointer destroy_3d_offset(density_brick_gpu,nzlo_out,nylo_out); destroy_3d_offset(vd_brick,nzlo_out,nylo_out); - density_brick_gpu = vd_brick = NULL; + density_brick_gpu = vd_brick = nullptr; PPPM::init(); @@ -203,11 +203,7 @@ void PPPMGPU::compute(int eflag, int vflag) // If need per-atom energies/virials, allocate per-atom arrays here // so that particle map on host can be done concurrently with GPU calculations - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); if (triclinic == 0) { bool success = true; @@ -258,10 +254,12 @@ void PPPMGPU::compute(int eflag, int vflag) // remap from 3d decomposition to FFT decomposition if (triclinic == 0) { - cg->reverse_comm(this,REVERSE_RHO_GPU); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO_GPU, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_gpu(); } else { - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); PPPM::brick2fft(); } @@ -274,16 +272,22 @@ void PPPMGPU::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - if (differentiation_flag == 1) cg->forward_comm(this,FORWARD_AD); - else cg->forward_comm(this,FORWARD_IK); + if (differentiation_flag == 1) + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); + else + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication if (evflag_atom) { if (differentiation_flag == 1 && vflag_atom) - cg_peratom->forward_comm(this,FORWARD_AD_PERATOM); + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); else if (differentiation_flag == 0) - cg_peratom->forward_comm(this,FORWARD_IK_PERATOM); + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } poisson_time += MPI_Wtime()-t3; @@ -510,8 +514,10 @@ void PPPMGPU::poisson_ik() pack own values to buf to send to another proc ------------------------------------------------------------------------- */ -void PPPMGPU::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMGPU::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == FORWARD_IK) { @@ -568,8 +574,10 @@ void PPPMGPU::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's own values from buf and set own ghost values ------------------------------------------------------------------------- */ -void PPPMGPU::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMGPU::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == FORWARD_IK) { @@ -626,8 +634,10 @@ void PPPMGPU::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) pack ghost values into buf to send to another proc ------------------------------------------------------------------------- */ -void PPPMGPU::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMGPU::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + if (flag == REVERSE_RHO_GPU) { FFT_SCALAR *src = &density_brick_gpu[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) @@ -643,8 +653,10 @@ void PPPMGPU::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's ghost values from buf and add to own values ------------------------------------------------------------------------- */ -void PPPMGPU::unpack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMGPU::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + if (flag == REVERSE_RHO_GPU) { FFT_SCALAR *dest = &density_brick_gpu[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) @@ -695,7 +707,7 @@ FFT_SCALAR ***PPPMGPU::create_3d_offset(int n1lo, int n1hi, int n2lo, int n2hi, void PPPMGPU::destroy_3d_offset(FFT_SCALAR ***array, int n1_offset, int n2_offset) { - if (array == NULL) return; + if (array == nullptr) return; memory->sfree(&array[n1_offset][n2_offset]); memory->sfree(array + n1_offset); } @@ -785,7 +797,7 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) // extend size of per-atom arrays if necessary // part2grid needs to be allocated - if (atom->nmax > nmax || part2grid == NULL) { + if (atom->nmax > nmax || part2grid == nullptr) { memory->destroy(part2grid); nmax = atom->nmax; memory->create(part2grid,nmax,3,"pppm:part2grid"); @@ -818,7 +830,8 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) density_brick = density_A_brick; density_fft = density_A_fft; - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // group B @@ -826,7 +839,8 @@ void PPPMGPU::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) density_brick = density_B_brick; density_fft = density_B_fft; - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // switch back pointers diff --git a/src/GPU/pppm_gpu.h b/src/GPU/pppm_gpu.h index 737d6c1816..60b7e06d09 100644 --- a/src/GPU/pppm_gpu.h +++ b/src/GPU/pppm_gpu.h @@ -46,10 +46,10 @@ class PPPMGPU : public PPPM { void brick2fft_gpu(); virtual void poisson_ik(); - void pack_forward(int, FFT_SCALAR *, int, int *); - void unpack_forward(int, FFT_SCALAR *, int, int *); - void pack_reverse(int, FFT_SCALAR *, int, int *); - void unpack_reverse(int, FFT_SCALAR *, int, int *); + void pack_forward_grid(int, void *, int, int *); + void unpack_forward_grid(int, void *, int, int *); + void pack_reverse_grid(int, void *, int, int *); + void unpack_reverse_grid(int, void *, int, int *); FFT_SCALAR ***create_3d_offset(int, int, int, int, int, int, const char *, FFT_SCALAR *, int); diff --git a/src/GRANULAR/fix_freeze.cpp b/src/GRANULAR/fix_freeze.cpp index 1df5c9d0a8..dd68aa032f 100644 --- a/src/GRANULAR/fix_freeze.cpp +++ b/src/GRANULAR/fix_freeze.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_freeze.h" -#include + #include #include "atom.h" #include "update.h" diff --git a/src/GRANULAR/fix_pour.cpp b/src/GRANULAR/fix_pour.cpp index 73b42b9653..d6b6372aaa 100644 --- a/src/GRANULAR/fix_pour.cpp +++ b/src/GRANULAR/fix_pour.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_pour.h" -#include + #include #include #include "atom.h" @@ -32,7 +32,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -48,10 +48,10 @@ enum{CONSTANT,EQUAL}; // same as FixGravity /* ---------------------------------------------------------------------- */ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), radius_poly(NULL), frac_poly(NULL), - idrigid(NULL), idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), - imageflags(NULL), fixrigid(NULL), fixshake(NULL), recvcounts(NULL), - displs(NULL), random(NULL), random2(NULL) + Fix(lmp, narg, arg), radius_poly(nullptr), frac_poly(nullptr), + idrigid(nullptr), idshake(nullptr), onemols(nullptr), molfrac(nullptr), coords(nullptr), + imageflags(nullptr), fixrigid(nullptr), fixshake(nullptr), recvcounts(nullptr), + displs(nullptr), random(nullptr), random2(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix pour command"); @@ -65,9 +65,9 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : // required args - ninsert = force->inumeric(FLERR,arg[3]); - ntype = force->inumeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); + ninsert = utils::inumeric(FLERR,arg[3],false,lmp); + ntype = utils::inumeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix pour command"); @@ -135,7 +135,7 @@ FixPour::FixPour(LAMMPS *lmp, int narg, char **arg) : ntype+onemols[i]->ntypes > atom->ntypes) error->all(FLERR,"Invalid atom type in fix pour mol command"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix pour molecule template ID must be same " "as atom style template ID"); onemols[i]->check_attributes(0); @@ -344,7 +344,7 @@ void FixPour::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix pour rigid fix does not exist"); @@ -359,7 +359,7 @@ void FixPour::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix pour shake fix does not exist"); @@ -456,7 +456,7 @@ void FixPour::pre_exchange() // perform allgatherv to acquire list of nearby particles on all procs - double *ptr = NULL; + double *ptr = nullptr; if (ncount) ptr = xmine[0]; MPI_Allgatherv(ptr,4*ncount,MPI_DOUBLE, xnear[0],recvcounts,displs,MPI_DOUBLE,world); @@ -644,7 +644,7 @@ void FixPour::pre_exchange() atom->molecule[n] = maxmol_all+1; } } - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { atom->molindex[n] = 0; atom->molatom[n] = m; } @@ -712,7 +712,7 @@ void FixPour::pre_exchange() } if (maxtag_all >= MAXTAGINT) error->all(FLERR,"New atom IDs exceed maximum allowed ID"); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -889,16 +889,16 @@ void FixPour::options(int narg, char **arg) iregion = -1; mode = ATOM; - molfrac = NULL; + molfrac = nullptr; rigidflag = 0; - idrigid = NULL; + idrigid = nullptr; shakeflag = 0; - idshake = NULL; + idshake = nullptr; idnext = 0; ignoreflag = ignoreline = ignoretri = 0; dstyle = ONE; radius_max = radius_one = 0.5; - radius_poly = frac_poly = NULL; + radius_poly = frac_poly = nullptr; density_lo = density_hi = 1.0; volfrac = 0.25; maxattempt = 50; @@ -930,9 +930,9 @@ void FixPour::options(int narg, char **arg) } else if (strcmp(arg[iarg],"molfrac") == 0) { if (mode != MOLECULE) error->all(FLERR,"Illegal fix pour command"); if (iarg+nmol+1 > narg) error->all(FLERR,"Illegal fix pour command"); - molfrac[0] = force->numeric(FLERR,arg[iarg+1]); + molfrac[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); for (int i = 1; i < nmol; i++) - molfrac[i] = molfrac[i-1] + force->numeric(FLERR,arg[iarg+i+1]); + molfrac[i] = molfrac[i-1] + utils::numeric(FLERR,arg[iarg+i+1],false,lmp); if (molfrac[nmol-1] < 1.0-EPSILON || molfrac[nmol-1] > 1.0+EPSILON) error->all(FLERR,"Illegal fix pour command"); molfrac[nmol-1] = 1.0; @@ -973,21 +973,21 @@ void FixPour::options(int narg, char **arg) if (strcmp(arg[iarg+1],"one") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); dstyle = ONE; - radius_one = 0.5 * force->numeric(FLERR,arg[iarg+2]); + radius_one = 0.5 * utils::numeric(FLERR,arg[iarg+2],false,lmp); radius_max = radius_one; iarg += 3; } else if (strcmp(arg[iarg+1],"range") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command"); dstyle = RANGE; - radius_lo = 0.5 * force->numeric(FLERR,arg[iarg+2]); - radius_hi = 0.5 * force->numeric(FLERR,arg[iarg+3]); + radius_lo = 0.5 * utils::numeric(FLERR,arg[iarg+2],false,lmp); + radius_hi = 0.5 * utils::numeric(FLERR,arg[iarg+3],false,lmp); if (radius_lo > radius_hi) error->all(FLERR,"Illegal fix pour command"); radius_max = radius_hi; iarg += 4; } else if (strcmp(arg[iarg+1],"poly") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); dstyle = POLY; - npoly = force->inumeric(FLERR,arg[iarg+2]); + npoly = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (npoly <= 0) error->all(FLERR,"Illegal fix pour command"); if (iarg+3 + 2*npoly > narg) error->all(FLERR,"Illegal fix pour command"); @@ -996,8 +996,8 @@ void FixPour::options(int narg, char **arg) iarg += 3; radius_max = 0.0; for (int i = 0; i < npoly; i++) { - radius_poly[i] = 0.5 * force->numeric(FLERR,arg[iarg++]); - frac_poly[i] = force->numeric(FLERR,arg[iarg++]); + radius_poly[i] = 0.5 * utils::numeric(FLERR,arg[iarg++],false,lmp); + frac_poly[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); if (radius_poly[i] <= 0.0 || frac_poly[i] < 0.0) error->all(FLERR,"Illegal fix pour command"); radius_max = MAX(radius_max,radius_poly[i]); @@ -1010,35 +1010,35 @@ void FixPour::options(int narg, char **arg) } else if (strcmp(arg[iarg],"dens") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); - density_lo = force->numeric(FLERR,arg[iarg+1]); - density_hi = force->numeric(FLERR,arg[iarg+2]); + density_lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + density_hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (density_lo > density_hi) error->all(FLERR,"Illegal fix pour command"); iarg += 3; } else if (strcmp(arg[iarg],"vol") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix pour command"); - volfrac = force->numeric(FLERR,arg[iarg+1]); - maxattempt = force->inumeric(FLERR,arg[iarg+2]); + volfrac = utils::numeric(FLERR,arg[iarg+1],false,lmp); + maxattempt = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"rate") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix pour command"); - rate = force->numeric(FLERR,arg[iarg+1]); + rate = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"vel") == 0) { if (domain->dimension == 3) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix pour command"); - vxlo = force->numeric(FLERR,arg[iarg+1]); - vxhi = force->numeric(FLERR,arg[iarg+2]); - vylo = force->numeric(FLERR,arg[iarg+3]); - vyhi = force->numeric(FLERR,arg[iarg+4]); + vxlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vxhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); + vylo = utils::numeric(FLERR,arg[iarg+3],false,lmp); + vyhi = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (vxlo > vxhi || vylo > vyhi) error->all(FLERR,"Illegal fix pour command"); - vz = force->numeric(FLERR,arg[iarg+5]); + vz = utils::numeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else { if (iarg+4 > narg) error->all(FLERR,"Illegal fix pour command"); - vxlo = force->numeric(FLERR,arg[iarg+1]); - vxhi = force->numeric(FLERR,arg[iarg+2]); - vy = force->numeric(FLERR,arg[iarg+3]); + vxlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vxhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); + vy = utils::numeric(FLERR,arg[iarg+3],false,lmp); vz = 0.0; if (vxlo > vxhi) error->all(FLERR,"Illegal fix pour command"); iarg += 4; @@ -1091,5 +1091,5 @@ void *FixPour::extract(const char *str, int &itype) itype = 0; return &oneradius; } - return NULL; + return nullptr; } diff --git a/src/GRANULAR/fix_wall_gran.cpp b/src/GRANULAR/fix_wall_gran.cpp index 80a121c035..cf05db82ce 100644 --- a/src/GRANULAR/fix_wall_gran.cpp +++ b/src/GRANULAR/fix_wall_gran.cpp @@ -63,8 +63,8 @@ enum {ROLL_NONE, ROLL_SDS}; /* ---------------------------------------------------------------------- */ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), history_one(NULL), - fix_rigid(NULL), mass_rigid(NULL) + Fix(lmp, narg, arg), idregion(nullptr), history_one(nullptr), + fix_rigid(nullptr), mass_rigid(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/gran command"); @@ -93,16 +93,16 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : size_history = 3; if (narg < 11) error->all(FLERR,"Illegal fix wall/gran command"); - kn = force->numeric(FLERR,arg[4]); + kn = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = force->numeric(FLERR,arg[5]); + else kt = utils::numeric(FLERR,arg[5],false,lmp); - gamman = force->numeric(FLERR,arg[6]); + gamman = utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = force->numeric(FLERR,arg[7]); + else gammat = utils::numeric(FLERR,arg[7],false,lmp); - xmu = force->numeric(FLERR,arg[8]); - int dampflag = force->inumeric(FLERR,arg[9]); + xmu = utils::numeric(FLERR,arg[8],false,lmp); + int dampflag = utils::inumeric(FLERR,arg[9],false,lmp); if (dampflag == 0) gammat = 0.0; if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || @@ -127,8 +127,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hooke option"); normal_model = NORMAL_HOOKE; - normal_coeffs[0] = force->numeric(FLERR,arg[iarg+1]); //kn - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping + normal_coeffs[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); //kn + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping iarg += 3; } else if (strcmp(arg[iarg], "hertz") == 0) { int num_coeffs = 2; @@ -136,8 +136,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hertz option"); normal_model = NORMAL_HERTZ; - normal_coeffs[0] = force->numeric(FLERR,arg[iarg+1]); //kn - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping + normal_coeffs[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); //kn + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping iarg += num_coeffs+1; } else if (strcmp(arg[iarg], "hertz/material") == 0) { int num_coeffs = 3; @@ -145,9 +145,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hertz option"); normal_model = HERTZ_MATERIAL; - Emod = force->numeric(FLERR,arg[iarg+1]); //E - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping - poiss = force->numeric(FLERR,arg[iarg+3]); //Poisson's ratio + Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping + poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; normal_coeffs[2] = poiss; iarg += num_coeffs+1; @@ -156,24 +156,24 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix wall/gran command, " "not enough parameters provided for Hertz option"); normal_model = DMT; - Emod = force->numeric(FLERR,arg[iarg+1]); //E - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping - poiss = force->numeric(FLERR,arg[iarg+3]); //Poisson's ratio + Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping + poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; normal_coeffs[2] = poiss; - normal_coeffs[3] = force->numeric(FLERR,arg[iarg+4]); //cohesion + normal_coeffs[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //cohesion iarg += 5; } else if (strcmp(arg[iarg], "jkr") == 0) { if (iarg + 4 >= narg) error->all(FLERR,"Illegal wall/gran command, " "not enough parameters provided for JKR option"); normal_model = JKR; - Emod = force->numeric(FLERR,arg[iarg+1]); //E - normal_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); //damping - poiss = force->numeric(FLERR,arg[iarg+3]); //Poisson's ratio + Emod = utils::numeric(FLERR,arg[iarg+1],false,lmp); //E + normal_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //damping + poiss = utils::numeric(FLERR,arg[iarg+3],false,lmp); //Poisson's ratio normal_coeffs[0] = Emod/(2*(1-poiss))*FOURTHIRDS; normal_coeffs[2] = poiss; - normal_coeffs[3] = force->numeric(FLERR,arg[iarg+4]); //cohesion + normal_coeffs[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //cohesion iarg += 5; } else if (strcmp(arg[iarg], "damping") == 0) { if (iarg+1 >= narg) @@ -205,8 +205,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : tangential_model = TANGENTIAL_NOHISTORY; tangential_coeffs[0] = 0; // gammat and friction coeff - tangential_coeffs[1] = force->numeric(FLERR,arg[iarg+2]); - tangential_coeffs[2] = force->numeric(FLERR,arg[iarg+3]); + tangential_coeffs[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tangential_coeffs[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if ((strcmp(arg[iarg+1], "linear_history") == 0) || (strcmp(arg[iarg+1], "mindlin") == 0) || @@ -230,12 +230,12 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : } tangential_coeffs[0] = Emod/4*(2-poiss)*(1+poiss); } else { - tangential_coeffs[0] = force->numeric(FLERR,arg[iarg+2]); //kt + tangential_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //kt } tangential_history = 1; // gammat and friction coeff - tangential_coeffs[1] = force->numeric(FLERR,arg[iarg+3]); - tangential_coeffs[2] = force->numeric(FLERR,arg[iarg+4]); + tangential_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + tangential_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -254,9 +254,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : roll_model = ROLL_SDS; roll_history = 1; // kR, gammaR, rolling friction coeff - roll_coeffs[0] = force->numeric(FLERR,arg[iarg+2]); - roll_coeffs[1] = force->numeric(FLERR,arg[iarg+3]); - roll_coeffs[2] = force->numeric(FLERR,arg[iarg+4]); + roll_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + roll_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + roll_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal wall/gran command, " @@ -278,9 +278,9 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : "not enough parameters provided for twist model"); twist_model = TWIST_SDS; twist_history = 1; - twist_coeffs[0] = force->numeric(FLERR,arg[iarg+2]); //kt - twist_coeffs[1] = force->numeric(FLERR,arg[iarg+3]); //gammat - twist_coeffs[2] = force->numeric(FLERR,arg[iarg+4]); //friction coeff. + twist_coeffs[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); //kt + twist_coeffs[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); //gammat + twist_coeffs[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); //friction coeff. iarg += 5; } else { error->all(FLERR, "Illegal wall/gran command, " @@ -303,37 +303,37 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // wallstyle args - idregion = NULL; + idregion = nullptr; if (strcmp(arg[iarg],"xplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = XPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = YPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zplane") == 0) { if (narg < iarg+3) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = ZPLANE; if (strcmp(arg[iarg+1],"NULL") == 0) lo = -BIG; - else lo = force->numeric(FLERR,arg[iarg+1]); + else lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"NULL") == 0) hi = BIG; - else hi = force->numeric(FLERR,arg[iarg+2]); + else hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"zcylinder") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); wallstyle = ZCYLINDER; lo = hi = 0.0; - cylradius = force->numeric(FLERR,arg[iarg+1]); + cylradius = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"region") == 0) { if (narg < iarg+2) error->all(FLERR,"Illegal fix wall/gran command"); @@ -357,8 +357,8 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/gran command"); - amplitude = force->numeric(FLERR,arg[iarg+2]); - period = force->numeric(FLERR,arg[iarg+3]); + amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + period = utils::numeric(FLERR,arg[iarg+3],false,lmp); wiggle = 1; iarg += 4; } else if (strcmp(arg[iarg],"shear") == 0) { @@ -367,7 +367,7 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"y") == 0) axis = 1; else if (strcmp(arg[iarg+1],"z") == 0) axis = 2; else error->all(FLERR,"Illegal fix wall/gran command"); - vshear = force->numeric(FLERR,arg[iarg+2]); + vshear = utils::numeric(FLERR,arg[iarg+2],false,lmp); wshear = 1; iarg += 3; } else if (strcmp(arg[iarg],"contacts") == 0) { @@ -407,16 +407,16 @@ FixWallGran::FixWallGran(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - history_one = NULL; + history_one = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; // initialize history as if particle is not touching region - // history_one will be NULL for wallstyle = REGION + // history_one will be a null pointer for wallstyle = REGION if (use_history && history_one) { int nlocal = atom->nlocal; @@ -438,8 +438,8 @@ FixWallGran::~FixWallGran() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete local storage @@ -471,7 +471,7 @@ void FixWallGran::init() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -576,7 +576,7 @@ void FixWallGran::post_force(int /*vflag*/) // dx,dy,dz = signed distance from wall // for rotating cylinder, reset vwall based on particle position // skip atom if not close enough to wall - // if wall was set to NULL, it's skipped since lo/hi are infinity + // if wall was set to a null pointer, it's skipped since lo/hi are infinity // compute force and torque on atom if close enough to wall // via wall potential matched to pair potential // set history if pair potential stores history @@ -681,7 +681,7 @@ void FixWallGran::post_force(int /*vflag*/) if (peratom_flag) contact = array_atom[i]; else - contact = NULL; + contact = nullptr; if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], @@ -1560,7 +1560,7 @@ void FixWallGran::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them - + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/GRANULAR/fix_wall_gran.h b/src/GRANULAR/fix_wall_gran.h index 3aa518209a..a81a4c787c 100644 --- a/src/GRANULAR/fix_wall_gran.h +++ b/src/GRANULAR/fix_wall_gran.h @@ -103,7 +103,7 @@ class FixWallGran : public Fix { // rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/fix_wall_gran_region.cpp b/src/GRANULAR/fix_wall_gran_region.cpp index 6953165af6..f91bac2c9b 100644 --- a/src/GRANULAR/fix_wall_gran_region.cpp +++ b/src/GRANULAR/fix_wall_gran_region.cpp @@ -39,9 +39,9 @@ enum {NORMAL_HOOKE, NORMAL_HERTZ, HERTZ_MATERIAL, DMT, JKR}; /* ---------------------------------------------------------------------- */ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : - FixWallGran(lmp, narg, arg), region(NULL), region_style(NULL), - ncontact(NULL), - walls(NULL), history_many(NULL), c2r(NULL) + FixWallGran(lmp, narg, arg), region(nullptr), region_style(nullptr), + ncontact(nullptr), + walls(nullptr), history_many(nullptr), c2r(nullptr) { restart_global = 1; motion_resetflag = 0; @@ -61,11 +61,11 @@ FixWallGranRegion::FixWallGranRegion(LAMMPS *lmp, int narg, char **arg) : // do not register with Atom class, since parent class did that memory->destroy(history_one); - history_one = NULL; + history_one = nullptr; - ncontact = NULL; - walls = NULL; - history_many = NULL; + ncontact = nullptr; + walls = nullptr; + history_many = nullptr; grow_arrays(atom->nmax); // initialize shear history as if particle is not touching region @@ -262,7 +262,7 @@ void FixWallGranRegion::post_force(int /*vflag*/) if (peratom_flag) contact = array_atom[i]; else - contact = NULL; + contact = nullptr; if (pairstyle == HOOKE) hooke(rsq,dx,dy,dz,vwall,v[i],f[i], @@ -498,7 +498,7 @@ void FixWallGranRegion::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them - + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/GRANULAR/pair_gran_hertz_history.cpp b/src/GRANULAR/pair_gran_hertz_history.cpp index 4a362c0928..89230f26bf 100644 --- a/src/GRANULAR/pair_gran_hertz_history.cpp +++ b/src/GRANULAR/pair_gran_hertz_history.cpp @@ -279,16 +279,16 @@ void PairGranHertzHistory::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - kn = force->numeric(FLERR,arg[0]); + kn = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = force->numeric(FLERR,arg[1]); + else kt = utils::numeric(FLERR,arg[1],false,lmp); - gamman = force->numeric(FLERR,arg[2]); + gamman = utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = force->numeric(FLERR,arg[3]); + else gammat = utils::numeric(FLERR,arg[3],false,lmp); - xmu = force->numeric(FLERR,arg[4]); - dampflag = force->inumeric(FLERR,arg[5]); + xmu = utils::numeric(FLERR,arg[4],false,lmp); + dampflag = utils::inumeric(FLERR,arg[5],false,lmp); if (dampflag == 0) gammat = 0.0; if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || diff --git a/src/GRANULAR/pair_gran_hooke_history.cpp b/src/GRANULAR/pair_gran_hooke_history.cpp index af46d813ca..b296f84657 100644 --- a/src/GRANULAR/pair_gran_hooke_history.cpp +++ b/src/GRANULAR/pair_gran_hooke_history.cpp @@ -16,10 +16,10 @@ ------------------------------------------------------------------------- */ #include "pair_gran_hooke_history.h" -#include + #include #include -#include + #include "atom.h" #include "force.h" #include "update.h" @@ -33,7 +33,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -52,7 +52,7 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) neighprev = 0; nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; // set comm size needed by this Pair if used with fix rigid @@ -65,7 +65,7 @@ PairGranHookeHistory::PairGranHookeHistory(LAMMPS *lmp) : Pair(lmp) // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - fix_history = NULL; + fix_history = nullptr; modify->add_fix("NEIGH_HISTORY_HH_DUMMY all DUMMY"); fix_dummy = (FixDummy *) modify->fix[modify->nfix-1]; } @@ -358,16 +358,16 @@ void PairGranHookeHistory::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - kn = force->numeric(FLERR,arg[0]); + kn = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"NULL") == 0) kt = kn * 2.0/7.0; - else kt = force->numeric(FLERR,arg[1]); + else kt = utils::numeric(FLERR,arg[1],false,lmp); - gamman = force->numeric(FLERR,arg[2]); + gamman = utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"NULL") == 0) gammat = 0.5 * gamman; - else gammat = force->numeric(FLERR,arg[3]); + else gammat = utils::numeric(FLERR,arg[3],false,lmp); - xmu = force->numeric(FLERR,arg[4]); - dampflag = force->inumeric(FLERR,arg[5]); + xmu = utils::numeric(FLERR,arg[4],false,lmp); + dampflag = utils::inumeric(FLERR,arg[5],false,lmp); if (dampflag == 0) gammat = 0.0; if (kn < 0.0 || kt < 0.0 || gamman < 0.0 || gammat < 0.0 || @@ -385,8 +385,8 @@ void PairGranHookeHistory::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -426,7 +426,7 @@ void PairGranHookeHistory::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (history && fix_history == NULL) { + if (history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",size_history); char **fixarg = new char*[4]; @@ -450,7 +450,7 @@ void PairGranHookeHistory::init_style() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -554,7 +554,7 @@ void PairGranHookeHistory::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -580,12 +580,12 @@ void PairGranHookeHistory::write_restart_settings(FILE *fp) void PairGranHookeHistory::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&kn,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kt,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamman,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gammat,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&xmu,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dampflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&kn,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kt,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamman,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gammat,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&xmu,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dampflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&kn,1,MPI_DOUBLE,0,world); MPI_Bcast(&kt,1,MPI_DOUBLE,0,world); diff --git a/src/GRANULAR/pair_gran_hooke_history.h b/src/GRANULAR/pair_gran_hooke_history.h index 309af54ee6..c27ce8a9af 100644 --- a/src/GRANULAR/pair_gran_hooke_history.h +++ b/src/GRANULAR/pair_gran_hooke_history.h @@ -61,7 +61,7 @@ class PairGranHookeHistory : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/GRANULAR/pair_granular.cpp b/src/GRANULAR/pair_granular.cpp index 1784f4562c..5edc656a67 100644 --- a/src/GRANULAR/pair_granular.cpp +++ b/src/GRANULAR/pair_granular.cpp @@ -18,10 +18,10 @@ ----------------------------------------------------------------------- */ #include "pair_granular.h" -#include + #include #include -#include + #include "atom.h" #include "force.h" #include "update.h" @@ -37,7 +37,7 @@ #include "error.h" #include "math_const.h" #include "math_special.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -55,7 +55,8 @@ using namespace MathSpecial; enum {HOOKE, HERTZ, HERTZ_MATERIAL, DMT, JKR}; enum {VELOCITY, MASS_VELOCITY, VISCOELASTIC, TSUJI}; enum {TANGENTIAL_NOHISTORY, TANGENTIAL_HISTORY, - TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE}; + TANGENTIAL_MINDLIN, TANGENTIAL_MINDLIN_RESCALE, + TANGENTIAL_MINDLIN_FORCE, TANGENTIAL_MINDLIN_RESCALE_FORCE}; enum {TWIST_NONE, TWIST_SDS, TWIST_MARSHALL}; enum {ROLL_NONE, ROLL_SDS}; @@ -72,14 +73,14 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) neighprev = 0; nmax = 0; - mass_rigid = NULL; + mass_rigid = nullptr; - onerad_dynamic = NULL; - onerad_frozen = NULL; - maxrad_dynamic = NULL; - maxrad_frozen = NULL; + onerad_dynamic = nullptr; + onerad_frozen = nullptr; + maxrad_dynamic = nullptr; + maxrad_frozen = nullptr; - history_transfer_factors = NULL; + history_transfer_factors = nullptr; dt = update->dt; @@ -96,7 +97,7 @@ PairGranular::PairGranular(LAMMPS *lmp) : Pair(lmp) // create dummy fix as placeholder for FixNeighHistory // this is so final order of Modify:fix will conform to input script - fix_history = NULL; + fix_history = nullptr; modify->add_fix("NEIGH_HISTORY_GRANULAR_DUMMY all DUMMY"); fix_dummy = (FixDummy *) modify->fix[modify->nfix-1]; } @@ -175,7 +176,8 @@ void PairGranular::compute(int eflag, int vflag) double signtwist, magtwist, magtortwist, Mtcrit; double tortwist1, tortwist2, tortwist3; - double shrmag,rsht; + double shrmag,rsht,prjmag; + bool frameupdate; int *ilist,*jlist,*numneigh,**firstneigh; int *touch,**firsttouch; double *history,*allhistory,**firsthistory; @@ -372,6 +374,12 @@ void PairGranular::compute(int eflag, int vflag) // tangential force, including history effects //**************************************** + // For linear, mindlin, mindlin_rescale: + // history = cumulative tangential displacement + // + // For mindlin/force, mindlin_rescale/force: + // history = cumulative tangential elastic force + // tangential component vt1 = vr1 - vn1; vt2 = vr2 - vn2; @@ -414,12 +422,15 @@ void PairGranular::compute(int eflag, int vflag) damp_normal_prefactor; if (tangential_history) { - if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN) { + if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_FORCE) { k_tangential *= a; } else if (tangential_model[itype][jtype] == - TANGENTIAL_MINDLIN_RESCALE) { + TANGENTIAL_MINDLIN_RESCALE || + tangential_model[itype][jtype] == + TANGENTIAL_MINDLIN_RESCALE_FORCE) { k_tangential *= a; - // on unloading, rescale the shear displacements + // on unloading, rescale the shear displacements/force if (a < history[3]) { double factor = a/history[3]; history[0] *= factor; @@ -427,37 +438,66 @@ void PairGranular::compute(int eflag, int vflag) history[2] *= factor; } } - // rotate and update displacements. + // rotate and update displacements / force. // see e.g. eq. 17 of Luding, Gran. Matter 2008, v10,p235 if (historyupdate) { rsht = history[0]*nx + history[1]*ny + history[2]*nz; - if (fabs(rsht) < EPSILON) rsht = 0; - if (rsht > 0) { + if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_FORCE || + tangential_model[itype][jtype] == + TANGENTIAL_MINDLIN_RESCALE_FORCE) + frameupdate = fabs(rsht) < EPSILON*Fscrit; + else + frameupdate = fabs(rsht)*k_tangential < EPSILON*Fscrit; + if (frameupdate) { shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + history[2]*history[2]); - // if rsht == shrmag, contacting pair has rotated 90 deg - // in one step, in which case you deserve a crash! - scalefac = shrmag/(shrmag - rsht); + // projection history[0] -= rsht*nx; history[1] -= rsht*ny; history[2] -= rsht*nz; + // also rescale to preserve magnitude + prjmag = sqrt(history[0]*history[0] + history[1]*history[1] + + history[2]*history[2]); + if (prjmag > 0) scalefac = shrmag/prjmag; + else scalefac = 0; history[0] *= scalefac; history[1] *= scalefac; history[2] *= scalefac; } // update history - history[0] += vtr1*dt; - history[1] += vtr2*dt; - history[2] += vtr3*dt; - if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) + if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { + // tangential displacement + history[0] += vtr1*dt; + history[1] += vtr2*dt; + history[2] += vtr3*dt; + } else { + // tangential force + // see e.g. eq. 18 of Thornton et al, Pow. Tech. 2013, v223,p30-46 + history[0] -= k_tangential*vtr1*dt; + history[1] -= k_tangential*vtr2*dt; + history[2] -= k_tangential*vtr3*dt; + } + if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE || + tangential_model[itype][jtype] == + TANGENTIAL_MINDLIN_RESCALE_FORCE) history[3] = a; } // tangential forces = history + tangential velocity damping - fs1 = -k_tangential*history[0] - damp_tangential*vtr1; - fs2 = -k_tangential*history[1] - damp_tangential*vtr2; - fs3 = -k_tangential*history[2] - damp_tangential*vtr3; + if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { + fs1 = -k_tangential*history[0] - damp_tangential*vtr1; + fs2 = -k_tangential*history[1] - damp_tangential*vtr2; + fs3 = -k_tangential*history[2] - damp_tangential*vtr3; + } else { + fs1 = history[0] - damp_tangential*vtr1; + fs2 = history[1] - damp_tangential*vtr2; + fs3 = history[2] - damp_tangential*vtr3; + } // rescale frictional displacements and forces if needed fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); @@ -465,12 +505,21 @@ void PairGranular::compute(int eflag, int vflag) shrmag = sqrt(history[0]*history[0] + history[1]*history[1] + history[2]*history[2]); if (shrmag != 0.0) { - history[0] = -1.0/k_tangential*(Fscrit*fs1/fs + - damp_tangential*vtr1); - history[1] = -1.0/k_tangential*(Fscrit*fs2/fs + - damp_tangential*vtr2); - history[2] = -1.0/k_tangential*(Fscrit*fs3/fs + - damp_tangential*vtr3); + if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || + tangential_model[itype][jtype] == + TANGENTIAL_MINDLIN_RESCALE) { + history[0] = -1.0/k_tangential*(Fscrit*fs1/fs + + damp_tangential*vtr1); + history[1] = -1.0/k_tangential*(Fscrit*fs2/fs + + damp_tangential*vtr2); + history[2] = -1.0/k_tangential*(Fscrit*fs3/fs + + damp_tangential*vtr3); + } else { + history[0] = Fscrit*fs1/fs + damp_tangential*vtr1; + history[1] = Fscrit*fs2/fs + damp_tangential*vtr2; + history[2] = Fscrit*fs3/fs + damp_tangential*vtr3; + } fs1 *= Fscrit/fs; fs2 *= Fscrit/fs; fs3 *= Fscrit/fs; @@ -512,18 +561,27 @@ void PairGranular::compute(int eflag, int vflag) int rhist1 = rhist0 + 1; int rhist2 = rhist1 + 1; - rolldotn = history[rhist0]*nx + history[rhist1]*ny + history[rhist2]*nz; + k_roll = roll_coeffs[itype][jtype][0]; + damp_roll = roll_coeffs[itype][jtype][1]; + Frcrit = roll_coeffs[itype][jtype][2] * Fncrit; + if (historyupdate) { - if (fabs(rolldotn) < EPSILON) rolldotn = 0; - if (rolldotn > 0) { // rotate into tangential plane + rolldotn = history[rhist0]*nx + history[rhist1]*ny + history[rhist2]*nz; + frameupdate = fabs(rolldotn)*k_roll < EPSILON*Frcrit; + if (frameupdate) { // rotate into tangential plane rollmag = sqrt(history[rhist0]*history[rhist0] + history[rhist1]*history[rhist1] + history[rhist2]*history[rhist2]); - scalefac = rollmag/(rollmag - rolldotn); + // projection history[rhist0] -= rolldotn*nx; history[rhist1] -= rolldotn*ny; history[rhist2] -= rolldotn*nz; // also rescale to preserve magnitude + prjmag = sqrt(history[rhist0]*history[rhist0] + + history[rhist1]*history[rhist1] + + history[rhist2]*history[rhist2]); + if (prjmag > 0) scalefac = rollmag/prjmag; + else scalefac = 0; history[rhist0] *= scalefac; history[rhist1] *= scalefac; history[rhist2] *= scalefac; @@ -533,14 +591,11 @@ void PairGranular::compute(int eflag, int vflag) history[rhist2] += vrl3*dt; } - k_roll = roll_coeffs[itype][jtype][0]; - damp_roll = roll_coeffs[itype][jtype][1]; fr1 = -k_roll*history[rhist0] - damp_roll*vrl1; fr2 = -k_roll*history[rhist1] - damp_roll*vrl2; fr3 = -k_roll*history[rhist2] - damp_roll*vrl3; // rescale frictional displacements and forces if needed - Frcrit = roll_coeffs[itype][jtype][2] * Fncrit; fr = sqrt(fr1*fr1 + fr2*fr2 + fr3*fr3); if (fr > Frcrit) { @@ -698,7 +753,7 @@ void PairGranular::allocate() void PairGranular::settings(int narg, char **arg) { if (narg == 1) { - cutoff_global = force->numeric(FLERR,arg[0]); + cutoff_global = utils::numeric(FLERR,arg[0],false,lmp); } else { cutoff_global = -1; // will be set based on particle sizes, model choice } @@ -729,12 +784,13 @@ void PairGranular::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); //Defaults normal_model_one = tangential_model_one = -1; - roll_model_one = twist_model_one = 0; + roll_model_one = ROLL_NONE; + twist_model_one = TWIST_NONE; damping_model_one = VISCOELASTIC; int iarg = 2; @@ -744,35 +800,35 @@ void PairGranular::coeff(int narg, char **arg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hooke option"); normal_model_one = HOOKE; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // kn - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // kn + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping iarg += 3; } else if (strcmp(arg[iarg], "hertz") == 0) { if (iarg + 2 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hertz option"); normal_model_one = HERTZ; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // kn - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // kn + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping iarg += 3; } else if (strcmp(arg[iarg], "hertz/material") == 0) { if (iarg + 3 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hertz/material option"); normal_model_one = HERTZ_MATERIAL; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // E - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping - normal_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); // Poisson's ratio + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping + normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio iarg += 4; } else if (strcmp(arg[iarg], "dmt") == 0) { if (iarg + 4 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for Hertz option"); normal_model_one = DMT; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // E - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping - normal_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); // Poisson's ratio - normal_coeffs_one[3] = force->numeric(FLERR,arg[iarg+4]); // cohesion + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping + normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio + normal_coeffs_one[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); // cohesion iarg += 5; } else if (strcmp(arg[iarg], "jkr") == 0) { if (iarg + 4 >= narg) @@ -780,10 +836,10 @@ void PairGranular::coeff(int narg, char **arg) "not enough parameters provided for JKR option"); beyond_contact = 1; normal_model_one = JKR; - normal_coeffs_one[0] = force->numeric(FLERR,arg[iarg+1]); // E - normal_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); // damping - normal_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); // Poisson's ratio - normal_coeffs_one[3] = force->numeric(FLERR,arg[iarg+4]); // cohesion + normal_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); // E + normal_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // damping + normal_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); // Poisson's ratio + normal_coeffs_one[3] = utils::numeric(FLERR,arg[iarg+4],false,lmp); // cohesion iarg += 5; } else if (strcmp(arg[iarg], "damping") == 0) { if (iarg+1 >= narg) @@ -815,12 +871,14 @@ void PairGranular::coeff(int narg, char **arg) tangential_model_one = TANGENTIAL_NOHISTORY; tangential_coeffs_one[0] = 0; // gammat and friction coeff - tangential_coeffs_one[1] = force->numeric(FLERR,arg[iarg+2]); - tangential_coeffs_one[2] = force->numeric(FLERR,arg[iarg+3]); + tangential_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tangential_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if ((strcmp(arg[iarg+1], "linear_history") == 0) || (strcmp(arg[iarg+1], "mindlin") == 0) || - (strcmp(arg[iarg+1], "mindlin_rescale") == 0)) { + (strcmp(arg[iarg+1], "mindlin_rescale") == 0) || + (strcmp(arg[iarg+1], "mindlin/force") == 0) || + (strcmp(arg[iarg+1], "mindlin_rescale/force") == 0)) { if (iarg + 4 >= narg) error->all(FLERR,"Illegal pair_coeff command, " "not enough parameters provided for tangential model"); @@ -830,9 +888,15 @@ void PairGranular::coeff(int narg, char **arg) tangential_model_one = TANGENTIAL_MINDLIN; else if (strcmp(arg[iarg+1], "mindlin_rescale") == 0) tangential_model_one = TANGENTIAL_MINDLIN_RESCALE; + else if (strcmp(arg[iarg+1], "mindlin/force") == 0) + tangential_model_one = TANGENTIAL_MINDLIN_FORCE; + else if (strcmp(arg[iarg+1], "mindlin_rescale/force") == 0) + tangential_model_one = TANGENTIAL_MINDLIN_RESCALE_FORCE; tangential_history = 1; if ((tangential_model_one == TANGENTIAL_MINDLIN || - tangential_model_one == TANGENTIAL_MINDLIN_RESCALE) && + tangential_model_one == TANGENTIAL_MINDLIN_RESCALE || + tangential_model_one == TANGENTIAL_MINDLIN_FORCE || + tangential_model_one == TANGENTIAL_MINDLIN_RESCALE_FORCE) && (strcmp(arg[iarg+2], "NULL") == 0)) { if (normal_model_one == HERTZ || normal_model_one == HOOKE) { error->all(FLERR, "NULL setting for Mindlin tangential " @@ -841,11 +905,11 @@ void PairGranular::coeff(int narg, char **arg) } tangential_coeffs_one[0] = -1; } else { - tangential_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); // kt + tangential_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); // kt } // gammat and friction coeff - tangential_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - tangential_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + tangential_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + tangential_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -864,9 +928,9 @@ void PairGranular::coeff(int narg, char **arg) roll_model_one = ROLL_SDS; roll_history = 1; // kR and gammaR and rolling friction coeff - roll_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); - roll_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - roll_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + roll_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + roll_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + roll_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -889,9 +953,9 @@ void PairGranular::coeff(int narg, char **arg) twist_model_one = TWIST_SDS; twist_history = 1; // kt and gammat and friction coeff - twist_coeffs_one[0] = force->numeric(FLERR,arg[iarg+2]); - twist_coeffs_one[1] = force->numeric(FLERR,arg[iarg+3]); - twist_coeffs_one[2] = force->numeric(FLERR,arg[iarg+4]); + twist_coeffs_one[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + twist_coeffs_one[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + twist_coeffs_one[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else { error->all(FLERR, "Illegal pair_coeff command, " @@ -900,7 +964,7 @@ void PairGranular::coeff(int narg, char **arg) } else if (strcmp(arg[iarg], "cutoff") == 0) { if (iarg + 1 >= narg) error->all(FLERR, "Illegal pair_coeff command, not enough parameters"); - cutoff_one = force->numeric(FLERR,arg[iarg+1]); + cutoff_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR, "Illegal pair coeff command"); } @@ -1014,7 +1078,8 @@ void PairGranular::init_style() } for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) - if (tangential_model[i][j] == TANGENTIAL_MINDLIN_RESCALE) { + if (tangential_model[i][j] == TANGENTIAL_MINDLIN_RESCALE || + tangential_model[i][j] == TANGENTIAL_MINDLIN_RESCALE_FORCE) { size_history += 1; roll_history_index += 1; twist_history_index += 1; @@ -1036,7 +1101,7 @@ void PairGranular::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (use_history && fix_history == NULL) { + if (use_history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",size_history); char **fixarg = new char*[4]; @@ -1060,7 +1125,7 @@ void PairGranular::init_style() // check for FixRigid so can extract rigid body masses - fix_rigid = NULL; + fix_rigid = nullptr; for (i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) break; if (i < modify->nfix) fix_rigid = modify->fix[i]; @@ -1265,20 +1330,20 @@ void PairGranular::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,NULL,error); - utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,NULL,error); - utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&normal_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&damping_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tangential_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&roll_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&twist_model[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,normal_coeffs[i][j],sizeof(double),4,fp,nullptr,error); + utils::sfread(FLERR,tangential_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,roll_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,twist_coeffs[i][j],sizeof(double),3,fp,nullptr,error); + utils::sfread(FLERR,&cutoff_type[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&normal_model[i][j],1,MPI_INT,0,world); MPI_Bcast(&damping_model[i][j],1,MPI_INT,0,world); @@ -1460,7 +1525,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, damp_normal = a*meff; } else if (damping_model[itype][jtype] == TSUJI) { damp_normal = sqrt(meff*knfac); - } + } else damp_normal = 0.0; damp_normal_prefactor = normal_coeffs[itype][jtype][1]*damp_normal; Fdamp = -damp_normal_prefactor*vnnr; @@ -1484,6 +1549,12 @@ double PairGranular::single(int i, int j, int itype, int jtype, // tangential force, including history effects //**************************************** + // For linear, mindlin, mindlin_rescale: + // history = cumulative tangential displacement + // + // For mindlin/force, mindlin_rescale/force: + // history = cumulative tangential elastic force + // tangential component vt1 = vr1 - vn1; vt2 = vr2 - vn2; @@ -1519,9 +1590,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, damp_tangential = tangential_coeffs[itype][jtype][1]*damp_normal_prefactor; if (tangential_history) { - if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN) { - k_tangential *= a; - } else if (tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { + if (tangential_model[itype][jtype] != TANGENTIAL_HISTORY) { k_tangential *= a; } @@ -1529,9 +1598,17 @@ double PairGranular::single(int i, int j, int itype, int jtype, history[2]*history[2]); // tangential forces = history + tangential velocity damping - fs1 = -k_tangential*history[0] - damp_tangential*vtr1; - fs2 = -k_tangential*history[1] - damp_tangential*vtr2; - fs3 = -k_tangential*history[2] - damp_tangential*vtr3; + if (tangential_model[itype][jtype] == TANGENTIAL_HISTORY || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN || + tangential_model[itype][jtype] == TANGENTIAL_MINDLIN_RESCALE) { + fs1 = -k_tangential*history[0] - damp_tangential*vtr1; + fs2 = -k_tangential*history[1] - damp_tangential*vtr2; + fs3 = -k_tangential*history[2] - damp_tangential*vtr3; + } else { + fs1 = history[0] - damp_tangential*vtr1; + fs2 = history[1] - damp_tangential*vtr2; + fs3 = history[2] - damp_tangential*vtr3; + } // rescale frictional forces if needed fs = sqrt(fs1*fs1 + fs2*fs2 + fs3*fs3); @@ -1540,7 +1617,7 @@ double PairGranular::single(int i, int j, int itype, int jtype, fs1 *= Fscrit/fs; fs2 *= Fscrit/fs; fs3 *= Fscrit/fs; - fs *= Fscrit/fs; + fs *= Fscrit/fs; } else fs1 = fs2 = fs3 = fs = 0.0; } diff --git a/src/GRANULAR/pair_granular.h b/src/GRANULAR/pair_granular.h index e9ba629b49..7ef4f2af98 100644 --- a/src/GRANULAR/pair_granular.h +++ b/src/GRANULAR/pair_granular.h @@ -56,7 +56,7 @@ class PairGranular : public Pair { // storage of rigid body masses for use in granular interactions - class Fix *fix_rigid; // ptr to rigid body fix, NULL if none + class Fix *fix_rigid; // ptr to rigid body fix, null pointer if none double *mass_rigid; // rigid mass for owned+ghost atoms int nmax; // allocated size of mass_rigid diff --git a/src/KIM/fix_store_kim.cpp b/src/KIM/fix_store_kim.cpp index 776d8aab98..5428b75093 100644 --- a/src/KIM/fix_store_kim.cpp +++ b/src/KIM/fix_store_kim.cpp @@ -67,8 +67,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixStoreKIM::FixStoreKIM(LAMMPS *lmp, int narg, char **arg) - : Fix(lmp, narg, arg), simulator_model(NULL), model_name(NULL), - model_units(NULL), user_units(NULL) + : Fix(lmp, narg, arg), simulator_model(nullptr), model_name(nullptr), + model_units(nullptr), user_units(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix STORE/KIM command"); } @@ -82,25 +82,25 @@ FixStoreKIM::~FixStoreKIM() if (simulator_model) { KIM_SimulatorModel *sm = (KIM_SimulatorModel *)simulator_model; KIM_SimulatorModel_Destroy(&sm); - simulator_model = NULL; + simulator_model = nullptr; } if (model_name) { char *mn = (char *)model_name; delete[] mn; - model_name = NULL; + model_name = nullptr; } if (model_units) { char *mu = (char *)model_units; delete[] mu; - model_units = NULL; + model_units = nullptr; } if (user_units) { char *uu = (char *)user_units; delete[] uu; - user_units = NULL; + user_units = nullptr; } } @@ -151,5 +151,5 @@ void *FixStoreKIM::getptr(const char *name) else if (strcmp(name,"model_name") == 0) return model_name; else if (strcmp(name,"model_units") == 0) return model_units; else if (strcmp(name,"user_units") == 0) return user_units; - else return NULL; + else return nullptr; } diff --git a/src/KIM/fix_store_kim.h b/src/KIM/fix_store_kim.h index 6baf480993..5775056876 100644 --- a/src/KIM/fix_store_kim.h +++ b/src/KIM/fix_store_kim.h @@ -79,8 +79,8 @@ class FixStoreKIM : public Fix { private: void *simulator_model; // pointer to KIM simulator model class void *model_name; // string of KIM model name - void *model_units; // string of unit conversion origin or NULL - void *user_units; // string of unit conversion target or NULL + void *model_units; // string of unit conversion origin or null pointer + void *user_units; // string of unit conversion target or null pointer }; } diff --git a/src/KIM/kim_init.cpp b/src/KIM/kim_init.cpp index 5e3bd934a9..5cd8f6a69f 100644 --- a/src/KIM/kim_init.cpp +++ b/src/KIM/kim_init.cpp @@ -57,24 +57,19 @@ ------------------------------------------------------------------------- */ #include "kim_init.h" -#include "fix_store_kim.h" -#include "kim_units.h" -#include -#include -#include -#include -#include "error.h" -#include "atom.h" + +#include "citeme.h" #include "comm.h" #include "domain.h" -#include "modify.h" -#include "update.h" -#include "universe.h" +#include "error.h" +#include "fix_store_kim.h" #include "input.h" +#include "kim_units.h" +#include "modify.h" +#include "universe.h" #include "variable.h" -#include "citeme.h" -#include "utils.h" -#include "fmt/format.h" + +#include extern "C" { #include "KIM_SimulatorHeaders.h" @@ -101,7 +96,7 @@ void KimInit::command(int narg, char **arg) } else unit_conversion_mode = false; char *model_units; - KIM_Model *pkim = NULL; + KIM_Model *pkim = nullptr; if (universe->me == 0) std::remove("kim.log"); @@ -318,7 +313,7 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM mesg += "# For Simulator : "; mesg += std::string(sim_name) + " " + sim_version + "\n"; mesg += "# Running on : LAMMPS "; - mesg += universe->version; + mesg += lmp->version; mesg += "\n"; mesg += "#\n"; @@ -371,8 +366,8 @@ void KimInit::do_init(char *model_name, char *user_units, char *model_units, KIM if (numberOfParameters) { KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; mesg += std::to_string(numberOfParameters) + " mutable parameters. \n"; @@ -491,7 +486,7 @@ void KimInit::write_log_cite(char *model_name) int availableAsString; char const * fileString; err = KIM_Collections_GetItemMetadataFile( - coll,i,&fileName,NULL,NULL,&availableAsString,&fileString); + coll,i,&fileName,nullptr,nullptr,&availableAsString,&fileString); if (err) continue; if (0 == strncmp("kimcite",fileName,7)) { diff --git a/src/KIM/kim_init.h b/src/KIM/kim_init.h index 3311d4e13d..8fa3247b22 100644 --- a/src/KIM/kim_init.h +++ b/src/KIM/kim_init.h @@ -66,7 +66,6 @@ CommandStyle(kim_init,KimInit) #define LMP_KIM_INIT_H #include "pointers.h" -#include // Forward declaration. typedef struct KIM_Model KIM_Model; diff --git a/src/KIM/kim_interactions.cpp b/src/KIM/kim_interactions.cpp index 87be2a4e7e..c5ae2ec380 100644 --- a/src/KIM/kim_interactions.cpp +++ b/src/KIM/kim_interactions.cpp @@ -57,23 +57,18 @@ ------------------------------------------------------------------------- */ #include "kim_interactions.h" -#include -#include -#include -#include -#include -#include "error.h" + #include "atom.h" #include "comm.h" #include "domain.h" +#include "error.h" +#include "fix_store_kim.h" +#include "input.h" #include "modify.h" #include "update.h" -#include "universe.h" -#include "input.h" -#include "variable.h" -#include "utils.h" -#include "fix_store_kim.h" -#include "fmt/format.h" + +#include +#include extern "C" { #include "KIM_SimulatorHeaders.h" @@ -108,12 +103,12 @@ void KimInteractions::do_setup(int narg, char **arg) fixed_types = false; } - char *model_name = NULL; - KIM_SimulatorModel *simulatorModel(NULL); + char *model_name = nullptr; + KIM_SimulatorModel *simulatorModel(nullptr); // check if we had a kim_init command by finding fix STORE/KIM // retrieve model name and pointer to simulator model class instance. - // validate model name if not given as NULL. + // validate model name if not given as null pointer. int ifix = modify->find_fix("KIM_MODEL_STORE"); if (ifix >= 0) { @@ -256,12 +251,12 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con std::string key = words[1]; std::string filename = words[2]; std::vector species(words.begin()+3,words.end()); - if (species.size() != atom->ntypes) + if ((int)species.size() != atom->ntypes) error->one(FLERR,"Incorrect args for KIM_SET_TYPE_PARAMETERS command"); FILE *fp; fp = fopen(filename.c_str(),"r"); - if (fp == NULL) { + if (fp == nullptr) { error->one(FLERR,"Parameter file not found"); } @@ -271,7 +266,7 @@ void KimInteractions::KIM_SET_TYPE_PARAMETERS(const std::string &input_line) con while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; diff --git a/src/KIM/kim_interactions.h b/src/KIM/kim_interactions.h index 414c7b39d5..071e5b284f 100644 --- a/src/KIM/kim_interactions.h +++ b/src/KIM/kim_interactions.h @@ -66,7 +66,6 @@ CommandStyle(kim_interactions,KimInteractions) #define LMP_KIM_INTERACTIONS_H #include "pointers.h" -#include namespace LAMMPS_NS { diff --git a/src/KIM/kim_param.cpp b/src/KIM/kim_param.cpp index 6df8c075dc..121f167ab6 100644 --- a/src/KIM/kim_param.cpp +++ b/src/KIM/kim_param.cpp @@ -56,19 +56,17 @@ ------------------------------------------------------------------------- */ #include "kim_param.h" -#include "fix_store_kim.h" -#include "pair_kim.h" -#include -#include -#include -#include -#include "comm.h" + #include "error.h" +#include "fix_store_kim.h" +#include "force.h" #include "input.h" #include "modify.h" +#include "pair_kim.h" #include "variable.h" -#include "force.h" -#include "fmt/format.h" + +#include +#include extern "C" { @@ -187,7 +185,7 @@ void KimParam::command(int narg, char **arg) input->write_echo(fmt::format("#=== BEGIN kim-param {} ===================" "==================\n",kim_param_get_set)); - KIM_Model *pkim = NULL; + KIM_Model *pkim = nullptr; std::string atom_type_list; @@ -253,9 +251,9 @@ void KimParam::command(int narg, char **arg) // Get the parameters if (kim_param_get_set == "get") { // Parameter name - char *paramname = NULL; + char *paramname = nullptr; // Variable name - char *varname = NULL; + char *varname = nullptr; // Loop over all the arguments for (int i = 1; i < narg;) { @@ -269,8 +267,8 @@ void KimParam::command(int narg, char **arg) int param_index; KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { kim_error = KIM_Model_GetParameterMetadata(pkim, param_index, @@ -346,7 +344,7 @@ void KimParam::command(int narg, char **arg) } int const nvars = nubound - nlbound + 1; - char **varsname = NULL; + char **varsname = nullptr; if (i < narg) { // Get the variable/variable_base name diff --git a/src/KIM/kim_param.h b/src/KIM/kim_param.h index a4e26451f2..e4fc5ce59a 100644 --- a/src/KIM/kim_param.h +++ b/src/KIM/kim_param.h @@ -65,7 +65,6 @@ CommandStyle(kim_param, KimParam) #define LMP_KIM_PARAM_H #include "pointers.h" -#include namespace LAMMPS_NS { diff --git a/src/KIM/kim_property.cpp b/src/KIM/kim_property.cpp index 643e0da47b..4a381fb8da 100644 --- a/src/KIM/kim_property.cpp +++ b/src/KIM/kim_property.cpp @@ -53,21 +53,18 @@ Designed for use with the kim-api-2.1.0 (and newer) package ------------------------------------------------------------------------- */ -#if LMP_PYTHON -#define PY_SSIZE_T_CLEAN -#include -#endif - #include "kim_property.h" #include "comm.h" -#include "input.h" -#include "variable.h" -#include "utils.h" #include "error.h" +#include "input.h" #include "lmppython.h" +#include "variable.h" -#include +#if LMP_PYTHON +#define PY_SSIZE_T_CLEAN +#include // IWYU pragma: export +#endif using namespace LAMMPS_NS; @@ -115,7 +112,7 @@ void kimProperty::command(int narg, char **arg) PyGILState_STATE gstate = PyGILState_Ensure(); // kim_property module - PyObject *kim_property = NULL; + PyObject *kim_property = nullptr; // import kim_property { @@ -441,7 +438,7 @@ void kimProperty::command(int narg, char **arg) "evaluation failed!"); } } else - pValue = NULL; + pValue = nullptr; // Destroy the variable input->variable->set("kim_property_str delete"); diff --git a/src/KIM/kim_query.cpp b/src/KIM/kim_query.cpp index 4a1db9450d..1fb003546f 100644 --- a/src/KIM/kim_query.cpp +++ b/src/KIM/kim_query.cpp @@ -56,24 +56,22 @@ ------------------------------------------------------------------------- */ #include "kim_query.h" -#include "fix_store_kim.h" -#include -#include -#include -#include + #include "comm.h" #include "error.h" +#include "fix_store_kim.h" +#include "info.h" #include "input.h" #include "modify.h" #include "variable.h" #include "version.h" -#include "info.h" -#include "fmt/format.h" + +#include +#include #if defined(LMP_KIM_CURL) #include #include -#include #endif using namespace LAMMPS_NS; @@ -340,8 +338,8 @@ char *do_query(char *qfunction, char * model_name, int narg, char **arg, /* ---------------------------------------------------------------------- */ -void KimQuery::echo_var_assign(const std::string & name, - const std::string & value) const +void KimQuery::echo_var_assign(const std::string &name, + const std::string &value) const { input->write_echo(fmt::format("variable {} string {}\n",name,value)); } diff --git a/src/KIM/kim_query.h b/src/KIM/kim_query.h index 6888f911f4..e1c49ed71d 100644 --- a/src/KIM/kim_query.h +++ b/src/KIM/kim_query.h @@ -64,7 +64,6 @@ CommandStyle(kim_query,KimQuery) #define LMP_KIM_QUERY_H #include "pointers.h" -#include namespace LAMMPS_NS { diff --git a/src/KIM/kim_units.cpp b/src/KIM/kim_units.cpp index 8db1eeff17..77dbad6f1d 100644 --- a/src/KIM/kim_units.cpp +++ b/src/KIM/kim_units.cpp @@ -57,6 +57,8 @@ #include #include #include +#include + using namespace std; namespace @@ -1016,10 +1018,8 @@ double get_torque_conversion_factor(units from_unit_enum, units to_unit_enum) double get_temperature_conversion_factor(units from_unit_enum, units to_unit_enum) { map > conv; - double to_si; conv[kelvin][kelvin] = 1.0; - return conv[from_unit_enum][to_unit_enum]; } diff --git a/src/KIM/pair_kim.cpp b/src/KIM/pair_kim.cpp index 7d2333aab1..30b5e6cbb2 100644 --- a/src/KIM/pair_kim.cpp +++ b/src/KIM/pair_kim.cpp @@ -55,21 +55,20 @@ Designed for use with the kim-api-2.0.2 (and newer) package ------------------------------------------------------------------------- */ #include "pair_kim.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" +#include "domain.h" +#include "error.h" #include "force.h" -#include "neighbor.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" +#include "neighbor.h" #include "update.h" -#include "memory.h" -#include "domain.h" -#include "utils.h" -#include "error.h" + +#include +#include using namespace LAMMPS_NS; @@ -79,9 +78,9 @@ PairKIM::PairKIM(LAMMPS *lmp) : Pair(lmp), settings_call_count(0), init_style_call_count(0), - kim_modelname(NULL), - lmps_map_species_to_unique(NULL), - lmps_unique_elements(NULL), + kim_modelname(nullptr), + lmps_map_species_to_unique(nullptr), + lmps_unique_elements(nullptr), lmps_num_unique_elements(0), lmps_units(METAL), lengthUnit(KIM_LENGTH_UNIT_unused), @@ -89,8 +88,8 @@ PairKIM::PairKIM(LAMMPS *lmp) : chargeUnit(KIM_CHARGE_UNIT_unused), temperatureUnit(KIM_TEMPERATURE_UNIT_unused), timeUnit(KIM_TIME_UNIT_unused), - pkim(NULL), - pargs(NULL), + pkim(nullptr), + pargs(nullptr), kim_model_support_for_energy(KIM_SUPPORT_STATUS_notSupported), kim_model_support_for_forces(KIM_SUPPORT_STATUS_notSupported), kim_model_support_for_particleEnergy(KIM_SUPPORT_STATUS_notSupported), @@ -98,15 +97,15 @@ PairKIM::PairKIM(LAMMPS *lmp) : lmps_local_tot_num_atoms(0), kim_global_influence_distance(0.0), kim_number_of_neighbor_lists(0), - kim_cutoff_values(NULL), - modelWillNotRequestNeighborsOfNoncontributingParticles(NULL), - neighborLists(NULL), - kim_particle_codes(NULL), + kim_cutoff_values(nullptr), + modelWillNotRequestNeighborsOfNoncontributingParticles(nullptr), + neighborLists(nullptr), + kim_particle_codes(nullptr), lmps_maxalloc(0), - kim_particleSpecies(NULL), - kim_particleContributing(NULL), - lmps_stripped_neigh_list(NULL), - lmps_stripped_neigh_ptr(NULL) + kim_particleSpecies(nullptr), + kim_particleContributing(nullptr), + lmps_stripped_neigh_list(nullptr), + lmps_stripped_neigh_ptr(nullptr) { // Initialize Pair data members to appropriate values single_enable = 0; // We do not provide the Single() function @@ -138,7 +137,7 @@ PairKIM::~PairKIM() if (kim_particle_codes_ok) { delete [] kim_particle_codes; - kim_particle_codes = NULL; + kim_particle_codes = nullptr; kim_particle_codes_ok = false; } @@ -343,8 +342,8 @@ void PairKIM::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom species to KIM elements // lmps_map_species_to_unique[i] = @@ -394,7 +393,7 @@ void PairKIM::coeff(int narg, char **arg) // setup mapping between LAMMPS unique elements and KIM species codes if (kim_particle_codes_ok) { delete [] kim_particle_codes; - kim_particle_codes = NULL; + kim_particle_codes = nullptr; kim_particle_codes_ok = false; } kim_particle_codes = new int[lmps_num_unique_elements]; @@ -431,7 +430,7 @@ void PairKIM::coeff(int narg, char **arg) int kimerror; // Parameter name - char *paramname = NULL; + char *paramname = nullptr; for (int i = 2 + atom->ntypes; i < narg;) { // Parameter name @@ -444,8 +443,8 @@ void PairKIM::coeff(int narg, char **arg) int param_index; KIM_DataType kim_DataType; int extent; - char const *str_name = NULL; - char const *str_desc = NULL; + char const *str_name = nullptr; + char const *str_desc = nullptr; for (param_index = 0; param_index < numberOfParameters; ++param_index) { kimerror = KIM_Model_GetParameterMetadata(pkim, param_index, @@ -904,7 +903,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs,KIM_COMPUTE_ARGUMENT_NAME_partialEnergy, - static_cast(NULL)); + static_cast(nullptr)); } } @@ -925,7 +924,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleEnergy, - static_cast(NULL)); + static_cast(nullptr)); } else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleEnergy, KIM_SUPPORT_STATUS_notSupported)) { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( @@ -938,7 +937,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, - static_cast(NULL)); + static_cast(nullptr)); } else { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialForces, &(atom->f[0][0])); @@ -961,7 +960,7 @@ void PairKIM::set_argument_pointers() kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( pargs, KIM_COMPUTE_ARGUMENT_NAME_partialParticleVirial, - static_cast(NULL)); + static_cast(nullptr)); } else if (KIM_SupportStatus_NotEqual(kim_model_support_for_particleVirial, KIM_SUPPORT_STATUS_notSupported)) { kimerror = kimerror || KIM_ComputeArguments_SetArgumentPointerDouble( diff --git a/src/KIM/pair_kim.h b/src/KIM/pair_kim.h index 1f2c8c8599..0c2e8d2684 100644 --- a/src/KIM/pair_kim.h +++ b/src/KIM/pair_kim.h @@ -65,7 +65,6 @@ PairStyle(kim,PairKIM) // includes from KIM & LAMMPS class KIM_API_model; #include "pair.h" -#include extern "C" { #include "KIM_SimulatorHeaders.h" diff --git a/src/KOKKOS/angle_charmm_kokkos.cpp b/src/KOKKOS/angle_charmm_kokkos.cpp index 288e5a475b..59ccac92ce 100644 --- a/src/KOKKOS/angle_charmm_kokkos.cpp +++ b/src/KOKKOS/angle_charmm_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "angle_charmm_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "force.h" #include "math_const.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/KOKKOS/angle_class2_kokkos.cpp b/src/KOKKOS/angle_class2_kokkos.cpp index ebb016b31b..bfa0f81a1d 100644 --- a/src/KOKKOS/angle_class2_kokkos.cpp +++ b/src/KOKKOS/angle_class2_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "angle_class2_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "force.h" #include "math_const.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/KOKKOS/angle_cosine_kokkos.cpp b/src/KOKKOS/angle_cosine_kokkos.cpp index 960988b3b5..cf93bfbde5 100644 --- a/src/KOKKOS/angle_cosine_kokkos.cpp +++ b/src/KOKKOS/angle_cosine_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "angle_cosine_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "force.h" #include "math_const.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/KOKKOS/angle_harmonic_kokkos.cpp b/src/KOKKOS/angle_harmonic_kokkos.cpp index bc08ff4b65..3a8878d222 100644 --- a/src/KOKKOS/angle_harmonic_kokkos.cpp +++ b/src/KOKKOS/angle_harmonic_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "angle_harmonic_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "force.h" #include "math_const.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/KOKKOS/atom_kokkos.cpp b/src/KOKKOS/atom_kokkos.cpp index e826a7c392..a587494d09 100644 --- a/src/KOKKOS/atom_kokkos.cpp +++ b/src/KOKKOS/atom_kokkos.cpp @@ -87,7 +87,7 @@ AtomKokkos::~AtomKokkos() memoryKK->destroy_kokkos(k_duChem,duChem); memoryKK->destroy_kokkos(k_dvector,dvector); - dvector = NULL; + dvector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -118,7 +118,7 @@ void AtomKokkos::sync_overlapping_device(const ExecutionSpace space, unsigned in void AtomKokkos::allocate_type_arrays() { - if (avec->mass_type) { + if (avec->mass_type == AtomVec::PER_TYPE) { k_mass = DAT::tdual_float_1d("Mass",ntypes+1); mass = k_mass.h_view.data(); mass_setflag = new int[ntypes+1]; @@ -282,7 +282,7 @@ int AtomKokkos::add_custom(const char *name, int flag) /* ---------------------------------------------------------------------- remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to NULL + free memory for vector and name and set ptrs to a null pointer ivector/dvector and iname/dname lists never shrink ------------------------------------------------------------------------- */ @@ -290,14 +290,14 @@ void AtomKokkos::remove_custom(int flag, int index) { if (flag == 0) { memory->destroy(ivector[index]); - ivector[index] = NULL; + ivector[index] = nullptr; delete [] iname[index]; - iname[index] = NULL; + iname[index] = nullptr; } else { //memoryKK->destroy_kokkos(dvector); - dvector[index] = NULL; + dvector[index] = nullptr; delete [] dname[index]; - dname[index] = NULL; + dname[index] = nullptr; } } diff --git a/src/KOKKOS/atom_kokkos.h b/src/KOKKOS/atom_kokkos.h index 82ea55beb1..6eebbad661 100644 --- a/src/KOKKOS/atom_kokkos.h +++ b/src/KOKKOS/atom_kokkos.h @@ -11,7 +11,7 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include "atom.h" +#include "atom.h" // IWYU pragma: export #include "kokkos_type.h" #ifndef LMP_ATOM_KOKKOS_H @@ -78,7 +78,7 @@ class AtomKokkos : public Atom { }; template -class SortFunctor { +struct SortFunctor { typedef typename ViewType::device_type device_type; ViewType source; Kokkos::View dest; @@ -100,19 +100,19 @@ class SortFunctor { dest(i) = source(index(i)); } void operator()(const typename std::enable_if::type& i) { - for(int j=0;j::type& i) { - for(int j=0;j::type& i) { - for(int j=0;jmemcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_angle_kokkos.h b/src/KOKKOS/atom_vec_angle_kokkos.h index 4fc71725b0..29b5ce8fc5 100644 --- a/src/KOKKOS/atom_vec_angle_kokkos.h +++ b/src/KOKKOS/atom_vec_angle_kokkos.h @@ -56,7 +56,7 @@ class AtomVecAngleKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.cpp b/src/KOKKOS/atom_vec_atomic_kokkos.cpp index 7a66dc753a..8b7d358791 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.cpp +++ b/src/KOKKOS/atom_vec_atomic_kokkos.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "atom_vec_atomic_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm_kokkos.h" #include "domain.h" -#include "modify.h" -#include "fix.h" -#include "atom_masks.h" -#include "memory_kokkos.h" #include "error.h" -#include "utils.h" +#include "fix.h" +#include "memory_kokkos.h" +#include "modify.h" using namespace LAMMPS_NS; @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; AtomVecAtomicKokkos::AtomVecAtomicKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -879,9 +879,9 @@ void AtomVecAtomicKokkos::write_data(FILE *fp, int n, double **buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecAtomicKokkos::memory_usage() +double AtomVecAtomicKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_atomic_kokkos.h b/src/KOKKOS/atom_vec_atomic_kokkos.h index 212132ef60..2c682d4989 100644 --- a/src/KOKKOS/atom_vec_atomic_kokkos.h +++ b/src/KOKKOS/atom_vec_atomic_kokkos.h @@ -46,7 +46,7 @@ class AtomVecAtomicKokkos : public AtomVecKokkos { void data_atom(double *, tagint, char **); void pack_data(double **); void write_data(FILE *, int, double **); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_bond_kokkos.cpp b/src/KOKKOS/atom_vec_bond_kokkos.cpp index 157f194125..ddf59a4fd7 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.cpp +++ b/src/KOKKOS/atom_vec_bond_kokkos.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "atom_vec_bond_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm_kokkos.h" #include "domain.h" -#include "modify.h" -#include "fix.h" -#include "atom_masks.h" -#include "memory_kokkos.h" #include "error.h" -#include "utils.h" +#include "fix.h" +#include "memory_kokkos.h" +#include "modify.h" using namespace LAMMPS_NS; @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecBondKokkos::AtomVecBondKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -1148,9 +1148,9 @@ int AtomVecBondKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecBondKokkos::memory_usage() +double AtomVecBondKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_bond_kokkos.h b/src/KOKKOS/atom_vec_bond_kokkos.h index f38ade8f64..7f4d04c037 100644 --- a/src/KOKKOS/atom_vec_bond_kokkos.h +++ b/src/KOKKOS/atom_vec_bond_kokkos.h @@ -50,7 +50,7 @@ class AtomVecBondKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_charge_kokkos.cpp b/src/KOKKOS/atom_vec_charge_kokkos.cpp index 8f468b8e46..88bcccdbc9 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.cpp +++ b/src/KOKKOS/atom_vec_charge_kokkos.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "atom_vec_charge_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm_kokkos.h" #include "domain.h" -#include "modify.h" -#include "fix.h" -#include "atom_masks.h" -#include "memory_kokkos.h" #include "error.h" -#include "utils.h" +#include "fix.h" +#include "memory_kokkos.h" +#include "modify.h" using namespace LAMMPS_NS; @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; AtomVecChargeKokkos::AtomVecChargeKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -1048,9 +1048,9 @@ int AtomVecChargeKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecChargeKokkos::memory_usage() +double AtomVecChargeKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_charge_kokkos.h b/src/KOKKOS/atom_vec_charge_kokkos.h index 39d641b844..4d61b2a69c 100644 --- a/src/KOKKOS/atom_vec_charge_kokkos.h +++ b/src/KOKKOS/atom_vec_charge_kokkos.h @@ -51,7 +51,7 @@ class AtomVecChargeKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.cpp b/src/KOKKOS/atom_vec_dpd_kokkos.cpp index 5319744c22..463f4d6897 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.cpp +++ b/src/KOKKOS/atom_vec_dpd_kokkos.cpp @@ -20,7 +20,7 @@ #include "atom_masks.h" #include "memory_kokkos.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; AtomVecDPDKokkos::AtomVecDPDKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 0; size_forward = 7; @@ -1830,9 +1830,9 @@ int AtomVecDPDKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecDPDKokkos::memory_usage() +double AtomVecDPDKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_dpd_kokkos.h b/src/KOKKOS/atom_vec_dpd_kokkos.h index e969a28cb8..71b0c85590 100644 --- a/src/KOKKOS/atom_vec_dpd_kokkos.h +++ b/src/KOKKOS/atom_vec_dpd_kokkos.h @@ -59,7 +59,7 @@ class AtomVecDPDKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, diff --git a/src/KOKKOS/atom_vec_full_kokkos.cpp b/src/KOKKOS/atom_vec_full_kokkos.cpp index 5d5833af07..b4bf77b4bf 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.cpp +++ b/src/KOKKOS/atom_vec_full_kokkos.cpp @@ -20,7 +20,7 @@ #include "atom_masks.h" #include "memory_kokkos.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecFullKokkos::AtomVecFullKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -1588,9 +1588,9 @@ int AtomVecFullKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecFullKokkos::memory_usage() +double AtomVecFullKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_full_kokkos.h b/src/KOKKOS/atom_vec_full_kokkos.h index a2d4fa9cf4..4a5a61e913 100644 --- a/src/KOKKOS/atom_vec_full_kokkos.h +++ b/src/KOKKOS/atom_vec_full_kokkos.h @@ -50,7 +50,7 @@ class AtomVecFullKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp index 8f8a0c8c00..1b90d34271 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.cpp +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "atom_vec_hybrid_kokkos.h" -#include + #include "atom_kokkos.h" +#include "atom_masks.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" -#include "utils.h" +#include "modify.h" + +#include using namespace LAMMPS_NS; @@ -88,7 +89,7 @@ void AtomVecHybridKokkos::process_args(int narg, char **arg) // hybrid settings are MAX or MIN of sub-style settings // hybrid sizes are minimal values plus extra values for each sub-style - molecular = 0; + molecular = Atom::ATOMIC; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -99,8 +100,8 @@ void AtomVecHybridKokkos::process_args(int narg, char **arg) xcol_data = 3; for (int k = 0; k < nstyles; k++) { - if ((styles[k]->molecular == 1 && molecular == 2) || - (styles[k]->molecular == 2 && molecular == 1)) + if ((styles[k]->molecular == Atom::MOLECULAR && molecular == Atom::TEMPLATE) || + (styles[k]->molecular == Atom::TEMPLATE && molecular == Atom::MOLECULAR)) error->all(FLERR,"Cannot mix molecular and molecule template " "atom styles"); molecular = MAX(molecular,styles[k]->molecular); @@ -113,7 +114,7 @@ void AtomVecHybridKokkos::process_args(int narg, char **arg) dipole_type = MAX(dipole_type,styles[k]->dipole_type); forceclearflag = MAX(forceclearflag,styles[k]->forceclearflag); - if (styles[k]->molecular == 2) onemols = styles[k]->onemols; + if (styles[k]->molecular == Atom::TEMPLATE) onemols = styles[k]->onemols; comm_x_only = MIN(comm_x_only,styles[k]->comm_x_only); comm_f_only = MIN(comm_f_only,styles[k]->comm_f_only); @@ -252,51 +253,51 @@ void AtomVecHybridKokkos::force_clear(int n, size_t nbytes) /* ---------------------------------------------------------------------- */ -int AtomVecHybridKokkos::pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, - const int & iswap, - const DAT::tdual_xfloat_2d &buf, - const int &pbc_flag, const int pbc[]) +int AtomVecHybridKokkos::pack_comm_kokkos(const int &/*n*/, const DAT::tdual_int_2d &/*k_sendlist*/, + const int & /*iswap*/, + const DAT::tdual_xfloat_2d &/*buf*/, + const int &/*pbc_flag*/, const int pbc[]) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); return 0; } -void AtomVecHybridKokkos::unpack_comm_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf) +void AtomVecHybridKokkos::unpack_comm_kokkos(const int &/*n*/, const int &/*nfirst*/, + const DAT::tdual_xfloat_2d &/*buf*/) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); } -int AtomVecHybridKokkos::pack_comm_self(const int &n, const DAT::tdual_int_2d &list, - const int & iswap, const int nfirst, - const int &pbc_flag, const int pbc[]) +int AtomVecHybridKokkos::pack_comm_self(const int &/*n*/, const DAT::tdual_int_2d &/*list*/, + const int & /*iswap*/, const int /*nfirst*/, + const int &/*pbc_flag*/, const int pbc[]) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); return 0; } -int AtomVecHybridKokkos::pack_border_kokkos(int n, DAT::tdual_int_2d k_sendlist, - DAT::tdual_xfloat_2d buf,int iswap, - int pbc_flag, int *pbc, ExecutionSpace space) +int AtomVecHybridKokkos::pack_border_kokkos(int /*n*/, DAT::tdual_int_2d /*k_sendlist*/, + DAT::tdual_xfloat_2d /*buf*/,int /*iswap*/, + int /*pbc_flag*/, int * /*pbc*/, ExecutionSpace /*space*/) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); return 0; } -void AtomVecHybridKokkos::unpack_border_kokkos(const int &n, const int &nfirst, - const DAT::tdual_xfloat_2d &buf, - ExecutionSpace space) +void AtomVecHybridKokkos::unpack_border_kokkos(const int &/*n*/, const int &/*nfirst*/, + const DAT::tdual_xfloat_2d &/*buf*/, + ExecutionSpace /*space*/) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); } -int AtomVecHybridKokkos::pack_exchange_kokkos(const int &nsend,DAT::tdual_xfloat_2d &buf, - DAT::tdual_int_1d k_sendlist, - DAT::tdual_int_1d k_copylist, - ExecutionSpace space, int dim, - X_FLOAT lo, X_FLOAT hi) +int AtomVecHybridKokkos::pack_exchange_kokkos(const int &/*nsend*/,DAT::tdual_xfloat_2d &/*buf*/, + DAT::tdual_int_1d /*k_sendlist*/, + DAT::tdual_int_1d /*k_copylist*/, + ExecutionSpace /*space*/, int /*dim*/, + X_FLOAT /*lo*/, X_FLOAT /*hi*/) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); return 0; } -int AtomVecHybridKokkos::unpack_exchange_kokkos(DAT::tdual_xfloat_2d &k_buf, int nrecv, - int nlocal, int dim, X_FLOAT lo, X_FLOAT hi, - ExecutionSpace space) +int AtomVecHybridKokkos::unpack_exchange_kokkos(DAT::tdual_xfloat_2d & /*k_buf*/, int /*nrecv*/, + int /*nlocal*/, int /*dim*/, X_FLOAT /*lo*/, + X_FLOAT /*hi*/, ExecutionSpace /*space*/) { error->all(FLERR,"AtomVecHybridKokkos doesn't yet support threaded comm"); return 0; @@ -1177,7 +1178,7 @@ void AtomVecHybridKokkos::build_styles() allstyles[nallstyles] = new char[n]; \ strcpy(allstyles[nallstyles],#key); \ nallstyles++; -#include "style_atom.h" +#include "style_atom.h" // IWYU pragma: keep #undef AtomStyle #undef ATOM_CLASS } @@ -1197,9 +1198,9 @@ int AtomVecHybridKokkos::known_style(char *str) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecHybridKokkos::memory_usage() +double AtomVecHybridKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; for (int k = 0; k < nstyles; k++) bytes += styles[k]->memory_usage(); return bytes; } diff --git a/src/KOKKOS/atom_vec_hybrid_kokkos.h b/src/KOKKOS/atom_vec_hybrid_kokkos.h index 02f9044d73..3354735bf7 100644 --- a/src/KOKKOS/atom_vec_hybrid_kokkos.h +++ b/src/KOKKOS/atom_vec_hybrid_kokkos.h @@ -65,7 +65,7 @@ class AtomVecHybridKokkos : public AtomVecKokkos { void write_vel(FILE *, int, double **); int property_atom(char *); void pack_property_atom(int, double *, int, int); - bigint memory_usage(); + double memory_usage(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, diff --git a/src/KOKKOS/atom_vec_kokkos.cpp b/src/KOKKOS/atom_vec_kokkos.cpp index b0fca4e316..f2dca9bebc 100644 --- a/src/KOKKOS/atom_vec_kokkos.cpp +++ b/src/KOKKOS/atom_vec_kokkos.cpp @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #include "atom_vec_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm_kokkos.h" #include "domain.h" -#include "atom_masks.h" -#include "utils.h" using namespace LAMMPS_NS; @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; AtomVecKokkos::AtomVecKokkos(LAMMPS *lmp) : AtomVec(lmp) { kokkosable = 1; - buffer = NULL; + buffer = nullptr; buffer_size = 0; no_comm_vel_flag = 0; diff --git a/src/KOKKOS/atom_vec_kokkos.h b/src/KOKKOS/atom_vec_kokkos.h index 7d8796b1ae..09f02f61e2 100644 --- a/src/KOKKOS/atom_vec_kokkos.h +++ b/src/KOKKOS/atom_vec_kokkos.h @@ -14,7 +14,8 @@ #ifndef LMP_ATOM_VEC_KOKKOS_H #define LMP_ATOM_VEC_KOKKOS_H -#include "atom_vec.h" +#include "atom_vec.h" // IWYU pragma: export + #include "kokkos_type.h" #include @@ -136,24 +137,24 @@ class AtomVecKokkos : public AtomVec { size_t buffer_size; void* buffer; - #ifdef KOKKOS_ENABLE_CUDA + #ifdef LMP_KOKKOS_GPU template Kokkos::View > create_async_copy(const ViewType& src) { typedef Kokkos::View::value, - Kokkos::CudaHostPinnedSpace,typename ViewType::memory_space>::type, + LMPPinnedHostType,typename ViewType::memory_space>::type, Kokkos::MemoryTraits > mirror_type; if (buffer_size == 0) { - buffer = Kokkos::kokkos_malloc(src.span()); + buffer = Kokkos::kokkos_malloc(src.span()); buffer_size = src.span(); } else if (buffer_size < src.span()) { - buffer = Kokkos::kokkos_realloc(buffer,src.span()); + buffer = Kokkos::kokkos_realloc(buffer,src.span()); buffer_size = src.span(); } return mirror_type(buffer, src.d_view.layout()); @@ -165,13 +166,13 @@ class AtomVecKokkos : public AtomVec { typename ViewType::array_layout, typename std::conditional< std::is_same::value, - Kokkos::CudaHostPinnedSpace,typename ViewType::memory_space>::type, + LMPPinnedHostType,typename ViewType::memory_space>::type, Kokkos::MemoryTraits > mirror_type; if (buffer_size == 0) { - buffer = Kokkos::kokkos_malloc(src.span()*sizeof(typename ViewType::value_type)); + buffer = Kokkos::kokkos_malloc(src.span()*sizeof(typename ViewType::value_type)); buffer_size = src.span(); } else if (buffer_size < src.span()) { - buffer = Kokkos::kokkos_realloc(buffer,src.span()*sizeof(typename ViewType::value_type)); + buffer = Kokkos::kokkos_realloc(buffer,src.span()*sizeof(typename ViewType::value_type)); buffer_size = src.span(); } mirror_type tmp_view((typename ViewType::value_type*)buffer, src.d_view.layout()); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.cpp b/src/KOKKOS/atom_vec_molecular_kokkos.cpp index 7832d6f9b0..d70d427257 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.cpp +++ b/src/KOKKOS/atom_vec_molecular_kokkos.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "atom_vec_molecular_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm_kokkos.h" #include "domain.h" -#include "modify.h" -#include "fix.h" -#include "atom_masks.h" -#include "memory_kokkos.h" #include "error.h" -#include "utils.h" +#include "fix.h" +#include "memory_kokkos.h" +#include "modify.h" using namespace LAMMPS_NS; @@ -30,9 +30,9 @@ using namespace LAMMPS_NS; AtomVecMolecularKokkos::AtomVecMolecularKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; comm_x_only = comm_f_only = 1; size_forward = 3; @@ -1987,9 +1987,9 @@ int AtomVecMolecularKokkos::write_data_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecMolecularKokkos::memory_usage() +double AtomVecMolecularKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_molecular_kokkos.h b/src/KOKKOS/atom_vec_molecular_kokkos.h index cede4f42a8..a356c6821c 100644 --- a/src/KOKKOS/atom_vec_molecular_kokkos.h +++ b/src/KOKKOS/atom_vec_molecular_kokkos.h @@ -56,7 +56,7 @@ class AtomVecMolecularKokkos : public AtomVecKokkos { int pack_data_hybrid(int, double *); void write_data(FILE *, int, double **); int write_data_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); void grow_pointers(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.cpp b/src/KOKKOS/atom_vec_sphere_kokkos.cpp index b1099d0fa6..c3cec6faee 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.cpp +++ b/src/KOKKOS/atom_vec_sphere_kokkos.cpp @@ -12,32 +12,31 @@ ------------------------------------------------------------------------- */ #include "atom_vec_sphere_kokkos.h" -#include -#include + #include "atom_kokkos.h" #include "atom_masks.h" #include "comm_kokkos.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "fix_adapt.h" #include "math_const.h" #include "memory.h" -#include "error.h" #include "memory_kokkos.h" -#include "utils.h" +#include "modify.h" + +#include using namespace LAMMPS_NS; +using namespace MathConst; #define DELTA 10 -static const double MY_PI = 3.14159265358979323846; // pi - /* ---------------------------------------------------------------------- */ AtomVecSphereKokkos::AtomVecSphereKokkos(LAMMPS *lmp) : AtomVecKokkos(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; comm_x_only = 1; comm_f_only = 0; @@ -2766,9 +2765,9 @@ int AtomVecSphereKokkos::write_vel_hybrid(FILE *fp, double *buf) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecSphereKokkos::memory_usage() +double AtomVecSphereKokkos::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (atom->memcheck("tag")) bytes += memory->usage(tag,nmax); if (atom->memcheck("type")) bytes += memory->usage(type,nmax); diff --git a/src/KOKKOS/atom_vec_sphere_kokkos.h b/src/KOKKOS/atom_vec_sphere_kokkos.h index 3f6d34e8b2..676df431d1 100644 --- a/src/KOKKOS/atom_vec_sphere_kokkos.h +++ b/src/KOKKOS/atom_vec_sphere_kokkos.h @@ -69,7 +69,7 @@ class AtomVecSphereKokkos : public AtomVecKokkos { int pack_vel_hybrid(int, double *); void write_vel(FILE *, int, double **); int write_vel_hybrid(FILE *, double *); - bigint memory_usage(); + double memory_usage(); int pack_comm_kokkos(const int &n, const DAT::tdual_int_2d &k_sendlist, const int & iswap, diff --git a/src/KOKKOS/bond_class2_kokkos.cpp b/src/KOKKOS/bond_class2_kokkos.cpp index 88504608f6..07712df203 100644 --- a/src/KOKKOS/bond_class2_kokkos.cpp +++ b/src/KOKKOS/bond_class2_kokkos.cpp @@ -16,16 +16,15 @@ ------------------------------------------------------------------------- */ #include "bond_class2_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "force.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/bond_fene_kokkos.cpp b/src/KOKKOS/bond_fene_kokkos.cpp index e6aa27649f..1ee82476b2 100644 --- a/src/KOKKOS/bond_fene_kokkos.cpp +++ b/src/KOKKOS/bond_fene_kokkos.cpp @@ -16,16 +16,16 @@ ------------------------------------------------------------------------- */ #include "bond_fene_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/bond_harmonic_kokkos.cpp b/src/KOKKOS/bond_harmonic_kokkos.cpp index ee1b58c91f..20b8778463 100644 --- a/src/KOKKOS/bond_harmonic_kokkos.cpp +++ b/src/KOKKOS/bond_harmonic_kokkos.cpp @@ -16,20 +16,18 @@ ------------------------------------------------------------------------- */ #include "bond_harmonic_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "force.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; - /* ---------------------------------------------------------------------- */ template diff --git a/src/KOKKOS/comm_kokkos.cpp b/src/KOKKOS/comm_kokkos.cpp index 3b9eeaf583..b9f3864981 100644 --- a/src/KOKKOS/comm_kokkos.cpp +++ b/src/KOKKOS/comm_kokkos.cpp @@ -12,23 +12,24 @@ ------------------------------------------------------------------------- */ #include "comm_kokkos.h" -#include "kokkos.h" + #include "atom.h" #include "atom_kokkos.h" +#include "atom_masks.h" #include "atom_vec.h" #include "atom_vec_kokkos.h" -#include "domain.h" -#include "atom_masks.h" -#include "error.h" -#include "memory_kokkos.h" -#include "force.h" -#include "pair.h" -#include "fix.h" #include "compute.h" +#include "domain.h" #include "dump.h" -#include "output.h" -#include "modify.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "kokkos.h" #include "kokkos_base.h" +#include "memory_kokkos.h" +#include "modify.h" +#include "output.h" +#include "pair.h" using namespace LAMMPS_NS; @@ -44,7 +45,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) { if (sendlist) for (int i = 0; i < maxswap; i++) memory->destroy(sendlist[i]); memory->sfree(sendlist); - sendlist = NULL; + sendlist = nullptr; k_sendlist = DAT::tdual_int_2d(); k_total_send = DAT::tdual_int_scalar("comm::k_total_send"); @@ -53,9 +54,9 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) // initialize comm buffers & exchange memory memory->destroy(buf_send); - buf_send = NULL; + buf_send = nullptr; memory->destroy(buf_recv); - buf_recv = NULL; + buf_recv = nullptr; k_exchange_lists = DAT::tdual_int_2d("comm:k_exchange_lists",2,100); k_exchange_sendlist = Kokkos::subview(k_exchange_lists,0,Kokkos::ALL); @@ -64,7 +65,7 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) k_sendflag = DAT::tdual_int_1d("comm:k_sendflag",100); memory->destroy(maxsendlist); - maxsendlist = NULL; + maxsendlist = nullptr; memory->create(maxsendlist,maxswap,"comm:maxsendlist"); for (int i = 0; i < maxswap; i++) { maxsendlist[i] = BUFMIN; @@ -81,11 +82,11 @@ CommKokkos::CommKokkos(LAMMPS *lmp) : CommBrick(lmp) CommKokkos::~CommKokkos() { memoryKK->destroy_kokkos(k_sendlist,sendlist); - sendlist = NULL; + sendlist = nullptr; memoryKK->destroy_kokkos(k_buf_send,buf_send); - buf_send = NULL; + buf_send = nullptr; memoryKK->destroy_kokkos(k_buf_recv,buf_recv); - buf_recv = NULL; + buf_recv = nullptr; } /* ---------------------------------------------------------------------- */ @@ -172,7 +173,7 @@ void CommKokkos::forward_comm(int dummy) /* ---------------------------------------------------------------------- */ template -void CommKokkos::forward_comm_device(int dummy) +void CommKokkos::forward_comm_device(int) { int n; MPI_Request request; @@ -418,7 +419,7 @@ void CommKokkos::forward_comm_pair_device(Pair *pair) if (sendproc[iswap] != me) { double* buf_send_pair; double* buf_recv_pair; - if (lmp->kokkos->cuda_aware_flag) { + if (lmp->kokkos->gpu_aware_flag) { buf_send_pair = k_buf_send_pair.view().data(); buf_recv_pair = k_buf_recv_pair.view().data(); } else { @@ -436,7 +437,7 @@ void CommKokkos::forward_comm_pair_device(Pair *pair) MPI_Send(buf_send_pair,n,MPI_DOUBLE,sendproc[iswap],0,world); if (recvnum[iswap]) MPI_Wait(&request,MPI_STATUS_IGNORE); - if (!lmp->kokkos->cuda_aware_flag) { + if (!lmp->kokkos->gpu_aware_flag) { k_buf_recv_pair.modify(); k_buf_recv_pair.sync(); } @@ -529,19 +530,18 @@ struct BuildExchangeListFunctor { typename AT::tdual_int_scalar nsend, typename AT::tdual_int_1d sendflag,int nlocal, int dim, X_FLOAT lo, X_FLOAT hi): + _lo(lo),_hi(hi), _x(x.template view()), - _sendlist(sendlist.template view()), - _nsend(nsend.template view()), - _sendflag(sendflag.template view()), _nlocal(nlocal),_dim(dim), - _lo(lo),_hi(hi){ - } + _nsend(nsend.template view()), + _sendlist(sendlist.template view()), + _sendflag(sendflag.template view()) { } KOKKOS_INLINE_FUNCTION void operator() (int i) const { if (_x(i,_dim) < _lo || _x(i,_dim) >= _hi) { const int mysend=Kokkos::atomic_fetch_add(&_nsend(),1); - if(mysend<_sendlist.extent(0)) { + if(mysend < (int)_sendlist.extent(0)) { _sendlist(mysend) = i; _sendflag(i) = 1; } @@ -568,7 +568,7 @@ void CommKokkos::exchange_device() // map_set() is done at end of borders() // clear ghost count and any ghost bonus data internal to AtomVec - if (map_style) atom->map_clear(); + if (map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); @@ -599,10 +599,10 @@ void CommKokkos::exchange_device() i = nsend = 0; if (true) { - if (k_sendflag.h_view.extent(0)(); k_count.h_view() = k_exchange_sendlist.h_view.extent(0); - while (k_count.h_view()>=k_exchange_sendlist.h_view.extent(0)) { + while (k_count.h_view() >= (int)k_exchange_sendlist.h_view.extent(0)) { k_count.h_view() = 0; k_count.modify(); k_count.sync(); @@ -616,7 +616,7 @@ void CommKokkos::exchange_device() k_count.modify(); k_count.sync(); - if (k_count.h_view()>=k_exchange_sendlist.h_view.extent(0)) { + if (k_count.h_view() >= (int)k_exchange_sendlist.h_view.extent(0)) { k_exchange_lists.resize(2,k_count.h_view()*1.1); k_exchange_sendlist = Kokkos::subview(k_exchange_lists,0,Kokkos::ALL); k_exchange_copylist = Kokkos::subview(k_exchange_lists,1,Kokkos::ALL); @@ -782,11 +782,10 @@ struct BuildBorderListFunctor { int _nlast, int _dim, X_FLOAT _lo, X_FLOAT _hi, int _iswap, int _maxsendlist): - x(_x.template view()), + lo(_lo),hi(_hi),x(_x.template view()),iswap(_iswap), + maxsendlist(_maxsendlist),nfirst(_nfirst),nlast(_nlast),dim(_dim), sendlist(_sendlist.template view()), - nsend(_nsend.template view()), - nfirst(_nfirst),nlast(_nlast),dim(_dim), - lo(_lo),hi(_hi),iswap(_iswap),maxsendlist(_maxsendlist){} + nsend(_nsend.template view()) {} KOKKOS_INLINE_FUNCTION @@ -823,7 +822,7 @@ void CommKokkos::borders_device() { double lo,hi; int *type; double **x; - double *buf,*mlo,*mhi; + double *mlo,*mhi; MPI_Request request; AtomVecKokkos *avec = (AtomVecKokkos *) atom->avec; @@ -992,10 +991,8 @@ void CommKokkos::borders_device() { if (n) MPI_Send(k_buf_send.view().data(),n, MPI_DOUBLE,sendproc[iswap],0,world); if (nrecv) MPI_Wait(&request,MPI_STATUS_IGNORE); - buf = buf_recv; } else { nrecv = nsend; - buf = buf_send; } // unpack buffer @@ -1046,7 +1043,7 @@ void CommKokkos::borders_device() { // reset global->local map atomKK->modified(exec_space,ALL_MASK); - if (map_style) { + if (map_style != Atom::MAP_NONE) { atomKK->sync(Host,TAG_MASK); atom->map_set(); } @@ -1058,7 +1055,7 @@ void CommKokkos::borders_device() { void CommKokkos::copy_swap_info() { - if (nswap > k_swap.extent(1)) { + if (nswap > (int)k_swap.extent(1)) { k_swap = DAT::tdual_int_2d("comm:swap",2,nswap); k_firstrecv = Kokkos::subview(k_swap,0,Kokkos::ALL); k_sendnum_scan = Kokkos::subview(k_swap,1,Kokkos::ALL); @@ -1076,7 +1073,7 @@ void CommKokkos::copy_swap_info() k_sendlist.sync(); - if (totalsend > k_pbc.extent(0)) { + if (totalsend > (int)k_pbc.extent(0)) { k_pbc = DAT::tdual_int_2d("comm:pbc",totalsend,6); k_swap2 = DAT::tdual_int_2d("comm:swap2",2,totalsend); k_pbc_flag = Kokkos::subview(k_swap2,0,Kokkos::ALL); @@ -1174,7 +1171,7 @@ void CommKokkos::grow_send_kokkos(int n, int flag, ExecutionSpace space) free/malloc the size of the recv buffer as needed with BUFFACTOR ------------------------------------------------------------------------- */ -void CommKokkos::grow_recv_kokkos(int n, ExecutionSpace space) +void CommKokkos::grow_recv_kokkos(int n, ExecutionSpace /*space*/) { maxrecv = static_cast (BUFFACTOR * n); int maxrecv_border = (maxrecv+BUFEXTRA+5)/atom->avec->size_border + 2; @@ -1187,7 +1184,7 @@ void CommKokkos::grow_recv_kokkos(int n, ExecutionSpace space) realloc the size of the iswap sendlist as needed with BUFFACTOR ------------------------------------------------------------------------- */ -void CommKokkos::grow_list(int iswap, int n) +void CommKokkos::grow_list(int /*iswap*/, int n) { int size = static_cast (BUFFACTOR * n); diff --git a/src/KOKKOS/comm_tiled_kokkos.cpp b/src/KOKKOS/comm_tiled_kokkos.cpp index a29d9f63b3..88d3d1ac8c 100644 --- a/src/KOKKOS/comm_tiled_kokkos.cpp +++ b/src/KOKKOS/comm_tiled_kokkos.cpp @@ -12,22 +12,10 @@ ------------------------------------------------------------------------- */ #include "comm_tiled_kokkos.h" -#include -#include "comm_brick.h" + #include "atom_kokkos.h" -#include "atom_vec.h" -#include "domain.h" -#include "force.h" -#include "pair.h" -#include "neighbor.h" -#include "modify.h" -#include "fix.h" -#include "compute.h" -#include "output.h" -#include "dump.h" -#include "memory_kokkos.h" -#include "error.h" #include "atom_masks.h" +#include "atom_vec.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/compute_coord_atom_kokkos.cpp b/src/KOKKOS/compute_coord_atom_kokkos.cpp index 90bd151b2d..c1f9324942 100644 --- a/src/KOKKOS/compute_coord_atom_kokkos.cpp +++ b/src/KOKKOS/compute_coord_atom_kokkos.cpp @@ -12,22 +12,18 @@ ------------------------------------------------------------------------- */ #include "compute_coord_atom_kokkos.h" -#include -#include -#include "compute_orientorder_atom_kokkos.h" + #include "atom_kokkos.h" -#include "update.h" +#include "atom_masks.h" +#include "comm.h" +#include "compute_orientorder_atom_kokkos.h" +#include "error.h" +#include "memory_kokkos.h" #include "modify.h" -#include "neighbor_kokkos.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" -#include "pair.h" -#include "comm.h" -#include "group.h" -#include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neighbor_kokkos.h" +#include "update.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp index cda8f72250..6e35dfd94f 100644 --- a/src/KOKKOS/compute_orientorder_atom_kokkos.cpp +++ b/src/KOKKOS/compute_orientorder_atom_kokkos.cpp @@ -16,23 +16,19 @@ ------------------------------------------------------------------------- */ #include "compute_orientorder_atom_kokkos.h" -#include -#include -#include + #include "atom_kokkos.h" -#include "update.h" -#include "modify.h" -#include "neighbor_kokkos.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" -#include "pair.h" -#include "comm.h" -#include "memory_kokkos.h" -#include "error.h" -#include "math_const.h" #include "atom_masks.h" #include "kokkos.h" +#include "math_const.h" +#include "memory_kokkos.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor_kokkos.h" +#include "pair.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -435,10 +431,8 @@ void ComputeOrientOrderAtomKokkos::select3(int k, int n, int ii) con template KOKKOS_INLINE_FUNCTION -void ComputeOrientOrderAtomKokkos::calc_boop1(int ncount, int ii, int ineigh) const +void ComputeOrientOrderAtomKokkos::calc_boop1(int /*ncount*/, int ii, int ineigh) const { - const int i = d_ilist[ii + chunk_offset]; - const double r0 = d_rlist(ii,ineigh,0); const double r1 = d_rlist(ii,ineigh,1); const double r2 = d_rlist(ii,ineigh,2); diff --git a/src/KOKKOS/compute_temp_kokkos.cpp b/src/KOKKOS/compute_temp_kokkos.cpp index 0e7fe25540..5e60d62be1 100644 --- a/src/KOKKOS/compute_temp_kokkos.cpp +++ b/src/KOKKOS/compute_temp_kokkos.cpp @@ -12,16 +12,15 @@ ------------------------------------------------------------------------- */ #include "compute_temp_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "update.h" -#include "force.h" -#include "domain.h" -#include "comm.h" -#include "group.h" -#include "error.h" #include "atom_masks.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/dihedral_charmm_kokkos.cpp b/src/KOKKOS/dihedral_charmm_kokkos.cpp index 0d8256f306..88b5e1344d 100644 --- a/src/KOKKOS/dihedral_charmm_kokkos.cpp +++ b/src/KOKKOS/dihedral_charmm_kokkos.cpp @@ -16,19 +16,18 @@ ------------------------------------------------------------------------- */ #include "dihedral_charmm_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "comm.h" -#include "neighbor_kokkos.h" -#include "domain.h" +#include "atom_masks.h" +#include "error.h" #include "force.h" -#include "pair.h" +#include "kokkos.h" #include "math_const.h" #include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" -#include "kokkos.h" +#include "neighbor_kokkos.h" +#include "pair.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/KOKKOS/dihedral_class2_kokkos.cpp b/src/KOKKOS/dihedral_class2_kokkos.cpp index 371af44e9a..156a13c2ec 100644 --- a/src/KOKKOS/dihedral_class2_kokkos.cpp +++ b/src/KOKKOS/dihedral_class2_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "dihedral_class2_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "comm.h" -#include "neighbor_kokkos.h" -#include "domain.h" -#include "force.h" -#include "update.h" -#include "memory_kokkos.h" -#include "error.h" #include "atom_masks.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory_kokkos.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/dihedral_harmonic_kokkos.cpp b/src/KOKKOS/dihedral_harmonic_kokkos.cpp index 408fa276e4..d4855b10c1 100644 --- a/src/KOKKOS/dihedral_harmonic_kokkos.cpp +++ b/src/KOKKOS/dihedral_harmonic_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "dihedral_harmonic_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "comm.h" -#include "neighbor_kokkos.h" -#include "domain.h" -#include "force.h" -#include "update.h" -#include "memory_kokkos.h" -#include "error.h" #include "atom_masks.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory_kokkos.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/dihedral_opls_kokkos.cpp b/src/KOKKOS/dihedral_opls_kokkos.cpp index 309d617f0a..42874936f9 100644 --- a/src/KOKKOS/dihedral_opls_kokkos.cpp +++ b/src/KOKKOS/dihedral_opls_kokkos.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "dihedral_opls_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "comm.h" -#include "neighbor_kokkos.h" -#include "domain.h" -#include "force.h" -#include "update.h" -#include "memory_kokkos.h" -#include "error.h" #include "atom_masks.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory_kokkos.h" +#include "neighbor_kokkos.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/domain_kokkos.h b/src/KOKKOS/domain_kokkos.h index eccc36a021..3bfdeb708b 100644 --- a/src/KOKKOS/domain_kokkos.h +++ b/src/KOKKOS/domain_kokkos.h @@ -14,7 +14,7 @@ #ifndef LMP_DOMAIN_KOKKOS_H #define LMP_DOMAIN_KOKKOS_H -#include "domain.h" +#include "domain.h" // IWYU pragma: export #include "kokkos_type.h" #include "kokkos_few.h" diff --git a/src/KOKKOS/fft3d_kokkos.cpp b/src/KOKKOS/fft3d_kokkos.cpp index e49d780040..d7f556cf87 100644 --- a/src/KOKKOS/fft3d_kokkos.cpp +++ b/src/KOKKOS/fft3d_kokkos.cpp @@ -14,16 +14,13 @@ /* ---------------------------------------------------------------------- Contributing authors: Stan Moore (SNL), Sam Mish (U.C. Davis) ------------------------------------------------------------------------- */ - -#include -#include -#include -#include #include "fft3d_kokkos.h" -#include "remap_kokkos.h" + #include "error.h" #include "kokkos.h" +#include "remap_kokkos.h" +#include using namespace LAMMPS_NS; @@ -72,7 +69,7 @@ FFT3dKokkos::FFT3dKokkos(LAMMPS *lmp, MPI_Comm comm, int nfast, int in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, scaled,permute,nbuf,usecollective,nthreads,usecuda_aware); - if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d FFT plan"); } /* ---------------------------------------------------------------------- */ @@ -406,7 +403,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan = new struct fft_plan_3d_kokkos; remapKK = new RemapKokkos(lmp); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; // remap from initial distribution to layout needed for 1st set of 1d FFTs // not needed if all procs own entire fast axis initially @@ -425,7 +422,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl first_jhi = in_jhi; first_klo = in_klo; first_khi = in_khi; - plan->pre_plan = NULL; + plan->pre_plan = nullptr; } else { first_ilo = 0; @@ -439,7 +436,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl first_ilo,first_ihi,first_jlo,first_jhi, first_klo,first_khi,2,0,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->pre_plan == NULL) return NULL; + if (plan->pre_plan == nullptr) return nullptr; } // 1d FFTs along fast axis @@ -464,7 +461,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl second_ilo,second_ihi,second_jlo,second_jhi, second_klo,second_khi,2,1,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->mid1_plan == NULL) return NULL; + if (plan->mid1_plan == nullptr) return nullptr; // 1d FFTs along mid axis @@ -505,7 +502,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl third_jlo,third_jhi,third_klo,third_khi, third_ilo,third_ihi,2,1,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->mid2_plan == NULL) return NULL; + if (plan->mid2_plan == nullptr) return nullptr; // 1d FFTs along slow axis @@ -524,7 +521,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl MPI_Allreduce(&flag,&remapflag,1,MPI_INT,MPI_MAX,comm); if (remapflag == 0) - plan->post_plan = NULL; + plan->post_plan = nullptr; else { plan->post_plan = remapKK->remap_3d_create_plan_kokkos(comm, @@ -533,7 +530,7 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl out_klo,out_khi,out_ilo,out_ihi, out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION, usecollective,usecuda_aware); - if (plan->post_plan == NULL) return NULL; + if (plan->post_plan == nullptr) return nullptr; } // configure plan memory pointers and allocate work space @@ -651,39 +648,39 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan->plan_fast_forward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_fast_backward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_mid_forward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_mid_backward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_slow_forward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_slow_backward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_BACKWARD,FFTW_ESTIMATE); #elif defined(FFT_CUFFT) @@ -707,16 +704,16 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl kissfftKK = new KissFFTKokkos(); - plan->cfg_fast_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,0,NULL,NULL); - plan->cfg_fast_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,1,NULL,NULL); + plan->cfg_fast_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,0,nullptr,nullptr); + plan->cfg_fast_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nfast,1,nullptr,nullptr); if (nmid == nfast) { plan->cfg_mid_forward = plan->cfg_fast_forward; plan->cfg_mid_backward = plan->cfg_fast_backward; } else { - plan->cfg_mid_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,0,NULL,NULL); - plan->cfg_mid_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,1,NULL,NULL); + plan->cfg_mid_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,0,nullptr,nullptr); + plan->cfg_mid_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nmid,1,nullptr,nullptr); } if (nslow == nfast) { @@ -728,8 +725,8 @@ struct fft_plan_3d_kokkos* FFT3dKokkos::fft_3d_create_pl plan->cfg_slow_backward = plan->cfg_mid_backward; } else { - plan->cfg_slow_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,0,NULL,NULL); - plan->cfg_slow_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,1,NULL,NULL); + plan->cfg_slow_forward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,0,nullptr,nullptr); + plan->cfg_slow_backward = KissFFTKokkos::kiss_fft_alloc_kokkos(nslow,1,nullptr,nullptr); } #endif diff --git a/src/KOKKOS/fix_deform_kokkos.cpp b/src/KOKKOS/fix_deform_kokkos.cpp index 05eb1c22f6..87d860b5ae 100644 --- a/src/KOKKOS/fix_deform_kokkos.cpp +++ b/src/KOKKOS/fix_deform_kokkos.cpp @@ -16,23 +16,22 @@ ------------------------------------------------------------------------- */ #include "fix_deform_kokkos.h" -#include -#include -#include + #include "atom_kokkos.h" -#include "update.h" -#include "comm.h" -#include "irregular.h" -#include "domain_kokkos.h" -#include "lattice.h" -#include "force.h" -#include "modify.h" -#include "math_const.h" -#include "kspace.h" -#include "input.h" -#include "variable.h" -#include "error.h" #include "atom_masks.h" +#include "domain_kokkos.h" +#include "error.h" +#include "force.h" +#include "input.h" +#include "irregular.h" +#include "kspace.h" +#include "math_const.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_dpd_energy_kokkos.h b/src/KOKKOS/fix_dpd_energy_kokkos.h index ebf3a796fe..32066c1195 100644 --- a/src/KOKKOS/fix_dpd_energy_kokkos.h +++ b/src/KOKKOS/fix_dpd_energy_kokkos.h @@ -27,7 +27,7 @@ FixStyle(dpd/energy/kk/host,FixDPDenergyKokkos) namespace LAMMPS_NS { -template +template class FixDPDenergyKokkos : public FixDPDenergy { public: FixDPDenergyKokkos(class LAMMPS *, int, char **); diff --git a/src/KOKKOS/fix_enforce2d_kokkos.cpp b/src/KOKKOS/fix_enforce2d_kokkos.cpp index cc8314a00f..62892d5b3d 100644 --- a/src/KOKKOS/fix_enforce2d_kokkos.cpp +++ b/src/KOKKOS/fix_enforce2d_kokkos.cpp @@ -49,7 +49,7 @@ void FixEnforce2DKokkos::setup(int vflag) template -void FixEnforce2DKokkos::post_force(int vflag) +void FixEnforce2DKokkos::post_force(int /*vflag*/) { atomKK->sync(execution_space,datamask_read); diff --git a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp index 21ee54df28..616351129a 100644 --- a/src/KOKKOS/fix_eos_table_rx_kokkos.cpp +++ b/src/KOKKOS/fix_eos_table_rx_kokkos.cpp @@ -98,7 +98,7 @@ FixEOStableRXKokkos::~FixEOStableRXKokkos() /* ---------------------------------------------------------------------- */ template -void FixEOStableRXKokkos::setup(int vflag) +void FixEOStableRXKokkos::setup(int /*vflag*/) { if (update_table) create_kokkos_tables(); @@ -411,7 +411,7 @@ void FixEOStableRXKokkos::temperature_lookup(int id, double ui, doub /* ---------------------------------------------------------------------- */ template -int FixEOStableRXKokkos::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) +int FixEOStableRXKokkos::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { int ii,jj,m; HAT::t_efloat_1d h_uChem = atomKK->k_uChem.h_view; diff --git a/src/KOKKOS/fix_freeze_kokkos.cpp b/src/KOKKOS/fix_freeze_kokkos.cpp index 70f3d3236d..726850f807 100644 --- a/src/KOKKOS/fix_freeze_kokkos.cpp +++ b/src/KOKKOS/fix_freeze_kokkos.cpp @@ -58,7 +58,7 @@ void FixFreezeKokkos::setup(int vflag) /* ---------------------------------------------------------------------- */ template -void FixFreezeKokkos::post_force(int vflag) +void FixFreezeKokkos::post_force(int /*vflag*/) { atomKK->sync(execution_space,datamask_read); atomKK->modified(execution_space,datamask_modify); @@ -84,7 +84,7 @@ void FixFreezeKokkos::post_force(int vflag) /* ---------------------------------------------------------------------- */ template -void FixFreezeKokkos::post_force_respa(int vflag, int ilevel, int iloop) +void FixFreezeKokkos::post_force_respa(int vflag, int /*ilevel*/, int /*iloop*/) { post_force(vflag); } diff --git a/src/KOKKOS/fix_gravity_kokkos.cpp b/src/KOKKOS/fix_gravity_kokkos.cpp index 4f8b57365e..7d413a1d57 100644 --- a/src/KOKKOS/fix_gravity_kokkos.cpp +++ b/src/KOKKOS/fix_gravity_kokkos.cpp @@ -12,13 +12,14 @@ ------------------------------------------------------------------------- */ #include "fix_gravity_kokkos.h" -#include "atom_masks.h" -#include "modify.h" -#include "input.h" -#include "variable.h" -#include "update.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "atom_vec.h" +#include "input.h" +#include "modify.h" +#include "update.h" +#include "variable.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/fix_langevin_kokkos.cpp b/src/KOKKOS/fix_langevin_kokkos.cpp index a8cc072ffc..0e3d8c360a 100644 --- a/src/KOKKOS/fix_langevin_kokkos.cpp +++ b/src/KOKKOS/fix_langevin_kokkos.cpp @@ -12,21 +12,22 @@ ------------------------------------------------------------------------- */ #include "fix_langevin_kokkos.h" -#include -#include "atom_masks.h" + #include "atom_kokkos.h" +#include "atom_masks.h" +#include "comm.h" +#include "compute.h" +#include "error.h" #include "force.h" #include "group.h" -#include "update.h" -#include "error.h" -#include "memory_kokkos.h" -#include "compute.h" -#include "comm.h" -#include "modify.h" #include "input.h" -#include "region.h" +#include "memory_kokkos.h" +#include "modify.h" +#include "update.h" #include "variable.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; @@ -62,7 +63,7 @@ FixLangevinKokkos::FixLangevinKokkos(LAMMPS *lmp, int narg, char **a if(gjfflag){ grow_arrays(atomKK->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize franprev to zero for (int i = 0; i < atomKK->nlocal; i++) { franprev[i][0] = 0.0; @@ -168,7 +169,7 @@ void FixLangevinKokkos::initial_integrate_item(int i) const /* ---------------------------------------------------------------------- */ template -void FixLangevinKokkos::post_force(int vflag) +void FixLangevinKokkos::post_force(int /*vflag*/) { // sync the device views which might have been modified on host atomKK->sync(execution_space,datamask_read); @@ -734,7 +735,7 @@ void FixLangevinKokkos::reset_dt() template double FixLangevinKokkos::compute_scalar() { - if (!tallyflag || flangevin == NULL) return 0.0; + if (!tallyflag || flangevin == nullptr) return 0.0; v = atomKK->k_v.template view(); mask = atomKK->k_mask.template view(); @@ -873,7 +874,7 @@ void FixLangevinKokkos::end_of_step_rmass_item(int i) const ------------------------------------------------------------------------- */ template -void FixLangevinKokkos::copy_arrays(int i, int j, int delflag) +void FixLangevinKokkos::copy_arrays(int i, int j, int /*delflag*/) { h_franprev(j,0) = h_franprev(i,0); h_franprev(j,1) = h_franprev(i,1); @@ -892,19 +893,19 @@ void FixLangevinKokkos::copy_arrays(int i, int j, int delflag) template void FixLangevinKokkos::cleanup_copy() { - random = NULL; - tstr = NULL; - gfactor1 = NULL; - gfactor2 = NULL; - ratio = NULL; - id_temp = NULL; - flangevin = NULL; - tforce = NULL; + random = nullptr; + tstr = nullptr; + gfactor1 = nullptr; + gfactor2 = nullptr; + ratio = nullptr; + id_temp = nullptr; + flangevin = nullptr; + tforce = nullptr; gjfflag = 0; - franprev = NULL; - lv = NULL; - id = style = NULL; - vatom = NULL; + franprev = nullptr; + lv = nullptr; + id = style = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/fix_langevin_kokkos.h b/src/KOKKOS/fix_langevin_kokkos.h index a6d467dfd7..034e4eaa8f 100644 --- a/src/KOKKOS/fix_langevin_kokkos.h +++ b/src/KOKKOS/fix_langevin_kokkos.h @@ -54,22 +54,22 @@ namespace LAMMPS_NS { typedef s_FSUM FSUM; template - class FixLangevinKokkos; + class FixLangevinKokkos; template - class FixLangevinKokkosInitialIntegrateFunctor; + struct FixLangevinKokkosInitialIntegrateFunctor; template - class FixLangevinKokkosPostForceFunctor; + struct FixLangevinKokkosPostForceFunctor; - template class FixLangevinKokkosZeroForceFunctor; + template struct FixLangevinKokkosZeroForceFunctor; - template class FixLangevinKokkosTallyEnergyFunctor; + template struct FixLangevinKokkosTallyEnergyFunctor; template - class FixLangevinKokkos : public FixLangevin { - public: + class FixLangevinKokkos : public FixLangevin { + public: FixLangevinKokkos(class LAMMPS *, int, char **); ~FixLangevinKokkos(); @@ -169,7 +169,6 @@ namespace LAMMPS_NS { template struct FixLangevinKokkosPostForceFunctor { - typedef DeviceType device_type; typedef FSUM value_type; FixLangevinKokkos c; diff --git a/src/KOKKOS/fix_minimize_kokkos.cpp b/src/KOKKOS/fix_minimize_kokkos.cpp index e7b10dbb8e..f123a663d2 100644 --- a/src/KOKKOS/fix_minimize_kokkos.cpp +++ b/src/KOKKOS/fix_minimize_kokkos.cpp @@ -12,10 +12,11 @@ ------------------------------------------------------------------------- */ #include "fix_minimize_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "domain.h" #include "memory_kokkos.h" -#include "atom_masks.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -33,7 +34,7 @@ FixMinimizeKokkos::FixMinimizeKokkos(LAMMPS *lmp, int narg, char **arg) : FixMinimizeKokkos::~FixMinimizeKokkos() { memoryKK->destroy_kokkos(k_vectors,vectors); - vectors = NULL; + vectors = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/fix_momentum_kokkos.cpp b/src/KOKKOS/fix_momentum_kokkos.cpp index 9c9d6cb1cd..be486bf752 100644 --- a/src/KOKKOS/fix_momentum_kokkos.cpp +++ b/src/KOKKOS/fix_momentum_kokkos.cpp @@ -12,17 +12,16 @@ ------------------------------------------------------------------------- */ #include "fix_momentum_kokkos.h" -#include -#include + #include "atom_kokkos.h" #include "atom_masks.h" -#include "domain.h" #include "domain_kokkos.h" #include "group.h" #include "error.h" -#include "force.h" #include "kokkos_few.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_neigh_history_kokkos.cpp b/src/KOKKOS/fix_neigh_history_kokkos.cpp index 848940c4b7..56a37c8d1b 100644 --- a/src/KOKKOS/fix_neigh_history_kokkos.cpp +++ b/src/KOKKOS/fix_neigh_history_kokkos.cpp @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #include "fix_neigh_history_kokkos.h" + #include "atom_kokkos.h" #include "error.h" #include "memory_kokkos.h" +#include "modify.h" #include "neigh_list_kokkos.h" #include "pair_kokkos.h" -#include "comm.h" -#include "modify.h" using namespace LAMMPS_NS; @@ -35,9 +35,9 @@ FixNeighHistoryKokkos::FixNeighHistoryKokkos(LAMMPS *lmp, int narg, memory->destroy(npartner); memory->sfree(partner); memory->sfree(valuepartner); - npartner = NULL; - partner = NULL; - valuepartner = NULL; + npartner = nullptr; + partner = nullptr; + valuepartner = nullptr; maxpartner = 8; grow_arrays(atom->nmax); @@ -284,7 +284,7 @@ void FixNeighHistoryKokkos::grow_arrays(int nmax) ------------------------------------------------------------------------- */ template -void FixNeighHistoryKokkos::copy_arrays(int i, int j, int delflag) +void FixNeighHistoryKokkos::copy_arrays(int i, int j, int /*delflag*/) { k_npartner.template sync(); k_partner.template sync(); diff --git a/src/KOKKOS/fix_nh_kokkos.cpp b/src/KOKKOS/fix_nh_kokkos.cpp index 46993994b1..a2985502bb 100644 --- a/src/KOKKOS/fix_nh_kokkos.cpp +++ b/src/KOKKOS/fix_nh_kokkos.cpp @@ -16,27 +16,24 @@ ------------------------------------------------------------------------- */ #include "fix_nh_kokkos.h" -#include -#include -#include -#include "math_extra.h" + #include "atom.h" -#include "force.h" -#include "group.h" -#include "comm.h" -#include "neighbor.h" -#include "irregular.h" -#include "modify.h" -#include "fix_deform.h" -#include "compute.h" -#include "kspace.h" -#include "update.h" -#include "respa.h" -#include "domain_kokkos.h" -#include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" #include "atom_kokkos.h" +#include "atom_masks.h" +#include "comm.h" +#include "compute.h" +#include "domain_kokkos.h" +#include "error.h" +#include "fix_deform.h" +#include "force.h" +#include "irregular.h" +#include "kspace.h" +#include "memory_kokkos.h" +#include "neighbor.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -88,7 +85,7 @@ void FixNHKokkos::init() ------------------------------------------------------------------------- */ template -void FixNHKokkos::setup(int vflag) +void FixNHKokkos::setup(int /*vflag*/) { // t_target is needed by NPH and NPT in compute_scalar() // If no thermostat or using fix nphug, @@ -179,7 +176,7 @@ void FixNHKokkos::setup(int vflag) ------------------------------------------------------------------------- */ template -void FixNHKokkos::initial_integrate(int vflag) +void FixNHKokkos::initial_integrate(int /*vflag*/) { // update eta_press_dot diff --git a/src/KOKKOS/fix_nph_kokkos.cpp b/src/KOKKOS/fix_nph_kokkos.cpp index d667e29221..7efcb150bd 100644 --- a/src/KOKKOS/fix_nph_kokkos.cpp +++ b/src/KOKKOS/fix_nph_kokkos.cpp @@ -12,10 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_nph_kokkos.h" -#include + #include "modify.h" #include "error.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_npt_kokkos.cpp b/src/KOKKOS/fix_npt_kokkos.cpp index 47b3da4efe..5b73eee4d7 100644 --- a/src/KOKKOS/fix_npt_kokkos.cpp +++ b/src/KOKKOS/fix_npt_kokkos.cpp @@ -12,10 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_npt_kokkos.h" -#include + #include "modify.h" #include "error.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_nve_kokkos.cpp b/src/KOKKOS/fix_nve_kokkos.cpp index 3198557ee7..fe6aeaccff 100644 --- a/src/KOKKOS/fix_nve_kokkos.cpp +++ b/src/KOKKOS/fix_nve_kokkos.cpp @@ -12,14 +12,11 @@ ------------------------------------------------------------------------- */ #include "fix_nve_kokkos.h" -#include -#include -#include "atom_masks.h" + #include "atom_kokkos.h" -#include "force.h" -#include "update.h" -#include "respa.h" -#include "error.h" +#include "atom_masks.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -54,7 +51,7 @@ void FixNVEKokkos::init() ------------------------------------------------------------------------- */ template -void FixNVEKokkos::initial_integrate(int vflag) +void FixNVEKokkos::initial_integrate(int /*vflag*/) { atomKK->sync(execution_space,datamask_read); atomKK->modified(execution_space,datamask_modify); @@ -166,8 +163,8 @@ void FixNVEKokkos::final_integrate_rmass_item(int i) const template void FixNVEKokkos::cleanup_copy() { - id = style = NULL; - vatom = NULL; + id = style = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/fix_nve_kokkos.h b/src/KOKKOS/fix_nve_kokkos.h index e2230d86b6..e5a551914b 100644 --- a/src/KOKKOS/fix_nve_kokkos.h +++ b/src/KOKKOS/fix_nve_kokkos.h @@ -31,9 +31,10 @@ template class FixNVEKokkos; template -class FixNVEKokkosInitialIntegrateFunctor; +struct FixNVEKokkosInitialIntegrateFunctor; + template -class FixNVEKokkosFinalIntegrateFunctor; +struct FixNVEKokkosFinalIntegrateFunctor; template class FixNVEKokkos : public FixNVE { diff --git a/src/KOKKOS/fix_nve_sphere_kokkos.cpp b/src/KOKKOS/fix_nve_sphere_kokkos.cpp index 13d9fef69c..f292f30d3f 100644 --- a/src/KOKKOS/fix_nve_sphere_kokkos.cpp +++ b/src/KOKKOS/fix_nve_sphere_kokkos.cpp @@ -39,8 +39,8 @@ FixNVESphereKokkos::FixNVESphereKokkos(LAMMPS *lmp, int narg, char * template void FixNVESphereKokkos::cleanup_copy() { - id = style = NULL; - vatom = NULL; + id = style = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,7 +58,7 @@ void FixNVESphereKokkos::init() /* ---------------------------------------------------------------------- */ template -void FixNVESphereKokkos::initial_integrate(int vflag) +void FixNVESphereKokkos::initial_integrate(int /*vflag*/) { atomKK->sync(execution_space,datamask_read); atomKK->modified(execution_space,datamask_modify); diff --git a/src/KOKKOS/fix_nvt_kokkos.cpp b/src/KOKKOS/fix_nvt_kokkos.cpp index 013095abc0..6e69582617 100644 --- a/src/KOKKOS/fix_nvt_kokkos.cpp +++ b/src/KOKKOS/fix_nvt_kokkos.cpp @@ -12,10 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_nvt_kokkos.h" -#include + +#include "error.h" #include "group.h" #include "modify.h" -#include "error.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_property_atom_kokkos.cpp b/src/KOKKOS/fix_property_atom_kokkos.cpp index ff374b885f..185e7445b2 100644 --- a/src/KOKKOS/fix_property_atom_kokkos.cpp +++ b/src/KOKKOS/fix_property_atom_kokkos.cpp @@ -12,14 +12,13 @@ ------------------------------------------------------------------------- */ #include "fix_property_atom_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "comm.h" -#include "memory_kokkos.h" -#include "error.h" -#include "update.h" #include "atom_masks.h" +#include "error.h" +#include "memory_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.cpp b/src/KOKKOS/fix_qeq_reax_kokkos.cpp index 7e798c740b..0f4ab850ae 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.cpp +++ b/src/KOKKOS/fix_qeq_reax_kokkos.cpp @@ -17,21 +17,21 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_reax_kokkos.h" -#include -#include "kokkos.h" + #include "atom.h" -#include "atom_masks.h" #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "neighbor.h" +#include "kokkos.h" +#include "memory_kokkos.h" #include "neigh_list_kokkos.h" #include "neigh_request.h" +#include "neighbor.h" #include "update.h" -#include "integrate.h" -#include "memory_kokkos.h" -#include "error.h" -#include "pair_reaxc_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -53,7 +53,7 @@ FixQEqReaxKokkos(LAMMPS *lmp, int narg, char **arg) : datamask_read = X_MASK | V_MASK | F_MASK | MASK_MASK | Q_MASK | TYPE_MASK | TAG_MASK; datamask_modify = Q_MASK | X_MASK; - nmax = nmax = m_cap = 0; + nmax = m_cap = 0; allocated_flag = 0; nprev = 4; @@ -112,7 +112,7 @@ void FixQEqReaxKokkos::init() ("FixQEqReax::params",ntypes+1); params = k_params.template view(); - for (n = 1; n <= ntypes; n++) { + for (int n = 1; n <= ntypes; n++) { k_params.h_view(n).chi = chi[n]; k_params.h_view(n).eta = eta[n]; k_params.h_view(n).gamma = gamma[n]; @@ -183,7 +183,7 @@ void FixQEqReaxKokkos::setup_pre_force(int vflag) /* ---------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::pre_force(int vflag) +void FixQEqReaxKokkos::pre_force(int /*vflag*/) { if (update->ntimestep % nevery) return; @@ -351,34 +351,35 @@ void FixQEqReaxKokkos::allocate_array() if (atom->nmax > nmax) { nmax = atom->nmax; - k_o = DAT::tdual_ffloat_1d("qeq/kk:h_o",nmax); + k_o = DAT::tdual_ffloat_1d("qeq/kk:o",nmax); d_o = k_o.template view(); h_o = k_o.h_view; - d_Hdia_inv = typename AT::t_ffloat_1d("qeq/kk:h_Hdia_inv",nmax); + d_Hdia_inv = typename AT::t_ffloat_1d("qeq/kk:Hdia_inv",nmax); - d_b_s = typename AT::t_ffloat_1d("qeq/kk:h_b_s",nmax); + d_b_s = typename AT::t_ffloat_1d("qeq/kk:b_s",nmax); - d_b_t = typename AT::t_ffloat_1d("qeq/kk:h_b_t",nmax); + d_b_t = typename AT::t_ffloat_1d("qeq/kk:b_t",nmax); - k_s = DAT::tdual_ffloat_1d("qeq/kk:h_s",nmax); + k_s = DAT::tdual_ffloat_1d("qeq/kk:s",nmax); d_s = k_s.template view(); h_s = k_s.h_view; - k_t = DAT::tdual_ffloat_1d("qeq/kk:h_t",nmax); + k_t = DAT::tdual_ffloat_1d("qeq/kk:t",nmax); d_t = k_t.template view(); h_t = k_t.h_view; - d_p = typename AT::t_ffloat_1d("qeq/kk:h_p",nmax); + d_p = typename AT::t_ffloat_1d("qeq/kk:p",nmax); - d_r = typename AT::t_ffloat_1d("qeq/kk:h_r",nmax); + d_r = typename AT::t_ffloat_1d("qeq/kk:r",nmax); - k_d = DAT::tdual_ffloat_1d("qeq/kk:h_d",nmax); + k_d = DAT::tdual_ffloat_1d("qeq/kk:d",nmax); d_d = k_d.template view(); h_d = k_d.h_view; } // init_storage + FixQEqReaxKokkosZeroFunctor zero_functor(this); Kokkos::parallel_for(ignum,zero_functor); @@ -779,8 +780,7 @@ void FixQEqReaxKokkos::cg_solve1() F_FLOAT sig_new = dot_sqr; int loop; - const int loopmax = 200; - for (loop = 1; loop < loopmax & sqrt(sig_new)/b_norm > tolerance; loop++) { + for (loop = 1; (loop < imax) && (sqrt(sig_new)/b_norm > tolerance); loop++) { // comm->forward_comm_fix(this); //Dist_vector( d ); pack_flag = 1; @@ -848,7 +848,7 @@ void FixQEqReaxKokkos::cg_solve1() Kokkos::parallel_for(inum,vecsum2_functor); } - if (loop >= loopmax && comm->me == 0) { + if (loop >= imax && comm->me == 0) { char str[128]; sprintf(str,"Fix qeq/reax cg_solve1 convergence failed after %d iterations " "at " BIGINT_FORMAT " step: %f",loop,update->ntimestep,sqrt(sig_new)/b_norm); @@ -918,8 +918,7 @@ void FixQEqReaxKokkos::cg_solve2() F_FLOAT sig_new = dot_sqr; int loop; - const int loopmax = 200; - for (loop = 1; loop < loopmax & sqrt(sig_new)/b_norm > tolerance; loop++) { + for (loop = 1; (loop < imax) && (sqrt(sig_new)/b_norm > tolerance); loop++) { // comm->forward_comm_fix(this); //Dist_vector( d ); pack_flag = 1; @@ -987,7 +986,7 @@ void FixQEqReaxKokkos::cg_solve2() Kokkos::parallel_for(inum,vecsum2_functor); } - if (loop >= loopmax && comm->me == 0) { + if (loop >= imax && comm->me == 0) { char str[128]; sprintf(str,"Fix qeq/reax cg_solve2 convergence failed after %d iterations " "at " BIGINT_FORMAT " step: %f",loop,update->ntimestep,sqrt(sig_new)/b_norm); @@ -1057,8 +1056,8 @@ KOKKOS_INLINE_FUNCTION void FixQEqReaxKokkos::sparse13_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); - auto a_o = v_o.template access::value>(); + auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); + auto a_o = v_o.template access::value>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1110,8 +1109,8 @@ KOKKOS_INLINE_FUNCTION void FixQEqReaxKokkos::sparse23_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); - auto a_o = v_o.template access::value>(); + auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); + auto a_o = v_o.template access::value>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1170,8 +1169,8 @@ KOKKOS_INLINE_FUNCTION void FixQEqReaxKokkos::sparse33_item(int ii) const { // The q array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); - auto a_o = v_o.template access::value>(); + auto v_o = ScatterViewHelper::value,decltype(dup_o),decltype(ndup_o)>::get(dup_o,ndup_o); + auto a_o = v_o.template access::value>(); const int i = d_ilist[ii]; if (mask[i] & groupbit) { @@ -1364,7 +1363,7 @@ void FixQEqReaxKokkos::calculate_q_item(int ii) const template int FixQEqReaxKokkos::pack_forward_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int /*pbc_flag*/, int * /*pbc*/) { int m; @@ -1424,7 +1423,7 @@ void FixQEqReaxKokkos::unpack_reverse_comm(int n, int *list, double template void FixQEqReaxKokkos::cleanup_copy() { - id = style = NULL; + id = style = nullptr; } /* ---------------------------------------------------------------------- @@ -1473,7 +1472,7 @@ void FixQEqReaxKokkos::grow_arrays(int nmax) ------------------------------------------------------------------------- */ template -void FixQEqReaxKokkos::copy_arrays(int i, int j, int delflag) +void FixQEqReaxKokkos::copy_arrays(int i, int j, int /*delflag*/) { k_s_hist.template sync(); k_t_hist.template sync(); diff --git a/src/KOKKOS/fix_qeq_reax_kokkos.h b/src/KOKKOS/fix_qeq_reax_kokkos.h index 80c1ccecc5..bed532905e 100644 --- a/src/KOKKOS/fix_qeq_reax_kokkos.h +++ b/src/KOKKOS/fix_qeq_reax_kokkos.h @@ -140,7 +140,7 @@ class FixQEqReaxKokkos : public FixQEqReax { KOKKOS_INLINE_FUNCTION params_qeq(){chi=0;eta=0;gamma=0;}; KOKKOS_INLINE_FUNCTION - params_qeq(int i){chi=0;eta=0;gamma=0;}; + params_qeq(int /*i*/){chi=0;eta=0;gamma=0;}; F_FLOAT chi, eta, gamma; }; @@ -267,8 +267,7 @@ struct FixQEqReaxKokkosComputeHFunctor { FixQEqReaxKokkosComputeHFunctor(FixQEqReaxKokkos *c_ptr, int _atoms_per_team, int _vector_length) - : c(*c_ptr), atoms_per_team(_atoms_per_team), - vector_length(_vector_length) { + : atoms_per_team(_atoms_per_team), vector_length(_vector_length), c(*c_ptr) { c.cleanup_copy(); }; @@ -283,7 +282,7 @@ struct FixQEqReaxKokkosComputeHFunctor { c.template compute_h_team(team, atoms_per_team, vector_length); } - size_t team_shmem_size(int team_size) const { + size_t team_shmem_size(int /*team_size*/) const { size_t shmem_size = Kokkos::View::shmem_size( atoms_per_team) + // s_ilist diff --git a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp index 51702bc603..faa5a98315 100644 --- a/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_bonds_kokkos.cpp @@ -16,14 +16,13 @@ ------------------------------------------------------------------------- */ #include "fix_reaxc_bonds_kokkos.h" + #include "atom.h" -#include "pair_reaxc_kokkos.h" -#include "force.h" -#include "compute.h" -#include "memory_kokkos.h" -#include "error.h" -#include "reaxc_defs.h" #include "atom_masks.h" +#include "error.h" +#include "force.h" +#include "memory_kokkos.h" +#include "pair_reaxc_kokkos.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -52,7 +51,7 @@ FixReaxCBondsKokkos::~FixReaxCBondsKokkos() void FixReaxCBondsKokkos::init() { Pair *pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " "pair_style reax/c/kk"); FixReaxCBonds::init(); @@ -60,7 +59,7 @@ void FixReaxCBondsKokkos::init() /* ---------------------------------------------------------------------- */ -void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp) +void FixReaxCBondsKokkos::Output_ReaxC_Bonds(bigint /*ntimestep*/, FILE * /*fp*/) { int nbuf_local; diff --git a/src/KOKKOS/fix_reaxc_species_kokkos.cpp b/src/KOKKOS/fix_reaxc_species_kokkos.cpp index f3bce2f9c0..4674389ed4 100644 --- a/src/KOKKOS/fix_reaxc_species_kokkos.cpp +++ b/src/KOKKOS/fix_reaxc_species_kokkos.cpp @@ -58,7 +58,7 @@ FixReaxCSpeciesKokkos::~FixReaxCSpeciesKokkos() void FixReaxCSpeciesKokkos::init() { Pair* pair_kk = force->pair_match("reax/c/kk",0); - if (pair_kk == NULL) error->all(FLERR,"Cannot use fix reax/c/species/kk without " + if (pair_kk == nullptr) error->all(FLERR,"Cannot use fix reax/c/species/kk without " "pair_style reax/c/kk"); FixReaxCSpecies::init(); diff --git a/src/KOKKOS/fix_rx_kokkos.cpp b/src/KOKKOS/fix_rx_kokkos.cpp index a760309218..1ba227d539 100644 --- a/src/KOKKOS/fix_rx_kokkos.cpp +++ b/src/KOKKOS/fix_rx_kokkos.cpp @@ -27,7 +27,7 @@ #include "comm.h" #include "domain.h" #include "kokkos.h" -#include "utils.h" + #include // DBL_EPSILON @@ -62,7 +62,7 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; template FixRxKokkos::FixRxKokkos(LAMMPS *lmp, int narg, char **arg) : FixRX(lmp, narg, arg), - pairDPDEKK(NULL), + pairDPDEKK(nullptr), update_kinetics_data(true) { kokkosable = 1; @@ -117,14 +117,14 @@ void FixRxKokkos::init() //FixRX::init(); pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); pairDPDEKK = dynamic_cast(pairDPDE); - if (pairDPDEKK == NULL) + if (pairDPDEKK == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy/kk with fix rx/kk"); bool eos_flag = false; @@ -387,10 +387,9 @@ void FixRxKokkos::k_rkf45_step (const int neq, const double h, Vecto template template KOKKOS_INLINE_FUNCTION -int FixRxKokkos::k_rkf45_h0 - (const int neq, const double t, const double t_stop, - const double hmin, const double hmax, - double& h0, VectorType& y, VectorType& rwk, UserDataType& userData) const +int FixRxKokkos::k_rkf45_h0 (const int neq, const double t, const double /*t_stop*/, + const double hmin, const double hmax, + double& h0, VectorType& y, VectorType& rwk, UserDataType& userData) const { // Set lower and upper bounds on h0, and take geometric mean as first trial value. // Exit with this value if the bounds cross each other. @@ -707,10 +706,9 @@ void FixRxKokkos::rkf45_step (const int neq, const double h, double } template -int FixRxKokkos::rkf45_h0 - (const int neq, const double t, const double t_stop, - const double hmin, const double hmax, - double& h0, double y[], double rwk[], void* v_params) const +int FixRxKokkos::rkf45_h0(const int neq, const double t, const double /*t_stop*/, + const double hmin, const double hmax, + double& h0, double y[], double rwk[], void* v_params) const { // Set lower and upper bounds on h0, and take geometric mean as first trial value. // Exit with this value if the bounds cross each other. @@ -920,7 +918,7 @@ int FixRxKokkos::rhs(double t, const double *y, double *dydt, void * /* ---------------------------------------------------------------------- */ template -int FixRxKokkos::rhs_dense(double t, const double *y, double *dydt, void *params) const +int FixRxKokkos::rhs_dense(double /*t*/, const double *y, double *dydt, void *params) const { UserRHSData *userData = (UserRHSData *) params; @@ -959,14 +957,14 @@ int FixRxKokkos::rhs_dense(double t, const double *y, double *dydt, /* ---------------------------------------------------------------------- */ template -int FixRxKokkos::rhs_sparse(double t, const double *y, double *dydt, void *v_params) const +int FixRxKokkos::rhs_sparse(double /*t*/, const double *y, double *dydt, void *v_params) const { UserRHSData *userData = (UserRHSData *) v_params; //const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; #define kFor (userData->kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData->rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) @@ -1068,7 +1066,7 @@ int FixRxKokkos::k_rhs(double t, const VectorType& y, VectorType& dy template template KOKKOS_INLINE_FUNCTION -int FixRxKokkos::k_rhs_dense(double t, const VectorType& y, VectorType& dydt, UserDataType& userData) const +int FixRxKokkos::k_rhs_dense(double /*t*/, const VectorType& y, VectorType& dydt, UserDataType& userData) const { #define rxnRateLaw (userData.rxnRateLaw) #define kFor (userData.kFor ) @@ -1110,10 +1108,10 @@ int FixRxKokkos::k_rhs_dense(double t, const VectorType& y, VectorTy template template KOKKOS_INLINE_FUNCTION -int FixRxKokkos::k_rhs_sparse(double t, const VectorType& y, VectorType& dydt, UserDataType& userData) const +int FixRxKokkos::k_rhs_sparse(double /*t*/, const VectorType& y, VectorType& dydt, UserDataType& userData) const { #define kFor (userData.kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData.rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) @@ -1430,7 +1428,7 @@ void FixRxKokkos::operator()(Tag_FixRxKokkos_solveSystems -void FixRxKokkos::solve_reactions(const int vflag, const bool isPreForce) +void FixRxKokkos::solve_reactions(const int /*vflag*/, const bool isPreForce) { //printf("Inside FixRxKokkos::solve_reactions localTempFlag= %d isPreForce= %s\n", localTempFlag, isPreForce ? "True" : "false"); @@ -1439,7 +1437,7 @@ void FixRxKokkos::solve_reactions(const int vflag, const bool isPreF if (update_kinetics_data) create_kinetics_data(); - TimerType timer_start = getTimeStamp(); + //TimerType timer_start = getTimeStamp(); //const int nlocal = atom->nlocal; this->nlocal = atom->nlocal; @@ -1462,30 +1460,33 @@ void FixRxKokkos::solve_reactions(const int vflag, const bool isPreF const int neighflag = lmp->kokkos->neighflag; -#define _template_switch(_wtflag, _localTempFlag) { \ - if (neighflag == HALF) \ - if (newton_pair) \ - computeLocalTemperature<_wtflag, _localTempFlag, true , HALF> (); \ - else \ - computeLocalTemperature<_wtflag, _localTempFlag, false, HALF> (); \ - else if (neighflag == HALFTHREAD) \ - if (newton_pair) \ - computeLocalTemperature<_wtflag, _localTempFlag, true , HALFTHREAD> (); \ - else \ - computeLocalTemperature<_wtflag, _localTempFlag, false, HALFTHREAD> (); \ - else if (neighflag == FULL) \ - if (newton_pair) \ - computeLocalTemperature<_wtflag, _localTempFlag, true , FULL> (); \ - else \ - computeLocalTemperature<_wtflag, _localTempFlag, false, FULL> (); \ +#define _template_switch(_wtflag, _localTempFlag) { \ + if (neighflag == HALF) { \ + if (newton_pair) { \ + computeLocalTemperature<_wtflag, _localTempFlag, true , HALF> (); \ + } else { \ + computeLocalTemperature<_wtflag, _localTempFlag, false, HALF> (); \ + } \ + } else if (neighflag == HALFTHREAD) { \ + if (newton_pair) { \ + computeLocalTemperature<_wtflag, _localTempFlag, true , HALFTHREAD> (); \ + } else { \ + computeLocalTemperature<_wtflag, _localTempFlag, false, HALFTHREAD> (); \ + } \ + } else if (neighflag == FULL) { \ + if (newton_pair) { \ + computeLocalTemperature<_wtflag, _localTempFlag, true , FULL> (); \ + } else { \ + computeLocalTemperature<_wtflag, _localTempFlag, false, FULL> (); \ + } \ + } \ } // Are there is no other options than wtFlag = (0)LUCY and localTempFlag = NONE : HARMONIC? if (localTempFlag == HARMONIC) { - _template_switch(LUCY, HARMONIC) - } - else { - _template_switch(LUCY, NONE) + _template_switch(LUCY, HARMONIC) + } else { + _template_switch(LUCY, NONE) } #undef _template_switch } @@ -1674,7 +1675,7 @@ void FixRxKokkos::solve_reactions(const int vflag, const bool isPreF atomKK->modified ( Host, DVECTOR_MASK ); - TimerType timer_stop = getTimeStamp(); + //TimerType timer_stop = getTimeStamp(); double time_ODE = getElapsedTime(timer_localTemperature, timer_ODE); @@ -2032,7 +2033,7 @@ void FixRxKokkos::computeLocalTemperature() const int ntypes = atom->ntypes; //memoryKK->create_kokkos (k_cutsq, h_cutsq, ntypes+1, ntypes+1, "pair:cutsq"); - if (ntypes+1 > k_cutsq.extent(0)) { + if (ntypes+1 > (int) k_cutsq.extent(0)) { memoryKK->destroy_kokkos (k_cutsq); memoryKK->create_kokkos (k_cutsq, ntypes+1, ntypes+1, "FixRxKokkos::k_cutsq"); d_cutsq = k_cutsq.template view(); @@ -2053,7 +2054,7 @@ void FixRxKokkos::computeLocalTemperature() int sumWeightsCt = nlocal + (NEWTON_PAIR ? nghost : 0); //memoryKK->create_kokkos (k_sumWeights, sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights"); - if (sumWeightsCt > k_sumWeights.template view().extent(0)) { + if (sumWeightsCt > (int)k_sumWeights.template view().extent(0)) { memoryKK->destroy_kokkos(k_sumWeights, sumWeights); memoryKK->create_kokkos (k_sumWeights, sumWeightsCt, "FixRxKokkos::sumWeights"); d_sumWeights = k_sumWeights.template view(); @@ -2196,7 +2197,7 @@ void FixRxKokkos::computeLocalTemperature() /* ---------------------------------------------------------------------- */ template -int FixRxKokkos::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) +int FixRxKokkos::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { //printf("inside FixRxKokkos::pack_forward_comm %d\n", comm->me); diff --git a/src/KOKKOS/fix_rx_kokkos.h b/src/KOKKOS/fix_rx_kokkos.h index 92b715f34d..0033e69649 100644 --- a/src/KOKKOS/fix_rx_kokkos.h +++ b/src/KOKKOS/fix_rx_kokkos.h @@ -71,7 +71,7 @@ struct s_CounterType }; typedef struct s_CounterType CounterType; -template +template class FixRxKokkos : public FixRX { public: typedef ArrayTypes AT; @@ -121,7 +121,7 @@ class FixRxKokkos : public FixRX { value_type *m_data; KOKKOS_INLINE_FUNCTION - StridedArrayType() : m_data(NULL) {} + StridedArrayType() : m_data(nullptr) {} KOKKOS_INLINE_FUNCTION StridedArrayType(value_type *ptr) : m_data(ptr) {} diff --git a/src/KOKKOS/fix_setforce_kokkos.cpp b/src/KOKKOS/fix_setforce_kokkos.cpp index da516f5ba2..00d717c915 100644 --- a/src/KOKKOS/fix_setforce_kokkos.cpp +++ b/src/KOKKOS/fix_setforce_kokkos.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_setforce_kokkos.h" -#include + #include "atom_kokkos.h" #include "update.h" #include "modify.h" @@ -24,7 +24,8 @@ #include "error.h" #include "atom_masks.h" #include "kokkos_base.h" -#include "region.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -56,7 +57,7 @@ FixSetForceKokkos::~FixSetForceKokkos() if (copymode) return; memoryKK->destroy_kokkos(k_sforce,sforce); - sforce = NULL; + sforce = nullptr; } /* ---------------------------------------------------------------------- */ @@ -85,7 +86,7 @@ void FixSetForceKokkos::post_force(int /*vflag*/) // update region if necessary - region = NULL; + region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/KOKKOS/fix_shardlow_kokkos.cpp b/src/KOKKOS/fix_shardlow_kokkos.cpp index c44294b2ff..1779ebc855 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.cpp +++ b/src/KOKKOS/fix_shardlow_kokkos.cpp @@ -35,7 +35,7 @@ #include "fix_shardlow_kokkos.h" #include -#include + #include "atom.h" #include "atom_masks.h" #include "atom_kokkos.h" @@ -63,7 +63,7 @@ using namespace random_external_state; template FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **arg) : - FixShardlow(lmp, narg, arg), k_pairDPDE(NULL), ghostmax(0), nlocal(0) , nghost(0) + FixShardlow(lmp, narg, arg), k_pairDPDE(nullptr), ghostmax(0), nlocal(0) , nghost(0) { kokkosable = 1; atomKK = (AtomKokkos *) atom; @@ -74,8 +74,8 @@ FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **a if (narg != 3) error->all(FLERR,"Illegal fix shardlow command"); -// k_pairDPD = NULL; - k_pairDPDE = NULL; +// k_pairDPD = nullptr; + k_pairDPDE = nullptr; // k_pairDPD = (PairDPDfdtKokkos *) force->pair_match("dpd/fdt",1); k_pairDPDE = dynamic_cast *>(force->pair_match("dpd/fdt/energy",0)); @@ -88,7 +88,7 @@ FixShardlowKokkos::FixShardlowKokkos(LAMMPS *lmp, int narg, char **a // } - if(/* k_pairDPD == NULL &&*/ k_pairDPDE == NULL) + if(/* k_pairDPD == nullptr &&*/ k_pairDPDE == nullptr) error->all(FLERR,"Must use pair_style "/*"dpd/fdt/kk or "*/"dpd/fdt/energy/kk with fix shardlow/kk"); #ifdef DEBUG_SSA_PAIR_CT @@ -562,7 +562,7 @@ void FixShardlowKokkos::ssa_update_dpde( template -void FixShardlowKokkos::initial_integrate(int vflag) +void FixShardlowKokkos::initial_integrate(int /*vflag*/) { d_numneigh = k_list->d_numneigh; d_neighbors = k_list->d_neighbors; @@ -716,7 +716,7 @@ void FixShardlowKokkos::operator()(TagFixShardlowSSAUpdateDPDEGhost< /* ---------------------------------------------------------------------- */ template -int FixShardlowKokkos::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) +int FixShardlowKokkos::pack_forward_comm(int n, int *list, double *buf, int /*pbc_flag*/, int * /*pbc*/) { int ii,jj,m; diff --git a/src/KOKKOS/fix_shardlow_kokkos.h b/src/KOKKOS/fix_shardlow_kokkos.h index 0469f6033d..d5541ac5b7 100644 --- a/src/KOKKOS/fix_shardlow_kokkos.h +++ b/src/KOKKOS/fix_shardlow_kokkos.h @@ -64,7 +64,7 @@ class FixShardlowKokkos : public FixShardlow { KOKKOS_INLINE_FUNCTION params_ssa(){cutinv=FLT_MAX;halfsigma=0;kappa=0;alpha=0;}; KOKKOS_INLINE_FUNCTION - params_ssa(int i){cutinv=FLT_MAX;halfsigma=0;kappa=0;alpha=0;}; + params_ssa(int /*i*/){cutinv=FLT_MAX;halfsigma=0;kappa=0;alpha=0;}; F_FLOAT cutinv,halfsigma,kappa,alpha; }; diff --git a/src/KOKKOS/fix_wall_lj93_kokkos.h b/src/KOKKOS/fix_wall_lj93_kokkos.h index 64f3c59a62..15a853d820 100644 --- a/src/KOKKOS/fix_wall_lj93_kokkos.h +++ b/src/KOKKOS/fix_wall_lj93_kokkos.h @@ -60,8 +60,7 @@ struct FixWallLJ93KokkosFunctor { FixWallLJ93Kokkos c; FixWallLJ93KokkosFunctor(FixWallLJ93Kokkos* c_ptr): - c(*c_ptr), - value_count(c_ptr->m+1) {} + value_count(c_ptr->m+1), c(*c_ptr) {} KOKKOS_INLINE_FUNCTION void operator()(const int i, value_type ewall) const { c.wall_particle_item(i,ewall); diff --git a/src/KOKKOS/fix_wall_reflect_kokkos.cpp b/src/KOKKOS/fix_wall_reflect_kokkos.cpp index a5bd6e6e6c..046c97c12b 100644 --- a/src/KOKKOS/fix_wall_reflect_kokkos.cpp +++ b/src/KOKKOS/fix_wall_reflect_kokkos.cpp @@ -12,20 +12,15 @@ ------------------------------------------------------------------------- */ #include "fix_wall_reflect_kokkos.h" -#include -#include -#include "atom_kokkos.h" -#include "comm.h" -#include "update.h" -#include "modify.h" -#include "domain.h" -#include "lattice.h" -#include "input.h" -#include "variable.h" -#include "error.h" -#include "force.h" -#include "atom_masks.h" +#include "atom_kokkos.h" +#include "atom_masks.h" +#include "input.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/KOKKOS/gridcomm_kokkos.cpp b/src/KOKKOS/gridcomm_kokkos.cpp index 024428366e..dfca97c13e 100644 --- a/src/KOKKOS/gridcomm_kokkos.cpp +++ b/src/KOKKOS/gridcomm_kokkos.cpp @@ -12,114 +12,75 @@ ------------------------------------------------------------------------- */ #include "gridcomm_kokkos.h" -#include + #include "comm.h" +#include "irregular.h" +#include "kokkos.h" +#include "kokkos_base_fft.h" #include "kspace.h" #include "memory_kokkos.h" -#include "error.h" -#include "kokkos_base_fft.h" -#include "kokkos.h" using namespace LAMMPS_NS; -#define SWAPDELTA 8 +enum{REGULAR,TILED}; -/* ---------------------------------------------------------------------- */ +#define DELTA 16 + +/* ---------------------------------------------------------------------- + NOTES + tiled implementation only currently works for RCB, not general tiled + b/c RCB tree is used to find neighboring tiles + if o indices for ghosts are < 0 or hi indices are >= N, + then grid is treated as periodic in that dimension, + communication is done across the periodic boundaries +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + constructor called by all classes except MSM + gcomm = world communicator + gn xyz = size of global grid + i xyz lohi = portion of global grid this proc owns, 0 <= index < N + o xyz lohi = owned grid portion + ghost grid cells needed in all directions + if o indices are < 0 or hi indices are >= N, + then grid is treated as periodic in that dimension, + communication is done across the periodic boundaries +------------------------------------------------------------------------- */ template -GridCommKokkos::GridCommKokkos(LAMMPS *lmp, MPI_Comm gcomm, int forward, int reverse, +GridCommKokkos::GridCommKokkos(LAMMPS *lmp, MPI_Comm gcomm, + int gnx, int gny, int gnz, int ixlo, int ixhi, int iylo, int iyhi, int izlo, int izhi, - int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi, - int pxlo, int pxhi, int pylo, int pyhi, int pzlo, int pzhi) - : Pointers(lmp) + int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi) + : GridComm(lmp, gcomm, + gnx, gny, gnz, + ixlo,ixhi, iylo, iyhi, izlo, izhi, + oxlo, oxhi, oylo, oyhi, ozlo, ozhi) { - gridcomm = gcomm; - MPI_Comm_rank(gridcomm,&me); - - nforward = forward; - nreverse = reverse; - - inxlo = ixlo; - inxhi = ixhi; - inylo = iylo; - inyhi = iyhi; - inzlo = izlo; - inzhi = izhi; - - outxlo = oxlo; - outxhi = oxhi; - outylo = oylo; - outyhi = oyhi; - outzlo = ozlo; - outzhi = ozhi; - - outxlo_max = oxlo; - outxhi_max = oxhi; - outylo_max = oylo; - outyhi_max = oyhi; - outzlo_max = ozlo; - outzhi_max = ozhi; - - procxlo = pxlo; - procxhi = pxhi; - procylo = pylo; - procyhi = pyhi; - proczlo = pzlo; - proczhi = pzhi; - - nswap = 0; - swap = NULL; - //buf1 = buf2 = NULL; } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + constructor called by MSM + gcomm = world communicator or sub-communicator for a hierarchical grid + flag = 1 if e xyz lohi values = larger grid stored by caller in gcomm = world + flag = 2 if e xyz lohi values = 6 neighbor procs in gcomm + gn xyz = size of global grid + i xyz lohi = portion of global grid this proc owns, 0 <= index < N + o xyz lohi = owned grid portion + ghost grid cells needed in all directions + e xyz lohi for flag = 1: extent of larger grid stored by caller + e xyz lohi for flag = 2: 6 neighbor procs +------------------------------------------------------------------------- */ template -GridCommKokkos::GridCommKokkos(LAMMPS *lmp, MPI_Comm gcomm, int forward, int reverse, +GridCommKokkos::GridCommKokkos(LAMMPS *lmp, MPI_Comm gcomm, int /*flag*/, + int gnx, int gny, int gnz, int ixlo, int ixhi, int iylo, int iyhi, int izlo, int izhi, int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi, - int oxlo_max, int oxhi_max, int oylo_max, int oyhi_max, - int ozlo_max, int ozhi_max, - int pxlo, int pxhi, int pylo, int pyhi, int pzlo, int pzhi) - : Pointers(lmp) + int /*exlo*/, int /*exhi*/, int /*eylo*/, int /*eyhi*/, int /*ezlo*/, int /*ezhi*/) + : GridComm(lmp, gcomm, + gnx, gny, gnz, + ixlo,ixhi, iylo, iyhi, izlo, izhi, + oxlo, oxhi, oylo, oyhi, ozlo, ozhi) { - gridcomm = gcomm; - MPI_Comm_rank(gridcomm,&me); - - nforward = forward; - nreverse = reverse; - - inxlo = ixlo; - inxhi = ixhi; - inylo = iylo; - inyhi = iyhi; - inzlo = izlo; - inzhi = izhi; - - outxlo = oxlo; - outxhi = oxhi; - outylo = oylo; - outyhi = oyhi; - outzlo = ozlo; - outzhi = ozhi; - - outxlo_max = oxlo_max; - outxhi_max = oxhi_max; - outylo_max = oylo_max; - outyhi_max = oyhi_max; - outzlo_max = ozlo_max; - outzhi_max = ozhi_max; - - procxlo = pxlo; - procxhi = pxhi; - procylo = pylo; - procyhi = pyhi; - proczlo = pzlo; - proczhi = pzhi; - - nswap = 0; - swap = NULL; - //buf1 = buf2 = NULL; } /* ---------------------------------------------------------------------- */ @@ -127,28 +88,49 @@ GridCommKokkos::GridCommKokkos(LAMMPS *lmp, MPI_Comm gcomm, int forw template GridCommKokkos::~GridCommKokkos() { - for (int i = 0; i < nswap; i++) { - //memoryKK->destroy_kokkos(swap[i].k_packlist,swap[i].packlist); - //memoryKK->destroy_kokkos(swap[i].k_unpacklist,swap[i].unpacklist); - } - memory->sfree(swap); + // regular comm data struct + + for (int i = 0; i < nswap; i++) { + swap[i].packlist = nullptr; + swap[i].unpacklist = nullptr; + } + + // tiled comm data structs + + for (int i = 0; i < nsend; i++) + send[i].packlist = nullptr; + + for (int i = 0; i < nrecv; i++) + recv[i].unpacklist = nullptr; + + for (int i = 0; i < ncopy; i++) { + copy[i].packlist = nullptr; + copy[i].unpacklist = nullptr; + } - //memory->destroy(buf1); - //memory->destroy(buf2); } /* ---------------------------------------------------------------------- - notify 6 neighbor procs how many ghost grid planes I need from them - ghostxlo = # of lower grid planes I own that are needed from me - by procxlo to become its upper ghost planes - ghostxhi = # of upper grid planes I own that are needed from me - by procxhi to become its lower ghost planes - if no neighbor proc, value is from self + setup comm for a regular grid of procs + each proc has 6 neighbors + comm pattern = series of swaps with one of those 6 procs + can be multiple swaps with same proc if ghost extent is large + swap may not be symmetric if both procs do not need same layers of ghosts + all procs perform same # of swaps in a direction, even if some don't need it ------------------------------------------------------------------------- */ template -void GridCommKokkos::ghost_notify() +void GridCommKokkos::setup_regular(int &nbuf1, int &nbuf2) { + int nsent,sendfirst,sendlast,recvfirst,recvlast; + int sendplanes,recvplanes; + int notdoneme,notdone; + + // notify 6 neighbor procs how many ghost grid planes I need from them + // ghost xyz lo = # of my lower grid planes that proc xyz lo needs as its ghosts + // ghost xyz hi = # of my upper grid planes that proc xyz hi needs as its ghosts + // if this proc is its own neighbor across periodic bounary, value is from self + int nplanes = inxlo - outxlo; if (procxlo != me) MPI_Sendrecv(&nplanes,1,MPI_INT,procxlo,0, @@ -184,49 +166,11 @@ void GridCommKokkos::ghost_notify() MPI_Sendrecv(&nplanes,1,MPI_INT,proczhi,0, &ghostzlo,1,MPI_INT,proczlo,0,gridcomm,MPI_STATUS_IGNORE); else ghostzlo = nplanes; -} -/* ---------------------------------------------------------------------- - check if all ghost grid comm needs overlap into non nearest-neighbor proc - if yes, return 1, else return 0 -------------------------------------------------------------------------- */ + // setup swaps = exchange of grid data with one of 6 neighobr procs + // can be more than one in a direction if ghost region extends beyond neigh proc + // all procs have same swap count, but swapsize npack/nunpack can be empty -template -int GridCommKokkos::ghost_overlap() -{ - int nearest = 0; - if (ghostxlo > inxhi-inxlo+1) nearest = 1; - if (ghostxhi > inxhi-inxlo+1) nearest = 1; - if (ghostylo > inyhi-inylo+1) nearest = 1; - if (ghostyhi > inyhi-inylo+1) nearest = 1; - if (ghostzlo > inzhi-inzlo+1) nearest = 1; - if (ghostzhi > inzhi-inzlo+1) nearest = 1; - - int nearest_all; - MPI_Allreduce(&nearest,&nearest_all,1,MPI_INT,MPI_MIN,gridcomm); - - return nearest_all; -} - -/* ---------------------------------------------------------------------- - create swap stencil for grid own/ghost communication - swaps covers all 3 dimensions and both directions - swaps cover multiple iterations in a direction if need grid pts - from further away than nearest-neighbor proc - same swap list used by forward and reverse communication -------------------------------------------------------------------------- */ - -template -void GridCommKokkos::setup() -{ - int nsent,sendfirst,sendlast,recvfirst,recvlast; - int sendplanes,recvplanes; - int notdoneme,notdone; - - int maxswap = 6; - swap = (Swap *) memory->smalloc(maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist = DAT::tdual_int_2d("Commgrid:packlist",maxswap,1); - k_unpacklist = DAT::tdual_int_2d("Commgrid:unpacklist",maxswap,1); nswap = 0; // send own grid pts to -x processor, recv ghost grid pts from +x processor @@ -238,19 +182,13 @@ void GridCommKokkos::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += SWAPDELTA; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist.resize(maxswap,k_packlist.extent(1)); - k_unpacklist.resize(maxswap,k_unpacklist.extent(1)); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procxlo; swap[nswap].recvproc = procxhi; sendplanes = MIN(sendlast-sendfirst+1,ghostxlo-nsent); swap[nswap].npack = - indices(k_packlist,nswap, + indices(k_swap_packlist,nswap, sendfirst,sendfirst+sendplanes-1,inylo,inyhi,inzlo,inzhi); if (procxlo != me) @@ -259,7 +197,7 @@ void GridCommKokkos::setup() else recvplanes = sendplanes; swap[nswap].nunpack = - indices(k_unpacklist,nswap, + indices(k_swap_unpacklist,nswap, recvfirst,recvfirst+recvplanes-1,inylo,inyhi,inzlo,inzhi); nsent += sendplanes; @@ -282,19 +220,13 @@ void GridCommKokkos::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += 1; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist.resize(maxswap,k_packlist.extent(1)); - k_unpacklist.resize(maxswap,k_unpacklist.extent(1)); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procxhi; swap[nswap].recvproc = procxlo; sendplanes = MIN(sendlast-sendfirst+1,ghostxhi-nsent); swap[nswap].npack = - indices(k_packlist,nswap, + indices(k_swap_packlist,nswap, sendlast-sendplanes+1,sendlast,inylo,inyhi,inzlo,inzhi); if (procxhi != me) @@ -303,7 +235,7 @@ void GridCommKokkos::setup() else recvplanes = sendplanes; swap[nswap].nunpack = - indices(k_unpacklist,nswap, + indices(k_swap_unpacklist,nswap, recvlast-recvplanes+1,recvlast,inylo,inyhi,inzlo,inzhi); nsent += sendplanes; @@ -326,19 +258,13 @@ void GridCommKokkos::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += SWAPDELTA; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist.resize(maxswap,k_packlist.extent(1)); - k_unpacklist.resize(maxswap,k_unpacklist.extent(1)); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procylo; swap[nswap].recvproc = procyhi; sendplanes = MIN(sendlast-sendfirst+1,ghostylo-nsent); swap[nswap].npack = - indices(k_packlist,nswap, + indices(k_swap_packlist,nswap, outxlo,outxhi,sendfirst,sendfirst+sendplanes-1,inzlo,inzhi); if (procylo != me) @@ -347,7 +273,7 @@ void GridCommKokkos::setup() else recvplanes = sendplanes; swap[nswap].nunpack = - indices(k_unpacklist,nswap, + indices(k_swap_unpacklist,nswap, outxlo,outxhi,recvfirst,recvfirst+recvplanes-1,inzlo,inzhi); nsent += sendplanes; @@ -370,19 +296,13 @@ void GridCommKokkos::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += 1; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist.resize(maxswap,k_packlist.extent(1)); - k_unpacklist.resize(maxswap,k_unpacklist.extent(1)); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procyhi; swap[nswap].recvproc = procylo; sendplanes = MIN(sendlast-sendfirst+1,ghostyhi-nsent); swap[nswap].npack = - indices(k_packlist,nswap, + indices(k_swap_packlist,nswap, outxlo,outxhi,sendlast-sendplanes+1,sendlast,inzlo,inzhi); if (procyhi != me) @@ -391,7 +311,7 @@ void GridCommKokkos::setup() else recvplanes = sendplanes; swap[nswap].nunpack = - indices(k_unpacklist,nswap, + indices(k_swap_unpacklist,nswap, outxlo,outxhi,recvlast-recvplanes+1,recvlast,inzlo,inzhi); nsent += sendplanes; @@ -414,19 +334,13 @@ void GridCommKokkos::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += SWAPDELTA; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist.resize(maxswap,k_packlist.extent(1)); - k_unpacklist.resize(maxswap,k_unpacklist.extent(1)); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = proczlo; swap[nswap].recvproc = proczhi; sendplanes = MIN(sendlast-sendfirst+1,ghostzlo-nsent); swap[nswap].npack = - indices(k_packlist,nswap, + indices(k_swap_packlist,nswap, outxlo,outxhi,outylo,outyhi,sendfirst,sendfirst+sendplanes-1); if (proczlo != me) @@ -435,7 +349,7 @@ void GridCommKokkos::setup() else recvplanes = sendplanes; swap[nswap].nunpack = - indices(k_unpacklist,nswap, + indices(k_swap_unpacklist,nswap, outxlo,outxhi,outylo,outyhi,recvfirst,recvfirst+recvplanes-1); nsent += sendplanes; @@ -458,19 +372,13 @@ void GridCommKokkos::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += 1; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - k_packlist.resize(maxswap,k_packlist.extent(1)); - k_unpacklist.resize(maxswap,k_unpacklist.extent(1)); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = proczhi; swap[nswap].recvproc = proczlo; sendplanes = MIN(sendlast-sendfirst+1,ghostzhi-nsent); swap[nswap].npack = - indices(k_packlist,nswap, + indices(k_swap_packlist,nswap, outxlo,outxhi,outylo,outyhi,sendlast-sendplanes+1,sendlast); if (proczhi != me) @@ -479,7 +387,7 @@ void GridCommKokkos::setup() else recvplanes = sendplanes; swap[nswap].nunpack = - indices(k_unpacklist,nswap, + indices(k_swap_unpacklist,nswap, outxlo,outxhi,outylo,outyhi,recvlast-recvplanes+1,recvlast); nsent += sendplanes; @@ -493,123 +401,556 @@ void GridCommKokkos::setup() MPI_Allreduce(¬doneme,¬done,1,MPI_INT,MPI_SUM,gridcomm); } - // nbuf = max of any forward/reverse pack/unpack + // ngrid = max of any forward/reverse pack/unpack grid points - nbuf = 0; + int ngrid = 0; for (int i = 0; i < nswap; i++) { - nbuf = MAX(nbuf,swap[i].npack); - nbuf = MAX(nbuf,swap[i].nunpack); + ngrid = MAX(ngrid,swap[i].npack); + ngrid = MAX(ngrid,swap[i].nunpack); } - nbuf *= MAX(nforward,nreverse); - //memory->create(buf1,nbuf,"Commgrid:buf1"); - k_buf1 = FFT_DAT::tdual_FFT_SCALAR_1d("Commgrid:buf1",nbuf); - //memory->create(buf2,nbuf,"Commgrid:buf2"); - k_buf2 = FFT_DAT::tdual_FFT_SCALAR_1d("Commgrid:buf2",nbuf); + + nbuf1 = nbuf2 = ngrid; } /* ---------------------------------------------------------------------- - use swap list in forward order to acquire copy of all needed ghost grid pts + setup comm for RCB tiled proc domains + each proc has arbitrary # of neighbors that overlap its ghost extent + identify which procs will send me ghost cells, and vice versa + may not be symmetric if both procs do not need same layers of ghosts + comm pattern = post recvs for all my ghosts, send my owned, wait on recvs + no exchanges by dimension, unlike CommTiled forward/reverse comm of particles ------------------------------------------------------------------------- */ template -void GridCommKokkos::forward_comm(KSpace *kspace, int which) +void GridCommKokkos::setup_tiled(int &nbuf1, int &nbuf2) { - k_packlist.sync(); - k_unpacklist.sync(); + int i,m; + double xlo,xhi,ylo,yhi,zlo,zhi; + int ghostbox[6],pbc[3]; + + // setup RCB tree of cut info for grid + // access CommTiled to get cut dimension + // cut = this proc's inlo in that dim + // dim is -1 for proc 0, but never accessed + + rcbinfo = (RCBinfo *) + memory->smalloc(nprocs*sizeof(RCBinfo),"GridComm:rcbinfo"); + RCBinfo rcbone; + rcbone.dim = comm->rcbcutdim; + if (rcbone.dim <= 0) rcbone.cut = inxlo; + else if (rcbone.dim == 1) rcbone.cut = inylo; + else if (rcbone.dim == 2) rcbone.cut = inzlo; + MPI_Allgather(&rcbone,sizeof(RCBinfo),MPI_CHAR, + rcbinfo,sizeof(RCBinfo),MPI_CHAR,gridcomm); + + // find overlaps of my extended ghost box with all other procs + // accounts for crossings of periodic boundaries + // noverlap = # of overlaps, including self + // overlap = vector of overlap info using Overlap data struct + + ghostbox[0] = outxlo; + ghostbox[1] = outxhi; + ghostbox[2] = outylo; + ghostbox[3] = outyhi; + ghostbox[4] = outzlo; + ghostbox[5] = outzhi; + + pbc[0] = pbc[1] = pbc[2] = 0; + + memory->create(overlap_procs,nprocs,"GridComm:overlap_procs"); + noverlap = maxoverlap = 0; + overlap = nullptr; + + ghost_box_drop(ghostbox,pbc); + + // send each proc an overlap message + // content: me, index of my overlap, box that overlaps with its owned cells + // ncopy = # of overlaps with myself, across a periodic boundary + + int *proclist; + memory->create(proclist,noverlap,"GridComm:proclist"); + srequest = (Request *) + memory->smalloc(noverlap*sizeof(Request),"GridComm:srequest"); + + int nsend_request = 0; + ncopy = 0; + + for (m = 0; m < noverlap; m++) { + if (overlap[m].proc == me) ncopy++; + else { + proclist[nsend_request] = overlap[m].proc; + srequest[nsend_request].sender = me; + srequest[nsend_request].index = m; + for (i = 0; i < 6; i++) + srequest[nsend_request].box[i] = overlap[m].box[i]; + nsend_request++; + } + } + + Irregular *irregular = new Irregular(lmp); + int nrecv_request = irregular->create_data(nsend_request,proclist,1); + Request *rrequest = + (Request *) memory->smalloc(nrecv_request*sizeof(Request),"GridComm:rrequest"); + irregular->exchange_data((char *) srequest,sizeof(Request),(char *) rrequest); + irregular->destroy_data(); + + // compute overlaps between received ghost boxes and my owned box + // overlap box used to setup my Send data struct and respond to requests + + send = (Send *) memory->smalloc(nrecv_request*sizeof(Send),"GridComm:send"); + + k_send_packlist = DAT::tdual_int_2d("GridComm:send_packlist",nrecv_request,k_send_packlist.extent(1)); + + sresponse = (Response *) + memory->smalloc(nrecv_request*sizeof(Response),"GridComm:sresponse"); + memory->destroy(proclist); + memory->create(proclist,nrecv_request,"GridComm:proclist"); + + for (m = 0; m < nrecv_request; m++) { + send[m].proc = rrequest[m].sender; + xlo = MAX(rrequest[m].box[0],inxlo); + xhi = MIN(rrequest[m].box[1],inxhi); + ylo = MAX(rrequest[m].box[2],inylo); + yhi = MIN(rrequest[m].box[3],inyhi); + zlo = MAX(rrequest[m].box[4],inzlo); + zhi = MIN(rrequest[m].box[5],inzhi); + send[m].npack = indices(k_send_packlist,m,xlo,xhi,ylo,yhi,zlo,zhi); + + proclist[m] = rrequest[m].sender; + sresponse[m].index = rrequest[m].index; + sresponse[m].box[0] = xlo; + sresponse[m].box[1] = xhi; + sresponse[m].box[2] = ylo; + sresponse[m].box[3] = yhi; + sresponse[m].box[4] = zlo; + sresponse[m].box[5] = zhi; + } + + nsend = nrecv_request; + + // reply to each Request message with a Response message + // content: index for the overlap on requestor, overlap box on my owned grid + + int nsend_response = nrecv_request; + int nrecv_response = irregular->create_data(nsend_response,proclist,1); + Response *rresponse = + (Response *) memory->smalloc(nrecv_response*sizeof(Response),"GridComm:rresponse"); + irregular->exchange_data((char *) sresponse,sizeof(Response),(char *) rresponse); + irregular->destroy_data(); + delete irregular; + + // process received responses + // box used to setup my Recv data struct after unwrapping via PBC + // adjacent = 0 if any box of ghost cells does not adjoin my owned cells + + recv = (Recv *) memory->smalloc(nrecv_response*sizeof(Recv),"GridComm:recv"); + + k_recv_unpacklist = DAT::tdual_int_2d("GridComm:recv_unpacklist",nrecv_response,k_recv_unpacklist.extent(1)); + + adjacent = 1; + + for (i = 0; i < nrecv_response; i++) { + m = rresponse[i].index; + recv[i].proc = overlap[m].proc; + xlo = rresponse[i].box[0] + overlap[m].pbc[0] * nx; + xhi = rresponse[i].box[1] + overlap[m].pbc[0] * nx; + ylo = rresponse[i].box[2] + overlap[m].pbc[1] * ny; + yhi = rresponse[i].box[3] + overlap[m].pbc[1] * ny; + zlo = rresponse[i].box[4] + overlap[m].pbc[2] * nz; + zhi = rresponse[i].box[5] + overlap[m].pbc[2] * nz; + recv[i].nunpack = indices(k_recv_unpacklist,i,xlo,xhi,ylo,yhi,zlo,zhi); + + if (xlo != inxhi+1 && xhi != inxlo-1 && + ylo != inyhi+1 && yhi != inylo-1 && + zlo != inzhi+1 && zhi != inzlo-1) adjacent = 0; + } + + nrecv = nrecv_response; + + // create Copy data struct from overlaps with self + + copy = (Copy *) memory->smalloc(ncopy*sizeof(Copy),"GridComm:copy"); + + k_copy_packlist = DAT::tdual_int_2d("GridComm:copy_packlist",ncopy,k_copy_packlist.extent(1)); + k_copy_unpacklist = DAT::tdual_int_2d("GridComm:copy_unpacklist",ncopy,k_copy_unpacklist.extent(1)); + + ncopy = 0; + for (m = 0; m < noverlap; m++) { + if (overlap[m].proc != me) continue; + xlo = overlap[m].box[0]; + xhi = overlap[m].box[1]; + ylo = overlap[m].box[2]; + yhi = overlap[m].box[3]; + zlo = overlap[m].box[4]; + zhi = overlap[m].box[5]; + copy[ncopy].npack = indices(k_copy_packlist,ncopy,xlo,xhi,ylo,yhi,zlo,zhi); + xlo = overlap[m].box[0] + overlap[m].pbc[0] * nx; + xhi = overlap[m].box[1] + overlap[m].pbc[0] * nx; + ylo = overlap[m].box[2] + overlap[m].pbc[1] * ny; + yhi = overlap[m].box[3] + overlap[m].pbc[1] * ny; + zlo = overlap[m].box[4] + overlap[m].pbc[2] * nz; + zhi = overlap[m].box[5] + overlap[m].pbc[2] * nz; + copy[ncopy].nunpack = indices(k_copy_unpacklist,ncopy,xlo,xhi,ylo,yhi,zlo,zhi); + ncopy++; + } + + // set offsets for received data + + int offset = 0; + for (m = 0; m < nsend; m++) { + send[m].offset = offset; + offset += send[m].npack; + } + + offset = 0; + for (m = 0; m < nrecv; m++) { + recv[m].offset = offset; + offset += recv[m].nunpack; + } + + // length of MPI requests vector is max of nsend, nrecv + + int nrequest = MAX(nsend,nrecv); + requests = new MPI_Request[nrequest]; + + // clean-up + + memory->sfree(rcbinfo); + memory->destroy(proclist); + memory->destroy(overlap_procs); + memory->sfree(overlap); + memory->sfree(srequest); + memory->sfree(rrequest); + memory->sfree(sresponse); + memory->sfree(rresponse); + + // nbuf1 = largest pack or unpack in any Send or Recv or Copy + // nbuf2 = larget of sum of all packs or unpacks in Send or Recv + + nbuf1 = 0; + + for (m = 0; m < ncopy; m++) { + nbuf1 = MAX(nbuf1,copy[m].npack); + nbuf1 = MAX(nbuf1,copy[m].nunpack); + } + + int nbufs = 0; + for (m = 0; m < nsend; m++) { + nbuf1 = MAX(nbuf1,send[m].npack); + nbufs += send[m].npack; + } + + int nbufr = 0; + for (m = 0; m < nrecv; m++) { + nbuf1 = MAX(nbuf1,recv[m].nunpack); + nbufr += recv[m].nunpack; + } + + nbuf2 = MAX(nbufs,nbufr); +} + +/* ---------------------------------------------------------------------- + forward comm of my owned cells to other's ghost cells +------------------------------------------------------------------------- */ + +template +void GridCommKokkos::forward_comm_kspace(KSpace *kspace, int nper, int which, + FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) +{ + if (layout == REGULAR) + forward_comm_kspace_regular(kspace,nper,which,k_buf1,k_buf2,datatype); + else + forward_comm_kspace_tiled(kspace,nper,which,k_buf1,k_buf2,datatype); +} + +/* ---------------------------------------------------------------------- + forward comm on regular grid of procs via list of swaps with 6 neighbor procs +------------------------------------------------------------------------- */ + +template +void GridCommKokkos:: +forward_comm_kspace_regular(KSpace *kspace, int nper, int which, + FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) +{ + int m; + MPI_Request request; KokkosBaseFFT* kspaceKKBase = dynamic_cast(kspace); + FFT_SCALAR* buf1; + FFT_SCALAR* buf2; + if (lmp->kokkos->gpu_aware_flag) { + buf1 = k_buf1.view().data(); + buf2 = k_buf2.view().data(); + } else { + buf1 = k_buf1.h_view.data(); + buf2 = k_buf2.h_view.data(); + } - for (int m = 0; m < nswap; m++) { + for (m = 0; m < nswap; m++) { if (swap[m].sendproc == me) - kspaceKKBase->pack_forward_kspace_kokkos(which,k_buf2,swap[m].npack,k_packlist,m); + kspaceKKBase->pack_forward_grid_kokkos(which,k_buf2,swap[m].npack,k_swap_packlist,m); else - kspaceKKBase->pack_forward_kspace_kokkos(which,k_buf1,swap[m].npack,k_packlist,m); + kspaceKKBase->pack_forward_grid_kokkos(which,k_buf1,swap[m].npack,k_swap_packlist,m); DeviceType().fence(); if (swap[m].sendproc != me) { - FFT_SCALAR* buf1; - FFT_SCALAR* buf2; - if (lmp->kokkos->cuda_aware_flag) { - buf1 = k_buf1.view().data(); - buf2 = k_buf2.view().data(); - } else { + + if (!lmp->kokkos->gpu_aware_flag) { k_buf1.modify(); k_buf1.sync(); - buf1 = k_buf1.h_view.data(); - buf2 = k_buf2.h_view.data(); } - MPI_Irecv(buf2,nforward*swap[m].nunpack,MPI_FFT_SCALAR, - swap[m].recvproc,0,gridcomm,&request); - MPI_Send(buf1,nforward*swap[m].npack,MPI_FFT_SCALAR, - swap[m].sendproc,0,gridcomm); - MPI_Wait(&request,MPI_STATUS_IGNORE); + if (swap[m].nunpack) MPI_Irecv(buf2,nper*swap[m].nunpack,datatype, + swap[m].recvproc,0,gridcomm,&request); + if (swap[m].npack) MPI_Send(buf1,nper*swap[m].npack,datatype, + swap[m].sendproc,0,gridcomm); + if (swap[m].nunpack) MPI_Wait(&request,MPI_STATUS_IGNORE); - if (!lmp->kokkos->cuda_aware_flag) { + if (!lmp->kokkos->gpu_aware_flag) { k_buf2.modify(); k_buf2.sync(); } } - kspaceKKBase->unpack_forward_kspace_kokkos(which,k_buf2,swap[m].nunpack,k_unpacklist,m); + kspaceKKBase->unpack_forward_grid_kokkos(which,k_buf2,0,swap[m].nunpack,k_swap_unpacklist,m); DeviceType().fence(); } } /* ---------------------------------------------------------------------- - use swap list in reverse order to compute fully summed value - for each owned grid pt that some other proc has copy of as a ghost grid pt + forward comm on tiled grid decomp via Send/Recv lists of each neighbor proc ------------------------------------------------------------------------- */ template -void GridCommKokkos::reverse_comm(KSpace *kspace, int which) +void GridCommKokkos:: +forward_comm_kspace_tiled(KSpace *kspace, int nper, int which, + FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) { - k_packlist.sync(); - k_unpacklist.sync(); + int i,m,offset; KokkosBaseFFT* kspaceKKBase = dynamic_cast(kspace); + FFT_SCALAR* buf1; + FFT_SCALAR* buf2; + if (lmp->kokkos->gpu_aware_flag) { + buf1 = k_buf1.view().data(); + buf2 = k_buf2.view().data(); + } else { + buf1 = k_buf1.h_view.data(); + buf2 = k_buf2.h_view.data(); + } - for (int m = nswap-1; m >= 0; m--) { + // post all receives + + for (m = 0; m < nrecv; m++) { + offset = nper * recv[m].offset; + MPI_Irecv(&buf2[offset],nper*recv[m].nunpack,datatype, + recv[m].proc,0,gridcomm,&requests[m]); + } + + // perform all sends to other procs + + for (m = 0; m < nsend; m++) { + kspaceKKBase->pack_forward_grid_kokkos(which,k_buf1,send[m].npack,k_send_packlist,m); + DeviceType().fence(); + + if (!lmp->kokkos->gpu_aware_flag) { + k_buf1.modify(); + k_buf1.sync(); + } + + MPI_Send(buf1,nper*send[m].npack,datatype,send[m].proc,0,gridcomm); + } + + // perform all copies to self + + for (m = 0; m < ncopy; m++) { + kspaceKKBase->pack_forward_grid_kokkos(which,k_buf1,copy[m].npack,k_copy_packlist,m); + kspaceKKBase->unpack_forward_grid_kokkos(which,k_buf1,0,copy[m].nunpack,k_copy_unpacklist,m); + } + + // unpack all received data + + for (i = 0; i < nrecv; i++) { + MPI_Waitany(nrecv,requests,&m,MPI_STATUS_IGNORE); + + if (!lmp->kokkos->gpu_aware_flag) { + k_buf2.modify(); + k_buf2.sync(); + } + + offset = nper * recv[m].offset; + kspaceKKBase->unpack_forward_grid_kokkos(which,k_buf2,offset, + recv[m].nunpack,k_recv_unpacklist,m); + DeviceType().fence(); + } +} + +/* ---------------------------------------------------------------------- + reverse comm of my ghost cells to sum to owner cells +------------------------------------------------------------------------- */ + +template +void GridCommKokkos::reverse_comm_kspace(KSpace *kspace, int nper, int which, + FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) +{ + if (layout == REGULAR) + reverse_comm_kspace_regular(kspace,nper,which,k_buf1,k_buf2,datatype); + else + reverse_comm_kspace_tiled(kspace,nper,which,k_buf1,k_buf2,datatype); +} + +/* ---------------------------------------------------------------------- + reverse comm on regular grid of procs via list of swaps with 6 neighbor procs +------------------------------------------------------------------------- */ + +template +void GridCommKokkos:: +reverse_comm_kspace_regular(KSpace *kspace, int nper, int which, + FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) +{ + int m; + MPI_Request request; + + KokkosBaseFFT* kspaceKKBase = dynamic_cast(kspace); + FFT_SCALAR* buf1; + FFT_SCALAR* buf2; + if (lmp->kokkos->gpu_aware_flag) { + buf1 = k_buf1.view().data(); + buf2 = k_buf2.view().data(); + } else { + buf1 = k_buf1.h_view.data(); + buf2 = k_buf2.h_view.data(); + } + + for (m = nswap-1; m >= 0; m--) { if (swap[m].recvproc == me) - kspaceKKBase->pack_reverse_kspace_kokkos(which,k_buf2,swap[m].nunpack,k_unpacklist,m); + kspaceKKBase->pack_reverse_grid_kokkos(which,k_buf2,swap[m].nunpack,k_swap_unpacklist,m); else - kspaceKKBase->pack_reverse_kspace_kokkos(which,k_buf1,swap[m].nunpack,k_unpacklist,m); + kspaceKKBase->pack_reverse_grid_kokkos(which,k_buf1,swap[m].nunpack,k_swap_unpacklist,m); DeviceType().fence(); if (swap[m].recvproc != me) { - FFT_SCALAR* buf1; - FFT_SCALAR* buf2; - if (lmp->kokkos->cuda_aware_flag) { - buf1 = k_buf1.view().data(); - buf2 = k_buf2.view().data(); - } else { + + if (!lmp->kokkos->gpu_aware_flag) { k_buf1.modify(); k_buf1.sync(); - buf1 = k_buf1.h_view.data(); - buf2 = k_buf2.h_view.data(); } - MPI_Irecv(buf2,nreverse*swap[m].npack,MPI_FFT_SCALAR, - swap[m].sendproc,0,gridcomm,&request); - MPI_Send(buf1,nreverse*swap[m].nunpack,MPI_FFT_SCALAR, - swap[m].recvproc,0,gridcomm); - MPI_Wait(&request,MPI_STATUS_IGNORE); + if (swap[m].npack) MPI_Irecv(buf2,nper*swap[m].npack,datatype, + swap[m].sendproc,0,gridcomm,&request); + if (swap[m].nunpack) MPI_Send(buf1,nper*swap[m].nunpack,datatype, + swap[m].recvproc,0,gridcomm); + if (swap[m].npack) MPI_Wait(&request,MPI_STATUS_IGNORE); - if (!lmp->kokkos->cuda_aware_flag) { + + if (!lmp->kokkos->gpu_aware_flag) { k_buf2.modify(); k_buf2.sync(); } } - kspaceKKBase->unpack_reverse_kspace_kokkos(which,k_buf2,swap[m].npack,k_packlist,m); + kspaceKKBase->unpack_reverse_grid_kokkos(which,k_buf2,0,swap[m].npack,k_swap_packlist,m); DeviceType().fence(); } } +/* ---------------------------------------------------------------------- + reverse comm on tiled grid decomp via Send/Recv lists of each neighbor proc +------------------------------------------------------------------------- */ + +template +void GridCommKokkos:: +reverse_comm_kspace_tiled(KSpace *kspace, int nper, int which, + FFT_DAT::tdual_FFT_SCALAR_1d &k_buf1, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf2, MPI_Datatype datatype) +{ + int i,m,offset; + + KokkosBaseFFT* kspaceKKBase = dynamic_cast(kspace); + + FFT_SCALAR* buf1; + FFT_SCALAR* buf2; + if (lmp->kokkos->gpu_aware_flag) { + buf1 = k_buf1.view().data(); + buf2 = k_buf2.view().data(); + } else { + buf1 = k_buf1.h_view.data(); + buf2 = k_buf2.h_view.data(); + } + + // post all receives + + for (m = 0; m < nsend; m++) { + offset = nper * send[m].offset; + MPI_Irecv(&buf2[offset],nper*send[m].npack,datatype, + send[m].proc,0,gridcomm,&requests[m]); + } + + // perform all sends to other procs + + for (m = 0; m < nrecv; m++) { + kspaceKKBase->pack_reverse_grid_kokkos(which,k_buf1,recv[m].nunpack,k_recv_unpacklist,m); + DeviceType().fence(); + + if (!lmp->kokkos->gpu_aware_flag) { + k_buf1.modify(); + k_buf1.sync(); + } + + MPI_Send(buf1,nper*recv[m].nunpack,datatype,recv[m].proc,0,gridcomm); + } + + // perform all copies to self + + for (m = 0; m < ncopy; m++) { + kspaceKKBase->pack_reverse_grid_kokkos(which,k_buf1,copy[m].nunpack,k_copy_unpacklist,m); + kspaceKKBase->unpack_reverse_grid_kokkos(which,k_buf1,0,copy[m].npack,k_copy_packlist,m); + } + + // unpack all received data + + for (i = 0; i < nsend; i++) { + MPI_Waitany(nsend,requests,&m,MPI_STATUS_IGNORE); + + if (!lmp->kokkos->gpu_aware_flag) { + k_buf2.modify(); + k_buf2.sync(); + } + + offset = nper * send[m].offset; + kspaceKKBase->unpack_reverse_grid_kokkos(which,k_buf2,offset, + send[m].npack,k_send_packlist,m); + DeviceType().fence(); + } +} + +/* ---------------------------------------------------------------------- + create swap stencil for grid own/ghost communication + swaps covers all 3 dimensions and both directions + swaps cover multiple iterations in a direction if need grid pts + from further away than nearest-neighbor proc + same swap list used by forward and reverse communication +------------------------------------------------------------------------- */ + +template +void GridCommKokkos::grow_swap() +{ + maxswap += DELTA; + swap = (Swap *) + memory->srealloc(swap,maxswap*sizeof(Swap),"GridComm:swap"); + + if (!k_swap_packlist.d_view.data()) { + k_swap_packlist = DAT::tdual_int_2d("GridComm:swap_packlist",maxswap,k_swap_packlist.extent(1)); + k_swap_unpacklist = DAT::tdual_int_2d("GridComm:swap_unpacklist",maxswap,k_swap_unpacklist.extent(1)); + } else { + k_swap_packlist.resize(maxswap,k_swap_packlist.extent(1)); + k_swap_unpacklist.resize(maxswap,k_swap_unpacklist.extent(1)); + } +} + /* ---------------------------------------------------------------------- create 1d list of offsets into 3d array section (xlo:xhi,ylo:yhi,zlo:zhi) - assume 3d array is allocated as (0:outxhi_max-outxlo_max+1,0:outyhi_max-outylo_max+1, - 0:outzhi_max-outzlo_max+1) + assume 3d array is allocated as + (fullxlo:fullxhi,fullylo:fullyhi,fullzlo:fullzhi) ------------------------------------------------------------------------- */ template @@ -620,8 +961,10 @@ int GridCommKokkos::indices(DAT::tdual_int_2d &k_list, int index, if (k_list.extent(1) < nmax) k_list.resize(k_list.extent(0),nmax); - int nx = (outxhi_max-outxlo_max+1); - int ny = (outyhi_max-outylo_max+1); + if (nmax == 0) return 0; + + int nx = (fullxhi-fullxlo+1); + int ny = (fullyhi-fullylo+1); k_list.sync(); @@ -630,7 +973,7 @@ int GridCommKokkos::indices(DAT::tdual_int_2d &k_list, int index, for (iz = zlo; iz <= zhi; iz++) for (iy = ylo; iy <= yhi; iy++) for (ix = xlo; ix <= xhi; ix++) - k_list.h_view(index,n++) = (iz-outzlo_max)*ny*nx + (iy-outylo_max)*nx + (ix-outxlo_max); + k_list.h_view(index,n++) = (iz-fullzlo)*ny*nx + (iy-fullylo)*nx + (ix-fullxlo); k_list.modify(); k_list.sync(); @@ -638,21 +981,10 @@ int GridCommKokkos::indices(DAT::tdual_int_2d &k_list, int index, return nmax; } - -/* ---------------------------------------------------------------------- - memory usage of send/recv bufs -------------------------------------------------------------------------- */ - -template -double GridCommKokkos::memory_usage() -{ - double bytes = 2*nbuf * sizeof(double); - return bytes; -} - namespace LAMMPS_NS { template class GridCommKokkos; #ifdef LMP_KOKKOS_GPU template class GridCommKokkos; #endif } + diff --git a/src/KOKKOS/gridcomm_kokkos.h b/src/KOKKOS/gridcomm_kokkos.h index 086834b467..1f93c111ca 100644 --- a/src/KOKKOS/gridcomm_kokkos.h +++ b/src/KOKKOS/gridcomm_kokkos.h @@ -14,81 +14,59 @@ #ifndef LMP_GRIDCOMM_KOKKOS_H #define LMP_GRIDCOMM_KOKKOS_H -#include "pointers.h" +#include "gridcomm.h" #include "kokkos_type.h" #include "fftdata_kokkos.h" -#ifdef FFT_SINGLE -typedef float FFT_SCALAR; -#define MPI_FFT_SCALAR MPI_FLOAT -#else -typedef double FFT_SCALAR; -#define MPI_FFT_SCALAR MPI_DOUBLE -#endif - namespace LAMMPS_NS { template -class GridCommKokkos : protected Pointers { +class GridCommKokkos : public GridComm { public: typedef DeviceType device_type; typedef ArrayTypes AT; typedef FFTArrayTypes FFT_AT; - - GridCommKokkos(class LAMMPS *, MPI_Comm, int, int, + GridCommKokkos(class LAMMPS *, MPI_Comm, int, int, int, + int, int, int, int, int, int, + int, int, int, int, int, int); + GridCommKokkos(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); - GridCommKokkos(class LAMMPS *, MPI_Comm, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); - ~GridCommKokkos(); - void ghost_notify(); - int ghost_overlap(); - void setup(); - void forward_comm(class KSpace *, int); - void reverse_comm(class KSpace *, int); - double memory_usage(); + virtual ~GridCommKokkos(); + void forward_comm_kspace(class KSpace *, int, int, + FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); + void reverse_comm_kspace(class KSpace *, int, int, + FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); private: - int me; - int nforward,nreverse; - MPI_Comm gridcomm; - MPI_Request request; + DAT::tdual_int_2d k_swap_packlist; + DAT::tdual_int_2d k_swap_unpacklist; - // in = inclusive indices of 3d grid chunk that I own - // out = inclusive indices of 3d grid chunk I own plus ghosts I use - // proc = 6 neighbor procs that surround me - // ghost = # of my owned grid planes needed from me - // by each of 6 neighbor procs to become their ghost planes + DAT::tdual_int_2d k_send_packlist; - int inxlo,inxhi,inylo,inyhi,inzlo,inzhi; - int outxlo,outxhi,outylo,outyhi,outzlo,outzhi; - int outxlo_max,outxhi_max,outylo_max,outyhi_max,outzlo_max,outzhi_max; - int procxlo,procxhi,procylo,procyhi,proczlo,proczhi; - int ghostxlo,ghostxhi,ghostylo,ghostyhi,ghostzlo,ghostzhi; + DAT::tdual_int_2d k_recv_unpacklist; - int nbuf; - //FFT_SCALAR *buf1,*buf2; - FFT_DAT::tdual_FFT_SCALAR_1d k_buf1; - FFT_DAT::tdual_FFT_SCALAR_1d k_buf2; + DAT::tdual_int_2d k_copy_packlist; + DAT::tdual_int_2d k_copy_unpacklist; - struct Swap { - int sendproc; // proc to send to for forward comm - int recvproc; // proc to recv from for forward comm - int npack; // # of datums to pack - int nunpack; // # of datums to unpack - //int *packlist; // 3d array offsets to pack - //int *unpacklist; // 3d array offsets to unpack - }; + // ------------------------------------------- + // internal methods + // ------------------------------------------- - DAT::tdual_int_2d k_packlist; - DAT::tdual_int_2d k_unpacklist; + void setup_regular(int &, int &); + void setup_tiled(int &, int &); - int nswap; - Swap *swap; + void forward_comm_kspace_regular(class KSpace *, int, int, + FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); + void forward_comm_kspace_tiled(class KSpace *, int, int, + FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); + void reverse_comm_kspace_regular(class KSpace *, int, int, + FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); + void reverse_comm_kspace_tiled(class KSpace *, int, int, + FFT_DAT::tdual_FFT_SCALAR_1d &, FFT_DAT::tdual_FFT_SCALAR_1d &, MPI_Datatype); + + void grow_swap(); int indices(DAT::tdual_int_2d &, int, int, int, int, int, int, int); }; diff --git a/src/KOKKOS/kokkos.cpp b/src/KOKKOS/kokkos.cpp index b1c46698ec..85365f8017 100644 --- a/src/KOKKOS/kokkos.cpp +++ b/src/KOKKOS/kokkos.cpp @@ -12,29 +12,32 @@ ------------------------------------------------------------------------- */ #include "kokkos.h" -#include -#include + +#include "error.h" +#include "force.h" +#include "memory_kokkos.h" +#include "neigh_list_kokkos.h" +#include "neighbor_kokkos.h" + #include -#include #include #include #include -#include "lammps.h" -#include "force.h" -#include "neighbor_kokkos.h" -#include "neigh_list_kokkos.h" -#include "error.h" -#include "memory_kokkos.h" -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU -// for detecting CUDA-aware MPI support: -// the variable int have_cuda_aware -// - is 1 if CUDA-aware MPI support is available -// - is 0 if CUDA-aware MPI support is unavailable -// - is -1 if CUDA-aware MPI support is unknown +// for detecting GPU-aware MPI support: +// the variable int have_gpu_aware +// - is 1 if GPU-aware MPI support is available +// - is 0 if GPU-aware MPI support is unavailable +// - is -1 if GPU-aware MPI support is unknown -#define CUDA_AWARE_UNKNOWN static int have_cuda_aware = -1; +#define GPU_AWARE_UNKNOWN static int have_gpu_aware = -1; + +// TODO HIP: implement HIP-aware MPI support (UCX) detection +#if defined(KOKKOS_ENABLE_HIP) +GPU_AWARE_UNKNOWN +#elif defined(KOKKOS_ENABLE_CUDA) // OpenMPI supports detecting CUDA-aware MPI as of version 2.0.0 @@ -44,23 +47,25 @@ #include #if defined(MPIX_CUDA_AWARE_SUPPORT) && MPIX_CUDA_AWARE_SUPPORT -static int have_cuda_aware = 1; +static int have_gpu_aware = 1; #elif defined(MPIX_CUDA_AWARE_SUPPORT) && !MPIX_CUDA_AWARE_SUPPORT -static int have_cuda_aware = 0; +static int have_gpu_aware = 0; #else -CUDA_AWARE_UNKNOWN +GPU_AWARE_UNKNOWN #endif // defined(MPIX_CUDA_AWARE_SUPPORT) #else // old OpenMPI -CUDA_AWARE_UNKNOWN +GPU_AWARE_UNKNOWN #endif // (OMPI_MAJOR_VERSION >=2) #else // unknown MPI library -CUDA_AWARE_UNKNOWN +GPU_AWARE_UNKNOWN #endif // OPEN_MPI #endif // KOKKOS_ENABLE_CUDA +#endif // LMP_ENABLE_DEVICE + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -187,9 +192,10 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) binsize = 0.0; #ifdef KOKKOS_ENABLE_CUDA - cuda_aware_flag = 1; + // TODO HIP: implement HIP-aware MPI testing + gpu_aware_flag = 1; #else - cuda_aware_flag = 0; + gpu_aware_flag = 0; #endif neigh_thread = 0; neigh_thread_set = 0; @@ -213,7 +219,7 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) exchange_comm_on_host = forward_comm_on_host = reverse_comm_on_host = 0; } -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU // check and warn about CUDA-aware MPI availability when using multiple MPI tasks // change default only if we can safely detect that CUDA-aware MPI is not available @@ -228,43 +234,43 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int len; char mpi_version[MPI_MAX_LIBRARY_VERSION_STRING]; MPI_Get_library_version(mpi_version, &len); - if (strstr(&mpi_version[0], "Spectrum") != NULL) { - cuda_aware_flag = 0; + if (strstr(&mpi_version[0], "Spectrum") != nullptr) { + gpu_aware_flag = 0; char* str; - if (str = getenv("OMPI_MCA_pml_pami_enable_cuda")) + if ((str = getenv("OMPI_MCA_pml_pami_enable_cuda"))) if((strcmp(str,"1") == 0)) { - have_cuda_aware = 1; - cuda_aware_flag = 1; + have_gpu_aware = 1; + gpu_aware_flag = 1; } - if (!cuda_aware_flag) + if (!gpu_aware_flag) if (me == 0) error->warning(FLERR,"The Spectrum MPI '-gpu' flag is not set. Disabling CUDA-aware MPI"); } #endif - if (cuda_aware_flag == 1 && have_cuda_aware == 0) { + if (gpu_aware_flag == 1 && have_gpu_aware == 0) { if (me == 0) error->warning(FLERR,"Turning off CUDA-aware MPI since it is not detected, " "use '-pk kokkos cuda/aware on' to override"); - cuda_aware_flag = 0; - } else if (have_cuda_aware == -1) { // maybe we are dealing with MPICH, MVAPICH2 or some derivative? + gpu_aware_flag = 0; + } else if (have_gpu_aware == -1) { // maybe we are dealing with MPICH, MVAPICH2 or some derivative? // MVAPICH2 #if defined(MPICH) && defined(MVAPICH2_VERSION) char* str; - cuda_aware_flag = 0; + gpu_aware_flag = 0; if ((str = getenv("MV2_ENABLE_CUDA"))) if ((strcmp(str,"1") == 0)) - cuda_aware_flag = 1; + gpu_aware_flag = 1; - if (!cuda_aware_flag) + if (!gpu_aware_flag) if (me == 0) - error->warning(FLERR,"MVAPICH2 'MV2_ENABLE_CUDA' environment variable is not set. Disabling CUDA-aware MPI"); + error->warning(FLERR,"MVAPICH2 'MV2_USE_CUDA' environment variable is not set. Disabling CUDA-aware MPI"); // pure MPICH or some unsupported MPICH derivative #elif defined(MPICH) && !defined(MVAPICH2_VERSION) if (me == 0) error->warning(FLERR,"Detected MPICH. Disabling CUDA-aware MPI"); - cuda_aware_flag = 0; + gpu_aware_flag = 0; #else if (me == 0) error->warning(FLERR,"Kokkos with CUDA assumes CUDA-aware MPI is available," @@ -272,9 +278,9 @@ KokkosLMP::KokkosLMP(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) " '-pk kokkos cuda/aware off' if getting segmentation faults"); #endif - } // if (-1 == have_cuda_aware) + } // if (-1 == have_gpu_aware) } // nmpi > 0 -#endif // KOKKOS_ENABLE_CUDA +#endif // LMP_ENABLE_DEVICE #ifdef KILL_KOKKOS_ON_SIGSEGV signal(SIGSEGV, my_signal_handler); @@ -324,7 +330,7 @@ void KokkosLMP::accelerator(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); - binsize = force->numeric(FLERR,arg[iarg+1]); + binsize = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"newton") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); @@ -383,8 +389,8 @@ void KokkosLMP::accelerator(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"cuda/aware") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package kokkos command"); - if (strcmp(arg[iarg+1],"off") == 0) cuda_aware_flag = 0; - else if (strcmp(arg[iarg+1],"on") == 0) cuda_aware_flag = 1; + if (strcmp(arg[iarg+1],"off") == 0) gpu_aware_flag = 0; + else if (strcmp(arg[iarg+1],"on") == 0) gpu_aware_flag = 1; else error->all(FLERR,"Illegal package kokkos command"); iarg += 2; } else if (strcmp(arg[iarg],"neigh/thread") == 0) { @@ -397,14 +403,14 @@ void KokkosLMP::accelerator(int narg, char **arg) } else error->all(FLERR,"Illegal package kokkos command"); } -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU int nmpi = 0; MPI_Comm_size(world,&nmpi); // if "cuda/aware off" and "comm device", change to "comm host" - if (!cuda_aware_flag && nmpi > 1) { + if (!gpu_aware_flag && nmpi > 1) { if (exchange_comm_classic == 0 && exchange_comm_on_host == 0) { exchange_comm_on_host = 1; exchange_comm_changed = 1; @@ -421,7 +427,7 @@ void KokkosLMP::accelerator(int narg, char **arg) // if "cuda/aware on" and comm flags were changed previously, change them back - if (cuda_aware_flag) { + if (gpu_aware_flag) { if (exchange_comm_changed) { exchange_comm_on_host = 0; exchange_comm_changed = 0; diff --git a/src/KOKKOS/kokkos.h b/src/KOKKOS/kokkos.h index 7b605bee1e..eb0eb2e71f 100644 --- a/src/KOKKOS/kokkos.h +++ b/src/KOKKOS/kokkos.h @@ -38,7 +38,7 @@ class KokkosLMP : protected Pointers { int nthreads,ngpus; int numa; int auto_sync; - int cuda_aware_flag; + int gpu_aware_flag; int neigh_thread; int neigh_thread_set; int newtonflag; @@ -55,7 +55,7 @@ class KokkosLMP : protected Pointers { int value = 0; if (neighflag == HALFTHREAD) - value = NeedDup::value; + value = std::is_same::value,Kokkos::Experimental::ScatterDuplicated>::value; return value; } diff --git a/src/KOKKOS/kokkos_base_fft.h b/src/KOKKOS/kokkos_base_fft.h index 7d0829e4d6..de3a293126 100644 --- a/src/KOKKOS/kokkos_base_fft.h +++ b/src/KOKKOS/kokkos_base_fft.h @@ -23,10 +23,10 @@ class KokkosBaseFFT { KokkosBaseFFT() {} //Kspace - virtual void pack_forward_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual void unpack_forward_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual void pack_reverse_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; - virtual void unpack_reverse_kspace_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + virtual void pack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + virtual void unpack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int) {}; + virtual void pack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int) {}; + virtual void unpack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int) {}; }; } diff --git a/src/KOKKOS/kokkos_type.h b/src/KOKKOS/kokkos_type.h index 54488f790d..5930a9e207 100644 --- a/src/KOKKOS/kokkos_type.h +++ b/src/KOKKOS/kokkos_type.h @@ -33,9 +33,19 @@ enum{FULL=1u,HALFTHREAD=2u,HALF=4u}; #define LMP_KOKKOS_GPU #endif +#if defined(LMP_KOKKOS_GPU) +#define KOKKOS_GPU_ARG(x) x +#else +#define KOKKOS_GPU_ARG(x) +#endif + #define MAX_TYPES_STACKPARAMS 12 #define NeighClusterSize 8 +namespace Kokkos { + using NoInit = ViewAllocateWithoutInitializing; +} + struct lmp_float3 { float x,y,z; KOKKOS_INLINE_FUNCTION @@ -205,6 +215,21 @@ struct ExecutionSpaceFromDevice { }; #endif +// set host pinned space +#if defined(KOKKOS_ENABLE_CUDA) +typedef Kokkos::CudaHostPinnedSpace LMPPinnedHostType; +#elif defined(KOKKOS_ENABLE_HIP) +typedef Kokkos::Experimental::HIPHostPinnedSpace LMPPinnedHostType; +#endif + +// create simple LMPDeviceSpace typedef for non HIP or CUDA specific +// behaviour +#if defined(KOKKOS_ENABLE_CUDA) +typedef Kokkos::Cuda LMPDeviceSpace; +#elif defined(KOKKOS_ENABLE_HIP) +typedef Kokkos::Experimental::HIP LMPDeviceSpace; +#endif + // Determine memory traits for force array // Do atomic trait when running HALFTHREAD neighbor list style @@ -223,20 +248,20 @@ struct AtomicF { // Do atomic trait when running HALFTHREAD neighbor list style with CUDA template struct AtomicDup { - enum {value = Kokkos::Experimental::ScatterNonAtomic}; + using value = Kokkos::Experimental::ScatterNonAtomic; }; #ifdef KOKKOS_ENABLE_CUDA template<> struct AtomicDup { - enum {value = Kokkos::Experimental::ScatterAtomic}; + using value = Kokkos::Experimental::ScatterAtomic; }; #endif -#if defined(KOKKOS_ENABLE_HIP) +#ifdef KOKKOS_ENABLE_HIP template<> struct AtomicDup { - enum {value = Kokkos::Experimental::ScatterAtomic}; + using value = Kokkos::Experimental::ScatterAtomic; }; #endif @@ -245,14 +270,14 @@ struct AtomicDup { #ifdef KOKKOS_ENABLE_OPENMP template<> struct AtomicDup { - enum {value = Kokkos::Experimental::ScatterAtomic}; + using value = Kokkos::Experimental::ScatterAtomic; }; #endif #ifdef KOKKOS_ENABLE_THREADS template<> struct AtomicDup { - enum {value = Kokkos::Experimental::ScatterAtomic}; + using value = Kokkos::Experimental::ScatterAtomic; }; #endif @@ -263,7 +288,7 @@ struct AtomicDup { // Use duplication when running threaded and not using atomics template struct NeedDup { - enum {value = Kokkos::Experimental::ScatterNonDuplicated}; + using value = Kokkos::Experimental::ScatterNonDuplicated; }; #ifndef LMP_KOKKOS_USE_ATOMICS @@ -271,20 +296,20 @@ struct NeedDup { #ifdef KOKKOS_ENABLE_OPENMP template<> struct NeedDup { - enum {value = Kokkos::Experimental::ScatterDuplicated}; + using value = Kokkos::Experimental::ScatterDuplicated; }; #endif #ifdef KOKKOS_ENABLE_THREADS template<> struct NeedDup { - enum {value = Kokkos::Experimental::ScatterDuplicated}; + using value = Kokkos::Experimental::ScatterDuplicated; }; #endif #endif -template +template class ScatterViewHelper {}; template @@ -1058,7 +1083,7 @@ struct alignas(2*sizeof(real)) SNAComplex { real re,im; - KOKKOS_FORCEINLINE_FUNCTION SNAComplex() = default; + SNAComplex() = default; KOKKOS_FORCEINLINE_FUNCTION SNAComplex(real re) : re(re), im(static_cast(0.)) { ; } @@ -1100,6 +1125,17 @@ KOKKOS_FORCEINLINE_FUNCTION SNAComplex operator*(const real& r, const SNAC typedef SNAComplex SNAcomplex; +// Cayley-Klein pack +// Can guarantee it's aligned to 2 complex +struct alignas(32) CayleyKleinPack { + + SNAcomplex a, b; + SNAcomplex da[3], db[3]; + SNAreal sfac; + SNAreal dsfacu[3]; + +}; + #if defined(KOKKOS_ENABLE_CXX11) #undef ISFINITE @@ -1112,4 +1148,10 @@ typedef SNAComplex SNAcomplex; #define LAMMPS_LAMBDA [=] #endif +#ifdef LMP_KOKKOS_GPU +#if defined(__CUDA_ARCH__) || defined(__HIP_DEVICE_COMPILE__) +#define LMP_KK_DEVICE_COMPILE +#endif +#endif + #endif diff --git a/src/KOKKOS/memory_kokkos.h b/src/KOKKOS/memory_kokkos.h index 39d30ac785..df85f72c65 100644 --- a/src/KOKKOS/memory_kokkos.h +++ b/src/KOKKOS/memory_kokkos.h @@ -14,7 +14,7 @@ #ifndef LMP_MEMORY_KOKKOS_H #define LMP_MEMORY_KOKKOS_H -#include "memory.h" +#include "memory.h" // IWYU pragma: export #include "kokkos_type.h" namespace LAMMPS_NS { @@ -78,7 +78,7 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type *&array, int n1, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,name); + if (array == nullptr) return create_kokkos(data,array,n1,name); data.resize(n1); array = data.h_view.data(); @@ -88,9 +88,9 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type *&array, template void destroy_kokkos(TYPE data, typename TYPE::value_type* &array) { - if (array == NULL) return; + if (array == nullptr) return; data = TYPE(); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -100,7 +100,7 @@ void destroy_kokkos(TYPE data, typename TYPE::value_type* &array) template TYPE destroy_kokkos(TYPE &data) { - /*if(data.data()!=NULL) + /*if(data.data()!=nullptr) free(data.data());*/ data = TYPE(); return data; @@ -186,7 +186,7 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, bigint n = 0; for (int i = 0; i < n1; i++) { if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); n += n2; @@ -211,7 +211,7 @@ template bigint n = 0; for (int i = 0; i < n1; i++) { if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &h_data(i,0); n += n2; @@ -228,14 +228,14 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, int n1, int n2, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,n2,name); + if (array == nullptr) return create_kokkos(data,array,n1,n2,name); data.resize(n1,n2); bigint nbytes = ((bigint) sizeof(typename TYPE::value_type *)) * n1; array = (typename TYPE::value_type**) srealloc(array,nbytes,name); for (int i = 0; i < n1; i++) if(n2==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -252,7 +252,7 @@ TYPE create_kokkos(TYPE &data, typename TYPE::value_type **&array, for (int i = 0; i < n1; i++) if(data.h_view.extent(1)==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -263,7 +263,7 @@ template TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, int n1, const char *name) { - if (array == NULL) return create_kokkos(data,array,n1,name); + if (array == nullptr) return create_kokkos(data,array,n1,name); data.resize(n1); @@ -272,7 +272,7 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, for (int i = 0; i < n1; i++) if(data.h_view.extent(1)==0) - array[i] = NULL; + array[i] = nullptr; else array[i] = &data.h_view(i,0); @@ -286,10 +286,10 @@ TYPE grow_kokkos(TYPE &data, typename TYPE::value_type **&array, template void destroy_kokkos(TYPE data, typename TYPE::value_type** &array) { - if (array == NULL) return; + if (array == nullptr) return; data = TYPE(); sfree(array); - array = NULL; + array = nullptr; } }; diff --git a/src/KOKKOS/min_kokkos.cpp b/src/KOKKOS/min_kokkos.cpp index e5f22411f6..759b00976f 100644 --- a/src/KOKKOS/min_kokkos.cpp +++ b/src/KOKKOS/min_kokkos.cpp @@ -16,32 +16,31 @@ ------------------------------------------------------------------------- */ #include "min_kokkos.h" -#include -#include -#include -#include "atom_kokkos.h" -#include "atom_vec.h" -#include "domain.h" -#include "comm.h" -#include "update.h" -#include "modify.h" -#include "fix_minimize_kokkos.h" -#include "compute.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" -#include "bond.h" + #include "angle.h" +#include "atom_kokkos.h" +#include "atom_masks.h" +#include "bond.h" +#include "comm.h" +#include "compute.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix_minimize_kokkos.h" +#include "force.h" #include "improper.h" +#include "kokkos.h" #include "kspace.h" +#include "modify.h" +#include "neighbor.h" #include "output.h" +#include "pair.h" #include "thermo.h" #include "timer.h" -#include "memory.h" -#include "error.h" -#include "kokkos.h" -#include "atom_masks.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -50,7 +49,7 @@ using namespace LAMMPS_NS; MinKokkos::MinKokkos(LAMMPS *lmp) : Min(lmp) { atomKK = (AtomKokkos *) atom; - fix_minimize_kk = NULL; + fix_minimize_kk = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/min_linesearch_kokkos.cpp b/src/KOKKOS/min_linesearch_kokkos.cpp index cb07c7db86..4306a5bd3b 100644 --- a/src/KOKKOS/min_linesearch_kokkos.cpp +++ b/src/KOKKOS/min_linesearch_kokkos.cpp @@ -16,16 +16,16 @@ ------------------------------------------------------------------------- */ #include "min_linesearch_kokkos.h" -#include -#include + #include "atom_kokkos.h" -#include "modify.h" -#include "fix_minimize_kokkos.h" -#include "pair.h" -#include "output.h" -#include "thermo.h" -#include "error.h" #include "atom_masks.h" +#include "error.h" +#include "fix_minimize_kokkos.h" +#include "output.h" +#include "pair.h" +#include "thermo.h" + +#include using namespace LAMMPS_NS; diff --git a/src/KOKKOS/nbin_kokkos.cpp b/src/KOKKOS/nbin_kokkos.cpp index 9b41dc1bff..158a87796e 100644 --- a/src/KOKKOS/nbin_kokkos.cpp +++ b/src/KOKKOS/nbin_kokkos.cpp @@ -12,14 +12,11 @@ ------------------------------------------------------------------------- */ #include "nbin_kokkos.h" -#include "neighbor.h" + #include "atom_kokkos.h" -#include "group.h" -#include "domain.h" +#include "atom_masks.h" #include "comm.h" #include "update.h" -#include "error.h" -#include "atom_masks.h" using namespace LAMMPS_NS; @@ -67,14 +64,14 @@ NBinKokkos::NBinKokkos(LAMMPS *lmp) : NBinStandard(lmp) { template void NBinKokkos::bin_atoms_setup(int nall) { - if (mbins > k_bins.d_view.extent(0)) { + if (mbins > (int)k_bins.d_view.extent(0)) { k_bins = DAT::tdual_int_2d("Neighbor::d_bins",mbins,atoms_per_bin); bins = k_bins.view(); k_bincount = DAT::tdual_int_1d("Neighbor::d_bincount",mbins); bincount = k_bincount.view(); } - if (nall > k_atom2bin.d_view.extent(0)) { + if (nall > (int)k_atom2bin.d_view.extent(0)) { k_atom2bin = DAT::tdual_int_1d("Neighbor::d_atom2bin",nall); atom2bin = k_atom2bin.view(); } @@ -138,7 +135,7 @@ void NBinKokkos::binatomsItem(const int &i) const atom2bin(i) = ibin; const int ac = Kokkos::atomic_fetch_add(&bincount[ibin], (int)1); - if(ac < bins.extent(1)) { + if(ac < (int)bins.extent(1)) { bins(ibin, ac) = i; } else { d_resize() = 1; diff --git a/src/KOKKOS/nbin_ssa_kokkos.cpp b/src/KOKKOS/nbin_ssa_kokkos.cpp index 2d9411e707..8d47eb3d0f 100644 --- a/src/KOKKOS/nbin_ssa_kokkos.cpp +++ b/src/KOKKOS/nbin_ssa_kokkos.cpp @@ -67,7 +67,7 @@ NBinSSAKokkos::NBinSSAKokkos(LAMMPS *lmp) : NBinStandard(lmp) /* ---------------------------------------------------------------------- */ template -void NBinSSAKokkos::bin_atoms_setup(int nall) +void NBinSSAKokkos::bin_atoms_setup(int /*nall*/) { if (mbins > (int) k_bins.h_view.extent(0)) { k_bins = DAT::tdual_int_2d("NBinSSAKokkos::bins",mbins,atoms_per_bin); diff --git a/src/KOKKOS/neigh_bond_kokkos.cpp b/src/KOKKOS/neigh_bond_kokkos.cpp index b815a084fb..8f054e46b5 100644 --- a/src/KOKKOS/neigh_bond_kokkos.cpp +++ b/src/KOKKOS/neigh_bond_kokkos.cpp @@ -16,22 +16,22 @@ ------------------------------------------------------------------------- */ #include "neigh_bond_kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "atom_vec.h" -#include "molecule.h" -#include "force.h" -#include "update.h" #include "domain_kokkos.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "memory_kokkos.h" +#include "modify.h" #include "output.h" #include "thermo.h" -#include "memory_kokkos.h" -#include "error.h" -#include "modify.h" -#include "fix.h" -#include -#include "atom_masks.h" -#include "domain.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; #define BONDDELTA 10000 @@ -75,34 +75,31 @@ void NeighBondKokkos::init_topology_kk() { // 1st time allocation of topology lists - if (atom->molecular && atom->nbonds && maxbond == 0) { - if (nprocs == 1) maxbond = atom->nbonds; - else maxbond = static_cast (LB_FACTOR * atom->nbonds / nprocs); - memoryKK->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist"); - } - - if (atom->molecular && atom->nangles && maxangle == 0) { - if (nprocs == 1) maxangle = atom->nangles; - else maxangle = static_cast (LB_FACTOR * atom->nangles / nprocs); - memoryKK->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist"); - } - - if (atom->molecular && atom->ndihedrals && maxdihedral == 0) { - if (nprocs == 1) maxdihedral = atom->ndihedrals; - else maxdihedral = static_cast - (LB_FACTOR * atom->ndihedrals / nprocs); - memoryKK->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist"); - } - - if (atom->molecular && atom->nimpropers && maximproper == 0) { - if (nprocs == 1) maximproper = atom->nimpropers; - else maximproper = static_cast - (LB_FACTOR * atom->nimpropers / nprocs); - memoryKK->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist"); + if (atom->molecular != Atom::ATOMIC) { + if (atom->nbonds && maxbond == 0) { + if (nprocs == 1) maxbond = atom->nbonds; + else maxbond = static_cast (LB_FACTOR * atom->nbonds / nprocs); + memoryKK->create_kokkos(k_bondlist,neighbor->bondlist,maxbond,3,"neigh:neighbor->bondlist"); + } + if (atom->nangles && maxangle == 0) { + if (nprocs == 1) maxangle = atom->nangles; + else maxangle = static_cast (LB_FACTOR * atom->nangles / nprocs); + memoryKK->create_kokkos(k_anglelist,neighbor->anglelist,maxangle,4,"neigh:neighbor->anglelist"); + } + if (atom->ndihedrals && maxdihedral == 0) { + if (nprocs == 1) maxdihedral = atom->ndihedrals; + else maxdihedral = static_cast (LB_FACTOR * atom->ndihedrals / nprocs); + memoryKK->create_kokkos(k_dihedrallist,neighbor->dihedrallist,maxdihedral,5,"neigh:neighbor->dihedrallist"); + } + if (atom->nimpropers && maximproper == 0) { + if (nprocs == 1) maximproper = atom->nimpropers; + else maximproper = static_cast (LB_FACTOR * atom->nimpropers / nprocs); + memoryKK->create_kokkos(k_improperlist,neighbor->improperlist,maximproper,5,"neigh:neighbor->improperlist"); + } } // set flags that determine which topology neighboring routines to use - // bonds,etc can only be broken for atom->molecular = 1, not 2 + // bonds,etc can only be broken for atom->molecular = Atom::MOLECULAR, not Atom::TEMPLATE // SHAKE sets bonds and angles negative // gcmc sets all bonds, angles, etc negative // bond_quartic sets bonds to 0 @@ -117,7 +114,7 @@ void NeighBondKokkos::init_topology_kk() { bond_off = angle_off = 1; if (force->bond && force->bond_match("quartic")) bond_off = 1; - if (atom->avec->bonds_allow && atom->molecular == 1) { + if (atom->avec->bonds_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (bond_off) break; for (m = 0; m < atom->num_bond[i]; m++) @@ -125,7 +122,7 @@ void NeighBondKokkos::init_topology_kk() { } } - if (atom->avec->angles_allow && atom->molecular == 1) { + if (atom->avec->angles_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (angle_off) break; for (m = 0; m < atom->num_angle[i]; m++) @@ -134,7 +131,7 @@ void NeighBondKokkos::init_topology_kk() { } int dihedral_off = 0; - if (atom->avec->dihedrals_allow && atom->molecular == 1) { + if (atom->avec->dihedrals_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (dihedral_off) break; for (m = 0; m < atom->num_dihedral[i]; m++) @@ -143,7 +140,7 @@ void NeighBondKokkos::init_topology_kk() { } int improper_off = 0; - if (atom->avec->impropers_allow && atom->molecular == 1) { + if (atom->avec->impropers_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (improper_off) break; for (m = 0; m < atom->num_improper[i]; m++) @@ -168,19 +165,19 @@ void NeighBondKokkos::init_topology_kk() { // set ptrs to topology build functions - if (atom->molecular == 2) bond_build_kk = &NeighBondKokkos::bond_template; + if (atom->molecular == Atom::TEMPLATE) bond_build_kk = &NeighBondKokkos::bond_template; else if (bond_off) bond_build_kk = &NeighBondKokkos::bond_partial; else bond_build_kk = &NeighBondKokkos::bond_all; - if (atom->molecular == 2) angle_build_kk = &NeighBondKokkos::angle_template; + if (atom->molecular == Atom::TEMPLATE) angle_build_kk = &NeighBondKokkos::angle_template; else if (angle_off) angle_build_kk = &NeighBondKokkos::angle_partial; else angle_build_kk = &NeighBondKokkos::angle_all; - if (atom->molecular == 2) dihedral_build_kk = &NeighBondKokkos::dihedral_template; + if (atom->molecular == Atom::TEMPLATE) dihedral_build_kk = &NeighBondKokkos::dihedral_template; else if (dihedral_off) dihedral_build_kk = &NeighBondKokkos::dihedral_partial; else dihedral_build_kk = &NeighBondKokkos::dihedral_all; - if (atom->molecular == 2) improper_build_kk = &NeighBondKokkos::improper_template; + if (atom->molecular == Atom::TEMPLATE) improper_build_kk = &NeighBondKokkos::improper_template; else if (improper_off) improper_build_kk = &NeighBondKokkos::improper_partial; else improper_build_kk = &NeighBondKokkos::improper_all; @@ -211,13 +208,13 @@ void NeighBondKokkos::build_topology_kk() // don't yet have atom_map_kokkos routines, so move data from host to device - if (atom->map_style != 1) + if (atom->map_style != Atom::MAP_ARRAY) error->all(FLERR,"Must use atom map style array with Kokkos"); int* map_array_host = atom->get_map_array(); int map_size = atom->get_map_size(); int map_maxarray = atom->get_map_maxarray(); - if (map_maxarray > k_map_array.extent(0)) + if (map_maxarray > (int)k_map_array.extent(0)) k_map_array = DAT::tdual_int_1d("NeighBond:map_array",map_maxarray); for (int i=0; i::build_topology_kk() map_array = k_map_array.view(); int* sametag_host = atomKK->sametag; - if (nmax > k_sametag.extent(0)) + if (nmax > (int)k_sametag.extent(0)) k_sametag = DAT::tdual_int_1d("NeighBond:sametag",nmax); for (int i=0; i::grow(int nmax) // skip if this list is already long enough to store nmax atoms // and maxneighs neighbors - if (nmax <= maxatoms && d_neighbors.extent(1) >= maxneighs) return; + if (nmax <= maxatoms && (int)d_neighbors.extent(1) >= maxneighs) return; maxatoms = nmax; k_ilist = DAT::tdual_int_1d("neighlist:ilist",maxatoms); d_ilist = k_ilist.view(); - k_numneigh = DAT::tdual_int_1d("neighlist:numneigh",maxatoms); - d_numneigh = k_numneigh.view(); - k_neighbors = DAT::tdual_neighbors_2d("neighlist:neighbors",maxatoms,maxneighs); - d_neighbors = k_neighbors.view(); + d_numneigh = typename ArrayTypes::t_int_1d("neighlist:numneigh",maxatoms); + d_neighbors = typename ArrayTypes::t_neighbors_2d(Kokkos::NoInit("neighlist:neighbors"),maxatoms,maxneighs); } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/neigh_list_kokkos.h b/src/KOKKOS/neigh_list_kokkos.h index edd775f7f9..5de871166e 100644 --- a/src/KOKKOS/neigh_list_kokkos.h +++ b/src/KOKKOS/neigh_list_kokkos.h @@ -15,7 +15,8 @@ #define LMP_NEIGH_LIST_KOKKOS_H #include "pointers.h" -#include "neigh_list.h" + +#include "neigh_list.h" // IWYU pragma: export #include "kokkos_type.h" namespace LAMMPS_NS { @@ -67,11 +68,9 @@ public: int maxneighs; void grow(int nmax); - DAT::tdual_neighbors_2d k_neighbors; typename ArrayTypes::t_neighbors_2d d_neighbors; DAT::tdual_int_1d k_ilist; // local indices of I atoms typename ArrayTypes::t_int_1d d_ilist; - DAT::tdual_int_1d k_numneigh; // # of J neighs for each I typename ArrayTypes::t_int_1d d_numneigh; NeighListKokkos(class LAMMPS *lmp); diff --git a/src/KOKKOS/neighbor_kokkos.cpp b/src/KOKKOS/neighbor_kokkos.cpp index a594c8f7a0..1795d87611 100644 --- a/src/KOKKOS/neighbor_kokkos.cpp +++ b/src/KOKKOS/neighbor_kokkos.cpp @@ -12,25 +12,26 @@ ------------------------------------------------------------------------- */ #include "neighbor_kokkos.h" -#include "atom_kokkos.h" -#include "pair.h" -#include "fix.h" -#include "neigh_request.h" -#include "memory_kokkos.h" -#include "update.h" -#include "atom_masks.h" -#include "error.h" -#include "kokkos.h" -#include "force.h" -#include "bond.h" + #include "angle.h" -#include "dihedral.h" -#include "improper.h" -#include "style_nbin.h" -#include "style_nstencil.h" -#include "style_npair.h" -#include "style_ntopo.h" +#include "atom_kokkos.h" +#include "atom_masks.h" +#include "bond.h" #include "comm.h" +#include "dihedral.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "improper.h" +#include "kokkos.h" +#include "memory_kokkos.h" +#include "neigh_request.h" +#include "pair.h" +#include "style_nbin.h" +#include "style_npair.h" +#include "style_nstencil.h" +#include "style_ntopo.h" +#include "update.h" using namespace LAMMPS_NS; @@ -40,10 +41,10 @@ NeighborKokkos::NeighborKokkos(LAMMPS *lmp) : Neighbor(lmp), neighbond_host(lmp),neighbond_device(lmp) { device_flag = 0; - bondlist = NULL; - anglelist = NULL; - dihedrallist = NULL; - improperlist = NULL; + bondlist = nullptr; + anglelist = nullptr; + dihedrallist = nullptr; + improperlist = nullptr; } /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ NeighborKokkos::~NeighborKokkos() { if (!copymode) { memoryKK->destroy_kokkos(k_cutneighsq,cutneighsq); - cutneighsq = NULL; + cutneighsq = nullptr; memoryKK->destroy_kokkos(k_ex_type,ex_type); memoryKK->destroy_kokkos(k_ex1_type,ex1_type); @@ -163,8 +164,6 @@ int NeighborKokkos::check_distance() template int NeighborKokkos::check_distance_kokkos() { - typedef DeviceType device_type; - double delx,dely,delz; double delta,delta1,delta2; @@ -216,7 +215,6 @@ int NeighborKokkos::check_distance_kokkos() template KOKKOS_INLINE_FUNCTION void NeighborKokkos::operator()(TagNeighborCheckDistance, const int &i, int &flag) const { - typedef DeviceType device_type; const X_FLOAT delx = x.view()(i,0) - xhold.view()(i,0); const X_FLOAT dely = x.view()(i,1) - xhold.view()(i,1); const X_FLOAT delz = x.view()(i,2) - xhold.view()(i,2); @@ -242,8 +240,6 @@ void NeighborKokkos::build(int topoflag) template void NeighborKokkos::build_kokkos(int topoflag) { - typedef DeviceType device_type; - int i,m; ago = 0; @@ -320,13 +316,12 @@ void NeighborKokkos::build_kokkos(int topoflag) // build topology lists for bonds/angles/etc - if (atom->molecular && topoflag) build_topology(); + if ((atom->molecular != Atom::ATOMIC) && topoflag) build_topology(); } template KOKKOS_INLINE_FUNCTION void NeighborKokkos::operator()(TagNeighborXhold, const int &i) const { - typedef DeviceType device_type; xhold.view()(i,0) = x.view()(i,0); xhold.view()(i,1) = x.view()(i,1); xhold.view()(i,2) = x.view()(i,2); diff --git a/src/KOKKOS/neighbor_kokkos.h b/src/KOKKOS/neighbor_kokkos.h index 3829502c0d..304fe8f1da 100644 --- a/src/KOKKOS/neighbor_kokkos.h +++ b/src/KOKKOS/neighbor_kokkos.h @@ -14,11 +14,10 @@ #ifndef LMP_NEIGHBOR_KOKKOS_H #define LMP_NEIGHBOR_KOKKOS_H -#include "neighbor.h" +#include "neighbor.h" // IWYU pragma: export #include "neigh_list_kokkos.h" #include "neigh_bond_kokkos.h" #include "kokkos_type.h" -#include namespace LAMMPS_NS { diff --git a/src/KOKKOS/npair_copy_kokkos.cpp b/src/KOKKOS/npair_copy_kokkos.cpp index 98f4b29c1c..eea0a14f86 100644 --- a/src/KOKKOS/npair_copy_kokkos.cpp +++ b/src/KOKKOS/npair_copy_kokkos.cpp @@ -73,16 +73,14 @@ void NPairCopyKokkos::copy_to_cpu(NeighList *list) NeighListKokkos* listcopy_kk = (NeighListKokkos*) listcopy; listcopy_kk->k_ilist.template sync(); - listcopy_kk->k_numneigh.template sync(); - listcopy_kk->k_neighbors.template sync(); int inum = listcopy->inum; int gnum = listcopy->gnum; int inum_all = inum; if (list->ghost) inum_all += gnum; auto h_ilist = listcopy_kk->k_ilist.h_view; - auto h_numneigh = listcopy_kk->k_numneigh.h_view; - auto h_neighbors = listcopy_kk->k_neighbors.h_view; + auto h_numneigh = Kokkos::create_mirror_view_and_copy(LMPHostType(),listcopy_kk->d_numneigh); + auto h_neighbors = Kokkos::create_mirror_view_and_copy(LMPHostType(),listcopy_kk->d_neighbors); list->inum = inum; list->gnum = gnum; diff --git a/src/KOKKOS/npair_halffull_kokkos.cpp b/src/KOKKOS/npair_halffull_kokkos.cpp index b109010935..653c1c4914 100644 --- a/src/KOKKOS/npair_halffull_kokkos.cpp +++ b/src/KOKKOS/npair_halffull_kokkos.cpp @@ -12,15 +12,14 @@ ------------------------------------------------------------------------- */ #include "npair_halffull_kokkos.h" -#include "neighbor.h" -#include "neigh_list_kokkos.h" + #include "atom_kokkos.h" -#include "atom_vec.h" -#include "molecule.h" -#include "domain.h" -#include "my_page.h" -#include "error.h" #include "atom_masks.h" +#include "atom_vec.h" +#include "domain.h" +#include "neigh_list_kokkos.h" + +#include using namespace LAMMPS_NS; @@ -74,8 +73,6 @@ void NPairHalffullKokkos::build(NeighList *list) list->gnum = k_list_full->gnum; k_list->k_ilist.template modify(); - k_list->k_numneigh.template modify(); - k_list->k_neighbors.template modify(); } template diff --git a/src/KOKKOS/npair_kokkos.cpp b/src/KOKKOS/npair_kokkos.cpp index 66daccc981..dfa1a14dd5 100644 --- a/src/KOKKOS/npair_kokkos.cpp +++ b/src/KOKKOS/npair_kokkos.cpp @@ -103,14 +103,14 @@ void NPairKokkos::copy_stencil_info() int maxstencil = ns->get_maxstencil(); - if (maxstencil > k_stencil.extent(0)) + if (maxstencil > (int)k_stencil.extent(0)) k_stencil = DAT::tdual_int_1d("neighlist:stencil",maxstencil); for (int k = 0; k < maxstencil; k++) k_stencil.h_view(k) = ns->stencil[k]; - k_stencil.modify(); - k_stencil.sync(); + k_stencil.modify(); + k_stencil.sync(); if (GHOST) { - if (maxstencil > k_stencilxyz.extent(0)) + if (maxstencil > (int)k_stencilxyz.extent(0)) k_stencilxyz = DAT::tdual_int_1d_3("neighlist:stencilxyz",maxstencil); for (int k = 0; k < maxstencil; k++) { k_stencilxyz.h_view(k,0) = ns->stencilxyz[k][0]; @@ -212,7 +212,7 @@ void NPairKokkos::build(NeighList *list_) data.h_resize() = 0; Kokkos::deep_copy(d_scalars, h_scalars); -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU #define BINS_PER_BLOCK 2 const int factor = atoms_per_bin<64?2:1; #else @@ -226,7 +226,7 @@ void NPairKokkos::build(NeighList *list_) if (newton_pair) { if (SIZE) { NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU if (ExecutionSpaceFromDevice::space == Device) { int team_size = atoms_per_bin*factor; int team_size_max = Kokkos::TeamPolicy(team_size,Kokkos::AUTO).team_size_max(f,Kokkos::ParallelForTag()); @@ -244,7 +244,7 @@ void NPairKokkos::build(NeighList *list_) #endif } else { NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU if (ExecutionSpaceFromDevice::space == Device) { int team_size = atoms_per_bin*factor; int team_size_max = Kokkos::TeamPolicy(team_size,Kokkos::AUTO).team_size_max(f,Kokkos::ParallelForTag()); @@ -264,7 +264,7 @@ void NPairKokkos::build(NeighList *list_) } else { if (SIZE) { NPairKokkosBuildFunctorSize f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU if (ExecutionSpaceFromDevice::space == Device) { int team_size = atoms_per_bin*factor; int team_size_max = Kokkos::TeamPolicy(team_size,Kokkos::AUTO).team_size_max(f,Kokkos::ParallelForTag()); @@ -282,7 +282,7 @@ void NPairKokkos::build(NeighList *list_) #endif } else { NPairKokkosBuildFunctor f(data,atoms_per_bin * 5 * sizeof(X_FLOAT) * factor); -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU if (ExecutionSpaceFromDevice::space == Device) { int team_size = atoms_per_bin*factor; int team_size_max = Kokkos::TeamPolicy(team_size,Kokkos::AUTO).team_size_max(f,Kokkos::ParallelForTag()); @@ -305,8 +305,7 @@ void NPairKokkos::build(NeighList *list_) if(data.h_resize()) { list->maxneighs = data.h_new_maxneighs() * 1.2; - list->k_neighbors = DAT::tdual_neighbors_2d("neighbors", list->d_neighbors.extent(0), list->maxneighs); - list->d_neighbors = list->k_neighbors.template view(); + list->d_neighbors = typename AT::t_neighbors_2d(Kokkos::NoInit("neighbors"), list->d_neighbors.extent(0), list->maxneighs); data.neigh_list.d_neighbors = list->d_neighbors; data.neigh_list.maxneighs = list->maxneighs; } @@ -321,8 +320,6 @@ void NPairKokkos::build(NeighList *list_) } list->k_ilist.template modify(); - list->k_numneigh.template modify(); - list->k_neighbors.template modify(); } /* ---------------------------------------------------------------------- */ @@ -397,7 +394,7 @@ void NeighborKokkosExecute:: int n = 0; int which = 0; int moltemplate; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; // get subview of neighbors of i @@ -431,7 +428,7 @@ void NeighborKokkosExecute:: const X_FLOAT delz = ztmp - x(j, 2); const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(i,j); /* else if (imol >= 0) */ @@ -488,7 +485,7 @@ void NeighborKokkosExecute:: const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = NeighborKokkosExecute::find_special(i,j); /* else if (imol >= 0) */ @@ -529,15 +526,33 @@ void NeighborKokkosExecute:: /* ---------------------------------------------------------------------- */ -#ifdef KOKKOS_ENABLE_CUDA -extern __shared__ X_FLOAT sharedmem[]; - -/* ---------------------------------------------------------------------- */ +#ifdef KOKKOS_ENABLE_HIP +#include +#if HIP_VERSION_MAJOR < 3 || (HIP_VERSION_MAJOR == 3 && HIP_VERSION_MINOR < 7) +// ROCm versions < 3.7 are missing __syncthreads_count, so we define a functional +// but (probably) not performant workaround +__device__ __forceinline__ int __syncthreads_count(int predicate) { + __shared__ int test_block[1]; + if (!(threadIdx.x || threadIdx.y || threadIdx.z)) + test_block[0] = 0; + __syncthreads(); + atomicAdd(test_block, predicate); + __threadfence_block(); + return test_block[0]; +} +#endif +#endif +#ifdef LMP_KOKKOS_GPU template template __device__ inline void NeighborKokkosExecute::build_ItemCuda(typename Kokkos::TeamPolicy::member_type dev) const { +#ifdef KOKKOS_ENABLE_HIP + HIP_DYNAMIC_SHARED(X_FLOAT, sharedmem); +#else + extern __shared__ X_FLOAT sharedmem[]; +#endif /* loop over atoms in i's bin, */ const int atoms_per_bin = c_bins.extent(1); @@ -614,7 +629,7 @@ void NeighborKokkosExecute::build_ItemCuda(typename Kokkos::TeamPoli const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { int which = 0; if (!moltemplate) which = NeighborKokkosExecute::find_special(i,j); @@ -692,7 +707,7 @@ void NeighborKokkosExecute::build_ItemCuda(typename Kokkos::TeamPoli const X_FLOAT rsq = delx * delx + dely * dely + delz * delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { int which = 0; if (!moltemplate) which = NeighborKokkosExecute::find_special(i,j); @@ -748,7 +763,7 @@ void NeighborKokkosExecute:: int n = 0; int which = 0; int moltemplate; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; // get subview of neighbors of i @@ -787,7 +802,7 @@ void NeighborKokkosExecute:: const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(i,j); /* else if (imol >= 0) */ @@ -971,11 +986,16 @@ void NeighborKokkosExecute:: /* ---------------------------------------------------------------------- */ -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU template template __device__ inline void NeighborKokkosExecute::build_ItemSizeCuda(typename Kokkos::TeamPolicy::member_type dev) const { +#ifdef KOKKOS_ENABLE_HIP + HIP_DYNAMIC_SHARED(X_FLOAT, sharedmem); +#else + extern __shared__ X_FLOAT sharedmem[]; +#endif /* loop over atoms in i's bin, */ const int atoms_per_bin = c_bins.extent(1); diff --git a/src/KOKKOS/npair_kokkos.h b/src/KOKKOS/npair_kokkos.h index 6ed1debf7c..be50fd6275 100644 --- a/src/KOKKOS/npair_kokkos.h +++ b/src/KOKKOS/npair_kokkos.h @@ -265,24 +265,22 @@ class NeighborKokkosExecute const typename ArrayTypes::t_int_scalar _h_resize, const typename AT::t_int_scalar _new_maxneighs, const typename ArrayTypes::t_int_scalar _h_new_maxneighs): - neigh_list(_neigh_list), cutneighsq(_cutneighsq),mbins(_mbins), + neigh_list(_neigh_list), cutneighsq(_cutneighsq),exclude(_exclude), + nex_type(_nex_type),ex1_type(_ex1_type),ex2_type(_ex2_type), + ex_type(_ex_type),nex_group(_nex_group),ex1_group(_ex1_group), + ex2_group(_ex2_group),ex1_bit(_ex1_bit),ex2_bit(_ex2_bit), + nex_mol(_nex_mol),ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit), + ex_mol_intra(_ex_mol_intra),mbins(_mbins), bincount(_bincount),c_bincount(_bincount),bins(_bins),c_bins(_bins), atom2bin(_atom2bin),c_atom2bin(_atom2bin), nstencil(_nstencil),d_stencil(_d_stencil),d_stencilxyz(_d_stencilxyz), - nlocal(_nlocal), x(_x),radius(_radius),type(_type),mask(_mask),molecule(_molecule), tag(_tag),special(_special),nspecial(_nspecial),molecular(_molecular), nbinx(_nbinx),nbiny(_nbiny),nbinz(_nbinz), mbinx(_mbinx),mbiny(_mbiny),mbinz(_mbinz), mbinxlo(_mbinxlo),mbinylo(_mbinylo),mbinzlo(_mbinzlo), bininvx(_bininvx),bininvy(_bininvy),bininvz(_bininvz), - exclude(_exclude),nex_type(_nex_type), - ex1_type(_ex1_type),ex2_type(_ex2_type),ex_type(_ex_type), - nex_group(_nex_group), - ex1_group(_ex1_group),ex2_group(_ex2_group), - ex1_bit(_ex1_bit),ex2_bit(_ex2_bit),nex_mol(_nex_mol), - ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit), - ex_mol_intra(_ex_mol_intra), + nlocal(_nlocal), xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic), xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half), skin(_skin),resize(_resize),h_resize(_h_resize), @@ -312,7 +310,7 @@ class NeighborKokkosExecute KOKKOS_FUNCTION void build_ItemSize(const int &i) const; -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU template __device__ inline void build_ItemCuda(typename Kokkos::TeamPolicy::member_type dev) const; @@ -389,7 +387,7 @@ struct NPairKokkosBuildFunctor { void operator() (const int & i) const { c.template build_Item(i); } -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU __device__ inline void operator() (typename Kokkos::TeamPolicy::member_type dev) const { @@ -415,7 +413,7 @@ struct NPairKokkosBuildFunctor { c.template build_Item(i); } - void operator() (typename Kokkos::TeamPolicy::member_type dev) const {} // Should error out + void operator() (typename Kokkos::TeamPolicy::member_type /*dev*/) const {} // Should error out }; template @@ -447,7 +445,7 @@ struct NPairKokkosBuildFunctorSize { c.template build_ItemSize(i); } -#ifdef KOKKOS_ENABLE_CUDA +#ifdef LMP_KOKKOS_GPU __device__ inline void operator() (typename Kokkos::TeamPolicy::member_type dev) const { c.template build_ItemSizeCuda(dev); @@ -471,7 +469,7 @@ struct NPairKokkosBuildFunctorSize { c.template build_ItemSize(i); } - void operator() (typename Kokkos::TeamPolicy::member_type dev) const {} // Should error out + void operator() (typename Kokkos::TeamPolicy::member_type /*dev*/) const {} // Should error out }; } diff --git a/src/KOKKOS/npair_skip_kokkos.cpp b/src/KOKKOS/npair_skip_kokkos.cpp index 13080a9580..81f78844d3 100644 --- a/src/KOKKOS/npair_skip_kokkos.cpp +++ b/src/KOKKOS/npair_skip_kokkos.cpp @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #include "npair_skip_kokkos.h" -#include "neigh_list_kokkos.h" + #include "atom_kokkos.h" -#include "atom_vec.h" -#include "error.h" #include "atom_masks.h" +#include "atom_vec.h" +#include "neigh_list_kokkos.h" using namespace LAMMPS_NS; diff --git a/src/KOKKOS/npair_ssa_kokkos.cpp b/src/KOKKOS/npair_ssa_kokkos.cpp index 55c7358042..1a4ae01901 100644 --- a/src/KOKKOS/npair_ssa_kokkos.cpp +++ b/src/KOKKOS/npair_ssa_kokkos.cpp @@ -519,14 +519,12 @@ fprintf(stdout, "Fina%03d %6d inum %6d gnum, total used %6d, allocated %6d\n" #endif list->k_ilist.template modify(); - list->k_numneigh.template modify(); - list->k_neighbors.template modify(); } template KOKKOS_INLINE_FUNCTION -void NPairSSAKokkosExecute::build_locals_onePhase(const bool firstTry, int me, int workPhase) const +void NPairSSAKokkosExecute::build_locals_onePhase(const bool firstTry, int /*me*/, int workPhase) const { const typename ArrayTypes::t_int_1d_const_um stencil = d_stencil; int which = 0; @@ -580,7 +578,7 @@ void NPairSSAKokkosExecute::build_locals_onePhase(const bool firstTr const X_FLOAT delz = ztmp - x(j, 2); const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(i,j); /* else if (imol >= 0) */ @@ -617,8 +615,8 @@ void NPairSSAKokkosExecute::build_locals_onePhase(const bool firstTr } } } - int len = inum - inum_start; #ifdef DEBUG_SSA_BUILD_LOCALS + int len = inum - inum_start; if (len != d_ssa_itemLen(workPhase, workItem + skippedItems)) { fprintf(stdout, "Leng%03d workphase (%2d,%3d,%3d): len = %4d, but ssa_itemLen = %4d%s\n" ,me @@ -708,7 +706,7 @@ void NPairSSAKokkosExecute::build_ghosts_onePhase(int workPhase) con const X_FLOAT delz = ztmp - x(j, 2); const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; if(rsq <= cutneighsq(itype,jtype)) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(j,i); /* else if (jmol >= 0) */ diff --git a/src/KOKKOS/npair_ssa_kokkos.h b/src/KOKKOS/npair_ssa_kokkos.h index 17a23b2811..b4f541cf2a 100644 --- a/src/KOKKOS/npair_ssa_kokkos.h +++ b/src/KOKKOS/npair_ssa_kokkos.h @@ -240,6 +240,13 @@ class NPairSSAKokkosExecute const int & _xperiodic, const int & _yperiodic, const int & _zperiodic, const int & _xprd_half, const int & _yprd_half, const int & _zprd_half): neigh_list(_neigh_list), cutneighsq(_cutneighsq), + exclude(_exclude),nex_type(_nex_type), + ex1_type(_ex1_type),ex2_type(_ex2_type),ex_type(_ex_type), + nex_group(_nex_group), + ex1_group(_ex1_group),ex2_group(_ex2_group), + ex1_bit(_ex1_bit),ex2_bit(_ex2_bit),nex_mol(_nex_mol), + ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit), + ex_mol_intra(_ex_mol_intra), bincount(_bincount),c_bincount(_bincount),bins(_bins),c_bins(_bins), gbincount(_gbincount),c_gbincount(_gbincount),gbins(_gbins),c_gbins(_gbins), lbinxlo(_lbinxlo),lbinxhi(_lbinxhi), @@ -247,6 +254,15 @@ class NPairSSAKokkosExecute lbinzlo(_lbinzlo),lbinzhi(_lbinzhi), nstencil(_nstencil),sx1(_sx1),sy1(_sy1),sz1(_sz1), d_stencil(_d_stencil),d_stencilxyz(_d_stencilxyz),d_nstencil_ssa(_d_nstencil_ssa), + x(_x),type(_type),mask(_mask),molecule(_molecule), + tag(_tag),special(_special),nspecial(_nspecial),molecular(_molecular), + nbinx(_nbinx),nbiny(_nbiny),nbinz(_nbinz), + mbinx(_mbinx),mbiny(_mbiny),mbinz(_mbinz), + mbinxlo(_mbinxlo),mbinylo(_mbinylo),mbinzlo(_mbinzlo), + bininvx(_bininvx),bininvy(_bininvy),bininvz(_bininvz), + nlocal(_nlocal), + xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic), + xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half), ssa_phaseCt(_ssa_phaseCt), d_ssa_phaseLen(_d_ssa_phaseLen), d_ssa_phaseOff(_d_ssa_phaseOff), @@ -255,23 +271,8 @@ class NPairSSAKokkosExecute ssa_gphaseCt(_ssa_gphaseCt), d_ssa_gphaseLen(_d_ssa_gphaseLen), d_ssa_gitemLoc(_d_ssa_gitemLoc), - d_ssa_gitemLen(_d_ssa_gitemLen), - nlocal(_nlocal), - x(_x),type(_type),mask(_mask),molecule(_molecule), - tag(_tag),special(_special),nspecial(_nspecial),molecular(_molecular), - nbinx(_nbinx),nbiny(_nbiny),nbinz(_nbinz), - mbinx(_mbinx),mbiny(_mbiny),mbinz(_mbinz), - mbinxlo(_mbinxlo),mbinylo(_mbinylo),mbinzlo(_mbinzlo), - bininvx(_bininvx),bininvy(_bininvy),bininvz(_bininvz), - exclude(_exclude),nex_type(_nex_type), - ex1_type(_ex1_type),ex2_type(_ex2_type),ex_type(_ex_type), - nex_group(_nex_group), - ex1_group(_ex1_group),ex2_group(_ex2_group), - ex1_bit(_ex1_bit),ex2_bit(_ex2_bit),nex_mol(_nex_mol), - ex_mol_group(_ex_mol_group),ex_mol_bit(_ex_mol_bit), - ex_mol_intra(_ex_mol_intra), - xperiodic(_xperiodic),yperiodic(_yperiodic),zperiodic(_zperiodic), - xprd_half(_xprd_half),yprd_half(_yprd_half),zprd_half(_zprd_half) { + d_ssa_gitemLen(_d_ssa_gitemLen) + { if (molecular == 2) moltemplate = 1; else moltemplate = 0; diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp index a6af4708d5..8f874b9feb 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.cpp @@ -48,9 +48,9 @@ PairBuckCoulCutKokkos::PairBuckCoulCutKokkos(LAMMPS *lmp):PairBuckCo execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -69,11 +69,11 @@ PairBuckCoulCutKokkos::~PairBuckCoulCutKokkos() memory->sfree(cutsq); memory->sfree(cut_ljsq); memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } } @@ -171,7 +171,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulCutKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, + const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; const F_FLOAT r = sqrt(rsq); @@ -191,7 +192,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulCutKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, + const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; const F_FLOAT r = sqrt(rsq); @@ -209,8 +211,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulCutKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); F_FLOAT forcecoul; @@ -227,8 +229,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulCutKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int& j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); diff --git a/src/KOKKOS/pair_buck_coul_cut_kokkos.h b/src/KOKKOS/pair_buck_coul_cut_kokkos.h index d026da458f..ca843df2d4 100644 --- a/src/KOKKOS/pair_buck_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_cut_kokkos.h @@ -48,7 +48,7 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut { KOKKOS_INLINE_FUNCTION params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; KOKKOS_INLINE_FUNCTION - params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; + params_buck_coul(int /*i*/){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset; }; @@ -113,12 +113,12 @@ class PairBuckCoulCutKokkos : public PairBuckCoulCut { void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairBuckCoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairBuckCoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairBuckCoulCutKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp index cdf3b0a6c1..6a13254e8a 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.cpp @@ -55,8 +55,8 @@ PairBuckCoulLongKokkos::PairBuckCoulLongKokkos(LAMMPS *lmp):PairBuck execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -75,11 +75,11 @@ PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() memory->sfree(cutsq); memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; } } @@ -88,11 +88,11 @@ PairBuckCoulLongKokkos::~PairBuckCoulLongKokkos() template void PairBuckCoulLongKokkos::cleanup_copy() { allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -184,7 +184,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulLongKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, + const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; const F_FLOAT r = sqrt(rsq); @@ -204,7 +205,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulLongKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, + const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; const F_FLOAT r = sqrt(rsq); @@ -223,8 +225,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulLongKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; @@ -261,8 +264,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairBuckCoulLongKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; diff --git a/src/KOKKOS/pair_buck_coul_long_kokkos.h b/src/KOKKOS/pair_buck_coul_long_kokkos.h index f48258c2e5..1cb407776c 100644 --- a/src/KOKKOS/pair_buck_coul_long_kokkos.h +++ b/src/KOKKOS/pair_buck_coul_long_kokkos.h @@ -49,7 +49,7 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong { KOKKOS_INLINE_FUNCTION params_buck_coul(){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; KOKKOS_INLINE_FUNCTION - params_buck_coul(int i){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; + params_buck_coul(int /*i*/){cut_ljsq=0;cut_coulsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; F_FLOAT cut_ljsq,cut_coulsq,a,c,rhoinv,buck1,buck2,offset; }; @@ -117,23 +117,23 @@ class PairBuckCoulLongKokkos : public PairBuckCoulLong { void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairBuckCoulLongKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairBuckCoulLongKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_buck_kokkos.cpp b/src/KOKKOS/pair_buck_kokkos.cpp index 71f63a9f92..efddb43a99 100644 --- a/src/KOKKOS/pair_buck_kokkos.cpp +++ b/src/KOKKOS/pair_buck_kokkos.cpp @@ -46,7 +46,7 @@ PairBuckKokkos::PairBuckKokkos(LAMMPS *lmp) : PairBuck(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -59,9 +59,9 @@ PairBuckKokkos::~PairBuckKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } diff --git a/src/KOKKOS/pair_buck_kokkos.h b/src/KOKKOS/pair_buck_kokkos.h index 815b5b2dee..ed23bf6a5b 100644 --- a/src/KOKKOS/pair_buck_kokkos.h +++ b/src/KOKKOS/pair_buck_kokkos.h @@ -47,7 +47,7 @@ class PairBuckKokkos : public PairBuck { KOKKOS_INLINE_FUNCTION params_buck(){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; KOKKOS_INLINE_FUNCTION - params_buck(int i){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; + params_buck(int /*i*/){cutsq=0;a=0;c=0;rhoinv=0;buck1=0;buck2=0;offset=0;}; F_FLOAT cutsq,a,c,rhoinv,buck1,buck2,offset; }; @@ -64,10 +64,8 @@ class PairBuckKokkos : public PairBuck { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0; - } - + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } Kokkos::DualView k_params; typename Kokkos::DualView::t_dev_const_um params; @@ -95,12 +93,12 @@ class PairBuckKokkos : public PairBuck { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairBuckKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairBuckKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairBuckKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_coul_cut_kokkos.cpp b/src/KOKKOS/pair_coul_cut_kokkos.cpp index 2047286181..a77f738a5f 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_coul_cut_kokkos.cpp @@ -37,7 +37,7 @@ PairCoulCutKokkos::PairCoulCutKokkos(LAMMPS *lmp) : PairCoulCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -55,9 +55,9 @@ template void PairCoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -144,7 +144,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairCoulCutKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); @@ -160,7 +160,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairCoulCutKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); diff --git a/src/KOKKOS/pair_coul_cut_kokkos.h b/src/KOKKOS/pair_coul_cut_kokkos.h index 78d0b192f8..d525422d2f 100644 --- a/src/KOKKOS/pair_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_coul_cut_kokkos.h @@ -48,7 +48,7 @@ class PairCoulCutKokkos : public PairCoulCut { KOKKOS_INLINE_FUNCTION params_coul(){cutsq=0,scale=0;}; KOKKOS_INLINE_FUNCTION - params_coul(int i){cutsq=0,scale=0;}; + params_coul(int /*i*/){cutsq=0,scale=0;}; F_FLOAT cutsq, scale; }; @@ -57,10 +57,8 @@ class PairCoulCutKokkos : public PairCoulCut { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_fpair(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0.0; } template KOKKOS_INLINE_FUNCTION @@ -69,10 +67,8 @@ class PairCoulCutKokkos : public PairCoulCut { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const{ - return 0; - } + F_FLOAT compute_evdwl(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } template KOKKOS_INLINE_FUNCTION @@ -117,12 +113,12 @@ class PairCoulCutKokkos : public PairCoulCut { double qqrd2e; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairCoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairCoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairCoulCutKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_coul_debye_kokkos.cpp b/src/KOKKOS/pair_coul_debye_kokkos.cpp index cddfc63b4d..b469a2b8c1 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_coul_debye_kokkos.cpp @@ -46,7 +46,7 @@ PairCoulDebyeKokkos::PairCoulDebyeKokkos(LAMMPS *lmp):PairCoulDebye( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } @@ -66,9 +66,9 @@ template void PairCoulDebyeKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -164,7 +164,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairCoulDebyeKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; @@ -187,7 +187,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairCoulDebyeKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; @@ -226,8 +226,8 @@ void PairCoulDebyeKokkos::settings(int narg, char **arg) { if (narg > 2) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set diff --git a/src/KOKKOS/pair_coul_debye_kokkos.h b/src/KOKKOS/pair_coul_debye_kokkos.h index b6e87b55f7..900613aaa0 100644 --- a/src/KOKKOS/pair_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_coul_debye_kokkos.h @@ -48,7 +48,7 @@ class PairCoulDebyeKokkos : public PairCoulDebye { KOKKOS_INLINE_FUNCTION params_coul(){cutsq=0,scale=0;}; KOKKOS_INLINE_FUNCTION - params_coul(int i){cutsq=0,scale=0;}; + params_coul(int /*i*/){cutsq=0,scale=0;}; F_FLOAT cutsq, scale; }; @@ -57,10 +57,8 @@ class PairCoulDebyeKokkos : public PairCoulDebye { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_fpair(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0.0; } template KOKKOS_INLINE_FUNCTION @@ -69,10 +67,8 @@ class PairCoulDebyeKokkos : public PairCoulDebye { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_evdwl(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } template KOKKOS_INLINE_FUNCTION @@ -117,12 +113,12 @@ class PairCoulDebyeKokkos : public PairCoulDebye { double qqrd2e; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairCoulDebyeKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairCoulDebyeKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairCoulDebyeKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_coul_long_kokkos.cpp b/src/KOKKOS/pair_coul_long_kokkos.cpp index 123763ea29..aeba50c0ad 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_coul_long_kokkos.cpp @@ -55,7 +55,7 @@ PairCoulLongKokkos::PairCoulLongKokkos(LAMMPS *lmp):PairCoulLong(lmp execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_coulsq = 0.0; } @@ -71,9 +71,9 @@ PairCoulLongKokkos::~PairCoulLongKokkos() k_cutsq = DAT::tdual_ffloat_2d(); k_cut_coulsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -82,10 +82,10 @@ PairCoulLongKokkos::~PairCoulLongKokkos() template void PairCoulLongKokkos::cleanup_copy() { allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -187,8 +187,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairCoulLongKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; @@ -225,8 +226,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairCoulLongKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; diff --git a/src/KOKKOS/pair_coul_long_kokkos.h b/src/KOKKOS/pair_coul_long_kokkos.h index 2ce7535233..590ab191a4 100644 --- a/src/KOKKOS/pair_coul_long_kokkos.h +++ b/src/KOKKOS/pair_coul_long_kokkos.h @@ -49,7 +49,7 @@ class PairCoulLongKokkos : public PairCoulLong { KOKKOS_INLINE_FUNCTION params_coul(){cut_coulsq=0;}; KOKKOS_INLINE_FUNCTION - params_coul(int i){cut_coulsq=0;}; + params_coul(int /*i*/){cut_coulsq=0;}; F_FLOAT cut_coulsq; }; @@ -58,10 +58,8 @@ class PairCoulLongKokkos : public PairCoulLong { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_fpair(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0.0; } template KOKKOS_INLINE_FUNCTION @@ -70,10 +68,8 @@ class PairCoulLongKokkos : public PairCoulLong { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_evdwl(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } template KOKKOS_INLINE_FUNCTION @@ -121,23 +117,23 @@ class PairCoulLongKokkos : public PairCoulLong { void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairCoulLongKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairCoulLongKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp index f4dc0e867c..f5e284e28a 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.cpp @@ -112,10 +112,10 @@ void PairDPDfdtEnergyKokkos::init_style() #endif } -#if defined(KOKKOS_ENABLE_CUDA) && defined(__CUDACC__) +#if (defined(KOKKOS_ENABLE_CUDA) && defined(__CUDACC__)) || defined(KOKKOS_ENABLE_HIP) // CUDA specialization of init_style to properly call rand_pool.init() template<> -void PairDPDfdtEnergyKokkos::init_style() +void PairDPDfdtEnergyKokkos::init_style() { PairDPDfdtEnergy::init_style(); @@ -125,10 +125,10 @@ void PairDPDfdtEnergyKokkos::init_style() int irequest = neighbor->nrequest - 1; neighbor->requests[irequest]-> - kokkos_host = std::is_same::value && - !std::is_same::value; + kokkos_host = std::is_same::value && + !std::is_same::value; neighbor->requests[irequest]-> - kokkos_device = std::is_same::value; + kokkos_device = std::is_same::value; if (neighflag == FULL) { neighbor->requests[irequest]->full = 1; diff --git a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h index 9d316df152..b6cf65976d 100644 --- a/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h +++ b/src/KOKKOS/pair_dpd_fdt_energy_kokkos.h @@ -90,7 +90,7 @@ class PairDPDfdtEnergyKokkos : public PairDPDfdtEnergy { KOKKOS_INLINE_FUNCTION params_dpd(){cut=0;a0=0;sigma=0;kappa=0;alpha=0;}; KOKKOS_INLINE_FUNCTION - params_dpd(int i){cut=0;a0=0;sigma=0;kappa=0;alpha=0;}; + params_dpd(int /*i*/){cut=0;a0=0;sigma=0;kappa=0;alpha=0;}; F_FLOAT cut,a0,sigma,kappa,alpha; }; diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.cpp b/src/KOKKOS/pair_eam_alloy_kokkos.cpp index 96a07628e8..724de46057 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.cpp +++ b/src/KOKKOS/pair_eam_alloy_kokkos.cpp @@ -29,7 +29,7 @@ #include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -427,8 +427,9 @@ void PairEAMAlloyKokkos::interpolate(int n, double delta, double *f, /* ---------------------------------------------------------------------- */ template -int PairEAMAlloyKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, int iswap_in, DAT::tdual_xfloat_1d &buf, - int pbc_flag, int *pbc) +int PairEAMAlloyKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, + int iswap_in, DAT::tdual_xfloat_1d &buf, + int /*pbc_flag*/, int * /*pbc*/) { d_sendlist = k_sendlist.view(); iswap = iswap_in; @@ -464,7 +465,7 @@ void PairEAMAlloyKokkos::operator()(TagPairEAMAlloyUnpackForwardComm template int PairEAMAlloyKokkos::pack_forward_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int /*pbc_flag*/, int * /*pbc*/) { int i,j; @@ -533,8 +534,8 @@ void PairEAMAlloyKokkos::operator()(TagPairEAMAlloyKernelA::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); - auto a_rho = v_rho.template access::value>(); + auto v_rho = ScatterViewHelper::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); + auto a_rho = v_rho.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -704,8 +705,8 @@ void PairEAMAlloyKokkos::operator()(TagPairEAMAlloyKernelC::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -814,11 +815,11 @@ void PairEAMAlloyKokkos::ev_tally(EV_FLOAT &ev, const int &i, const // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (EFLAG) { if (eflag_atom) { @@ -937,7 +938,7 @@ void PairEAMAlloyKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -1051,7 +1052,7 @@ void PairEAMAlloyKokkos::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/KOKKOS/pair_eam_alloy_kokkos.h b/src/KOKKOS/pair_eam_alloy_kokkos.h index 5796bdd1d4..2c4e4fdf93 100644 --- a/src/KOKKOS/pair_eam_alloy_kokkos.h +++ b/src/KOKKOS/pair_eam_alloy_kokkos.h @@ -61,7 +61,7 @@ class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMAlloyKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } void coeff(int, char **); KOKKOS_INLINE_FUNCTION @@ -129,14 +129,14 @@ class PairEAMAlloyKokkos : public PairEAM, public KokkosBase { typename ArrayTypes::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_fp; diff --git a/src/KOKKOS/pair_eam_fs_kokkos.cpp b/src/KOKKOS/pair_eam_fs_kokkos.cpp index 4f3302b455..2667c21517 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.cpp +++ b/src/KOKKOS/pair_eam_fs_kokkos.cpp @@ -29,7 +29,7 @@ #include "memory_kokkos.h" #include "error.h" #include "atom_masks.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -427,8 +427,9 @@ void PairEAMFSKokkos::interpolate(int n, double delta, double *f, t_ /* ---------------------------------------------------------------------- */ template -int PairEAMFSKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, int iswap_in, DAT::tdual_xfloat_1d &buf, - int pbc_flag, int *pbc) +int PairEAMFSKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, + int iswap_in, DAT::tdual_xfloat_1d &buf, + int /*pbc_flag*/, int * /*pbc*/) { d_sendlist = k_sendlist.view(); iswap = iswap_in; @@ -464,7 +465,7 @@ void PairEAMFSKokkos::operator()(TagPairEAMFSUnpackForwardComm, cons template int PairEAMFSKokkos::pack_forward_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int /*pbc_flag*/, int * /*pbc*/) { int i,j; @@ -533,8 +534,8 @@ void PairEAMFSKokkos::operator()(TagPairEAMFSKernelA::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); - auto a_rho = v_rho.template access::value>(); + auto v_rho = ScatterViewHelper::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); + auto a_rho = v_rho.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -704,8 +705,8 @@ void PairEAMFSKokkos::operator()(TagPairEAMFSKernelC::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -814,11 +815,11 @@ void PairEAMFSKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (EFLAG) { if (eflag_atom) { @@ -937,7 +938,7 @@ void PairEAMFSKokkos::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -1001,7 +1002,7 @@ void PairEAMFSKokkos::read_file(char *filename) ValueTokenizer values = reader.next_values(1); file->nelements = values.next_int(); - if (values.count() != file->nelements + 1) + if ((int)values.count() != file->nelements + 1) error->one(FLERR,"Incorrect element names in EAM potential file"); file->elements = new char*[file->nelements]; @@ -1054,7 +1055,7 @@ void PairEAMFSKokkos::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/KOKKOS/pair_eam_fs_kokkos.h b/src/KOKKOS/pair_eam_fs_kokkos.h index 64e1c78d56..104ecf1a0b 100644 --- a/src/KOKKOS/pair_eam_fs_kokkos.h +++ b/src/KOKKOS/pair_eam_fs_kokkos.h @@ -61,7 +61,7 @@ class PairEAMFSKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMFSKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } void coeff(int, char **); KOKKOS_INLINE_FUNCTION @@ -129,14 +129,14 @@ class PairEAMFSKokkos : public PairEAM, public KokkosBase { typename ArrayTypes::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_fp; diff --git a/src/KOKKOS/pair_eam_kokkos.cpp b/src/KOKKOS/pair_eam_kokkos.cpp index f0ac646b6b..fc3a264199 100644 --- a/src/KOKKOS/pair_eam_kokkos.cpp +++ b/src/KOKKOS/pair_eam_kokkos.cpp @@ -425,8 +425,9 @@ void PairEAMKokkos::interpolate(int n, double delta, double *f, t_ho /* ---------------------------------------------------------------------- */ template -int PairEAMKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, int iswap_in, DAT::tdual_xfloat_1d &buf, - int pbc_flag, int *pbc) +int PairEAMKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, + int iswap_in, DAT::tdual_xfloat_1d &buf, + int /*pbc_flag*/, int * /*pbc*/) { d_sendlist = k_sendlist.view(); iswap = iswap_in; @@ -462,7 +463,7 @@ void PairEAMKokkos::operator()(TagPairEAMUnpackForwardComm, const in template int PairEAMKokkos::pack_forward_comm(int n, int *list, double *buf, - int pbc_flag, int *pbc) + int /*pbc_flag*/, int * /*pbc*/) { int i,j; @@ -531,8 +532,8 @@ void PairEAMKokkos::operator()(TagPairEAMKernelA::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); - auto a_rho = v_rho.template access::value>(); + auto v_rho = ScatterViewHelper::value,decltype(dup_rho),decltype(ndup_rho)>::get(dup_rho,ndup_rho); + auto a_rho = v_rho.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -700,8 +701,8 @@ void PairEAMKokkos::operator()(TagPairEAMKernelC::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -810,11 +811,11 @@ void PairEAMKokkos::ev_tally(EV_FLOAT &ev, const int &i, const int & // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (EFLAG) { if (eflag_atom) { diff --git a/src/KOKKOS/pair_eam_kokkos.h b/src/KOKKOS/pair_eam_kokkos.h index 20bac4ed16..99719bbe5a 100644 --- a/src/KOKKOS/pair_eam_kokkos.h +++ b/src/KOKKOS/pair_eam_kokkos.h @@ -59,7 +59,7 @@ class PairEAMKokkos : public PairEAM, public KokkosBase { virtual ~PairEAMKokkos(); void compute(int, int); void init_style(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } KOKKOS_INLINE_FUNCTION void operator()(TagPairEAMPackForwardComm, const int&) const; @@ -126,14 +126,14 @@ class PairEAMKokkos : public PairEAM, public KokkosBase { typename ArrayTypes::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_rho; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_rho; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; DAT::tdual_ffloat_1d k_rho; DAT::tdual_ffloat_1d k_fp; diff --git a/src/KOKKOS/pair_exp6_rx_kokkos.cpp b/src/KOKKOS/pair_exp6_rx_kokkos.cpp index a41ef0e6d1..811589972f 100644 --- a/src/KOKKOS/pair_exp6_rx_kokkos.cpp +++ b/src/KOKKOS/pair_exp6_rx_kokkos.cpp @@ -17,7 +17,7 @@ #include "pair_exp6_rx_kokkos.h" #include -#include + #include #include "atom.h" #include "comm.h" @@ -32,7 +32,7 @@ #include "neigh_request.h" #include "atom_kokkos.h" #include "kokkos.h" -#include "utils.h" + #ifdef _OPENMP #include @@ -140,7 +140,7 @@ void PairExp6rxKokkos::init_style() template void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) { - TimerType t_start = getTimeStamp(); + //TimerType t_start = getTimeStamp(); copymode = 1; @@ -185,11 +185,11 @@ void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) // and ghost atoms. Make the parameter data persistent // and exchange like any other atom property later. - TimerType t_mix_start = getTimeStamp(); + //TimerType t_mix_start = getTimeStamp(); { const int np_total = nlocal + atom->nghost; - if (np_total > PairExp6ParamData.epsilon1.extent(0)) { + if (np_total > (int)PairExp6ParamData.epsilon1.extent(0)) { PairExp6ParamData.epsilon1 = typename AT::t_float_1d("PairExp6ParamData.epsilon1" ,np_total); PairExp6ParamData.alpha1 = typename AT::t_float_1d("PairExp6ParamData.alpha1" ,np_total); PairExp6ParamData.rm1 = typename AT::t_float_1d("PairExp6ParamData.rm1" ,np_total); @@ -258,7 +258,7 @@ void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) error->all(FLERR,"Computed fraction less than -10*DBL_EPSILON"); #endif } - TimerType t_mix_stop = getTimeStamp(); + //TimerType t_mix_stop = getTimeStamp(); k_error_flag.template modify(); k_error_flag.template sync(); @@ -309,7 +309,7 @@ void PairExp6rxKokkos::compute(int eflag_in, int vflag_in) nthreads = lmp->kokkos->nthreads; int nmax = f.extent(0); - if (nmax > t_f.extent(1)) { + if (nmax > (int)t_f.extent(1)) { t_f = t_f_array_thread("pair_exp6_rx:t_f",nthreads,nmax); t_uCG = t_efloat_1d_thread("pair_exp6_rx:t_uCG",nthreads,nmax); t_uCGnew = t_efloat_1d_thread("pair_exp6_rx:t_UCGnew",nthreads,nmax); @@ -814,7 +814,7 @@ void PairExp6rxKokkos::operator()(TagPairExp6rxComputeNoAtomics unique_token_type; unique_token_type unique_token; @@ -1156,7 +1156,7 @@ void PairExp6rxKokkos::operator()(TagPairExp6rxComputeNoAtomics::vectorized_operator(const int &ii, EV_FLOAT& Kokkos::View::value,Kokkos::MemoryTraits::value> > a_uCGnew = uCGnew; int tid = 0; -#ifndef KOKKOS_ENABLE_CUDA +#ifndef LMP_KOKKOS_GPU typedef Kokkos::Experimental::UniqueToken< DeviceType, Kokkos::Experimental::UniqueTokenScope::Global> unique_token_type; unique_token_type unique_token; @@ -1297,7 +1297,9 @@ void PairExp6rxKokkos::vectorized_operator(const int &ii, EV_FLOAT& } // reduction here. + #ifdef KOKKOS_ENABLE_PRAGMA_SIMD #pragma simd reduction(+: fx_i, fy_i, fz_i, uCG_i, uCGnew_i) reduction(|: hasError) + #endif for (int jlane = 0; jlane < niters; jlane++) { int j = neigh_j[jlane]; @@ -1568,27 +1570,26 @@ void PairExp6rxKokkos::vectorized_operator(const int &ii, EV_FLOAT& { const int j = neigh_j[jlane] & NEIGHMASK; - if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) - if (UseAtomics) - a_uCG(j) += 0.5*evdwlOld_j[jlane]; - else - t_uCG(tid,j) += 0.5*evdwlOld_j[jlane]; - - if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) - if (UseAtomics) - a_uCGnew(j) += uCGnew_j[jlane]; - else - t_uCGnew(tid,j) += uCGnew_j[jlane]; - if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) { - if (UseAtomics) - { + if (UseAtomics) { + a_uCG(j) += 0.5*evdwlOld_j[jlane]; + } else { + t_uCG(tid,j) += 0.5*evdwlOld_j[jlane]; + } + } + if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) { + if (UseAtomics) { + a_uCGnew(j) += uCGnew_j[jlane]; + } else { + t_uCGnew(tid,j) += uCGnew_j[jlane]; + } + } + if ((NEIGHFLAG==HALF || NEIGHFLAG==HALFTHREAD) && (NEWTON_PAIR || j < nlocal)) { + if (UseAtomics) { a_f(j,0) -= delx_j[jlane]*fpair_j[jlane]; a_f(j,1) -= dely_j[jlane]*fpair_j[jlane]; a_f(j,2) -= delz_j[jlane]*fpair_j[jlane]; - } - else - { + } else { t_f(tid,j,0) -= delx_j[jlane]*fpair_j[jlane]; t_f(tid,j,1) -= dely_j[jlane]*fpair_j[jlane]; t_f(tid,j,2) -= delz_j[jlane]*fpair_j[jlane]; @@ -1623,7 +1624,7 @@ void PairExp6rxKokkos::vectorized_operator(const int &ii, EV_FLOAT& t_uCGnew(tid,i) += uCGnew_i; } -#ifndef KOKKOS_ENABLE_CUDA +#ifndef LMP_KOKKOS_GPU unique_token.release(tid); #endif } @@ -1714,16 +1715,16 @@ void PairExp6rxKokkos::read_file(char *file) char **words = new char*[params_per_line+1]; memoryKK->destroy_kokkos(k_params,params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open exp6/rx potential file %s",file); error->one(FLERR,str); @@ -1740,7 +1741,7 @@ void PairExp6rxKokkos::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -1762,7 +1763,7 @@ void PairExp6rxKokkos::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -1782,7 +1783,7 @@ void PairExp6rxKokkos::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -2128,7 +2129,7 @@ void partition_range( const int begin, const int end, int &thread_begin, int &th /* ---------------------------------------------------------------------- */ -#ifndef KOKKOS_ENABLE_CUDA +#ifndef LMP_KOKKOS_GPU template template void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int errorFlag, @@ -2172,7 +2173,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int #endif // Zero out all of the terms first. + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { rm3[id] = 0.0; @@ -2192,7 +2195,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int // Compute the total number of molecules in the old and new CG particle as well as the total number of molecules in the fluid portion of the old and new CG particle for (int ispecies = 0; ispecies < nspecies; ispecies++) { + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { nTotal[id] += dvector(ispecies,id); @@ -2205,7 +2210,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int if (isOneFluidApprox(isite1) || isOneFluidApprox(isite2)) { if (isite1 == d_params[iparam].ispecies || isite2 == d_params[iparam].ispecies) continue; + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { nMoleculesOFAold[id] += dvector(ispecies+nspecies,id); @@ -2215,7 +2222,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int } // Make a reduction. + #ifdef KOKKOS_ENABLE_PRAGMA_simd #pragma omp simd reduction(+:errorFlag1) + #endif for (int id = idx_begin; id < idx_end; ++id) { if ( nTotal[id] < MY_EPSILON || nTotalold[id] < MY_EPSILON ) @@ -2233,7 +2242,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int // If Site1 matches a pure species, then grab the parameters if (isite1 == d_params[iparam].ispecies) { + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { rm1_old[id] = d_params[iparam].rm; @@ -2254,7 +2265,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int // If Site2 matches a pure species, then grab the parameters if (isite2 == d_params[iparam].ispecies) { + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { rm2_old[id] = d_params[iparam].rm; @@ -2280,7 +2293,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int const double epsiloni = d_params[iparam].epsilon; const double alphai = d_params[iparam].alpha; + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { if(nMoleculesOFA[id]::getMixingWeightsVect(const int np_total, int const double epsilonij = sqrt(epsiloni*epsilonj); const double alphaij = sqrt(alphai*alphaj); + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { double xMolej, xMolej_old; @@ -2329,7 +2346,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int if (isOneFluidApprox(isite1)) { + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { rm1[id] = cbrt(rm3[id]); @@ -2358,7 +2377,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int } if(scalingFlag == EXPONENT) { + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { exponentScaling(nMoleculesOFA[id],epsilon1[id],rm1[id]); @@ -2366,7 +2387,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int } } else if(scalingFlag == POLYNOMIAL){ + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { polynomialScaling(nMoleculesOFA[id],alpha1[id],epsilon1[id],rm1[id]); @@ -2377,7 +2400,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int if (isOneFluidApprox(isite2)) { + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { rm2[id] = cbrt(rm3[id]); @@ -2406,7 +2431,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int } if(scalingFlag == EXPONENT){ + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { exponentScaling(nMoleculesOFA[id],epsilon2[id],rm2[id]); @@ -2414,7 +2441,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int } } else if(scalingFlag == POLYNOMIAL){ + #ifdef KOKKOS_ENABLE_PRAGMA_IVDEP #pragma ivdep + #endif for (int id = idx_begin; id < idx_end; ++id) { polynomialScaling(nMoleculesOFA[id],alpha2[id],epsilon2[id],rm2[id]); @@ -2424,7 +2453,9 @@ void PairExp6rxKokkos::getMixingWeightsVect(const int np_total, int } // Check that no fractions are less than zero + #ifdef KOKKOS_ENABLE_PRAGMA_SIMD #pragma omp simd reduction(+:errorFlag2) + #endif for (int id = idx_begin; id < idx_end; ++id) { if(fraction1[id] < 0.0 || nMolecules1[id] < 0.0){ diff --git a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp index 07ef629e77..a1c376cdfa 100644 --- a/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp +++ b/src/KOKKOS/pair_gran_hooke_history_kokkos.cpp @@ -48,8 +48,8 @@ PairGranHookeHistoryKokkos::~PairGranHookeHistoryKokkos() if (allocated) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } @@ -64,7 +64,7 @@ void PairGranHookeHistoryKokkos::init_style() // it replaces FixDummy, created in the constructor // this is so its order in the fix list is preserved - if (history && fix_history == NULL) { + if (history && fix_history == nullptr) { char dnumstr[16]; sprintf(dnumstr,"%d",3); char **fixarg = new char*[4]; @@ -288,7 +288,6 @@ void PairGranHookeHistoryKokkos::operator()(TagPairGranHookeHistoryR const X_FLOAT xtmp = x(i,0); const X_FLOAT ytmp = x(i,1); const X_FLOAT ztmp = x(i,2); - const LMP_FLOAT imass = rmass[i]; const LMP_FLOAT irad = radius[i]; const int jnum = d_numneigh[i]; int count = 0; @@ -300,7 +299,6 @@ void PairGranHookeHistoryKokkos::operator()(TagPairGranHookeHistoryR const X_FLOAT dely = ytmp - x(j,1); const X_FLOAT delz = ztmp - x(j,2); const X_FLOAT rsq = delx*delx + dely*dely + delz*delz; - const LMP_FLOAT jmass = rmass[j]; const LMP_FLOAT jrad = radius[j]; const LMP_FLOAT radsum = irad + jrad; @@ -550,7 +548,7 @@ void PairGranHookeHistoryKokkos::ev_tally_xyz(EV_FLOAT &ev, int i, i template template KOKKOS_INLINE_FUNCTION -void PairGranHookeHistoryKokkos::ev_tally_xyz_atom(EV_FLOAT &ev, int i, int j, +void PairGranHookeHistoryKokkos::ev_tally_xyz_atom(EV_FLOAT & /*ev*/, int i, int j, F_FLOAT fx, F_FLOAT fy, F_FLOAT fz, X_FLOAT delx, X_FLOAT dely, X_FLOAT delz) const { diff --git a/src/KOKKOS/pair_hybrid_kokkos.cpp b/src/KOKKOS/pair_hybrid_kokkos.cpp index b5b0a9d02b..23b8401fe8 100644 --- a/src/KOKKOS/pair_hybrid_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_kokkos.cpp @@ -87,7 +87,7 @@ void PairHybridKokkos::compute(int eflag, int vflag) // check if we are running with r-RESPA using the hybrid keyword - Respa *respa = NULL; + Respa *respa = nullptr; respaflag = 0; if (strstr(update->integrate_style,"respa")) { respa = (Respa *) update->integrate; diff --git a/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp b/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp index 0cebd79c88..9c75f3abe8 100644 --- a/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp +++ b/src/KOKKOS/pair_hybrid_overlay_kokkos.cpp @@ -18,6 +18,7 @@ #include "force.h" #include "error.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -34,8 +35,8 @@ void PairHybridOverlayKokkos::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // 3rd arg = pair sub-style name // 4th arg = pair sub-style index if name used multiple times @@ -52,7 +53,7 @@ void PairHybridOverlayKokkos::coeff(int narg, char **arg) if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients"); if (!isdigit(arg[3][0])) error->all(FLERR,"Incorrect args for pair coefficients"); - int index = force->inumeric(FLERR,arg[3]); + int index = utils::inumeric(FLERR,arg[3],false,lmp); if (index == multiple[m]) break; else continue; } else break; diff --git a/src/KOKKOS/pair_kokkos.h b/src/KOKKOS/pair_kokkos.h index 06458948ef..cb55dd3141 100644 --- a/src/KOKKOS/pair_kokkos.h +++ b/src/KOKKOS/pair_kokkos.h @@ -19,7 +19,7 @@ #define LMP_PAIR_KOKKOS_H #include "Kokkos_Macros.hpp" -#include "pair.h" +#include "pair.h" // IWYU pragma: export #include "neighbor_kokkos.h" #include "neigh_list_kokkos.h" #include "Kokkos_Vectorization.hpp" @@ -51,8 +51,7 @@ struct DoCoul<1> { //Specialisation for Neighborlist types Half, HalfThread, Full template -class PairComputeFunctor { - public: +struct PairComputeFunctor { typedef typename PairStyle::device_type device_type ; typedef ArrayTypes AT; @@ -68,16 +67,16 @@ class PairComputeFunctor { // The force array is atomic for Half/Thread neighbor style //Kokkos::View::value,Kokkos::MemoryTraits::value> > f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,NeedDup::value > dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,typename NeedDup::value > dup_f; // The eatom and vatom arrays are atomic for Half/Thread neighbor style //Kokkos::View::value,Kokkos::MemoryTraits::value> > eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,NeedDup::value > dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,typename NeedDup::value > dup_eatom; //Kokkos::View::value,Kokkos::MemoryTraits::value> > vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,NeedDup::value > dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,typename NeedDup::value > dup_vatom; @@ -90,12 +89,12 @@ class PairComputeFunctor { f = c.f; d_eatom = c.d_eatom; d_vatom = c.d_vatom; - dup_f = Kokkos::Experimental::create_scatter_view::value >(c.f); - dup_eatom = Kokkos::Experimental::create_scatter_view::value >(c.d_eatom); - dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); + dup_f = Kokkos::Experimental::create_scatter_view::value >(c.f); + dup_eatom = Kokkos::Experimental::create_scatter_view::value >(c.d_eatom); + dup_vatom = Kokkos::Experimental::create_scatter_view::value >(c.d_vatom); }; - // Call cleanup_copy which sets allocations NULL which are destructed by the PairStyle + // Call cleanup_copy which sets allocations to null which are destructed by the PairStyle ~PairComputeFunctor() {c.cleanup_copy();list.copymode = 1;}; KOKKOS_INLINE_FUNCTION int sbmask(const int& j) const { @@ -119,7 +118,7 @@ class PairComputeFunctor { EV_FLOAT compute_item(const int& ii, const NeighListKokkos &list, const NoCoulTag&) const { - auto a_f = dup_f.template access::value>(); + auto a_f = dup_f.template access::value>(); EV_FLOAT ev; const int i = list.d_ilist[ii]; @@ -186,7 +185,7 @@ class PairComputeFunctor { EV_FLOAT compute_item(const int& ii, const NeighListKokkos &list, const CoulTag& ) const { - auto a_f = dup_f.template access::value>(); + auto a_f = dup_f.template access::value>(); EV_FLOAT ev; const int i = list.d_ilist[ii]; @@ -587,8 +586,8 @@ class PairComputeFunctor { const F_FLOAT &epair, const F_FLOAT &fpair, const F_FLOAT &delx, const F_FLOAT &dely, const F_FLOAT &delz) const { - auto a_eatom = dup_eatom.template access::value>(); - auto a_vatom = dup_vatom.template access::value>(); + auto a_eatom = dup_eatom.template access::value>(); + auto a_vatom = dup_vatom.template access::value>(); const int EFLAG = c.eflag; const int NEWTON_PAIR = c.newton_pair; @@ -712,7 +711,10 @@ EV_FLOAT pair_compute_neighlist (PairStyle* fpair, typename std::enable_if -int GetTeamSize(FunctorStyle& functor, int inum, int reduce_flag, int team_size, int vector_length) { +int GetTeamSize(FunctorStyle& KOKKOS_GPU_ARG(functor), int KOKKOS_GPU_ARG(inum), + int KOKKOS_GPU_ARG(reduce_flag), int team_size, int KOKKOS_GPU_ARG(vector_length)) { + +#ifdef LMP_KOKKOS_GPU int team_size_max; if (reduce_flag) @@ -720,7 +722,6 @@ int GetTeamSize(FunctorStyle& functor, int inum, int reduce_flag, int team_size, else team_size_max = Kokkos::TeamPolicy<>(inum,Kokkos::AUTO).team_size_max(functor,Kokkos::ParallelForTag()); -#ifdef LMP_KOKKOS_GPU if(team_size*vector_length > team_size_max) team_size = team_size_max/vector_length; #else diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp index c8c6e54a5f..adfe095dc5 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.cpp @@ -54,7 +54,7 @@ PairLJCharmmCoulCharmmImplicitKokkos::PairLJCharmmCoulCharmmImplicit execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -74,9 +74,9 @@ PairLJCharmmCoulCharmmImplicitKokkos::~PairLJCharmmCoulCharmmImplici memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -88,11 +88,11 @@ template void PairLJCharmmCoulCharmmImplicitKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -194,7 +194,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmImplicitKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -224,7 +224,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmImplicitKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -251,8 +251,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmImplicitKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; F_FLOAT forcecoul, switch1, switch2; @@ -277,8 +278,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmImplicitKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; F_FLOAT ecoul, switch1; diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h index 9405092716..1fb2c7724b 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_implicit_kokkos.h @@ -111,23 +111,23 @@ class PairLJCharmmCoulCharmmImplicitKokkos : public PairLJCharmmCoulCharmmImplic void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmImplicitKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmImplicitKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmImplicitKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJCharmmCoulCharmmImplicitKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmImplicitKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmImplicitKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmImplicitKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp index 62adc84ab0..a20a6242c3 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.cpp @@ -55,7 +55,7 @@ PairLJCharmmCoulCharmmKokkos::PairLJCharmmCoulCharmmKokkos(LAMMPS *l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -75,9 +75,9 @@ PairLJCharmmCoulCharmmKokkos::~PairLJCharmmCoulCharmmKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -89,11 +89,11 @@ template void PairLJCharmmCoulCharmmKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -195,7 +195,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -225,7 +225,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -252,8 +252,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); @@ -278,8 +278,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulCharmmKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); diff --git a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h index 4e00040fd9..a7e3a80840 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_charmm_kokkos.h @@ -111,23 +111,23 @@ class PairLJCharmmCoulCharmmKokkos : public PairLJCharmmCoulCharmm { void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJCharmmCoulCharmmKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulCharmmKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp index 4c122773d7..2f4a03e9b0 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.cpp @@ -55,7 +55,7 @@ PairLJCharmmCoulLongKokkos::PairLJCharmmCoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -75,9 +75,9 @@ PairLJCharmmCoulLongKokkos::~PairLJCharmmCoulLongKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -89,11 +89,11 @@ template void PairLJCharmmCoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -195,7 +195,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulLongKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -225,7 +225,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulLongKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -252,8 +252,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulLongKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; @@ -289,8 +290,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCharmmCoulLongKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; diff --git a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h index b030783401..6b76b00170 100644 --- a/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_charmm_coul_long_kokkos.h @@ -109,23 +109,23 @@ class PairLJCharmmCoulLongKokkos : public PairLJCharmmCoulLong { void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJCharmmCoulLongKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCharmmCoulLongKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp index 4317029ab9..799f1a2789 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.cpp @@ -43,9 +43,9 @@ PairLJClass2CoulCutKokkos::PairLJClass2CoulCutKokkos(LAMMPS *lmp):Pa execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -67,11 +67,11 @@ template void PairLJClass2CoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -190,8 +190,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJClass2CoulCutKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); F_FLOAT forcecoul; @@ -229,8 +230,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJClass2CoulCutKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); diff --git a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h index 991d7c9626..96623a7b24 100644 --- a/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_cut_kokkos.h @@ -105,12 +105,12 @@ class PairLJClass2CoulCutKokkos : public PairLJClass2CoulCut { double qqrd2e; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJClass2CoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJClass2CoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJClass2CoulCutKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp index 51193bf692..7fafd865c0 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.cpp @@ -51,8 +51,8 @@ PairLJClass2CoulLongKokkos::PairLJClass2CoulLongKokkos(LAMMPS *lmp): execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -74,11 +74,11 @@ template void PairLJClass2CoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -203,8 +203,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJClass2CoulLongKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; @@ -261,8 +262,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJClass2CoulLongKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; diff --git a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h index 8a2e993353..c5729697ee 100644 --- a/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_coul_long_kokkos.h @@ -109,23 +109,23 @@ class PairLJClass2CoulLongKokkos : public PairLJClass2CoulLong { double qqrd2e; void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJClass2CoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJClass2CoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJClass2CoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJClass2CoulLongKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJClass2CoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJClass2CoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJClass2CoulLongKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_class2_kokkos.cpp b/src/KOKKOS/pair_lj_class2_kokkos.cpp index a0d2fba581..6a66a8861d 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.cpp +++ b/src/KOKKOS/pair_lj_class2_kokkos.cpp @@ -46,7 +46,7 @@ PairLJClass2Kokkos::PairLJClass2Kokkos(LAMMPS *lmp) : PairLJClass2(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJClass2Kokkos::~PairLJClass2Kokkos() if (allocated) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJClass2Kokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_class2_kokkos.h b/src/KOKKOS/pair_lj_class2_kokkos.h index 4bfc44ee6f..8c40599f95 100644 --- a/src/KOKKOS/pair_lj_class2_kokkos.h +++ b/src/KOKKOS/pair_lj_class2_kokkos.h @@ -48,7 +48,7 @@ class PairLJClass2Kokkos : public PairLJClass2 { KOKKOS_INLINE_FUNCTION params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;}; KOKKOS_INLINE_FUNCTION - params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;}; + params_lj(int /*i*/){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;}; F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset; }; @@ -65,16 +65,13 @@ class PairLJClass2Kokkos : public PairLJClass2 { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, - const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { - return 0.0; - } + F_FLOAT compute_fcoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, const int& /*itype*/, + const int& /*jtype*/, const F_FLOAT& /*factor_coul*/, const F_FLOAT& /*qtmp*/) const { return 0; } Kokkos::DualView k_params; typename Kokkos::DualView::t_dev_const_um params; @@ -101,12 +98,12 @@ class PairLJClass2Kokkos : public PairLJClass2 { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJClass2Kokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJClass2Kokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJClass2Kokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp index ebfb484836..3749690b79 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.cpp @@ -42,9 +42,9 @@ PairLJCutCoulCutKokkos::PairLJCutCoulCutKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -66,11 +66,11 @@ template void PairLJCutCoulCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -163,7 +163,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulCutKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -183,8 +183,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulCutKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); F_FLOAT forcecoul; @@ -201,7 +202,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulCutKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -220,8 +221,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulCutKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); diff --git a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h index 4dd9379821..6f2de779a6 100644 --- a/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_cut_kokkos.h @@ -105,12 +105,12 @@ class PairLJCutCoulCutKokkos : public PairLJCutCoulCut { double qqrd2e; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulCutKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp index 0e5b5999cd..bd4530cf32 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.cpp @@ -46,9 +46,9 @@ PairLJCutCoulDebyeKokkos::PairLJCutCoulDebyeKokkos(LAMMPS *lmp):Pair execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; } @@ -70,11 +70,11 @@ template void PairLJCutCoulDebyeKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -170,7 +170,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDebyeKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -190,8 +190,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDebyeKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); @@ -212,7 +213,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDebyeKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -231,8 +232,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDebyeKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); @@ -275,10 +277,10 @@ void PairLJCutCoulDebyeKokkos::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[2]); + else cut_coul_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that were previously set from data file diff --git a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h index 315969bc62..bfcf48aa98 100644 --- a/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_debye_kokkos.h @@ -105,12 +105,12 @@ class PairLJCutCoulDebyeKokkos : public PairLJCutCoulDebye { double qqrd2e; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulDebyeKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulDebyeKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulDebyeKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp index 8690859cd8..47fa5cf114 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.cpp @@ -56,9 +56,9 @@ PairLJCutCoulDSFKokkos::PairLJCutCoulDSFKokkos(LAMMPS *lmp):PairLJCu execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; } @@ -80,11 +80,11 @@ template void PairLJCutCoulDSFKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - //cut_coulsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + //cut_coulsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -190,7 +190,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDSFKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -210,7 +210,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDSFKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -229,8 +229,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDSFKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r = sqrt(rsq); @@ -250,8 +251,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulDSFKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r = sqrt(rsq); const F_FLOAT prefactor = factor_coul * qqrd2e * qtmp * q(j); diff --git a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h index 558d40e174..d45591c89e 100644 --- a/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_dsf_kokkos.h @@ -104,12 +104,12 @@ class PairLJCutCoulDSFKokkos : public PairLJCutCoulDSF { double qqrd2e; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulDSFKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulDSFKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutCoulDSFKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp index 8cbfe03597..6f31a816d2 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.cpp @@ -53,8 +53,8 @@ PairLJCutCoulLongKokkos::PairLJCutCoulLongKokkos(LAMMPS *lmp):PairLJ execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_ljsq = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; cut_coulsq = 0.0; } @@ -66,8 +66,8 @@ PairLJCutCoulLongKokkos::~PairLJCutCoulLongKokkos() { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; if (allocated){ memoryKK->destroy_kokkos(k_cutsq, cutsq); memoryKK->destroy_kokkos(k_cut_ljsq, cut_ljsq); @@ -80,11 +80,11 @@ template void PairLJCutCoulLongKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_ljsq = NULL; - eatom = NULL; - vatom = NULL; - ftable = NULL; + cutsq = nullptr; + cut_ljsq = nullptr; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -184,7 +184,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulLongKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -204,8 +204,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulLongKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; @@ -241,7 +241,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulLongKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT r6inv = r2inv*r2inv*r2inv; @@ -260,8 +260,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJCutCoulLongKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { if(Specialisation::DoTable && rsq > tabinnersq) { union_int_float_t rsq_lookup; rsq_lookup.f = rsq; diff --git a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h index aba065bf0f..95210e06f7 100644 --- a/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_coul_long_kokkos.h @@ -109,23 +109,23 @@ class PairLJCutCoulLongKokkos : public PairLJCutCoulLong { double qqrd2e; void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCutCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCutCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCutCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJCutCoulLongKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJCutCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCutCoulLongKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJCutCoulLongKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_cut_kokkos.cpp b/src/KOKKOS/pair_lj_cut_kokkos.cpp index 8294d62f68..674c54fa4c 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.cpp +++ b/src/KOKKOS/pair_lj_cut_kokkos.cpp @@ -41,7 +41,7 @@ PairLJCutKokkos::PairLJCutKokkos(LAMMPS *lmp) : PairLJCut(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,9 +54,9 @@ PairLJCutKokkos::~PairLJCutKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -66,9 +66,9 @@ template void PairLJCutKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_cut_kokkos.h b/src/KOKKOS/pair_lj_cut_kokkos.h index 122aef5a1e..1bb0421b4a 100644 --- a/src/KOKKOS/pair_lj_cut_kokkos.h +++ b/src/KOKKOS/pair_lj_cut_kokkos.h @@ -48,7 +48,7 @@ class PairLJCutKokkos : public PairLJCut { KOKKOS_INLINE_FUNCTION params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;}; KOKKOS_INLINE_FUNCTION - params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;}; + params_lj(int /*i*/){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;}; F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset; }; @@ -65,10 +65,8 @@ class PairLJCutKokkos : public PairLJCut { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0; - } - + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } Kokkos::DualView k_params; typename Kokkos::DualView::t_dev_const_um params; @@ -96,12 +94,12 @@ class PairLJCutKokkos : public PairLJCut { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJCutKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_expand_kokkos.cpp b/src/KOKKOS/pair_lj_expand_kokkos.cpp index 93385b7c70..5d47e5dabe 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.cpp +++ b/src/KOKKOS/pair_lj_expand_kokkos.cpp @@ -46,7 +46,7 @@ PairLJExpandKokkos::PairLJExpandKokkos(LAMMPS *lmp) : PairLJExpand(l execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJExpandKokkos::~PairLJExpandKokkos() if (!copymode) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJExpandKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -151,7 +151,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJExpandKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, + const int& itype, const int& jtype) const { const F_FLOAT r = sqrt(rsq); const F_FLOAT rshift = r - (STACKPARAMS?m_params[itype][jtype].shift:params(itype,jtype).shift); @@ -171,7 +172,8 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJExpandKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, + const int& itype, const int& jtype) const { const F_FLOAT r = sqrt(rsq); const F_FLOAT rshift = r - (STACKPARAMS?m_params[itype][jtype].shift:params(itype,jtype).shift); diff --git a/src/KOKKOS/pair_lj_expand_kokkos.h b/src/KOKKOS/pair_lj_expand_kokkos.h index bdd0bf5870..d6a860690a 100644 --- a/src/KOKKOS/pair_lj_expand_kokkos.h +++ b/src/KOKKOS/pair_lj_expand_kokkos.h @@ -48,7 +48,7 @@ class PairLJExpandKokkos : public PairLJExpand { KOKKOS_INLINE_FUNCTION params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;}; KOKKOS_INLINE_FUNCTION - params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;}; + params_lj(int /*i*/){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;shift=0;}; F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset,shift; }; @@ -65,16 +65,13 @@ class PairLJExpandKokkos : public PairLJExpand { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0.0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, - const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { - return 0.0; - } + F_FLOAT compute_fcoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, const int& /*itype*/, + const int& /*jtype*/, const F_FLOAT& /*factor_coul*/, const F_FLOAT& /*qtmp*/) const { return 0; } Kokkos::DualView k_params; typename Kokkos::DualView::t_dev_const_um params; @@ -102,12 +99,12 @@ class PairLJExpandKokkos : public PairLJExpand { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJExpandKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJExpandKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJExpandKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp index fa9ca453a8..04d018257e 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.cpp @@ -46,7 +46,7 @@ PairLJGromacsCoulGromacsKokkos::PairLJGromacsCoulGromacsKokkos(LAMMP execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; @@ -66,9 +66,9 @@ PairLJGromacsCoulGromacsKokkos::~PairLJGromacsCoulGromacsKokkos() memory->sfree(cutsq); //memory->sfree(cut_ljsq); //memory->sfree(cut_coulsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; cut_ljsq = 0.0; cut_coulsq = 0.0; } @@ -80,11 +80,11 @@ template void PairLJGromacsCoulGromacsKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; + cutsq = nullptr; cut_ljsq = 0.0; - eatom = NULL; - vatom = NULL; - ftable = NULL; + eatom = nullptr; + vatom = nullptr; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -186,7 +186,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJGromacsCoulGromacsKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; @@ -213,7 +213,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJGromacsCoulGromacsKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; @@ -241,8 +241,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJGromacsCoulGromacsKokkos:: -compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_fcoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); @@ -264,8 +265,9 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJGromacsCoulGromacsKokkos:: -compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { +compute_ecoul(const F_FLOAT& rsq, const int& /*i*/, const int&j, + const int& /*itype*/, const int& /*jtype*/, + const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { const F_FLOAT r2inv = 1.0/rsq; const F_FLOAT rinv = sqrt(r2inv); diff --git a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h index 51fc0b71b7..fd4511c519 100644 --- a/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_coul_gromacs_kokkos.h @@ -49,7 +49,7 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs { KOKKOS_INLINE_FUNCTION params_lj_coul_gromacs(){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;}; KOKKOS_INLINE_FUNCTION - params_lj_coul_gromacs(int i){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;}; + params_lj_coul_gromacs(int /*i*/){cut_ljsq=0;cut_coulsq=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;}; F_FLOAT cut_ljsq,cut_coulsq,lj1,lj2,lj3,lj4,offset,ljsw1,ljsw2,ljsw3,ljsw4,ljsw5; }; @@ -118,23 +118,23 @@ class PairLJGromacsCoulGromacsKokkos : public PairLJGromacsCoulGromacs { void allocate(); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsCoulGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsCoulGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsCoulGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJGromacsCoulGromacsKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsCoulGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsCoulGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsCoulGromacsKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp index ed1e38a346..dacf4d977e 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.cpp +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.cpp @@ -46,9 +46,9 @@ PairLJGromacsKokkos::PairLJGromacsKokkos(LAMMPS *lmp):PairLJGromacs( execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | Q_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; } @@ -63,11 +63,11 @@ PairLJGromacsKokkos::~PairLJGromacsKokkos() k_cutsq = DAT::tdual_ffloat_2d(); k_cut_inner_sq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; } } @@ -77,11 +77,11 @@ template void PairLJGromacsKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - cut_inner = NULL; - cut_inner_sq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + cut_inner = nullptr; + cut_inner_sq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -173,7 +173,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJGromacsKokkos:: -compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, +compute_fpair(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; @@ -200,7 +200,7 @@ template template KOKKOS_INLINE_FUNCTION F_FLOAT PairLJGromacsKokkos:: -compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, +compute_evdwl(const F_FLOAT& rsq, const int& /*i*/, const int& /*j*/, const int& itype, const int& jtype) const { const F_FLOAT r2inv = 1.0/rsq; diff --git a/src/KOKKOS/pair_lj_gromacs_kokkos.h b/src/KOKKOS/pair_lj_gromacs_kokkos.h index c8c792038d..956c5df47d 100644 --- a/src/KOKKOS/pair_lj_gromacs_kokkos.h +++ b/src/KOKKOS/pair_lj_gromacs_kokkos.h @@ -48,7 +48,7 @@ class PairLJGromacsKokkos : public PairLJGromacs { KOKKOS_INLINE_FUNCTION params_lj(){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;}; KOKKOS_INLINE_FUNCTION - params_lj(int i){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;}; + params_lj(int /*i*/){cut_inner_sq=0;cut_inner=0;lj1=0;lj2=0;lj3=0;lj4=0;offset=0;ljsw1=0;ljsw2=0;ljsw3=0;ljsw4=0;ljsw5=0;}; F_FLOAT cut_inner_sq,cut_inner,lj1,lj2,lj3,lj4,offset,ljsw1,ljsw2,ljsw3,ljsw4,ljsw5; }; @@ -60,13 +60,6 @@ class PairLJGromacsKokkos : public PairLJGromacs { F_FLOAT compute_fpair(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const; - template - KOKKOS_INLINE_FUNCTION - F_FLOAT compute_fcoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, - const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const { - return 0.0; - } - template KOKKOS_INLINE_FUNCTION F_FLOAT compute_evdwl(const F_FLOAT& rsq, const int& i, const int&j, @@ -74,10 +67,13 @@ class PairLJGromacsKokkos : public PairLJGromacs { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype, const F_FLOAT& factor_coul, const F_FLOAT& qtmp) const{ - return 0.0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } + + template + KOKKOS_INLINE_FUNCTION + F_FLOAT compute_fcoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, const int& /*itype*/, + const int& /*jtype*/, const F_FLOAT& /*factor_coul*/, const F_FLOAT& /*qtmp*/) const { return 0; } Kokkos::DualView k_params; typename Kokkos::DualView >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute >(PairLJGromacsKokkos*, NeighListKokkos*); - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist >(PairLJGromacsKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.cpp b/src/KOKKOS/pair_lj_sdk_kokkos.cpp index 8b228f2c01..ddf4b4efd7 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.cpp +++ b/src/KOKKOS/pair_lj_sdk_kokkos.cpp @@ -46,7 +46,7 @@ PairLJSDKKokkos::PairLJSDKKokkos(LAMMPS *lmp) : PairLJSDK(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ PairLJSDKKokkos::~PairLJSDKKokkos() if (allocated) { k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - cutsq = NULL; + cutsq = nullptr; } } @@ -67,9 +67,9 @@ template void PairLJSDKKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_lj_sdk_kokkos.h b/src/KOKKOS/pair_lj_sdk_kokkos.h index db71dc4677..0a183051ba 100644 --- a/src/KOKKOS/pair_lj_sdk_kokkos.h +++ b/src/KOKKOS/pair_lj_sdk_kokkos.h @@ -48,7 +48,7 @@ class PairLJSDKKokkos : public PairLJSDK { KOKKOS_INLINE_FUNCTION params_lj(){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;lj_type=0;}; KOKKOS_INLINE_FUNCTION - params_lj(int i){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;lj_type=0;}; + params_lj(int /*i*/){cutsq=0,lj1=0;lj2=0;lj3=0;lj4=0;offset=0;lj_type=0;}; F_FLOAT cutsq,lj1,lj2,lj3,lj4,offset; int lj_type; }; @@ -66,9 +66,8 @@ class PairLJSDKKokkos : public PairLJSDK { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } Kokkos::DualView k_params; @@ -97,12 +96,12 @@ class PairLJSDKKokkos : public PairLJSDK { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairLJSDKKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_morse_kokkos.cpp b/src/KOKKOS/pair_morse_kokkos.cpp index ba6e9ba97d..b6cf4ed8d6 100644 --- a/src/KOKKOS/pair_morse_kokkos.cpp +++ b/src/KOKKOS/pair_morse_kokkos.cpp @@ -48,7 +48,7 @@ PairMorseKokkos::PairMorseKokkos(LAMMPS *lmp) : PairMorse(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,9 +61,9 @@ PairMorseKokkos::~PairMorseKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -73,9 +73,9 @@ template void PairMorseKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_morse_kokkos.h b/src/KOKKOS/pair_morse_kokkos.h index ff3c552437..41de06a560 100644 --- a/src/KOKKOS/pair_morse_kokkos.h +++ b/src/KOKKOS/pair_morse_kokkos.h @@ -47,7 +47,7 @@ class PairMorseKokkos : public PairMorse { KOKKOS_INLINE_FUNCTION params_morse(){cutsq=0,d0=0;alpha=0;r0=0;offset=0;} KOKKOS_INLINE_FUNCTION - params_morse(int i){cutsq=0,d0=0;alpha=0;r0=0;offset=0;} + params_morse(int /*i*/){cutsq=0,d0=0;alpha=0;r0=0;offset=0;} F_FLOAT cutsq,d0,alpha,r0,offset; }; @@ -64,9 +64,8 @@ class PairMorseKokkos : public PairMorse { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } Kokkos::DualView k_params; @@ -95,12 +94,12 @@ class PairMorseKokkos : public PairMorse { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairMorseKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairMorseKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairMorseKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp index ca609f72b7..f620d194a0 100644 --- a/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp +++ b/src/KOKKOS/pair_multi_lucy_rx_kokkos.cpp @@ -83,7 +83,7 @@ PairMultiLucyRXKokkos::~PairMultiLucyRXKokkos() delete h_table; delete d_table; - tabindex = NULL; + tabindex = nullptr; } /* ---------------------------------------------------------------------- */ @@ -175,7 +175,7 @@ void PairMultiLucyRXKokkos::compute_style(int eflag_in, int vflag_in { const int ntotal = nlocal + nghost; - if (ntotal > d_mixWtSite1.extent(0)) { + if (ntotal > (int)d_mixWtSite1.extent(0)) { d_mixWtSite1old = typename AT::t_float_1d("PairMultiLucyRX::mixWtSite1old",ntotal); d_mixWtSite2old = typename AT::t_float_1d("PairMultiLucyRX::mixWtSite2old",ntotal); d_mixWtSite1 = typename AT::t_float_1d("PairMultiLucyRX::mixWtSite1",ntotal); @@ -659,8 +659,7 @@ void PairMultiLucyRXKokkos::getMixingWeights(int id, double &mixWtSi /* ---------------------------------------------------------------------- */ template -int PairMultiLucyRXKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, int iswap_in, DAT::tdual_xfloat_1d &buf, - int pbc_flag, int *pbc) +int PairMultiLucyRXKokkos::pack_forward_comm_kokkos(int n, DAT::tdual_int_2d k_sendlist, int iswap_in, DAT::tdual_xfloat_1d &buf, int /*pbc_flag*/, int * /*pbc*/) { atomKK->sync(execution_space,DPDRHO_MASK); @@ -699,7 +698,8 @@ void PairMultiLucyRXKokkos::operator()(TagPairMultiLucyRXUnpackForwa /* ---------------------------------------------------------------------- */ template -int PairMultiLucyRXKokkos::pack_forward_comm(int n, int *list, double *buf, int pbc_flag, int *pbc) +int PairMultiLucyRXKokkos::pack_forward_comm(int n, int *list, double *buf, + int /*pbc_flag*/, int * /*pbc*/) { int i,j,m; @@ -881,15 +881,15 @@ void PairMultiLucyRXKokkos::create_kokkos_tables() h_table->innersq[i] = tb->innersq; h_table->invdelta[i] = tb->invdelta; - for(int j = 0; jrsq.extent(1); j++) + for(int j = 0; j < (int)h_table->rsq.extent(1); j++) h_table->rsq(i,j) = tb->rsq[j]; - for(int j = 0; je.extent(1); j++) + for(int j = 0; j < (int)h_table->e.extent(1); j++) h_table->e(i,j) = tb->e[j]; - for(int j = 0; jde.extent(1); j++) + for(int j = 0; j < (int)h_table->de.extent(1); j++) h_table->de(i,j) = tb->de[j]; - for(int j = 0; jf.extent(1); j++) + for(int j = 0; j < (int)h_table->f.extent(1); j++) h_table->f(i,j) = tb->f[j]; - for(int j = 0; jdf.extent(1); j++) + for(int j = 0; j < (int)h_table->df.extent(1); j++) h_table->df(i,j) = tb->df[j]; } @@ -953,7 +953,7 @@ void PairMultiLucyRXKokkos::settings(int narg, char **arg) else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -980,7 +980,7 @@ void PairMultiLucyRXKokkos::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/KOKKOS/pair_reaxc_kokkos.cpp b/src/KOKKOS/pair_reaxc_kokkos.cpp index 201167f992..d76cb98ec3 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.cpp +++ b/src/KOKKOS/pair_reaxc_kokkos.cpp @@ -16,25 +16,23 @@ ------------------------------------------------------------------------- */ #include "pair_reaxc_kokkos.h" -#include -#include -#include -#include "kokkos.h" + #include "atom_kokkos.h" +#include "atom_masks.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "neigh_list_kokkos.h" +#include "kokkos.h" #include "math_const.h" #include "math_special.h" -#include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" +#include "neigh_request.h" +#include "neighbor.h" #include "reaxc_defs.h" #include "reaxc_lookup.h" #include "reaxc_tool_box.h" +#include + #define TEAMSIZE 128 @@ -81,14 +79,14 @@ PairReaxCKokkos::~PairReaxCKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); memoryKK->destroy_kokkos(k_tmpid,tmpid); - tmpid = NULL; + tmpid = nullptr; memoryKK->destroy_kokkos(k_tmpbo,tmpbo); - tmpbo = NULL; + tmpbo = nullptr; // deallocate views of views in serial to prevent race condition in profiling tools - for (int i = 0; i < k_LR.extent(0); i++) { - for (int j = 0; j < k_LR.extent(1); j++) { + for (int i = 0; i < (int)k_LR.extent(0); i++) { + for (int j = 0; j < (int)k_LR.extent(1); j++) { k_LR.h_view(i,j).d_vdW = decltype(k_LR.h_view(i,j).d_vdW )(); k_LR.h_view(i,j).d_CEvd = decltype(k_LR.h_view(i,j).d_CEvd )(); k_LR.h_view(i,j).d_ele = decltype(k_LR.h_view(i,j).d_ele )(); @@ -139,7 +137,7 @@ void PairReaxCKokkos::init_style() { PairReaxC::init_style(); if (fix_reax) modify->delete_fix(fix_id); // not needed in the Kokkos version - fix_reax = NULL; + fix_reax = nullptr; // irequest = neigh request made by parent class @@ -1084,8 +1082,8 @@ void PairReaxCKokkos::operator()(PairReaxComputeLJCoulomb::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); F_FLOAT powr_vdw, powgi_vdw, fn13, dfn13, exp1, exp2, etmp; F_FLOAT evdwl, fvdwl; @@ -1236,8 +1234,8 @@ void PairReaxCKokkos::operator()(PairReaxComputeTabulatedLJCoulomb::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; const X_FLOAT xtmp = x(i,0); @@ -1599,18 +1597,17 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsHalf, if (d_resize_bo() || d_resize_hb()) return; - auto v_dDeltap_self = ScatterViewHelper::value,decltype(dup_dDeltap_self),decltype(ndup_dDeltap_self)>::get(dup_dDeltap_self,ndup_dDeltap_self); - auto a_dDeltap_self = v_dDeltap_self.template access::value>(); + auto v_dDeltap_self = ScatterViewHelper::value,decltype(dup_dDeltap_self),decltype(ndup_dDeltap_self)>::get(dup_dDeltap_self,ndup_dDeltap_self); + auto a_dDeltap_self = v_dDeltap_self.template access::value>(); - auto v_total_bo = ScatterViewHelper::value,decltype(dup_total_bo),decltype(ndup_total_bo)>::get(dup_total_bo,ndup_total_bo); - auto a_total_bo = v_total_bo.template access::value>(); + auto v_total_bo = ScatterViewHelper::value,decltype(dup_total_bo),decltype(ndup_total_bo)>::get(dup_total_bo,ndup_total_bo); + auto a_total_bo = v_total_bo.template access::value>(); 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], dBOp_i[3], dln_BOp_pi_i[3], dln_BOp_pi2_i[3]; @@ -1635,7 +1632,6 @@ void PairReaxCKokkos::operator()(PairReaxBuildListsHalf, 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; @@ -1825,7 +1821,6 @@ template KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxBondOrder2, const int &ii) const { - F_FLOAT delij[3]; F_FLOAT exp_p1i, exp_p2i, exp_p1j, exp_p2j, f1, f2, f3, u1_ij, u1_ji, Cf1A_ij, Cf1B_ij, Cf1_ij, Cf1_ji; F_FLOAT f4, f5, exp_f4, exp_f5, f4f5, Cf45_ij, Cf45_ji; F_FLOAT A0_ij, A1_ij, A2_ij, A3_ij, A2_ji, A3_ji; @@ -1835,10 +1830,6 @@ void PairReaxCKokkos::operator()(PairReaxBondOrder2, const int &ii) const int j_start = d_bo_first[i]; const int j_end = j_start + d_bo_num[i]; - const X_FLOAT xtmp = x(i,0); - const X_FLOAT ytmp = x(i,1); - const X_FLOAT ztmp = x(i,2); - const F_FLOAT val_i = paramssing(itype).valency; d_total_bo[i] = 0.0; @@ -1847,11 +1838,6 @@ void PairReaxCKokkos::operator()(PairReaxBondOrder2, const int &ii) 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; const int i_index = maxbo+j_index; @@ -2039,8 +2025,8 @@ template KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxComputeMulti2, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access::value>(); const int i = d_ilist[ii]; const int itype = type(i); @@ -2191,12 +2177,12 @@ template KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxComputeAngular, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access::value>(); const int i = d_ilist[ii]; const int itype = type(i); @@ -2503,13 +2489,13 @@ template KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxComputeTorsion, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access::value>(); Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; - //auto a_Cdbo = dup_Cdbo.template access::value>(); + //auto a_Cdbo = dup_Cdbo.template access::value>(); // in reaxc_torsion_angles: j = i, k = j, i = k; @@ -2655,7 +2641,6 @@ void PairReaxCKokkos::operator()(PairReaxComputeTorsion KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxComputeHydrogen, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); int hblist[MAX_BONDS]; F_FLOAT theta, cos_theta, sin_xhz4, cos_xhz1, sin_theta2; @@ -2898,7 +2883,6 @@ void PairReaxCKokkos::operator()(PairReaxComputeHydrogen::operator()(PairReaxUpdateBond, cons Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbo = d_Cdbo; Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbopi = d_Cdbopi; Kokkos::View::value,Kokkos::MemoryTraits::value> > a_Cdbopi2 = d_Cdbopi2; - //auto a_Cdbo = dup_Cdbo.template access::value>(); - //auto a_Cdbopi = dup_Cdbopi.template access::value>(); - //auto a_Cdbopi2 = dup_Cdbopi2.template access::value>(); + //auto a_Cdbo = dup_Cdbo.template access::value>(); + //auto a_Cdbopi = dup_Cdbopi.template access::value>(); + //auto a_Cdbopi2 = dup_Cdbopi2.template access::value>(); const int i = d_ilist[ii]; const tagint itag = tag(i); @@ -3079,13 +3063,12 @@ template KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxComputeBond1, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); - auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); - auto a_CdDelta = v_CdDelta.template access::value>(); + auto v_CdDelta = ScatterViewHelper::value,decltype(dup_CdDelta),decltype(ndup_CdDelta)>::get(dup_CdDelta,ndup_CdDelta); + auto a_CdDelta = v_CdDelta.template access::value>(); - F_FLOAT delij[3]; F_FLOAT p_be1, p_be2, De_s, De_p, De_pp, pow_BOs_be2, exp_be12, CEbo, ebond; const int i = d_ilist[ii]; @@ -3095,7 +3078,6 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond1::operator()(PairReaxComputeBond1 KOKKOS_INLINE_FUNCTION void PairReaxCKokkos::operator()(PairReaxComputeBond2, const int &ii, EV_FLOAT_REAX& ev) const { - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); F_FLOAT delij[3], delik[3], deljk[3], tmpvec[3]; F_FLOAT dBOp_i[3], dBOp_k[3], dln_BOp_pi[3], dln_BOp_pi2[3]; @@ -3230,10 +3192,7 @@ void PairReaxCKokkos::operator()(PairReaxComputeBond2::operator()(PairReaxComputeBond2::ev_tally(EV_FLOAT_REAX &ev, const int &i, cons // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -3486,7 +3440,7 @@ void PairReaxCKokkos::ev_tally(EV_FLOAT_REAX &ev, const int &i, cons template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::e_tally(EV_FLOAT_REAX &ev, const int &i, const int &j, +void PairReaxCKokkos::e_tally(EV_FLOAT_REAX & /*ev*/, const int &i, const int &j, const F_FLOAT &epair) const { @@ -3494,8 +3448,8 @@ void PairReaxCKokkos::e_tally(EV_FLOAT_REAX &ev, const int &i, const if (eflag_atom) { - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); const E_FLOAT epairhalf = 0.5 * epair; a_eatom[i] += epairhalf; @@ -3508,12 +3462,12 @@ void PairReaxCKokkos::e_tally(EV_FLOAT_REAX &ev, const int &i, const template template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::e_tally_single(EV_FLOAT_REAX &ev, const int &i, +void PairReaxCKokkos::e_tally_single(EV_FLOAT_REAX & /*ev*/, const int &i, const F_FLOAT &epair) const { // The eatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); a_eatom[i] += epair; } @@ -3546,8 +3500,8 @@ void PairReaxCKokkos::v_tally(EV_FLOAT_REAX &ev, const int &i, } if (vflag_atom) { - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); a_vatom(i,0) += v[0]; a_vatom(i,1) += v[1]; a_vatom(i,2) += v[2]; a_vatom(i,3) += v[3]; a_vatom(i,4) += v[4]; a_vatom(i,5) += v[5]; @@ -3564,8 +3518,8 @@ void PairReaxCKokkos::v_tally3(EV_FLOAT_REAX &ev, const int &i, cons { // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); F_FLOAT v[6]; @@ -3626,8 +3580,8 @@ void PairReaxCKokkos::v_tally4(EV_FLOAT_REAX &ev, const int &i, cons } if (vflag_atom) { - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); a_vatom(i,0) += 0.25 * v[0]; a_vatom(i,1) += 0.25 * v[1]; a_vatom(i,2) += 0.25 * v[2]; a_vatom(i,3) += 0.25 * v[3]; a_vatom(i,4) += 0.25 * v[4]; a_vatom(i,5) += 0.25 * v[5]; @@ -3645,8 +3599,9 @@ void PairReaxCKokkos::v_tally4(EV_FLOAT_REAX &ev, const int &i, cons template KOKKOS_INLINE_FUNCTION -void PairReaxCKokkos::v_tally3_atom(EV_FLOAT_REAX &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const +void PairReaxCKokkos::v_tally3_atom(EV_FLOAT_REAX &ev, const int &i, const int & /*j*/, + const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, + F_FLOAT *drji, F_FLOAT *drjk) const { F_FLOAT v[6]; @@ -3896,7 +3851,7 @@ template void PairReaxCKokkos::FindBondSpecies() { - if (nmax > k_tmpid.extent(0)) { + if (nmax > (int)k_tmpid.extent(0)) { memoryKK->destroy_kokkos(k_tmpid,tmpid); memoryKK->destroy_kokkos(k_tmpbo,tmpbo); memoryKK->create_kokkos(k_tmpid,tmpid,nmax,MAXSPECBOND,"pair:tmpid"); diff --git a/src/KOKKOS/pair_reaxc_kokkos.h b/src/KOKKOS/pair_reaxc_kokkos.h index 60865bfbe2..3e5c07cc4d 100644 --- a/src/KOKKOS/pair_reaxc_kokkos.h +++ b/src/KOKKOS/pair_reaxc_kokkos.h @@ -252,7 +252,7 @@ class PairReaxCKokkos : public PairReaxC { params_sing(){mass=0;chi=0;eta=0;r_s=0;r_pi=0;r_pi2=0;valency=0;valency_val=0;valency_e=0;valency_boc=0;nlp_opt=0; p_lp2=0;p_ovun2=0;p_ovun5=0;p_val3=0;p_val5=0;p_hbond=0;}; KOKKOS_INLINE_FUNCTION - params_sing(int i){mass=0;chi=0;eta=0;r_s=0;r_pi=0;r_pi2=0;valency=0;valency_val=0;valency_e=0;valency_boc=0;nlp_opt=0; + params_sing(int /*i*/){mass=0;chi=0;eta=0;r_s=0;r_pi=0;r_pi2=0;valency=0;valency_val=0;valency_e=0;valency_boc=0;nlp_opt=0; p_lp2=0;p_ovun2=0;p_ovun5=0;p_val3=0;p_val5=0;p_hbond=0;}; F_FLOAT mass,chi,eta,r_s,r_pi,r_pi2,valency,valency_val,valency_e,valency_boc,nlp_opt, p_lp2,p_ovun2,p_ovun5, p_val3, p_val5, p_hbond; @@ -265,7 +265,7 @@ class PairReaxCKokkos : public PairReaxC { p_boc3=0;p_boc4=0;p_boc5=0;p_be1=0,p_be2=0,De_s=0,De_p=0;De_pp=0; p_ovun1=0;}; KOKKOS_INLINE_FUNCTION - params_twbp(int i){gamma=0;gamma_w=0;alpha=0;r_vdw=0;epsilon=0;acore=0;ecore=0;rcore=0;lgre=0;lgcij=0; + params_twbp(int /*i*/){gamma=0;gamma_w=0;alpha=0;r_vdw=0;epsilon=0;acore=0;ecore=0;rcore=0;lgre=0;lgcij=0; r_s=0;r_pi=0;r_pi2=0;p_bo1=0;p_bo2=0;p_bo3=0;p_bo4=0;p_bo5=0;p_bo6=0;ovc=0;v13cor=0; p_boc3=0;p_boc4=0;p_boc5=0;p_be1=0,p_be2=0,De_s=0,De_p=0;De_pp=0; p_ovun1=0;}; @@ -279,7 +279,7 @@ class PairReaxCKokkos : public PairReaxC { KOKKOS_INLINE_FUNCTION params_thbp(){cnt=0;theta_00=0;p_val1=0;p_val2=0;p_val4=0;p_val7=0;p_pen1=0;p_coa1=0;}; KOKKOS_INLINE_FUNCTION - params_thbp(int i){cnt=0;theta_00=0;p_val1=0;p_val2=0;p_val4=0;p_val7=0;p_pen1=0;p_coa1=0;}; + params_thbp(int /*i*/){cnt=0;theta_00=0;p_val1=0;p_val2=0;p_val4=0;p_val7=0;p_pen1=0;p_coa1=0;}; F_FLOAT cnt, theta_00, p_val1, p_val2, p_val4, p_val7, p_pen1, p_coa1; }; @@ -287,7 +287,7 @@ class PairReaxCKokkos : public PairReaxC { KOKKOS_INLINE_FUNCTION params_fbp(){p_tor1=0;p_cot1=0;V1=0;V2=0;V3=0;}; KOKKOS_INLINE_FUNCTION - params_fbp(int i){p_tor1=0;p_cot1=0;V1=0;V2=0;V3=0;}; + params_fbp(int /*i*/){p_tor1=0;p_cot1=0;V1=0;V2=0;V3=0;}; F_FLOAT p_tor1, p_cot1, V1, V2, V3; }; @@ -295,7 +295,7 @@ class PairReaxCKokkos : public PairReaxC { KOKKOS_INLINE_FUNCTION params_hbp(){p_hb1=0;p_hb2=0;p_hb3=0;r0_hb=0;}; KOKKOS_INLINE_FUNCTION - params_hbp(int i){p_hb1=0;p_hb2=0;p_hb3=0;r0_hb=0;}; + params_hbp(int /*i*/){p_hb1=0;p_hb2=0;p_hb3=0;r0_hb=0;}; F_FLOAT p_hb1, p_hb2, p_hb3, r0_hb; }; @@ -386,25 +386,25 @@ class PairReaxCKokkos : public PairReaxC { typename AT::t_ffloat_2d_dl d_C1dbopi2, d_C2dbopi2, d_C3dbopi2, d_C4dbopi2; typename AT::t_ffloat_2d_dl d_Cdbo, d_Cdbopi, d_Cdbopi2, d_dDeltap_self; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_total_bo; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_CdDelta; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_dDeltap_self; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbo; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbopi; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbopi2; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_total_bo; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_CdDelta; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_dDeltap_self; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbo; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbopi; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_Cdbopi2; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_total_bo; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_CdDelta; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_dDeltap_self; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbo; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbopi; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbopi2; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_total_bo; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_CdDelta; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_dDeltap_self; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbo; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbopi; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_Cdbopi2; int need_dup; diff --git a/src/KOKKOS/pair_snap_kokkos.h b/src/KOKKOS/pair_snap_kokkos.h index a4e15fe5ce..e7a1f3173d 100644 --- a/src/KOKKOS/pair_snap_kokkos.h +++ b/src/KOKKOS/pair_snap_kokkos.h @@ -50,6 +50,7 @@ struct TagPairSNAPComputeFusedDeidrj{}; // CPU backend only struct TagPairSNAPPreUiCPU{}; struct TagPairSNAPComputeUiCPU{}; +struct TagPairSNAPTransformUiCPU{}; struct TagPairSNAPComputeZiCPU{}; struct TagPairSNAPBetaCPU{}; struct TagPairSNAPComputeBiCPU{}; @@ -104,7 +105,7 @@ public: void operator() (TagPairSNAPComputeUi,const typename Kokkos::TeamPolicy::member_type& team) const; KOKKOS_INLINE_FUNCTION - void operator() (TagPairSNAPTransformUi,const int iatom_mod, const int idxu, const int iatom_div) const; + void operator() (TagPairSNAPTransformUi,const int iatom_mod, const int j, const int iatom_div) const; KOKKOS_INLINE_FUNCTION void operator() (TagPairSNAPComputeZi,const int iatom_mod, const int idxz, const int iatom_div) const; @@ -134,15 +135,15 @@ public: KOKKOS_INLINE_FUNCTION void operator() (TagPairSNAPComputeUiCPU,const typename Kokkos::TeamPolicy::member_type& team) const; + KOKKOS_INLINE_FUNCTION + void operator() (TagPairSNAPTransformUiCPU, const int j, const int iatom) const; + KOKKOS_INLINE_FUNCTION void operator() (TagPairSNAPComputeZiCPU,const int& ii) const; KOKKOS_INLINE_FUNCTION void operator() (TagPairSNAPComputeBiCPU,const typename Kokkos::TeamPolicy::member_type& team) const; - KOKKOS_INLINE_FUNCTION - void operator() (TagPairSNAPZeroYiCPU,const typename Kokkos::TeamPolicy::member_type& team) const; - KOKKOS_INLINE_FUNCTION void operator() (TagPairSNAPComputeYiCPU,const int& ii) const; @@ -227,10 +228,10 @@ inline double dist2(double* x,double* y); typename AT::t_int_1d_randomread type; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; friend void pair_virial_fdotr_compute(PairSNAPKokkos*); diff --git a/src/KOKKOS/pair_snap_kokkos_impl.h b/src/KOKKOS/pair_snap_kokkos_impl.h index 74bc26ef17..bacb5f75d6 100644 --- a/src/KOKKOS/pair_snap_kokkos_impl.h +++ b/src/KOKKOS/pair_snap_kokkos_impl.h @@ -206,8 +206,6 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) EV_FLOAT ev; - int idxu_max = snaKK.idxu_max; - while (chunk_offset < inum) { // chunk up loop to prevent running out of memory EV_FLOAT ev_tmp; @@ -246,6 +244,13 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) Kokkos::parallel_for("ComputeUiCPU",policy_ui_cpu,*this); } + { + // Expand ulisttot -> ulisttot_full + // Zero out ylist + typename Kokkos::MDRangePolicy, Kokkos::Rank<2, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUiCPU> policy_transform_ui_cpu({0,0},{twojmax+1,chunk_size}); + Kokkos::parallel_for("TransformUiCPU",policy_transform_ui_cpu,*this); + } + //Compute bispectrum if (quadraticflag || eflag) { //ComputeZi @@ -261,20 +266,12 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) Kokkos::parallel_for("ComputeBiCPU",policy_bi_cpu,*this); } - //ZeroYi,ComputeYi + //ComputeYi { - int vector_length = vector_length_default; - int team_size = team_size_default; - //Compute beta = dE_i/dB_i for all i in list typename Kokkos::RangePolicy policy_beta(0,chunk_size); Kokkos::parallel_for("ComputeBetaCPU",policy_beta,*this); - //ZeroYi - check_team_size_for(chunk_size,team_size,vector_length); - typename Kokkos::TeamPolicy policy_zero_yi(((idxu_max+team_size-1)/team_size)*chunk_size,team_size,vector_length); - Kokkos::parallel_for("ZeroYiCPU",policy_zero_yi,*this); - //ComputeYi int idxz_max = snaKK.idxz_max; typename Kokkos::RangePolicy policy_yi_cpu(0,chunk_size*idxz_max); @@ -294,6 +291,7 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) Kokkos::parallel_for("ComputeDeidrjCPU",policy_deidrj_cpu,*this); } + } else { // GPU #ifdef LMP_KOKKOS_GPU @@ -313,10 +311,10 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) int team_size = 4; // need to cap b/c of shared memory reqs check_team_size_for(chunk_size,team_size,vector_length); - // scratch size: 2 * team_size * (twojmax+1)^2, to cover all `m1`,`m2` values + // scratch size: 2 * team_size * (twojmax+1)^2, to cover all `m1`,`m2` values, div 2 for symmetry // 2 is for double buffer - const int tile_size = (twojmax+1)*(twojmax+1); + const int tile_size = (twojmax+1)*(twojmax/2+1); typedef Kokkos::View< SNAcomplex*, Kokkos::DefaultExecutionSpace::scratch_memory_space, Kokkos::MemoryTraits > @@ -329,7 +327,7 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) Kokkos::parallel_for("ComputeUi",policy_ui,*this); //Transform data layout of ulisttot to AoSoA, zero ylist - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{32,idxu_max,(chunk_size + 32 - 1) / 32},{32,4,1}); + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformUi> policy_transform_ui({0,0,0},{32,twojmax+1,(chunk_size + 32 - 1) / 32},{32,4,1}); Kokkos::parallel_for("TransformUi",policy_transform_ui,*this); } @@ -367,7 +365,8 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) Kokkos::parallel_for("ComputeYi",policy_compute_yi,*this); //Transform data layout of ylist out of AoSoA - typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformYi> policy_transform_yi({0,0,0},{32,idxu_max,(chunk_size + 32 - 1) / 32},{32,4,1}); + const int idxu_half_max = snaKK.idxu_half_max; + typename Kokkos::MDRangePolicy, Kokkos::Rank<3, Kokkos::Iterate::Left, Kokkos::Iterate::Left>, TagPairSNAPTransformYi> policy_transform_yi({0,0,0},{32,idxu_half_max,(chunk_size + 32 - 1) / 32},{32,4,1}); Kokkos::parallel_for("TransformYi",policy_transform_yi,*this); } @@ -397,7 +396,7 @@ void PairSNAPKokkos::compute(int eflag_in, int vflag_in) } } -#endif // KOKKOS_ENABLE_CUDA +#endif // LMP_KOKKOS_GPU } @@ -608,12 +607,21 @@ void PairSNAPKokkos::operator() (TagPairSNAPComputeNeigh,const typen if ( rsq < rnd_cutsq(itype,jtype) ) { if (final) { - my_sna.rij(ii,offset,0) = dx; - my_sna.rij(ii,offset,1) = dy; - my_sna.rij(ii,offset,2) = dz; +#ifdef LMP_KOKKOS_GPU + if (!host_flag) { + my_sna.compute_cayley_klein(ii, offset, dx, dy, dz, (radi + d_radelem[elem_j])*rcutfac, + d_wjelem[elem_j]); + } else { +#endif + my_sna.rij(ii,offset,0) = dx; + my_sna.rij(ii,offset,1) = dy; + my_sna.rij(ii,offset,2) = dz; + my_sna.wj(ii,offset) = d_wjelem[elem_j]; + my_sna.rcutij(ii,offset) = (radi + d_radelem[elem_j])*rcutfac; +#ifdef LMP_KOKKOS_GPU + } +#endif my_sna.inside(ii,offset) = j; - my_sna.wj(ii,offset) = d_wjelem[elem_j]; - my_sna.rcutij(ii,offset) = (radi + d_radelem[elem_j])*rcutfac; if (chemflag) my_sna.element(ii,offset) = elem_j; else @@ -704,27 +712,54 @@ void PairSNAPKokkos::operator() (TagPairSNAPComputeUi,const typename template KOKKOS_INLINE_FUNCTION -void PairSNAPKokkos::operator() (TagPairSNAPTransformUi,const int iatom_mod, const int idxu, const int iatom_div) const { +void PairSNAPKokkos::operator() (TagPairSNAPTransformUi,const int iatom_mod, const int j, const int iatom_div) const { SNAKokkos my_sna = snaKK; const int iatom = iatom_mod + iatom_div * 32; if (iatom >= chunk_size) return; - if (idxu >= my_sna.idxu_max) return; + if (j > twojmax) return; int elem_count = chemflag ? nelements : 1; for (int ielem = 0; ielem < elem_count; ielem++) { + const int jju_half = my_sna.idxu_half_block(j); + const int jju = my_sna.idxu_block(j); - const auto utot_re = my_sna.ulisttot_re(idxu, ielem, iatom); - const auto utot_im = my_sna.ulisttot_im(idxu, ielem, iatom); + for (int mb = 0; 2*mb <= j; mb++) { + for (int ma = 0; ma <= j; ma++) { + // Extract top half - my_sna.ulisttot_pack(iatom_mod, idxu, ielem, iatom_div) = { utot_re, utot_im }; + const int idxu_shift = mb * (j + 1) + ma; + const int idxu_half = jju_half + idxu_shift; + const int idxu = jju + idxu_shift; - my_sna.ylist_pack_re(iatom_mod, idxu, ielem, iatom_div) = 0.; - my_sna.ylist_pack_im(iatom_mod, idxu, ielem, iatom_div) = 0.; + auto utot_re = my_sna.ulisttot_re(idxu_half, ielem, iatom); + auto utot_im = my_sna.ulisttot_im(idxu_half, ielem, iatom); + + // Store + my_sna.ulisttot_pack(iatom_mod, idxu, ielem, iatom_div) = { utot_re, utot_im }; + + // Also zero yi + my_sna.ylist_pack_re(iatom_mod, idxu_half, ielem, iatom_div) = 0.; + my_sna.ylist_pack_im(iatom_mod, idxu_half, ielem, iatom_div) = 0.; + + // Symmetric term + const int sign_factor = (((ma+mb)%2==0)?1:-1); + const int idxu_flip = jju + (j + 1 - mb) * (j + 1) - (ma + 1); + + if (sign_factor == 1) { + utot_im = -utot_im; + } else { + utot_re = -utot_re; + } + + my_sna.ulisttot_pack(iatom_mod, idxu_flip, ielem, iatom_div) = { utot_re, utot_im }; + + // No need to zero symmetrized ylist + } + } } - } template @@ -742,20 +777,20 @@ void PairSNAPKokkos::operator() (TagPairSNAPComputeYi,const int iato template KOKKOS_INLINE_FUNCTION -void PairSNAPKokkos::operator() (TagPairSNAPTransformYi,const int iatom_mod, const int idxu, const int iatom_div) const { +void PairSNAPKokkos::operator() (TagPairSNAPTransformYi,const int iatom_mod, const int idxu_half, const int iatom_div) const { SNAKokkos my_sna = snaKK; const int iatom = iatom_mod + iatom_div * 32; if (iatom >= chunk_size) return; - if (idxu >= my_sna.idxu_max) return; + if (idxu_half >= my_sna.idxu_half_max) return; int elem_count = chemflag ? nelements : 1; for (int ielem = 0; ielem < elem_count; ielem++) { - const auto y_re = my_sna.ylist_pack_re(iatom_mod, idxu, ielem, iatom_div); - const auto y_im = my_sna.ylist_pack_im(iatom_mod, idxu, ielem, iatom_div); + const auto y_re = my_sna.ylist_pack_re(iatom_mod, idxu_half, ielem, iatom_div); + const auto y_im = my_sna.ylist_pack_im(iatom_mod, idxu_half, ielem, iatom_div); - my_sna.ylist(idxu, ielem, iatom) = { y_re, y_im }; + my_sna.ylist(idxu_half, ielem, iatom) = { y_re, y_im }; } } @@ -904,22 +939,52 @@ void PairSNAPKokkos::operator() (TagPairSNAPComputeUiCPU,const typen template KOKKOS_INLINE_FUNCTION -void PairSNAPKokkos::operator() (TagPairSNAPZeroYiCPU,const typename Kokkos::TeamPolicy::member_type& team) const { +void PairSNAPKokkos::operator() (TagPairSNAPTransformUiCPU, const int j, const int iatom) const { SNAKokkos my_sna = snaKK; - // Extract the quantum number - const int idx = team.team_rank() + team.team_size() * (team.league_rank() % ((my_sna.idxu_max+team.team_size()-1)/team.team_size())); - if (idx >= my_sna.idxu_max) return; + if (iatom >= chunk_size) return; - // Extract the atomic index - const int ii = team.league_rank() / ((my_sna.idxu_max+team.team_size()-1)/team.team_size()); - if (ii >= chunk_size) return; + if (j > twojmax) return; - if (chemflag) - for(int ielem = 0; ielem < nelements; ielem++) - my_sna.zero_yi_cpu(idx,ii,ielem); - else - my_sna.zero_yi_cpu(idx,ii,0); + int elem_count = chemflag ? nelements : 1; + + // De-symmetrize ulisttot + for (int ielem = 0; ielem < elem_count; ielem++) { + + const int jju_half = my_sna.idxu_half_block(j); + const int jju = my_sna.idxu_block(j); + + for (int mb = 0; 2*mb <= j; mb++) { + for (int ma = 0; ma <= j; ma++) { + // Extract top half + + const int idxu_shift = mb * (j + 1) + ma; + const int idxu_half = jju_half + idxu_shift; + const int idxu = jju + idxu_shift; + + // Load ulist + auto utot = my_sna.ulisttot(idxu_half, ielem, iatom); + + // Store + my_sna.ulisttot_full(idxu, ielem, iatom) = utot; + + // Zero Yi + my_sna.ylist(idxu_half, ielem, iatom) = {0., 0.}; + + // Symmetric term + const int sign_factor = (((ma+mb)%2==0)?1:-1); + const int idxu_flip = jju + (j + 1 - mb) * (j + 1) - (ma + 1); + + if (sign_factor == 1) { + utot.im = -utot.im; + } else { + utot.re = -utot.re; + } + + my_sna.ulisttot_full(idxu_flip, ielem, iatom) = utot; + } + } + } } template @@ -991,8 +1056,8 @@ void PairSNAPKokkos::operator() (TagPairSNAPComputeForce::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); int ii = team.league_rank(); const int i = d_ilist[ii + chunk_offset]; @@ -1105,8 +1170,8 @@ void PairSNAPKokkos::v_tally_xyz(EV_FLOAT &ev, const int &i, const i { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); const E_FLOAT v0 = delx*fx; const E_FLOAT v1 = dely*fy; diff --git a/src/KOKKOS/pair_sw_kokkos.cpp b/src/KOKKOS/pair_sw_kokkos.cpp index 4b5e9eafe2..a8a79f968f 100644 --- a/src/KOKKOS/pair_sw_kokkos.cpp +++ b/src/KOKKOS/pair_sw_kokkos.cpp @@ -61,8 +61,8 @@ PairSWKokkos::~PairSWKokkos() if (!copymode) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } @@ -130,11 +130,11 @@ void PairSWKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if ((d_neighbors_short.extent(1) != max_neighs) || - (d_neighbors_short.extent(0) != ignum)) { + if (((int) d_neighbors_short.extent(1) != max_neighs) || + ((int) d_neighbors_short.extent(0) != ignum)) { d_neighbors_short = Kokkos::View("SW::neighbors_short",ignum,max_neighs); } - if (d_numneigh_short.extent(0)!=ignum) + if ((int)d_numneigh_short.extent(0)!=ignum) d_numneigh_short = Kokkos::View("SW::numneighs_short",ignum); Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); @@ -244,8 +244,8 @@ void PairSWKokkos::operator()(TagPairSWComputeHalf // The f array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); F_FLOAT delr1[3],delr2[3],fj[3],fk[3]; F_FLOAT evdwl = 0.0; @@ -387,7 +387,6 @@ void PairSWKokkos::operator()(TagPairSWComputeFullA::operator()(TagPairSWComputeFullA::ev_tally(EV_FLOAT &ev, const int &i, const int &j // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -878,11 +876,11 @@ void PairSWKokkos::ev_tally3(EV_FLOAT &ev, const int &i, const int & // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (eflag_atom) { epairthird = THIRD * (evdwl + ecoul); @@ -936,7 +934,7 @@ void PairSWKokkos::ev_tally3(EV_FLOAT &ev, const int &i, const int & template KOKKOS_INLINE_FUNCTION -void PairSWKokkos::ev_tally3_atom(EV_FLOAT &ev, const int &i, +void PairSWKokkos::ev_tally3_atom(EV_FLOAT & /*ev*/, const int &i, const F_FLOAT &evdwl, const F_FLOAT &ecoul, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drki) const { diff --git a/src/KOKKOS/pair_sw_kokkos.h b/src/KOKKOS/pair_sw_kokkos.h index 2fc7f93c12..31b7f3301d 100644 --- a/src/KOKKOS/pair_sw_kokkos.h +++ b/src/KOKKOS/pair_sw_kokkos.h @@ -135,12 +135,12 @@ class PairSWKokkos : public PairSW { typename AT::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; typename AT::t_int_1d_randomread d_type2frho; typename AT::t_int_2d_randomread d_type2rhor; diff --git a/src/KOKKOS/pair_table_kokkos.cpp b/src/KOKKOS/pair_table_kokkos.cpp index 721deb84f3..996dae5c1b 100644 --- a/src/KOKKOS/pair_table_kokkos.cpp +++ b/src/KOKKOS/pair_table_kokkos.cpp @@ -304,21 +304,21 @@ void PairTableKokkos::create_kokkos_tables() h_table->invdelta[i] = tb->invdelta; h_table->deltasq6[i] = tb->deltasq6; - for(int j = 0; jrsq.extent(1); j++) + for(int j = 0; j < (int) h_table->rsq.extent(1); j++) h_table->rsq(i,j) = tb->rsq[j]; - for(int j = 0; jdrsq.extent(1); j++) + for(int j = 0; j < (int) h_table->drsq.extent(1); j++) h_table->drsq(i,j) = tb->drsq[j]; - for(int j = 0; je.extent(1); j++) + for(int j = 0; j < (int) h_table->e.extent(1); j++) h_table->e(i,j) = tb->e[j]; - for(int j = 0; jde.extent(1); j++) + for(int j = 0; j < (int) h_table->de.extent(1); j++) h_table->de(i,j) = tb->de[j]; - for(int j = 0; jf.extent(1); j++) + for(int j = 0; j < (int) h_table->f.extent(1); j++) h_table->f(i,j) = tb->f[j]; - for(int j = 0; jdf.extent(1); j++) + for(int j = 0; j < (int) h_table->df.extent(1); j++) h_table->df(i,j) = tb->df[j]; - for(int j = 0; je2.extent(1); j++) + for(int j = 0; j < (int) h_table->e2.extent(1); j++) h_table->e2(i,j) = tb->e2[j]; - for(int j = 0; jf2.extent(1); j++) + for(int j = 0; j < (int) h_table->f2.extent(1); j++) h_table->f2(i,j) = tb->f2[j]; } @@ -428,7 +428,7 @@ void PairTableKokkos::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -462,7 +462,7 @@ void PairTableKokkos::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -522,10 +522,10 @@ template void PairTableKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - h_table=NULL; d_table=NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + h_table=nullptr; d_table=nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_table_kokkos.h b/src/KOKKOS/pair_table_kokkos.h index 2f84e6a61e..ed4e73b095 100644 --- a/src/KOKKOS/pair_table_kokkos.h +++ b/src/KOKKOS/pair_table_kokkos.h @@ -35,7 +35,7 @@ struct S_TableCompute { }; template -class PairTableComputeFunctor; +struct PairTableComputeFunctor; template class PairTableKokkos : public PairTable { @@ -132,37 +132,36 @@ class PairTableKokkos : public PairTable { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; - friend class PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; + friend struct PairComputeFunctor >; friend void pair_virial_fdotr_compute(PairTableKokkos*); }; diff --git a/src/KOKKOS/pair_table_rx_kokkos.cpp b/src/KOKKOS/pair_table_rx_kokkos.cpp index 0efef97eb5..b2b8a7d60e 100644 --- a/src/KOKKOS/pair_table_rx_kokkos.cpp +++ b/src/KOKKOS/pair_table_rx_kokkos.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_table_rx_kokkos.h" -#include + #include #include #include "kokkos.h" @@ -33,7 +33,7 @@ #include "kokkos_few.h" #include "kokkos.h" #include "modify.h" -#include "utils.h" + #include using namespace LAMMPS_NS; @@ -70,11 +70,11 @@ void getMixingWeights( nTotal = 0.0; nTotalOld = 0.0; assert(id >= 0); - assert(id < dvector.extent(1)); + assert(id < (int)dvector.extent(1)); for (int ispecies = 0; ispecies < nspecies; ++ispecies){ - assert(ispecies < dvector.extent(0)); + assert(ispecies < (int)dvector.extent(0)); nTotal += dvector(ispecies,id); - assert(ispecies+nspecies < dvector.extent(0)); + assert(ispecies+nspecies < (int)dvector.extent(0)); nTotalOld += dvector(ispecies+nspecies,id); } @@ -654,7 +654,7 @@ void PairTableRXKokkos::compute_style(int eflag_in, int vflag_in) // loop over neighbors of my atoms const int ntotal = atom->nlocal + atom->nghost; - if (ntotal > mixWtSite1.extent(0)) { + if (ntotal > (int)mixWtSite1.extent(0)) { mixWtSite1old = Kokkos::View("PairTableRXKokkos::mixWtSite1old", ntotal); mixWtSite2old = Kokkos::View("PairTableRXKokkos::mixWtSite2old", ntotal); mixWtSite1 = Kokkos::View("PairTableRXKokkos::mixWtSite1", ntotal); @@ -847,21 +847,21 @@ void PairTableRXKokkos::create_kokkos_tables() h_table->invdelta[i] = tb->invdelta; h_table->deltasq6[i] = tb->deltasq6; - for(int j = 0; jrsq.extent(1); j++) + for(int j = 0; j < (int)h_table->rsq.extent(1); j++) h_table->rsq(i,j) = tb->rsq[j]; - for(int j = 0; jdrsq.extent(1); j++) + for(int j = 0; j < (int)h_table->drsq.extent(1); j++) h_table->drsq(i,j) = tb->drsq[j]; - for(int j = 0; je.extent(1); j++) + for(int j = 0; j < (int)h_table->e.extent(1); j++) h_table->e(i,j) = tb->e[j]; - for(int j = 0; jde.extent(1); j++) + for(int j = 0; j < (int)h_table->de.extent(1); j++) h_table->de(i,j) = tb->de[j]; - for(int j = 0; jf.extent(1); j++) + for(int j = 0; j < (int)h_table->f.extent(1); j++) h_table->f(i,j) = tb->f[j]; - for(int j = 0; jdf.extent(1); j++) + for(int j = 0; j < (int)h_table->df.extent(1); j++) h_table->df(i,j) = tb->df[j]; - for(int j = 0; je2.extent(1); j++) + for(int j = 0; j < (int)h_table->e2.extent(1); j++) h_table->e2(i,j) = tb->e2[j]; - for(int j = 0; jf2.extent(1); j++) + for(int j = 0; j < (int)h_table->f2.extent(1); j++) h_table->f2(i,j) = tb->f2[j]; } @@ -971,7 +971,7 @@ void PairTableRXKokkos::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -995,7 +995,7 @@ void PairTableRXKokkos::settings(int narg, char **arg) for (int m = 0; m < ntables; m++) free_table(&tables[m]); memory->sfree(tables); ntables = 0; - tables = NULL; + tables = nullptr; if (allocated) { memory->destroy(setflag); @@ -1025,8 +1025,8 @@ void PairTableRXKokkos::coeff(int narg, char **arg) if (!rx_flag) error->all(FLERR,"PairTableRX requires a fix rx command."); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int me; MPI_Comm_rank(world,&me); @@ -1063,7 +1063,7 @@ void PairTableRXKokkos::coeff(int narg, char **arg) // set table cutoff - if (narg == 7) tb->cut = force->numeric(FLERR,arg[6]); + if (narg == 7) tb->cut = utils::numeric(FLERR,arg[6],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; @@ -1173,7 +1173,7 @@ double PairTableRXKokkos::init_one(int i, int j) template double PairTableRXKokkos::single(int i, int j, int itype, int jtype, double rsq, - double factor_coul, double factor_lj, + double /*factor_coul*/, double factor_lj, double &fforce) { int itable; @@ -1289,10 +1289,10 @@ template void PairTableRXKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; - h_table=NULL; d_table=NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; + h_table=nullptr; d_table=nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_tersoff_kokkos.cpp b/src/KOKKOS/pair_tersoff_kokkos.cpp index 910e8da4f3..6d1dea00fe 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_kokkos.cpp @@ -213,11 +213,11 @@ void PairTersoffKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if ((d_neighbors_short.extent(1) != max_neighs) || - (d_neighbors_short.extent(0) != ignum)) { + if (((int)d_neighbors_short.extent(1) != max_neighs) || + ((int)d_neighbors_short.extent(0) != ignum)) { d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum,max_neighs); } - if (d_numneigh_short.extent(0)!=ignum) + if ((int)d_numneigh_short.extent(0)!=ignum) d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum); Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); @@ -324,8 +324,8 @@ void PairTersoffKokkos::operator()(TagPairTersoffComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -1139,11 +1139,11 @@ void PairTersoffKokkos::ev_tally(EV_FLOAT &ev, const int &i, const i // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -1207,8 +1207,8 @@ void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, const int &i, const i { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); F_FLOAT v[6]; @@ -1245,8 +1245,8 @@ void PairTersoffKokkos::v_tally3(EV_FLOAT &ev, const int &i, const i template KOKKOS_INLINE_FUNCTION -void PairTersoffKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const +void PairTersoffKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, const int & /*j*/, + const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const { F_FLOAT v[6]; diff --git a/src/KOKKOS/pair_tersoff_kokkos.h b/src/KOKKOS/pair_tersoff_kokkos.h index 0c57e21a6c..9bae8df91f 100644 --- a/src/KOKKOS/pair_tersoff_kokkos.h +++ b/src/KOKKOS/pair_tersoff_kokkos.h @@ -156,7 +156,7 @@ class PairTersoffKokkos : public PairTersoff { params_ters(){powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;}; KOKKOS_INLINE_FUNCTION - params_ters(int i){powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; + params_ters(int /*i*/){powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;}; F_FLOAT powerm, gamma, lam3, c, d, h, powern, beta, lam2, bigb, bigr, bigd, lam1, biga, cutsq, c1, c2, c3, c4; @@ -202,12 +202,12 @@ class PairTersoffKokkos : public PairTersoff { typename ArrayTypes::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; typedef Kokkos::DualView tdual_ffloat_2d_n7; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp index d51983bfc8..581cb3e7f9 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.cpp @@ -213,11 +213,11 @@ void PairTersoffMODKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if ((d_neighbors_short.extent(1) != max_neighs) || - (d_neighbors_short.extent(0) != ignum)) { + if (((int)d_neighbors_short.extent(1) != max_neighs) || + ((int)d_neighbors_short.extent(0) != ignum)) { d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum,max_neighs); } - if (d_numneigh_short.extent(0)!=ignum) + if ((int)d_numneigh_short.extent(0)!=ignum) d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum); Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); @@ -324,8 +324,8 @@ void PairTersoffMODKokkos::operator()(TagPairTersoffMODComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -1142,11 +1142,11 @@ void PairTersoffMODKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -1210,8 +1210,8 @@ void PairTersoffMODKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); F_FLOAT v[6]; @@ -1248,8 +1248,10 @@ void PairTersoffMODKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons template KOKKOS_INLINE_FUNCTION -void PairTersoffMODKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const +void PairTersoffMODKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, + const int & /*j*/, const int & /*k*/, + F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, + F_FLOAT *drjk) const { F_FLOAT v[6]; diff --git a/src/KOKKOS/pair_tersoff_mod_kokkos.h b/src/KOKKOS/pair_tersoff_mod_kokkos.h index b47f11e029..4d541c0446 100644 --- a/src/KOKKOS/pair_tersoff_mod_kokkos.h +++ b/src/KOKKOS/pair_tersoff_mod_kokkos.h @@ -156,7 +156,7 @@ class PairTersoffMODKokkos : public PairTersoffMOD { params_ters(){powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0; lam1=0;biga=0;powern_del=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;c5=0;ca1=0;ca4=0;}; KOKKOS_INLINE_FUNCTION - params_ters(int i){powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0; + params_ters(int /*i*/){powerm=0;lam3=0;h=0;powern=0;beta=0;lam2=0;bigb=0;bigr=0;bigd=0; lam1=0;biga=0;powern_del=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;c5=0;ca1=0;ca4=0;}; F_FLOAT powerm, lam3, h, powern, beta, lam2, bigb, bigr, bigd, lam1, biga, powern_del, cutsq, c1, c2, c3, c4, c5, ca1, ca4; @@ -202,12 +202,12 @@ class PairTersoffMODKokkos : public PairTersoffMOD { typename ArrayTypes::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; typedef Kokkos::DualView tdual_ffloat_2d_n7; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp index 9c8bb6e1a5..2610a63385 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.cpp @@ -229,11 +229,11 @@ void PairTersoffZBLKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if ((d_neighbors_short.extent(1) != max_neighs) || - (d_neighbors_short.extent(0) != ignum)) { + if (((int)d_neighbors_short.extent(1) != max_neighs) || + ((int)d_neighbors_short.extent(0) != ignum)) { d_neighbors_short = Kokkos::View("Tersoff::neighbors_short",ignum,max_neighs); } - if (d_numneigh_short.extent(0)!=ignum) + if ((int)d_numneigh_short.extent(0)!=ignum) d_numneigh_short = Kokkos::View("Tersoff::numneighs_short",ignum); Kokkos::parallel_for(Kokkos::RangePolicy(0,neighflag==FULL?ignum:inum), *this); @@ -340,8 +340,8 @@ void PairTersoffZBLKokkos::operator()(TagPairTersoffZBLComputeHalf::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); - auto a_f = v_f.template access::value>(); + auto v_f = ScatterViewHelper::value,decltype(dup_f),decltype(ndup_f)>::get(dup_f,ndup_f); + auto a_f = v_f.template access::value>(); const int i = d_ilist[ii]; if (i >= nlocal) return; @@ -1238,11 +1238,11 @@ void PairTersoffZBLKokkos::ev_tally(EV_FLOAT &ev, const int &i, cons // The eatom and vatom arrays are duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); - auto a_eatom = v_eatom.template access::value>(); + auto v_eatom = ScatterViewHelper::value,decltype(dup_eatom),decltype(ndup_eatom)>::get(dup_eatom,ndup_eatom); + auto a_eatom = v_eatom.template access::value>(); - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); if (eflag_atom) { const E_FLOAT epairhalf = 0.5 * epair; @@ -1306,8 +1306,8 @@ void PairTersoffZBLKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons { // The vatom array is duplicated for OpenMP, atomic for CUDA, and neither for Serial - auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); - auto a_vatom = v_vatom.template access::value>(); + auto v_vatom = ScatterViewHelper::value,decltype(dup_vatom),decltype(ndup_vatom)>::get(dup_vatom,ndup_vatom); + auto a_vatom = v_vatom.template access::value>(); F_FLOAT v[6]; @@ -1344,8 +1344,9 @@ void PairTersoffZBLKokkos::v_tally3(EV_FLOAT &ev, const int &i, cons template KOKKOS_INLINE_FUNCTION -void PairTersoffZBLKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, const int &j, const int &k, - F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drjk) const +void PairTersoffZBLKokkos::v_tally3_atom(EV_FLOAT &ev, const int &i, const int & /*j*/, + const int & /*k*/, F_FLOAT *fj, F_FLOAT *fk, + F_FLOAT *drji, F_FLOAT *drjk) const { F_FLOAT v[6]; diff --git a/src/KOKKOS/pair_tersoff_zbl_kokkos.h b/src/KOKKOS/pair_tersoff_zbl_kokkos.h index bed2564da5..fccbca7f46 100644 --- a/src/KOKKOS/pair_tersoff_zbl_kokkos.h +++ b/src/KOKKOS/pair_tersoff_zbl_kokkos.h @@ -155,7 +155,7 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { params_ters(){powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;Z_i=0;Z_j=0;ZBLcut=0;ZBLexpscale=0;}; KOKKOS_INLINE_FUNCTION - params_ters(int i){powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; + params_ters(int /*i*/){powerm=0;gamma=0;lam3=0;c=0;d=0;h=0;powern=0;beta=0;lam2=0;bigb=0; bigr=0;bigd=0;lam1=0;biga=0;cutsq=0;c1=0;c2=0;c3=0;c4=0;Z_i=0;Z_j=0;ZBLcut=0;ZBLexpscale=0;}; F_FLOAT powerm, gamma, lam3, c, d, h, powern, beta, lam2, bigb, bigr, bigd, lam1, biga, cutsq, c1, c2, c3, c4, Z_i, Z_j, ZBLcut, ZBLexpscale; @@ -207,12 +207,12 @@ class PairTersoffZBLKokkos : public PairTersoffZBL { typename ArrayTypes::t_virial_array d_vatom; int need_dup; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; - Kokkos::Experimental::ScatterView::value,Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterDuplicated> dup_vatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_f; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_eatom; + Kokkos::Experimental::ScatterView::value,typename Kokkos::Experimental::ScatterSum,Kokkos::Experimental::ScatterNonDuplicated> ndup_vatom; typedef Kokkos::DualView tdual_ffloat_2d_n7; typedef typename tdual_ffloat_2d_n7::t_dev_const_randomread t_ffloat_2d_n7_randomread; diff --git a/src/KOKKOS/pair_vashishta_kokkos.cpp b/src/KOKKOS/pair_vashishta_kokkos.cpp index 47ffe64105..106422a234 100644 --- a/src/KOKKOS/pair_vashishta_kokkos.cpp +++ b/src/KOKKOS/pair_vashishta_kokkos.cpp @@ -16,20 +16,21 @@ ------------------------------------------------------------------------- */ #include "pair_vashishta_kokkos.h" -#include -#include -#include "kokkos.h" -#include "pair_kokkos.h" + #include "atom_kokkos.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" +#include "atom_masks.h" #include "comm.h" +#include "error.h" +#include "force.h" +#include "kokkos.h" +#include "math_const.h" #include "memory_kokkos.h" #include "neigh_list_kokkos.h" -#include "error.h" -#include "atom_masks.h" -#include "math_const.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -60,8 +61,8 @@ PairVashishtaKokkos::~PairVashishtaKokkos() if (!copymode) { memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } } @@ -116,20 +117,20 @@ void PairVashishtaKokkos::compute(int eflag_in, int vflag_in) int max_neighs = d_neighbors.extent(1); - if ((d_neighbors_short_2body.extent(1) != max_neighs) || - (d_neighbors_short_2body.extent(0) != ignum)) { + if (((int)d_neighbors_short_2body.extent(1) != max_neighs) || + ((int)d_neighbors_short_2body.extent(0) != ignum)) { d_neighbors_short_2body = Kokkos::View("Vashishta::neighbors_short_2body",ignum,max_neighs); } - if (d_numneigh_short_2body.extent(0)!=ignum) { + if ((int)d_numneigh_short_2body.extent(0)!=ignum) { d_numneigh_short_2body = Kokkos::View("Vashishta::numneighs_short_2body",ignum); } - if ((d_neighbors_short_3body.extent(1) != max_neighs) || - (d_neighbors_short_3body.extent(0) != ignum)) { + if (((int)d_neighbors_short_3body.extent(1) != max_neighs) || + ((int)d_neighbors_short_3body.extent(0) != ignum)) { d_neighbors_short_3body = Kokkos::View("Vashishta::neighbors_short_3body",ignum,max_neighs); } - if (d_numneigh_short_3body.extent(0)!=ignum) { + if ((int)d_numneigh_short_3body.extent(0)!=ignum) { d_numneigh_short_3body = Kokkos::View("Vashishta::numneighs_short_3body",ignum); } @@ -372,7 +373,6 @@ void PairVashishtaKokkos::operator()(TagPairVashishtaComputeFullA::operator()(TagPairVashishtaComputeFullA::ev_tally3(EV_FLOAT &ev, const int &i, cons template KOKKOS_INLINE_FUNCTION -void PairVashishtaKokkos::ev_tally3_atom(EV_FLOAT &ev, const int &i, +void PairVashishtaKokkos::ev_tally3_atom(EV_FLOAT & /*ev*/, const int &i, const F_FLOAT &evdwl, const F_FLOAT &ecoul, F_FLOAT *fj, F_FLOAT *fk, F_FLOAT *drji, F_FLOAT *drki) const { diff --git a/src/KOKKOS/pair_yukawa_kokkos.cpp b/src/KOKKOS/pair_yukawa_kokkos.cpp index 71236c807c..03deb1ecf8 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.cpp +++ b/src/KOKKOS/pair_yukawa_kokkos.cpp @@ -45,7 +45,7 @@ PairYukawaKokkos::PairYukawaKokkos(LAMMPS *lmp) : PairYukawa(lmp) execution_space = ExecutionSpaceFromDevice::space; datamask_read = X_MASK | F_MASK | TYPE_MASK | ENERGY_MASK | VIRIAL_MASK; datamask_modify = F_MASK | ENERGY_MASK | VIRIAL_MASK; - cutsq = NULL; + cutsq = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,9 +58,9 @@ PairYukawaKokkos::~PairYukawaKokkos() memoryKK->destroy_kokkos(k_vatom,vatom); k_cutsq = DAT::tdual_ffloat_2d(); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -70,9 +70,9 @@ template void PairYukawaKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KOKKOS/pair_yukawa_kokkos.h b/src/KOKKOS/pair_yukawa_kokkos.h index f24298d415..5e2a1e53e8 100644 --- a/src/KOKKOS/pair_yukawa_kokkos.h +++ b/src/KOKKOS/pair_yukawa_kokkos.h @@ -47,7 +47,7 @@ class PairYukawaKokkos : public PairYukawa { KOKKOS_INLINE_FUNCTION params_yukawa(){ cutsq=0, a = 0; offset = 0; } KOKKOS_INLINE_FUNCTION - params_yukawa(int i){ cutsq=0, a = 0; offset = 0; } + params_yukawa(int /*i*/){ cutsq=0, a = 0; offset = 0; } F_FLOAT cutsq, a, offset; }; @@ -67,11 +67,8 @@ class PairYukawaKokkos : public PairYukawa { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, - const int& itype, const int& jtype) const - { - return 0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } Kokkos::DualView k_params; @@ -100,12 +97,12 @@ class PairYukawaKokkos : public PairYukawa { int nlocal,nall,eflag,vflag; void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist( PairYukawaKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist( diff --git a/src/KOKKOS/pair_zbl_kokkos.cpp b/src/KOKKOS/pair_zbl_kokkos.cpp index 8b583a75f7..796dd52116 100644 --- a/src/KOKKOS/pair_zbl_kokkos.cpp +++ b/src/KOKKOS/pair_zbl_kokkos.cpp @@ -60,9 +60,9 @@ PairZBLKokkos::~PairZBLKokkos() memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); memory->sfree(cutsq); - eatom = NULL; - vatom = NULL; - cutsq = NULL; + eatom = nullptr; + vatom = nullptr; + cutsq = nullptr; } } @@ -416,9 +416,9 @@ template void PairZBLKokkos::cleanup_copy() { // WHY needed: this prevents parent copy from deallocating any arrays allocated = 0; - cutsq = NULL; - eatom = NULL; - vatom = NULL; + cutsq = nullptr; + eatom = nullptr; + vatom = nullptr; } namespace LAMMPS_NS { diff --git a/src/KOKKOS/pair_zbl_kokkos.h b/src/KOKKOS/pair_zbl_kokkos.h index ce3fe58640..e5332af4a9 100644 --- a/src/KOKKOS/pair_zbl_kokkos.h +++ b/src/KOKKOS/pair_zbl_kokkos.h @@ -83,19 +83,18 @@ class PairZBLKokkos : public PairZBL { template KOKKOS_INLINE_FUNCTION - F_FLOAT compute_ecoul(const F_FLOAT& rsq, const int& i, const int&j, const int& itype, const int& jtype) const { - return 0; - } + F_FLOAT compute_ecoul(const F_FLOAT& /*rsq*/, const int& /*i*/, const int& /*j*/, + const int& /*itype*/, const int& /*jtype*/) const { return 0; } void cleanup_copy(); void allocate(); - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; - friend class PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; + friend struct PairComputeFunctor; friend EV_FLOAT pair_compute_neighlist(PairZBLKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairZBLKokkos*,NeighListKokkos*); friend EV_FLOAT pair_compute_neighlist(PairZBLKokkos*,NeighListKokkos*); diff --git a/src/KOKKOS/pppm_kokkos.cpp b/src/KOKKOS/pppm_kokkos.cpp index 743f2daec9..9d9a26897f 100644 --- a/src/KOKKOS/pppm_kokkos.cpp +++ b/src/KOKKOS/pppm_kokkos.cpp @@ -16,26 +16,22 @@ ------------------------------------------------------------------------- */ #include "pppm_kokkos.h" -#include -#include -#include "atom_kokkos.h" -#include "comm.h" -#include "gridcomm_kokkos.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" -#include "domain.h" -#include "fft3d_kokkos.h" -#include "remap_kokkos.h" -#include "memory_kokkos.h" -#include "error.h" -#include "atom_masks.h" -#include "kokkos.h" -#include "utils.h" -#include "fmt/format.h" +#include "atom_kokkos.h" +#include "atom_masks.h" +#include "domain.h" +#include "error.h" +#include "fft3d_kokkos.h" +#include "force.h" +#include "gridcomm_kokkos.h" +#include "kokkos.h" #include "math_const.h" #include "math_special_kokkos.h" +#include "memory_kokkos.h" +#include "pair.h" +#include "remap_kokkos.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -81,26 +77,25 @@ PPPMKokkos::PPPMKokkos(LAMMPS *lmp) : PPPM(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - //density_brick = d_vdx_brick = d_vdy_brick = d_vdz_brick = NULL; - //d_density_fft = NULL; - //d_u_brick = NULL; - //d_v0_brick = d_v1_brick = d_v2_brick = d_v3_brick = d_v4_brick = d_v5_brick = NULL; - //greensfn = NULL; - //d_work1 = d_work2 = NULL; - //vg = NULL; - //d_fkx = d_fky = d_fkz = NULL; + //density_brick = d_vdx_brick = d_vdy_brick = d_vdz_brick = nullptr; + //d_density_fft = nullptr; + //d_u_brick = nullptr; + //d_v0_brick = d_v1_brick = d_v2_brick = d_v3_brick = d_v4_brick = d_v5_brick = nullptr; + //greensfn = nullptr; + //d_work1 = d_work2 = nullptr; + //vg = nullptr; + //d_fkx = d_fky = d_fkz = nullptr; - //gf_b = NULL; - //rho1d = rho_coeff = drho1d = drho_coeff = NULL; + //gf_b = nullptr; + //rho1d = rho_coeff = drho1d = drho_coeff = nullptr; - fft1 = fft2 = NULL; - remap = NULL; - cg = NULL; - cg_peratom = NULL; + fft1 = fft2 = nullptr; + remap = nullptr; + gc = nullptr; nmax = 0; - //part2grid = NULL; + //part2grid = nullptr; peratom_allocate_flag = 0; @@ -145,7 +140,7 @@ template void PPPMKokkos::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/kk command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- @@ -165,8 +160,8 @@ PPPMKokkos::~PPPMKokkos() memoryKK->destroy_kokkos(k_eatom,eatom); memoryKK->destroy_kokkos(k_vatom,vatom); - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; } /* ---------------------------------------------------------------------- @@ -192,9 +187,6 @@ void PPPMKokkos::init() "slab correction"); if (domain->dimension == 2) error->all(FLERR, "Cannot use PPPM with 2d simulation"); - if (comm->style != 0) - error->universe_all(FLERR,"PPPM can only currently be used with " - "comm_style brick"); if (!atomKK->q_flag) error->all(FLERR,"Kspace style requires atom attribute q"); @@ -220,7 +212,7 @@ void PPPMKokkos::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -255,9 +247,7 @@ void PPPMKokkos::init() // or overlap is allowed, then done // else reduce order and try again - int (*procneigh)[2] = comm->procneigh; - - GridCommKokkos *cgtmp = NULL; + GridCommKokkos *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -269,24 +259,23 @@ void PPPMKokkos::init() set_grid_local(); if (overlap_allowed) break; - cgtmp = new GridCommKokkos(lmp,world,1,1, + gctmp = new GridCommKokkos(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - cgtmp->ghost_notify(); - if (!cgtmp->ghost_overlap()) break; - delete cgtmp; + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + int tmp1,tmp2; + gctmp->setup(tmp1,tmp2); + if (!gctmp->ghost_adjacent()) break; + delete gctmp; order--; iteration++; } if (order < minorder) error->all(FLERR,"PPPM order < minimum allowed order"); - if (!overlap_allowed && cgtmp->ghost_overlap()) + if (!overlap_allowed && gctmp->ghost_adjacent()) error->all(FLERR,"PPPM grid stencil extends " "beyond nearest neighbor processor"); - if (cgtmp) delete cgtmp; + if (gctmp) delete gctmp; // adjust g_ewald @@ -320,8 +309,6 @@ void PPPMKokkos::init() // don't invoke allocate peratom(), will be allocated when needed allocate(); - cg->ghost_notify(); - cg->setup(); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -564,11 +551,9 @@ void PPPMKokkos::setup_grid() allocate(); - cg->ghost_notify(); - if (overlap_allowed == 0 && cg->ghost_overlap()) + if (!overlap_allowed && !gc->ghost_adjacent()) error->all(FLERR,"PPPM grid stencil extends " "beyond nearest neighbor processor"); - cg->setup(); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -576,7 +561,7 @@ void PPPMKokkos::setup_grid() compute_gf_denom(); compute_rho_coeff(); - // pre-compute volume-dependent coeffs + // pre-compute volume-dependent coeffs for portion of grid I now own setup(); } @@ -609,11 +594,8 @@ void PPPMKokkos::compute(int eflag, int vflag) d_vatom = k_vatom.view(); } - if (evflag_atom && !peratom_allocate_flag) { + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } x = atomKK->k_x.view(); f = atomKK->k_f.view(); @@ -667,7 +649,8 @@ void PPPMKokkos::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,REVERSE_RHO, + k_gc_buf1,k_gc_buf2,MPI_FFT_SCALAR); brick2fft(); // compute potential gradient on my FFT grid and @@ -680,12 +663,14 @@ void PPPMKokkos::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - cg->forward_comm(this,FORWARD_IK); + gc->forward_comm_kspace(this,3,FORWARD_IK, + k_gc_buf1,k_gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication if (evflag_atom) - cg_peratom->forward_comm(this,FORWARD_IK_PERATOM); + gc->forward_comm_kspace(this,7,FORWARD_IK_PERATOM, + k_gc_buf1,k_gc_buf2,MPI_FFT_SCALAR); // calculate the force on my particles @@ -826,32 +811,36 @@ void PPPMKokkos::allocate() // remap takes data from 3d brick to FFT decomposition int collective_flag = 0; // not yet supported in Kokkos version - int cuda_aware_flag = lmp->kokkos->cuda_aware_flag; + int gpu_aware_flag = lmp->kokkos->gpu_aware_flag; int tmp; fft1 = new FFT3dKokkos(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft, nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft, - 0,0,&tmp,collective_flag,cuda_aware_flag); + 0,0,&tmp,collective_flag,gpu_aware_flag); fft2 = new FFT3dKokkos(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - 0,0,&tmp,collective_flag,cuda_aware_flag); + 0,0,&tmp,collective_flag,gpu_aware_flag); remap = new RemapKokkos(lmp,world, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft, - 1,0,0,FFT_PRECISION,collective_flag,cuda_aware_flag); + 1,0,0,FFT_PRECISION,collective_flag,gpu_aware_flag); // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods - int (*procneigh)[2] = comm->procneigh; - - cg = new GridCommKokkos(lmp,world,3,1, + gc = new GridCommKokkos(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + gc->setup(ngc_buf1,ngc_buf2); + + npergrid = 3; + + k_gc_buf1 = FFT_DAT::tdual_FFT_SCALAR_1d("pppm:gc_buf1",npergrid*ngc_buf1); + k_gc_buf2 = FFT_DAT::tdual_FFT_SCALAR_1d("pppm:gc_buf2",npergrid*ngc_buf2); } /* ---------------------------------------------------------------------- @@ -862,22 +851,22 @@ template void PPPMKokkos::deallocate() { memoryKK->destroy_kokkos(d_density_fft,density_fft); - density_fft = NULL; + density_fft = nullptr; memoryKK->destroy_kokkos(d_greensfn,greensfn); - greensfn = NULL; + greensfn = nullptr; memoryKK->destroy_kokkos(d_work1,work1); - work1 = NULL; + work1 = nullptr; memoryKK->destroy_kokkos(d_work2,work2); - work2 = NULL; + work2 = nullptr; delete fft1; - fft1 = NULL; + fft1 = nullptr; delete fft2; - fft2 = NULL; + fft2 = nullptr; delete remap; - remap = NULL; - delete cg; - cg = NULL; + remap = nullptr; + delete gc; + gc = nullptr; } /* ---------------------------------------------------------------------- @@ -899,16 +888,13 @@ void PPPMKokkos::allocate_peratom() d_v5_brick = typename FFT_AT::t_FFT_SCALAR_3d("pppm:d_v5_brick",nzhi_out-nzlo_out+1,nyhi_out-nylo_out+1,nxhi_out-nxlo_out+1); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - int (*procneigh)[2] = comm->procneigh; + npergrid = 7; - cg_peratom = - new GridCommKokkos(lmp,world,7,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + k_gc_buf1 = FFT_DAT::tdual_FFT_SCALAR_1d("pppm:gc_buf1",npergrid*ngc_buf1); + k_gc_buf2 = FFT_DAT::tdual_FFT_SCALAR_1d("pppm:gc_buf2",npergrid*ngc_buf2); } /* ---------------------------------------------------------------------- @@ -919,9 +905,6 @@ template void PPPMKokkos::deallocate_peratom() { peratom_allocate_flag = 0; - - delete cg_peratom; - cg_peratom = NULL; } /* ---------------------------------------------------------------------- @@ -1185,153 +1168,11 @@ double PPPMKokkos::final_accuracy() template void PPPMKokkos::set_grid_local() { - // global indices of PPPM grid range from 0 to N-1 - // nlo_in,nhi_in = lower/upper limits of the 3d sub-brick of - // global PPPM grid that I own without ghost cells - // for slab PPPM, assign z grid as if it were not extended + PPPM::set_grid_local(); - nxlo_in = static_cast (comm->xsplit[comm->myloc[0]] * nx_pppm); - nxhi_in = static_cast (comm->xsplit[comm->myloc[0]+1] * nx_pppm) - 1; - - nylo_in = static_cast (comm->ysplit[comm->myloc[1]] * ny_pppm); - nyhi_in = static_cast (comm->ysplit[comm->myloc[1]+1] * ny_pppm) - 1; - - nzlo_in = static_cast - (comm->zsplit[comm->myloc[2]] * nz_pppm/slab_volfactor); - nzhi_in = static_cast - (comm->zsplit[comm->myloc[2]+1] * nz_pppm/slab_volfactor) - 1; - - // nlower,nupper = stencil size for mapping particles to PPPM grid - - nlower = -(order-1)/2; - nupper = order/2; - - // shift values for particle <-> grid mapping - // add/subtract OFFSET to avoid int(-0.75) = 0 when want it to be -1 - - if (order % 2) shift = OFFSET + 0.5; - else shift = OFFSET; - if (order % 2) shiftone = 0.0; - else shiftone = 0.5; - - // nlo_out,nhi_out = lower/upper limits of the 3d sub-brick of - // global PPPM grid that my particles can contribute charge to - // effectively nlo_in,nhi_in + ghost cells - // nlo,nhi = global coords of grid pt to "lower left" of smallest/largest - // position a particle in my box can be at - // dist[3] = particle position bound = subbox + skin/2.0 + qdist - // qdist = offset due to TIP4P fictitious charge - // convert to triclinic if necessary - // nlo_out,nhi_out = nlo,nhi + stencil size for particle mapping - // for slab PPPM, assign z grid as if it were not extended - - double *prd,*sublo,*subhi; - - if (triclinic == 0) { - prd = domain->prd; - boxlo[0] = domain->boxlo[0]; - boxlo[1] = domain->boxlo[1]; - boxlo[2] = domain->boxlo[2]; - sublo = domain->sublo; - subhi = domain->subhi; - } else { - prd = domain->prd_lamda; - boxlo[0] = domain->boxlo_lamda[0]; - boxlo[1] = domain->boxlo_lamda[1]; - boxlo[2] = domain->boxlo_lamda[2]; - domain->x2lamda(atomKK->nlocal); - sublo = domain->sublo_lamda; - subhi = domain->subhi_lamda; - } - - double xprd = prd[0]; - double yprd = prd[1]; - double zprd = prd[2]; - double zprd_slab = zprd*slab_volfactor; - - double dist[3]; - double cuthalf = 0.5*neighbor->skin + qdist; - if (triclinic == 0) dist[0] = dist[1] = dist[2] = cuthalf; - else kspacebbox(cuthalf,&dist[0]); - - int nlo,nhi; - - nlo = static_cast ((sublo[0]-dist[0]-boxlo[0]) * - nx_pppm/xprd + shift) - OFFSET; - nhi = static_cast ((subhi[0]+dist[0]-boxlo[0]) * - nx_pppm/xprd + shift) - OFFSET; - nxlo_out = nlo + nlower; - nxhi_out = nhi + nupper; - - nlo = static_cast ((sublo[1]-dist[1]-boxlo[1]) * - ny_pppm/yprd + shift) - OFFSET; - nhi = static_cast ((subhi[1]+dist[1]-boxlo[1]) * - ny_pppm/yprd + shift) - OFFSET; - nylo_out = nlo + nlower; - nyhi_out = nhi + nupper; - - nlo = static_cast ((sublo[2]-dist[2]-boxlo[2]) * - nz_pppm/zprd_slab + shift) - OFFSET; - nhi = static_cast ((subhi[2]+dist[2]-boxlo[2]) * - nz_pppm/zprd_slab + shift) - OFFSET; - nzlo_out = nlo + nlower; - nzhi_out = nhi + nupper; - - // for slab PPPM, change the grid boundary for processors at +z end - // to include the empty volume between periodically repeating slabs - // for slab PPPM, want charge data communicated from -z proc to +z proc, - // but not vice versa, also want field data communicated from +z proc to - // -z proc, but not vice versa - // this is accomplished by nzhi_in = nzhi_out on +z end (no ghost cells) - // also insure no other procs use ghost cells beyond +z limit - - if (slabflag == 1) { - if (comm->myloc[2] == comm->procgrid[2]-1) - nzhi_in = nzhi_out = nz_pppm - 1; - nzhi_out = MIN(nzhi_out,nz_pppm-1); - } - - // decomposition of FFT mesh - // global indices range from 0 to N-1 - // proc owns entire x-dimension, clumps of columns in y,z dimensions - // npey_fft,npez_fft = # of procs in y,z dims - // if nprocs is small enough, proc can own 1 or more entire xy planes, - // else proc owns 2d sub-blocks of yz plane - // me_y,me_z = which proc (0-npe_fft-1) I am in y,z dimensions - // nlo_fft,nhi_fft = lower/upper limit of the section - // of the global FFT mesh that I own - - int npey_fft,npez_fft; - if (nz_pppm >= nprocs) { - npey_fft = 1; - npez_fft = nprocs; - } else procs2grid2d(nprocs,ny_pppm,nz_pppm,&npey_fft,&npez_fft); - - int me_y = me % npey_fft; - int me_z = me / npey_fft; - - nxlo_fft = 0; - nxhi_fft = nx_pppm - 1; - nylo_fft = me_y*ny_pppm/npey_fft; - nyhi_fft = (me_y+1)*ny_pppm/npey_fft - 1; - nzlo_fft = me_z*nz_pppm/npez_fft; - nzhi_fft = (me_z+1)*nz_pppm/npez_fft - 1; - - // PPPM grid pts owned by this proc, including ghosts - - ngrid = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * - (nzhi_out-nzlo_out+1); - - // FFT grids owned by this proc, without ghosts - // nfft = FFT points in FFT decomposition on this proc - // nfft_brick = FFT points in 3d brick-decomposition on this proc - // nfft_both = greater of 2 values - - nfft = (nxhi_fft-nxlo_fft+1) * (nyhi_fft-nylo_fft+1) * - (nzhi_fft-nzlo_fft+1); - int nfft_brick = (nxhi_in-nxlo_in+1) * (nyhi_in-nylo_in+1) * - (nzhi_in-nzlo_in+1); - nfft_both = MAX(nfft,nfft_brick); + boxlo[0] = domain->boxlo[0]; + boxlo[1] = domain->boxlo[1]; + boxlo[2] = domain->boxlo[2]; } /* ---------------------------------------------------------------------- @@ -1479,7 +1320,7 @@ void PPPMKokkos::compute_gf_ik_triclinic() template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_compute_gf_ik_triclinic, const int &m) const +void PPPMKokkos::operator()(TagPPPM_compute_gf_ik_triclinic, const int &/*m*/) const { //int n = (m - nzlo_fft)*(nyhi_fft+1 - nylo_fft)*(nxhi_fft+1 - nxlo_fft); // @@ -2085,14 +1926,14 @@ void PPPMKokkos::poisson_ik_triclinic() template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic1, const int &k) const +void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic1, const int &/*k*/) const { } template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic2, const int &k) const +void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic2, const int &/*k*/) const { // for (j = nylo_in-nylo_out; j <= nyhi_in-nylo_out; j++) // for (i = nxlo_in-nxlo_out; i <= nxhi_in-nxlo_out; i++) { @@ -2103,7 +1944,7 @@ void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic2, const int template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic3, const int &k) const +void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic3, const int &/*k*/) const { // int n = (k - (nzlo_in-nzlo_out))*((nyhi_in-nylo_out) - (nylo_in-nylo_out) + 1)*((nxhi_in-nxlo_out) - (nxlo_in-nxlo_out) + 1)*2; @@ -2111,7 +1952,7 @@ void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic3, const int template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic4, const int &k) const +void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic4, const int &/*k*/) const { // int n = (k - (nzlo_in-nzlo_out))*((nyhi_in-nylo_out) - (nylo_in-nylo_out) + 1)*((nxhi_in-nxlo_out) - (nxlo_in-nxlo_out) + 1)*2; // @@ -2119,7 +1960,7 @@ void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic4, const int template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic5, const int &k) const +void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic5, const int &/*k*/) const { // int n = (k - (nzlo_in-nzlo_out))*((nyhi_in-nylo_out) - (nylo_in-nylo_out) + 1)*((nxhi_in-nxlo_out) - (nxlo_in-nxlo_out) + 1)*2; // @@ -2127,7 +1968,7 @@ void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic5, const int template KOKKOS_INLINE_FUNCTION -void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic6, const int &k) const +void PPPMKokkos::operator()(TagPPPM_poisson_ik_triclinic6, const int &/*k*/) const { // int n = (k - (nzlo_in-nzlo_out))*((nyhi_in-nylo_out) - (nylo_in-nylo_out) + 1)*((nxhi_in-nxlo_out) - (nxlo_in-nxlo_out) + 1)*2; // @@ -2568,7 +2409,7 @@ void PPPMKokkos::operator()(TagPPPM_fieldforce_peratom, const int &i ------------------------------------------------------------------------- */ template -void PPPMKokkos::pack_forward_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::pack_forward_grid_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(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2624,11 +2465,12 @@ void PPPMKokkos::operator()(TagPPPM_pack_forward2, const int &i) con ------------------------------------------------------------------------- */ template -void PPPMKokkos::unpack_forward_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::unpack_forward_grid_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int offset, int nlist, DAT::tdual_int_2d &k_list, int index) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); d_buf = k_buf.view(); + unpack_offset = offset; nx = (nxhi_out-nxlo_out+1); ny = (nyhi_out-nylo_out+1); @@ -2652,9 +2494,9 @@ void PPPMKokkos::operator()(TagPPPM_unpack_forward1, const int &i) c const int iz = (int) (dlist/(nx*ny)); const int iy = (int) ((dlist - iz*nx*ny)/nx); const int ix = d_list_index[i] - iz*nx*ny - iy*nx; - d_vdx_brick(iz,iy,ix) = d_buf[3*i]; - d_vdy_brick(iz,iy,ix) = d_buf[3*i+1]; - d_vdz_brick(iz,iy,ix) = d_buf[3*i+2]; + d_vdx_brick(iz,iy,ix) = d_buf[3*i + unpack_offset]; + d_vdy_brick(iz,iy,ix) = d_buf[3*i+1 + unpack_offset]; + d_vdz_brick(iz,iy,ix) = d_buf[3*i+2 + unpack_offset]; } template @@ -2667,12 +2509,12 @@ void PPPMKokkos::operator()(TagPPPM_unpack_forward2, const int &i) c const int ix = d_list_index[i] - iz*nx*ny - iy*nx; if (eflag_atom) d_u_brick(iz,iy,ix) = d_buf[7*i]; if (vflag_atom) { - d_v0_brick(iz,iy,ix) = d_buf[7*i+1]; - d_v1_brick(iz,iy,ix) = d_buf[7*i+2]; - d_v2_brick(iz,iy,ix) = d_buf[7*i+3]; - d_v3_brick(iz,iy,ix) = d_buf[7*i+4]; - d_v4_brick(iz,iy,ix) = d_buf[7*i+5]; - d_v5_brick(iz,iy,ix) = d_buf[7*i+6]; + d_v0_brick(iz,iy,ix) = d_buf[7*i+1 + unpack_offset]; + d_v1_brick(iz,iy,ix) = d_buf[7*i+2 + unpack_offset]; + d_v2_brick(iz,iy,ix) = d_buf[7*i+3 + unpack_offset]; + d_v3_brick(iz,iy,ix) = d_buf[7*i+4 + unpack_offset]; + d_v4_brick(iz,iy,ix) = d_buf[7*i+5 + unpack_offset]; + d_v5_brick(iz,iy,ix) = d_buf[7*i+6 + unpack_offset]; } } @@ -2681,7 +2523,7 @@ void PPPMKokkos::operator()(TagPPPM_unpack_forward2, const int &i) c ------------------------------------------------------------------------- */ template -void PPPMKokkos::pack_reverse_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::pack_reverse_grid_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(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); @@ -2711,11 +2553,12 @@ void PPPMKokkos::operator()(TagPPPM_pack_reverse, const int &i) cons ------------------------------------------------------------------------- */ template -void PPPMKokkos::unpack_reverse_kspace_kokkos(int flag, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int nlist, DAT::tdual_int_2d &k_list, int index) +void PPPMKokkos::unpack_reverse_grid_kokkos(int /*flag*/, FFT_DAT::tdual_FFT_SCALAR_1d &k_buf, int offset, int nlist, DAT::tdual_int_2d &k_list, int index) { typename AT::t_int_2d_um d_list = k_list.view(); d_list_index = Kokkos::subview(d_list,index,Kokkos::ALL()); d_buf = k_buf.view(); + unpack_offset = offset; nx = (nxhi_out-nxlo_out+1); ny = (nyhi_out-nylo_out+1); @@ -2733,7 +2576,7 @@ void PPPMKokkos::operator()(TagPPPM_unpack_reverse, const int &i) co const int iz = (int) (dlist/(nx*ny)); const int iy = (int) ((dlist - iz*nx*ny)/nx); const int ix = d_list_index[i] - iz*nx*ny - iy*nx; - d_density_brick(iz,iy,ix) += d_buf[i]; + d_density_brick(iz,iy,ix) += d_buf[i + unpack_offset]; } /* ---------------------------------------------------------------------- @@ -3044,7 +2887,9 @@ double PPPMKokkos::memory_usage() if (peratom_allocate_flag) bytes += 6 * nbrick * sizeof(FFT_SCALAR); - if (cg) bytes += cg->memory_usage(); + // two GridComm bufs + + bytes += (ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); return bytes; } diff --git a/src/KOKKOS/pppm_kokkos.h b/src/KOKKOS/pppm_kokkos.h index 56cd6f5140..b2c7dbe852 100644 --- a/src/KOKKOS/pppm_kokkos.h +++ b/src/KOKKOS/pppm_kokkos.h @@ -311,6 +311,7 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT { int nx,ny,nz; typename AT::t_int_1d_um d_list_index; typename FFT_AT::t_FFT_SCALAR_1d_um d_buf; + int unpack_offset; DAT::tdual_int_scalar k_flag; @@ -353,10 +354,14 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT { //double **acons; typename Kokkos::DualView::t_host acons; + // FFTs and grid communication + FFT3dKokkos *fft1,*fft2; RemapKokkos *remap; - GridCommKokkos *cg; - GridCommKokkos *cg_peratom; + GridCommKokkos *gc; + + FFT_DAT::tdual_FFT_SCALAR_1d k_gc_buf1,k_gc_buf2; + int ngc_buf1,ngc_buf2,npergrid; //int **part2grid; // storage for particle -> grid mapping typename AT::t_int_1d_3 d_part2grid; @@ -403,10 +408,10 @@ class PPPMKokkos : public PPPM, public KokkosBaseFFT { // grid communication - 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); + void pack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); + void unpack_forward_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int); + void pack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, DAT::tdual_int_2d &, int); + void unpack_reverse_grid_kokkos(int, FFT_DAT::tdual_FFT_SCALAR_1d &, int, int, DAT::tdual_int_2d &, int); // triclinic diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.cpp b/src/KOKKOS/rand_pool_wrap_kokkos.cpp index 2d8865feb0..51ea45e83a 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.cpp +++ b/src/KOKKOS/rand_pool_wrap_kokkos.cpp @@ -24,7 +24,7 @@ using namespace LAMMPS_NS; RandPoolWrap::RandPoolWrap(int, LAMMPS *lmp) : Pointers(lmp) { - random_thr = NULL; + random_thr = nullptr; nthreads = lmp->kokkos->nthreads; } @@ -42,7 +42,7 @@ void RandPoolWrap::destroy() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } diff --git a/src/KOKKOS/rand_pool_wrap_kokkos.h b/src/KOKKOS/rand_pool_wrap_kokkos.h index 9124d8e9e7..8ae90011ab 100644 --- a/src/KOKKOS/rand_pool_wrap_kokkos.h +++ b/src/KOKKOS/rand_pool_wrap_kokkos.h @@ -26,7 +26,7 @@ struct RandWrap { KOKKOS_INLINE_FUNCTION RandWrap() { - rng = NULL; + rng = nullptr; } KOKKOS_INLINE_FUNCTION diff --git a/src/KOKKOS/remap_kokkos.cpp b/src/KOKKOS/remap_kokkos.cpp index 2894009887..1c72c9edc5 100644 --- a/src/KOKKOS/remap_kokkos.cpp +++ b/src/KOKKOS/remap_kokkos.cpp @@ -11,12 +11,10 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include -#include -#include #include "remap_kokkos.h" -#include "pack_kokkos.h" + #include "error.h" +#include "pack_kokkos.h" using namespace LAMMPS_NS; @@ -28,7 +26,7 @@ using namespace LAMMPS_NS; template RemapKokkos::RemapKokkos(LAMMPS *lmp) : Pointers(lmp) { - plan = NULL; + plan = nullptr; } template @@ -46,7 +44,7 @@ RemapKokkos::RemapKokkos(LAMMPS *lmp, MPI_Comm comm, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, nqty,permute,memory,precision,usecollective, usecuda_aware); - if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d remap plan"); } /* ---------------------------------------------------------------------- */ @@ -220,7 +218,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat int in_klo, int in_khi, int out_ilo, int out_ihi, int out_jlo, int out_jhi, int out_klo, int out_khi, - int nqty, int permute, int memory, int precision, + int nqty, int permute, int memory, int /*precision*/, int usecollective, int usecuda_aware) { @@ -237,7 +235,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat // allocate memory for plan data struct plan = new struct remap_plan_3d_kokkos; - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; plan->usecollective = usecollective; plan->usecuda_aware = usecuda_aware; @@ -270,10 +268,10 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat // combine output extents across all procs inarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (inarray == NULL) return NULL; + if (inarray == nullptr) return nullptr; outarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (outarray == NULL) return NULL; + if (outarray == nullptr) return nullptr; MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE, outarray,sizeof(struct extent_3d),MPI_BYTE,comm); @@ -299,8 +297,8 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat plan->packplan = (struct pack_plan_3d *) malloc(nsend*sizeof(struct pack_plan_3d)); - if (plan->send_offset == NULL || plan->send_size == NULL || - plan->send_proc == NULL || plan->packplan == NULL) return NULL; + if (plan->send_offset == nullptr || plan->send_size == nullptr || + plan->send_proc == nullptr || plan->packplan == nullptr) return nullptr; } // store send info, with self as last entry @@ -381,9 +379,9 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat plan->unpackplan = (struct pack_plan_3d *) malloc(nrecv*sizeof(struct pack_plan_3d)); - if (plan->recv_offset == NULL || plan->recv_size == NULL || - plan->recv_proc == NULL || plan->recv_bufloc == NULL || - plan->request == NULL || plan->unpackplan == NULL) return NULL; + if (plan->recv_offset == nullptr || plan->recv_size == nullptr || + plan->recv_proc == nullptr || plan->recv_bufloc == nullptr || + plan->request == nullptr || plan->unpackplan == nullptr) return nullptr; } // store recv info, with self as last entry @@ -467,7 +465,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat if (size) { plan->d_sendbuf = typename FFT_AT::t_FFT_SCALAR_1d("remap3d:sendbuf",size); - if (!plan->d_sendbuf.data()) return NULL; + if (!plan->d_sendbuf.data()) return nullptr; } // if requested, allocate internal scratch space for recvs, @@ -477,7 +475,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat if (nrecv > 0) { plan->d_scratch = typename FFT_AT::t_FFT_SCALAR_1d("remap3d:scratch",nqty*out.isize*out.jsize*out.ksize); - if (!plan->d_scratch.data()) return NULL; + if (!plan->d_scratch.data()) return nullptr; } } @@ -497,7 +495,7 @@ struct remap_plan_3d_kokkos* RemapKokkos::remap_3d_creat template void RemapKokkos::remap_3d_destroy_plan_kokkos(struct remap_plan_3d_kokkos *plan) { - if (plan == NULL) return; + if (plan == nullptr) return; // free MPI communicator diff --git a/src/KOKKOS/sna_kokkos.h b/src/KOKKOS/sna_kokkos.h index 7edac7de00..7804aaef18 100644 --- a/src/KOKKOS/sna_kokkos.h +++ b/src/KOKKOS/sna_kokkos.h @@ -55,6 +55,8 @@ public: typedef Kokkos::View t_sna_3c3; typedef Kokkos::View t_sna_5c; + typedef Kokkos::View t_sna_2ckp; + inline SNAKokkos() {}; KOKKOS_INLINE_FUNCTION @@ -75,9 +77,13 @@ inline double memory_usage(); int ncoeff; + int host_flag; // functions for bispectrum coefficients, GPU only KOKKOS_INLINE_FUNCTION + void compute_cayley_klein(const int&, const int&, const double&, const double&, + const double&, const double&, const double&); + KOKKOS_INLINE_FUNCTION void pre_ui(const typename Kokkos::TeamPolicy::member_type& team,const int&,const int&); // ForceSNAP KOKKOS_INLINE_FUNCTION void compute_ui(const typename Kokkos::TeamPolicy::member_type& team, const int, const int); // ForceSNAP @@ -97,8 +103,6 @@ inline KOKKOS_INLINE_FUNCTION void compute_zi_cpu(const int&); // ForceSNAP KOKKOS_INLINE_FUNCTION - void zero_yi_cpu(const int&,const int&,const int&); // ForceSNAP - KOKKOS_INLINE_FUNCTION void compute_yi_cpu(int, const Kokkos::View &beta); // ForceSNAP KOKKOS_INLINE_FUNCTION @@ -117,6 +121,8 @@ inline double compute_sfac(double, double); // add_uarraytot, compute_duarray KOKKOS_INLINE_FUNCTION double compute_dsfac(double, double); // compute_duarray + KOKKOS_INLINE_FUNCTION + void compute_s_dsfac(const double, const double, double&, double&); // compute_cayley_klein // efficient complex FMA // efficient caxpy (i.e., y += a x) @@ -140,6 +146,9 @@ inline //per sna class instance for OMP use + // Alternative to rij, wj, rcutij... + // just calculate everything up front + t_sna_2ckp cayleyklein; // Per InFlight Particle t_sna_3d rij; @@ -156,6 +165,7 @@ inline t_sna_3d_ll blist; t_sna_3c_ll ulisttot; + t_sna_3c_ll ulisttot_full; // un-folded ulisttot, cpu only t_sna_3c_ll zlist; t_sna_3c_ll ulist; @@ -173,7 +183,7 @@ inline t_sna_4d_ll ylist_pack_re; // split real, t_sna_4d_ll ylist_pack_im; // imag AoSoA layout - int idxcg_max, idxu_max, idxz_max, idxb_max; + int idxcg_max, idxu_max, idxu_half_max, idxu_cache_max, idxz_max, idxb_max; // Chem snap counts int nelements; @@ -188,7 +198,13 @@ private: Kokkos::View idxz; Kokkos::View idxb; Kokkos::View idxcg_block; + +public: Kokkos::View idxu_block; + Kokkos::View idxu_half_block; + Kokkos::View idxu_cache_block; + +private: Kokkos::View idxz_block; Kokkos::View idxb_block; diff --git a/src/KOKKOS/sna_kokkos_impl.h b/src/KOKKOS/sna_kokkos_impl.h index 93d8347c5e..3060aa9527 100644 --- a/src/KOKKOS/sna_kokkos_impl.h +++ b/src/KOKKOS/sna_kokkos_impl.h @@ -31,6 +31,9 @@ SNAKokkos::SNAKokkos(double rfac0_in, int twojmax_in, double rmin0_in, int switch_flag_in, int bzero_flag_in, int chem_flag_in, int bnorm_flag_in, int wselfall_flag_in, int nelements_in) { + LAMMPS_NS::ExecutionSpace execution_space = ExecutionSpaceFromDevice::space; + host_flag = (execution_space == LAMMPS_NS::Host); + wself = 1.0; rfac0 = rfac0_in; @@ -120,6 +123,36 @@ void SNAKokkos::build_indexlist() idxu_max = idxu_count; Kokkos::deep_copy(idxu_block,h_idxu_block); + // index list for half uarray + idxu_half_block = Kokkos::View("SNAKokkos::idxu_half_block",jdim); + auto h_idxu_half_block = Kokkos::create_mirror_view(idxu_half_block); + + int idxu_half_count = 0; + for(int j = 0; j <= twojmax; j++) { + h_idxu_half_block[j] = idxu_half_count; + for(int mb = 0; 2*mb <= j; mb++) + for(int ma = 0; ma <= j; ma++) + idxu_half_count++; + } + idxu_half_max = idxu_half_count; + Kokkos::deep_copy(idxu_half_block, h_idxu_half_block); + + // index list for "cache" uarray + // this is the GPU scratch memory requirements + // applied the CPU structures + idxu_cache_block = Kokkos::View("SNAKokkos::idxu_cache_block",jdim); + auto h_idxu_cache_block = Kokkos::create_mirror_view(idxu_cache_block); + + int idxu_cache_count = 0; + for(int j = 0; j <= twojmax; j++) { + h_idxu_cache_block[j] = idxu_cache_count; + for(int mb = 0; mb < ((j+3)/2); mb++) + for (int ma = 0; ma <= j; ma++) + idxu_cache_count++; + } + idxu_cache_max = idxu_cache_count; + Kokkos::deep_copy(idxu_cache_block, h_idxu_cache_block); + // index list for beta and B int idxb_count = 0; @@ -201,15 +234,17 @@ void SNAKokkos::build_indexlist() h_idxz(idxz_count,8) = MIN(j1, (2 * mb - j + j2 + j1) / 2) - h_idxz(idxz_count,5) + 1; // apply to z(j1,j2,j,ma,mb) to unique element of y(j) - - const int jju = h_idxu_block[j] + (j+1)*mb + ma; - h_idxz(idxz_count,9) = jju; + // ylist is "compressed" via symmetry in its + // contraction with dulist + const int jju_half = h_idxu_half_block[j] + (j+1)*mb + ma; + h_idxz(idxz_count,9) = jju_half; idxz_count++; } } Kokkos::deep_copy(idxz,h_idxz); Kokkos::deep_copy(idxz_block,h_idxz_block); + } /* ---------------------------------------------------------------------- */ @@ -230,44 +265,47 @@ void SNAKokkos::grow_rij(int newnatom, int newnmax) natom = newnatom; nmax = newnmax; - rij = t_sna_3d("sna:rij",natom,nmax,3); - inside = t_sna_2i("sna:inside",natom,nmax); - wj = t_sna_2d("sna:wj",natom,nmax); - rcutij = t_sna_2d("sna:rcutij",natom,nmax); - element = t_sna_2i("sna:rcutij",natom,nmax); - dedr = t_sna_3d("sna:dedr",natom,nmax,3); + inside = t_sna_2i(Kokkos::NoInit("sna:inside"),natom,nmax); + element = t_sna_2i(Kokkos::NoInit("sna:rcutij"),natom,nmax); + dedr = t_sna_3d(Kokkos::NoInit("sna:dedr"),natom,nmax,3); #ifdef LMP_KOKKOS_GPU - if (std::is_same::value) { - // dummy allocation - ulisttot = t_sna_3c_ll("sna:ulisttot",1,1,1); - ulisttot_re = t_sna_3d_ll("sna:ulisttot_re",idxu_max,nelements,natom); - ulisttot_im = t_sna_3d_ll("sna:ulisttot_im",idxu_max,nelements,natom); - ulisttot_pack = t_sna_4c_ll("sna:ulisttot_pack",32,idxu_max,nelements,(natom+32-1)/32); - ulist = t_sna_3c_ll("sna:ulist",1,1,1); - zlist = t_sna_3c_ll("sna:zlist",1,1,1); - zlist_pack = t_sna_4c_ll("sna:zlist_pack",32,idxz_max,ndoubles,(natom+32-1)/32); - blist = t_sna_3d_ll("sna:blist",idxb_max,ntriples,natom); - blist_pack = t_sna_4d_ll("sna:blist_pack",32,idxb_max,ntriples,(natom+32-1)/32); - ylist = t_sna_3c_ll("sna:ylist",idxu_max,nelements,natom); - ylist_pack_re = t_sna_4d_ll("sna:ylist_pack_re",32,idxu_max,nelements,(natom+32-1)/32); - ylist_pack_im = t_sna_4d_ll("sna:ylist_pack_im",32,idxu_max,nelements,(natom+32-1)/32); - dulist = t_sna_4c3_ll("sna:dulist",1,1,1); + if (!host_flag) { + + cayleyklein = t_sna_2ckp(Kokkos::NoInit("sna:cayleyklein"), natom, nmax); + ulisttot = t_sna_3c_ll(Kokkos::NoInit("sna:ulisttot"),1,1,1); // dummy allocation + ulisttot_full = t_sna_3c_ll(Kokkos::NoInit("sna:ulisttot"),1,1,1); + ulisttot_re = t_sna_3d_ll(Kokkos::NoInit("sna:ulisttot_re"),idxu_half_max,nelements,natom); + ulisttot_im = t_sna_3d_ll(Kokkos::NoInit("sna:ulisttot_im"),idxu_half_max,nelements,natom); + ulisttot_pack = t_sna_4c_ll(Kokkos::NoInit("sna:ulisttot_pack"),32,idxu_max,nelements,(natom+32-1)/32); + ulist = t_sna_3c_ll(Kokkos::NoInit("sna:ulist"),1,1,1); + zlist = t_sna_3c_ll(Kokkos::NoInit("sna:zlist"),1,1,1); + zlist_pack = t_sna_4c_ll(Kokkos::NoInit("sna:zlist_pack"),32,idxz_max,ndoubles,(natom+32-1)/32); + blist = t_sna_3d_ll(Kokkos::NoInit("sna:blist"),idxb_max,ntriples,natom); + blist_pack = t_sna_4d_ll(Kokkos::NoInit("sna:blist_pack"),32,idxb_max,ntriples,(natom+32-1)/32); + ylist = t_sna_3c_ll(Kokkos::NoInit("sna:ylist"),idxu_half_max,nelements,natom); + ylist_pack_re = t_sna_4d_ll(Kokkos::NoInit("sna:ylist_pack_re"),32,idxu_half_max,nelements,(natom+32-1)/32); + ylist_pack_im = t_sna_4d_ll(Kokkos::NoInit("sna:ylist_pack_im"),32,idxu_half_max,nelements,(natom+32-1)/32); + dulist = t_sna_4c3_ll(Kokkos::NoInit("sna:dulist"),1,1,1); } else { #endif - ulisttot = t_sna_3c_ll("sna:ulisttot",idxu_max,nelements,natom); - ulisttot_re = t_sna_3d_ll("sna:ulisttot_re",1,1,1); - ulisttot_im = t_sna_3d_ll("sna:ulisttot_im",1,1,1); - ulisttot_pack = t_sna_4c_ll("sna:ulisttot_pack",1,1,1,1); - ulist = t_sna_3c_ll("sna:ulist",idxu_max,natom,nmax); - zlist = t_sna_3c_ll("sna:zlist",idxz_max,ndoubles,natom); - zlist_pack = t_sna_4c_ll("sna:zlist_pack",1,1,1,1); - blist = t_sna_3d_ll("sna:blist",idxb_max,ntriples,natom); - blist_pack = t_sna_4d_ll("sna:blist_pack",1,1,1,1); - ylist = t_sna_3c_ll("sna:ylist",idxu_max,nelements,natom); - ylist_pack_re = t_sna_4d_ll("sna:ylist_pack_re",1,1,1,1); - ylist_pack_im = t_sna_4d_ll("sna:ylist_pack_im",1,1,1,1); - dulist = t_sna_4c3_ll("sna:dulist",idxu_max,natom,nmax); + rij = t_sna_3d(Kokkos::NoInit("sna:rij"),natom,nmax,3); + wj = t_sna_2d(Kokkos::NoInit("sna:wj"),natom,nmax); + rcutij = t_sna_2d(Kokkos::NoInit("sna:rcutij"),natom,nmax); + ulisttot = t_sna_3c_ll(Kokkos::NoInit("sna:ulisttot"),idxu_half_max,nelements,natom); + ulisttot_full = t_sna_3c_ll(Kokkos::NoInit("sna:ulisttot_full"),idxu_max,nelements,natom); + ulisttot_re = t_sna_3d_ll(Kokkos::NoInit("sna:ulisttot_re"),1,1,1); + ulisttot_im = t_sna_3d_ll(Kokkos::NoInit("sna:ulisttot_im"),1,1,1); + ulisttot_pack = t_sna_4c_ll(Kokkos::NoInit("sna:ulisttot_pack"),1,1,1,1); + ulist = t_sna_3c_ll(Kokkos::NoInit("sna:ulist"),idxu_cache_max,natom,nmax); + zlist = t_sna_3c_ll(Kokkos::NoInit("sna:zlist"),idxz_max,ndoubles,natom); + zlist_pack = t_sna_4c_ll(Kokkos::NoInit("sna:zlist_pack"),1,1,1,1); + blist = t_sna_3d_ll(Kokkos::NoInit("sna:blist"),idxb_max,ntriples,natom); + blist_pack = t_sna_4d_ll(Kokkos::NoInit("sna:blist_pack"),1,1,1,1); + ylist = t_sna_3c_ll(Kokkos::NoInit("sna:ylist"),idxu_half_max,nelements,natom); + ylist_pack_re = t_sna_4d_ll(Kokkos::NoInit("sna:ylist_pack_re"),1,1,1,1); + ylist_pack_im = t_sna_4d_ll(Kokkos::NoInit("sna:ylist_pack_im"),1,1,1,1); + dulist = t_sna_4c3_ll(Kokkos::NoInit("sna:dulist"),idxu_cache_max,natom,nmax); #ifdef LMP_KOKKOS_GPU } @@ -278,20 +316,111 @@ void SNAKokkos::grow_rij(int newnatom, int newnmax) * GPU routines * ----------------------------------------------------------------------*/ + +/* ---------------------------------------------------------------------- + Precompute the Cayley-Klein parameters and the derivatives thereof. + This routine better exploits parallelism than the GPU ComputeUi and + ComputeFusedDeidrj, which are one warp per atom-neighbor pair. +------------------------------------------------------------------------- */ + +template +KOKKOS_INLINE_FUNCTION +void SNAKokkos::compute_cayley_klein(const int& iatom, const int& jnbor, const double& x, const double& y, + const double& z, const double& rcut, const double& wj_local) +{ + //const double x = rij(iatom,jnbor,0); + //const double y = rij(iatom,jnbor,1); + //const double z = rij(iatom,jnbor,2); + const double rsq = x * x + y * y + z * z; + const double r = sqrt(rsq); + //const double rcut = rcutij(iatom, jnbor); + const double rscale0 = rfac0 * MY_PI / (rcut - rmin0); + const double theta0 = (r - rmin0) * rscale0; + double sn, cs; + sincos(theta0, &sn, &cs); + const double z0 = r * cs / sn; + const double dz0dr = z0 / r - (r*rscale0) * (rsq + z0 * z0) / rsq; + + //const double wj_local = wj(iatom, jnbor); + double sfac, dsfac; + compute_s_dsfac(r, rcut, sfac, dsfac); + sfac *= wj_local; + dsfac *= wj_local; + + const double rinv = 1.0 / r; + const double ux = x * rinv; + const double uy = y * rinv; + const double uz = z * rinv; + + const double r0inv = 1.0 / sqrt(r * r + z0 * z0); + + const SNAcomplex a = { z0 * r0inv, -z * r0inv }; + const SNAcomplex b = { r0inv * y, -r0inv * x }; + + const double dr0invdr = -r0inv * r0inv * r0inv * (r + z0 * dz0dr); + + const double dr0invx = dr0invdr * ux; + const double dr0invy = dr0invdr * uy; + const double dr0invz = dr0invdr * uz; + + const double dz0x = dz0dr * ux; + const double dz0y = dz0dr * uy; + const double dz0z = dz0dr * uz; + + const SNAcomplex dax = { dz0x * r0inv + z0 * dr0invx, -z * dr0invx }; + const SNAcomplex day = { dz0y * r0inv + z0 * dr0invy, -z * dr0invy }; + const SNAcomplex daz = { dz0z * r0inv + z0 * dr0invz, -z * dr0invz - r0inv }; + + const SNAcomplex dbx = { y * dr0invx, -x * dr0invx - r0inv }; + const SNAcomplex dby = { y * dr0invy + r0inv, -x * dr0invy }; + const SNAcomplex dbz = { y * dr0invz, -x * dr0invz }; + + const double dsfacux = dsfac * ux; + const double dsfacuy = dsfac * uy; + const double dsfacuz = dsfac * uz; + + CayleyKleinPack ckp{}; + ckp.a = a; + ckp.b = b; + ckp.da[0] = dax; + ckp.db[0] = dbx; + ckp.da[1] = day; + ckp.db[1] = dby; + ckp.da[2] = daz; + ckp.db[2] = dbz; + ckp.sfac = sfac; + ckp.dsfacu[0] = dsfacux; + ckp.dsfacu[1] = dsfacuy; + ckp.dsfacu[2] = dsfacuz; + + // Yes, this breaks the standard mantra of using SoA + // instead of AoS, but it's net fine because of the + // one warp per atom/neighbor pair for the recursive + // polynomials. There's good L1 reuse, anyway. + cayleyklein(iatom, jnbor) = ckp; +} + +/* ---------------------------------------------------------------------- + Initialize ulisttot with self-energy terms. + Ulisttot uses a "half" data layout which takes + advantage of the symmetry of the Wigner U matrices. +------------------------------------------------------------------------- */ + template KOKKOS_INLINE_FUNCTION void SNAKokkos::pre_ui(const typename Kokkos::TeamPolicy::member_type& team, const int& iatom, const int& ielem) { for (int jelem = 0; jelem < nelements; jelem++) { for (int j = 0; j <= twojmax; j++) { - const int jju = idxu_block(j); + const int jju_half = idxu_half_block(j); // Only diagonal elements get initialized - // for (int m = 0; m < (j+1)*(j+1); m++) - Kokkos::parallel_for(Kokkos::ThreadVectorRange(team, (j+1)*(j+1)), + // Top half only: gets symmetrized by TransformUi + // for (int m = 0; m < (j+1)*(j/2+1); m++) + Kokkos::parallel_for(Kokkos::ThreadVectorRange(team, (j+1)*(j/2+1)), [&] (const int m) { - const int jjup = jju + m; + const int jjup = jju_half + m; // if m is on the "diagonal", initialize it with the self energy. // Otherwise zero it out @@ -323,40 +452,27 @@ void SNAKokkos::compute_ui(const typename Kokkos::TeamPolicy::compute_ui(const typename Kokkos::TeamPolicy::compute_ui(const typename Kokkos::TeamPolicy::compute_ui(const typename Kokkos::TeamPolicy physical j integer), last element maps to self, skip - //if (!(m == total_iters - 1 && j % 2 == 0)) { - if (m < total_iters - 1 || j % 2 == 1) { - const int sign_factor = (((ma+mb)%2==0)?1:-1); - const int jju_shared_flip = (j+1-mb)*(j+1)-(ma+1); - const int jjup_flip = jju + jju_shared_flip; // jju+(j+1-mb)*(j+1)-(ma+1); + const int sign_factor = (((ma+mb)%2==0)?1:-1); + const int jju_shared_flip = (j+1-mb)*(j+1)-(ma+1); - if (sign_factor == 1) { - u_accum.im = -u_accum.im; - } else { - u_accum.re = -u_accum.re; - } - - buf2[jju_shared_flip] = u_accum; - - // split re, im to get fully coalesced atomic add - Kokkos::atomic_add(&(ulisttot_re(jjup_flip,jelem,iatom)), sfac * u_accum.re); - Kokkos::atomic_add(&(ulisttot_im(jjup_flip,jelem,iatom)), sfac * u_accum.im); + if (sign_factor == 1) { + u_accum.im = -u_accum.im; + } else { + u_accum.re = -u_accum.re; } + + if (j%2==1 && mb+1==n_mb) { + buf2[jju_shared_flip] = u_accum; + } + + // symmetric part of ulisttot is generated in TransformUi + }); // In CUDA backend, // ThreadVectorRange has a __syncwarp (appropriately masked for @@ -454,8 +567,11 @@ void SNAKokkos::compute_ui(const typename Kokkos::TeamPolicy @@ -486,14 +602,18 @@ void SNAKokkos::compute_zi(const int& iatom_mod, const int& jjz, con int jju2 = idxu_block[j2] + (j2+1)*mb2max; int icgb = mb1min*(j2+1) + mb2max; + #ifdef LMP_KK_DEVICE_COMPILE #pragma unroll + #endif for(int ib = 0; ib < nb; ib++) { int ma1 = ma1min; int ma2 = ma2max; int icga = ma1min*(j2+1) + ma2max; + #ifdef LMP_KK_DEVICE_COMPILE #pragma unroll + #endif for(int ia = 0; ia < na; ia++) { const SNAcomplex utot1 = ulisttot_pack(iatom_mod, jju1+ma1, elem1, iatom_div); const SNAcomplex utot2 = ulisttot_pack(iatom_mod, jju2+ma2, elem2, iatom_div); @@ -525,6 +645,8 @@ void SNAKokkos::compute_zi(const int& iatom_mod, const int& jjz, con /* ---------------------------------------------------------------------- compute Bi by summing conj(Ui)*Zi + AoSoA data layout to take advantage of coalescing, avoiding warp + divergence. ------------------------------------------------------------------------- */ template @@ -615,8 +737,9 @@ void SNAKokkos::compute_bi(const int& iatom_mod, const int& jjb, con /* ---------------------------------------------------------------------- - compute Yi from Ui without storing Zi, looping over zlist indices, - GPU version + compute Yi from Ui without storing Zi, looping over zlist indices. + AoSoA data layout to take advantage of coalescing, avoiding warp + divergence. GPU version. ------------------------------------------------------------------------- */ template @@ -635,7 +758,7 @@ void SNAKokkos::compute_yi(int iatom_mod, int jjz, int iatom_div, const int mb2max = idxz(jjz, 6); const int na = idxz(jjz, 7); const int nb = idxz(jjz, 8); - const int jju = idxz(jjz, 9); + const int jju_half = idxz(jjz, 9); const double *cgblock = cglist.data() + idxcg_block(j1,j2,j); //int mb = (2 * (mb1min+mb2max) - j1 - j2 + j) / 2; @@ -651,14 +774,18 @@ void SNAKokkos::compute_yi(int iatom_mod, int jjz, int iatom_div, int jju2 = idxu_block[j2] + (j2 + 1) * mb2max; int icgb = mb1min * (j2 + 1) + mb2max; + #ifdef LMP_KK_DEVICE_COMPILE #pragma unroll + #endif for (int ib = 0; ib < nb; ib++) { int ma1 = ma1min; int ma2 = ma2max; int icga = ma1min*(j2+1) + ma2max; + #ifdef LMP_KK_DEVICE_COMPILE #pragma unroll + #endif for (int ia = 0; ia < na; ia++) { const SNAcomplex utot1 = ulisttot_pack(iatom_mod,jju1+ma1,elem1,iatom_div); const SNAcomplex utot2 = ulisttot_pack(iatom_mod,jju2+ma2,elem2,iatom_div); @@ -677,8 +804,8 @@ void SNAKokkos::compute_yi(int iatom_mod, int jjz, int iatom_div, } // end loop over ib if (bnorm_flag) { - ztmp_r /= j + 1; - ztmp_i /= j + 1; + ztmp_r /= (j + 1); + ztmp_i /= (j + 1); } // apply to z(j1,j2,j,ma,mb) to unique element of y(j) @@ -710,8 +837,8 @@ void SNAKokkos::compute_yi(int iatom_mod, int jjz, int iatom_div, betaj *= (j1 + 1) / (j + 1.0); - Kokkos::atomic_add(&(ylist_pack_re(iatom_mod, jju, elem3, iatom_div)), betaj*ztmp_r); - Kokkos::atomic_add(&(ylist_pack_im(iatom_mod, jju, elem3, iatom_div)), betaj*ztmp_i); + Kokkos::atomic_add(&(ylist_pack_re(iatom_mod, jju_half, elem3, iatom_div)), betaj*ztmp_r); + Kokkos::atomic_add(&(ylist_pack_im(iatom_mod, jju_half, elem3, iatom_div)), betaj*ztmp_i); } // end loop over elem3 } // end loop over elem2 } // end loop over elem1 @@ -719,7 +846,7 @@ void SNAKokkos::compute_yi(int iatom_mod, int jjz, int iatom_div, /* ---------------------------------------------------------------------- Fused calculation of the derivative of Ui w.r.t. atom j - and of dEidRj. GPU only. + and accumulation into dEidRj. GPU only. ------------------------------------------------------------------------- */ template @@ -732,6 +859,9 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli const int scratch_shift = team_rank * max_m_tile; const int jelem = element(iatom, jnbor); + // See notes on data layouts for shared memory caching + // in `compute_ui`. + // double buffer for ulist SNAcomplex* ulist_buf1 = (SNAcomplex*)team.team_shmem( ).get_shmem(team.team_size()*max_m_tile*sizeof(SNAcomplex), 0) + scratch_shift; SNAcomplex* ulist_buf2 = (SNAcomplex*)team.team_shmem( ).get_shmem(team.team_size()*max_m_tile*sizeof(SNAcomplex), 0) + scratch_shift; @@ -740,50 +870,20 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli SNAcomplex* dulist_buf1 = (SNAcomplex*)team.team_shmem( ).get_shmem(team.team_size()*max_m_tile*sizeof(SNAcomplex), 0) + scratch_shift; SNAcomplex* dulist_buf2 = (SNAcomplex*)team.team_shmem( ).get_shmem(team.team_size()*max_m_tile*sizeof(SNAcomplex), 0) + scratch_shift; - const double x = rij(iatom,jnbor,0); - const double y = rij(iatom,jnbor,1); - const double z = rij(iatom,jnbor,2); - const double rsq = x * x + y * y + z * z; - const double r = sqrt(rsq); - const double rcut = rcutij(iatom, jnbor); - const double rscale0 = rfac0 * MY_PI / (rcut - rmin0); - const double theta0 = (r - rmin0) * rscale0; - const double cs = cos(theta0); - const double sn = sin(theta0); - const double z0 = r * cs / sn; - const double dz0dr = z0 / r - (r*rscale0) * (rsq + z0 * z0) / rsq; + const CayleyKleinPack& ckp = cayleyklein(iatom, jnbor); - const double wj_local = wj(iatom, jnbor); - const double sfac = wj_local * compute_sfac(r, rcut); - const double dsfac = wj_local * compute_dsfac(r, rcut); - - const double rinv = 1.0 / r; - - // extract a single unit vector - const double u = (dir == 0 ? x * rinv : dir == 1 ? y * rinv : z * rinv); - - // Compute Cayley-Klein parameters for unit quaternion - const double r0inv = 1.0 / sqrt(r * r + z0 * z0); - - const SNAcomplex a = { r0inv * z0, -r0inv * z }; - const SNAcomplex b = { r0inv * y, -r0inv * x }; - - const double dr0invdr = -r0inv * r0inv * r0inv * (r + z0 * dz0dr); - const double dr0inv = dr0invdr * u; - const double dz0 = dz0dr * u; - - const SNAcomplex da = { dz0 * r0inv + z0 * dr0inv, - - z * dr0inv + (dir == 2 ? - r0inv : 0.) }; - - const SNAcomplex db = { y * dr0inv + (dir==1?r0inv:0.), - -x * dr0inv + (dir==0?-r0inv:0.) }; + const SNAcomplex a = ckp.a; + const SNAcomplex b = ckp.b; + const SNAcomplex da = ckp.da[dir]; + const SNAcomplex db = ckp.db[dir]; + const double sfac = ckp.sfac; + const double dsfacu = ckp.dsfacu[dir]; // dsfac * u // Accumulate the full contribution to dedr on the fly - const double du_prod = dsfac * u; // chain rule const SNAcomplex y_local = ylist(0, jelem, iatom); // Symmetry factor of 0.5 b/c 0 element is on diagonal for even j==0 - double dedr_full_sum = 0.5 * du_prod * y_local.re; + double dedr_full_sum = 0.5 * dsfacu * y_local.re; // single has a warp barrier at the end Kokkos::single(Kokkos::PerThread(team), [=]() { @@ -793,8 +893,7 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli }); for (int j = 1; j <= twojmax; j++) { - int jju = idxu_block[j]; - int jjup = idxu_block[j-1]; + int jju_half = idxu_half_block[j]; // flatten the loop over ma,mb @@ -812,11 +911,10 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli [&] (const int m, double& sum_tmp) { // ma fast, mb slow - // Equivalent to `int ma = m % n_ma; int mb = m / n_ma;` IF everything's positive. const int mb = m / n_ma; const int ma = m - mb * n_ma; - const int jju_index = jju+m; + const int jju_half_index = jju_half+m; // Load y_local, apply the symmetry scaling factor // The "secret" of the shared memory optimization is it eliminates @@ -824,7 +922,7 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli // shared memory and otherwise always writing, making the kernel // ultimately compute bound. We take advantage of that by adding // some reads back in. - auto y_local = ylist(jju_index, jelem, iatom); + auto y_local = ylist(jju_half_index, jelem, iatom); if (j % 2 == 0 && 2*mb == j) { if (ma == mb) { y_local = 0.5*y_local; } else if (ma > mb) { y_local = { 0., 0. }; } // can probably avoid this outright @@ -870,7 +968,7 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli dulist_buf2[jju_shared_idx] = du_accum; // Directly accumulate deidrj into sum_tmp - const SNAcomplex du_prod = ((dsfac * u)*u_accum) + (sfac*du_accum); + const SNAcomplex du_prod = (dsfacu * u_accum) + (sfac * du_accum); sum_tmp += du_prod.re * y_local.re + du_prod.im * y_local.im; // copy left side to right side with inversion symmetry VMK 4.4(2) @@ -923,8 +1021,9 @@ void SNAKokkos::compute_fused_deidrj(const typename Kokkos::TeamPoli * ----------------------------------------------------------------------*/ /* ---------------------------------------------------------------------- - * compute Ui by summing over neighbors j - * ------------------------------------------------------------------------- */ + Ulisttot uses a "half" data layout which takes + advantage of the symmetry of the Wigner U matrices. + * ------------------------------------------------------------------------- */ template KOKKOS_INLINE_FUNCTION @@ -932,11 +1031,11 @@ void SNAKokkos::pre_ui_cpu(const typename Kokkos::TeamPolicy::pre_ui_cpu(const typename Kokkos::TeamPolicy @@ -1026,10 +1127,10 @@ void SNAKokkos::compute_zi_cpu(const int& iter) int ma2 = ma2max; int icga = ma1min * (j2 + 1) + ma2max; for(int ia = 0; ia < na; ia++) { - suma1_r += cgblock[icga] * (ulisttot(jju1+ma1, elem1, iatom).re * ulisttot(jju2+ma2, elem2, iatom).re - - ulisttot(jju1+ma1, elem1, iatom).im * ulisttot(jju2+ma2, elem2, iatom).im); - suma1_i += cgblock[icga] * (ulisttot(jju1+ma1, elem1, iatom).re * ulisttot(jju2+ma2, elem2, iatom).im + - ulisttot(jju1+ma1, elem1, iatom).im * ulisttot(jju2+ma2, elem2, iatom).re); + suma1_r += cgblock[icga] * (ulisttot_full(jju1+ma1, elem1, iatom).re * ulisttot_full(jju2+ma2, elem2, iatom).re - + ulisttot_full(jju1+ma1, elem1, iatom).im * ulisttot_full(jju2+ma2, elem2, iatom).im); + suma1_i += cgblock[icga] * (ulisttot_full(jju1+ma1, elem1, iatom).re * ulisttot_full(jju2+ma2, elem2, iatom).im + + ulisttot_full(jju1+ma1, elem1, iatom).im * ulisttot_full(jju2+ma2, elem2, iatom).re); ma1++; ma2--; icga += j2; @@ -1098,8 +1199,8 @@ void SNAKokkos::compute_bi_cpu(const typename Kokkos::TeamPolicy::compute_bi_cpu(const typename Kokkos::TeamPolicy::compute_bi_cpu(const typename Kokkos::TeamPolicy::compute_bi_cpu(const typename Kokkos::TeamPolicy -KOKKOS_INLINE_FUNCTION -void SNAKokkos::zero_yi_cpu(const int& idx, const int& iatom, const int& ielem) -{ - ylist(idx,ielem,iatom) = {0.0, 0.0}; -} - /* ---------------------------------------------------------------------- compute Yi from Ui without storing Zi, looping over zlist indices, CPU version @@ -1188,7 +1278,7 @@ void SNAKokkos::compute_yi_cpu(int iter, const int mb2max = idxz(jjz, 6); const int na = idxz(jjz, 7); const int nb = idxz(jjz, 8); - const int jju = idxz(jjz, 9); + const int jju_half = idxz(jjz, 9); const double *cgblock = cglist.data() + idxcg_block(j1,j2,j); //int mb = (2 * (mb1min+mb2max) - j1 - j2 + j) / 2; @@ -1214,10 +1304,10 @@ void SNAKokkos::compute_yi_cpu(int iter, int icga = ma1min*(j2+1) + ma2max; for (int ia = 0; ia < na; ia++) { - suma1_r += cgblock[icga] * (ulisttot(jju1+ma1, elem1, iatom).re * ulisttot(jju2+ma2, elem2, iatom).re - - ulisttot(jju1+ma1, elem1, iatom).im * ulisttot(jju2+ma2, elem2, iatom).im); - suma1_i += cgblock[icga] * (ulisttot(jju1+ma1, elem1, iatom).re * ulisttot(jju2+ma2, elem2, iatom).im + - ulisttot(jju1+ma1, elem1, iatom).im * ulisttot(jju2+ma2, elem2, iatom).re); + suma1_r += cgblock[icga] * (ulisttot_full(jju1+ma1, elem1, iatom).re * ulisttot_full(jju2+ma2, elem2, iatom).re - + ulisttot_full(jju1+ma1, elem1, iatom).im * ulisttot_full(jju2+ma2, elem2, iatom).im); + suma1_i += cgblock[icga] * (ulisttot_full(jju1+ma1, elem1, iatom).re * ulisttot_full(jju2+ma2, elem2, iatom).im + + ulisttot_full(jju1+ma1, elem1, iatom).im * ulisttot_full(jju2+ma2, elem2, iatom).re); ma1++; ma2--; icga += j2; @@ -1264,8 +1354,8 @@ void SNAKokkos::compute_yi_cpu(int iter, if (!bnorm_flag && j1 > j) betaj *= (j1 + 1) / (j + 1.0); - Kokkos::atomic_add(&(ylist(jju, elem3, iatom).re), betaj*ztmp_r); - Kokkos::atomic_add(&(ylist(jju, elem3, iatom).im), betaj*ztmp_i); + Kokkos::atomic_add(&(ylist(jju_half, elem3, iatom).re), betaj*ztmp_r); + Kokkos::atomic_add(&(ylist(jju_half, elem3, iatom).im), betaj*ztmp_i); } // end loop over elem3 } // end loop over elem2 } // end loop over elem1 @@ -1274,6 +1364,8 @@ void SNAKokkos::compute_yi_cpu(int iter, /* ---------------------------------------------------------------------- calculate derivative of Ui w.r.t. atom j + see comments above compute_duarray_cpu for comments on the + data layout ------------------------------------------------------------------------- */ template @@ -1301,6 +1393,10 @@ void SNAKokkos::compute_duidrj_cpu(const typename Kokkos::TeamPolicy /* ---------------------------------------------------------------------- compute dEidRj, CPU path only. + dulist takes advantage of a `cached` data layout, similar to the + shared memory layout for the GPU routines, which is efficient for + compressing the calculation in compute_duarray_cpu. That said, + dulist only uses the "half" data layout part of that structure. ------------------------------------------------------------------------- */ @@ -1314,14 +1410,18 @@ void SNAKokkos::compute_deidrj_cpu(const typename Kokkos::TeamPolicy //for(int j = 0; j <= twojmax; j++) { Kokkos::parallel_reduce(Kokkos::ThreadVectorRange(team,twojmax+1), [&] (const int& j, t_scalar3& sum_tmp) { - int jju = idxu_block[j]; + int jju_half = idxu_half_block[j]; + int jju_cache = idxu_cache_block[j]; for(int mb = 0; 2*mb < j; mb++) for(int ma = 0; ma <= j; ma++) { - sum_tmp.x += dulist(jju,iatom,jnbor,0).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,0).im * ylist(jju,jelem,iatom).im; - sum_tmp.y += dulist(jju,iatom,jnbor,1).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,1).im * ylist(jju,jelem,iatom).im; - sum_tmp.z += dulist(jju,iatom,jnbor,2).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,2).im * ylist(jju,jelem,iatom).im; - jju++; + sum_tmp.x += dulist(jju_cache,iatom,jnbor,0).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,0).im * ylist(jju_half,jelem,iatom).im; + sum_tmp.y += dulist(jju_cache,iatom,jnbor,1).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,1).im * ylist(jju_half,jelem,iatom).im; + sum_tmp.z += dulist(jju_cache,iatom,jnbor,2).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,2).im * ylist(jju_half,jelem,iatom).im; + jju_half++; jju_cache++; } //end loop over ma mb // For j even, handle middle column @@ -1330,16 +1430,22 @@ void SNAKokkos::compute_deidrj_cpu(const typename Kokkos::TeamPolicy int mb = j/2; for(int ma = 0; ma < mb; ma++) { - sum_tmp.x += dulist(jju,iatom,jnbor,0).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,0).im * ylist(jju,jelem,iatom).im; - sum_tmp.y += dulist(jju,iatom,jnbor,1).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,1).im * ylist(jju,jelem,iatom).im; - sum_tmp.z += dulist(jju,iatom,jnbor,2).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,2).im * ylist(jju,jelem,iatom).im; - jju++; + sum_tmp.x += dulist(jju_cache,iatom,jnbor,0).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,0).im * ylist(jju_half,jelem,iatom).im; + sum_tmp.y += dulist(jju_cache,iatom,jnbor,1).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,1).im * ylist(jju_half,jelem,iatom).im; + sum_tmp.z += dulist(jju_cache,iatom,jnbor,2).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,2).im * ylist(jju_half,jelem,iatom).im; + jju_half++; jju_cache++; } //int ma = mb; - sum_tmp.x += (dulist(jju,iatom,jnbor,0).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,0).im * ylist(jju,jelem,iatom).im)*0.5; - sum_tmp.y += (dulist(jju,iatom,jnbor,1).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,1).im * ylist(jju,jelem,iatom).im)*0.5; - sum_tmp.z += (dulist(jju,iatom,jnbor,2).re * ylist(jju,jelem,iatom).re + dulist(jju,iatom,jnbor,2).im * ylist(jju,jelem,iatom).im)*0.5; + sum_tmp.x += (dulist(jju_cache,iatom,jnbor,0).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,0).im * ylist(jju_half,jelem,iatom).im)*0.5; + sum_tmp.y += (dulist(jju_cache,iatom,jnbor,1).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,1).im * ylist(jju_half,jelem,iatom).im)*0.5; + sum_tmp.z += (dulist(jju_cache,iatom,jnbor,2).re * ylist(jju_half,jelem,iatom).re + + dulist(jju_cache,iatom,jnbor,2).im * ylist(jju_half,jelem,iatom).im)*0.5; } // end if jeven },final_sum); // end loop over j @@ -1355,6 +1461,10 @@ void SNAKokkos::compute_deidrj_cpu(const typename Kokkos::TeamPolicy /* ---------------------------------------------------------------------- add Wigner U-functions for one neighbor to the total + ulist is in a "cached" data layout, which is a compressed layout + which still keeps the recursive calculation simple. On the other hand + `ulisttot` uses a "half" data layout, which fully takes advantage + of the symmetry of the Wigner U matrices. ------------------------------------------------------------------------- */ template @@ -1364,15 +1474,27 @@ void SNAKokkos::add_uarraytot(const typename Kokkos::TeamPolicy @@ -1399,8 +1521,8 @@ void SNAKokkos::compute_uarray_cpu(const typename Kokkos::TeamPolicy ulist(0,iatom,jnbor).im = 0.0; for (int j = 1; j <= twojmax; j++) { - int jju = idxu_block[j]; - int jjup = idxu_block[j-1]; + const int jju = idxu_cache_block[j]; + const int jjup = idxu_cache_block[j-1]; // fill in left side of matrix layer from previous layer @@ -1434,37 +1556,37 @@ void SNAKokkos::compute_uarray_cpu(const typename Kokkos::TeamPolicy (b_r * ulist(jjup_index,iatom,jnbor).im - b_i * ulist(jjup_index,iatom,jnbor).re); } - }); - // copy left side to right side with inversion symmetry VMK 4.4(2) - // u[ma-j,mb-j] = (-1)^(ma-mb)*Conj([u[ma,mb)) + // copy left side to right side with inversion symmetry VMK 4.4(2) + // u[ma-j,mb-j] = (-1)^(ma-mb)*Conj([u[ma,mb)) - jju = idxu_block[j]; - jjup = jju+(j+1)*(j+1)-1; - Kokkos::parallel_for(Kokkos::ThreadVectorRange(team,(j+2)/2), - [&] (const int& mb) { -// for (int mb = 0; 2*mb <= j; mb++) { - int mbpar = (mb)%2==0?1:-1; - int mapar = mbpar; - for (int ma = 0; ma <= j; ma++) { - const int jju_index = jju+mb*(j+1)+ma; - const int jjup_index = jjup-mb*(j+1)-ma; - if (mapar == 1) { - ulist(jjup_index,iatom,jnbor).re = ulist(jju_index,iatom,jnbor).re; - ulist(jjup_index,iatom,jnbor).im = -ulist(jju_index,iatom,jnbor).im; - } else { - ulist(jjup_index,iatom,jnbor).re = -ulist(jju_index,iatom,jnbor).re; - ulist(jjup_index,iatom,jnbor).im = ulist(jju_index,iatom,jnbor).im; + // Only need to add one symmetrized row for convenience + // Symmetry gets "unfolded" in accumulating ulisttot + if (j%2==1 && mb==(j/2)) { + const int mbpar = (mb)%2==0?1:-1; + int mapar = mbpar; + for (int ma = 0; ma <= j; ma++) { + const int jju_index = jju + mb*(j+1) + ma; + const int jjup_index = jju + (j+1-mb)*(j+1)-(ma+1); + if (mapar == 1) { + ulist(jjup_index,iatom,jnbor).re = ulist(jju_index,iatom,jnbor).re; + ulist(jjup_index,iatom,jnbor).im = -ulist(jju_index,iatom,jnbor).im; + } else { + ulist(jjup_index,iatom,jnbor).re = -ulist(jju_index,iatom,jnbor).re; + ulist(jjup_index,iatom,jnbor).im = ulist(jju_index,iatom,jnbor).im; + } + mapar = -mapar; } - mapar = -mapar; } }); + } } /* ---------------------------------------------------------------------- compute derivatives of Wigner U-functions for one neighbor see comments in compute_uarray_cpu() + Uses same cached data layout of ulist ------------------------------------------------------------------------- */ template @@ -1524,8 +1646,8 @@ double r0inv; dulist(0,iatom,jnbor,2).im = 0.0; for (int j = 1; j <= twojmax; j++) { - int jju = idxu_block[j]; - int jjup = idxu_block[j-1]; + int jju = idxu_cache_block[j]; + int jjup = idxu_cache_block[j-1]; Kokkos::parallel_for(Kokkos::ThreadVectorRange(team,(j+2)/2), [&] (const int& mb) { //for (int mb = 0; 2*mb <= j; mb++) { @@ -1568,33 +1690,32 @@ double r0inv; b_i * dulist(jjup_index,iatom,jnbor,k).re); } } - }); - // copy left side to right side with inversion symmetry VMK 4.4(2) - // u[ma-j][mb-j] = (-1)^(ma-mb)*Conj([u[ma][mb]) + // Only need to add one symmetrized row for convenience + // Symmetry gets "unfolded" during the dedr accumulation - jju = idxu_block[j]; - jjup = jju+(j+1)*(j+1)-1; - Kokkos::parallel_for(Kokkos::ThreadVectorRange(team,(j+2)/2), - [&] (const int& mb) { -// for (int mb = 0; 2*mb <= j; mb++) { - int mbpar = (mb)%2==0?1:-1; - int mapar = mbpar; - for (int ma = 0; ma <= j; ma++) { - const int jju_index = jju+mb*(j+1)+ma; - const int jjup_index = jjup-mb*(j+1)-ma; - if (mapar == 1) { - for (int k = 0; k < 3; k++) { - dulist(jjup_index,iatom,jnbor,k).re = dulist(jju_index,iatom,jnbor,k).re; - dulist(jjup_index,iatom,jnbor,k).im = -dulist(jju_index,iatom,jnbor,k).im; - } - } else { - for (int k = 0; k < 3; k++) { - dulist(jjup_index,iatom,jnbor,k).re = -dulist(jju_index,iatom,jnbor,k).re; - dulist(jjup_index,iatom,jnbor,k).im = dulist(jju_index,iatom,jnbor,k).im; + // copy left side to right side with inversion symmetry VMK 4.4(2) + // u[ma-j][mb-j] = (-1)^(ma-mb)*Conj([u[ma][mb]) + + if (j%2==1 && mb==(j/2)) { + const int mbpar = (mb)%2==0?1:-1; + int mapar = mbpar; + for (int ma = 0; ma <= j; ma++) { + const int jju_index = jju+mb*(j+1)+ma; + const int jjup_index = jju+(mb+2)*(j+1)-(ma+1); + if (mapar == 1) { + for (int k = 0; k < 3; k++) { + dulist(jjup_index,iatom,jnbor,k).re = dulist(jju_index,iatom,jnbor,k).re; + dulist(jjup_index,iatom,jnbor,k).im = -dulist(jju_index,iatom,jnbor,k).im; + } + } else { + for (int k = 0; k < 3; k++) { + dulist(jjup_index,iatom,jnbor,k).re = -dulist(jju_index,iatom,jnbor,k).re; + dulist(jjup_index,iatom,jnbor,k).im = dulist(jju_index,iatom,jnbor,k).im; + } } + mapar = -mapar; } - mapar = -mapar; } }); } @@ -1605,8 +1726,11 @@ double r0inv; sfac *= wj; dsfac *= wj; + // Even though we fill out a full "cached" data layout above, + // we only need the "half" data for the accumulation into dedr. + // Thus we skip updating any unnecessary data. for (int j = 0; j <= twojmax; j++) { - int jju = idxu_block[j]; + int jju = idxu_cache_block[j]; for (int mb = 0; 2*mb <= j; mb++) for (int ma = 0; ma <= j; ma++) { dulist(jju,iatom,jnbor,0).re = dsfac * ulist(jju,iatom,jnbor).re * ux + @@ -1980,6 +2104,24 @@ double SNAKokkos::compute_dsfac(double r, double rcut) return 0.0; } +template +KOKKOS_INLINE_FUNCTION +void SNAKokkos::compute_s_dsfac(const double r, const double rcut, double& sfac, double& dsfac) { + if (switch_flag == 0) { sfac = 0.; dsfac = 0.; } + else if (switch_flag == 1) { + if (r <= rmin0) { sfac = 1.0; dsfac = 0.0; } + else if (r > rcut) { sfac = 0.; dsfac = 0.; } + else { + const double rcutfac = MY_PI / (rcut - rmin0); + double sn, cs; + sincos((r - rmin0) * rcutfac, &sn, &cs); + sfac = 0.5 * (cs + 1.0); + dsfac = -0.5 * sn * rcutfac; + + } + } else { sfac = 0.; dsfac = 0.; } +} + /* ---------------------------------------------------------------------- */ // efficient complex FMA (i.e., y += a x) @@ -2030,31 +2172,32 @@ double SNAKokkos::memory_usage() bytes += idxcg_max * sizeof(double); // cglist #ifdef LMP_KOKKOS_GPU - if (std::is_same::value) { - int natom_pad = ((natom + 32 - 1) / 32) * 32; // for AoSoA layouts + if (!host_flag) { - bytes += natom * idxu_max * nelements * sizeof(double); // ulisttot_re - bytes += natom * idxu_max * nelements * sizeof(double); // ulisttot_im + auto natom_pad = (natom+32-1)/32; + + bytes += natom * idxu_half_max * nelements * sizeof(double); // ulisttot_re + bytes += natom * idxu_half_max * nelements * sizeof(double); // ulisttot_im bytes += natom_pad * idxu_max * nelements * sizeof(double) * 2; // ulisttot_pack bytes += natom_pad * idxz_max * ndoubles * sizeof(double) * 2; // zlist_pack bytes += natom_pad * idxb_max * ntriples * sizeof(double); // blist_pack - bytes += natom_pad * idxu_max * nelements * sizeof(double); // ylist_pack_re - bytes += natom_pad * idxu_max * nelements * sizeof(double); // ylist_pack_im - bytes += natom * idxu_max * nelements * sizeof(double) * 2; // ylist + bytes += natom_pad * idxu_half_max * nelements * sizeof(double); // ylist_pack_re + bytes += natom_pad * idxu_half_max * nelements * sizeof(double); // ylist_pack_im + bytes += natom * idxu_half_max * nelements * sizeof(double) * 2; // ylist } else { #endif - bytes += natom * nmax * idxu_max * sizeof(double) * 2; // ulist - bytes += natom * idxu_max * nelements * sizeof(double) * 2; // ulisttot + bytes += natom * nmax * idxu_cache_max * sizeof(double) * 2; // ulist + bytes += natom * idxu_half_max * nelements * sizeof(double) * 2; // ulisttot bytes += natom * idxz_max * ndoubles * sizeof(double) * 2; // zlist bytes += natom * idxb_max * ntriples * sizeof(double); // blist - bytes += natom * idxu_max * nelements * sizeof(double) * 2; // ylist + bytes += natom * idxu_half_max * nelements * sizeof(double) * 2; // ylist - bytes += natom * nmax * idxu_max * 3 * sizeof(double) * 2; // dulist + bytes += natom * nmax * idxu_cache_max * 3 * sizeof(double) * 2; // dulist #ifdef LMP_KOKKOS_GPU } #endif @@ -2063,6 +2206,8 @@ double SNAKokkos::memory_usage() bytes += jdim * jdim * jdim * sizeof(int); // idxcg_block bytes += jdim * sizeof(int); // idxu_block + bytes += jdim * sizeof(int); // idxu_half_block + bytes += jdim * sizeof(int); // idxu_cache_block bytes += jdim * jdim * jdim * sizeof(int); // idxz_block bytes += jdim * jdim * jdim * sizeof(int); // idxb_block diff --git a/src/KSPACE/ewald.cpp b/src/KSPACE/ewald.cpp index efb35d42b8..51e19f7637 100644 --- a/src/KSPACE/ewald.cpp +++ b/src/KSPACE/ewald.cpp @@ -19,19 +19,17 @@ ------------------------------------------------------------------------- */ #include "ewald.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "pair.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "pair.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -41,11 +39,11 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp), - kxvecs(NULL), kyvecs(NULL), kzvecs(NULL), ug(NULL), eg(NULL), vg(NULL), - ek(NULL), sfacrl(NULL), sfacim(NULL), sfacrl_all(NULL), sfacim_all(NULL), - cs(NULL), sn(NULL), sfacrl_A(NULL), sfacim_A(NULL), sfacrl_A_all(NULL), - sfacim_A_all(NULL), sfacrl_B(NULL), sfacim_B(NULL), sfacrl_B_all(NULL), - sfacim_B_all(NULL) + kxvecs(nullptr), kyvecs(nullptr), kzvecs(nullptr), ug(nullptr), eg(nullptr), vg(nullptr), + ek(nullptr), sfacrl(nullptr), sfacim(nullptr), sfacrl_all(nullptr), sfacim_all(nullptr), + cs(nullptr), sn(nullptr), sfacrl_A(nullptr), sfacim_A(nullptr), sfacrl_A_all(nullptr), + sfacim_A_all(nullptr), sfacrl_B(nullptr), sfacim_B(nullptr), sfacrl_B_all(nullptr), + sfacim_B_all(nullptr) { group_allocate_flag = 0; kmax_created = 0; @@ -55,14 +53,14 @@ Ewald::Ewald(LAMMPS *lmp) : KSpace(lmp), accuracy_relative = 0.0; kmax = 0; - kxvecs = kyvecs = kzvecs = NULL; - ug = NULL; - eg = vg = NULL; - sfacrl = sfacim = sfacrl_all = sfacim_all = NULL; + kxvecs = kyvecs = kzvecs = nullptr; + ug = nullptr; + eg = vg = nullptr; + sfacrl = sfacim = sfacrl_all = sfacim_all = nullptr; nmax = 0; - ek = NULL; - cs = sn = NULL; + ek = nullptr; + cs = sn = nullptr; kcount = 0; } @@ -71,7 +69,7 @@ void Ewald::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal kspace_style ewald command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- @@ -123,7 +121,7 @@ void Ewald::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole.cpp b/src/KSPACE/ewald_dipole.cpp index 1921b8dc55..ae2596ffee 100644 --- a/src/KSPACE/ewald_dipole.cpp +++ b/src/KSPACE/ewald_dipole.cpp @@ -16,22 +16,20 @@ ------------------------------------------------------------------------- */ #include "ewald_dipole.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "pair.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "math_const.h" #include "math_special.h" #include "memory.h" -#include "error.h" +#include "pair.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -42,12 +40,12 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ EwaldDipole::EwaldDipole(LAMMPS *lmp) : Ewald(lmp), - tk(NULL), vc(NULL) + tk(nullptr), vc(nullptr) { ewaldflag = dipoleflag = 1; group_group_enable = 0; - tk = NULL; - vc = NULL; + tk = nullptr; + vc = nullptr; } /* ---------------------------------------------------------------------- @@ -114,7 +112,7 @@ void EwaldDipole::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_dipole_spin.cpp b/src/KSPACE/ewald_dipole_spin.cpp index bdbb737de8..67f49f87cf 100644 --- a/src/KSPACE/ewald_dipole_spin.cpp +++ b/src/KSPACE/ewald_dipole_spin.cpp @@ -16,21 +16,19 @@ ------------------------------------------------------------------------- */ #include "ewald_dipole_spin.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "pair.h" #include "domain.h" +#include "error.h" +#include "force.h" #include "math_const.h" #include "memory.h" -#include "error.h" +#include "pair.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -104,7 +102,7 @@ void EwaldDipoleSpin::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); double cutoff = *p_cutoff; diff --git a/src/KSPACE/ewald_disp.cpp b/src/KSPACE/ewald_disp.cpp index b40e3cd34b..4de393c8f6 100644 --- a/src/KSPACE/ewald_disp.cpp +++ b/src/KSPACE/ewald_disp.cpp @@ -16,23 +16,21 @@ ------------------------------------------------------------------------- */ #include "ewald_disp.h" -#include -#include -#include -#include -#include "math_vector.h" -#include "math_const.h" -#include "math_special.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "pair.h" #include "domain.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "math_const.h" +#include "math_special.h" +#include "math_vector.h" +#include "memory.h" +#include "pair.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -45,21 +43,21 @@ using namespace MathSpecial; /* ---------------------------------------------------------------------- */ EwaldDisp::EwaldDisp(LAMMPS *lmp) : KSpace(lmp), - kenergy(NULL), kvirial(NULL), energy_self_peratom(NULL), virial_self_peratom(NULL), - ekr_local(NULL), hvec(NULL), kvec(NULL), B(NULL), cek_local(NULL), cek_global(NULL) + kenergy(nullptr), kvirial(nullptr), energy_self_peratom(nullptr), virial_self_peratom(nullptr), + ekr_local(nullptr), hvec(nullptr), kvec(nullptr), B(nullptr), cek_local(nullptr), cek_global(nullptr) { ewaldflag = dispersionflag = dipoleflag = 1; memset(function, 0, EWALD_NFUNCS*sizeof(int)); - kenergy = kvirial = NULL; - cek_local = cek_global = NULL; - ekr_local = NULL; - hvec = NULL; - kvec = NULL; - B = NULL; + kenergy = kvirial = nullptr; + cek_local = cek_global = nullptr; + ekr_local = nullptr; + hvec = nullptr; + kvec = nullptr; + B = nullptr; first_output = 0; - energy_self_peratom = NULL; - virial_self_peratom = NULL; + energy_self_peratom = nullptr; + virial_self_peratom = nullptr; nmax = 0; q2 = 0; b2 = 0; @@ -69,7 +67,7 @@ EwaldDisp::EwaldDisp(LAMMPS *lmp) : KSpace(lmp), void EwaldDisp::settings(int narg, char **arg) { if (narg!=1) error->all(FLERR,"Illegal kspace_style ewald/n command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } @@ -111,8 +109,8 @@ void EwaldDisp::init() int tmp; Pair *pair = force->pair; - int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL; - double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL; + int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : nullptr; + double *cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : nullptr; if (!(ptr||cutoff)) error->all(FLERR,"KSpace style is incompatible with Pair style"); int ewald_order = ptr ? *((int *) ptr) : 1<<1; @@ -425,12 +423,12 @@ void EwaldDisp::deallocate_peratom() // free memory { if (energy_self_peratom) { memory->destroy(energy_self_peratom); - energy_self_peratom = NULL; + energy_self_peratom = nullptr; } if (virial_self_peratom) { memory->destroy(virial_self_peratom); - virial_self_peratom = NULL; + virial_self_peratom = nullptr; } } @@ -438,12 +436,12 @@ void EwaldDisp::deallocate_peratom() // free memory void EwaldDisp::deallocate() // free memory { - delete [] hvec; hvec = NULL; - delete [] kvec; kvec = NULL; - delete [] kenergy; kenergy = NULL; - delete [] kvirial; kvirial = NULL; - delete [] cek_local; cek_local = NULL; - delete [] cek_global; cek_global = NULL; + delete [] hvec; hvec = nullptr; + delete [] kvec; kvec = nullptr; + delete [] kenergy; kenergy = nullptr; + delete [] kvirial; kvirial = nullptr; + delete [] cek_local; cek_local = nullptr; + delete [] cek_global; cek_global = nullptr; } /* ---------------------------------------------------------------------- */ @@ -728,7 +726,7 @@ void EwaldDisp::compute_ek() { cvector *ekr = ekr_local; int lbytes = (2*nbox+1)*sizeof(cvector); - hvector *h = NULL; + hvector *h = nullptr; kvector *k, *nk = kvec+nkvec; cvector *z = new cvector[2*nbox+1]; cvector z1, *zx, *zy, *zz, *zn = z+2*nbox; @@ -736,7 +734,7 @@ void EwaldDisp::compute_ek() vector mui; double *x = atom->x[0], *xn = x+3*atom->nlocal, *q = atom->q, qi = 0.0; double bi = 0.0, ci[7]; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; int i, kx, ky, n = nkvec*nsums, *type = atom->type, tri = domain->triclinic; int func[EWALD_NFUNCS]; @@ -808,8 +806,8 @@ void EwaldDisp::compute_force() vector sum[EWALD_MAX_NSUMS], mui = COMPLEX_NULL; complex *cek, zc, zx = COMPLEX_NULL, zxy = COMPLEX_NULL; complex *cek_coul; - double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = NULL; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *f = atom->f[0], *fn = f+3*atom->nlocal, *q = atom->q, *t = nullptr; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double *ke, c[EWALD_NFUNCS] = { 8.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(12.0*volume), @@ -1004,7 +1002,7 @@ void EwaldDisp::compute_energy_peratom() complex *cek_coul; double *q = atom->q; double *eatomj = eatom; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double *ke = kenergy; double c[EWALD_NFUNCS] = { @@ -1161,8 +1159,8 @@ void EwaldDisp::compute_virial_dipole() double sum_total[6]; complex *cek, zc, zx = COMPLEX_NULL, zxy = COMPLEX_NULL; complex *cek_coul; - double *mu = atom->mu ? atom->mu[0] : NULL; - double *vatomj = NULL; + double *mu = atom->mu ? atom->mu[0] : nullptr; + double *vatomj = nullptr; if (vflag_atom && vatom) vatomj = vatom[0]; const double qscale = force->qqrd2e * scale; double *ke, c[EWALD_NFUNCS] = { @@ -1257,8 +1255,8 @@ void EwaldDisp::compute_virial_peratom() complex *cek_coul; double *kv; double *q = atom->q; - double *vatomj = vatom ? vatom[0] : NULL; - double *mu = atom->mu ? atom->mu[0] : NULL; + double *vatomj = vatom ? vatom[0] : nullptr; + double *mu = atom->mu ? atom->mu[0] : nullptr; const double qscale = force->qqrd2e * scale; double c[EWALD_NFUNCS] = { 4.0*MY_PI*qscale/volume, 2.0*MY_PI*MY_PIS/(24.0*volume), diff --git a/src/KSPACE/fft3d.cpp b/src/KSPACE/fft3d.cpp index 3e4d131d3a..d5ca88c0df 100644 --- a/src/KSPACE/fft3d.cpp +++ b/src/KSPACE/fft3d.cpp @@ -198,6 +198,7 @@ void fft_3d(FFT_DATA *in, FFT_DATA *out, int flag, struct fft_plan_3d *plan) (FFT_SCALAR *) plan->scratch, plan->post_plan); // scaling if required + if (flag == 1 && plan->scaled) { norm = plan->norm; num = plan->normnum; @@ -278,7 +279,7 @@ struct fft_plan_3d *fft_3d_create_plan( // allocate memory for plan data struct plan = (struct fft_plan_3d *) malloc(sizeof(struct fft_plan_3d)); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; // remap from initial distribution to layout needed for 1st set of 1d FFTs // not needed if all procs own entire fast axis initially @@ -298,7 +299,7 @@ struct fft_plan_3d *fft_3d_create_plan( first_jhi = in_jhi; first_klo = in_klo; first_khi = in_khi; - plan->pre_plan = NULL; + plan->pre_plan = nullptr; } else { first_ilo = 0; first_ihi = nfast - 1; @@ -310,7 +311,7 @@ struct fft_plan_3d *fft_3d_create_plan( remap_3d_create_plan(comm,in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, first_ilo,first_ihi,first_jlo,first_jhi, first_klo,first_khi,2,0,0,FFT_PRECISION,0); - if (plan->pre_plan == NULL) return NULL; + if (plan->pre_plan == nullptr) return nullptr; } // 1d FFTs along fast axis @@ -335,7 +336,7 @@ struct fft_plan_3d *fft_3d_create_plan( second_ilo,second_ihi,second_jlo,second_jhi, second_klo,second_khi,2,1,0,FFT_PRECISION, usecollective); - if (plan->mid1_plan == NULL) return NULL; + if (plan->mid1_plan == nullptr) return nullptr; // 1d FFTs along mid axis @@ -376,7 +377,7 @@ struct fft_plan_3d *fft_3d_create_plan( second_ilo,second_ihi, third_jlo,third_jhi,third_klo,third_khi, third_ilo,third_ihi,2,1,0,FFT_PRECISION,usecollective); - if (plan->mid2_plan == NULL) return NULL; + if (plan->mid2_plan == nullptr) return nullptr; // 1d FFTs along slow axis @@ -397,7 +398,7 @@ struct fft_plan_3d *fft_3d_create_plan( MPI_Allreduce(&flag,&remapflag,1,MPI_INT,MPI_MAX,comm); if (remapflag == 0) - plan->post_plan = NULL; + plan->post_plan = nullptr; else { plan->post_plan = remap_3d_create_plan(comm, @@ -405,7 +406,7 @@ struct fft_plan_3d *fft_3d_create_plan( third_jlo,third_jhi, out_klo,out_khi,out_ilo,out_ihi, out_jlo,out_jhi,2,(permute+1)%3,0,FFT_PRECISION,0); - if (plan->post_plan == NULL) return NULL; + if (plan->post_plan == nullptr) return nullptr; } // configure plan memory pointers and allocate work space @@ -466,15 +467,15 @@ struct fft_plan_3d *fft_3d_create_plan( if (copy_size) { plan->copy = (FFT_DATA *) malloc(copy_size*sizeof(FFT_DATA)); - if (plan->copy == NULL) return NULL; + if (plan->copy == nullptr) return nullptr; } - else plan->copy = NULL; + else plan->copy = nullptr; if (scratch_size) { plan->scratch = (FFT_DATA *) malloc(scratch_size*sizeof(FFT_DATA)); - if (plan->scratch == NULL) return NULL; + if (plan->scratch == nullptr) return nullptr; } - else plan->scratch = NULL; + else plan->scratch = nullptr; // system specific pre-computation of 1d FFT coeffs // and scaling normalization @@ -526,47 +527,47 @@ struct fft_plan_3d *fft_3d_create_plan( plan->plan_fast_forward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_fast_backward = FFTW_API(plan_many_dft)(1, &nfast,plan->total1/plan->length1, - NULL,&nfast,1,plan->length1, - NULL,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, + nullptr,&nfast,1,plan->length1, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_mid_forward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_mid_backward = FFTW_API(plan_many_dft)(1, &nmid,plan->total2/plan->length2, - NULL,&nmid,1,plan->length2, - NULL,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, + nullptr,&nmid,1,plan->length2, FFTW_BACKWARD,FFTW_ESTIMATE); plan->plan_slow_forward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_FORWARD,FFTW_ESTIMATE); plan->plan_slow_backward = FFTW_API(plan_many_dft)(1, &nslow,plan->total3/plan->length3, - NULL,&nslow,1,plan->length3, - NULL,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, + nullptr,&nslow,1,plan->length3, FFTW_BACKWARD,FFTW_ESTIMATE); #else /* FFT_KISS */ - plan->cfg_fast_forward = kiss_fft_alloc(nfast,0,NULL,NULL); - plan->cfg_fast_backward = kiss_fft_alloc(nfast,1,NULL,NULL); + plan->cfg_fast_forward = kiss_fft_alloc(nfast,0,nullptr,nullptr); + plan->cfg_fast_backward = kiss_fft_alloc(nfast,1,nullptr,nullptr); if (nmid == nfast) { plan->cfg_mid_forward = plan->cfg_fast_forward; plan->cfg_mid_backward = plan->cfg_fast_backward; } else { - plan->cfg_mid_forward = kiss_fft_alloc(nmid,0,NULL,NULL); - plan->cfg_mid_backward = kiss_fft_alloc(nmid,1,NULL,NULL); + plan->cfg_mid_forward = kiss_fft_alloc(nmid,0,nullptr,nullptr); + plan->cfg_mid_backward = kiss_fft_alloc(nmid,1,nullptr,nullptr); } if (nslow == nfast) { @@ -578,8 +579,8 @@ struct fft_plan_3d *fft_3d_create_plan( plan->cfg_slow_backward = plan->cfg_mid_backward; } else { - plan->cfg_slow_forward = kiss_fft_alloc(nslow,0,NULL,NULL); - plan->cfg_slow_backward = kiss_fft_alloc(nslow,1,NULL,NULL); + plan->cfg_slow_forward = kiss_fft_alloc(nslow,0,nullptr,nullptr); + plan->cfg_slow_backward = kiss_fft_alloc(nslow,1,nullptr,nullptr); } #endif diff --git a/src/KSPACE/fft3d_wrap.cpp b/src/KSPACE/fft3d_wrap.cpp index 507b23d27d..28af7aabbd 100644 --- a/src/KSPACE/fft3d_wrap.cpp +++ b/src/KSPACE/fft3d_wrap.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fft3d_wrap.h" -#include + #include "error.h" using namespace LAMMPS_NS; @@ -30,7 +30,7 @@ FFT3d::FFT3d(LAMMPS *lmp, MPI_Comm comm, int nfast, int nmid, int nslow, in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, scaled,permute,nbuf,usecollective); - if (plan == NULL) error->one(FLERR,"Could not create 3d FFT plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d FFT plan"); } /* ---------------------------------------------------------------------- */ diff --git a/src/KSPACE/fix_tune_kspace.cpp b/src/KSPACE/fix_tune_kspace.cpp index 8a7d49091a..c205f9de05 100644 --- a/src/KSPACE/fix_tune_kspace.cpp +++ b/src/KSPACE/fix_tune_kspace.cpp @@ -16,24 +16,22 @@ ------------------------------------------------------------------------- */ #include "fix_tune_kspace.h" -#include -#include -#include -#include + #include "comm.h" -#include "update.h" +#include "compute.h" +#include "error.h" #include "force.h" #include "info.h" #include "kspace.h" -#include "pair.h" -#include "error.h" -#include "memory.h" -#include "timer.h" -#include "neighbor.h" #include "modify.h" -#include "compute.h" -#include "utils.h" -#include "fmt/format.h" +#include "neighbor.h" +#include "pair.h" +#include "timer.h" +#include "update.h" + +#include +#include +#include #define SWAP(a,b) {temp=(a);(a)=(b);(b)=temp;} #define SIGN(a,b) ((b) >= 0.0 ? fabs(a) : -fabs(a)) @@ -64,7 +62,7 @@ FixTuneKspace::FixTuneKspace(LAMMPS *lmp, int narg, char **arg) : // parse arguments - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix tune/kspace command"); // set up reneighboring diff --git a/src/KSPACE/fix_tune_kspace.h b/src/KSPACE/fix_tune_kspace.h index 339f79626f..3e4db40344 100644 --- a/src/KSPACE/fix_tune_kspace.h +++ b/src/KSPACE/fix_tune_kspace.h @@ -21,7 +21,7 @@ FixStyle(tune/kspace,FixTuneKspace) #define LMP_FIX_TUNE_KSPACE_H #include "fix.h" -#include + namespace LAMMPS_NS { diff --git a/src/KSPACE/gridcomm.cpp b/src/KSPACE/gridcomm.cpp index 368e7370fe..1c013716ca 100644 --- a/src/KSPACE/gridcomm.cpp +++ b/src/KSPACE/gridcomm.cpp @@ -12,135 +12,242 @@ ------------------------------------------------------------------------- */ #include "gridcomm.h" -#include + +#include "comm.h" +#include "error.h" +#include "irregular.h" #include "kspace.h" #include "memory.h" using namespace LAMMPS_NS; -#define SWAPDELTA 8 +enum{REGULAR,TILED}; -/* ---------------------------------------------------------------------- */ +#define DELTA 16 -GridComm::GridComm(LAMMPS *lmp, MPI_Comm gcomm, int forward, int reverse, +/* ---------------------------------------------------------------------- + NOTES + tiled implementation only currently works for RCB, not general tiled + b/c RCB tree is used to find neighboring tiles + if o indices for ghosts are < 0 or hi indices are >= N, + then grid is treated as periodic in that dimension, + communication is done across the periodic boundaries +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + constructor called by all classes except MSM + gcomm = world communicator + gn xyz = size of global grid + i xyz lohi = portion of global grid this proc owns, 0 <= index < N + o xyz lohi = owned grid portion + ghost grid cells needed in all directions + if o indices are < 0 or hi indices are >= N, + then grid is treated as periodic in that dimension, + communication is done across the periodic boundaries +------------------------------------------------------------------------- */ + +GridComm::GridComm(LAMMPS *lmp, MPI_Comm gcomm, + int gnx, int gny, int gnz, int ixlo, int ixhi, int iylo, int iyhi, int izlo, int izhi, - int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi, - int pxlo, int pxhi, int pylo, int pyhi, int pzlo, int pzhi) + int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi) : Pointers(lmp) { - gridcomm = gcomm; - MPI_Comm_rank(gridcomm,&me); + if (comm->layout == Comm::LAYOUT_TILED) layout = TILED; + else layout = REGULAR; - nforward = forward; - nreverse = reverse; - - inxlo = ixlo; - inxhi = ixhi; - inylo = iylo; - inyhi = iyhi; - inzlo = izlo; - inzhi = izhi; - - outxlo = oxlo; - outxhi = oxhi; - outylo = oylo; - outyhi = oyhi; - outzlo = ozlo; - outzhi = ozhi; - - outxlo_max = oxlo; - outxhi_max = oxhi; - outylo_max = oylo; - outyhi_max = oyhi; - outzlo_max = ozlo; - outzhi_max = ozhi; - - procxlo = pxlo; - procxhi = pxhi; - procylo = pylo; - procyhi = pyhi; - proczlo = pzlo; - proczhi = pzhi; - - nswap = 0; - swap = NULL; - buf1 = buf2 = NULL; + if (layout == REGULAR) { + int (*procneigh)[2] = comm->procneigh; + initialize(gcomm,gnx,gny,gnz, + ixlo,ixhi,iylo,iyhi,izlo,izhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + procneigh[0][0],procneigh[0][1], + procneigh[1][0],procneigh[1][1], + procneigh[2][0],procneigh[2][1]); + } else { + initialize(gcomm,gnx,gny,gnz, + ixlo,ixhi,iylo,iyhi,izlo,izhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + 0,0,0,0,0,0); + } } -/* ---------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + constructor called by MSM + gcomm = world communicator or sub-communicator for a hierarchical grid + flag = 1 if e xyz lohi values = larger grid stored by caller in gcomm = world + flag = 2 if e xyz lohi values = 6 neighbor procs in gcomm + gn xyz = size of global grid + i xyz lohi = portion of global grid this proc owns, 0 <= index < N + o xyz lohi = owned grid portion + ghost grid cells needed in all directions + e xyz lohi for flag = 1: extent of larger grid stored by caller + e xyz lohi for flag = 2: 6 neighbor procs +------------------------------------------------------------------------- */ -GridComm::GridComm(LAMMPS *lmp, MPI_Comm gcomm, int forward, int reverse, +GridComm::GridComm(LAMMPS *lmp, MPI_Comm gcomm, int flag, + int gnx, int gny, int gnz, int ixlo, int ixhi, int iylo, int iyhi, int izlo, int izhi, int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi, - int oxlo_max, int oxhi_max, int oylo_max, int oyhi_max, - int ozlo_max, int ozhi_max, - int pxlo, int pxhi, int pylo, int pyhi, int pzlo, int pzhi) + int exlo, int exhi, int eylo, int eyhi, int ezlo, int ezhi) : Pointers(lmp) { - gridcomm = gcomm; - MPI_Comm_rank(gridcomm,&me); + if (comm->layout == Comm::LAYOUT_TILED) layout = TILED; + else layout = REGULAR; - nforward = forward; - nreverse = reverse; + if (flag == 1) { + if (layout == REGULAR) { + // this assumes gcomm = world + int (*procneigh)[2] = comm->procneigh; + initialize(gcomm,gnx,gny,gnz, + ixlo,ixhi,iylo,iyhi,izlo,izhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + exlo,exhi,eylo,eyhi,ezlo,ezhi, + procneigh[0][0],procneigh[0][1], + procneigh[1][0],procneigh[1][1], + procneigh[2][0],procneigh[2][1]); + } else { + initialize(gcomm,gnx,gny,gnz, + ixlo,ixhi,iylo,iyhi,izlo,izhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + exlo,exhi,eylo,eyhi,ezlo,ezhi, + 0,0,0,0,0,0); + } - inxlo = ixlo; - inxhi = ixhi; - inylo = iylo; - inyhi = iyhi; - inzlo = izlo; - inzhi = izhi; - - outxlo = oxlo; - outxhi = oxhi; - outylo = oylo; - outyhi = oyhi; - outzlo = ozlo; - outzhi = ozhi; - - outxlo_max = oxlo_max; - outxhi_max = oxhi_max; - outylo_max = oylo_max; - outyhi_max = oyhi_max; - outzlo_max = ozlo_max; - outzhi_max = ozhi_max; - - procxlo = pxlo; - procxhi = pxhi; - procylo = pylo; - procyhi = pyhi; - proczlo = pzlo; - proczhi = pzhi; - - nswap = 0; - swap = NULL; - buf1 = buf2 = NULL; + } else if (flag == 2) { + if (layout == REGULAR) { + initialize(gcomm,gnx,gny,gnz, + ixlo,ixhi,iylo,iyhi,izlo,izhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + oxlo,oxhi,oylo,oyhi,ozlo,ozhi, + exlo,exhi,eylo,eyhi,ezlo,ezhi); + } else { + error->all(FLERR,"GridComm does not support tiled layout with neighbor procs"); + } + } } /* ---------------------------------------------------------------------- */ GridComm::~GridComm() { + // regular comm data struct + for (int i = 0; i < nswap; i++) { memory->destroy(swap[i].packlist); memory->destroy(swap[i].unpacklist); } memory->sfree(swap); - memory->destroy(buf1); - memory->destroy(buf2); + // tiled comm data structs + + for (int i = 0; i < nsend; i++) + memory->destroy(send[i].packlist); + memory->sfree(send); + + for (int i = 0; i < nrecv; i++) + memory->destroy(recv[i].unpacklist); + memory->sfree(recv); + + for (int i = 0; i < ncopy; i++) { + memory->destroy(copy[i].packlist); + memory->destroy(copy[i].unpacklist); + } + memory->sfree(copy); + + delete [] requests; } /* ---------------------------------------------------------------------- - notify 6 neighbor procs how many ghost grid planes I need from them - ghostxlo = # of lower grid planes I own that are needed from me - by procxlo to become its upper ghost planes - ghostxhi = # of upper grid planes I own that are needed from me - by procxhi to become its lower ghost planes - if no neighbor proc, value is from self + store constructor args in local variables ------------------------------------------------------------------------- */ -void GridComm::ghost_notify() +void GridComm::initialize(MPI_Comm gcomm, + int gnx, int gny, int gnz, + int ixlo, int ixhi, int iylo, int iyhi, int izlo, int izhi, + int oxlo, int oxhi, int oylo, int oyhi, int ozlo, int ozhi, + int fxlo, int fxhi, int fylo, int fyhi, int fzlo, int fzhi, + int pxlo, int pxhi, int pylo, int pyhi, int pzlo, int pzhi) { + gridcomm = gcomm; + MPI_Comm_rank(gridcomm,&me); + MPI_Comm_size(gridcomm,&nprocs); + + nx = gnx; + ny = gny; + nz = gnz; + + inxlo = ixlo; + inxhi = ixhi; + inylo = iylo; + inyhi = iyhi; + inzlo = izlo; + inzhi = izhi; + + outxlo = oxlo; + outxhi = oxhi; + outylo = oylo; + outyhi = oyhi; + outzlo = ozlo; + outzhi = ozhi; + + fullxlo = fxlo; + fullxhi = fxhi; + fullylo = fylo; + fullyhi = fyhi; + fullzlo = fzlo; + fullzhi = fzhi; + + // for REGULAR layout, proc xyz lohi = my 6 neighbor procs in this MPI_Comm + + if (layout == REGULAR) { + procxlo = pxlo; + procxhi = pxhi; + procylo = pylo; + procyhi = pyhi; + proczlo = pzlo; + proczhi = pzhi; + } + + // internal data initializations + + nswap = maxswap = 0; + swap = nullptr; + + nsend = nrecv = ncopy = 0; + send = nullptr; + recv = nullptr; + copy = nullptr; + requests = nullptr; +} + +/* ---------------------------------------------------------------------- */ + +void GridComm::setup(int &nbuf1, int &nbuf2) +{ + if (layout == REGULAR) setup_regular(nbuf1,nbuf2); + else setup_tiled(nbuf1,nbuf2); +} + +/* ---------------------------------------------------------------------- + setup comm for a regular grid of procs + each proc has 6 neighbors + comm pattern = series of swaps with one of those 6 procs + can be multiple swaps with same proc if ghost extent is large + swap may not be symmetric if both procs do not need same layers of ghosts + all procs perform same # of swaps in a direction, even if some don't need it +------------------------------------------------------------------------- */ + +void GridComm::setup_regular(int &nbuf1, int &nbuf2) +{ + int nsent,sendfirst,sendlast,recvfirst,recvlast; + int sendplanes,recvplanes; + int notdoneme,notdone; + + // notify 6 neighbor procs how many ghost grid planes I need from them + // ghost xyz lo = # of my lower grid planes that proc xyz lo needs as its ghosts + // ghost xyz hi = # of my upper grid planes that proc xyz hi needs as its ghosts + // if this proc is its own neighbor across periodic bounary, value is from self + int nplanes = inxlo - outxlo; if (procxlo != me) MPI_Sendrecv(&nplanes,1,MPI_INT,procxlo,0, @@ -176,45 +283,11 @@ void GridComm::ghost_notify() MPI_Sendrecv(&nplanes,1,MPI_INT,proczhi,0, &ghostzlo,1,MPI_INT,proczlo,0,gridcomm,MPI_STATUS_IGNORE); else ghostzlo = nplanes; -} -/* ---------------------------------------------------------------------- - check if all ghost grid comm needs overlap into non nearest-neighbor proc - if yes, return 1, else return 0 -------------------------------------------------------------------------- */ + // setup swaps = exchange of grid data with one of 6 neighobr procs + // can be more than one in a direction if ghost region extends beyond neigh proc + // all procs have same swap count, but swapsize npack/nunpack can be empty -int GridComm::ghost_overlap() -{ - int nearest = 0; - if (ghostxlo > inxhi-inxlo+1) nearest = 1; - if (ghostxhi > inxhi-inxlo+1) nearest = 1; - if (ghostylo > inyhi-inylo+1) nearest = 1; - if (ghostyhi > inyhi-inylo+1) nearest = 1; - if (ghostzlo > inzhi-inzlo+1) nearest = 1; - if (ghostzhi > inzhi-inzlo+1) nearest = 1; - - int nearest_all; - MPI_Allreduce(&nearest,&nearest_all,1,MPI_INT,MPI_MIN,gridcomm); - - return nearest_all; -} - -/* ---------------------------------------------------------------------- - create swap stencil for grid own/ghost communication - swaps covers all 3 dimensions and both directions - swaps cover multiple iterations in a direction if need grid pts - from further away than nearest-neighbor proc - same swap list used by forward and reverse communication -------------------------------------------------------------------------- */ - -void GridComm::setup() -{ - int nsent,sendfirst,sendlast,recvfirst,recvlast; - int sendplanes,recvplanes; - int notdoneme,notdone; - - int maxswap = 6; - swap = (Swap *) memory->smalloc(maxswap*sizeof(Swap),"Commgrid:swap"); nswap = 0; // send own grid pts to -x processor, recv ghost grid pts from +x processor @@ -226,11 +299,7 @@ void GridComm::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += SWAPDELTA; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procxlo; swap[nswap].recvproc = procxhi; @@ -268,11 +337,7 @@ void GridComm::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += 1; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procxhi; swap[nswap].recvproc = procxlo; @@ -310,11 +375,7 @@ void GridComm::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += SWAPDELTA; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procylo; swap[nswap].recvproc = procyhi; @@ -352,11 +413,7 @@ void GridComm::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += 1; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = procyhi; swap[nswap].recvproc = procylo; @@ -394,11 +451,7 @@ void GridComm::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += SWAPDELTA; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = proczlo; swap[nswap].recvproc = proczhi; @@ -436,11 +489,7 @@ void GridComm::setup() notdone = 1; while (notdone) { - if (nswap == maxswap) { - maxswap += 1; - swap = (Swap *) - memory->srealloc(swap,maxswap*sizeof(Swap),"Commgrid:swap"); - } + if (nswap == maxswap) grow_swap(); swap[nswap].sendproc = proczhi; swap[nswap].recvproc = proczlo; @@ -469,98 +518,633 @@ void GridComm::setup() MPI_Allreduce(¬doneme,¬done,1,MPI_INT,MPI_SUM,gridcomm); } - // nbuf = max of any forward/reverse pack/unpack + // ngrid = max of any forward/reverse pack/unpack grid points - nbuf = 0; + int ngrid = 0; for (int i = 0; i < nswap; i++) { - nbuf = MAX(nbuf,swap[i].npack); - nbuf = MAX(nbuf,swap[i].nunpack); + ngrid = MAX(ngrid,swap[i].npack); + ngrid = MAX(ngrid,swap[i].nunpack); } - nbuf *= MAX(nforward,nreverse); - memory->create(buf1,nbuf,"Commgrid:buf1"); - memory->create(buf2,nbuf,"Commgrid:buf2"); + + nbuf1 = nbuf2 = ngrid; } /* ---------------------------------------------------------------------- - use swap list in forward order to acquire copy of all needed ghost grid pts + setup comm for RCB tiled proc domains + each proc has arbitrary # of neighbors that overlap its ghost extent + identify which procs will send me ghost cells, and vice versa + may not be symmetric if both procs do not need same layers of ghosts + comm pattern = post recvs for all my ghosts, send my owned, wait on recvs + no exchanges by dimension, unlike CommTiled forward/reverse comm of particles ------------------------------------------------------------------------- */ -void GridComm::forward_comm(KSpace *kspace, int which) +void GridComm::setup_tiled(int &nbuf1, int &nbuf2) { - for (int m = 0; m < nswap; m++) { + int i,m; + double xlo,xhi,ylo,yhi,zlo,zhi; + int ghostbox[6],pbc[3]; + + // setup RCB tree of cut info for grid + // access CommTiled to get cut dimension + // cut = this proc's inlo in that dim + // dim is -1 for proc 0, but never accessed + + rcbinfo = (RCBinfo *) + memory->smalloc(nprocs*sizeof(RCBinfo),"GridComm:rcbinfo"); + RCBinfo rcbone; + rcbone.dim = comm->rcbcutdim; + if (rcbone.dim <= 0) rcbone.cut = inxlo; + else if (rcbone.dim == 1) rcbone.cut = inylo; + else if (rcbone.dim == 2) rcbone.cut = inzlo; + MPI_Allgather(&rcbone,sizeof(RCBinfo),MPI_CHAR, + rcbinfo,sizeof(RCBinfo),MPI_CHAR,gridcomm); + + // find overlaps of my extended ghost box with all other procs + // accounts for crossings of periodic boundaries + // noverlap = # of overlaps, including self + // overlap = vector of overlap info using Overlap data struct + + ghostbox[0] = outxlo; + ghostbox[1] = outxhi; + ghostbox[2] = outylo; + ghostbox[3] = outyhi; + ghostbox[4] = outzlo; + ghostbox[5] = outzhi; + + pbc[0] = pbc[1] = pbc[2] = 0; + + memory->create(overlap_procs,nprocs,"GridComm:overlap_procs"); + noverlap = maxoverlap = 0; + overlap = nullptr; + + ghost_box_drop(ghostbox,pbc); + + // send each proc an overlap message + // content: me, index of my overlap, box that overlaps with its owned cells + // ncopy = # of overlaps with myself, across a periodic boundary + + int *proclist; + memory->create(proclist,noverlap,"GridComm:proclist"); + srequest = (Request *) + memory->smalloc(noverlap*sizeof(Request),"GridComm:srequest"); + + int nsend_request = 0; + ncopy = 0; + + for (m = 0; m < noverlap; m++) { + if (overlap[m].proc == me) ncopy++; + else { + proclist[nsend_request] = overlap[m].proc; + srequest[nsend_request].sender = me; + srequest[nsend_request].index = m; + for (i = 0; i < 6; i++) + srequest[nsend_request].box[i] = overlap[m].box[i]; + nsend_request++; + } + } + + Irregular *irregular = new Irregular(lmp); + int nrecv_request = irregular->create_data(nsend_request,proclist,1); + Request *rrequest = + (Request *) memory->smalloc(nrecv_request*sizeof(Request),"GridComm:rrequest"); + irregular->exchange_data((char *) srequest,sizeof(Request),(char *) rrequest); + irregular->destroy_data(); + + // compute overlaps between received ghost boxes and my owned box + // overlap box used to setup my Send data struct and respond to requests + + send = (Send *) memory->smalloc(nrecv_request*sizeof(Send),"GridComm:send"); + sresponse = (Response *) + memory->smalloc(nrecv_request*sizeof(Response),"GridComm:sresponse"); + memory->destroy(proclist); + memory->create(proclist,nrecv_request,"GridComm:proclist"); + + for (m = 0; m < nrecv_request; m++) { + send[m].proc = rrequest[m].sender; + xlo = MAX(rrequest[m].box[0],inxlo); + xhi = MIN(rrequest[m].box[1],inxhi); + ylo = MAX(rrequest[m].box[2],inylo); + yhi = MIN(rrequest[m].box[3],inyhi); + zlo = MAX(rrequest[m].box[4],inzlo); + zhi = MIN(rrequest[m].box[5],inzhi); + send[m].npack = indices(send[m].packlist,xlo,xhi,ylo,yhi,zlo,zhi); + + proclist[m] = rrequest[m].sender; + sresponse[m].index = rrequest[m].index; + sresponse[m].box[0] = xlo; + sresponse[m].box[1] = xhi; + sresponse[m].box[2] = ylo; + sresponse[m].box[3] = yhi; + sresponse[m].box[4] = zlo; + sresponse[m].box[5] = zhi; + } + + nsend = nrecv_request; + + // reply to each Request message with a Response message + // content: index for the overlap on requestor, overlap box on my owned grid + + int nsend_response = nrecv_request; + int nrecv_response = irregular->create_data(nsend_response,proclist,1); + Response *rresponse = + (Response *) memory->smalloc(nrecv_response*sizeof(Response),"GridComm:rresponse"); + irregular->exchange_data((char *) sresponse,sizeof(Response),(char *) rresponse); + irregular->destroy_data(); + delete irregular; + + // process received responses + // box used to setup my Recv data struct after unwrapping via PBC + // adjacent = 0 if any box of ghost cells does not adjoin my owned cells + + recv = (Recv *) memory->smalloc(nrecv_response*sizeof(Recv),"GridComm:recv"); + adjacent = 1; + + for (i = 0; i < nrecv_response; i++) { + m = rresponse[i].index; + recv[i].proc = overlap[m].proc; + xlo = rresponse[i].box[0] + overlap[m].pbc[0] * nx; + xhi = rresponse[i].box[1] + overlap[m].pbc[0] * nx; + ylo = rresponse[i].box[2] + overlap[m].pbc[1] * ny; + yhi = rresponse[i].box[3] + overlap[m].pbc[1] * ny; + zlo = rresponse[i].box[4] + overlap[m].pbc[2] * nz; + zhi = rresponse[i].box[5] + overlap[m].pbc[2] * nz; + recv[i].nunpack = indices(recv[i].unpacklist,xlo,xhi,ylo,yhi,zlo,zhi); + + if (xlo != inxhi+1 && xhi != inxlo-1 && + ylo != inyhi+1 && yhi != inylo-1 && + zlo != inzhi+1 && zhi != inzlo-1) adjacent = 0; + } + + nrecv = nrecv_response; + + // create Copy data struct from overlaps with self + + copy = (Copy *) memory->smalloc(ncopy*sizeof(Copy),"GridComm:copy"); + + ncopy = 0; + for (m = 0; m < noverlap; m++) { + if (overlap[m].proc != me) continue; + xlo = overlap[m].box[0]; + xhi = overlap[m].box[1]; + ylo = overlap[m].box[2]; + yhi = overlap[m].box[3]; + zlo = overlap[m].box[4]; + zhi = overlap[m].box[5]; + copy[ncopy].npack = indices(copy[ncopy].packlist,xlo,xhi,ylo,yhi,zlo,zhi); + xlo = overlap[m].box[0] + overlap[m].pbc[0] * nx; + xhi = overlap[m].box[1] + overlap[m].pbc[0] * nx; + ylo = overlap[m].box[2] + overlap[m].pbc[1] * ny; + yhi = overlap[m].box[3] + overlap[m].pbc[1] * ny; + zlo = overlap[m].box[4] + overlap[m].pbc[2] * nz; + zhi = overlap[m].box[5] + overlap[m].pbc[2] * nz; + copy[ncopy].nunpack = indices(copy[ncopy].unpacklist,xlo,xhi,ylo,yhi,zlo,zhi); + ncopy++; + } + + // set offsets for received data + + int offset = 0; + for (m = 0; m < nsend; m++) { + send[m].offset = offset; + offset += send[m].npack; + } + + offset = 0; + for (m = 0; m < nrecv; m++) { + recv[m].offset = offset; + offset += recv[m].nunpack; + } + + // length of MPI requests vector is max of nsend, nrecv + + int nrequest = MAX(nsend,nrecv); + requests = new MPI_Request[nrequest]; + + // clean-up + + memory->sfree(rcbinfo); + memory->destroy(proclist); + memory->destroy(overlap_procs); + memory->sfree(overlap); + memory->sfree(srequest); + memory->sfree(rrequest); + memory->sfree(sresponse); + memory->sfree(rresponse); + + // nbuf1 = largest pack or unpack in any Send or Recv or Copy + // nbuf2 = larget of sum of all packs or unpacks in Send or Recv + + nbuf1 = 0; + + for (m = 0; m < ncopy; m++) { + nbuf1 = MAX(nbuf1,copy[m].npack); + nbuf1 = MAX(nbuf1,copy[m].nunpack); + } + + int nbufs = 0; + for (m = 0; m < nsend; m++) { + nbuf1 = MAX(nbuf1,send[m].npack); + nbufs += send[m].npack; + } + + int nbufr = 0; + for (m = 0; m < nrecv; m++) { + nbuf1 = MAX(nbuf1,recv[m].nunpack); + nbufr += recv[m].nunpack; + } + + nbuf2 = MAX(nbufs,nbufr); +} + +/* ---------------------------------------------------------------------- + recursively split a box until it doesn't overlap any periodic boundaries + box = 6 integers = (xlo,xhi,ylo,yhi,zlo,zhi) + each lo/hi value may extend beyonw 0 to N-1 into another periodic image + pbc = flags in each dim of which periodic image the caller box was in + when a box straddles a periodic bounadry, split it in two + when a box does not straddle, drop it down RCB tree + add all the procs it overlaps with to Overlap list +------------------------------------------------------------------------- */ + +void GridComm::ghost_box_drop(int *box, int *pbc) +{ + int i,m; + + // newbox12 and newpbc are initially copies of caller box and pbc + + int newbox1[6],newbox2[6],newpbc[3]; + + for (i = 0; i < 6; i++) newbox1[i] = newbox2[i] = box[i]; + for (i = 0; i < 3; i++) newpbc[i] = pbc[i]; + + // 6 if tests to see if box needs to be split across a periodic boundary + // newbox1 and 2 = new split boxes, newpbc increments current pbc + // final else is no split + + int splitflag = 1; + + if (box[0] < 0) { + newbox1[0] = 0; + newbox2[0] = box[0] + nx; + newbox2[1] = nx - 1; + newpbc[0]--; + } else if (box[1] >= nx) { + newbox1[1] = nx - 1; + newbox2[0] = 0; + newbox2[1] = box[1] - nx; + newpbc[0]++; + } else if (box[2] < 0) { + newbox1[2] = 0; + newbox2[2] = box[2] + ny; + newbox2[3] = ny - 1; + newpbc[1]--; + } else if (box[3] >= ny) { + newbox1[3] = ny - 1; + newbox2[2] = 0; + newbox2[3] = box[3] - ny; + newpbc[1]++; + } else if (box[4] < 0) { + newbox1[4] = 0; + newbox2[4] = box[4] + nz; + newbox2[5] = nz - 1; + newpbc[2]--; + } else if (box[5] >= nz) { + newbox1[5] = nz - 1; + newbox2[4] = 0; + newbox2[5] = box[5] - nz; + newpbc[2]++; + + // box is not split, drop on RCB tree + // returns nprocs = # of procs it overlaps, including self + // returns proc_overlap = list of proc IDs it overlaps + // skip self overlap if no crossing of periodic boundaries + // do not skip self if overlap is in another periodic image + + } else { + splitflag = 0; + int np = 0; + box_drop_grid(box,0,nprocs-1,np,overlap_procs); + for (m = 0; m < np; m++) { + if (noverlap == maxoverlap) grow_overlap(); + if (overlap_procs[m] == me && + pbc[0] == 0 && pbc[1] == 0 && pbc[2] == 0) continue; + overlap[noverlap].proc = overlap_procs[m]; + for (i = 0; i < 6; i++) overlap[noverlap].box[i] = box[i]; + for (i = 0; i < 3; i++) overlap[noverlap].pbc[i] = pbc[i]; + noverlap++; + } + } + + // recurse with 2 split boxes + + if (splitflag) { + ghost_box_drop(newbox1,pbc); + ghost_box_drop(newbox2,newpbc); + } +} + +/* ---------------------------------------------------------------------- + recursively drop a box down the RCB tree to find all procs it overlaps with + box = 6 integers = (xlo,xhi,ylo,yhi,zlo,zhi) + each lo/hi value ranges from 0 to N-1 in a dim, N = grid size in that dim + box is guaranteed to be wholly within the global domain + return Np = # of procs, plist = proc IDs +------------------------------------------------------------------------- */ + +void GridComm::box_drop_grid(int *box, int proclower, int procupper, + int &np, int *plist) +{ + // end recursion when partition is a single proc + // add proclower to plist + + if (proclower == procupper) { + plist[np++] = proclower; + return; + } + + // drop box on each side of cut it extends beyond + // use < and >= criteria so does not include a box it only touches + // procmid = 1st processor in upper half of partition + // = location in tree that stores this cut + // cut = index of first grid cell in upper partition + // dim = 0,1,2 dimension of cut + + int procmid = proclower + (procupper - proclower) / 2 + 1; + int dim = rcbinfo[procmid].dim; + int cut = rcbinfo[procmid].cut; + + if (box[2*dim] < cut) box_drop_grid(box,proclower,procmid-1,np,plist); + if (box[2*dim+1] >= cut) box_drop_grid(box,procmid,procupper,np,plist); +} + +/* ---------------------------------------------------------------------- + check if all procs only need ghost info from adjacent procs + return 1 if yes, 0 if no +------------------------------------------------------------------------- */ + +int GridComm::ghost_adjacent() +{ + if (layout == REGULAR) return ghost_adjacent_regular(); + return ghost_adjacent_tiled(); +} + +/* ---------------------------------------------------------------------- + adjacent = 0 if a proc's ghost xyz lohi values exceed its subdomain size + return 0 if adjacent=0 for any proc, else 1 +------------------------------------------------------------------------- */ + +int GridComm::ghost_adjacent_regular() +{ + adjacent = 1; + if (ghostxlo > inxhi-inxlo+1) adjacent = 0; + if (ghostxhi > inxhi-inxlo+1) adjacent = 0; + if (ghostylo > inyhi-inylo+1) adjacent = 0; + if (ghostyhi > inyhi-inylo+1) adjacent = 0; + if (ghostzlo > inzhi-inzlo+1) adjacent = 0; + if (ghostzhi > inzhi-inzlo+1) adjacent = 0; + + int adjacent_all; + MPI_Allreduce(&adjacent,&adjacent_all,1,MPI_INT,MPI_MIN,gridcomm); + return adjacent_all; +} + +/* ---------------------------------------------------------------------- + adjacent = 0 if a proc's received ghosts were flagged + as non-adjacent in setup_tiled() + return 0 if adjacent=0 for any proc, else 1 +------------------------------------------------------------------------- */ + +int GridComm::ghost_adjacent_tiled() +{ + int adjacent_all; + MPI_Allreduce(&adjacent,&adjacent_all,1,MPI_INT,MPI_MIN,gridcomm); + return adjacent_all; +} + +/* ---------------------------------------------------------------------- + forward comm of my owned cells to other's ghost cells +------------------------------------------------------------------------- */ + +void GridComm::forward_comm_kspace(KSpace *kspace, int nper, int nbyte, int which, + void *buf1, void *buf2, MPI_Datatype datatype) +{ + if (layout == REGULAR) + forward_comm_kspace_regular(kspace,nper,nbyte,which,buf1,buf2,datatype); + else + forward_comm_kspace_tiled(kspace,nper,nbyte,which,buf1,buf2,datatype); +} + +/* ---------------------------------------------------------------------- + forward comm on regular grid of procs via list of swaps with 6 neighbor procs +------------------------------------------------------------------------- */ + +void GridComm:: +forward_comm_kspace_regular(KSpace *kspace, int nper, int /*nbyte*/, int which, + void *buf1, void *buf2, MPI_Datatype datatype) +{ + int m; + MPI_Request request; + + for (m = 0; m < nswap; m++) { if (swap[m].sendproc == me) - kspace->pack_forward(which,buf2,swap[m].npack,swap[m].packlist); + kspace->pack_forward_grid(which,buf2,swap[m].npack,swap[m].packlist); else - kspace->pack_forward(which,buf1,swap[m].npack,swap[m].packlist); + kspace->pack_forward_grid(which,buf1,swap[m].npack,swap[m].packlist); if (swap[m].sendproc != me) { - MPI_Irecv(buf2,nforward*swap[m].nunpack,MPI_FFT_SCALAR, - swap[m].recvproc,0,gridcomm,&request); - MPI_Send(buf1,nforward*swap[m].npack,MPI_FFT_SCALAR, - swap[m].sendproc,0,gridcomm); - MPI_Wait(&request,MPI_STATUS_IGNORE); + if (swap[m].nunpack) MPI_Irecv(buf2,nper*swap[m].nunpack,datatype, + swap[m].recvproc,0,gridcomm,&request); + if (swap[m].npack) MPI_Send(buf1,nper*swap[m].npack,datatype, + swap[m].sendproc,0,gridcomm); + if (swap[m].nunpack) MPI_Wait(&request,MPI_STATUS_IGNORE); } - kspace->unpack_forward(which,buf2,swap[m].nunpack,swap[m].unpacklist); + kspace->unpack_forward_grid(which,buf2,swap[m].nunpack,swap[m].unpacklist); } } /* ---------------------------------------------------------------------- - use swap list in reverse order to compute fully summed value - for each owned grid pt that some other proc has copy of as a ghost grid pt + forward comm on tiled grid decomp via Send/Recv lists of each neighbor proc ------------------------------------------------------------------------- */ -void GridComm::reverse_comm(KSpace *kspace, int which) +void GridComm:: +forward_comm_kspace_tiled(KSpace *kspace, int nper, int nbyte, int which, + void *buf1, void *vbuf2, MPI_Datatype datatype) { - for (int m = nswap-1; m >= 0; m--) { + int i,m,offset; + + char *buf2 = (char *) vbuf2; + + // post all receives + + for (m = 0; m < nrecv; m++) { + offset = nper * recv[m].offset * nbyte; + MPI_Irecv((void *) &buf2[offset],nper*recv[m].nunpack,datatype, + recv[m].proc,0,gridcomm,&requests[m]); + } + + // perform all sends to other procs + + for (m = 0; m < nsend; m++) { + kspace->pack_forward_grid(which,buf1,send[m].npack,send[m].packlist); + MPI_Send(buf1,nper*send[m].npack,datatype,send[m].proc,0,gridcomm); + } + + // perform all copies to self + + for (m = 0; m < ncopy; m++) { + kspace->pack_forward_grid(which,buf1,copy[m].npack,copy[m].packlist); + kspace->unpack_forward_grid(which,buf1,copy[m].nunpack,copy[m].unpacklist); + } + + // unpack all received data + + for (i = 0; i < nrecv; i++) { + MPI_Waitany(nrecv,requests,&m,MPI_STATUS_IGNORE); + offset = nper * recv[m].offset * nbyte; + kspace->unpack_forward_grid(which,(void *) &buf2[offset], + recv[m].nunpack,recv[m].unpacklist); + } +} + +/* ---------------------------------------------------------------------- + reverse comm of my ghost cells to sum to owner cells +------------------------------------------------------------------------- */ + +void GridComm::reverse_comm_kspace(KSpace *kspace, int nper, int nbyte, int which, + void *buf1, void *buf2, MPI_Datatype datatype) +{ + if (layout == REGULAR) + reverse_comm_kspace_regular(kspace,nper,nbyte,which,buf1,buf2,datatype); + else + reverse_comm_kspace_tiled(kspace,nper,nbyte,which,buf1,buf2,datatype); +} + +/* ---------------------------------------------------------------------- + reverse comm on regular grid of procs via list of swaps with 6 neighbor procs +------------------------------------------------------------------------- */ + +void GridComm:: +reverse_comm_kspace_regular(KSpace *kspace, int nper, int /*nbyte*/, int which, + void *buf1, void *buf2, MPI_Datatype datatype) +{ + int m; + MPI_Request request; + + for (m = nswap-1; m >= 0; m--) { if (swap[m].recvproc == me) - kspace->pack_reverse(which,buf2,swap[m].nunpack,swap[m].unpacklist); + kspace->pack_reverse_grid(which,buf2,swap[m].nunpack,swap[m].unpacklist); else - kspace->pack_reverse(which,buf1,swap[m].nunpack,swap[m].unpacklist); + kspace->pack_reverse_grid(which,buf1,swap[m].nunpack,swap[m].unpacklist); if (swap[m].recvproc != me) { - MPI_Irecv(buf2,nreverse*swap[m].npack,MPI_FFT_SCALAR, - swap[m].sendproc,0,gridcomm,&request); - MPI_Send(buf1,nreverse*swap[m].nunpack,MPI_FFT_SCALAR, - swap[m].recvproc,0,gridcomm); - MPI_Wait(&request,MPI_STATUS_IGNORE); + if (swap[m].npack) MPI_Irecv(buf2,nper*swap[m].npack,datatype, + swap[m].sendproc,0,gridcomm,&request); + if (swap[m].nunpack) MPI_Send(buf1,nper*swap[m].nunpack,datatype, + swap[m].recvproc,0,gridcomm); + if (swap[m].npack) MPI_Wait(&request,MPI_STATUS_IGNORE); } - kspace->unpack_reverse(which,buf2,swap[m].npack,swap[m].packlist); + kspace->unpack_reverse_grid(which,buf2,swap[m].npack,swap[m].packlist); } } +/* ---------------------------------------------------------------------- + reverse comm on tiled grid decomp via Send/Recv lists of each neighbor proc +------------------------------------------------------------------------- */ + +void GridComm:: +reverse_comm_kspace_tiled(KSpace *kspace, int nper, int nbyte, int which, + void *buf1, void *vbuf2, MPI_Datatype datatype) +{ + int i,m,offset; + + char *buf2 = (char *) vbuf2; + + // post all receives + + for (m = 0; m < nsend; m++) { + offset = nper * send[m].offset * nbyte; + MPI_Irecv((void *) &buf2[offset],nper*send[m].npack,datatype, + send[m].proc,0,gridcomm,&requests[m]); + } + + // perform all sends to other procs + + for (m = 0; m < nrecv; m++) { + kspace->pack_reverse_grid(which,buf1,recv[m].nunpack,recv[m].unpacklist); + MPI_Send(buf1,nper*recv[m].nunpack,datatype,recv[m].proc,0,gridcomm); + } + + // perform all copies to self + + for (m = 0; m < ncopy; m++) { + kspace->pack_reverse_grid(which,buf1,copy[m].nunpack,copy[m].unpacklist); + kspace->unpack_reverse_grid(which,buf1,copy[m].npack,copy[m].packlist); + } + + // unpack all received data + + for (i = 0; i < nsend; i++) { + MPI_Waitany(nsend,requests,&m,MPI_STATUS_IGNORE); + offset = nper * send[m].offset * nbyte; + kspace->unpack_reverse_grid(which,(void *) &buf2[offset], + send[m].npack,send[m].packlist); + } +} + +/* ---------------------------------------------------------------------- + create swap stencil for grid own/ghost communication + swaps covers all 3 dimensions and both directions + swaps cover multiple iterations in a direction if need grid pts + from further away than nearest-neighbor proc + same swap list used by forward and reverse communication +------------------------------------------------------------------------- */ + +void GridComm::grow_swap() +{ + maxswap += DELTA; + swap = (Swap *) + memory->srealloc(swap,maxswap*sizeof(Swap),"GridComm:swap"); +} + +/* ---------------------------------------------------------------------- + create swap stencil for grid own/ghost communication + swaps covers all 3 dimensions and both directions + swaps cover multiple iterations in a direction if need grid pts + from further away than nearest-neighbor proc + same swap list used by forward and reverse communication +------------------------------------------------------------------------- */ + +void GridComm::grow_overlap() +{ + maxoverlap += DELTA; + overlap = (Overlap *) + memory->srealloc(overlap,maxoverlap*sizeof(Overlap),"GridComm:overlap"); +} + /* ---------------------------------------------------------------------- create 1d list of offsets into 3d array section (xlo:xhi,ylo:yhi,zlo:zhi) - assume 3d array is allocated as (outxlo_max:outxhi_max,outylo_max:outyhi_max, - outzlo_max:outzhi_max) + assume 3d array is allocated as + (fullxlo:fullxhi,fullylo:fullyhi,fullzlo:fullzhi) ------------------------------------------------------------------------- */ int GridComm::indices(int *&list, int xlo, int xhi, int ylo, int yhi, int zlo, int zhi) { int nmax = (xhi-xlo+1) * (yhi-ylo+1) * (zhi-zlo+1); - memory->create(list,nmax,"Commgrid:list"); + memory->create(list,nmax,"GridComm:indices"); + if (nmax == 0) return 0; - int nx = (outxhi_max-outxlo_max+1); - int ny = (outyhi_max-outylo_max+1); + int nx = (fullxhi-fullxlo+1); + int ny = (fullyhi-fullylo+1); int n = 0; int ix,iy,iz; for (iz = zlo; iz <= zhi; iz++) for (iy = ylo; iy <= yhi; iy++) for (ix = xlo; ix <= xhi; ix++) - list[n++] = (iz-outzlo_max)*ny*nx + (iy-outylo_max)*nx + (ix-outxlo_max); + list[n++] = (iz-fullzlo)*ny*nx + (iy-fullylo)*nx + (ix-fullxlo); return nmax; } - -/* ---------------------------------------------------------------------- - memory usage of send/recv bufs -------------------------------------------------------------------------- */ - -double GridComm::memory_usage() -{ - double bytes = 2*nbuf * sizeof(double); - return bytes; -} diff --git a/src/KSPACE/gridcomm.h b/src/KSPACE/gridcomm.h index faa6d5c4fb..97c914999f 100644 --- a/src/KSPACE/gridcomm.h +++ b/src/KSPACE/gridcomm.h @@ -16,55 +16,57 @@ #include "pointers.h" -#ifdef FFT_SINGLE -typedef float FFT_SCALAR; -#define MPI_FFT_SCALAR MPI_FLOAT -#else -typedef double FFT_SCALAR; -#define MPI_FFT_SCALAR MPI_DOUBLE -#endif - namespace LAMMPS_NS { class GridComm : protected Pointers { public: - GridComm(class LAMMPS *, MPI_Comm, int, int, + GridComm(class LAMMPS *, MPI_Comm, int, int, int, + int, int, int, int, int, int, + int, int, int, int, int, int); + GridComm(class LAMMPS *, MPI_Comm, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int, int); - GridComm(class LAMMPS *, MPI_Comm, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int, - int, int, int, int, int, int); - ~GridComm(); - void ghost_notify(); - int ghost_overlap(); - void setup(); - void forward_comm(class KSpace *, int); - void reverse_comm(class KSpace *, int); - double memory_usage(); + virtual ~GridComm(); + void setup(int &, int &); + int ghost_adjacent(); + void forward_comm_kspace(class KSpace *, int, int, int, + void *, void *, MPI_Datatype); + void reverse_comm_kspace(class KSpace *, int, int, int, + void *, void *, MPI_Datatype); - private: - int me; - int nforward,nreverse; - MPI_Comm gridcomm; - MPI_Request request; + protected: + int me,nprocs; + int layout; // REGULAR or TILED + MPI_Comm gridcomm; // communicator for this class + // usually world, but MSM calls with subset - // in = inclusive indices of 3d grid chunk that I own - // out = inclusive indices of 3d grid chunk I own plus ghosts I use - // proc = 6 neighbor procs that surround me - // ghost = # of my owned grid planes needed from me - // by each of 6 neighbor procs to become their ghost planes + // inputs from caller via constructor - int inxlo,inxhi,inylo,inyhi,inzlo,inzhi; - int outxlo,outxhi,outylo,outyhi,outzlo,outzhi; - int outxlo_max,outxhi_max,outylo_max,outyhi_max,outzlo_max,outzhi_max; - int procxlo,procxhi,procylo,procyhi,proczlo,proczhi; - int ghostxlo,ghostxhi,ghostylo,ghostyhi,ghostzlo,ghostzhi; + int nx,ny,nz; // size of global grid in all 3 dims + int inxlo,inxhi; // inclusive extent of my grid chunk + int inylo,inyhi; // 0 <= in <= N-1 + int inzlo,inzhi; + int outxlo,outxhi; // inclusive extent of my grid chunk plus + int outylo,outyhi; // ghost cells in all 6 directions + int outzlo,outzhi; // lo indices can be < 0, hi indices can be >= N + int fullxlo,fullxhi; // extent of grid chunk that caller stores + int fullylo,fullyhi; // can be same as out indices or larger + int fullzlo,fullzhi; - int nbuf; - FFT_SCALAR *buf1,*buf2; + // ------------------------------------------- + // internal variables for REGULAR layout + // ------------------------------------------- + + int procxlo,procxhi; // 6 neighbor procs that adjoin me + int procylo,procyhi; // not used for comm_style = tiled + int proczlo,proczhi; + + int ghostxlo,ghostxhi; // # of my owned grid planes needed + int ghostylo,ghostyhi; // by neighobr procs in each dir as their ghost planes + int ghostzlo,ghostzhi; + + // swap = exchange of owned and ghost grid cells between 2 procs, including self struct Swap { int sendproc; // proc to send to for forward comm @@ -75,9 +77,130 @@ class GridComm : protected Pointers { int *unpacklist; // 3d array offsets to unpack }; - int nswap; + int nswap,maxswap; Swap *swap; + // ------------------------------------------- + // internal variables for TILED layout + // ------------------------------------------- + + int *overlap_procs; // length of Nprocs in communicator + MPI_Request *requests; // length of max messages this proc receives + + // RCB tree of cut info + // each proc contributes one value, except proc 0 + + struct RCBinfo { + int dim; // 0,1,2 = which dim the cut is in + int cut; // grid index of lowest cell in upper half of cut + }; + + RCBinfo *rcbinfo; + + // overlap = a proc whose owned cells overlap with my extended ghost box + // includes overlaps across periodic boundaries, can also be self + + struct Overlap { + int proc; // proc whose owned cells overlap my ghost cells + int box[6]; // box that overlaps otherproc's owned cells + // this box is wholly contained within global grid + int pbc[3]; // PBC offsets to convert box to a portion of my ghost box + // my ghost box may extend beyond global grid + }; + + int noverlap,maxoverlap; + Overlap *overlap; + + // request = sent to each proc whose owned cells overlap my ghost cells + + struct Request { + int sender; // sending proc + int index; // index of overlap on sender + int box[6]; // box that overlaps receiver's owned cells + // wholly contained within global grid + }; + + Request *srequest,*rrequest; + + // response = reply from each proc whose owned cells overlap my ghost cells + + struct Response { + int index; // index of my overlap for the initial request + int box[6]; // box that overlaps responder's owned cells + // wholly contained within global grid + // has to unwrapped by PBC to map to my ghost cells + }; + + Response *sresponse,*rresponse; + + // send = proc to send a subset of my owned cells to, for forward comm + // for reverse comm, proc I receive ghost overlaps with my owned cells from + // offset used in reverse comm to recv a message in middle of a large buffer + + struct Send { + int proc; + int npack; + int *packlist; + int offset; + }; + + // recv = proc to recv a subset of my ghost cells from, for forward comm + // for reverse comm, proc I send a subset of my ghost cells to + // offset used in forward comm to recv a message in middle of a large buffer + + struct Recv { + int proc; + int nunpack; + int *unpacklist; + int offset; + }; + + int adjacent; // 0 on a proc who receives ghosts from a non-neighbor proc + + // copy = subset of my owned cells to copy into subset of my ghost cells + // that describes forward comm, for reverse comm it is the opposite + + struct Copy { + int npack; + int nunpack; + int *packlist; + int *unpacklist; + }; + + int nsend,nrecv,ncopy; + Send *send; + Recv *recv; + Copy *copy; + + // ------------------------------------------- + // internal methods + // ------------------------------------------- + + void initialize(MPI_Comm, int, int, int, + int, int, int, int, int, int, + int, int, int, int, int, int, + int, int, int, int, int, int, + int, int, int, int, int, int); + virtual void setup_regular(int &, int &); + virtual void setup_tiled(int &, int &); + void ghost_box_drop(int *, int *); + void box_drop_grid(int *, int, int, int &, int *); + + int ghost_adjacent_regular(); + int ghost_adjacent_tiled(); + + void forward_comm_kspace_regular(class KSpace *, int, int, int, + void *, void *, MPI_Datatype); + void forward_comm_kspace_tiled(class KSpace *, int, int, int, + void *, void *, MPI_Datatype); + void reverse_comm_kspace_regular(class KSpace *, int, int, int, + void *, void *, MPI_Datatype); + void reverse_comm_kspace_tiled(class KSpace *, int, int, int, + void *, void *, MPI_Datatype); + + virtual void grow_swap(); + void grow_overlap(); + int indices(int *&, int, int, int, int, int, int); }; diff --git a/src/KSPACE/kissfft.h b/src/KSPACE/kissfft.h index c95b648dcb..119dc17f66 100644 --- a/src/KSPACE/kissfft.h +++ b/src/KSPACE/kissfft.h @@ -420,14 +420,14 @@ static void kf_factor(int n, int *facbuf) */ static kiss_fft_cfg kiss_fft_alloc(int nfft, int inverse_fft, void *mem, size_t *lenmem) { - kiss_fft_cfg st=NULL; + kiss_fft_cfg st=nullptr; size_t memneeded = sizeof(struct kiss_fft_state) + sizeof(FFT_DATA)*(nfft-1); /* twiddle factors */ - if (lenmem==NULL) { + if (lenmem==nullptr) { st=(kiss_fft_cfg)KISS_FFT_MALLOC( memneeded ); } else { - if (mem != NULL && *lenmem >= memneeded) + if (mem != nullptr && *lenmem >= memneeded) st = (kiss_fft_cfg)mem; *lenmem = memneeded; } diff --git a/src/KSPACE/msm.cpp b/src/KSPACE/msm.cpp index e522ccb7ad..8127f89d9c 100644 --- a/src/KSPACE/msm.cpp +++ b/src/KSPACE/msm.cpp @@ -16,22 +16,20 @@ ------------------------------------------------------------------------- */ #include "msm.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "gridcomm.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" #include "domain.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" - +#include "force.h" +#include "gridcomm.h" #include "math_const.h" +#include "memory.h" +#include "neighbor.h" +#include "pair.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -42,21 +40,24 @@ using namespace MathConst; enum{REVERSE_RHO,REVERSE_AD,REVERSE_AD_PERATOM}; enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; + /* ---------------------------------------------------------------------- */ -MSM::MSM(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), delxinv(NULL), delyinv(NULL), delzinv(NULL), nx_msm(NULL), - ny_msm(NULL), nz_msm(NULL), nxlo_in(NULL), nylo_in(NULL), nzlo_in(NULL), - nxhi_in(NULL), nyhi_in(NULL), nzhi_in(NULL), nxlo_out(NULL), nylo_out(NULL), - nzlo_out(NULL), nxhi_out(NULL), nyhi_out(NULL), nzhi_out(NULL), ngrid(NULL), - active_flag(NULL), alpha(NULL), betax(NULL), betay(NULL), betaz(NULL), peratom_allocate_flag(0), - levels(0), world_levels(NULL), qgrid(NULL), egrid(NULL), v0grid(NULL), v1grid(NULL), - v2grid(NULL), v3grid(NULL), v4grid(NULL), v5grid(NULL), g_direct(NULL), - v0_direct(NULL), v1_direct(NULL), v2_direct(NULL), v3_direct(NULL), v4_direct(NULL), - v5_direct(NULL), g_direct_top(NULL), v0_direct_top(NULL), v1_direct_top(NULL), - v2_direct_top(NULL), v3_direct_top(NULL), v4_direct_top(NULL), v5_direct_top(NULL), - phi1d(NULL), dphi1d(NULL), procneigh_levels(NULL), cg(NULL), cg_peratom(NULL), - cg_all(NULL), cg_peratom_all(NULL), part2grid(NULL), boxlo(NULL) +MSM::MSM(LAMMPS *lmp) + : KSpace(lmp), + factors(nullptr), delxinv(nullptr), delyinv(nullptr), delzinv(nullptr), nx_msm(nullptr), + ny_msm(nullptr), nz_msm(nullptr), nxlo_in(nullptr), nylo_in(nullptr), nzlo_in(nullptr), + nxhi_in(nullptr), nyhi_in(nullptr), nzhi_in(nullptr), nxlo_out(nullptr), nylo_out(nullptr), + nzlo_out(nullptr), nxhi_out(nullptr), nyhi_out(nullptr), nzhi_out(nullptr), ngrid(nullptr), + active_flag(nullptr), alpha(nullptr), betax(nullptr), betay(nullptr), betaz(nullptr), + peratom_allocate_flag(0),levels(0),world_levels(nullptr),qgrid(nullptr),egrid(nullptr), + v0grid(nullptr), v1grid(nullptr),v2grid(nullptr),v3grid(nullptr),v4grid(nullptr),v5grid(nullptr), + g_direct(nullptr),v0_direct(nullptr),v1_direct(nullptr),v2_direct(nullptr),v3_direct(nullptr), + v4_direct(nullptr),v5_direct(nullptr),g_direct_top(nullptr),v0_direct_top(nullptr), + v1_direct_top(nullptr),v2_direct_top(nullptr),v3_direct_top(nullptr),v4_direct_top(nullptr), + v5_direct_top(nullptr),phi1d(nullptr),dphi1d(nullptr),procneigh_levels(nullptr),gcall(nullptr), + gc(nullptr),gcall_buf1(nullptr),gcall_buf2(nullptr),gc_buf1(nullptr),gc_buf2(nullptr), + ngc_buf1(nullptr),ngc_buf2(nullptr),part2grid(nullptr),boxlo(nullptr) { msmflag = 1; @@ -66,32 +67,32 @@ MSM::MSM(LAMMPS *lmp) : KSpace(lmp), MPI_Comm_rank(world,&me); - phi1d = dphi1d = NULL; + phi1d = dphi1d = nullptr; nmax = 0; - part2grid = NULL; + part2grid = nullptr; - g_direct = NULL; - g_direct_top = NULL; + g_direct = nullptr; + g_direct_top = nullptr; - v0_direct = v1_direct = v2_direct = NULL; - v3_direct = v4_direct = v5_direct = NULL; + v0_direct = v1_direct = v2_direct = nullptr; + v3_direct = v4_direct = v5_direct = nullptr; - v0_direct_top = v1_direct_top = v2_direct_top = NULL; - v3_direct_top = v4_direct_top = v5_direct_top = NULL; + v0_direct_top = v1_direct_top = v2_direct_top = nullptr; + v3_direct_top = v4_direct_top = v5_direct_top = nullptr; - ngrid = NULL; + ngrid = nullptr; - alpha = betax = betay = betaz = NULL; - nx_msm = ny_msm = nz_msm = NULL; - nxlo_in = nylo_in = nzlo_in = NULL; - nxhi_in = nyhi_in = nzhi_in = NULL; - nxlo_out = nylo_out = nzlo_out = NULL; - nxhi_out = nyhi_out = nzhi_out = NULL; - delxinv = delyinv = delzinv = NULL; - qgrid = NULL; - egrid = NULL; - v0grid = v1grid = v2grid = v3grid = v4grid = v5grid = NULL; + alpha = betax = betay = betaz = nullptr; + nx_msm = ny_msm = nz_msm = nullptr; + nxlo_in = nylo_in = nzlo_in = nullptr; + nxhi_in = nyhi_in = nzhi_in = nullptr; + nxlo_out = nylo_out = nzlo_out = nullptr; + nxhi_out = nyhi_out = nzhi_out = nullptr; + delxinv = delyinv = delzinv = nullptr; + qgrid = nullptr; + egrid = nullptr; + v0grid = v1grid = v2grid = v3grid = v4grid = v5grid = nullptr; peratom_allocate_flag = 0; scalar_pressure_flag = 1; @@ -105,7 +106,7 @@ MSM::MSM(LAMMPS *lmp) : KSpace(lmp), void MSM::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style msm command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- @@ -117,6 +118,7 @@ MSM::~MSM() delete [] factors; deallocate(); if (peratom_allocate_flag) deallocate_peratom(); + deallocate_levels(); memory->destroy(part2grid); memory->destroy(g_direct); memory->destroy(g_direct_top); @@ -132,7 +134,6 @@ MSM::~MSM() memory->destroy(v3_direct_top); memory->destroy(v4_direct_top); memory->destroy(v5_direct_top); - deallocate_levels(); } /* ---------------------------------------------------------------------- @@ -175,7 +176,7 @@ void MSM::init() int itmp; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -205,9 +206,9 @@ void MSM::init() if (me == 0) { std::string mesg = fmt::format(" 3d grid size/proc = {}\n", ngrid_max); - mesg += fmt::format(" estimated absolute RMS force accuracy = {:.8g}\n", + mesg += fmt::format(" estimated absolute RMS force accuracy = {:.8}\n", estimated_error); - mesg += fmt::format(" estimated relative force accuracy = {:.8g}\n", + mesg += fmt::format(" estimated relative force accuracy = {:.8}\n", estimated_error/two_charge_force); mesg += fmt::format(" grid = {} {} {}\n",nx_msm[0],ny_msm[0],nz_msm[0]); mesg += fmt::format(" order = {}\n",order); @@ -397,17 +398,6 @@ void MSM::setup() // don't invoke allocate_peratom(), compute() will allocate when needed allocate(); - - // setup commgrid - - cg_all->ghost_notify(); - cg_all->setup(); - for (int n=0; nghost_notify(); - cg[n]->setup(); - } - } /* ---------------------------------------------------------------------- @@ -448,16 +438,7 @@ void MSM::compute(int eflag, int vflag) // invoke allocate_peratom() if needed for first time - if (vflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom_all->ghost_notify(); - cg_peratom_all->setup(); - for (int n=0; nghost_notify(); - cg_peratom[n]->setup(); - } - } + if (vflag_atom && !peratom_allocate_flag) allocate_peratom(); // convert atoms from box to lamda coords @@ -483,7 +464,8 @@ void MSM::compute(int eflag, int vflag) // to fully sum contribution in their 3d grid current_level = 0; - cg_all->reverse_comm(this,REVERSE_RHO); + gcall->reverse_comm_kspace(this,1,sizeof(double),REVERSE_RHO, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // forward communicate charge density values to fill ghost grid points // compute direct sum interaction and then restrict to coarser grid @@ -491,8 +473,8 @@ void MSM::compute(int eflag, int vflag) for (int n=0; n<=levels-2; n++) { if (!active_flag[n]) continue; current_level = n; - cg[n]->forward_comm(this,FORWARD_RHO); - + gc[n]->forward_comm_kspace(this,1,sizeof(double),FORWARD_RHO, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); direct(n); restriction(n); } @@ -503,11 +485,18 @@ void MSM::compute(int eflag, int vflag) if (active_flag[levels-1]) { if (domain->nonperiodic) { current_level = levels-1; - cg[levels-1]->forward_comm(this,FORWARD_RHO); + gc[levels-1]-> + forward_comm_kspace(this,1,sizeof(double),FORWARD_RHO, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); direct_top(levels-1); - cg[levels-1]->reverse_comm(this,REVERSE_AD); + gc[levels-1]-> + reverse_comm_kspace(this,1,sizeof(double),REVERSE_AD, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); if (vflag_atom) - cg_peratom[levels-1]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[levels-1]-> + reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); + } else { // Here using MPI_Allreduce is cheaper than using commgrid grid_swap_forward(levels-1,qgrid[levels-1]); @@ -515,7 +504,9 @@ void MSM::compute(int eflag, int vflag) grid_swap_reverse(levels-1,egrid[levels-1]); current_level = levels-1; if (vflag_atom) - cg_peratom[levels-1]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[levels-1]-> + reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); } } @@ -527,24 +518,28 @@ void MSM::compute(int eflag, int vflag) prolongation(n); current_level = n; - cg[n]->reverse_comm(this,REVERSE_AD); + gc[n]->reverse_comm_kspace(this,1,sizeof(double),REVERSE_AD, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); // extra per-atom virial communication if (vflag_atom) - cg_peratom[n]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[n]->reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); } // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks current_level = 0; - cg_all->forward_comm(this,FORWARD_AD); + gcall->forward_comm_kspace(this,1,sizeof(double),FORWARD_AD, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // extra per-atom energy/virial communication if (vflag_atom) - cg_peratom_all->forward_comm(this,FORWARD_AD_PERATOM); + gcall->forward_comm_kspace(this,6,sizeof(double),FORWARD_AD_PERATOM, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // calculate the force on my particles (interpolation) @@ -603,8 +598,7 @@ void MSM::compute(int eflag, int vflag) // convert atoms back from lamda to box coords - if (triclinic) - domain->lamda2x(atom->nlocal); + if (triclinic) domain->lamda2x(atom->nlocal); } /* ---------------------------------------------------------------------- @@ -621,15 +615,18 @@ void MSM::allocate() // commgrid using all processors for finest grid level - int (*procneigh_all)[2] = comm->procneigh; + gcall = new GridComm(lmp,world,1,nx_msm[0],ny_msm[0],nz_msm[0], + nxlo_in[0],nxhi_in[0],nylo_in[0], + nyhi_in[0],nzlo_in[0],nzhi_in[0], + nxlo_out_all,nxhi_out_all,nylo_out_all, + nyhi_out_all,nzlo_out_all,nzhi_out_all, + nxlo_out[0],nxhi_out[0],nylo_out[0], + nyhi_out[0],nzlo_out[0],nzhi_out[0]); - - cg_all = new GridComm(lmp,world,1,1, - nxlo_in[0],nxhi_in[0],nylo_in[0],nyhi_in[0],nzlo_in[0],nzhi_in[0], - nxlo_out_all,nxhi_out_all,nylo_out_all,nyhi_out_all,nzlo_out_all,nzhi_out_all, - nxlo_out[0],nxhi_out[0],nylo_out[0],nyhi_out[0],nzlo_out[0],nzhi_out[0], - procneigh_all[0][0],procneigh_all[0][1],procneigh_all[1][0], - procneigh_all[1][1],procneigh_all[2][0],procneigh_all[2][1]); + gcall->setup(ngcall_buf1,ngcall_buf2); + npergrid = 1; + memory->create(gcall_buf1,npergrid*ngcall_buf1,"msm:gcall_buf1"); + memory->create(gcall_buf2,npergrid*ngcall_buf2,"msm:gcall_buf2"); // allocate memory for each grid level @@ -644,12 +641,23 @@ void MSM::allocate() if (active_flag[n]) { int **procneigh = procneigh_levels[n]; - cg[n] = new GridComm(lmp,world_levels[n],1,1, - nxlo_in[n],nxhi_in[n],nylo_in[n],nyhi_in[n],nzlo_in[n],nzhi_in[n], - nxlo_out[n],nxhi_out[n],nylo_out[n],nyhi_out[n],nzlo_out[n],nzhi_out[n], - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - } else cg[n] = nullptr; + gc[n] = new GridComm(lmp,world_levels[n],2,nx_msm[n],ny_msm[n],nz_msm[n], + nxlo_in[n],nxhi_in[n],nylo_in[n],nyhi_in[n], + nzlo_in[n],nzhi_in[n], + nxlo_out[n],nxhi_out[n],nylo_out[n],nyhi_out[n], + nzlo_out[n],nzhi_out[n], + procneigh[0][0],procneigh[0][1],procneigh[1][0], + procneigh[1][1],procneigh[2][0],procneigh[2][1]); + + gc[n]->setup(ngc_buf1[n],ngc_buf2[n]); + npergrid = 1; + memory->create(gc_buf1[n],npergrid*ngc_buf1[n],"msm:gc_buf1"); + memory->create(gc_buf2[n],npergrid*ngc_buf2[n],"msm:gc_buf2"); + + } else { + gc[n] = nullptr; + gc_buf1[n] = gc_buf2[n] = nullptr; + } } } @@ -662,8 +670,11 @@ void MSM::deallocate() memory->destroy2d_offset(phi1d,-order_allocated); memory->destroy2d_offset(dphi1d,-order_allocated); - if (cg_all) delete cg_all; - cg_all = nullptr; + if (gcall) delete gcall; + memory->destroy(gcall_buf1); + memory->destroy(gcall_buf2); + gcall = nullptr; + gcall_buf1 = gcall_buf2 = nullptr; for (int n=0; ndestroy(gc_buf1[n]); + memory->destroy(gc_buf2[n]); + gc[n] = nullptr; + gc_buf1[n] = gc_buf2[n] = nullptr; } } } @@ -695,15 +709,11 @@ void MSM::allocate_peratom() // create commgrid object for per-atom virial using all processors - int (*procneigh_all)[2] = comm->procneigh; - - cg_peratom_all = - new GridComm(lmp,world,6,6, - nxlo_in[0],nxhi_in[0],nylo_in[0],nyhi_in[0],nzlo_in[0],nzhi_in[0], - nxlo_out_all,nxhi_out_all,nylo_out_all,nyhi_out_all,nzlo_out_all,nzhi_out_all, - nxlo_out[0],nxhi_out[0],nylo_out[0],nyhi_out[0],nzlo_out[0],nzhi_out[0], - procneigh_all[0][0],procneigh_all[0][1],procneigh_all[1][0], - procneigh_all[1][1],procneigh_all[2][0],procneigh_all[2][1]); + npergrid = 6; + memory->destroy(gcall_buf1); + memory->destroy(gcall_buf2); + memory->create(gcall_buf1,npergrid*ngcall_buf1,"pppm:gcall_buf1"); + memory->create(gcall_buf2,npergrid*ngcall_buf2,"pppm:gcall_buf2"); // allocate memory for each grid level @@ -724,13 +734,11 @@ void MSM::allocate_peratom() // create commgrid object for per-atom virial if (active_flag[n]) { - int **procneigh = procneigh_levels[n]; - cg_peratom[n] = - new GridComm(lmp,world_levels[n],6,6, - nxlo_in[n],nxhi_in[n],nylo_in[n],nyhi_in[n],nzlo_in[n],nzhi_in[n], - nxlo_out[n],nxhi_out[n],nylo_out[n],nyhi_out[n],nzlo_out[n],nzhi_out[n], - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + npergrid = 6; + memory->destroy(gc_buf1[n]); + memory->destroy(gc_buf2[n]); + memory->create(gc_buf1[n],npergrid*ngc_buf1[n],"pppm:gc_buf1"); + memory->create(gc_buf2[n],npergrid*ngc_buf2[n],"pppm:gc_buf2"); } } } @@ -743,8 +751,6 @@ void MSM::deallocate_peratom() { peratom_allocate_flag = 0; - if (cg_peratom_all) delete cg_peratom_all; - for (int n=0; ndestroy3d_offset(v0grid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); @@ -758,9 +764,6 @@ void MSM::deallocate_peratom() memory->destroy3d_offset(v4grid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); if (v5grid[n]) memory->destroy3d_offset(v5grid[n],nzlo_out[n],nylo_out[n],nxlo_out[n]); - - if (cg_peratom) - if (cg_peratom[n]) delete cg_peratom[n]; } } @@ -772,8 +775,11 @@ void MSM::allocate_levels() { ngrid = new int[levels]; - cg = new GridComm*[levels]; - cg_peratom = new GridComm*[levels]; + gc = new GridComm*[levels]; + gc_buf1 = new double*[levels]; + gc_buf2 = new double*[levels]; + ngc_buf1 = new int[levels]; + ngc_buf2 = new int[levels]; memory->create(procneigh_levels,levels,3,2,"msm:procneigh_levels"); world_levels = new MPI_Comm[levels]; @@ -819,21 +825,19 @@ void MSM::allocate_levels() v5grid = new double***[levels]; for (int n=0; ndestroy(procneigh_levels); delete [] world_levels; delete [] active_flag; - delete [] cg; - delete [] cg_peratom; + + delete [] gc; + delete [] gc_buf1; + delete [] gc_buf2; + delete [] ngc_buf1; + delete [] ngc_buf2; delete [] alpha; delete [] betax; @@ -893,8 +900,8 @@ void MSM::deallocate_levels() world_levels = nullptr; active_flag = nullptr; - cg = nullptr; - cg_peratom = nullptr; + gc = nullptr; + gc_buf1 = gc_buf2 = nullptr; alpha = nullptr; betax = nullptr; @@ -1070,7 +1077,7 @@ void MSM::set_grid_global() if (me == 0) error->warning(FLERR,fmt::format("Adjusting Coulombic cutoff for " - "MSM, new cutoff = {}", cutoff)); + "MSM, new cutoff = {:.8}", cutoff)); } if (triclinic == 0) { @@ -1377,7 +1384,7 @@ void MSM::set_proc_grid(int n) // define a new MPI communicator for this grid level that only includes active procs - if(world_levels[n] != MPI_COMM_NULL) MPI_Comm_free(&world_levels[n]); + if (world_levels[n] != MPI_COMM_NULL) MPI_Comm_free(&world_levels[n]); MPI_Comm_split(world,color,me,&world_levels[n]); if (!active_flag[n]) return; @@ -1425,16 +1432,16 @@ void MSM::setup_grid() return 1 if yes, 0 if no ------------------------------------------------------------------------- */ -int MSM::factorable(int n, int &flag, int &levels) +int MSM::factorable(int n, int &flag, int &nlevels) { int i; - levels = 1; + nlevels = 1; while (n > 1) { for (i = 0; i < nfactors; i++) { if (n % factors[i] == 0) { n /= factors[i]; - levels++; + nlevels++; break; } } @@ -2434,6 +2441,7 @@ void MSM::prolongation(int n) be cheaper than using nearest-neighbor communication (commgrid), right now only works for periodic boundary conditions ------------------------------------------------------------------------- */ + void MSM::grid_swap_forward(int n, double*** &gridn) { double ***gridn_tmp; @@ -2533,32 +2541,31 @@ void MSM::grid_swap_reverse(int n, double*** &gridn) pack own values to buf to send to another proc (used by commgrid) ------------------------------------------------------------------------- */ -void MSM::pack_forward(int flag, double *buf, int nlist, int *list) +void MSM::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + double *buf = (double *) vbuf; + int n = current_level; - - double ***qgridn = qgrid[n]; - double ***egridn = egrid[n]; - - double ***v0gridn = v0grid[n]; - double ***v1gridn = v1grid[n]; - double ***v2gridn = v2grid[n]; - double ***v3gridn = v3grid[n]; - double ***v4gridn = v4grid[n]; - double ***v5gridn = v5grid[n]; - int k = 0; if (flag == FORWARD_RHO) { + double ***qgridn = qgrid[n]; double *qsrc = &qgridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) { buf[k++] = qsrc[list[i]]; } } else if (flag == FORWARD_AD) { + double ***egridn = egrid[n]; double *src = &egridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) buf[i] = src[list[i]]; } else if (flag == FORWARD_AD_PERATOM) { + double ***v0gridn = v0grid[n]; + double ***v1gridn = v1grid[n]; + double ***v2gridn = v2grid[n]; + double ***v3gridn = v3grid[n]; + double ***v4gridn = v4grid[n]; + double ***v5gridn = v5grid[n]; double *v0src = &v0gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v1src = &v1gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v2src = &v2gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; @@ -2580,32 +2587,31 @@ void MSM::pack_forward(int flag, double *buf, int nlist, int *list) unpack another proc's own values from buf and set own ghost values ------------------------------------------------------------------------- */ -void MSM::unpack_forward(int flag, double *buf, int nlist, int *list) +void MSM::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + double *buf = (double *) vbuf; + int n = current_level; - - double ***qgridn = qgrid[n]; - double ***egridn = egrid[n]; - - double ***v0gridn = v0grid[n]; - double ***v1gridn = v1grid[n]; - double ***v2gridn = v2grid[n]; - double ***v3gridn = v3grid[n]; - double ***v4gridn = v4grid[n]; - double ***v5gridn = v5grid[n]; - int k = 0; if (flag == FORWARD_RHO) { + double ***qgridn = qgrid[n]; double *dest = &qgridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) { dest[list[i]] = buf[k++]; } } else if (flag == FORWARD_AD) { + double ***egridn = egrid[n]; double *dest = &egridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) dest[list[i]] = buf[k++]; } else if (flag == FORWARD_AD_PERATOM) { + double ***v0gridn = v0grid[n]; + double ***v1gridn = v1grid[n]; + double ***v2gridn = v2grid[n]; + double ***v3gridn = v3grid[n]; + double ***v4gridn = v4grid[n]; + double ***v5gridn = v5grid[n]; double *v0src = &v0gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v1src = &v1gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v2src = &v2gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; @@ -2627,32 +2633,31 @@ void MSM::unpack_forward(int flag, double *buf, int nlist, int *list) pack ghost values into buf to send to another proc ------------------------------------------------------------------------- */ -void MSM::pack_reverse(int flag, double *buf, int nlist, int *list) +void MSM::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + double *buf = (double *) vbuf; + int n = current_level; - - double ***qgridn = qgrid[n]; - double ***egridn = egrid[n]; - - double ***v0gridn = v0grid[n]; - double ***v1gridn = v1grid[n]; - double ***v2gridn = v2grid[n]; - double ***v3gridn = v3grid[n]; - double ***v4gridn = v4grid[n]; - double ***v5gridn = v5grid[n]; - int k = 0; if (flag == REVERSE_RHO) { + double ***qgridn = qgrid[n]; double *qsrc = &qgridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) { buf[k++] = qsrc[list[i]]; } } else if (flag == REVERSE_AD) { + double ***egridn = egrid[n]; double *src = &egridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) buf[i] = src[list[i]]; } else if (flag == REVERSE_AD_PERATOM) { + double ***v0gridn = v0grid[n]; + double ***v1gridn = v1grid[n]; + double ***v2gridn = v2grid[n]; + double ***v3gridn = v3grid[n]; + double ***v4gridn = v4grid[n]; + double ***v5gridn = v5grid[n]; double *v0src = &v0gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v1src = &v1gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v2src = &v2gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; @@ -2674,32 +2679,31 @@ void MSM::pack_reverse(int flag, double *buf, int nlist, int *list) unpack another proc's ghost values from buf and add to own values ------------------------------------------------------------------------- */ -void MSM::unpack_reverse(int flag, double *buf, int nlist, int *list) +void MSM::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + double *buf = (double *) vbuf; + int n = current_level; - - double ***qgridn = qgrid[n]; - double ***egridn = egrid[n]; - - double ***v0gridn = v0grid[n]; - double ***v1gridn = v1grid[n]; - double ***v2gridn = v2grid[n]; - double ***v3gridn = v3grid[n]; - double ***v4gridn = v4grid[n]; - double ***v5gridn = v5grid[n]; - int k = 0; if (flag == REVERSE_RHO) { + double ***qgridn = qgrid[n]; double *dest = &qgridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) { dest[list[i]] += buf[k++]; } } else if (flag == REVERSE_AD) { + double ***egridn = egrid[n]; double *dest = &egridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; for (int i = 0; i < nlist; i++) dest[list[i]] += buf[k++]; } else if (flag == REVERSE_AD_PERATOM) { + double ***v0gridn = v0grid[n]; + double ***v1gridn = v1grid[n]; + double ***v2gridn = v2grid[n]; + double ***v3gridn = v3grid[n]; + double ***v4gridn = v4grid[n]; + double ***v5gridn = v5grid[n]; double *v0src = &v0gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v1src = &v1gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; double *v2src = &v2gridn[nzlo_out[n]][nylo_out[n]][nxlo_out[n]]; @@ -3416,3 +3420,24 @@ void MSM::get_virial_direct_top(int n) } } } + +/* ---------------------------------------------------------------------- + memory usage of local arrays +------------------------------------------------------------------------- */ + +double MSM::memory_usage() +{ + double bytes = 0; + + // NOTE: Stan, fill in other memory allocations here + + // all GridComm bufs + + bytes += (ngcall_buf1 + ngcall_buf2) * npergrid * sizeof(double); + + for (int n=0; n grid mapping int nmax; + int triclinic; double *boxlo; void set_grid_global(); @@ -126,15 +132,12 @@ class MSM : public KSpace { void get_g_direct_top(int); void get_virial_direct_top(int); - // triclinic - - int triclinic; - // grid communication - void pack_forward(int, double *, int, int *); - void unpack_forward(int, double *, int, int *); - void pack_reverse(int, double *, int, int *); - void unpack_reverse(int, double *, int, int *); + + void pack_forward_grid(int, void *, int, int *); + void unpack_forward_grid(int, void *, int, int *); + void pack_reverse_grid(int, void *, int, int *); + void unpack_reverse_grid(int, void *, int, int *); }; } diff --git a/src/KSPACE/msm_cg.cpp b/src/KSPACE/msm_cg.cpp index 43bb106051..383bb58dd5 100644 --- a/src/KSPACE/msm_cg.cpp +++ b/src/KSPACE/msm_cg.cpp @@ -40,7 +40,7 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ MSMCG::MSMCG(LAMMPS *lmp) : MSM(lmp), - is_charged(NULL) + is_charged(nullptr) { triclinic_support = 0; @@ -58,7 +58,7 @@ void MSMCG::settings(int narg, char **arg) MSM::settings(narg,arg); - if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1])); + if (narg == 2) smallq = fabs(utils::numeric(FLERR,arg[1],false,lmp)); else smallq = SMALLQ; } @@ -91,17 +91,7 @@ void MSMCG::compute(int eflag, int vflag) // invoke allocate_peratom() if needed for first time - if (vflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom_all->ghost_notify(); - cg_peratom_all->setup(); - for (int n=0; nghost_notify(); - cg_peratom[n]->setup(); - } - peratom_allocate_flag = 1; - } + if (vflag_atom && !peratom_allocate_flag) allocate_peratom(); // extend size of per-atom arrays if necessary @@ -143,7 +133,7 @@ void MSMCG::compute(int eflag, int vflag) / static_cast(atom->natoms); if (me == 0) - utils::logmesg(lmp,fmt::format(" MSM/cg optimization cutoff: {:.8g}\n" + utils::logmesg(lmp,fmt::format(" MSM/cg optimization cutoff: {:.8}\n" " Total charged atoms: {:.1f}%\n" " Min/max charged atoms/proc: {:.1f}%" " {:.1f}%\n",smallq, @@ -171,7 +161,8 @@ void MSMCG::compute(int eflag, int vflag) // to fully sum contribution in their 3d grid current_level = 0; - cg_all->reverse_comm(this,REVERSE_RHO); + gcall->reverse_comm_kspace(this,1,sizeof(double),REVERSE_RHO, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // forward communicate charge density values to fill ghost grid points // compute direct sum interaction and then restrict to coarser grid @@ -179,24 +170,30 @@ void MSMCG::compute(int eflag, int vflag) for (int n=0; n<=levels-2; n++) { if (!active_flag[n]) continue; current_level = n; - cg[n]->forward_comm(this,FORWARD_RHO); - + gc[n]->forward_comm_kspace(this,1,sizeof(double),FORWARD_RHO, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); direct(n); restriction(n); } - // compute direct interaction for top grid level for non-periodic // and for second from top grid level for periodic if (active_flag[levels-1]) { if (domain->nonperiodic) { current_level = levels-1; - cg[levels-1]->forward_comm(this,FORWARD_RHO); + gc[levels-1]-> + forward_comm_kspace(this,1,sizeof(double),FORWARD_RHO, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); direct_top(levels-1); - cg[levels-1]->reverse_comm(this,REVERSE_AD); + gc[levels-1]-> + reverse_comm_kspace(this,1,sizeof(double),REVERSE_AD, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); if (vflag_atom) - cg_peratom[levels-1]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[levels-1]-> + reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); + } else { // Here using MPI_Allreduce is cheaper than using commgrid grid_swap_forward(levels-1,qgrid[levels-1]); @@ -204,7 +201,9 @@ void MSMCG::compute(int eflag, int vflag) grid_swap_reverse(levels-1,egrid[levels-1]); current_level = levels-1; if (vflag_atom) - cg_peratom[levels-1]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[levels-1]-> + reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); } } @@ -216,24 +215,28 @@ void MSMCG::compute(int eflag, int vflag) prolongation(n); current_level = n; - cg[n]->reverse_comm(this,REVERSE_AD); + gc[n]->reverse_comm_kspace(this,1,sizeof(double),REVERSE_AD, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); // extra per-atom virial communication if (vflag_atom) - cg_peratom[n]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[n]->reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); } // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks current_level = 0; - cg_all->forward_comm(this,FORWARD_AD); + gcall->forward_comm_kspace(this,1,sizeof(double),FORWARD_AD, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // extra per-atom energy/virial communication if (vflag_atom) - cg_peratom_all->forward_comm(this,FORWARD_AD_PERATOM); + gcall->forward_comm_kspace(this,6,sizeof(double),FORWARD_AD_PERATOM, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // calculate the force on my particles (interpolation) @@ -536,6 +539,9 @@ void MSMCG::fieldforce_peratom() } } +/* ---------------------------------------------------------------------- + memory usage of local arrays +------------------------------------------------------------------------- */ double MSMCG::memory_usage() { diff --git a/src/KSPACE/pair_born_coul_long.cpp b/src/KSPACE/pair_born_coul_long.cpp index b4d050412a..060c19dc19 100644 --- a/src/KSPACE/pair_born_coul_long.cpp +++ b/src/KSPACE/pair_born_coul_long.cpp @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -45,9 +45,9 @@ using namespace MathConst; PairBornCoulLong::PairBornCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -240,9 +240,9 @@ void PairBornCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -264,18 +264,18 @@ void PairBornCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -375,7 +375,7 @@ void PairBornCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -383,7 +383,7 @@ void PairBornCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -423,16 +423,16 @@ void PairBornCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -466,13 +466,13 @@ void PairBornCoulLong::write_restart_settings(FILE *fp) void PairBornCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -577,5 +577,5 @@ void *PairBornCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_born_coul_msm.cpp b/src/KSPACE/pair_born_coul_msm.cpp index 7300cd92e0..707f7f7959 100644 --- a/src/KSPACE/pair_born_coul_msm.cpp +++ b/src/KSPACE/pair_born_coul_msm.cpp @@ -34,7 +34,7 @@ PairBornCoulMSM::PairBornCoulMSM(LAMMPS *lmp) : PairBornCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -251,5 +251,5 @@ void *PairBornCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_coul_long.cpp b/src/KSPACE/pair_buck_coul_long.cpp index a46424baf7..2733bc31cd 100644 --- a/src/KSPACE/pair_buck_coul_long.cpp +++ b/src/KSPACE/pair_buck_coul_long.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_buck_coul_long.h" -#include + #include #include #include "atom.h" @@ -24,7 +24,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -43,7 +43,17 @@ PairBuckCoulLong::PairBuckCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; + cut_lj = nullptr; + cut_ljsq = nullptr; + a = nullptr; + rho = nullptr; + c = nullptr; + rhoinv = nullptr; + buck1 = nullptr; + buck2 = nullptr; + offset = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -230,9 +240,9 @@ void PairBuckCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -255,16 +265,16 @@ void PairBuckCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -354,7 +364,7 @@ void PairBuckCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -362,7 +372,7 @@ void PairBuckCoulLong::init_style() // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -400,14 +410,14 @@ void PairBuckCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -439,13 +449,13 @@ void PairBuckCoulLong::write_restart_settings(FILE *fp) void PairBuckCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -548,5 +558,5 @@ void *PairBuckCoulLong::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_coul_msm.cpp b/src/KSPACE/pair_buck_coul_msm.cpp index 1355a2f13a..87c852b5aa 100644 --- a/src/KSPACE/pair_buck_coul_msm.cpp +++ b/src/KSPACE/pair_buck_coul_msm.cpp @@ -31,7 +31,7 @@ PairBuckCoulMSM::PairBuckCoulMSM(LAMMPS *lmp) : PairBuckCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -246,5 +246,5 @@ void *PairBuckCoulMSM::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_buck_long_coul_long.cpp b/src/KSPACE/pair_buck_long_coul_long.cpp index 92db9ff069..744232dd8e 100644 --- a/src/KSPACE/pair_buck_long_coul_long.cpp +++ b/src/KSPACE/pair_buck_long_coul_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_buck_long_coul_long.h" -#include + #include #include #include "math_vector.h" @@ -31,7 +31,7 @@ #include "respa.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -50,9 +50,9 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; - cut_respa = NULL; + ftable = nullptr; + fdisptable = nullptr; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -61,7 +61,7 @@ PairBuckLongCoulLong::PairBuckLongCoulLong(LAMMPS *lmp) : Pair(lmp) void PairBuckLongCoulLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style buck/long/coul/long command"); @@ -90,15 +90,17 @@ void PairBuckLongCoulLong::settings(int narg, char **arg) error->warning(FLERR,"Using largest cutoff for buck/long/coul/long"); if (!*(++arg)) error->all(FLERR,"Cutoffs missing in pair_style buck/long/coul/long"); + if (!((ewald_order^ewald_off) & (1<<6))) + dispersionflag = 0; if (ewald_off & (1<<6)) error->all(FLERR,"LJ6 off not supported in pair_style buck/long/coul/long"); if (!((ewald_order^ewald_off) & (1<<1))) error->all(FLERR, "Coulomb cut not supported in pair_style buck/long/coul/coul"); - cut_buck_global = force->numeric(FLERR,*(arg++)); + cut_buck_global = utils::numeric(FLERR,*(arg++),false,lmp); if (narg == 4 && ((ewald_order & 0x42) == 0x42)) error->all(FLERR,"Only one cutoff allowed when requesting all long"); - if (narg == 4) cut_coul = force->numeric(FLERR,*arg); + if (narg == 4) cut_coul = utils::numeric(FLERR,*arg,false,lmp); else cut_coul = cut_buck_global; if (allocated) { @@ -175,10 +177,10 @@ void PairBuckLongCoulLong::allocate() void *PairBuckLongCoulLong::extract(const char *id, int &dim) { const char *ids[] = { - "B", "ewald_order", "ewald_cut", "ewald_mix", "cut_coul", "cut_LJ", NULL}; + "B", "ewald_order", "ewald_cut", "ewald_mix", "cut_coul", "cut_LJ", nullptr}; void *ptrs[] = { buck_c, &ewald_order, &cut_coul, &mix_flag, &cut_coul, &cut_buck_global, - NULL}; + nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -198,15 +200,15 @@ void PairBuckLongCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,*(arg++),atom->ntypes,ilo,ihi); - force->bounds(FLERR,*(arg++),atom->ntypes,jlo,jhi); + utils::bounds(FLERR,*(arg++),1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,*(arg++),1,atom->ntypes,jlo,jhi,error); - double buck_a_one = force->numeric(FLERR,*(arg++)); - double buck_rho_one = force->numeric(FLERR,*(arg++)); - double buck_c_one = force->numeric(FLERR,*(arg++)); + double buck_a_one = utils::numeric(FLERR,*(arg++),false,lmp); + double buck_rho_one = utils::numeric(FLERR,*(arg++),false,lmp); + double buck_c_one = utils::numeric(FLERR,*(arg++),false,lmp); double cut_buck_one = cut_buck_global; - if (narg == 6) cut_buck_one = force->numeric(FLERR,*(arg++)); + if (narg == 6) cut_buck_one = utils::numeric(FLERR,*(arg++),false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -238,7 +240,7 @@ void PairBuckLongCoulLong::init_style() // ensure use of KSpace long-range solver, set two g_ewalds - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; @@ -248,7 +250,7 @@ void PairBuckLongCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // setup force tables @@ -357,14 +359,14 @@ void PairBuckLongCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck_a_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck_rho_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck_c_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_buck_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck_a_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck_rho_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck_c_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_buck_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck_a_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck_rho_read[i][j],1,MPI_DOUBLE,0,world); @@ -387,6 +389,7 @@ void PairBuckLongCoulLong::write_restart_settings(FILE *fp) fwrite(&ncoultablebits,sizeof(int),1,fp); fwrite(&tabinner,sizeof(double),1,fp); fwrite(&ewald_order,sizeof(int),1,fp); + fwrite(&dispersionflag,sizeof(int),1,fp); } /* ---------------------------------------------------------------------- @@ -396,13 +399,14 @@ void PairBuckLongCoulLong::write_restart_settings(FILE *fp) void PairBuckLongCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_buck_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_buck_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_buck_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -411,6 +415,7 @@ void PairBuckLongCoulLong::read_restart_settings(FILE *fp) MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world); MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world); MPI_Bcast(&ewald_order,1,MPI_INT,0,world); + MPI_Bcast(&dispersionflag,1,MPI_INT,0,world); } /* ---------------------------------------------------------------------- @@ -529,8 +534,7 @@ void PairBuckLongCoulLong::compute(int eflag, int vflag) if (eflag) ecoul = qiqj*(etable[k]+f*detable[k]-t.f); } } - } - else force_coul = ecoul = 0.0; + } else force_coul = ecoul = 0.0; if (rsq < cut_bucksqi[typej]) { // buckingham double rn = r2inv*r2inv*r2inv, @@ -543,16 +547,14 @@ void PairBuckLongCoulLong::compute(int eflag, int vflag) force_buck = r*expr*buck1i[typej]-g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq; if (eflag) evdwl = expr*buckai[typej]-g6*((a2+1.0)*a2+0.5)*x2; - } - else { // special case + } else { // special case double f = special_lj[ni], t = rn*(1.0-f); force_buck = f*r*expr*buck1i[typej]- g8*(((6.0*a2+6.0)*a2+3.0)*a2+1.0)*x2*rsq+t*buck2i[typej]; if (eflag) evdwl = f*expr*buckai[typej] - g6*((a2+1.0)*a2+0.5)*x2+t*buckci[typej]; } - } - else { //table real space + } else { //table real space union_int_float_t disp_t; disp_t.f = rsq; const int disp_k = (disp_t.i & ndispmask)>>ndispshiftbits; @@ -560,21 +562,18 @@ void PairBuckLongCoulLong::compute(int eflag, int vflag) if (ni == 0) { force_buck = r*expr*buck1i[typej]-(fdisptable[disp_k]+f_disp*dfdisptable[disp_k])*buckci[typej]; if (eflag) evdwl = expr*buckai[typej]-(edisptable[disp_k]+f_disp*dedisptable[disp_k])*buckci[typej]; - } - else { //speial case + } else { //special case double f = special_lj[ni], t = rn*(1.0-f); force_buck = f*r*expr*buck1i[typej] -(fdisptable[disp_k]+f_disp*dfdisptable[disp_k])*buckci[typej] +t*buck2i[typej]; if (eflag) evdwl = f*expr*buckai[typej] -(edisptable[disp_k]+f_disp*dedisptable[disp_k])*buckci[typej]+t*buckci[typej]; } } - } - else { // cut + } else { // cut if (ni == 0) { force_buck = r*expr*buck1i[typej]-rn*buck2i[typej]; if (eflag) evdwl = expr*buckai[typej] - rn*buckci[typej]-offseti[typej]; - } - else { // special case + } else { // special case double f = special_lj[ni]; force_buck = f*(r*expr*buck1i[typej]-rn*buck2i[typej]); if (eflag) @@ -1018,7 +1017,7 @@ double PairBuckLongCoulLong::single(int i, int j, int itype, int jtype, g6*((a2+1.0)*a2+0.5)*x2+t*buck_c[itype][jtype]; } else { // cut force_buck = - buck1[itype][jtype]*r*expr-factor_buck*buck_c[itype][jtype]*r6inv; + factor_buck*(buck1[itype][jtype]*r*expr-buck2[itype][jtype]*r6inv); eng += buck_a[itype][jtype]*expr- factor_buck*(buck_c[itype][jtype]*r6inv-offset[itype][jtype]); } diff --git a/src/KSPACE/pair_coul_long.cpp b/src/KSPACE/pair_coul_long.cpp index 9a9f2f3783..68b9a8cbe2 100644 --- a/src/KSPACE/pair_coul_long.cpp +++ b/src/KSPACE/pair_coul_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_long.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -44,9 +44,9 @@ using namespace LAMMPS_NS; PairCoulLong::PairCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -199,7 +199,7 @@ void PairCoulLong::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_coul = force->numeric(FLERR,arg[0]); + cut_coul = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- @@ -212,8 +212,8 @@ void PairCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -242,13 +242,13 @@ void PairCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -291,10 +291,10 @@ void PairCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&scale[i][j],1,MPI_DOUBLE,0,world); } } @@ -320,11 +320,11 @@ void PairCoulLong::write_restart_settings(FILE *fp) void PairCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -393,5 +393,5 @@ void *PairCoulLong::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_coul_msm.cpp b/src/KSPACE/pair_coul_msm.cpp index 5d42e1f046..bf689d403d 100644 --- a/src/KSPACE/pair_coul_msm.cpp +++ b/src/KSPACE/pair_coul_msm.cpp @@ -217,5 +217,5 @@ void *PairCoulMSM::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmm_coul_long.cpp b/src/KSPACE/pair_lj_charmm_coul_long.cpp index 9ea6739c8e..b4455ff9b8 100644 --- a/src/KSPACE/pair_lj_charmm_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_long.cpp @@ -29,7 +29,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -47,11 +47,11 @@ PairLJCharmmCoulLong::PairLJCharmmCoulLong(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; implicit = 0; mix_flag = ARITHMETIC; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -631,10 +631,10 @@ void PairLJCharmmCoulLong::settings(int narg, char **arg) { if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } /* ---------------------------------------------------------------------- @@ -647,16 +647,16 @@ void PairLJCharmmCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; @@ -738,11 +738,11 @@ void PairLJCharmmCoulLong::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -824,14 +824,14 @@ void PairLJCharmmCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -863,13 +863,13 @@ void PairLJCharmmCoulLong::write_restart_settings(FILE *fp) void PairLJCharmmCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -994,5 +994,5 @@ void *PairLJCharmmCoulLong::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmm_coul_msm.cpp b/src/KSPACE/pair_lj_charmm_coul_msm.cpp index a93a1275f4..fe3ce441a1 100644 --- a/src/KSPACE/pair_lj_charmm_coul_msm.cpp +++ b/src/KSPACE/pair_lj_charmm_coul_msm.cpp @@ -35,7 +35,7 @@ PairLJCharmmCoulMSM::PairLJCharmmCoulMSM(LAMMPS *lmp) : ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -537,5 +537,5 @@ void *PairLJCharmmCoulMSM::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp index 36d8126eec..abc8888e59 100644 --- a/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp +++ b/src/KSPACE/pair_lj_charmmfsw_coul_long.cpp @@ -33,7 +33,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -51,11 +51,11 @@ PairLJCharmmfswCoulLong::PairLJCharmmfswCoulLong(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; implicit = 0; mix_flag = ARITHMETIC; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; // short-range/long-range flag accessed by DihedralCharmmfsw @@ -682,10 +682,10 @@ void PairLJCharmmfswCoulLong::settings(int narg, char **arg) { if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } /* ---------------------------------------------------------------------- @@ -698,16 +698,16 @@ void PairLJCharmmfswCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; @@ -786,11 +786,11 @@ void PairLJCharmmfswCoulLong::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -872,14 +872,14 @@ void PairLJCharmmfswCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -911,13 +911,13 @@ void PairLJCharmmfswCoulLong::write_restart_settings(FILE *fp) void PairLJCharmmfswCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -1055,5 +1055,5 @@ void *PairLJCharmmfswCoulLong::extract(const char *str, int &dim) if (strcmp(str,"cut_lj") == 0) return (void *) &cut_lj; if (strcmp(str,"dihedflag") == 0) return (void *) &dihedflag; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_coul_long.cpp b/src/KSPACE/pair_lj_cut_coul_long.cpp index 578e5be30c..7ae60acc86 100644 --- a/src/KSPACE/pair_lj_cut_coul_long.cpp +++ b/src/KSPACE/pair_lj_cut_coul_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_long.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -51,9 +51,9 @@ PairLJCutCoulLong::PairLJCutCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -594,9 +594,9 @@ void PairLJCutCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -619,14 +619,14 @@ void PairLJCutCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -676,11 +676,11 @@ void PairLJCutCoulLong::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -792,13 +792,13 @@ void PairLJCutCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -829,13 +829,13 @@ void PairLJCutCoulLong::write_restart_settings(FILE *fp) void PairLJCutCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -943,5 +943,5 @@ void *PairLJCutCoulLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_coul_msm.cpp b/src/KSPACE/pair_lj_cut_coul_msm.cpp index 4ebbcb9a3f..00aa88152d 100644 --- a/src/KSPACE/pair_lj_cut_coul_msm.cpp +++ b/src/KSPACE/pair_lj_cut_coul_msm.cpp @@ -34,7 +34,7 @@ PairLJCutCoulMSM::PairLJCutCoulMSM(LAMMPS *lmp) : PairLJCutCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; nmax = 0; - ftmp = NULL; + ftmp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -478,5 +478,5 @@ void *PairLJCutCoulMSM::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/KSPACE/pair_lj_cut_tip4p_long.cpp b/src/KSPACE/pair_lj_cut_tip4p_long.cpp index a4f115568f..0d7778c93a 100644 --- a/src/KSPACE/pair_lj_cut_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_cut_tip4p_long.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_tip4p_long.h" -#include + #include #include #include "angle.h" @@ -30,7 +30,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -55,8 +55,8 @@ PairLJCutTIP4PLong::PairLJCutTIP4PLong(LAMMPS *lmp) : writedata = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -430,15 +430,15 @@ void PairLJCutTIP4PLong::settings(int narg, char **arg) { if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[5]); + cut_lj_global = utils::numeric(FLERR,arg[5],false,lmp); if (narg == 6) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[6]); + else cut_coul = utils::numeric(FLERR,arg[6],false,lmp); // reset cutoffs that have been explicitly set @@ -464,9 +464,9 @@ void PairLJCutTIP4PLong::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJCutCoulLong::init_style(); @@ -529,19 +529,19 @@ void PairLJCutTIP4PLong::write_restart_settings(FILE *fp) void PairLJCutTIP4PLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -594,7 +594,7 @@ void *PairLJCutTIP4PLong::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_coul_long.cpp b/src/KSPACE/pair_lj_long_coul_long.cpp index 70c385f9b8..960a47e685 100644 --- a/src/KSPACE/pair_lj_long_coul_long.cpp +++ b/src/KSPACE/pair_lj_long_coul_long.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_long_coul_long.h" -#include + #include #include #include "math_vector.h" @@ -33,8 +33,8 @@ #include "respa.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; @@ -53,10 +53,10 @@ PairLJLongCoulLong::PairLJLongCoulLong(LAMMPS *lmp) : Pair(lmp) dispersionflag = ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; - fdisptable = NULL; + ftable = nullptr; + fdisptable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -65,7 +65,7 @@ PairLJLongCoulLong::PairLJLongCoulLong(LAMMPS *lmp) : Pair(lmp) void PairLJLongCoulLong::options(char **arg, int order) { - const char *option[] = {"long", "cut", "off", NULL}; + const char *option[] = {"long", "cut", "off", nullptr}; int i; if (!*arg) error->all(FLERR,"Illegal pair_style lj/long/coul/long command"); @@ -92,13 +92,15 @@ void PairLJLongCoulLong::settings(int narg, char **arg) error->warning(FLERR,"Using largest cutoff for lj/long/coul/long"); if (!*(++arg)) error->all(FLERR,"Cutoffs missing in pair_style lj/long/coul/long"); + if (!((ewald_order^ewald_off) & (1<<6))) + dispersionflag = 0; if (!((ewald_order^ewald_off) & (1<<1))) error->all(FLERR, "Coulomb cut not supported in pair_style lj/long/coul/long"); - cut_lj_global = force->numeric(FLERR,*(arg++)); + cut_lj_global = utils::numeric(FLERR,*(arg++),false,lmp); if (narg == 4 && ((ewald_order & 0x42) == 0x42)) error->all(FLERR,"Only one cutoff allowed when requesting all long"); - if (narg == 4) cut_coul = force->numeric(FLERR,*arg); + if (narg == 4) cut_coul = utils::numeric(FLERR,*arg,false,lmp); else cut_coul = cut_lj_global; if (allocated) { @@ -174,10 +176,10 @@ void *PairLJLongCoulLong::extract(const char *id, int &dim) { const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "ewald_mix", - "cut_coul", "cut_LJ", NULL}; + "cut_coul", "cut_LJ", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &mix_flag, - &cut_coul, &cut_lj_global, NULL}; + &cut_coul, &cut_lj_global, nullptr}; int i; for (i=0; ids[i]&&strcmp(ids[i], id); ++i); @@ -196,14 +198,14 @@ void PairLJLongCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -233,7 +235,7 @@ void PairLJLongCoulLong::init_style() // ensure use of KSpace long-range solver, set two g_ewalds - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); if (ewald_order&(1<<1)) g_ewald = force->kspace->g_ewald; if (ewald_order&(1<<6)) g_ewald_6 = force->kspace->g_ewald_6; @@ -243,7 +245,7 @@ void PairLJLongCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // setup force tables @@ -358,13 +360,13 @@ void PairLJLongCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_read[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_read[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon_read[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma_read[i][j],1,MPI_DOUBLE,0,world); @@ -386,6 +388,7 @@ void PairLJLongCoulLong::write_restart_settings(FILE *fp) fwrite(&ncoultablebits,sizeof(int),1,fp); fwrite(&tabinner,sizeof(double),1,fp); fwrite(&ewald_order,sizeof(int),1,fp); + fwrite(&dispersionflag,sizeof(int),1,fp); } /* ---------------------------------------------------------------------- @@ -395,13 +398,14 @@ void PairLJLongCoulLong::write_restart_settings(FILE *fp) void PairLJLongCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -410,6 +414,7 @@ void PairLJLongCoulLong::read_restart_settings(FILE *fp) MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world); MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world); MPI_Bcast(&ewald_order,1,MPI_INT,0,world); + MPI_Bcast(&dispersionflag,1,MPI_INT,0,world); } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_lj_long_tip4p_long.cpp b/src/KSPACE/pair_lj_long_tip4p_long.cpp index 92ff2f9ad1..790e318160 100644 --- a/src/KSPACE/pair_lj_long_tip4p_long.cpp +++ b/src/KSPACE/pair_lj_long_tip4p_long.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_long_tip4p_long.h" -#include + #include #include #include "angle.h" @@ -30,7 +30,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -52,8 +52,8 @@ PairLJLongTIP4PLong::PairLJLongTIP4PLong(LAMMPS *lmp) : respa_enable = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to find_M() finding bonded H atoms which are not near O atom @@ -1440,19 +1440,21 @@ void PairLJLongTIP4PLong::settings(int narg, char **arg) if (!comm->me && ewald_order==((1<<1)|(1<<6))) error->warning(FLERR, "Using largest cutoff for pair_style lj/long/tip4p/long"); + if (!((ewald_order^ewald_off) & (1<<6))) + dispersionflag = 0; if (!((ewald_order^ewald_off)&(1<<1))) error->all(FLERR, "Coulomb cut not supported in pair_style lj/long/tip4p/long"); - typeO = force->inumeric(FLERR,arg[1]); - typeH = force->inumeric(FLERR,arg[2]); - typeB = force->inumeric(FLERR,arg[3]); - typeA = force->inumeric(FLERR,arg[4]); - qdist = force->numeric(FLERR,arg[5]); + typeO = utils::inumeric(FLERR,arg[1],false,lmp); + typeH = utils::inumeric(FLERR,arg[2],false,lmp); + typeB = utils::inumeric(FLERR,arg[3],false,lmp); + typeA = utils::inumeric(FLERR,arg[4],false,lmp); + qdist = utils::numeric(FLERR,arg[5],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[6]); + cut_lj_global = utils::numeric(FLERR,arg[6],false,lmp); if (narg == 8) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[7]); + else cut_coul = utils::numeric(FLERR,arg[7],false,lmp); // reset cutoffs that have been explicitly set @@ -1477,9 +1479,9 @@ void PairLJLongTIP4PLong::init_style() error->all(FLERR,"Pair style lj/long/tip4p/long requires newton pair on"); if (!atom->q_flag) error->all(FLERR,"Pair style lj/long/tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJLongCoulLong::init_style(); @@ -1532,6 +1534,7 @@ void PairLJLongTIP4PLong::write_restart_settings(FILE *fp) fwrite(&ncoultablebits,sizeof(int),1,fp); fwrite(&tabinner,sizeof(double),1,fp); fwrite(&ewald_order,sizeof(int),1,fp); + fwrite(&dispersionflag,sizeof(int),1,fp); } /* ---------------------------------------------------------------------- @@ -1541,19 +1544,20 @@ void PairLJLongTIP4PLong::write_restart_settings(FILE *fp) void PairLJLongTIP4PLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&ewald_order,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -1569,6 +1573,7 @@ void PairLJLongTIP4PLong::read_restart_settings(FILE *fp) MPI_Bcast(&ncoultablebits,1,MPI_INT,0,world); MPI_Bcast(&tabinner,1,MPI_DOUBLE,0,world); MPI_Bcast(&ewald_order,1,MPI_INT,0,world); + MPI_Bcast(&dispersionflag,1,MPI_INT,0,world); } /* ---------------------------------------------------------------------- @@ -1606,14 +1611,14 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) const char *ids[] = { "B", "sigma", "epsilon", "ewald_order", "ewald_cut", "cut_coul", - "ewald_mix", "cut_LJ", NULL}; + "ewald_mix", "cut_LJ", nullptr}; void *ptrs[] = { lj4, sigma, epsilon, &ewald_order, &cut_coul, &cut_coul, - &mix_flag, &cut_lj_global, NULL}; + &mix_flag, &cut_lj_global, nullptr}; int i; i=0; - while (ids[i] != NULL) { + while (ids[i] != nullptr) { if (i <=2) dim = 2; else dim = 0; @@ -1622,7 +1627,7 @@ void *PairLJLongTIP4PLong::extract(const char *str, int &dim) ++i; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pair_tip4p_long.cpp b/src/KSPACE/pair_tip4p_long.cpp index c3ec44b7eb..80785d3551 100644 --- a/src/KSPACE/pair_tip4p_long.cpp +++ b/src/KSPACE/pair_tip4p_long.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_tip4p_long.h" -#include + #include #include #include "angle.h" @@ -30,7 +30,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -51,8 +51,8 @@ PairTIP4PLong::PairTIP4PLong(LAMMPS *lmp) : PairCoulLong(lmp) respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -398,13 +398,13 @@ void PairTIP4PLong::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - cut_coul = force->numeric(FLERR,arg[5]); + cut_coul = utils::numeric(FLERR,arg[5],false,lmp); } /* ---------------------------------------------------------------------- @@ -421,9 +421,9 @@ void PairTIP4PLong::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairCoulLong::init_style(); @@ -468,11 +468,11 @@ void PairTIP4PLong::read_restart_settings(FILE *fp) PairCoulLong::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -514,7 +514,7 @@ void *PairTIP4PLong::extract(const char *str, int &dim) if (strcmp(str,"typeA") == 0) return (void *) &typeA; if (strcmp(str,"typeB") == 0) return (void *) &typeB; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/KSPACE/pppm.cpp b/src/KSPACE/pppm.cpp index a44fc4ab6c..89d308eaa3 100644 --- a/src/KSPACE/pppm.cpp +++ b/src/KSPACE/pppm.cpp @@ -19,28 +19,25 @@ ------------------------------------------------------------------------- */ #include "pppm.h" -#include -#include -#include -#include -#include "atom.h" -#include "comm.h" -#include "gridcomm.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" -#include "bond.h" -#include "angle.h" -#include "domain.h" -#include "fft3d_wrap.h" -#include "remap_wrap.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fft3d_wrap.h" +#include "force.h" +#include "gridcomm.h" #include "math_const.h" #include "math_special.h" +#include "memory.h" +#include "neighbor.h" +#include "pair.h" +#include "remap_wrap.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -66,15 +63,16 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), density_brick(NULL), vdx_brick(NULL), vdy_brick(NULL), vdz_brick(NULL), - u_brick(NULL), v0_brick(NULL), v1_brick(NULL), v2_brick(NULL), v3_brick(NULL), - v4_brick(NULL), v5_brick(NULL), greensfn(NULL), vg(NULL), fkx(NULL), fky(NULL), - fkz(NULL), density_fft(NULL), work1(NULL), work2(NULL), gf_b(NULL), rho1d(NULL), - rho_coeff(NULL), drho1d(NULL), drho_coeff(NULL), sf_precoeff1(NULL), sf_precoeff2(NULL), - sf_precoeff3(NULL), sf_precoeff4(NULL), sf_precoeff5(NULL), sf_precoeff6(NULL), - acons(NULL), density_A_brick(NULL), density_B_brick(NULL), density_A_fft(NULL), - density_B_fft(NULL), fft1(NULL), fft2(NULL), remap(NULL), cg(NULL), cg_peratom(NULL), - part2grid(NULL), boxlo(NULL) + factors(nullptr), density_brick(nullptr), vdx_brick(nullptr), vdy_brick(nullptr), vdz_brick(nullptr), + u_brick(nullptr), v0_brick(nullptr), v1_brick(nullptr), v2_brick(nullptr), v3_brick(nullptr), + v4_brick(nullptr), v5_brick(nullptr), greensfn(nullptr), vg(nullptr), fkx(nullptr), fky(nullptr), + fkz(nullptr), density_fft(nullptr), work1(nullptr), work2(nullptr), gf_b(nullptr), rho1d(nullptr), + rho_coeff(nullptr), drho1d(nullptr), drho_coeff(nullptr), + sf_precoeff1(nullptr), sf_precoeff2(nullptr), sf_precoeff3(nullptr), + sf_precoeff4(nullptr), sf_precoeff5(nullptr), sf_precoeff6(nullptr), + acons(nullptr), fft1(nullptr), fft2(nullptr), remap(nullptr), gc(nullptr), + gc_buf1(nullptr), gc_buf2(nullptr), density_A_brick(nullptr), density_B_brick(nullptr), density_A_fft(nullptr), + density_B_fft(nullptr), part2grid(nullptr), boxlo(nullptr) { peratom_allocate_flag = 0; group_allocate_flag = 0; @@ -97,31 +95,31 @@ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), nyhi_in = nylo_in = nyhi_out = nylo_out = 0; nzhi_in = nzlo_in = nzhi_out = nzlo_out = 0; - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; - u_brick = NULL; - v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = NULL; - greensfn = NULL; - work1 = work2 = NULL; - vg = NULL; - fkx = fky = fkz = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; + u_brick = nullptr; + v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = nullptr; + greensfn = nullptr; + work1 = work2 = nullptr; + vg = nullptr; + fkx = fky = fkz = nullptr; sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = - sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = nullptr; - density_A_brick = density_B_brick = NULL; - density_A_fft = density_B_fft = NULL; + density_A_brick = density_B_brick = nullptr; + density_A_fft = density_B_fft = nullptr; - gf_b = NULL; - rho1d = rho_coeff = drho1d = drho_coeff = NULL; + gf_b = nullptr; + rho1d = rho_coeff = drho1d = drho_coeff = nullptr; - fft1 = fft2 = NULL; - remap = NULL; - cg = NULL; - cg_peratom = NULL; + fft1 = fft2 = nullptr; + remap = nullptr; + gc = nullptr; + gc_buf1 = gc_buf2 = nullptr; nmax = 0; - part2grid = NULL; + part2grid = nullptr; // define acons coefficients for estimation of kspace errors // see JCP 109, pg 7698 for derivation of coefficients @@ -163,7 +161,7 @@ PPPM::PPPM(LAMMPS *lmp) : KSpace(lmp), void PPPM::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- @@ -205,9 +203,6 @@ void PPPM::init() "slab correction"); if (domain->dimension == 2) error->all(FLERR,"Cannot use PPPM with 2d simulation"); - if (comm->style != 0) - error->universe_all(FLERR,"PPPM can only currently be used with " - "comm_style brick"); if (!atom->q_flag) error->all(FLERR,"Kspace style requires atom attribute q"); @@ -234,7 +229,7 @@ void PPPM::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -259,8 +254,8 @@ void PPPM::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == NULL || force->bond == NULL || - force->angle->setflag == NULL || force->bond->setflag == NULL) + if (force->angle == nullptr || force->bond == nullptr || + force->angle->setflag == nullptr || force->bond->setflag == nullptr) error->all(FLERR,"Bond and angle potentials must be defined for TIP4P"); if (typeA < 1 || typeA > atom->nangletypes || force->angle->setflag[typeA] == 0) @@ -297,9 +292,7 @@ void PPPM::init() // or overlap is allowed, then done // else reduce order and try again - int (*procneigh)[2] = comm->procneigh; - - GridComm *cgtmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -312,24 +305,24 @@ void PPPM::init() set_grid_local(); if (overlap_allowed) break; - cgtmp = new GridComm(lmp,world,1,1, + gctmp = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - cgtmp->ghost_notify(); - if (!cgtmp->ghost_overlap()) break; - delete cgtmp; + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + int tmp1,tmp2; + gctmp->setup(tmp1,tmp2); + if (gctmp->ghost_adjacent()) break; + delete gctmp; order--; iteration++; } if (order < minorder) error->all(FLERR,"PPPM order < minimum allowed order"); - if (!overlap_allowed && cgtmp->ghost_overlap()) + if (!overlap_allowed && !gctmp->ghost_adjacent()) error->all(FLERR,"PPPM grid stencil extends " "beyond nearest neighbor processor"); - if (cgtmp) delete cgtmp; + if (gctmp) delete gctmp; // adjust g_ewald @@ -363,8 +356,6 @@ void PPPM::init() // don't invoke allocate peratom() or group(), will be allocated when needed allocate(); - cg->ghost_notify(); - cg->setup(); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -578,11 +569,9 @@ void PPPM::setup_grid() allocate(); - cg->ghost_notify(); - if (overlap_allowed == 0 && cg->ghost_overlap()) + if (!overlap_allowed && !gc->ghost_adjacent()) error->all(FLERR,"PPPM grid stencil extends " "beyond nearest neighbor processor"); - cg->setup(); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -591,7 +580,7 @@ void PPPM::setup_grid() if (differentiation_flag == 1) compute_sf_precoeff(); compute_rho_coeff(); - // pre-compute volume-dependent coeffs + // pre-compute volume-dependent coeffs for portion of grid I now own setup(); } @@ -609,11 +598,7 @@ void PPPM::compute(int eflag, int vflag) ev_init(eflag,vflag); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); // if atom count has changed, update qsum and qsqsum @@ -652,7 +637,8 @@ void PPPM::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // compute potential gradient on my FFT grid and @@ -665,16 +651,22 @@ void PPPM::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - if (differentiation_flag == 1) cg->forward_comm(this,FORWARD_AD); - else cg->forward_comm(this,FORWARD_IK); + if (differentiation_flag == 1) + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); + else + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication if (evflag_atom) { if (differentiation_flag == 1 && vflag_atom) - cg_peratom->forward_comm(this,FORWARD_AD_PERATOM); + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); else if (differentiation_flag == 0) - cg_peratom->forward_comm(this,FORWARD_IK_PERATOM); + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } // calculate the force on my particles @@ -821,21 +813,19 @@ void PPPM::allocate() 1,0,0,FFT_PRECISION,collective_flag); // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods - int (*procneigh)[2] = comm->procneigh; + gc = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, + nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); - if (differentiation_flag == 1) - cg = new GridComm(lmp,world,1,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg = new GridComm(lmp,world,3,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + gc->setup(ngc_buf1,ngc_buf2); + + if (differentiation_flag) npergrid = 1; + else npergrid = 3; + + memory->create(gc_buf1,npergrid*ngc_buf1,"pppm:gc_buf1"); + memory->create(gc_buf2,npergrid*ngc_buf2,"pppm:gc_buf2"); } /* ---------------------------------------------------------------------- @@ -877,7 +867,7 @@ void PPPM::deallocate() } memory->destroy(gf_b); - if (stagger_flag) gf_b = NULL; + if (stagger_flag) gf_b = nullptr; memory->destroy2d_offset(rho1d,-order_allocated/2); memory->destroy2d_offset(drho1d,-order_allocated/2); memory->destroy2d_offset(rho_coeff,(1-order_allocated)/2); @@ -886,7 +876,9 @@ void PPPM::deallocate() delete fft1; delete fft2; delete remap; - delete cg; + delete gc; + memory->destroy(gc_buf1); + memory->destroy(gc_buf2); } /* ---------------------------------------------------------------------- @@ -915,24 +907,16 @@ void PPPM::allocate_peratom() memory->create3d_offset(v5_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm:v5_brick"); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - int (*procneigh)[2] = comm->procneigh; + if (differentiation_flag) npergrid = 6; + else npergrid = 7; - if (differentiation_flag == 1) - cg_peratom = - new GridComm(lmp,world,6,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_peratom = - new GridComm(lmp,world,7,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + memory->destroy(gc_buf1); + memory->destroy(gc_buf2); + memory->create(gc_buf1,npergrid*ngc_buf1,"pppm:gc_buf1"); + memory->create(gc_buf2,npergrid*ngc_buf2,"pppm:gc_buf2"); } /* ---------------------------------------------------------------------- @@ -952,8 +936,6 @@ void PPPM::deallocate_peratom() if (differentiation_flag != 1) memory->destroy3d_offset(u_brick,nzlo_out,nylo_out,nxlo_out); - - delete cg_peratom; } /* ---------------------------------------------------------------------- @@ -1002,7 +984,8 @@ void PPPM::set_grid_global() int count = 0; while (1) { - // set grid dimension + // set grid dimensions + nx_pppm = static_cast (xprd/h_x); ny_pppm = static_cast (yprd/h_y); nz_pppm = static_cast (zprd_slab/h_z); @@ -1011,31 +994,16 @@ void PPPM::set_grid_global() if (ny_pppm <= 1) ny_pppm = 2; if (nz_pppm <= 1) nz_pppm = 2; - //set local grid dimension - int npey_fft,npez_fft; - if (nz_pppm >= nprocs) { - npey_fft = 1; - npez_fft = nprocs; - } else procs2grid2d(nprocs,ny_pppm,nz_pppm,&npey_fft,&npez_fft); - - int me_y = me % npey_fft; - int me_z = me / npey_fft; - - nxlo_fft = 0; - nxhi_fft = nx_pppm - 1; - nylo_fft = me_y*ny_pppm/npey_fft; - nyhi_fft = (me_y+1)*ny_pppm/npey_fft - 1; - nzlo_fft = me_z*nz_pppm/npez_fft; - nzhi_fft = (me_z+1)*nz_pppm/npez_fft - 1; + // estimate Kspace force error double df_kspace = compute_df_kspace(); - count++; - // break loop if the accuracy has been reached or // too many loops have been performed + count++; if (df_kspace <= accuracy) break; + if (count > 500) error->all(FLERR, "Could not compute grid size"); h *= 0.95; h_x = h_y = h_z = h; @@ -1163,7 +1131,11 @@ double PPPM::compute_df_kspace() double PPPM::compute_qopt() { - double qopt = 0.0; + int k,l,m,nx,ny,nz; + double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; + double u1,u2,sqk; + double sum1,sum2,sum3,sum4,dot2; + double *prd = domain->prd; const double xprd = prd[0]; @@ -1176,67 +1148,69 @@ double PPPM::compute_qopt() const double unitky = (MY_2PI/yprd); const double unitkz = (MY_2PI/zprd_slab); - double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; - double u1, u2, sqk; - double sum1,sum2,sum3,sum4,dot2; - - int k,l,m,nx,ny,nz; const int twoorder = 2*order; - for (m = nzlo_fft; m <= nzhi_fft; m++) { + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point + + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + int nxy_pppm = nx_pppm * ny_pppm; + + double qopt = 0.0; + + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm; + l = (i/nx_pppm) % ny_pppm; + m = i / nxy_pppm; + + const int kper = k - nx_pppm*(2*k/nx_pppm); + const int lper = l - ny_pppm*(2*l/ny_pppm); const int mper = m - nz_pppm*(2*m/nz_pppm); - for (l = nylo_fft; l <= nyhi_fft; l++) { - const int lper = l - ny_pppm*(2*l/ny_pppm); + sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper); + if (sqk == 0.0) continue; - for (k = nxlo_fft; k <= nxhi_fft; k++) { - const int kper = k - nx_pppm*(2*k/nx_pppm); + sum1 = sum2 = sum3 = sum4 = 0.0; - sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper); + for (nx = -2; nx <= 2; nx++) { + qx = unitkx*(kper+nx_pppm*nx); + sx = exp(-0.25*square(qx/g_ewald)); + argx = 0.5*qx*xprd/nx_pppm; + wx = powsinxx(argx,twoorder); + qx *= qx; - if (sqk != 0.0) { + for (ny = -2; ny <= 2; ny++) { + qy = unitky*(lper+ny_pppm*ny); + sy = exp(-0.25*square(qy/g_ewald)); + argy = 0.5*qy*yprd/ny_pppm; + wy = powsinxx(argy,twoorder); + qy *= qy; - sum1 = 0.0; - sum2 = 0.0; - sum3 = 0.0; - sum4 = 0.0; - for (nx = -2; nx <= 2; nx++) { - qx = unitkx*(kper+nx_pppm*nx); - sx = exp(-0.25*square(qx/g_ewald)); - argx = 0.5*qx*xprd/nx_pppm; - wx = powsinxx(argx,twoorder); - qx *= qx; + for (nz = -2; nz <= 2; nz++) { + qz = unitkz*(mper+nz_pppm*nz); + sz = exp(-0.25*square(qz/g_ewald)); + argz = 0.5*qz*zprd_slab/nz_pppm; + wz = powsinxx(argz,twoorder); + qz *= qz; - for (ny = -2; ny <= 2; ny++) { - qy = unitky*(lper+ny_pppm*ny); - sy = exp(-0.25*square(qy/g_ewald)); - argy = 0.5*qy*yprd/ny_pppm; - wy = powsinxx(argy,twoorder); - qy *= qy; + dot2 = qx+qy+qz; + u1 = sx*sy*sz; + u2 = wx*wy*wz; - for (nz = -2; nz <= 2; nz++) { - qz = unitkz*(mper+nz_pppm*nz); - sz = exp(-0.25*square(qz/g_ewald)); - argz = 0.5*qz*zprd_slab/nz_pppm; - wz = powsinxx(argz,twoorder); - qz *= qz; - - dot2 = qx+qy+qz; - u1 = sx*sy*sz; - u2 = wx*wy*wz; - sum1 += u1*u1/dot2*MY_4PI*MY_4PI; - sum2 += u1 * u2 * MY_4PI; - sum3 += u2; - sum4 += dot2*u2; - } - } - } - sum2 *= sum2; - qopt += sum1 - sum2/(sum3*sum4); + sum1 += u1*u1/dot2*MY_4PI*MY_4PI; + sum2 += u1 * u2 * MY_4PI; + sum3 += u2; + sum4 += dot2*u2; } } } + + sum2 *= sum2; + qopt += sum1 - sum2/(sum3*sum4); } + + // sum qopt over all procs + double qopt_all; MPI_Allreduce(&qopt,&qopt_all,1,MPI_DOUBLE,MPI_SUM,world); return qopt_all; @@ -1349,18 +1323,31 @@ void PPPM::set_grid_local() // nlo_in,nhi_in = lower/upper limits of the 3d sub-brick of // global PPPM grid that I own without ghost cells // for slab PPPM, assign z grid as if it were not extended + // both non-tiled and tiled proc layouts use 0-1 fractional sumdomain info - nxlo_in = static_cast (comm->xsplit[comm->myloc[0]] * nx_pppm); - nxhi_in = static_cast (comm->xsplit[comm->myloc[0]+1] * nx_pppm) - 1; + if (comm->layout != Comm::LAYOUT_TILED) { + nxlo_in = static_cast (comm->xsplit[comm->myloc[0]] * nx_pppm); + nxhi_in = static_cast (comm->xsplit[comm->myloc[0]+1] * nx_pppm) - 1; - nylo_in = static_cast (comm->ysplit[comm->myloc[1]] * ny_pppm); - nyhi_in = static_cast (comm->ysplit[comm->myloc[1]+1] * ny_pppm) - 1; + nylo_in = static_cast (comm->ysplit[comm->myloc[1]] * ny_pppm); + nyhi_in = static_cast (comm->ysplit[comm->myloc[1]+1] * ny_pppm) - 1; - nzlo_in = static_cast + nzlo_in = static_cast (comm->zsplit[comm->myloc[2]] * nz_pppm/slab_volfactor); - nzhi_in = static_cast + nzhi_in = static_cast (comm->zsplit[comm->myloc[2]+1] * nz_pppm/slab_volfactor) - 1; + } else { + nxlo_in = static_cast (comm->mysplit[0][0] * nx_pppm); + nxhi_in = static_cast (comm->mysplit[0][1] * nx_pppm) - 1; + + nylo_in = static_cast (comm->mysplit[1][0] * ny_pppm); + nyhi_in = static_cast (comm->mysplit[1][1] * ny_pppm) - 1; + + nzlo_in = static_cast (comm->mysplit[2][0] * nz_pppm/slab_volfactor); + nzhi_in = static_cast (comm->mysplit[2][1] * nz_pppm/slab_volfactor) - 1; + } + // nlower,nupper = stencil size for mapping particles to PPPM grid nlower = -(order-1)/2; @@ -1446,22 +1433,26 @@ void PPPM::set_grid_local() // -z proc, but not vice versa // this is accomplished by nzhi_in = nzhi_out on +z end (no ghost cells) // also insure no other procs use ghost cells beyond +z limit + // differnet logic for non-tiled vs tiled decomposition if (slabflag == 1) { - if (comm->myloc[2] == comm->procgrid[2]-1) - nzhi_in = nzhi_out = nz_pppm - 1; + if (comm->layout != Comm::LAYOUT_TILED) { + if (comm->myloc[2] == comm->procgrid[2]-1) nzhi_in = nzhi_out = nz_pppm - 1; + } else { + if (comm->mysplit[2][1] == 1.0) nzhi_in = nzhi_out = nz_pppm - 1; + } nzhi_out = MIN(nzhi_out,nz_pppm-1); } - // decomposition of FFT mesh + // x-pencil decomposition of FFT mesh // global indices range from 0 to N-1 - // proc owns entire x-dimension, clumps of columns in y,z dimensions + // each proc owns entire x-dimension, clumps of columns in y,z dimensions // npey_fft,npez_fft = # of procs in y,z dims // if nprocs is small enough, proc can own 1 or more entire xy planes, // else proc owns 2d sub-blocks of yz plane // me_y,me_z = which proc (0-npe_fft-1) I am in y,z dimensions // nlo_fft,nhi_fft = lower/upper limit of the section - // of the global FFT mesh that I own + // of the global FFT mesh that I own in x-pencil decomposition int npey_fft,npez_fft; if (nz_pppm >= nprocs) { @@ -1479,13 +1470,13 @@ void PPPM::set_grid_local() nzlo_fft = me_z*nz_pppm/npez_fft; nzhi_fft = (me_z+1)*nz_pppm/npez_fft - 1; - // PPPM grid pts owned by this proc, including ghosts + // ngrid = count of PPPM grid pts owned by this proc, including ghosts ngrid = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); - // FFT grids owned by this proc, without ghosts - // nfft = FFT points in FFT decomposition on this proc + // count of FFT grids pts owned by this proc, without ghosts + // nfft = FFT points in x-pencil FFT decomposition on this proc // nfft_brick = FFT points in 3d brick-decomposition on this proc // nfft_both = greater of 2 values @@ -2637,8 +2628,10 @@ void PPPM::fieldforce_peratom() pack own values to buf to send to another proc ------------------------------------------------------------------------- */ -void PPPM::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPM::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == FORWARD_IK) { @@ -2695,8 +2688,10 @@ void PPPM::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's own values from buf and set own ghost values ------------------------------------------------------------------------- */ -void PPPM::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPM::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == FORWARD_IK) { @@ -2753,8 +2748,10 @@ void PPPM::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) pack ghost values into buf to send to another proc ------------------------------------------------------------------------- */ -void PPPM::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPM::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + if (flag == REVERSE_RHO) { FFT_SCALAR *src = &density_brick[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) @@ -2766,8 +2763,10 @@ void PPPM::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's ghost values from buf and add to own values ------------------------------------------------------------------------- */ -void PPPM::unpack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPM::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + if (flag == REVERSE_RHO) { FFT_SCALAR *dest = &density_brick[nzlo_out][nylo_out][nxlo_out]; for (int i = 0; i < nlist; i++) @@ -3056,6 +3055,7 @@ int PPPM::timing_3d(int n, double &time3d) double PPPM::memory_usage() { double bytes = nmax*3 * sizeof(double); + int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); if (differentiation_flag == 1) { @@ -3063,6 +3063,7 @@ double PPPM::memory_usage() } else { bytes += 4 * nbrick * sizeof(FFT_SCALAR); } + if (triclinic) bytes += 3 * nfft_both * sizeof(double); bytes += 6 * nfft_both * sizeof(double); bytes += nfft_both * sizeof(double); @@ -3076,7 +3077,9 @@ double PPPM::memory_usage() bytes += 2 * nfft_both * sizeof(FFT_SCALAR);; } - if (cg) bytes += cg->memory_usage(); + // two GridComm bufs + + bytes += (ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); return bytes; } @@ -3134,7 +3137,8 @@ void PPPM::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) density_brick = density_A_brick; density_fft = density_A_fft; - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // group B @@ -3142,7 +3146,8 @@ void PPPM::compute_group_group(int groupbit_A, int groupbit_B, int AA_flag) density_brick = density_B_brick; density_fft = density_B_fft; - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // switch back pointers @@ -3436,7 +3441,7 @@ void PPPM::poisson_groups_triclinic() } /* ---------------------------------------------------------------------- - Slab-geometry correction term to dampen inter-slab interactions between + slab-geometry correction term to dampen inter-slab interactions between periodically repeating slabs. Yields good approximation to 2D Ewald if adequate empty space is left between repeating slabs (J. Chem. Phys. 111, 3155). Slabs defined here to be parallel to the xy plane. Also diff --git a/src/KSPACE/pppm.h b/src/KSPACE/pppm.h index f73fb49ad3..7451af47b4 100644 --- a/src/KSPACE/pppm.h +++ b/src/KSPACE/pppm.h @@ -96,17 +96,21 @@ class PPPM : public KSpace { double sf_coeff[6]; // coefficients for calculating ad self-forces double **acons; + // FFTs and grid communication + + class FFT3d *fft1,*fft2; + class Remap *remap; + class GridComm *gc; + + FFT_SCALAR *gc_buf1,*gc_buf2; + int ngc_buf1,ngc_buf2,npergrid; + // group-group interactions int group_allocate_flag; FFT_SCALAR ***density_A_brick,***density_B_brick; FFT_SCALAR *density_A_fft,*density_B_fft; - class FFT3d *fft1,*fft2; - class Remap *remap; - class GridComm *cg; - class GridComm *cg_peratom; - int **part2grid; // storage for particle -> grid mapping int nmax; @@ -160,10 +164,10 @@ class PPPM : public KSpace { // grid communication - virtual void pack_forward(int, FFT_SCALAR *, int, int *); - virtual void unpack_forward(int, FFT_SCALAR *, int, int *); - virtual void pack_reverse(int, FFT_SCALAR *, int, int *); - virtual void unpack_reverse(int, FFT_SCALAR *, int, int *); + virtual void pack_forward_grid(int, void *, int, int *); + virtual void unpack_forward_grid(int, void *, int, int *); + virtual void pack_reverse_grid(int, void *, int, int *); + virtual void unpack_reverse_grid(int, void *, int, int *); // triclinic diff --git a/src/KSPACE/pppm_cg.cpp b/src/KSPACE/pppm_cg.cpp index 14631c480e..62f816a94d 100644 --- a/src/KSPACE/pppm_cg.cpp +++ b/src/KSPACE/pppm_cg.cpp @@ -16,20 +16,18 @@ ------------------------------------------------------------------------- */ #include "pppm_cg.h" -#include -#include -#include + #include "atom.h" -#include "gridcomm.h" #include "domain.h" #include "error.h" -#include "force.h" -#include "neighbor.h" -#include "memory.h" +#include "gridcomm.h" #include "math_const.h" +#include "memory.h" +#include "neighbor.h" #include "remap.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -49,7 +47,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ PPPMCG::PPPMCG(LAMMPS *lmp) : PPPM(lmp), - is_charged(NULL) + is_charged(nullptr) { num_charged = -1; group_group_enable = 1; @@ -66,7 +64,7 @@ void PPPMCG::settings(int narg, char **arg) PPPM::settings(narg,arg); - if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1])); + if (narg == 2) smallq = fabs(utils::numeric(FLERR,arg[1],false,lmp)); else smallq = SMALLQ; } @@ -90,11 +88,7 @@ void PPPMCG::compute(int eflag, int vflag) ev_init(eflag,vflag); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); // if atom count has changed, update qsum and qsqsum @@ -162,6 +156,7 @@ void PPPMCG::compute(int eflag, int vflag) } // only need to rebuild this list after a neighbor list update + if (neighbor->ago == 0) { num_charged = 0; for (int i = 0; i < atom->nlocal; ++i) { @@ -182,7 +177,8 @@ void PPPMCG::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // compute potential gradient on my FFT grid and @@ -195,16 +191,22 @@ void PPPMCG::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - if (differentiation_flag == 1) cg->forward_comm(this,FORWARD_AD); - else cg->forward_comm(this,FORWARD_IK); + if (differentiation_flag == 1) + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); + else + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication if (evflag_atom) { if (differentiation_flag == 1 && vflag_atom) - cg_peratom->forward_comm(this,FORWARD_AD_PERATOM); + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); else if (differentiation_flag == 0) - cg_peratom->forward_comm(this,FORWARD_IK_PERATOM); + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } // calculate the force on my particles diff --git a/src/KSPACE/pppm_dipole.cpp b/src/KSPACE/pppm_dipole.cpp index 314e8704b3..feb17e522e 100644 --- a/src/KSPACE/pppm_dipole.cpp +++ b/src/KSPACE/pppm_dipole.cpp @@ -16,26 +16,23 @@ ------------------------------------------------------------------------- */ #include "pppm_dipole.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "gridcomm.h" -#include "force.h" -#include "pair.h" #include "domain.h" -#include "fft3d_wrap.h" -#include "remap_wrap.h" -#include "memory.h" #include "error.h" -#include "update.h" -#include "utils.h" -#include "fmt/format.h" - +#include "fft3d_wrap.h" +#include "force.h" +#include "gridcomm.h" #include "math_const.h" #include "math_special.h" +#include "memory.h" +#include "pair.h" +#include "remap_wrap.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -61,26 +58,25 @@ enum{FORWARD_MU,FORWARD_MU_PERATOM}; /* ---------------------------------------------------------------------- */ PPPMDipole::PPPMDipole(LAMMPS *lmp) : PPPM(lmp), - densityx_brick_dipole(NULL), densityy_brick_dipole(NULL), - densityz_brick_dipole(NULL), - vdxx_brick_dipole(NULL), vdyy_brick_dipole(NULL), vdzz_brick_dipole(NULL), - vdxy_brick_dipole(NULL), vdxz_brick_dipole(NULL), vdyz_brick_dipole(NULL), - ux_brick_dipole(NULL), uy_brick_dipole(NULL), uz_brick_dipole(NULL), - v0x_brick_dipole(NULL), v1x_brick_dipole(NULL), - v2x_brick_dipole(NULL), v3x_brick_dipole(NULL), v4x_brick_dipole(NULL), - v5x_brick_dipole(NULL), v0y_brick_dipole(NULL), v1y_brick_dipole(NULL), - v2y_brick_dipole(NULL), v3y_brick_dipole(NULL), v4y_brick_dipole(NULL), - v5y_brick_dipole(NULL), v0z_brick_dipole(NULL), v1z_brick_dipole(NULL), - v2z_brick_dipole(NULL), v3z_brick_dipole(NULL), v4z_brick_dipole(NULL), - v5z_brick_dipole(NULL), work3(NULL), work4(NULL), - densityx_fft_dipole(NULL), densityy_fft_dipole(NULL), - densityz_fft_dipole(NULL) + densityx_brick_dipole(nullptr), densityy_brick_dipole(nullptr), + densityz_brick_dipole(nullptr), + vdxx_brick_dipole(nullptr), vdyy_brick_dipole(nullptr), vdzz_brick_dipole(nullptr), + vdxy_brick_dipole(nullptr), vdxz_brick_dipole(nullptr), vdyz_brick_dipole(nullptr), + ux_brick_dipole(nullptr), uy_brick_dipole(nullptr), uz_brick_dipole(nullptr), + v0x_brick_dipole(nullptr), v1x_brick_dipole(nullptr), + v2x_brick_dipole(nullptr), v3x_brick_dipole(nullptr), v4x_brick_dipole(nullptr), + v5x_brick_dipole(nullptr), v0y_brick_dipole(nullptr), v1y_brick_dipole(nullptr), + v2y_brick_dipole(nullptr), v3y_brick_dipole(nullptr), v4y_brick_dipole(nullptr), + v5y_brick_dipole(nullptr), v0z_brick_dipole(nullptr), v1z_brick_dipole(nullptr), + v2z_brick_dipole(nullptr), v3z_brick_dipole(nullptr), v4z_brick_dipole(nullptr), + v5z_brick_dipole(nullptr), work3(nullptr), work4(nullptr), + densityx_fft_dipole(nullptr), densityy_fft_dipole(nullptr), + densityz_fft_dipole(nullptr) { dipoleflag = 1; group_group_enable = 0; - cg_dipole = NULL; - cg_peratom_dipole = NULL; + gc_dipole = nullptr; } /* ---------------------------------------------------------------------- @@ -93,10 +89,6 @@ PPPMDipole::~PPPMDipole() deallocate(); if (peratom_allocate_flag) deallocate_peratom(); - fft1 = NULL; - fft2 = NULL; - remap = NULL; - cg_dipole = NULL; } /* ---------------------------------------------------------------------- @@ -161,7 +153,7 @@ void PPPMDipole::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -195,9 +187,7 @@ void PPPMDipole::init() // or overlap is allowed, then done // else reduce order and try again - int (*procneigh)[2] = comm->procneigh; - - GridComm *cgtmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -210,24 +200,24 @@ void PPPMDipole::init() set_grid_local(); if (overlap_allowed) break; - cgtmp = new GridComm(lmp,world,1,1, + gctmp = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - cgtmp->ghost_notify(); - if (!cgtmp->ghost_overlap()) break; - delete cgtmp; + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + int tmp1,tmp2; + gctmp->setup(tmp1,tmp2); + if (gctmp->ghost_adjacent()) break; + delete gctmp; order--; iteration++; } if (order < minorder) error->all(FLERR,"PPPMDipole order < minimum allowed order"); - if (!overlap_allowed && cgtmp->ghost_overlap()) + if (!overlap_allowed && !gctmp->ghost_adjacent()) error->all(FLERR,"PPPMDipole grid stencil extends " "beyond nearest neighbor processor"); - if (cgtmp) delete cgtmp; + if (gctmp) delete gctmp; // adjust g_ewald @@ -261,8 +251,6 @@ void PPPMDipole::init() // don't invoke allocate peratom(), will be allocated when needed allocate(); - cg_dipole->ghost_notify(); - cg_dipole->setup(); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -385,11 +373,9 @@ void PPPMDipole::setup_grid() allocate(); - cg_dipole->ghost_notify(); - if (overlap_allowed == 0 && cg_dipole->ghost_overlap()) + if (!overlap_allowed && !gc_dipole->ghost_adjacent()) error->all(FLERR,"PPPMDipole grid stencil extends " "beyond nearest neighbor processor"); - cg_dipole->setup(); // pre-compute Green's function denomiator expansion // pre-compute 1d charge distribution coefficients @@ -421,11 +407,7 @@ void PPPMDipole::compute(int eflag, int vflag) error->all(FLERR,"Cannot (yet) compute per-atom virial " "with kspace style pppm/dipole"); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom_dipole->ghost_notify(); - cg_peratom_dipole->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); // if atom count has changed, update qsum and qsqsum @@ -460,7 +442,8 @@ void PPPMDipole::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg_dipole->reverse_comm(this,REVERSE_MU); + gc_dipole->reverse_comm_kspace(this,3,sizeof(FFT_SCALAR),REVERSE_MU, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_dipole(); // compute potential gradient on my FFT grid and @@ -473,13 +456,14 @@ void PPPMDipole::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - cg_dipole->forward_comm(this,FORWARD_MU); + gc_dipole->forward_comm_kspace(this,9,sizeof(FFT_SCALAR),FORWARD_MU, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication - if (evflag_atom) { - cg_peratom_dipole->forward_comm(this,FORWARD_MU_PERATOM); - } + if (evflag_atom) + gc->forward_comm_kspace(this,18,sizeof(FFT_SCALAR),FORWARD_MU_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // calculate the force on my particles @@ -522,7 +506,8 @@ void PPPMDipole::compute(int eflag, int vflag) if (eflag_atom) { for (i = 0; i < nlocal; i++) { eatom[i] *= 0.5; - eatom[i] -= (mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + mu[i][2]*mu[i][2])*2.0*g3/3.0/MY_PIS; + eatom[i] -= (mu[i][0]*mu[i][0] + mu[i][1]*mu[i][1] + + mu[i][2]*mu[i][2])*2.0*g3/3.0/MY_PIS; eatom[i] *= qscale; } } @@ -619,14 +604,18 @@ void PPPMDipole::allocate() 1,0,0,FFT_PRECISION,collective_flag); // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods - int (*procneigh)[2] = comm->procneigh; - - cg_dipole = new GridComm(lmp,world,9,3, + gc_dipole = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + gc->setup(ngc_buf1,ngc_buf2); + + npergrid = 9; + + memory->create(gc_buf1,npergrid*ngc_buf1,"pppm:gc_buf1"); + memory->create(gc_buf2,npergrid*ngc_buf2,"pppm:gc_buf2"); } /* ---------------------------------------------------------------------- @@ -674,7 +663,9 @@ void PPPMDipole::deallocate() delete fft1; delete fft2; delete remap; - delete cg_dipole; + delete gc_dipole; + memory->destroy(gc_buf1); + memory->destroy(gc_buf2); } /* ---------------------------------------------------------------------- @@ -724,16 +715,15 @@ void PPPMDipole::allocate_peratom() memory->create3d_offset(v5z_brick_dipole,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm_dipole:v5z_brick_dipole"); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - int (*procneigh)[2] = comm->procneigh; + npergrid = 18; - cg_peratom_dipole = - new GridComm(lmp,world,18,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + memory->destroy(gc_buf1); + memory->destroy(gc_buf2); + memory->create(gc_buf1,npergrid*ngc_buf1,"pppm:gc_buf1"); + memory->create(gc_buf2,npergrid*ngc_buf2,"pppm:gc_buf2"); } /* ---------------------------------------------------------------------- @@ -764,8 +754,6 @@ void PPPMDipole::deallocate_peratom() memory->destroy3d_offset(v3z_brick_dipole,nzlo_out,nylo_out,nxlo_out); memory->destroy3d_offset(v4z_brick_dipole,nzlo_out,nylo_out,nxlo_out); memory->destroy3d_offset(v5z_brick_dipole,nzlo_out,nylo_out,nxlo_out); - - delete cg_peratom_dipole; } /* ---------------------------------------------------------------------- @@ -2171,8 +2159,10 @@ void PPPMDipole::fieldforce_peratom_dipole() pack own values to buf to send to another proc ------------------------------------------------------------------------- */ -void PPPMDipole::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDipole::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == FORWARD_MU) { @@ -2242,8 +2232,10 @@ void PPPMDipole::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's own values from buf and set own ghost values ------------------------------------------------------------------------- */ -void PPPMDipole::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDipole::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == FORWARD_MU) { @@ -2313,8 +2305,10 @@ void PPPMDipole::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) pack ghost values into buf to send to another proc ------------------------------------------------------------------------- */ -void PPPMDipole::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDipole::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == REVERSE_MU) { FFT_SCALAR *src_dipole0 = &densityx_brick_dipole[nzlo_out][nylo_out][nxlo_out]; @@ -2332,8 +2326,10 @@ void PPPMDipole::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's ghost values from buf and add to own values ------------------------------------------------------------------------- */ -void PPPMDipole::unpack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDipole::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; if (flag == REVERSE_MU) { FFT_SCALAR *dest_dipole0 = &densityx_brick_dipole[nzlo_out][nylo_out][nxlo_out]; @@ -2484,6 +2480,7 @@ int PPPMDipole::timing_3d(int n, double &time3d) double PPPMDipole::memory_usage() { double bytes = nmax*3 * sizeof(double); + int nbrick = (nxhi_out-nxlo_out+1) * (nyhi_out-nylo_out+1) * (nzhi_out-nzlo_out+1); bytes += 6 * nfft_both * sizeof(double); // vg @@ -2495,8 +2492,9 @@ double PPPMDipole::memory_usage() if (peratom_allocate_flag) bytes += 21 * nbrick * sizeof(FFT_SCALAR); - if (cg_dipole) bytes += cg_dipole->memory_usage(); - if (cg_peratom_dipole) bytes += cg_peratom_dipole->memory_usage(); + // two GridComm bufs + + bytes += (ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); return bytes; } diff --git a/src/KSPACE/pppm_dipole.h b/src/KSPACE/pppm_dipole.h index a767f8b4c2..eb49361842 100644 --- a/src/KSPACE/pppm_dipole.h +++ b/src/KSPACE/pppm_dipole.h @@ -50,10 +50,10 @@ class PPPMDipole : public PPPM { // grid communication - void pack_forward(int, FFT_SCALAR *, int, int *); - void unpack_forward(int, FFT_SCALAR *, int, int *); - void pack_reverse(int, FFT_SCALAR *, int, int *); - void unpack_reverse(int, FFT_SCALAR *, int, int *); + void pack_forward_grid(int, void *, int, int *); + void unpack_forward_grid(int, void *, int, int *); + void pack_reverse_grid(int, void *, int, int *); + void unpack_reverse_grid(int, void *, int, int *); // dipole @@ -69,10 +69,12 @@ class PPPMDipole : public PPPM { FFT_SCALAR ***v3z_brick_dipole,***v4z_brick_dipole,***v5z_brick_dipole; FFT_SCALAR *work3,*work4; FFT_SCALAR *densityx_fft_dipole,*densityy_fft_dipole,*densityz_fft_dipole; - class GridComm *cg_dipole; - class GridComm *cg_peratom_dipole; + + class GridComm *gc_dipole; + int only_dipole_flag; double musum,musqsum,mu2; + double find_gewald_dipole(double, double, bigint, double, double); double newton_raphson_f_dipole(double, double, bigint, double, double); double derivf_dipole(double, double, bigint, double, double); @@ -87,7 +89,6 @@ class PPPMDipole : public PPPM { void fieldforce_peratom_dipole(); double final_accuracy_dipole(); void musum_musq(); - }; } diff --git a/src/KSPACE/pppm_dipole_spin.cpp b/src/KSPACE/pppm_dipole_spin.cpp index a4373eb276..a3f7aa29cf 100644 --- a/src/KSPACE/pppm_dipole_spin.cpp +++ b/src/KSPACE/pppm_dipole_spin.cpp @@ -16,22 +16,19 @@ ------------------------------------------------------------------------- */ #include "pppm_dipole_spin.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "gridcomm.h" -#include "force.h" -#include "pair.h" #include "domain.h" -#include "memory.h" #include "error.h" -#include "update.h" -#include "utils.h" -#include "fmt/format.h" - +#include "force.h" +#include "gridcomm.h" #include "math_const.h" +#include "memory.h" +#include "pair.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -78,10 +75,10 @@ PPPMDipoleSpin::~PPPMDipoleSpin() deallocate(); if (peratom_allocate_flag) deallocate_peratom(); - fft1 = NULL; - fft2 = NULL; - remap = NULL; - cg_dipole = NULL; + fft1 = nullptr; + fft2 = nullptr; + remap = nullptr; + gc_dipole = nullptr; } /* ---------------------------------------------------------------------- @@ -142,7 +139,7 @@ void PPPMDipoleSpin::init() int itmp = 0; double *p_cutoff = (double *) force->pair->extract("cut_coul",itmp); // check the correct extract here - if (p_cutoff == NULL) + if (p_cutoff == nullptr) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -175,9 +172,7 @@ void PPPMDipoleSpin::init() // or overlap is allowed, then done // else reduce order and try again - int (*procneigh)[2] = comm->procneigh; - - GridComm *cgtmp = NULL; + GridComm *gctmp = nullptr; int iteration = 0; while (order >= minorder) { @@ -190,24 +185,24 @@ void PPPMDipoleSpin::init() set_grid_local(); if (overlap_allowed) break; - cgtmp = new GridComm(lmp,world,1,1, + gctmp = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - cgtmp->ghost_notify(); - if (!cgtmp->ghost_overlap()) break; - delete cgtmp; + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + int tmp1,tmp2; + gctmp->setup(tmp1,tmp2); + if (gctmp->ghost_adjacent()) break; + delete gctmp; order--; iteration++; } if (order < minorder) error->all(FLERR,"PPPMDipoleSpin order < minimum allowed order"); - if (!overlap_allowed && cgtmp->ghost_overlap()) + if (!overlap_allowed && !gctmp->ghost_adjacent()) error->all(FLERR,"PPPMDipoleSpin grid stencil extends " "beyond nearest neighbor processor"); - if (cgtmp) delete cgtmp; + if (gctmp) delete gctmp; // adjust g_ewald @@ -241,8 +236,6 @@ void PPPMDipoleSpin::init() // don't invoke allocate peratom(), will be allocated when needed allocate(); - cg_dipole->ghost_notify(); - cg_dipole->setup(); // pre-compute Green's function denominator expansion // pre-compute 1d charge distribution coefficients @@ -270,11 +263,7 @@ void PPPMDipoleSpin::compute(int eflag, int vflag) error->all(FLERR,"Cannot (yet) compute per-atom virial " "with kspace style pppm/dipole/spin"); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom_dipole->ghost_notify(); - cg_peratom_dipole->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); // if atom count has changed, update qsum and qsqsum @@ -309,7 +298,8 @@ void PPPMDipoleSpin::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg_dipole->reverse_comm(this,REVERSE_MU); + gc_dipole->reverse_comm_kspace(this,3,sizeof(FFT_SCALAR),REVERSE_MU, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_dipole(); // compute potential gradient on my FFT grid and @@ -322,13 +312,14 @@ void PPPMDipoleSpin::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - cg_dipole->forward_comm(this,FORWARD_MU); + gc_dipole->forward_comm_kspace(this,9,sizeof(FFT_SCALAR),FORWARD_MU, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication - if (evflag_atom) { - cg_peratom_dipole->forward_comm(this,FORWARD_MU_PERATOM); - } + if (evflag_atom) + gc->forward_comm_kspace(this,18,sizeof(FFT_SCALAR),FORWARD_MU_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // calculate the force on my particles diff --git a/src/KSPACE/pppm_dipole_spin.h b/src/KSPACE/pppm_dipole_spin.h index fe88fc75ce..e50b342b19 100644 --- a/src/KSPACE/pppm_dipole_spin.h +++ b/src/KSPACE/pppm_dipole_spin.h @@ -46,7 +46,6 @@ class PPPMDipoleSpin : public PPPMDipole { void fieldforce_ik_spin(); void fieldforce_peratom_spin(); void spsum_spsq(); - }; } diff --git a/src/KSPACE/pppm_disp.cpp b/src/KSPACE/pppm_disp.cpp index b5fd14796c..a88a0892bc 100644 --- a/src/KSPACE/pppm_disp.cpp +++ b/src/KSPACE/pppm_disp.cpp @@ -17,26 +17,24 @@ ------------------------------------------------------------------------- */ #include "pppm_disp.h" -#include -#include -#include -#include -#include "math_const.h" -#include "atom.h" -#include "comm.h" -#include "gridcomm.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" -#include "bond.h" + #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" #include "domain.h" -#include "fft3d_wrap.h" -#include "remap_wrap.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "fft3d_wrap.h" +#include "force.h" +#include "gridcomm.h" +#include "math_const.h" +#include "memory.h" +#include "neighbor.h" +#include "pair.h" +#include "remap_wrap.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -51,8 +49,8 @@ enum{REVERSE_RHO, REVERSE_RHO_G, REVERSE_RHO_A, REVERSE_RHO_NONE}; enum{FORWARD_IK, FORWARD_AD, FORWARD_IK_PERATOM, FORWARD_AD_PERATOM, FORWARD_IK_G, FORWARD_AD_G, FORWARD_IK_PERATOM_G, FORWARD_AD_PERATOM_G, FORWARD_IK_A, FORWARD_AD_A, FORWARD_IK_PERATOM_A, FORWARD_AD_PERATOM_A, - FORWARD_IK_NONE, FORWARD_AD_NONE, FORWARD_IK_PERATOM_NONE, FORWARD_AD_PERATOM_NONE}; - + FORWARD_IK_NONE, FORWARD_AD_NONE, FORWARD_IK_PERATOM_NONE, + FORWARD_AD_PERATOM_NONE}; #ifdef FFT_SINGLE #define ZEROF 0.0f @@ -65,47 +63,47 @@ enum{FORWARD_IK, FORWARD_AD, FORWARD_IK_PERATOM, FORWARD_AD_PERATOM, /* ---------------------------------------------------------------------- */ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), - factors(NULL), csumi(NULL), cii(NULL), B(NULL), density_brick(NULL), vdx_brick(NULL), - vdy_brick(NULL), vdz_brick(NULL), density_fft(NULL), u_brick(NULL), v0_brick(NULL), - v1_brick(NULL), v2_brick(NULL), v3_brick(NULL), v4_brick(NULL), v5_brick(NULL), - density_brick_g(NULL), vdx_brick_g(NULL), vdy_brick_g(NULL), vdz_brick_g(NULL), - density_fft_g(NULL), u_brick_g(NULL), v0_brick_g(NULL), v1_brick_g(NULL), v2_brick_g(NULL), - v3_brick_g(NULL), v4_brick_g(NULL), v5_brick_g(NULL), density_brick_a0(NULL), - vdx_brick_a0(NULL), vdy_brick_a0(NULL), vdz_brick_a0(NULL), density_fft_a0(NULL), - u_brick_a0(NULL), v0_brick_a0(NULL), v1_brick_a0(NULL), v2_brick_a0(NULL), - v3_brick_a0(NULL), v4_brick_a0(NULL), v5_brick_a0(NULL), density_brick_a1(NULL), - vdx_brick_a1(NULL), vdy_brick_a1(NULL), vdz_brick_a1(NULL), density_fft_a1(NULL), - u_brick_a1(NULL), v0_brick_a1(NULL), v1_brick_a1(NULL), v2_brick_a1(NULL), - v3_brick_a1(NULL), v4_brick_a1(NULL), v5_brick_a1(NULL), density_brick_a2(NULL), - vdx_brick_a2(NULL), vdy_brick_a2(NULL), vdz_brick_a2(NULL), density_fft_a2(NULL), - u_brick_a2(NULL), v0_brick_a2(NULL), v1_brick_a2(NULL), v2_brick_a2(NULL), - v3_brick_a2(NULL), v4_brick_a2(NULL), v5_brick_a2(NULL), density_brick_a3(NULL), - vdx_brick_a3(NULL), vdy_brick_a3(NULL), vdz_brick_a3(NULL), density_fft_a3(NULL), - u_brick_a3(NULL), v0_brick_a3(NULL), v1_brick_a3(NULL), v2_brick_a3(NULL), - v3_brick_a3(NULL), v4_brick_a3(NULL), v5_brick_a3(NULL), density_brick_a4(NULL), - vdx_brick_a4(NULL), vdy_brick_a4(NULL), vdz_brick_a4(NULL), density_fft_a4(NULL), - u_brick_a4(NULL), v0_brick_a4(NULL), v1_brick_a4(NULL), v2_brick_a4(NULL), - v3_brick_a4(NULL), v4_brick_a4(NULL), v5_brick_a4(NULL), density_brick_a5(NULL), - vdx_brick_a5(NULL), vdy_brick_a5(NULL), vdz_brick_a5(NULL), density_fft_a5(NULL), - u_brick_a5(NULL), v0_brick_a5(NULL), v1_brick_a5(NULL), v2_brick_a5(NULL), - v3_brick_a5(NULL), v4_brick_a5(NULL), v5_brick_a5(NULL), density_brick_a6(NULL), - vdx_brick_a6(NULL), vdy_brick_a6(NULL), vdz_brick_a6(NULL), density_fft_a6(NULL), - u_brick_a6(NULL), v0_brick_a6(NULL), v1_brick_a6(NULL), v2_brick_a6(NULL), - v3_brick_a6(NULL), v4_brick_a6(NULL), v5_brick_a6(NULL), density_brick_none(NULL), - vdx_brick_none(NULL), vdy_brick_none(NULL), vdz_brick_none(NULL), - density_fft_none(NULL), u_brick_none(NULL), v0_brick_none(NULL), v1_brick_none(NULL), - v2_brick_none(NULL), v3_brick_none(NULL), v4_brick_none(NULL), v5_brick_none(NULL), - greensfn(NULL), vg(NULL), vg2(NULL), greensfn_6(NULL), vg_6(NULL), vg2_6(NULL), - fkx(NULL), fky(NULL), fkz(NULL), fkx2(NULL), fky2(NULL), fkz2(NULL), fkx_6(NULL), - fky_6(NULL), fkz_6(NULL), fkx2_6(NULL), fky2_6(NULL), fkz2_6(NULL), gf_b(NULL), - gf_b_6(NULL), sf_precoeff1(NULL), sf_precoeff2(NULL), sf_precoeff3(NULL), - sf_precoeff4(NULL), sf_precoeff5(NULL), sf_precoeff6(NULL), sf_precoeff1_6(NULL), - sf_precoeff2_6(NULL), sf_precoeff3_6(NULL), sf_precoeff4_6(NULL), sf_precoeff5_6(NULL), - sf_precoeff6_6(NULL), rho1d(NULL), rho_coeff(NULL), drho1d(NULL), drho_coeff(NULL), - rho1d_6(NULL), rho_coeff_6(NULL), drho1d_6(NULL), drho_coeff_6(NULL), work1(NULL), - work2(NULL), work1_6(NULL), work2_6(NULL), fft1(NULL), fft2(NULL), fft1_6(NULL), - fft2_6(NULL), remap(NULL), remap_6(NULL), cg(NULL), cg_peratom(NULL), cg_6(NULL), - cg_peratom_6(NULL), part2grid(NULL), part2grid_6(NULL), boxlo(NULL) + factors(nullptr), csumi(nullptr), cii(nullptr), B(nullptr), density_brick(nullptr), vdx_brick(nullptr), + vdy_brick(nullptr), vdz_brick(nullptr), density_fft(nullptr), u_brick(nullptr), v0_brick(nullptr), + v1_brick(nullptr), v2_brick(nullptr), v3_brick(nullptr), v4_brick(nullptr), v5_brick(nullptr), + density_brick_g(nullptr), vdx_brick_g(nullptr), vdy_brick_g(nullptr), vdz_brick_g(nullptr), + density_fft_g(nullptr), u_brick_g(nullptr), v0_brick_g(nullptr), v1_brick_g(nullptr), v2_brick_g(nullptr), + v3_brick_g(nullptr), v4_brick_g(nullptr), v5_brick_g(nullptr), density_brick_a0(nullptr), + vdx_brick_a0(nullptr), vdy_brick_a0(nullptr), vdz_brick_a0(nullptr), density_fft_a0(nullptr), + u_brick_a0(nullptr), v0_brick_a0(nullptr), v1_brick_a0(nullptr), v2_brick_a0(nullptr), + v3_brick_a0(nullptr), v4_brick_a0(nullptr), v5_brick_a0(nullptr), density_brick_a1(nullptr), + vdx_brick_a1(nullptr), vdy_brick_a1(nullptr), vdz_brick_a1(nullptr), density_fft_a1(nullptr), + u_brick_a1(nullptr), v0_brick_a1(nullptr), v1_brick_a1(nullptr), v2_brick_a1(nullptr), + v3_brick_a1(nullptr), v4_brick_a1(nullptr), v5_brick_a1(nullptr), density_brick_a2(nullptr), + vdx_brick_a2(nullptr), vdy_brick_a2(nullptr), vdz_brick_a2(nullptr), density_fft_a2(nullptr), + u_brick_a2(nullptr), v0_brick_a2(nullptr), v1_brick_a2(nullptr), v2_brick_a2(nullptr), + v3_brick_a2(nullptr), v4_brick_a2(nullptr), v5_brick_a2(nullptr), density_brick_a3(nullptr), + vdx_brick_a3(nullptr), vdy_brick_a3(nullptr), vdz_brick_a3(nullptr), density_fft_a3(nullptr), + u_brick_a3(nullptr), v0_brick_a3(nullptr), v1_brick_a3(nullptr), v2_brick_a3(nullptr), + v3_brick_a3(nullptr), v4_brick_a3(nullptr), v5_brick_a3(nullptr), density_brick_a4(nullptr), + vdx_brick_a4(nullptr), vdy_brick_a4(nullptr), vdz_brick_a4(nullptr), density_fft_a4(nullptr), + u_brick_a4(nullptr), v0_brick_a4(nullptr), v1_brick_a4(nullptr), v2_brick_a4(nullptr), + v3_brick_a4(nullptr), v4_brick_a4(nullptr), v5_brick_a4(nullptr), density_brick_a5(nullptr), + vdx_brick_a5(nullptr), vdy_brick_a5(nullptr), vdz_brick_a5(nullptr), density_fft_a5(nullptr), + u_brick_a5(nullptr), v0_brick_a5(nullptr), v1_brick_a5(nullptr), v2_brick_a5(nullptr), + v3_brick_a5(nullptr), v4_brick_a5(nullptr), v5_brick_a5(nullptr), density_brick_a6(nullptr), + vdx_brick_a6(nullptr), vdy_brick_a6(nullptr), vdz_brick_a6(nullptr), density_fft_a6(nullptr), + u_brick_a6(nullptr), v0_brick_a6(nullptr), v1_brick_a6(nullptr), v2_brick_a6(nullptr), + v3_brick_a6(nullptr), v4_brick_a6(nullptr), v5_brick_a6(nullptr), density_brick_none(nullptr), + vdx_brick_none(nullptr), vdy_brick_none(nullptr), vdz_brick_none(nullptr), + density_fft_none(nullptr), u_brick_none(nullptr), v0_brick_none(nullptr), v1_brick_none(nullptr), + v2_brick_none(nullptr), v3_brick_none(nullptr), v4_brick_none(nullptr), v5_brick_none(nullptr), + greensfn(nullptr), vg(nullptr), vg2(nullptr), greensfn_6(nullptr), vg_6(nullptr), vg2_6(nullptr), + fkx(nullptr), fky(nullptr), fkz(nullptr), fkx2(nullptr), fky2(nullptr), fkz2(nullptr), fkx_6(nullptr), + fky_6(nullptr), fkz_6(nullptr), fkx2_6(nullptr), fky2_6(nullptr), fkz2_6(nullptr), gf_b(nullptr), + gf_b_6(nullptr), sf_precoeff1(nullptr), sf_precoeff2(nullptr), sf_precoeff3(nullptr), + sf_precoeff4(nullptr), sf_precoeff5(nullptr), sf_precoeff6(nullptr), sf_precoeff1_6(nullptr), + sf_precoeff2_6(nullptr), sf_precoeff3_6(nullptr), sf_precoeff4_6(nullptr), sf_precoeff5_6(nullptr), + sf_precoeff6_6(nullptr), rho1d(nullptr), rho_coeff(nullptr), drho1d(nullptr), drho_coeff(nullptr), + rho1d_6(nullptr), rho_coeff_6(nullptr), drho1d_6(nullptr), drho_coeff_6(nullptr), work1(nullptr), + work2(nullptr), work1_6(nullptr), work2_6(nullptr), fft1(nullptr), fft2(nullptr), fft1_6(nullptr), + fft2_6(nullptr), remap(nullptr), remap_6(nullptr), gc(nullptr), gc6(nullptr), + part2grid(nullptr), part2grid_6(nullptr), boxlo(nullptr) { triclinic_support = 0; pppmflag = dispersionflag = 1; @@ -127,100 +125,100 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), nzhi_in_6 = nzlo_in_6 = nzhi_out_6 = nzlo_out_6 = 0; csumflag = 0; - B = NULL; - cii = NULL; - csumi = NULL; + B = nullptr; + cii = nullptr; + csumi = nullptr; peratom_allocate_flag = 0; - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; u_brick = v0_brick = v1_brick = v2_brick = v3_brick = - v4_brick = v5_brick = NULL; + v4_brick = v5_brick = nullptr; - density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = NULL; - density_fft_g = NULL; + density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = nullptr; + density_fft_g = nullptr; u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = v3_brick_g = - v4_brick_g = v5_brick_g = NULL; + v4_brick_g = v5_brick_g = nullptr; - density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = NULL; - density_fft_a0 = NULL; + density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = nullptr; + density_fft_a0 = nullptr; u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = v3_brick_a0 = - v4_brick_a0 = v5_brick_a0 = NULL; + v4_brick_a0 = v5_brick_a0 = nullptr; - density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = NULL; - density_fft_a1 = NULL; + density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = nullptr; + density_fft_a1 = nullptr; u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = v3_brick_a1 = - v4_brick_a1 = v5_brick_a1 = NULL; + v4_brick_a1 = v5_brick_a1 = nullptr; - density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = NULL; - density_fft_a2 = NULL; + density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = nullptr; + density_fft_a2 = nullptr; u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = - v4_brick_a2 = v5_brick_a2 = NULL; + v4_brick_a2 = v5_brick_a2 = nullptr; - density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = NULL; - density_fft_a3 = NULL; + density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = nullptr; + density_fft_a3 = nullptr; u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = - v4_brick_a3 = v5_brick_a3 = NULL; + v4_brick_a3 = v5_brick_a3 = nullptr; - density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = NULL; - density_fft_a4 = NULL; + density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = nullptr; + density_fft_a4 = nullptr; u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = v3_brick_a4 = - v4_brick_a4 = v5_brick_a4 = NULL; + v4_brick_a4 = v5_brick_a4 = nullptr; - density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = NULL; - density_fft_a5 = NULL; + density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = nullptr; + density_fft_a5 = nullptr; u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = v3_brick_a5 = - v4_brick_a5 = v5_brick_a5 = NULL; + v4_brick_a5 = v5_brick_a5 = nullptr; - density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = NULL; - density_fft_a6 = NULL; + density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = nullptr; + density_fft_a6 = nullptr; u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = v3_brick_a6 = - v4_brick_a6 = v5_brick_a6 = NULL; + v4_brick_a6 = v5_brick_a6 = nullptr; - density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = NULL; - density_fft_none = NULL; + density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = nullptr; + density_fft_none = nullptr; u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = v3_brick_none = - v4_brick_none = v5_brick_none = NULL; + v4_brick_none = v5_brick_none = nullptr; - greensfn = NULL; - greensfn_6 = NULL; - work1 = work2 = NULL; - work1_6 = work2_6 = NULL; - vg = NULL; - vg2 = NULL; - vg_6 = NULL; - vg2_6 = NULL; - fkx = fky = fkz = NULL; - fkx2 = fky2 = fkz2 = NULL; - fkx_6 = fky_6 = fkz_6 = NULL; - fkx2_6 = fky2_6 = fkz2_6 = NULL; + greensfn = nullptr; + greensfn_6 = nullptr; + work1 = work2 = nullptr; + work1_6 = work2_6 = nullptr; + vg = nullptr; + vg2 = nullptr; + vg_6 = nullptr; + vg2_6 = nullptr; + fkx = fky = fkz = nullptr; + fkx2 = fky2 = fkz2 = nullptr; + fkx_6 = fky_6 = fkz_6 = nullptr; + fkx2_6 = fky2_6 = fkz2_6 = nullptr; sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = sf_precoeff4 = - sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff5 = sf_precoeff6 = nullptr; sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = sf_precoeff4_6 = - sf_precoeff5_6 = sf_precoeff6_6 = NULL; + sf_precoeff5_6 = sf_precoeff6_6 = nullptr; - gf_b = NULL; - gf_b_6 = NULL; - rho1d = rho_coeff = NULL; - drho1d = drho_coeff = NULL; - rho1d_6 = rho_coeff_6 = NULL; - drho1d_6 = drho_coeff_6 = NULL; - fft1 = fft2 = NULL; - fft1_6 = fft2_6 = NULL; - remap = NULL; - remap_6 = NULL; + gf_b = nullptr; + gf_b_6 = nullptr; + rho1d = rho_coeff = nullptr; + drho1d = drho_coeff = nullptr; + rho1d_6 = rho_coeff_6 = nullptr; + drho1d_6 = drho_coeff_6 = nullptr; + fft1 = fft2 = nullptr; + fft1_6 = fft2_6 = nullptr; + remap = nullptr; + remap_6 = nullptr; + gc = gc6 = nullptr; + gc_buf1 = gc_buf2 = nullptr; + gc6_buf1 = gc6_buf2 = nullptr; + ngc_buf1 = ngc_buf2 = ngc6_buf1 = ngc6_buf2 = 0; + ngrid = ngrid_6 = npergrid = npergrid6 = 0; nmax = 0; - part2grid = NULL; - part2grid_6 = NULL; + part2grid = nullptr; + part2grid_6 = nullptr; - cg = NULL; - cg_peratom = NULL; - cg_6 = NULL; - cg_peratom_6 = NULL; - - memset(function, 0, EWALD_FUNCS*sizeof(int)); + memset(function,0,EWALD_FUNCS*sizeof(int)); } /* ---------------------------------------------------------------------- */ @@ -228,7 +226,7 @@ PPPMDisp::PPPMDisp(LAMMPS *lmp) : KSpace(lmp), void PPPMDisp::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal kspace_style pppm/disp command"); - accuracy_relative = fabs(force->numeric(FLERR,arg[0])); + accuracy_relative = fabs(utils::numeric(FLERR,arg[0],false,lmp)); } /* ---------------------------------------------------------------------- @@ -239,16 +237,16 @@ PPPMDisp::~PPPMDisp() { delete [] factors; delete [] B; - B = NULL; + B = nullptr; delete [] cii; - cii = NULL; + cii = nullptr; delete [] csumi; - csumi = NULL; + csumi = nullptr; deallocate(); deallocate_peratom(); memory->destroy(part2grid); memory->destroy(part2grid_6); - part2grid = part2grid_6 = NULL; + part2grid = part2grid_6 = nullptr; } /* ---------------------------------------------------------------------- @@ -297,9 +295,9 @@ void PPPMDisp::init() int tmp; Pair *pair = force->pair; - int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : NULL; - double *p_cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : NULL; - double *p_cutoff_lj = pair ? (double *) pair->extract("cut_LJ",tmp) : NULL; + int *ptr = pair ? (int *) pair->extract("ewald_order",tmp) : nullptr; + double *p_cutoff = pair ? (double *) pair->extract("cut_coul",tmp) : nullptr; + double *p_cutoff_lj = pair ? (double *) pair->extract("cut_LJ",tmp) : nullptr; if (!(ptr||p_cutoff||p_cutoff_lj)) error->all(FLERR,"KSpace style is incompatible with Pair style"); cutoff = *p_cutoff; @@ -379,7 +377,7 @@ void PPPMDisp::init() int typeA = *p_typeA; int typeB = *p_typeB; - if (force->angle == NULL || force->bond == NULL) + if (force->angle == nullptr || force->bond == nullptr) error->all(FLERR,"Bond and angle potentials must be defined for TIP4P"); if (typeA < 1 || typeA > atom->nangletypes || force->angle->setflag[typeA] == 0) @@ -410,11 +408,10 @@ void PPPMDisp::init() if (accuracy_absolute >= 0.0) accuracy = accuracy_absolute; else accuracy = accuracy_relative * two_charge_force; - int (*procneigh)[2] = comm->procneigh; - int iteration = 0; if (function[0]) { - GridComm *cgtmp = NULL; + + GridComm *gctmp = nullptr; while (order >= minorder) { if (iteration && me == 0) @@ -442,23 +439,24 @@ void PPPMDisp::init() if (overlap_allowed) break; - cgtmp = new GridComm(lmp, world,1,1, + gctmp = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out, - nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - cgtmp->ghost_notify(); - if (!cgtmp->ghost_overlap()) break; - delete cgtmp; + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + int tmp1,tmp2; + gctmp->setup(tmp1,tmp2); + if (gctmp->ghost_adjacent()) break; + delete gctmp; order--; } if (order < minorder) - error->all(FLERR, - "Coulomb PPPMDisp order has been reduced below minorder"); - if (cgtmp) delete cgtmp; + error->all(FLERR,"Coulomb PPPMDisp order has been reduced below minorder"); + if (!overlap_allowed && !gctmp->ghost_adjacent()) + error->all(FLERR,"PPPMDisp grid stencil extends " + "beyond nearest neighbor processor"); + if (gctmp) delete gctmp; // adjust g_ewald @@ -493,7 +491,8 @@ void PPPMDisp::init() iteration = 0; if (function[1] + function[2] + function[3]) { - GridComm *cgtmp = NULL; + + GridComm *gctmp = nullptr; while (order_6 >= minorder) { if (iteration && me == 0) @@ -519,23 +518,27 @@ void PPPMDisp::init() if (overlap_allowed) break; - cgtmp = new GridComm(lmp,world,1,1, + gctmp = new GridComm(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6, nzlo_in_6,nzhi_in_6, nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6, - nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - cgtmp->ghost_notify(); - if (!cgtmp->ghost_overlap()) break; - delete cgtmp; + nzlo_out_6,nzhi_out_6); + + int tmp1,tmp2; + gctmp->setup(tmp1,tmp2); + if (gctmp->ghost_adjacent()) break; + delete gctmp; + order_6--; } if (order_6 < minorder) error->all(FLERR,"Dispersion PPPMDisp order has been " "reduced below minorder"); - if (cgtmp) delete cgtmp; + if (!overlap_allowed && !gctmp->ghost_adjacent()) + error->all(FLERR,"Dispersion PPPMDisp grid stencil extends " + "beyond nearest neighbor processor"); + if (gctmp) delete gctmp; // adjust g_ewald_6 @@ -547,7 +550,6 @@ void PPPMDisp::init() double acc, acc_real, acc_kspace; final_accuracy_6(acc, acc_real, acc_kspace); - // print stats int ngrid_max,nfft_both_max; @@ -556,14 +558,14 @@ void PPPMDisp::init() if (me == 0) { std::string mesg = fmt::format(" Dispersion G vector (1/distance)= " - "{}\n", g_ewald_6); + "{:.8}\n", g_ewald_6); mesg += fmt::format(" Dispersion grid = {} {} {}\n", nx_pppm_6,ny_pppm_6,nz_pppm_6); mesg += fmt::format(" Dispersion stencil order = {}\n",order_6); mesg += fmt::format(" Dispersion estimated absolute RMS force accuracy " - "= {}\n",acc); + "= {:.8}\n",acc); mesg += fmt::format(" Dispersion estimated relative force accuracy " - "= {}\n",acc/two_charge_force); + "= {:.8}\n",acc/two_charge_force); mesg += " using " LMP_FFT_PREC " precision " LMP_FFT_LIB "\n"; mesg += fmt::format(" 3d grid and FFT values/proc = {} {}\n", ngrid_max, nfft_both_max); @@ -581,8 +583,6 @@ void PPPMDisp::init() if (function[0]) { compute_gf_denom(gf_b, order); compute_rho_coeff(rho_coeff, drho_coeff, order); - cg->ghost_notify(); - cg->setup(); if (differentiation_flag == 1) compute_sf_precoeff(nx_pppm, ny_pppm, nz_pppm, order, nxlo_fft, nylo_fft, nzlo_fft, @@ -593,8 +593,6 @@ void PPPMDisp::init() if (function[1] + function[2] + function[3]) { compute_gf_denom(gf_b_6, order_6); compute_rho_coeff(rho_coeff_6, drho_coeff_6, order_6); - cg_6->ghost_notify(); - cg_6->setup(); if (differentiation_flag == 1) compute_sf_precoeff(nx_pppm_6, ny_pppm_6, nz_pppm_6, order_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, @@ -602,7 +600,6 @@ void PPPMDisp::init() sf_precoeff1_6, sf_precoeff2_6, sf_precoeff3_6, sf_precoeff4_6, sf_precoeff5_6, sf_precoeff6_6); } - } /* ---------------------------------------------------------------------- @@ -611,7 +608,6 @@ void PPPMDisp::init() void PPPMDisp::setup() { - if (slabflag == 0 && domain->nonperiodic > 0) error->all(FLERR,"Cannot use non-periodic boundaries with PPPMDisp"); if (slabflag == 1) { @@ -642,7 +638,8 @@ void PPPMDisp::setup() double unitkz = (2.0*MY_PI/zprd_slab); //compute the virial coefficients and green functions - if (function[0]){ + + if (function[0]) { delxinv = nx_pppm/xprd; delyinv = ny_pppm/yprd; @@ -831,18 +828,14 @@ void PPPMDisp::setup_grid() allocate(); if (function[0]) { - cg->ghost_notify(); - if (overlap_allowed == 0 && cg->ghost_overlap()) - error->all(FLERR,"PPPM grid stencil extends " + if (!overlap_allowed && !gc->ghost_adjacent()) + error->all(FLERR,"PPPMDisp grid stencil extends " "beyond nearest neighbor processor"); - cg->setup(); } if (function[1] + function[2] + function[3]) { - cg_6->ghost_notify(); - if (overlap_allowed == 0 && cg_6->ghost_overlap()) - error->all(FLERR,"PPPM grid stencil extends " + if (!overlap_allowed && !gc6->ghost_adjacent()) + error->all(FLERR,"Dispersion PPPMDisp grid stencil extends " "beyond nearest neighbor processor"); - cg_6->setup(); } // pre-compute Green's function denomiator expansion @@ -880,34 +873,26 @@ void PPPMDisp::setup_grid() void PPPMDisp::compute(int eflag, int vflag) { - int i; - // convert atoms from box to lamda coords + + // set energy/virial flags + // invoke allocate_peratom() if needed for first time ev_init(eflag,vflag); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - if (function[0]) { - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } - if (function[1] + function[2] + function[3]) { - cg_peratom_6->ghost_notify(); - cg_peratom_6->setup(); - } - peratom_allocate_flag = 1; - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); + + // convert atoms from box to lamda coords if (triclinic == 0) boxlo = domain->boxlo; else { boxlo = domain->boxlo_lamda; domain->x2lamda(atom->nlocal); } + // extend size of per-atom arrays if necessary if (atom->nmax > nmax) { - if (function[0]) memory->destroy(part2grid); if (function[1] + function[2] + function[3]) memory->destroy(part2grid_6); nmax = atom->nmax; @@ -916,7 +901,6 @@ void PPPMDisp::compute(int eflag, int vflag) memory->create(part2grid_6,nmax,3,"pppm/disp:part2grid_6"); } - energy = 0.0; energy_1 = 0.0; energy_6 = 0.0; @@ -931,20 +915,20 @@ void PPPMDisp::compute(int eflag, int vflag) if (function[0]) { - //perform calculations for coulomb interactions only + // perform calculations for coulomb interactions only particle_map_c(delxinv, delyinv, delzinv, shift, part2grid, nupper, nlower, - nxlo_out, nylo_out, nzlo_out, nxhi_out, nyhi_out, nzhi_out); + nxlo_out, nylo_out, nzlo_out, nxhi_out, nyhi_out, nzhi_out); make_rho_c(); - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in, density_brick, density_fft, work1,remap); if (differentiation_flag == 1) { - poisson_ad(work1, work2, density_fft, fft1, fft2, nx_pppm, ny_pppm, nz_pppm, nfft, nxlo_fft, nylo_fft, nzlo_fft, nxhi_fft, nyhi_fft, nzhi_fft, @@ -953,11 +937,14 @@ void PPPMDisp::compute(int eflag, int vflag) virial_1, vg,vg2, u_brick, v0_brick, v1_brick, v2_brick, v3_brick, v4_brick, v5_brick); - cg->forward_comm(this,FORWARD_AD); + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); fieldforce_c_ad(); - if (vflag_atom) cg_peratom->forward_comm(this, FORWARD_AD_PERATOM); + if (vflag_atom) + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } else { poisson_ik(work1, work2, density_fft, fft1, fft2, @@ -969,42 +956,54 @@ void PPPMDisp::compute(int eflag, int vflag) vdx_brick, vdy_brick, vdz_brick, virial_1, vg,vg2, u_brick, v0_brick, v1_brick, v2_brick, v3_brick, v4_brick, v5_brick); - cg->forward_comm(this, FORWARD_IK); + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); fieldforce_c_ik(); - if (evflag_atom) cg_peratom->forward_comm(this, FORWARD_IK_PERATOM); + if (evflag_atom) + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } + if (evflag_atom) fieldforce_c_peratom(); } if (function[1]) { - //perform calculations for geometric mixing - particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, part2grid_6, nupper_6, nlower_6, - nxlo_out_6, nylo_out_6, nzlo_out_6, nxhi_out_6, nyhi_out_6, nzhi_out_6); + + // perform calculations for geometric mixing + + particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, part2grid_6, + nupper_6, nlower_6, + nxlo_out_6, nylo_out_6, nzlo_out_6, + nxhi_out_6, nyhi_out_6, nzhi_out_6); + make_rho_g(); - - cg_6->reverse_comm(this, REVERSE_RHO_G); + gc6->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); brick2fft(nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6, density_brick_g, density_fft_g, work1_6,remap_6); if (differentiation_flag == 1) { - poisson_ad(work1_6, work2_6, density_fft_g, fft1_6, fft2_6, nx_pppm_6, ny_pppm_6, nz_pppm_6, nfft_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6, nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6, energy_6, greensfn_6, virial_6, vg_6, vg2_6, - u_brick_g, v0_brick_g, v1_brick_g, v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g); + u_brick_g, v0_brick_g, v1_brick_g, v2_brick_g, + v3_brick_g, v4_brick_g, v5_brick_g); - cg_6->forward_comm(this,FORWARD_AD_G); + gc6->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_g_ad(); - if (vflag_atom) cg_peratom_6->forward_comm(this,FORWARD_AD_PERATOM_G); + if (vflag_atom) + gc6->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { poisson_ik(work1_6, work2_6, density_fft_g, fft1_6, fft2_6, @@ -1014,55 +1013,73 @@ void PPPMDisp::compute(int eflag, int vflag) energy_6, greensfn_6, fkx_6, fky_6, fkz_6,fkx2_6, fky2_6, fkz2_6, vdx_brick_g, vdy_brick_g, vdz_brick_g, virial_6, vg_6, vg2_6, - u_brick_g, v0_brick_g, v1_brick_g, v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g); + u_brick_g, v0_brick_g, v1_brick_g, v2_brick_g, + v3_brick_g, v4_brick_g, v5_brick_g); - cg_6->forward_comm(this,FORWARD_IK_G); + gc6->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_g_ik(); - - if (evflag_atom) cg_peratom_6->forward_comm(this, FORWARD_IK_PERATOM_G); + if (evflag_atom) + gc6->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } + if (evflag_atom) fieldforce_g_peratom(); } if (function[2]) { - //perform calculations for arithmetic mixing - particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, part2grid_6, nupper_6, nlower_6, - nxlo_out_6, nylo_out_6, nzlo_out_6, nxhi_out_6, nyhi_out_6, nzhi_out_6); + + // perform calculations for arithmetic mixing + + particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, part2grid_6, + nupper_6, nlower_6, + nxlo_out_6, nylo_out_6, nzlo_out_6, + nxhi_out_6, nyhi_out_6, nzhi_out_6); + make_rho_a(); - cg_6->reverse_comm(this, REVERSE_RHO_A); + gc->reverse_comm_kspace(this,7,sizeof(FFT_SCALAR),REVERSE_RHO_A, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_a(); - if ( differentiation_flag == 1) { - + if (differentiation_flag == 1) { poisson_ad(work1_6, work2_6, density_fft_a3, fft1_6, fft2_6, nx_pppm_6, ny_pppm_6, nz_pppm_6, nfft_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6, nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6, energy_6, greensfn_6, virial_6, vg_6, vg2_6, - u_brick_a3, v0_brick_a3, v1_brick_a3, v2_brick_a3, v3_brick_a3, v4_brick_a3, v5_brick_a3); + u_brick_a3, v0_brick_a3, v1_brick_a3, v2_brick_a3, + v3_brick_a3, v4_brick_a3, v5_brick_a3); poisson_2s_ad(density_fft_a0, density_fft_a6, - u_brick_a0, v0_brick_a0, v1_brick_a0, v2_brick_a0, v3_brick_a0, v4_brick_a0, v5_brick_a0, - u_brick_a6, v0_brick_a6, v1_brick_a6, v2_brick_a6, v3_brick_a6, v4_brick_a6, v5_brick_a6); + u_brick_a0, v0_brick_a0, v1_brick_a0, v2_brick_a0, + v3_brick_a0, v4_brick_a0, v5_brick_a0, + u_brick_a6, v0_brick_a6, v1_brick_a6, v2_brick_a6, + v3_brick_a6, v4_brick_a6, v5_brick_a6); poisson_2s_ad(density_fft_a1, density_fft_a5, - u_brick_a1, v0_brick_a1, v1_brick_a1, v2_brick_a1, v3_brick_a1, v4_brick_a1, v5_brick_a1, - u_brick_a5, v0_brick_a5, v1_brick_a5, v2_brick_a5, v3_brick_a5, v4_brick_a5, v5_brick_a5); + u_brick_a1, v0_brick_a1, v1_brick_a1, v2_brick_a1, + v3_brick_a1, v4_brick_a1, v5_brick_a1, + u_brick_a5, v0_brick_a5, v1_brick_a5, v2_brick_a5, + v3_brick_a5, v4_brick_a5, v5_brick_a5); poisson_2s_ad(density_fft_a2, density_fft_a4, - u_brick_a2, v0_brick_a2, v1_brick_a2, v2_brick_a2, v3_brick_a2, v4_brick_a2, v5_brick_a2, - u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, v3_brick_a4, v4_brick_a4, v5_brick_a4); + u_brick_a2, v0_brick_a2, v1_brick_a2, v2_brick_a2, + v3_brick_a2, v4_brick_a2, v5_brick_a2, + u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, + v3_brick_a4, v4_brick_a4, v5_brick_a4); - cg_6->forward_comm(this, FORWARD_AD_A); + gc6->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_AD_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_a_ad(); - if (evflag_atom) cg_peratom_6->forward_comm(this, FORWARD_AD_PERATOM_A); + if (evflag_atom) + gc6->forward_comm_kspace(this,42,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { - poisson_ik(work1_6, work2_6, density_fft_a3, fft1_6, fft2_6, nx_pppm_6, ny_pppm_6, nz_pppm_6, nfft_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6, @@ -1070,45 +1087,60 @@ void PPPMDisp::compute(int eflag, int vflag) energy_6, greensfn_6, fkx_6, fky_6, fkz_6,fkx2_6, fky2_6, fkz2_6, vdx_brick_a3, vdy_brick_a3, vdz_brick_a3, virial_6, vg_6, vg2_6, - u_brick_a3, v0_brick_a3, v1_brick_a3, v2_brick_a3, v3_brick_a3, v4_brick_a3, v5_brick_a3); + u_brick_a3, v0_brick_a3, v1_brick_a3, v2_brick_a3, + v3_brick_a3, v4_brick_a3, v5_brick_a3); poisson_2s_ik(density_fft_a0, density_fft_a6, vdx_brick_a0, vdy_brick_a0, vdz_brick_a0, vdx_brick_a6, vdy_brick_a6, vdz_brick_a6, - u_brick_a0, v0_brick_a0, v1_brick_a0, v2_brick_a0, v3_brick_a0, v4_brick_a0, v5_brick_a0, - u_brick_a6, v0_brick_a6, v1_brick_a6, v2_brick_a6, v3_brick_a6, v4_brick_a6, v5_brick_a6); + u_brick_a0, v0_brick_a0, v1_brick_a0, v2_brick_a0, + v3_brick_a0, v4_brick_a0, v5_brick_a0, + u_brick_a6, v0_brick_a6, v1_brick_a6, v2_brick_a6, + v3_brick_a6, v4_brick_a6, v5_brick_a6); poisson_2s_ik(density_fft_a1, density_fft_a5, vdx_brick_a1, vdy_brick_a1, vdz_brick_a1, vdx_brick_a5, vdy_brick_a5, vdz_brick_a5, - u_brick_a1, v0_brick_a1, v1_brick_a1, v2_brick_a1, v3_brick_a1, v4_brick_a1, v5_brick_a1, - u_brick_a5, v0_brick_a5, v1_brick_a5, v2_brick_a5, v3_brick_a5, v4_brick_a5, v5_brick_a5); + u_brick_a1, v0_brick_a1, v1_brick_a1, v2_brick_a1, + v3_brick_a1, v4_brick_a1, v5_brick_a1, + u_brick_a5, v0_brick_a5, v1_brick_a5, v2_brick_a5, + v3_brick_a5, v4_brick_a5, v5_brick_a5); poisson_2s_ik(density_fft_a2, density_fft_a4, vdx_brick_a2, vdy_brick_a2, vdz_brick_a2, vdx_brick_a4, vdy_brick_a4, vdz_brick_a4, - u_brick_a2, v0_brick_a2, v1_brick_a2, v2_brick_a2, v3_brick_a2, v4_brick_a2, v5_brick_a2, - u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, v3_brick_a4, v4_brick_a4, v5_brick_a4); + u_brick_a2, v0_brick_a2, v1_brick_a2, v2_brick_a2, + v3_brick_a2, v4_brick_a2, v5_brick_a2, + u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, + v3_brick_a4, v4_brick_a4, v5_brick_a4); - cg_6->forward_comm(this, FORWARD_IK_A); + gc6->forward_comm_kspace(this,18,sizeof(FFT_SCALAR),FORWARD_IK_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_a_ik(); - if (evflag_atom) cg_peratom_6->forward_comm(this, FORWARD_IK_PERATOM_A); + if (evflag_atom) + gc6->forward_comm_kspace(this,49,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } + if (evflag_atom) fieldforce_a_peratom(); } if (function[3]) { - //perform calculations if no mixing rule applies - particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, part2grid_6, nupper_6, nlower_6, - nxlo_out_6, nylo_out_6, nzlo_out_6, nxhi_out_6, nyhi_out_6, nzhi_out_6); + + // perform calculations if no mixing rule applies + + particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, part2grid_6, + nupper_6, nlower_6, + nxlo_out_6, nylo_out_6, nzlo_out_6, + nxhi_out_6, nyhi_out_6, nzhi_out_6); make_rho_none(); - cg_6->reverse_comm(this, REVERSE_RHO_NONE); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO_NONE, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_none(); if (differentiation_flag == 1) { - int n = 0; for (int k = 0; kforward_comm(this,FORWARD_AD_NONE); + gc6->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_none_ad(); - if (vflag_atom) cg_peratom_6->forward_comm(this,FORWARD_AD_PERATOM_NONE); + if (vflag_atom) + gc6->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { int n = 0; @@ -1136,13 +1171,16 @@ void PPPMDisp::compute(int eflag, int vflag) n += 2; } - cg_6->forward_comm(this,FORWARD_IK_NONE); + gc6->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); fieldforce_none_ik(); if (evflag_atom) - cg_peratom_6->forward_comm(this, FORWARD_IK_PERATOM_NONE); + gc6->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } + if (evflag_atom) fieldforce_none_peratom(); } @@ -1156,6 +1194,7 @@ void PPPMDisp::compute(int eflag, int vflag) // sum energy across procs and add in volume-dependent term const double qscale = force->qqrd2e * scale; + if (eflag_global) { double energy_all; MPI_Allreduce(&energy_1,&energy_all,1,MPI_DOUBLE,MPI_SUM,world); @@ -1192,8 +1231,10 @@ void PPPMDisp::compute(int eflag, int vflag) if (eflag_atom) { if (function[0]) { double *q = atom->q; + // coulomb self energy correction for (i = 0; i < atom->nlocal; i++) { - eatom[i] -= qscale*g_ewald*q[i]*q[i]/MY_PIS + qscale*MY_PI2*q[i]*qsum / (g_ewald*g_ewald*volume); //coulomb self energy correction + eatom[i] -= qscale*g_ewald*q[i]*q[i]/MY_PIS + + qscale*MY_PI2*q[i]*qsum / (g_ewald*g_ewald*volume); } } if (function[1] + function[2] + function[3]) { @@ -1209,9 +1250,11 @@ void PPPMDisp::compute(int eflag, int vflag) if (vflag_atom) { if (function[1] + function[2] + function[3]) { int tmp; + // dispersion self virial correction for (i = 0; i < atom->nlocal; i++) { tmp = atom->type[i]; - for (int n = 0; n < 3; n++) vatom[i][n] -= MY_PI*MY_PIS/(6*volume)*pow(g_ewald_6,3)*csumi[tmp]; //dispersion self virial correction + for (int n = 0; n < 3; n++) + vatom[i][n] -= MY_PI*MY_PIS/(6*volume)*pow(g_ewald_6,3)*csumi[tmp]; } } } @@ -1238,14 +1281,14 @@ void PPPMDisp::init_coeffs() // local pair coeffs int n = atom->ntypes; int converged; delete [] B; - B = NULL; + B = nullptr; if (function[3] + function[2]) { // no mixing rule or arithmetic if (function[2] && me == 0) utils::logmesg(lmp," Optimizing splitting of Dispersion coefficients\n"); // allocate data for eigenvalue decomposition - double **A=NULL; - double **Q=NULL; + double **A=nullptr; + double **Q=nullptr; if ( n > 1 ) { // get dispersion coefficients double **b = (double **) force->pair->extract("B",tmp); @@ -1605,9 +1648,6 @@ int PPPMDisp::check_convergence(double** A,double** Q,double** A0, void _noopt PPPMDisp::allocate() { - - int (*procneigh)[2] = comm->procneigh; - if (function[0]) { memory->create(work1,2*nfft_both,"pppm/disp:work1"); memory->create(work2,2*nfft_both,"pppm/disp:work2"); @@ -1620,12 +1660,12 @@ void _noopt PPPMDisp::allocate() memory->create1d_offset(fky2,nylo_fft,nyhi_fft,"pppm/disp:fky2"); memory->create1d_offset(fkz2,nzlo_fft,nzhi_fft,"pppm/disp:fkz2"); - memory->create(gf_b,order,"pppm/disp:gf_b"); memory->create2d_offset(rho1d,3,-order/2,order/2,"pppm/disp:rho1d"); memory->create2d_offset(rho_coeff,order,(1-order)/2,order/2,"pppm/disp:rho_coeff"); memory->create2d_offset(drho1d,3,-order/2,order/2,"pppm/disp:rho1d"); - memory->create2d_offset(drho_coeff,order,(1-order)/2,order/2,"pppm/disp:drho_coeff"); + memory->create2d_offset(drho_coeff,order,(1-order)/2,order/2, + "pppm/disp:drho_coeff"); memory->create(greensfn,nfft_both,"pppm/disp:greensfn"); memory->create(vg,nfft_both,6,"pppm/disp:vg"); @@ -1633,7 +1673,7 @@ void _noopt PPPMDisp::allocate() memory->create3d_offset(density_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm/disp:density_brick"); - if ( differentiation_flag == 1) { + if (differentiation_flag == 1) { memory->create3d_offset(u_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm/disp:u_brick"); memory->create(sf_precoeff1,nfft_both,"pppm/disp:sf_precoeff1"); @@ -1670,20 +1710,20 @@ void _noopt PPPMDisp::allocate() nxlo_fft,nxhi_fft,nylo_fft,nyhi_fft,nzlo_fft,nzhi_fft, 1,0,0,FFT_PRECISION,collective_flag); - // create ghost grid object for rho and electric field communication + // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods - if (differentiation_flag == 1) - cg = new GridComm(lmp,world,1,1, + gc = new GridComm(lmp,world,nx_pppm,ny_pppm,nz_pppm, nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg = new GridComm(lmp,world,3,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out); + + gc->setup(ngc_buf1,ngc_buf2); + + if (differentiation_flag) npergrid = 1; + else npergrid = 3; + + memory->create(gc_buf1,npergrid*ngc_buf1,"pppm:gc_buf1"); + memory->create(gc_buf2,npergrid*ngc_buf2,"pppm:gc_buf2"); } if (function[1]) { @@ -1700,9 +1740,11 @@ void _noopt PPPMDisp::allocate() memory->create(gf_b_6,order_6,"pppm/disp:gf_b_6"); memory->create2d_offset(rho1d_6,3,-order_6/2,order_6/2,"pppm/disp:rho1d_6"); - memory->create2d_offset(rho_coeff_6,order_6,(1-order_6)/2,order_6/2,"pppm/disp:rho_coeff_6"); + memory->create2d_offset(rho_coeff_6,order_6,(1-order_6)/2,order_6/2, + "pppm/disp:rho_coeff_6"); memory->create2d_offset(drho1d_6,3,-order_6/2,order_6/2,"pppm/disp:drho1d_6"); - memory->create2d_offset(drho_coeff_6,order_6,(1-order_6)/2,order_6/2,"pppm/disp:drho_coeff_6"); + memory->create2d_offset(drho_coeff_6,order_6,(1-order_6)/2,order_6/2, + "pppm/disp:drho_coeff_6"); memory->create(greensfn_6,nfft_both_6,"pppm/disp:greensfn_6"); memory->create(vg_6,nfft_both_6,6,"pppm/disp:vg_6"); @@ -1710,7 +1752,7 @@ void _noopt PPPMDisp::allocate() memory->create3d_offset(density_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_g"); - if ( differentiation_flag == 1) { + if (differentiation_flag == 1) { memory->create3d_offset(u_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:u_brick_g"); @@ -1721,7 +1763,7 @@ void _noopt PPPMDisp::allocate() memory->create(sf_precoeff5_6,nfft_both_6,"pppm/disp:sf_precoeff5_6"); memory->create(sf_precoeff6_6,nfft_both_6,"pppm/disp:sf_precoeff6_6"); - } else { + } else { memory->create3d_offset(vdx_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:vdx_brick_g"); memory->create3d_offset(vdy_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, @@ -1731,38 +1773,41 @@ void _noopt PPPMDisp::allocate() } memory->create(density_fft_g,nfft_both_6,"pppm/disp:density_fft_g"); - int tmp; - fft1_6 = new FFT3d(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, - nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, - nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, - 0,0,&tmp,collective_flag); + fft1_6 = + new FFT3d(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, + nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, + nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, + 0,0,&tmp,collective_flag); - fft2_6 = new FFT3d(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, - nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - 0,0,&tmp,collective_flag); + fft2_6 = + new FFT3d(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, + nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, + nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, + 0,0,&tmp,collective_flag); - remap_6 = new Remap(lmp,world, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, - 1,0,0,FFT_PRECISION,collective_flag); + remap_6 = + new Remap(lmp,world, + nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, + nxlo_fft_6,nxhi_fft_6,nylo_fft_6,nyhi_fft_6,nzlo_fft_6,nzhi_fft_6, + 1,0,0,FFT_PRECISION,collective_flag); // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods - if (differentiation_flag == 1) - cg_6 = new GridComm(lmp,world,1,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_6 = new GridComm(lmp,world,3,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + gc6 = + new GridComm(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, + nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, + nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6); + + gc6->setup(ngc6_buf1,ngc6_buf2); + + if (differentiation_flag) npergrid6 = 1; + else npergrid6 = 7; + + memory->create(gc6_buf1,npergrid6*ngc6_buf1,"pppm:gc_buf1"); + memory->create(gc6_buf2,npergrid6*ngc6_buf2,"pppm:gc_buf2"); } if (function[2]) { @@ -1779,27 +1824,36 @@ void _noopt PPPMDisp::allocate() memory->create(gf_b_6,order_6,"pppm/disp:gf_b_6"); memory->create2d_offset(rho1d_6,3,-order_6/2,order_6/2,"pppm/disp:rho1d_6"); - memory->create2d_offset(rho_coeff_6,order_6,(1-order_6)/2,order_6/2,"pppm/disp:rho_coeff_6"); + memory->create2d_offset(rho_coeff_6,order_6,(1-order_6)/2,order_6/2, + "pppm/disp:rho_coeff_6"); memory->create2d_offset(drho1d_6,3,-order_6/2,order_6/2,"pppm/disp:drho1d_6"); - memory->create2d_offset(drho_coeff_6,order_6,(1-order_6)/2,order_6/2,"pppm/disp:drho_coeff_6"); + memory->create2d_offset(drho_coeff_6,order_6,(1-order_6)/2,order_6/2, + "pppm/disp:drho_coeff_6"); memory->create(greensfn_6,nfft_both_6,"pppm/disp:greensfn_6"); memory->create(vg_6,nfft_both_6,6,"pppm/disp:vg_6"); memory->create(vg2_6,nfft_both_6,3,"pppm/disp:vg2_6"); - memory->create3d_offset(density_brick_a0,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a0,nzlo_out_6, + nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a0"); - memory->create3d_offset(density_brick_a1,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a1,nzlo_out_6, + nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a1"); - memory->create3d_offset(density_brick_a2,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a2,nzlo_out_6,nzhi_out_6, + nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a2"); - memory->create3d_offset(density_brick_a3,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a3,nzlo_out_6,nzhi_out_6, + nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a3"); - memory->create3d_offset(density_brick_a4,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a4,nzlo_out_6,nzhi_out_6, + nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a4"); - memory->create3d_offset(density_brick_a5,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a5,nzlo_out_6,nzhi_out_6, + nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a5"); - memory->create3d_offset(density_brick_a6,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create3d_offset(density_brick_a6,nzlo_out_6,nzhi_out_6, + nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_a6"); memory->create(density_fft_a0,nfft_both_6,"pppm/disp:density_fft_a0"); @@ -1811,7 +1865,7 @@ void _noopt PPPMDisp::allocate() memory->create(density_fft_a6,nfft_both_6,"pppm/disp:density_fft_a6"); - if ( differentiation_flag == 1 ) { + if (differentiation_flag == 1) { memory->create3d_offset(u_brick_a0,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:u_brick_a0"); memory->create3d_offset(u_brick_a1,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, @@ -1886,8 +1940,6 @@ void _noopt PPPMDisp::allocate() nxlo_out_6,nxhi_out_6,"pppm/disp:vdz_brick_a6"); } - - int tmp; fft1_6 = new FFT3d(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, @@ -1906,20 +1958,20 @@ void _noopt PPPMDisp::allocate() 1,0,0,FFT_PRECISION,collective_flag); // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods + gc6 = + new GridComm(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, + nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, + nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6); - if (differentiation_flag == 1) - cg_6 = new GridComm(lmp,world,7,7, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_6 = new GridComm(lmp,world,21,7, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + gc6->setup(ngc6_buf1,ngc6_buf2); + + if (differentiation_flag) npergrid6 = 7; + else npergrid6 = 18; + + memory->create(gc6_buf1,npergrid6*ngc6_buf1,"pppm:gc_buf1"); + memory->create(gc6_buf2,npergrid6*ngc6_buf2,"pppm:gc_buf2"); } if (function[3]) { @@ -1936,18 +1988,22 @@ void _noopt PPPMDisp::allocate() memory->create(gf_b_6,order_6,"pppm/disp:gf_b_6"); memory->create2d_offset(rho1d_6,3,-order_6/2,order_6/2,"pppm/disp:rho1d_6"); - memory->create2d_offset(rho_coeff_6,order_6,(1-order_6)/2,order_6/2,"pppm/disp:rho_coeff_6"); + memory->create2d_offset(rho_coeff_6,order_6,(1-order_6)/2,order_6/2, + "pppm/disp:rho_coeff_6"); memory->create2d_offset(drho1d_6,3,-order_6/2,order_6/2,"pppm/disp:drho1d_6"); - memory->create2d_offset(drho_coeff_6,order_6,(1-order_6)/2,order_6/2,"pppm/disp:drho_coeff_6"); + memory->create2d_offset(drho_coeff_6,order_6,(1-order_6)/2,order_6/2, + "pppm/disp:drho_coeff_6"); memory->create(greensfn_6,nfft_both_6,"pppm/disp:greensfn_6"); memory->create(vg_6,nfft_both_6,6,"pppm/disp:vg_6"); memory->create(vg2_6,nfft_both_6,3,"pppm/disp:vg2_6"); - memory->create4d_offset(density_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(density_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:density_brick_none"); if ( differentiation_flag == 1) { - memory->create4d_offset(u_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(u_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:u_brick_none"); memory->create(sf_precoeff1_6,nfft_both_6,"pppm/disp:sf_precoeff1_6"); @@ -1958,15 +2014,18 @@ void _noopt PPPMDisp::allocate() memory->create(sf_precoeff6_6,nfft_both_6,"pppm/disp:sf_precoeff6_6"); } else { - memory->create4d_offset(vdx_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(vdx_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:vdx_brick_none"); - memory->create4d_offset(vdy_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(vdy_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:vdy_brick_none"); - memory->create4d_offset(vdz_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(vdz_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:vdz_brick_none"); } - memory->create(density_fft_none,nsplit_alloc,nfft_both_6,"pppm/disp:density_fft_none"); - + memory->create(density_fft_none,nsplit_alloc,nfft_both_6, + "pppm/disp:density_fft_none"); int tmp; @@ -1986,21 +2045,21 @@ void _noopt PPPMDisp::allocate() 1,0,0,FFT_PRECISION,collective_flag); // create ghost grid object for rho and electric field communication + // also create 2 bufs for ghost grid cell comm, passed to GridComm methods - if (differentiation_flag == 1) - cg_6 = new GridComm(lmp,world,nsplit_alloc,nsplit_alloc, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_6 = new GridComm(lmp,world,3*nsplit_alloc,nsplit_alloc, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + gc6 = + new GridComm(lmp,world,nx_pppm_6,ny_pppm_6,nz_pppm_6, + nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, + nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6); + + gc6->setup(ngc6_buf1,ngc6_buf2); + + if (differentiation_flag) npergrid6 = 1; + else npergrid6 = 3; + + memory->create(gc6_buf1,npergrid6*ngc6_buf1,"pppm:gc_buf1"); + memory->create(gc6_buf2,npergrid6*ngc6_buf2,"pppm:gc_buf2"); } - } /* ---------------------------------------------------------------------- @@ -2010,15 +2069,12 @@ void _noopt PPPMDisp::allocate() void PPPMDisp::allocate_peratom() { - - int (*procneigh)[2] = comm->procneigh; + peratom_allocate_flag = 1; if (function[0]) { - if (differentiation_flag != 1) memory->create3d_offset(u_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm/disp:u_brick"); - memory->create3d_offset(v0_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm/disp:v0_brick"); memory->create3d_offset(v1_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, @@ -2032,32 +2088,22 @@ void PPPMDisp::allocate_peratom() memory->create3d_offset(v5_brick,nzlo_out,nzhi_out,nylo_out,nyhi_out, nxlo_out,nxhi_out,"pppm/disp:v5_brick"); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - if (differentiation_flag == 1) - cg_peratom = - new GridComm(lmp,world,6,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_peratom = - new GridComm(lmp,world,7,1, - nxlo_in,nxhi_in,nylo_in,nyhi_in,nzlo_in,nzhi_in, - nxlo_out,nxhi_out,nylo_out,nyhi_out,nzlo_out,nzhi_out, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + if (differentiation_flag) npergrid = 6; + else npergrid = 7; + memory->destroy(gc_buf1); + memory->destroy(gc_buf2); + memory->create(gc_buf1,npergrid*ngc_buf1,"pppm:gc_buf1"); + memory->create(gc_buf2,npergrid*ngc_buf2,"pppm:gc_buf2"); } - if (function[1]) { - - if ( differentiation_flag != 1 ) + if (differentiation_flag != 1 ) memory->create3d_offset(u_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:u_brick_g"); - memory->create3d_offset(v0_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v0_brick_g"); memory->create3d_offset(v1_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, @@ -2071,28 +2117,20 @@ void PPPMDisp::allocate_peratom() memory->create3d_offset(v5_brick_g,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v5_brick_g"); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - if (differentiation_flag == 1) - cg_peratom_6 = - new GridComm(lmp,world,6,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_peratom_6 = - new GridComm(lmp,world,7,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + if (differentiation_flag) npergrid = 6; + else npergrid = 7; + memory->destroy(gc6_buf1); + memory->destroy(gc6_buf2); + memory->create(gc6_buf1,npergrid*ngc6_buf1,"pppm:gc6_buf1"); + memory->create(gc6_buf2,npergrid*ngc6_buf2,"pppm:gc6_buf2"); } if (function[2]) { - - if ( differentiation_flag != 1 ) { + if (differentiation_flag != 1 ) { memory->create3d_offset(u_brick_a0,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:u_brick_a0"); memory->create3d_offset(u_brick_a1,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, @@ -2200,65 +2238,56 @@ void PPPMDisp::allocate_peratom() memory->create3d_offset(v5_brick_a6,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v5_brick_a6"); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - if (differentiation_flag == 1) - cg_peratom_6 = - new GridComm(lmp,world,42,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_peratom_6 = - new GridComm(lmp,world,49,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + if (differentiation_flag) npergrid = 42; + else npergrid = 49; + memory->destroy(gc6_buf1); + memory->destroy(gc6_buf2); + memory->create(gc6_buf1,npergrid*ngc6_buf1,"pppm:gc6_buf1"); + memory->create(gc6_buf2,npergrid*ngc6_buf2,"pppm:gc6_buf2"); } if (function[3]) { - - if ( differentiation_flag != 1 ) - memory->create4d_offset(u_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + if (differentiation_flag != 1) + memory->create4d_offset(u_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:u_brick_none"); - memory->create4d_offset(v0_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(v0_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v0_brick_none"); - memory->create4d_offset(v1_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(v1_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v1_brick_none"); - memory->create4d_offset(v2_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(v2_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v2_brick_none"); - memory->create4d_offset(v3_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(v3_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v3_brick_none"); - memory->create4d_offset(v4_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(v4_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v4_brick_none"); - memory->create4d_offset(v5_brick_none,nsplit_alloc,nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, + memory->create4d_offset(v5_brick_none,nsplit_alloc, + nzlo_out_6,nzhi_out_6,nylo_out_6,nyhi_out_6, nxlo_out_6,nxhi_out_6,"pppm/disp:v5_brick_none"); - // create ghost grid object for rho and electric field communication + // use same GC ghost grid object for peratom grid communication + // but need to reallocate a larger gc_buf1 and gc_buf2 - if (differentiation_flag == 1) - cg_peratom_6 = - new GridComm(lmp,world,6*nsplit_alloc,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); - else - cg_peratom_6 = - new GridComm(lmp,world,7*nsplit_alloc,1, - nxlo_in_6,nxhi_in_6,nylo_in_6,nyhi_in_6,nzlo_in_6,nzhi_in_6, - nxlo_out_6,nxhi_out_6,nylo_out_6,nyhi_out_6,nzlo_out_6,nzhi_out_6, - procneigh[0][0],procneigh[0][1],procneigh[1][0], - procneigh[1][1],procneigh[2][0],procneigh[2][1]); + if (differentiation_flag) npergrid = 6; + else npergrid = 7; + memory->destroy(gc6_buf1); + memory->destroy(gc6_buf2); + memory->create(gc6_buf1,npergrid*ngc6_buf1,"pppm:gc6_buf1"); + memory->create(gc6_buf2,npergrid*ngc6_buf2,"pppm:gc6_buf2"); } } - /* ---------------------------------------------------------------------- deallocate memory that depends on # of K-vectors and order ------------------------------------------------------------------------- */ @@ -2270,80 +2299,80 @@ void PPPMDisp::deallocate() memory->destroy3d_offset(vdy_brick,nzlo_out,nylo_out,nxlo_out); memory->destroy3d_offset(vdz_brick,nzlo_out,nylo_out,nxlo_out); memory->destroy(density_fft); - density_brick = vdx_brick = vdy_brick = vdz_brick = NULL; - density_fft = NULL; + density_brick = vdx_brick = vdy_brick = vdz_brick = nullptr; + density_fft = nullptr; memory->destroy3d_offset(density_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_g,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_g); - density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = NULL; - density_fft_g = NULL; + density_brick_g = vdx_brick_g = vdy_brick_g = vdz_brick_g = nullptr; + density_fft_g = nullptr; memory->destroy3d_offset(density_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a0,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a0); - density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = NULL; - density_fft_a0 = NULL; + density_brick_a0 = vdx_brick_a0 = vdy_brick_a0 = vdz_brick_a0 = nullptr; + density_fft_a0 = nullptr; memory->destroy3d_offset(density_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a1,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a1); - density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = NULL; - density_fft_a1 = NULL; + density_brick_a1 = vdx_brick_a1 = vdy_brick_a1 = vdz_brick_a1 = nullptr; + density_fft_a1 = nullptr; memory->destroy3d_offset(density_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a2,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a2); - density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = NULL; - density_fft_a2 = NULL; + density_brick_a2 = vdx_brick_a2 = vdy_brick_a2 = vdz_brick_a2 = nullptr; + density_fft_a2 = nullptr; memory->destroy3d_offset(density_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a3,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a3); - density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = NULL; - density_fft_a3 = NULL; + density_brick_a3 = vdx_brick_a3 = vdy_brick_a3 = vdz_brick_a3 = nullptr; + density_fft_a3 = nullptr; memory->destroy3d_offset(density_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a4,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a4); - density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = NULL; - density_fft_a4 = NULL; + density_brick_a4 = vdx_brick_a4 = vdy_brick_a4 = vdz_brick_a4 = nullptr; + density_fft_a4 = nullptr; memory->destroy3d_offset(density_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a5,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a5); - density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = NULL; - density_fft_a5 = NULL; + density_brick_a5 = vdx_brick_a5 = vdy_brick_a5 = vdz_brick_a5 = nullptr; + density_fft_a5 = nullptr; memory->destroy3d_offset(density_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdx_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdy_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy3d_offset(vdz_brick_a6,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_a6); - density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = NULL; - density_fft_a6 = NULL; + density_brick_a6 = vdx_brick_a6 = vdy_brick_a6 = vdz_brick_a6 = nullptr; + density_fft_a6 = nullptr; memory->destroy4d_offset(density_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdx_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdy_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy4d_offset(vdz_brick_none,nzlo_out_6,nylo_out_6,nxlo_out_6); memory->destroy(density_fft_none); - density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = NULL; - density_fft_none = NULL; + density_brick_none = vdx_brick_none = vdy_brick_none = vdz_brick_none = nullptr; + density_fft_none = nullptr; memory->destroy(sf_precoeff1); memory->destroy(sf_precoeff2); @@ -2351,7 +2380,8 @@ void PPPMDisp::deallocate() memory->destroy(sf_precoeff4); memory->destroy(sf_precoeff5); memory->destroy(sf_precoeff6); - sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = NULL; + sf_precoeff1 = sf_precoeff2 = sf_precoeff3 = + sf_precoeff4 = sf_precoeff5 = sf_precoeff6 = nullptr; memory->destroy(sf_precoeff1_6); memory->destroy(sf_precoeff2_6); @@ -2359,7 +2389,8 @@ void PPPMDisp::deallocate() memory->destroy(sf_precoeff4_6); memory->destroy(sf_precoeff5_6); memory->destroy(sf_precoeff6_6); - sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = sf_precoeff4_6 = sf_precoeff5_6 = sf_precoeff6_6 = NULL; + sf_precoeff1_6 = sf_precoeff2_6 = sf_precoeff3_6 = + sf_precoeff4_6 = sf_precoeff5_6 = sf_precoeff6_6 = nullptr; memory->destroy(greensfn); memory->destroy(greensfn_6); @@ -2371,65 +2402,61 @@ void PPPMDisp::deallocate() memory->destroy(vg2); memory->destroy(vg_6); memory->destroy(vg2_6); - greensfn = greensfn_6 = NULL; - work1 = work2 = work1_6 = work2_6 = NULL; - vg = vg2 = vg_6 = vg2_6 = NULL; + greensfn = greensfn_6 = nullptr; + work1 = work2 = work1_6 = work2_6 = nullptr; + vg = vg2 = vg_6 = vg2_6 = nullptr; memory->destroy1d_offset(fkx,nxlo_fft); memory->destroy1d_offset(fky,nylo_fft); memory->destroy1d_offset(fkz,nzlo_fft); - fkx = fky = fkz = NULL; + fkx = fky = fkz = nullptr; memory->destroy1d_offset(fkx2,nxlo_fft); memory->destroy1d_offset(fky2,nylo_fft); memory->destroy1d_offset(fkz2,nzlo_fft); - fkx2 = fky2 = fkz2 = NULL; + fkx2 = fky2 = fkz2 = nullptr; memory->destroy1d_offset(fkx_6,nxlo_fft_6); memory->destroy1d_offset(fky_6,nylo_fft_6); memory->destroy1d_offset(fkz_6,nzlo_fft_6); - fkx_6 = fky_6 = fkz_6 = NULL; + fkx_6 = fky_6 = fkz_6 = nullptr; memory->destroy1d_offset(fkx2_6,nxlo_fft_6); memory->destroy1d_offset(fky2_6,nylo_fft_6); memory->destroy1d_offset(fkz2_6,nzlo_fft_6); - fkx2_6 = fky2_6 = fkz2_6 = NULL; - + fkx2_6 = fky2_6 = fkz2_6 = nullptr; memory->destroy(gf_b); memory->destroy2d_offset(rho1d,-order/2); memory->destroy2d_offset(rho_coeff,(1-order)/2); memory->destroy2d_offset(drho1d,-order/2); memory->destroy2d_offset(drho_coeff, (1-order)/2); - gf_b = NULL; - rho1d = rho_coeff = drho1d = drho_coeff = NULL; + gf_b = nullptr; + rho1d = rho_coeff = drho1d = drho_coeff = nullptr; memory->destroy(gf_b_6); memory->destroy2d_offset(rho1d_6,-order_6/2); memory->destroy2d_offset(rho_coeff_6,(1-order_6)/2); memory->destroy2d_offset(drho1d_6,-order_6/2); memory->destroy2d_offset(drho_coeff_6,(1-order_6)/2); - gf_b_6 = NULL; - rho1d_6 = rho_coeff_6 = drho1d_6 = drho_coeff_6 = NULL; + gf_b_6 = nullptr; + rho1d_6 = rho_coeff_6 = drho1d_6 = drho_coeff_6 = nullptr; + memory->destroy(gc_buf1); + memory->destroy(gc_buf2); delete fft1; delete fft2; delete remap; - delete cg; - fft1 = fft2 = NULL; - remap = NULL; - cg = NULL; + delete gc; + memory->destroy(gc6_buf1); + memory->destroy(gc6_buf2); delete fft1_6; delete fft2_6; delete remap_6; - delete cg_6; - fft1_6 = fft2_6 = NULL; - remap_6 = NULL; - cg_6 = NULL; + delete gc6; } - /* ---------------------------------------------------------------------- deallocate memory that depends on # of K-vectors and order for per atom calculations @@ -2446,7 +2473,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick, nzlo_out, nylo_out, nxlo_out); memory->destroy3d_offset(v4_brick, nzlo_out, nylo_out, nxlo_out); memory->destroy3d_offset(v5_brick, nzlo_out, nylo_out, nxlo_out); - u_brick = v0_brick = v1_brick = v2_brick = v3_brick = v4_brick = v5_brick = NULL; + u_brick = v0_brick = v1_brick = v2_brick = + v3_brick = v4_brick = v5_brick = nullptr; memory->destroy3d_offset(u_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2455,7 +2483,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_g, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = v3_brick_g = v4_brick_g = v5_brick_g = NULL; + u_brick_g = v0_brick_g = v1_brick_g = v2_brick_g = + v3_brick_g = v4_brick_g = v5_brick_g = nullptr; memory->destroy3d_offset(u_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2464,7 +2493,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a0, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = v3_brick_a0 = v4_brick_a0 = v5_brick_a0 = NULL; + u_brick_a0 = v0_brick_a0 = v1_brick_a0 = v2_brick_a0 = + v3_brick_a0 = v4_brick_a0 = v5_brick_a0 = nullptr; memory->destroy3d_offset(u_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2473,7 +2503,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a1, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = v3_brick_a1 = v4_brick_a1 = v5_brick_a1 = NULL; + u_brick_a1 = v0_brick_a1 = v1_brick_a1 = v2_brick_a1 = + v3_brick_a1 = v4_brick_a1 = v5_brick_a1 = nullptr; memory->destroy3d_offset(u_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2482,7 +2513,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a2, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = v4_brick_a2 = v5_brick_a2 = NULL; + u_brick_a2 = v0_brick_a2 = v1_brick_a2 = v2_brick_a2 = v3_brick_a2 = v4_brick_a2 = v5_brick_a2 = nullptr; memory->destroy3d_offset(u_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2491,7 +2522,7 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a3, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = v4_brick_a3 = v5_brick_a3 = NULL; + u_brick_a3 = v0_brick_a3 = v1_brick_a3 = v2_brick_a3 = v3_brick_a3 = v4_brick_a3 = v5_brick_a3 = nullptr; memory->destroy3d_offset(u_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2500,7 +2531,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a4, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = v3_brick_a4 = v4_brick_a4 = v5_brick_a4 = NULL; + u_brick_a4 = v0_brick_a4 = v1_brick_a4 = v2_brick_a4 = + v3_brick_a4 = v4_brick_a4 = v5_brick_a4 = nullptr; memory->destroy3d_offset(u_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2509,7 +2541,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a5, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = v3_brick_a5 = v4_brick_a5 = v5_brick_a5 = NULL; + u_brick_a5 = v0_brick_a5 = v1_brick_a5 = v2_brick_a5 = + v3_brick_a5 = v4_brick_a5 = v5_brick_a5 = nullptr; memory->destroy3d_offset(u_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v0_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2518,7 +2551,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy3d_offset(v3_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v4_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy3d_offset(v5_brick_a6, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = v3_brick_a6 = v4_brick_a6 = v5_brick_a6 = NULL; + u_brick_a6 = v0_brick_a6 = v1_brick_a6 = v2_brick_a6 = + v3_brick_a6 = v4_brick_a6 = v5_brick_a6 = nullptr; memory->destroy4d_offset(u_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v0_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); @@ -2527,11 +2561,8 @@ void PPPMDisp::deallocate_peratom() memory->destroy4d_offset(v3_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v4_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); memory->destroy4d_offset(v5_brick_none, nzlo_out_6, nylo_out_6, nxlo_out_6); - u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = v3_brick_none = v4_brick_none = v5_brick_none = NULL; - - delete cg_peratom; - delete cg_peratom_6; - cg_peratom = cg_peratom_6 = NULL; + u_brick_none = v0_brick_none = v1_brick_none = v2_brick_none = + v3_brick_none = v4_brick_none = v5_brick_none = nullptr; } /* ---------------------------------------------------------------------- @@ -2577,6 +2608,7 @@ void PPPMDisp::set_grid() while (1) { // set grid dimension + nx_pppm = static_cast (xprd/h_x); ny_pppm = static_cast (yprd/h_y); nz_pppm = static_cast (zprd_slab/h_z); @@ -2585,32 +2617,18 @@ void PPPMDisp::set_grid() if (ny_pppm <= 1) ny_pppm = 2; if (nz_pppm <= 1) nz_pppm = 2; - //set local grid dimension - int npey_fft,npez_fft; - if (nz_pppm >= nprocs) { - npey_fft = 1; - npez_fft = nprocs; - } else procs2grid2d(nprocs,ny_pppm,nz_pppm,&npey_fft,&npez_fft); - - int me_y = me % npey_fft; - int me_z = me / npey_fft; - - nxlo_fft = 0; - nxhi_fft = nx_pppm - 1; - nylo_fft = me_y*ny_pppm/npey_fft; - nyhi_fft = (me_y+1)*ny_pppm/npey_fft - 1; - nzlo_fft = me_z*nz_pppm/npez_fft; - nzhi_fft = (me_z+1)*nz_pppm/npez_fft - 1; + // estimate Kspace force error double qopt = compute_qopt(); - double dfkspace = sqrt(qopt/natoms)*q2/(xprd*yprd*zprd_slab); - count++; + // break loop if the accuracy has been reached or + // too many loops have been performed - // break loop if the accuracy has been reached or too many loops have been performed + count++; if (dfkspace <= accuracy) break; - if (count > 500) error->all(FLERR, "Could not compute grid size for Coulomb interaction"); + + if (count > 500) error->all(FLERR, "Could not compute grid size"); h *= 0.95; h_x = h_y = h_z = h; } @@ -2628,15 +2646,15 @@ void PPPMDisp::set_grid() ------------------------------------------------------------------------- */ void PPPMDisp::set_fft_parameters(int& nx_p,int& ny_p,int& nz_p, - int& nxlo_f,int& nylo_f,int& nzlo_f, - int& nxhi_f,int& nyhi_f,int& nzhi_f, - int& nxlo_i,int& nylo_i,int& nzlo_i, - int& nxhi_i,int& nyhi_i,int& nzhi_i, - int& nxlo_o,int& nylo_o,int& nzlo_o, - int& nxhi_o,int& nyhi_o,int& nzhi_o, - int& nlow, int& nupp, - int& ng, int& nf, int& nfb, - double& sft,double& sftone, int& ord) + int& nxlo_f,int& nylo_f,int& nzlo_f, + int& nxhi_f,int& nyhi_f,int& nzhi_f, + int& nxlo_i,int& nylo_i,int& nzlo_i, + int& nxhi_i,int& nyhi_i,int& nzhi_i, + int& nxlo_o,int& nylo_o,int& nzlo_o, + int& nxhi_o,int& nyhi_o,int& nzhi_o, + int& nlow, int& nupp, + int& ng, int& nf, int& nfb, + double& sft,double& sftone, int& ord) { // global indices of PPPM grid range from 0 to N-1 // nlo_in,nhi_in = lower/upper limits of the 3d sub-brick of @@ -2770,20 +2788,16 @@ void PPPMDisp::set_fft_parameters(int& nx_p,int& ny_p,int& nz_p, // PPPM grid for this proc, including ghosts - ng = (nxhi_o-nxlo_o+1) * (nyhi_o-nylo_o+1) * - (nzhi_o-nzlo_o+1); + ng = (nxhi_o-nxlo_o+1) * (nyhi_o-nylo_o+1) * (nzhi_o-nzlo_o+1); // FFT arrays on this proc, without ghosts // nfft = FFT points in FFT decomposition on this proc // nfft_brick = FFT points in 3d brick-decomposition on this proc // nfft_both = greater of 2 values - nf = (nxhi_f-nxlo_f+1) * (nyhi_f-nylo_f+1) * - (nzhi_f-nzlo_f+1); - int nfft_brick = (nxhi_i-nxlo_i+1) * (nyhi_i-nylo_i+1) * - (nzhi_i-nzlo_i+1); + nf = (nxhi_f-nxlo_f+1) * (nyhi_f-nylo_f+1) * (nzhi_f-nzlo_f+1); + int nfft_brick = (nxhi_i-nxlo_i+1) * (nyhi_i-nylo_i+1) * (nzhi_i-nzlo_i+1); nfb = MAX(nf,nfft_brick); - } /* ---------------------------------------------------------------------- @@ -2811,9 +2825,9 @@ int PPPMDisp::factorable(int n) /* ---------------------------------------------------------------------- pre-compute Green's function denominator expansion coeffs, Gamma(2n) ------------------------------------------------------------------------- */ + void PPPMDisp::adjust_gewald() { - // Use Newton solver to find g_ewald double dx; @@ -2829,12 +2843,11 @@ void PPPMDisp::adjust_gewald() // Failed to converge error->all(FLERR, "Could not compute g_ewald"); - } /* ---------------------------------------------------------------------- - Calculate f(x) - ------------------------------------------------------------------------- */ + calculate f(x) +------------------------------------------------------------------------- */ double PPPMDisp::f() { @@ -2856,9 +2869,9 @@ double PPPMDisp::f() } /* ---------------------------------------------------------------------- - Calculate numerical derivative f'(x) using forward difference - [f(x + h) - f(x)] / h - ------------------------------------------------------------------------- */ + calculate numerical derivative f'(x) using forward difference + [f(x + h) - f(x)] / h +------------------------------------------------------------------------- */ double PPPMDisp::derivf() { @@ -2876,7 +2889,7 @@ double PPPMDisp::derivf() } /* ---------------------------------------------------------------------- - Calculate the final estimator for the accuracy + calculate the final estimator for the accuracy ------------------------------------------------------------------------- */ double PPPMDisp::final_accuracy() @@ -2900,7 +2913,7 @@ double PPPMDisp::final_accuracy() } /* ---------------------------------------------------------------------- - Calculate the final estimator for the Dispersion accuracy + calculate the final estimator for the Dispersion accuracy ------------------------------------------------------------------------- */ void PPPMDisp::final_accuracy_6(double& acc, double& acc_real, double& acc_kspace) @@ -2913,54 +2926,46 @@ void PPPMDisp::final_accuracy_6(double& acc, double& acc_real, double& acc_kspac acc_real = lj_rspace_error(); double qopt = compute_qopt_6(); - acc_kspace = sqrt(qopt/natoms)*csum/(xprd*yprd*zprd_slab); - acc = sqrt(acc_real*acc_real + acc_kspace*acc_kspace); + return; } /* ---------------------------------------------------------------------- - Compute qopt for Coulomb interactions + compute qopt for Coulomb interactions ------------------------------------------------------------------------- */ double PPPMDisp::compute_qopt() { double qopt; - if (differentiation_flag == 1) { - qopt = compute_qopt_ad(); - } else { - qopt = compute_qopt_ik(); - } + if (differentiation_flag == 1) qopt = compute_qopt_ad(); + else qopt = compute_qopt_ik(); double qopt_all; MPI_Allreduce(&qopt,&qopt_all,1,MPI_DOUBLE,MPI_SUM,world); return qopt_all; } /* ---------------------------------------------------------------------- - Compute qopt for Dispersion interactions + compute qopt for Dispersion interactions ------------------------------------------------------------------------- */ double PPPMDisp::compute_qopt_6() { double qopt; - if (differentiation_flag == 1) { - qopt = compute_qopt_6_ad(); - } else { - qopt = compute_qopt_6_ik(); - } + if (differentiation_flag == 1) qopt = compute_qopt_6_ad(); + else qopt = compute_qopt_6_ik(); double qopt_all; MPI_Allreduce(&qopt,&qopt_all,1,MPI_DOUBLE,MPI_SUM,world); return qopt_all; } /* ---------------------------------------------------------------------- - Compute qopt for the ik differentiation scheme and Coulomb interaction + compute qopt for the ik differentiation scheme and Coulomb interaction ------------------------------------------------------------------------- */ double PPPMDisp::compute_qopt_ik() { - double qopt = 0.0; int k,l,m; double *prd; @@ -2976,7 +2981,7 @@ double PPPMDisp::compute_qopt_ik() double unitky = (2.0*MY_PI/yprd); double unitkz = (2.0*MY_PI/zprd_slab); - int nx,ny,nz,kper,lper,mper; + int nx,ny,nz; double sqk, u2; double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double sum1,sum2, sum3,dot1,dot2; @@ -2985,67 +2990,73 @@ double PPPMDisp::compute_qopt_ik() int nby = 2; int nbz = 2; - for (m = nzlo_fft; m <= nzhi_fft; m++) { - mper = m - nz_pppm*(2*m/nz_pppm); + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point - for (l = nylo_fft; l <= nyhi_fft; l++) { - lper = l - ny_pppm*(2*l/ny_pppm); + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + int nxy_pppm = nx_pppm * ny_pppm; - for (k = nxlo_fft; k <= nxhi_fft; k++) { - kper = k - nx_pppm*(2*k/nx_pppm); + double qopt = 0.0; - sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + - pow(unitkz*mper,2.0); + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm; + l = (i/nx_pppm) % ny_pppm; + m = i / nxy_pppm; - if (sqk != 0.0) { - sum1 = 0.0; - sum2 = 0.0; - sum3 = 0.0; - for (nx = -nbx; nx <= nbx; nx++) { - qx = unitkx*(kper+nx_pppm*nx); - sx = exp(-0.25*pow(qx/g_ewald,2.0)); - wx = 1.0; - argx = 0.5*qx*xprd/nx_pppm; - if (argx != 0.0) wx = pow(sin(argx)/argx,order); - for (ny = -nby; ny <= nby; ny++) { - qy = unitky*(lper+ny_pppm*ny); - sy = exp(-0.25*pow(qy/g_ewald,2.0)); - wy = 1.0; - argy = 0.5*qy*yprd/ny_pppm; - if (argy != 0.0) wy = pow(sin(argy)/argy,order); - for (nz = -nbz; nz <= nbz; nz++) { - qz = unitkz*(mper+nz_pppm*nz); - sz = exp(-0.25*pow(qz/g_ewald,2.0)); - wz = 1.0; - argz = 0.5*qz*zprd_slab/nz_pppm; - if (argz != 0.0) wz = pow(sin(argz)/argz,order); + const int kper = k - nx_pppm*(2*k/nx_pppm); + const int lper = l - ny_pppm*(2*l/ny_pppm); + const int mper = m - nz_pppm*(2*m/nz_pppm); - dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz; - dot2 = qx*qx+qy*qy+qz*qz; - u2 = pow(wx*wy*wz,2.0); - sum1 += sx*sy*sz*sx*sy*sz/dot2*4.0*4.0*MY_PI*MY_PI; - sum2 += u2*sx*sy*sz*4.0*MY_PI/dot2*dot1; - sum3 += u2; - } - } - } - sum2 *= sum2; - sum3 *= sum3*sqk; - qopt += sum1 -sum2/sum3; + sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + pow(unitkz*mper,2.0); + if (sqk == 0.0) continue; + + sum1 = sum2 = sum3 = 0.0; + + for (nx = -nbx; nx <= nbx; nx++) { + qx = unitkx*(kper+nx_pppm*nx); + sx = exp(-0.25*pow(qx/g_ewald,2.0)); + wx = 1.0; + argx = 0.5*qx*xprd/nx_pppm; + if (argx != 0.0) wx = pow(sin(argx)/argx,order); + + for (ny = -nby; ny <= nby; ny++) { + qy = unitky*(lper+ny_pppm*ny); + sy = exp(-0.25*pow(qy/g_ewald,2.0)); + wy = 1.0; + argy = 0.5*qy*yprd/ny_pppm; + if (argy != 0.0) wy = pow(sin(argy)/argy,order); + + for (nz = -nbz; nz <= nbz; nz++) { + qz = unitkz*(mper+nz_pppm*nz); + sz = exp(-0.25*pow(qz/g_ewald,2.0)); + wz = 1.0; + argz = 0.5*qz*zprd_slab/nz_pppm; + if (argz != 0.0) wz = pow(sin(argz)/argz,order); + + dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz; + dot2 = qx*qx+qy*qy+qz*qz; + u2 = pow(wx*wy*wz,2.0); + sum1 += sx*sy*sz*sx*sy*sz/dot2*4.0*4.0*MY_PI*MY_PI; + sum2 += u2*sx*sy*sz*4.0*MY_PI/dot2*dot1; + sum3 += u2; } } } + + sum2 *= sum2; + sum3 *= sum3*sqk; + qopt += sum1 -sum2/sum3; } + return qopt; } /* ---------------------------------------------------------------------- - Compute qopt for the ad differentiation scheme and Coulomb interaction + compute qopt for the ad differentiation scheme and Coulomb interaction ------------------------------------------------------------------------- */ double PPPMDisp::compute_qopt_ad() { - double qopt = 0.0; int k,l,m; double *prd; @@ -3057,12 +3068,11 @@ double PPPMDisp::compute_qopt_ad() double zprd = prd[2]; double zprd_slab = zprd*slab_volfactor; - double unitkx = (2.0*MY_PI/xprd); double unitky = (2.0*MY_PI/yprd); double unitkz = (2.0*MY_PI/zprd_slab); - int nx,ny,nz,kper,lper,mper; + int nx,ny,nz; double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double u2, sqk; double sum1,sum2,sum3,sum4,dot2; @@ -3071,68 +3081,72 @@ double PPPMDisp::compute_qopt_ad() int nby = 2; int nbz = 2; - for (m = nzlo_fft; m <= nzhi_fft; m++) { - mper = m - nz_pppm*(2*m/nz_pppm); + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point - for (l = nylo_fft; l <= nyhi_fft; l++) { - lper = l - ny_pppm*(2*l/ny_pppm); + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + int nxy_pppm = nx_pppm * ny_pppm; - for (k = nxlo_fft; k <= nxhi_fft; k++) { - kper = k - nx_pppm*(2*k/nx_pppm); + double qopt = 0.0; - sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + - pow(unitkz*mper,2.0); + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm; + l = (i/nx_pppm) % ny_pppm; + m = i / nxy_pppm; - if (sqk != 0.0) { + const int kper = k - nx_pppm*(2*k/nx_pppm); + const int lper = l - ny_pppm*(2*l/ny_pppm); + const int mper = m - nz_pppm*(2*m/nz_pppm); - sum1 = 0.0; - sum2 = 0.0; - sum3 = 0.0; - sum4 = 0.0; - for (nx = -nbx; nx <= nbx; nx++) { - qx = unitkx*(kper+nx_pppm*nx); - sx = exp(-0.25*pow(qx/g_ewald,2.0)); - wx = 1.0; - argx = 0.5*qx*xprd/nx_pppm; - if (argx != 0.0) wx = pow(sin(argx)/argx,order); - for (ny = -nby; ny <= nby; ny++) { - qy = unitky*(lper+ny_pppm*ny); - sy = exp(-0.25*pow(qy/g_ewald,2.0)); - wy = 1.0; - argy = 0.5*qy*yprd/ny_pppm; - if (argy != 0.0) wy = pow(sin(argy)/argy,order); - for (nz = -nbz; nz <= nbz; nz++) { - qz = unitkz*(mper+nz_pppm*nz); - sz = exp(-0.25*pow(qz/g_ewald,2.0)); - wz = 1.0; - argz = 0.5*qz*zprd_slab/nz_pppm; - if (argz != 0.0) wz = pow(sin(argz)/argz,order); + sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + pow(unitkz*mper,2.0); + if (sqk == 0.0) continue; - dot2 = qx*qx+qy*qy+qz*qz; - u2 = pow(wx*wy*wz,2.0); - sum1 += sx*sy*sz*sx*sy*sz/dot2*4.0*4.0*MY_PI*MY_PI; - sum2 += sx*sy*sz * u2*4.0*MY_PI; - sum3 += u2; - sum4 += dot2*u2; - } - } - } - sum2 *= sum2; - qopt += sum1 - sum2/(sum3*sum4); + sum1 = sum2 = sum3 = sum4 = 0.0; + + for (nx = -nbx; nx <= nbx; nx++) { + qx = unitkx*(kper+nx_pppm*nx); + sx = exp(-0.25*pow(qx/g_ewald,2.0)); + wx = 1.0; + argx = 0.5*qx*xprd/nx_pppm; + if (argx != 0.0) wx = pow(sin(argx)/argx,order); + + for (ny = -nby; ny <= nby; ny++) { + qy = unitky*(lper+ny_pppm*ny); + sy = exp(-0.25*pow(qy/g_ewald,2.0)); + wy = 1.0; + argy = 0.5*qy*yprd/ny_pppm; + if (argy != 0.0) wy = pow(sin(argy)/argy,order); + + for (nz = -nbz; nz <= nbz; nz++) { + qz = unitkz*(mper+nz_pppm*nz); + sz = exp(-0.25*pow(qz/g_ewald,2.0)); + wz = 1.0; + argz = 0.5*qz*zprd_slab/nz_pppm; + if (argz != 0.0) wz = pow(sin(argz)/argz,order); + + dot2 = qx*qx+qy*qy+qz*qz; + u2 = pow(wx*wy*wz,2.0); + sum1 += sx*sy*sz*sx*sy*sz/dot2*4.0*4.0*MY_PI*MY_PI; + sum2 += sx*sy*sz * u2*4.0*MY_PI; + sum3 += u2; + sum4 += dot2*u2; } } } + + sum2 *= sum2; + qopt += sum1 - sum2/(sum3*sum4); } + return qopt; } /* ---------------------------------------------------------------------- - Compute qopt for the ik differentiation scheme and Dispersion interaction + compute qopt for the ik differentiation scheme and Dispersion interaction ------------------------------------------------------------------------- */ double PPPMDisp::compute_qopt_6_ik() { - double qopt = 0.0; int k,l,m; double *prd; @@ -3148,7 +3162,7 @@ double PPPMDisp::compute_qopt_6_ik() double unitky = (2.0*MY_PI/yprd); double unitkz = (2.0*MY_PI/zprd_slab); - int nx,ny,nz,kper,lper,mper; + int nx,ny,nz; double sqk, u2; double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double sum1,sum2, sum3; @@ -3161,71 +3175,76 @@ double PPPMDisp::compute_qopt_6_ik() int nby = 2; int nbz = 2; - for (m = nzlo_fft_6; m <= nzhi_fft_6; m++) { - mper = m - nz_pppm_6*(2*m/nz_pppm_6); + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point - for (l = nylo_fft_6; l <= nyhi_fft_6; l++) { - lper = l - ny_pppm_6*(2*l/ny_pppm_6); + bigint ngridtotal = (bigint) nx_pppm_6 * ny_pppm_6 * nz_pppm_6; + int nxy_pppm_6 = nx_pppm_6 * ny_pppm_6; - for (k = nxlo_fft_6; k <= nxhi_fft_6; k++) { - kper = k - nx_pppm_6*(2*k/nx_pppm_6); + double qopt = 0.0; - sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + - pow(unitkz*mper,2.0); + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm_6; + l = (i/nx_pppm_6) % ny_pppm_6; + m = i / nxy_pppm_6; - if (sqk != 0.0) { - sum1 = 0.0; - sum2 = 0.0; - sum3 = 0.0; - for (nx = -nbx; nx <= nbx; nx++) { - qx = unitkx*(kper+nx_pppm_6*nx); - sx = exp(-qx*qx*inv2ew*inv2ew); - wx = 1.0; - argx = 0.5*qx*xprd/nx_pppm_6; - if (argx != 0.0) wx = pow(sin(argx)/argx,order_6); - for (ny = -nby; ny <= nby; ny++) { - qy = unitky*(lper+ny_pppm_6*ny); - sy = exp(-qy*qy*inv2ew*inv2ew); - wy = 1.0; - argy = 0.5*qy*yprd/ny_pppm_6; - if (argy != 0.0) wy = pow(sin(argy)/argy,order_6); - for (nz = -nbz; nz <= nbz; nz++) { - qz = unitkz*(mper+nz_pppm_6*nz); - sz = exp(-qz*qz*inv2ew*inv2ew); - wz = 1.0; - argz = 0.5*qz*zprd_slab/nz_pppm_6; - if (argz != 0.0) wz = pow(sin(argz)/argz,order_6); + const int kper = k - nx_pppm_6*(2*k/nx_pppm_6); + const int lper = l - ny_pppm_6*(2*l/ny_pppm_6); + const int mper = m - nz_pppm_6*(2*m/nz_pppm_6); - dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz; - dot2 = qx*qx+qy*qy+qz*qz; - rtdot2 = sqrt(dot2); - term = (1-2*dot2*inv2ew*inv2ew)*sx*sy*sz + - 2*dot2*rtdot2*inv2ew*inv2ew*inv2ew*rtpi*erfc(rtdot2*inv2ew); - term *= g_ewald_6*g_ewald_6*g_ewald_6; - u2 = pow(wx*wy*wz,2.0); - sum1 += term*term*MY_PI*MY_PI*MY_PI/9.0 * dot2; - sum2 += -u2*term*MY_PI*rtpi/3.0*dot1; - sum3 += u2; - } - } - } - sum2 *= sum2; - sum3 *= sum3*sqk; - qopt += sum1 -sum2/sum3; + sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + pow(unitkz*mper,2.0); + if (sqk == 0.0) continue; + + sum1 = sum2 = sum3 = 0.0; + + for (nx = -nbx; nx <= nbx; nx++) { + qx = unitkx*(kper+nx_pppm_6*nx); + sx = exp(-qx*qx*inv2ew*inv2ew); + wx = 1.0; + argx = 0.5*qx*xprd/nx_pppm_6; + if (argx != 0.0) wx = pow(sin(argx)/argx,order_6); + + for (ny = -nby; ny <= nby; ny++) { + qy = unitky*(lper+ny_pppm_6*ny); + sy = exp(-qy*qy*inv2ew*inv2ew); + wy = 1.0; + argy = 0.5*qy*yprd/ny_pppm_6; + if (argy != 0.0) wy = pow(sin(argy)/argy,order_6); + + for (nz = -nbz; nz <= nbz; nz++) { + qz = unitkz*(mper+nz_pppm_6*nz); + sz = exp(-qz*qz*inv2ew*inv2ew); + wz = 1.0; + argz = 0.5*qz*zprd_slab/nz_pppm_6; + if (argz != 0.0) wz = pow(sin(argz)/argz,order_6); + + dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz; + dot2 = qx*qx+qy*qy+qz*qz; + rtdot2 = sqrt(dot2); + term = (1-2*dot2*inv2ew*inv2ew)*sx*sy*sz + + 2*dot2*rtdot2*inv2ew*inv2ew*inv2ew*rtpi*erfc(rtdot2*inv2ew); + term *= g_ewald_6*g_ewald_6*g_ewald_6; + u2 = pow(wx*wy*wz,2.0); + sum1 += term*term*MY_PI*MY_PI*MY_PI/9.0 * dot2; + sum2 += -u2*term*MY_PI*rtpi/3.0*dot1; + sum3 += u2; } } } + sum2 *= sum2; + sum3 *= sum3*sqk; + qopt += sum1 -sum2/sum3; } + return qopt; } /* ---------------------------------------------------------------------- - Compute qopt for the ad differentiation scheme and Dispersion interaction + compute qopt for the ad differentiation scheme and Dispersion interaction ------------------------------------------------------------------------- */ double PPPMDisp::compute_qopt_6_ad() { - double qopt = 0.0; int k,l,m; double *prd; @@ -3241,7 +3260,7 @@ double PPPMDisp::compute_qopt_6_ad() double unitky = (2.0*MY_PI/yprd); double unitkz = (2.0*MY_PI/zprd_slab); - int nx,ny,nz,kper,lper,mper; + int nx,ny,nz; double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double u2, sqk; double sum1,sum2,sum3,sum4; @@ -3254,62 +3273,66 @@ double PPPMDisp::compute_qopt_6_ad() int nby = 2; int nbz = 2; - for (m = nzlo_fft_6; m <= nzhi_fft_6; m++) { - mper = m - nz_pppm_6*(2*m/nz_pppm_6); + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point - for (l = nylo_fft_6; l <= nyhi_fft_6; l++) { - lper = l - ny_pppm_6*(2*l/ny_pppm_6); + bigint ngridtotal = (bigint) nx_pppm_6 * ny_pppm_6 * nz_pppm_6; + int nxy_pppm_6 = nx_pppm_6 * ny_pppm_6; - for (k = nxlo_fft_6; k <= nxhi_fft_6; k++) { - kper = k - nx_pppm_6*(2*k/nx_pppm_6); + double qopt = 0.0; - sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + - pow(unitkz*mper,2.0); + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm_6; + l = (i/nx_pppm_6) % ny_pppm_6; + m = i / nxy_pppm_6; - if (sqk != 0.0) { + const int kper = k - nx_pppm_6*(2*k/nx_pppm_6); + const int lper = l - ny_pppm_6*(2*l/ny_pppm_6); + const int mper = m - nz_pppm_6*(2*m/nz_pppm_6); - sum1 = 0.0; - sum2 = 0.0; - sum3 = 0.0; - sum4 = 0.0; - for (nx = -nbx; nx <= nbx; nx++) { - qx = unitkx*(kper+nx_pppm_6*nx); - sx = exp(-qx*qx*inv2ew*inv2ew); - wx = 1.0; - argx = 0.5*qx*xprd/nx_pppm_6; - if (argx != 0.0) wx = pow(sin(argx)/argx,order_6); - for (ny = -nby; ny <= nby; ny++) { - qy = unitky*(lper+ny_pppm_6*ny); - sy = exp(-qy*qy*inv2ew*inv2ew); - wy = 1.0; - argy = 0.5*qy*yprd/ny_pppm_6; - if (argy != 0.0) wy = pow(sin(argy)/argy,order_6); - for (nz = -nbz; nz <= nbz; nz++) { - qz = unitkz*(mper+nz_pppm_6*nz); - sz = exp(-qz*qz*inv2ew*inv2ew); - wz = 1.0; - argz = 0.5*qz*zprd_slab/nz_pppm_6; - if (argz != 0.0) wz = pow(sin(argz)/argz,order_6); + sqk = pow(unitkx*kper,2.0) + pow(unitky*lper,2.0) + pow(unitkz*mper,2.0); + if (sqk == 0.0) continue; - dot2 = qx*qx+qy*qy+qz*qz; - rtdot2 = sqrt(dot2); - term = (1-2*dot2*inv2ew*inv2ew)*sx*sy*sz + - 2*dot2*rtdot2*inv2ew*inv2ew*inv2ew*rtpi*erfc(rtdot2*inv2ew); - term *= g_ewald_6*g_ewald_6*g_ewald_6; - u2 = pow(wx*wy*wz,2.0); - sum1 += term*term*MY_PI*MY_PI*MY_PI/9.0 * dot2; - sum2 += -term*MY_PI*rtpi/3.0 * u2 * dot2; - sum3 += u2; - sum4 += dot2*u2; - } - } - } - sum2 *= sum2; - qopt += sum1 - sum2/(sum3*sum4); + sum1 = sum2 = sum3 = sum4 = 0.0; + + for (nx = -nbx; nx <= nbx; nx++) { + qx = unitkx*(kper+nx_pppm_6*nx); + sx = exp(-qx*qx*inv2ew*inv2ew); + wx = 1.0; + argx = 0.5*qx*xprd/nx_pppm_6; + if (argx != 0.0) wx = pow(sin(argx)/argx,order_6); + + for (ny = -nby; ny <= nby; ny++) { + qy = unitky*(lper+ny_pppm_6*ny); + sy = exp(-qy*qy*inv2ew*inv2ew); + wy = 1.0; + argy = 0.5*qy*yprd/ny_pppm_6; + if (argy != 0.0) wy = pow(sin(argy)/argy,order_6); + + for (nz = -nbz; nz <= nbz; nz++) { + qz = unitkz*(mper+nz_pppm_6*nz); + sz = exp(-qz*qz*inv2ew*inv2ew); + wz = 1.0; + argz = 0.5*qz*zprd_slab/nz_pppm_6; + if (argz != 0.0) wz = pow(sin(argz)/argz,order_6); + + dot2 = qx*qx+qy*qy+qz*qz; + rtdot2 = sqrt(dot2); + term = (1-2*dot2*inv2ew*inv2ew)*sx*sy*sz + + 2*dot2*rtdot2*inv2ew*inv2ew*inv2ew*rtpi*erfc(rtdot2*inv2ew); + term *= g_ewald_6*g_ewald_6*g_ewald_6; + u2 = pow(wx*wy*wz,2.0); + sum1 += term*term*MY_PI*MY_PI*MY_PI/9.0 * dot2; + sum2 += -term*MY_PI*rtpi/3.0 * u2 * dot2; + sum3 += u2; + sum4 += dot2*u2; } } } + sum2 *= sum2; + qopt += sum1 - sum2/(sum3*sum4); } + return qopt; } @@ -3320,7 +3343,8 @@ double PPPMDisp::compute_qopt_6_ad() void PPPMDisp::set_grid_6() { - // Calculate csum + // calculate csum + if (!csumflag) calc_csum(); if (!gewaldflag_6) set_init_g6(); if (!gridflag_6) set_n_pppm_6(); @@ -3352,8 +3376,7 @@ void PPPMDisp::calc_csum() int *neach = new int[ntypes+1]; for (i = 0; i<=ntypes; i++) neach[i] = 0; - //the following variables are needed to distinguish between arithmetic - // and geometric mixing + // following variables distinguish between arithmetic and geometric mixing if (function[1]) { for (i = 1; i <= ntypes; i++) @@ -3388,7 +3411,6 @@ void PPPMDisp::calc_csum() } } - double tmp2; MPI_Allreduce(&csum,&tmp2,1,MPI_DOUBLE,MPI_SUM,world); csum = tmp2; @@ -3398,8 +3420,10 @@ void PPPMDisp::calc_csum() MPI_Allreduce(neach,neach_all,ntypes+1,MPI_INT,MPI_SUM,world); // copmute csumij and csumi + double d1, d2; - if (function[1]){ + + if (function[1]) { for (i=1; i<=ntypes; i++) { for (j=1; j<=ntypes; j++) { csumi[i] += neach_all[j]*B[i]*B[j]; @@ -3410,6 +3434,7 @@ void PPPMDisp::calc_csum() } } } + if (function[2]) { for (i=1; i<=ntypes; i++) { for (j=1; j<=ntypes; j++) { @@ -3423,6 +3448,7 @@ void PPPMDisp::calc_csum() } } } + if (function[3]) { for (i=1; i<=ntypes; i++) { for (j=1; j<=ntypes; j++) { @@ -3446,10 +3472,11 @@ void PPPMDisp::calc_csum() void PPPMDisp::adjust_gewald_6() { - // Use Newton solver to find g_ewald_6 + // use Newton solver to find g_ewald_6 + double dx; - // Start loop + // start loop for (int i = 0; i < LARGE; i++) { dx = f_6() / derivf_6(); @@ -3457,15 +3484,14 @@ void PPPMDisp::adjust_gewald_6() if (fabs(f_6()) < SMALL) return; } - // Failed to converge + // failed to converge error->all(FLERR, "Could not adjust g_ewald_6"); - } /* ---------------------------------------------------------------------- - Calculate f(x) for Dispersion interaction - ------------------------------------------------------------------------- */ + calculate f(x) for Dispersion interaction +------------------------------------------------------------------------- */ double PPPMDisp::f_6() { @@ -3490,13 +3516,13 @@ double PPPMDisp::f_6() } /* ---------------------------------------------------------------------- - Calculate numerical derivative f'(x) using forward difference - [f(x + h) - f(x)] / h - ------------------------------------------------------------------------- */ + calculate numerical derivative f'(x) using forward difference + [f(x + h) - f(x)] / h +------------------------------------------------------------------------- */ double PPPMDisp::derivf_6() { - double h = 0.000001; //Derivative step-size + double h = 0.000001; // derivative step-size double df,f1,f2,g_ewald_old; f1 = f_6(); @@ -3512,7 +3538,7 @@ double PPPMDisp::derivf_6() /* ---------------------------------------------------------------------- calculate an initial value for g_ewald_6 - ---------------------------------------------------------------------- */ + ---------------------------------------------------------------------- */ void PPPMDisp::set_init_g6() { @@ -3527,11 +3553,13 @@ void PPPMDisp::set_init_g6() // if df_real > 0, repeat divide g_ewald_6 by 2 until df_real < 0 // else, repeat multiply g_ewald_6 by 2 until df_real > 0 // perform bisection for the last two values of + double df_real; double g_ewald_old; double gmin, gmax; // check if there is a user defined accuracy + double acc_rspace = accuracy; if (accuracy_real_6 > 0) acc_rspace = accuracy_real_6; @@ -3570,12 +3598,11 @@ void PPPMDisp::set_init_g6() g_ewald_6 = gmin + 0.5*(gmax-gmin); } if (counter >= LARGE-1) error->all(FLERR,"Cannot compute initial g_ewald_disp"); - } /* ---------------------------------------------------------------------- calculate nx_pppm, ny_pppm, nz_pppm for dispersion interaction - ---------------------------------------------------------------------- */ + ---------------------------------------------------------------------- */ void PPPMDisp::set_n_pppm_6() { @@ -3596,10 +3623,13 @@ void PPPMDisp::set_n_pppm_6() if (accuracy_kspace_6 > 0.0) acc_kspace = accuracy_kspace_6; // initial value for the grid spacing + h = h_x = h_y = h_z = 4.0/g_ewald_6; + // decrease grid spacing until required precision is obtained + int count = 0; - while(1) { + while (1) { // set grid dimension nx_pppm_6 = static_cast (xprd/h_x); @@ -3633,7 +3663,9 @@ void PPPMDisp::set_n_pppm_6() count++; - // break loop if the accuracy has been reached or too many loops have been performed + // break loop if the accuracy has been reached or + // too many loops have been performed + if (df_kspace <= acc_kspace) break; if (count > 500) error->all(FLERR, "Could not compute grid size for Dispersion"); h *= 0.95; @@ -3643,7 +3675,7 @@ void PPPMDisp::set_n_pppm_6() /* ---------------------------------------------------------------------- calculate the real space error for dispersion interactions - ---------------------------------------------------------------------- */ +---------------------------------------------------------------------- */ double PPPMDisp::lj_rspace_error() { @@ -3657,15 +3689,15 @@ double PPPMDisp::lj_rspace_error() double rgs = (cutoff_lj*g_ewald_6); rgs *= rgs; double rgs_inv = 1.0/rgs; - deltaf = csum/sqrt(natoms*xprd*yprd*zprd_slab*cutoff_lj)*sqrt(MY_PI)*pow(g_ewald_6, 5)* + deltaf = csum/sqrt(natoms*xprd*yprd*zprd_slab*cutoff_lj)* + sqrt(MY_PI)*pow(g_ewald_6, 5)* exp(-rgs)*(1+rgs_inv*(3+rgs_inv*(6+rgs_inv*6))); return deltaf; } - /* ---------------------------------------------------------------------- - Compyute the modified (hockney-eastwood) coulomb green function - ---------------------------------------------------------------------- */ + compute the modified (hockney-eastwood) coulomb green function +---------------------------------------------------------------------- */ void PPPMDisp::compute_gf() { @@ -3691,7 +3723,6 @@ void PPPMDisp::compute_gf() double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; double numerator,denominator; - n = 0; for (m = nzlo_fft; m <= nzhi_fft; m++) { mper = m - nz_pppm*(2*m/nz_pppm); @@ -3744,12 +3775,11 @@ void PPPMDisp::compute_gf() ------------------------------------------------------------------------- */ void PPPMDisp::compute_sf_precoeff(int nxp, int nyp, int nzp, int ord, - int nxlo_ft, int nylo_ft, int nzlo_ft, - int nxhi_ft, int nyhi_ft, int nzhi_ft, - double *sf_pre1, double *sf_pre2, double *sf_pre3, - double *sf_pre4, double *sf_pre5, double *sf_pre6) + int nxlo_ft, int nylo_ft, int nzlo_ft, + int nxhi_ft, int nyhi_ft, int nzhi_ft, + double *sf_pre1, double *sf_pre2, double *sf_pre3, + double *sf_pre4, double *sf_pre5, double *sf_pre6) { - int i,k,l,m,n; double *prd; @@ -3866,8 +3896,8 @@ void PPPMDisp::compute_sf_precoeff(int nxp, int nyp, int nzp, int ord, } /* ---------------------------------------------------------------------- - Compute the modified (hockney-eastwood) dispersion green function - ---------------------------------------------------------------------- */ + compute the modified (hockney-eastwood) dispersion green function + ---------------------------------------------------------------------- */ void PPPMDisp::compute_gf_6() { @@ -3986,7 +4016,7 @@ void PPPMDisp::compute_sf_coeff() } } - // Compute the coefficients for the self-force correction + // compute the coefficients for the self-force correction double prex, prey, prez; prex = prey = prez = MY_PI/volume; @@ -4063,7 +4093,6 @@ void PPPMDisp::compute_sf_coeff_6() double tmp[6]; MPI_Allreduce(sf_coeff_6,tmp,6,MPI_DOUBLE,MPI_SUM,world); for (n = 0; n < 6; n++) sf_coeff_6[n] = tmp[n]; - } /* ---------------------------------------------------------------------- @@ -4498,20 +4527,22 @@ void PPPMDisp::make_rho_none() ------------------------------------------------------------------------- */ void PPPMDisp::poisson_ik(FFT_SCALAR* wk1, FFT_SCALAR* wk2, - FFT_SCALAR* dfft, LAMMPS_NS::FFT3d* ft1,LAMMPS_NS::FFT3d* ft2, - int nx_p, int ny_p, int nz_p, int nft, - int nxlo_ft, int nylo_ft, int nzlo_ft, - int nxhi_ft, int nyhi_ft, int nzhi_ft, - int nxlo_i, int nylo_i, int nzlo_i, - int nxhi_i, int nyhi_i, int nzhi_i, - double& egy, double* gfn, - double* kx, double* ky, double* kz, - double* kx2, double* ky2, double* kz2, - FFT_SCALAR*** vx_brick, FFT_SCALAR*** vy_brick, FFT_SCALAR*** vz_brick, - double* vir, double** vcoeff, double** vcoeff2, - FFT_SCALAR*** u_pa, FFT_SCALAR*** v0_pa, FFT_SCALAR*** v1_pa, FFT_SCALAR*** v2_pa, - FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, FFT_SCALAR*** v5_pa) - + FFT_SCALAR* dfft, LAMMPS_NS::FFT3d* ft1, + LAMMPS_NS::FFT3d* ft2, + int nx_p, int ny_p, int nz_p, int nft, + int nxlo_ft, int nylo_ft, int nzlo_ft, + int nxhi_ft, int nyhi_ft, int nzhi_ft, + int nxlo_i, int nylo_i, int nzlo_i, + int nxhi_i, int nyhi_i, int nzhi_i, + double& egy, double* gfn, + double* kx, double* ky, double* kz, + double* kx2, double* ky2, double* kz2, + FFT_SCALAR*** vx_brick, FFT_SCALAR*** vy_brick, + FFT_SCALAR*** vz_brick, + double* vir, double** vcoeff, double** vcoeff2, + FFT_SCALAR*** u_pa, FFT_SCALAR*** v0_pa, + FFT_SCALAR*** v1_pa, FFT_SCALAR*** v2_pa, + FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, FFT_SCALAR*** v5_pa) { int i,j,k,n; @@ -4642,18 +4673,18 @@ void PPPMDisp::poisson_ik(FFT_SCALAR* wk1, FFT_SCALAR* wk2, ------------------------------------------------------------------------- */ void PPPMDisp::poisson_ad(FFT_SCALAR* wk1, FFT_SCALAR* wk2, - FFT_SCALAR* dfft, LAMMPS_NS::FFT3d* ft1,LAMMPS_NS::FFT3d* ft2, - int nx_p, int ny_p, int nz_p, int nft, - int nxlo_ft, int nylo_ft, int nzlo_ft, - int nxhi_ft, int nyhi_ft, int nzhi_ft, - int nxlo_i, int nylo_i, int nzlo_i, - int nxhi_i, int nyhi_i, int nzhi_i, - double& egy, double* gfn, - double* vir, double** vcoeff, double** vcoeff2, - FFT_SCALAR*** u_pa, FFT_SCALAR*** v0_pa, FFT_SCALAR*** v1_pa, FFT_SCALAR*** v2_pa, - FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, FFT_SCALAR*** v5_pa) - - + FFT_SCALAR* dfft, LAMMPS_NS::FFT3d* ft1,LAMMPS_NS::FFT3d* ft2, + int nx_p, int ny_p, int nz_p, int nft, + int nxlo_ft, int nylo_ft, int nzlo_ft, + int nxhi_ft, int nyhi_ft, int nzhi_ft, + int nxlo_i, int nylo_i, int nzlo_i, + int nxhi_i, int nyhi_i, int nzhi_i, + double& egy, double* gfn, + double* vir, double** vcoeff, double** vcoeff2, + FFT_SCALAR*** u_pa, FFT_SCALAR*** v0_pa, + FFT_SCALAR*** v1_pa, FFT_SCALAR*** v2_pa, + FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, + FFT_SCALAR*** v5_pa) { int i,j,k,n; double eng; @@ -4733,11 +4764,13 @@ void PPPMDisp::poisson_ad(FFT_SCALAR* wk1, FFT_SCALAR* wk2, ------------------------------------------------------------------------- */ void PPPMDisp:: poisson_peratom(FFT_SCALAR* wk1, FFT_SCALAR* wk2, LAMMPS_NS::FFT3d* ft2, - double** vcoeff, double** vcoeff2, int nft, - int nxlo_i, int nylo_i, int nzlo_i, - int nxhi_i, int nyhi_i, int nzhi_i, - FFT_SCALAR*** v0_pa, FFT_SCALAR*** v1_pa, FFT_SCALAR*** v2_pa, - FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, FFT_SCALAR*** v5_pa) + double** vcoeff, double** vcoeff2, int nft, + int nxlo_i, int nylo_i, int nzlo_i, + int nxhi_i, int nyhi_i, int nzhi_i, + FFT_SCALAR*** v0_pa, FFT_SCALAR*** v1_pa, + FFT_SCALAR*** v2_pa, + FFT_SCALAR*** v3_pa, FFT_SCALAR*** v4_pa, + FFT_SCALAR*** v5_pa) { //v0 & v1 term int n, i, j, k; @@ -4803,13 +4836,16 @@ void PPPMDisp:: poisson_peratom(FFT_SCALAR* wk1, FFT_SCALAR* wk2, LAMMPS_NS::FFT for ik scheme ------------------------------------------------------------------------- */ -void PPPMDisp::poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, - FFT_SCALAR*** vxbrick_1, FFT_SCALAR*** vybrick_1, FFT_SCALAR*** vzbrick_1, - FFT_SCALAR*** vxbrick_2, FFT_SCALAR*** vybrick_2, FFT_SCALAR*** vzbrick_2, - FFT_SCALAR*** u_pa_1, FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, - FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, - FFT_SCALAR*** u_pa_2, FFT_SCALAR*** v0_pa_2, FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, - FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) +void PPPMDisp:: +poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, + FFT_SCALAR*** vxbrick_1, FFT_SCALAR*** vybrick_1, FFT_SCALAR*** vzbrick_1, + FFT_SCALAR*** vxbrick_2, FFT_SCALAR*** vybrick_2, FFT_SCALAR*** vzbrick_2, + FFT_SCALAR*** u_pa_1, FFT_SCALAR*** v0_pa_1, + FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, + FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, + FFT_SCALAR*** u_pa_2, FFT_SCALAR*** v0_pa_2, + FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, + FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) { int i,j,k,n; @@ -4848,7 +4884,8 @@ void PPPMDisp::poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, if (vflag_global) { n = 0; for (i = 0; i < nfft_6; i++) { - eng = 2 * s2 * greensfn_6[i] * (work1_6[n]*work2_6[n+1] - work1_6[n+1]*work2_6[n]); + eng = 2 * s2 * greensfn_6[i] * + (work1_6[n]*work2_6[n+1] - work1_6[n+1]*work2_6[n]); for (j = 0; j < 6; j++) virial_6[j] += eng*vg_6[i][j]; if (eflag_global)energy_6 += eng; n += 2; @@ -4861,7 +4898,9 @@ void PPPMDisp::poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, n += 2; } } + // unify the two transformed vectors for efficient calculations later + for ( i = 0; i < 2*nfft_6; i++) { work1_6[i] += work2_6[i]; } @@ -4961,8 +5000,10 @@ void PPPMDisp::poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, } } - if (vflag_atom) poisson_2s_peratom(v0_pa_1, v1_pa_1, v2_pa_1, v3_pa_1, v4_pa_1, v5_pa_1, - v0_pa_2, v1_pa_2, v2_pa_2, v3_pa_2, v4_pa_2, v5_pa_2); + if (vflag_atom) poisson_2s_peratom(v0_pa_1, v1_pa_1, v2_pa_1, + v3_pa_1, v4_pa_1, v5_pa_1, + v0_pa_2, v1_pa_2, v2_pa_2, + v3_pa_2, v4_pa_2, v5_pa_2); } @@ -4971,11 +5012,15 @@ void PPPMDisp::poisson_2s_ik(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, for ik scheme ------------------------------------------------------------------------- */ -void PPPMDisp::poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, - FFT_SCALAR*** vxbrick_1, FFT_SCALAR*** vybrick_1, FFT_SCALAR*** vzbrick_1, - FFT_SCALAR*** vxbrick_2, FFT_SCALAR*** vybrick_2, FFT_SCALAR*** vzbrick_2, - FFT_SCALAR**** u_pa, FFT_SCALAR**** v0_pa, FFT_SCALAR**** v1_pa, FFT_SCALAR**** v2_pa, - FFT_SCALAR**** v3_pa, FFT_SCALAR**** v4_pa, FFT_SCALAR**** v5_pa) +void PPPMDisp:: +poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, + FFT_SCALAR*** vxbrick_1, FFT_SCALAR*** vybrick_1, + FFT_SCALAR*** vzbrick_1, + FFT_SCALAR*** vxbrick_2, FFT_SCALAR*** vybrick_2, + FFT_SCALAR*** vzbrick_2, + FFT_SCALAR**** u_pa, FFT_SCALAR**** v0_pa, + FFT_SCALAR**** v1_pa, FFT_SCALAR**** v2_pa, + FFT_SCALAR**** v3_pa, FFT_SCALAR**** v4_pa, FFT_SCALAR**** v5_pa) { int i,j,k,n; double eng; @@ -4983,8 +5028,8 @@ void PPPMDisp::poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* df double scaleinv = 1.0/(nx_pppm_6*ny_pppm_6*nz_pppm_6); // transform charge/dispersion density (r -> k) - // only one tansform required when energies and pressures do not - // need to be calculated + // only one tansform required when energies and pressures not needed + if (eflag_global + vflag_global == 0) { n = 0; for (i = 0; i < nfft_6; i++) { @@ -4995,9 +5040,8 @@ void PPPMDisp::poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* df fft1_6->compute(work1_6,work1_6,1); } + // two transforms are required when energies and pressures are calculated - // two transforms are required when energies and pressures are - // calculated else { n = 0; for (i = 0; i < nfft_6; i++) { @@ -5016,7 +5060,9 @@ void PPPMDisp::poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* df if (vflag_global) { n = 0; for (i = 0; i < nfft_6; i++) { - eng = s2 * greensfn_6[i] * (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); + eng = s2 * greensfn_6[i] * + (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); for (j = 0; j < 6; j++) virial_6[j] += eng*vg_6[i][j]; if (eflag_global)energy_6 += eng; n += 2; @@ -5025,11 +5071,15 @@ void PPPMDisp::poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* df n = 0; for (i = 0; i < nfft_6; i++) { energy_6 += - s2 * greensfn_6[i] * (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); + s2 * greensfn_6[i] * + (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); n += 2; } } + // unify the two transformed vectors for efficient calculations later + for ( i = 0; i < 2*nfft_6; i++) { work1_6[i] += work2_6[i]; } @@ -5139,12 +5189,14 @@ void PPPMDisp::poisson_none_ik(int n1, int n2,FFT_SCALAR* dfft_1, FFT_SCALAR* df for ad scheme ------------------------------------------------------------------------- */ -void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, - FFT_SCALAR*** u_pa_1, FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, - FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, - FFT_SCALAR*** u_pa_2, FFT_SCALAR*** v0_pa_2, FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, - FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) - +void PPPMDisp:: +poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, + FFT_SCALAR*** u_pa_1, FFT_SCALAR*** v0_pa_1, + FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, + FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, + FFT_SCALAR*** u_pa_2, FFT_SCALAR*** v0_pa_2, + FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, + FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) { int i,j,k,n; double eng; @@ -5152,8 +5204,8 @@ void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, double scaleinv = 1.0/(nx_pppm_6*ny_pppm_6*nz_pppm_6); // transform charge/dispersion density (r -> k) - // only one tansform required when energies and pressures do not - // need to be calculated + // only one tansform required when energies and pressures not needed + if (eflag_global + vflag_global == 0) { n = 0; for (i = 0; i < nfft_6; i++) { @@ -5163,8 +5215,9 @@ void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, fft1_6->compute(work1_6,work1_6,1); } - // two transforms are required when energies and pressures are - // calculated + + // two transforms are required when energies and pressures are calculated + else { n = 0; for (i = 0; i < nfft_6; i++) { @@ -5182,7 +5235,8 @@ void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, if (vflag_global) { n = 0; for (i = 0; i < nfft_6; i++) { - eng = 2 * s2 * greensfn_6[i] * (work1_6[n]*work2_6[n+1] - work1_6[n+1]*work2_6[n]); + eng = 2 * s2 * greensfn_6[i] * + (work1_6[n]*work2_6[n+1] - work1_6[n+1]*work2_6[n]); for (j = 0; j < 6; j++) virial_6[j] += eng*vg_6[i][j]; if (eflag_global)energy_6 += eng; n += 2; @@ -5226,8 +5280,10 @@ void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, u_pa_2[k][j][i] = work2_6[n++]; } - if (vflag_atom) poisson_2s_peratom(v0_pa_1, v1_pa_1, v2_pa_1, v3_pa_1, v4_pa_1, v5_pa_1, - v0_pa_2, v1_pa_2, v2_pa_2, v3_pa_2, v4_pa_2, v5_pa_2); + if (vflag_atom) poisson_2s_peratom(v0_pa_1, v1_pa_1, v2_pa_1, + v3_pa_1, v4_pa_1, v5_pa_1, + v0_pa_2, v1_pa_2, v2_pa_2, + v3_pa_2, v4_pa_2, v5_pa_2); } /* ---------------------------------------------------------------------- @@ -5235,10 +5291,11 @@ void PPPMDisp::poisson_2s_ad(FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, for ad scheme ------------------------------------------------------------------------- */ -void PPPMDisp::poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, - FFT_SCALAR*** u_pa_1, FFT_SCALAR*** u_pa_2, - FFT_SCALAR**** v0_pa, FFT_SCALAR**** v1_pa, FFT_SCALAR**** v2_pa, - FFT_SCALAR**** v3_pa, FFT_SCALAR**** v4_pa, FFT_SCALAR**** v5_pa) +void PPPMDisp:: +poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* dfft_2, + FFT_SCALAR*** u_pa_1, FFT_SCALAR*** u_pa_2, + FFT_SCALAR**** v0_pa, FFT_SCALAR**** v1_pa, FFT_SCALAR**** v2_pa, + FFT_SCALAR**** v3_pa, FFT_SCALAR**** v4_pa, FFT_SCALAR**** v5_pa) { int i,j,k,n; double eng; @@ -5246,8 +5303,8 @@ void PPPMDisp::poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* d double scaleinv = 1.0/(nx_pppm_6*ny_pppm_6*nz_pppm_6); // transform charge/dispersion density (r -> k) - // only one tansform required when energies and pressures do not - // need to be calculated + // only one tansform required when energies and pressures not needed + if (eflag_global + vflag_global == 0) { n = 0; for (i = 0; i < nfft_6; i++) { @@ -5257,8 +5314,9 @@ void PPPMDisp::poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* d fft1_6->compute(work1_6,work1_6,1); } - // two transforms are required when energies and pressures are - // calculated + + // two transforms are required when energies and pressures are calculated + else { n = 0; for (i = 0; i < nfft_6; i++) { @@ -5276,7 +5334,9 @@ void PPPMDisp::poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* d if (vflag_global) { n = 0; for (i = 0; i < nfft_6; i++) { - eng = s2 * greensfn_6[i] * (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); + eng = s2 * greensfn_6[i] * + (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); for (j = 0; j < 6; j++) virial_6[j] += eng*vg_6[i][j]; if (eflag_global)energy_6 += eng; n += 2; @@ -5285,11 +5345,15 @@ void PPPMDisp::poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* d n = 0; for (i = 0; i < nfft_6; i++) { energy_6 += - s2 * greensfn_6[i] * (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); + s2 * greensfn_6[i] * + (B[n1]*(work1_6[n]*work1_6[n] + work1_6[n+1]*work1_6[n+1]) + + B[n2]*(work2_6[n]*work2_6[n] + work2_6[n+1]*work2_6[n+1])); n += 2; } } + // unify the two transformed vectors for efficient calculations later + for ( i = 0; i < 2*nfft_6; i++) { work1_6[i] += work2_6[i]; } @@ -5329,12 +5393,14 @@ void PPPMDisp::poisson_none_ad(int n1, int n2, FFT_SCALAR* dfft_1, FFT_SCALAR* d Fourier Transform for per atom virial calculations ------------------------------------------------------------------------- */ -void PPPMDisp::poisson_2s_peratom(FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, - FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, - FFT_SCALAR*** v0_pa_2, FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, - FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) +void PPPMDisp:: +poisson_2s_peratom(FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, + FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, + FFT_SCALAR*** v0_pa_2, FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, + FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) { //Compute first virial term v0 + int n, i, j, k; n = 0; @@ -5454,11 +5520,16 @@ void PPPMDisp::poisson_2s_peratom(FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, Fourier Transform for per atom virial calculations ------------------------------------------------------------------------- */ -void PPPMDisp::poisson_none_peratom(int n1, int n2, - FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, FFT_SCALAR*** v2_pa_1, - FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, FFT_SCALAR*** v5_pa_1, - FFT_SCALAR*** v0_pa_2, FFT_SCALAR*** v1_pa_2, FFT_SCALAR*** v2_pa_2, - FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, FFT_SCALAR*** v5_pa_2) +void PPPMDisp:: +poisson_none_peratom(int n1, int n2, + FFT_SCALAR*** v0_pa_1, FFT_SCALAR*** v1_pa_1, + FFT_SCALAR*** v2_pa_1, + FFT_SCALAR*** v3_pa_1, FFT_SCALAR*** v4_pa_1, + FFT_SCALAR*** v5_pa_1, + FFT_SCALAR*** v0_pa_2, FFT_SCALAR*** v1_pa_2, + FFT_SCALAR*** v2_pa_2, + FFT_SCALAR*** v3_pa_2, FFT_SCALAR*** v4_pa_2, + FFT_SCALAR*** v5_pa_2) { //Compute first virial term v0 int n, i, j, k; @@ -5946,7 +6017,6 @@ void PPPMDisp::fieldforce_g_ad() sf += sf_coeff_6[5]*sin(4*MY_PI*s3); sf *= 2*lj*lj; if (slabflag != 2) f[i][2] += ekz*lj - sf; - } } @@ -6259,17 +6329,21 @@ void PPPMDisp::fieldforce_a_ad() sf = sf_coeff_6[0]*sin(2*MY_PI*s1); sf += sf_coeff_6[1]*sin(4*MY_PI*s1); sf *= 4*lj0*lj6 + 4*lj1*lj5 + 4*lj2*lj4 + 2*lj3*lj3; - f[i][0] += lj0*ekx0 + lj1*ekx1 + lj2*ekx2 + lj3*ekx3 + lj4*ekx4 + lj5*ekx5 + lj6*ekx6 - sf; + f[i][0] += lj0*ekx0 + lj1*ekx1 + lj2*ekx2 + lj3*ekx3 + + lj4*ekx4 + lj5*ekx5 + lj6*ekx6 - sf; sf = sf_coeff_6[2]*sin(2*MY_PI*s2); sf += sf_coeff_6[3]*sin(4*MY_PI*s2); sf *= 4*lj0*lj6 + 4*lj1*lj5 + 4*lj2*lj4 + 2*lj3*lj3; - f[i][1] += lj0*eky0 + lj1*eky1 + lj2*eky2 + lj3*eky3 + lj4*eky4 + lj5*eky5 + lj6*eky6 - sf; + f[i][1] += lj0*eky0 + lj1*eky1 + lj2*eky2 + lj3*eky3 + + lj4*eky4 + lj5*eky5 + lj6*eky6 - sf; sf = sf_coeff_6[4]*sin(2*MY_PI*s3); sf += sf_coeff_6[5]*sin(4*MY_PI*s3); sf *= 4*lj0*lj6 + 4*lj1*lj5 + 4*lj2*lj4 + 2*lj3*lj3; - if (slabflag != 2) f[i][2] += lj0*ekz0 + lj1*ekz1 + lj2*ekz2 + lj3*ekz3 + lj4*ekz4 + lj5*ekz5 + lj6*ekz6 - sf; + if (slabflag != 2) + f[i][2] += lj0*ekz0 + lj1*ekz1 + + lj2*ekz2 + lj3*ekz3 + lj4*ekz4 + lj5*ekz5 + lj6*ekz6 - sf; } } @@ -6709,8 +6783,10 @@ void PPPMDisp::fieldforce_none_peratom() pack values to buf to send to another proc ------------------------------------------------------------------------- */ -void PPPMDisp::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDisp::pack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; switch (flag) { @@ -7213,7 +7289,6 @@ void PPPMDisp::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) } break; } - } } @@ -7221,8 +7296,10 @@ void PPPMDisp::pack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's own values from buf and set own ghost values ------------------------------------------------------------------------- */ -void PPPMDisp::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDisp::unpack_forward_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; switch (flag) { @@ -7725,7 +7802,6 @@ void PPPMDisp::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) } break; } - } } @@ -7733,8 +7809,10 @@ void PPPMDisp::unpack_forward(int flag, FFT_SCALAR *buf, int nlist, int *list) pack ghost values into buf to send to another proc ------------------------------------------------------------------------- */ -void PPPMDisp::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDisp::pack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; //Coulomb interactions @@ -7787,8 +7865,10 @@ void PPPMDisp::pack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) unpack another proc's ghost values from buf and add to own values ------------------------------------------------------------------------- */ -void PPPMDisp::unpack_reverse(int flag, FFT_SCALAR *buf, int nlist, int *list) +void PPPMDisp::unpack_reverse_grid(int flag, void *vbuf, int nlist, int *list) { + FFT_SCALAR *buf = (FFT_SCALAR *) vbuf; + int n = 0; //Coulomb interactions @@ -8172,6 +8252,7 @@ int PPPMDisp::timing_3d(int n, double &time3d) double PPPMDisp::memory_usage() { double bytes = nmax*3 * sizeof(double); + int mixing = 1; int diff = 3; //depends on differentiation int per = 7; //depends on per atom calculations @@ -8190,17 +8271,23 @@ double PPPMDisp::memory_usage() bytes += 6 * nfft_both * sizeof(double); // vg bytes += nfft_both * sizeof(double); // greensfn bytes += nfft_both * 3 * sizeof(FFT_SCALAR); // density_FFT, work1, work2 - if (cg) bytes += cg->memory_usage(); } if (function[1] + function[2] + function[3]) { int nbrick = (nxhi_out_6-nxlo_out_6+1) * (nyhi_out_6-nylo_out_6+1) * (nzhi_out_6-nzlo_out_6+1); - bytes += (1 + diff + per ) * nbrick * sizeof(FFT_SCALAR) * mixing; // density_brick + vd_brick + per atom bricks + // density_brick + vd_brick + per atom bricks + bytes += (1 + diff + per ) * nbrick * sizeof(FFT_SCALAR) * mixing; bytes += 6 * nfft_both_6 * sizeof(double); // vg bytes += nfft_both_6 * sizeof(double); // greensfn - bytes += nfft_both_6 * (mixing + 2) * sizeof(FFT_SCALAR); // density_FFT, work1, work2 - if (cg_6) bytes += cg_6->memory_usage(); + // density_FFT, work1, work2 + bytes += nfft_both_6 * (mixing + 2) * sizeof(FFT_SCALAR); } + + // four GridComm bufs + + bytes += (ngc_buf1 + ngc_buf2) * npergrid * sizeof(FFT_SCALAR); + bytes += (ngc6_buf1 + ngc6_buf2) * npergrid6 * sizeof(FFT_SCALAR); + return bytes; } diff --git a/src/KSPACE/pppm_disp.h b/src/KSPACE/pppm_disp.h index 130671fa28..37170478b0 100644 --- a/src/KSPACE/pppm_disp.h +++ b/src/KSPACE/pppm_disp.h @@ -42,7 +42,6 @@ typedef double FFT_SCALAR; namespace LAMMPS_NS { - #define EWALD_MAXORDER 6 #define EWALD_FUNCS 4 @@ -190,15 +189,14 @@ Variables needed for calculating the 1/r and 1/r^6 potential FFT_SCALAR *work1,*work2; FFT_SCALAR *work1_6, *work2_6; - class FFT3d *fft1,*fft2 ; - class FFT3d *fft1_6, *fft2_6; - class Remap *remap; - class Remap *remap_6; - class GridComm *cg; - class GridComm *cg_peratom; - class GridComm *cg_6; - class GridComm *cg_peratom_6; + class FFT3d *fft1_6,*fft2_6; + class Remap *remap,*remap_6; + class GridComm *gc,*gc6; + + FFT_SCALAR *gc_buf1,*gc_buf2,*gc6_buf1,*gc6_buf2; + int ngc_buf1,ngc_buf2,npergrid; + int ngc6_buf1,ngc6_buf2,npergrid6; int **part2grid; // storage for particle -> grid mapping int **part2grid_6; @@ -257,7 +255,6 @@ Variables needed for calculating the 1/r and 1/r^6 potential void compute_gf_denom(double*, int); double gf_denom(double, double, double, double*, int); - void compute_sf_precoeff(int, int, int, int, int, int, int, int, int, int, @@ -268,7 +265,6 @@ Variables needed for calculating the 1/r and 1/r^6 potential void compute_gf_6(); void compute_sf_coeff_6(); - virtual void particle_map(double, double, double, double, int **, int, int, int, int, int, @@ -295,8 +291,10 @@ Variables needed for calculating the 1/r and 1/r^6 potential int, int, int, double&, double *, double *, double *, double *, double *, double *, double *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, double *, double **, double **, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, double *, double **, double **, + FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); virtual void poisson_ad(FFT_SCALAR*, FFT_SCALAR*, @@ -317,14 +315,18 @@ Variables needed for calculating the 1/r and 1/r^6 potential virtual void poisson_2s_ik(FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); virtual void poisson_2s_ad(FFT_SCALAR *, FFT_SCALAR *, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, + FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***); virtual void poisson_2s_peratom(FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, @@ -339,9 +341,11 @@ Variables needed for calculating the 1/r and 1/r^6 potential virtual void poisson_none_ik(int, int, FFT_SCALAR *, FFT_SCALAR *, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, FFT_SCALAR ***, - FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, + FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, + FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****, FFT_SCALAR ****); - virtual void poisson_none_peratom(int, int, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, + virtual void poisson_none_peratom(int, int, + FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***, FFT_SCALAR***); @@ -369,10 +373,10 @@ Variables needed for calculating the 1/r and 1/r^6 potential // grid communication - void pack_forward(int, FFT_SCALAR *, int, int *); - void unpack_forward(int, FFT_SCALAR *, int, int *); - void pack_reverse(int, FFT_SCALAR *, int, int *); - void unpack_reverse(int, FFT_SCALAR *, int, int *); + void pack_forward_grid(int, void *, int, int *); + void unpack_forward_grid(int, void *, int, int *); + void pack_reverse_grid(int, void *, int, int *); + void unpack_reverse_grid(int, void *, int, int *); }; } diff --git a/src/KSPACE/pppm_stagger.cpp b/src/KSPACE/pppm_stagger.cpp index d7466ee0d4..afdc97e374 100644 --- a/src/KSPACE/pppm_stagger.cpp +++ b/src/KSPACE/pppm_stagger.cpp @@ -50,7 +50,7 @@ enum{FORWARD_IK,FORWARD_AD,FORWARD_IK_PERATOM,FORWARD_AD_PERATOM}; PPPMStagger::PPPMStagger(LAMMPS *lmp) : PPPM(lmp), - gf_b2(NULL) + gf_b2(nullptr) { stagger_flag = 1; group_group_enable = 0; @@ -123,11 +123,7 @@ void PPPMStagger::compute(int eflag, int vflag) ev_init(eflag,vflag); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); // convert atoms from box to lamda coords @@ -160,7 +156,8 @@ void PPPMStagger::compute(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // compute potential gradient on my FFT grid and @@ -173,16 +170,22 @@ void PPPMStagger::compute(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - if (differentiation_flag == 1) cg->forward_comm(this,FORWARD_AD); - else cg->forward_comm(this,FORWARD_IK); + if (differentiation_flag == 1) + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); + else + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication if (evflag_atom) { if (differentiation_flag == 1 && vflag_atom) - cg_peratom->forward_comm(this,FORWARD_AD_PERATOM); + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); else if (differentiation_flag == 0) - cg_peratom->forward_comm(this,FORWARD_IK_PERATOM); + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } // calculate the force on my particles @@ -268,10 +271,16 @@ void PPPMStagger::compute(int eflag, int vflag) double PPPMStagger::compute_qopt() { - if (differentiation_flag == 1) - return compute_qopt_ad(); + if (differentiation_flag == 1) return compute_qopt_ad(); + + int k,l,m,nx,ny,nz; + double snx,sny,snz; + double cnx,cny,cnz; + double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; + double sum1,sum2,dot1,dot2; + double numerator,denominator; + double u1,u2,u3,sqk; - double qopt = 0.0; const double * const prd = domain->prd; const double xprd = prd[0]; @@ -282,77 +291,76 @@ double PPPMStagger::compute_qopt() const double unitky = (MY_2PI/yprd); const double unitkz = (MY_2PI/zprd_slab); - double snx,sny,snz; - double cnx,cny,cnz; - double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; - double sum1,sum2,dot1,dot2; - double numerator,denominator; - double u1,u2,u3,sqk; - - int k,l,m,nx,ny,nz,kper,lper,mper; - const int nbx = 2; const int nby = 2; const int nbz = 2; const int twoorder = 2*order; - for (m = nzlo_fft; m <= nzhi_fft; m++) { - mper = m - nz_pppm*(2*m/nz_pppm); + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point + + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + int nxy_pppm = nx_pppm * ny_pppm; + + double qopt = 0.0; + + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm; + l = (i/nx_pppm) % ny_pppm; + m = i / nxy_pppm; + + const int kper = k - nx_pppm*(2*k/nx_pppm); + const int lper = l - ny_pppm*(2*l/ny_pppm); + const int mper = m - nz_pppm*(2*m/nz_pppm); + + sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper); + if (sqk == 0.0) continue; + + snx = square(sin(0.5*unitkx*kper*xprd/nx_pppm)); + cnx = cos(0.5*unitkx*kper*xprd/nx_pppm); + sny = square(sin(0.5*unitky*lper*yprd/ny_pppm)); + cny = cos(0.5*unitky*lper*yprd/ny_pppm); snz = square(sin(0.5*unitkz*mper*zprd_slab/nz_pppm)); cnz = cos(0.5*unitkz*mper*zprd_slab/nz_pppm); - for (l = nylo_fft; l <= nyhi_fft; l++) { - lper = l - ny_pppm*(2*l/ny_pppm); - sny = square(sin(0.5*unitky*lper*yprd/ny_pppm)); - cny = cos(0.5*unitky*lper*yprd/ny_pppm); + numerator = MY_4PI/sqk; + denominator = 0.5*(gf_denom(snx,sny,snz) + gf_denom2(cnx,cny,cnz)); - for (k = nxlo_fft; k <= nxhi_fft; k++) { - kper = k - nx_pppm*(2*k/nx_pppm); - snx = square(sin(0.5*unitkx*kper*xprd/nx_pppm)); - cnx = cos(0.5*unitkx*kper*xprd/nx_pppm); + sum1 = sum2 = 0.0; - sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper); + for (nx = -nbx; nx <= nbx; nx++) { + qx = unitkx*(kper+nx_pppm*nx); + sx = exp(-0.25*square(qx/g_ewald)); + argx = 0.5*qx*xprd/nx_pppm; + wx = powsinxx(argx,twoorder); - if (sqk != 0.0) { - numerator = MY_4PI/sqk; - denominator = 0.5*(gf_denom(snx,sny,snz) + gf_denom2(cnx,cny,cnz)); - sum1 = 0.0; - sum2 = 0.0; + for (ny = -nby; ny <= nby; ny++) { + qy = unitky*(lper+ny_pppm*ny); + sy = exp(-0.25*square(qy/g_ewald)); + argy = 0.5*qy*yprd/ny_pppm; + wy = powsinxx(argy,twoorder); - for (nx = -nbx; nx <= nbx; nx++) { - qx = unitkx*(kper+nx_pppm*nx); - sx = exp(-0.25*square(qx/g_ewald)); - argx = 0.5*qx*xprd/nx_pppm; - wx = powsinxx(argx,twoorder); + for (nz = -nbz; nz <= nbz; nz++) { + qz = unitkz*(mper+nz_pppm*nz); + sz = exp(-0.25*square(qz/g_ewald)); + argz = 0.5*qz*zprd_slab/nz_pppm; + wz = powsinxx(argz,twoorder); - for (ny = -nby; ny <= nby; ny++) { - qy = unitky*(lper+ny_pppm*ny); - sy = exp(-0.25*square(qy/g_ewald)); - argy = 0.5*qy*yprd/ny_pppm; - wy = powsinxx(argy,twoorder); - - for (nz = -nbz; nz <= nbz; nz++) { - qz = unitkz*(mper+nz_pppm*nz); - sz = exp(-0.25*square(qz/g_ewald)); - argz = 0.5*qz*zprd_slab/nz_pppm; - wz = powsinxx(argz,twoorder); - - dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz; - dot2 = qx*qx + qy*qy + qz*qz; - u1 = sx*sy*sz; - u2 = wx*wy*wz; - u3 = numerator*u1*u2*dot1; - sum1 += u1*u1*MY_4PI*MY_4PI/dot2; - sum2 += u3*u3/dot2; - } - } - } - qopt += sum1 - sum2/denominator; + dot1 = unitkx*kper*qx + unitky*lper*qy + unitkz*mper*qz; + dot2 = qx*qx + qy*qy + qz*qz; + u1 = sx*sy*sz; + u2 = wx*wy*wz; + u3 = numerator*u1*u2*dot1; + sum1 += u1*u1*MY_4PI*MY_4PI/dot2; + sum2 += u3*u3/dot2; } } } + + qopt += sum1 - sum2/denominator; } + double qopt_all; MPI_Allreduce(&qopt,&qopt_all,1,MPI_DOUBLE,MPI_SUM,world); return qopt_all; @@ -364,7 +372,11 @@ double PPPMStagger::compute_qopt() double PPPMStagger::compute_qopt_ad() { - double qopt = 0.0; + int k,l,m,nx,ny,nz; + double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; + double sum1,sum2,sum3,sum4,sum5,sum6,dot2; + double u1,u2,sqk; + const double * const prd = domain->prd; const double xprd = prd[0]; @@ -375,72 +387,68 @@ double PPPMStagger::compute_qopt_ad() const double unitky = (MY_2PI/yprd); const double unitkz = (MY_2PI/zprd_slab); - double argx,argy,argz,wx,wy,wz,sx,sy,sz,qx,qy,qz; - double sum1,sum2,sum3,sum4,sum5,sum6,dot2; - double u1,u2,sqk; - - int k,l,m,nx,ny,nz,kper,lper,mper; - const int nbx = 2; const int nby = 2; const int nbz = 2; const int twoorder = 2*order; - for (m = nzlo_fft; m <= nzhi_fft; m++) { - mper = m - nz_pppm*(2*m/nz_pppm); + // loop over entire FFT grid + // each proc calculates contributions from every Pth grid point - for (l = nylo_fft; l <= nyhi_fft; l++) { - lper = l - ny_pppm*(2*l/ny_pppm); + bigint ngridtotal = (bigint) nx_pppm * ny_pppm * nz_pppm; + int nxy_pppm = nx_pppm * ny_pppm; - for (k = nxlo_fft; k <= nxhi_fft; k++) { - kper = k - nx_pppm*(2*k/nx_pppm); + double qopt = 0.0; - sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper); + for (bigint i = me; i < ngridtotal; i += nprocs) { + k = i % nx_pppm; + l = (i/nx_pppm) % ny_pppm; + m = i / nxy_pppm; - if (sqk != 0.0) { - sum1 = 0.0; - sum2 = 0.0; - sum3 = 0.0; - sum4 = 0.0; - sum5 = 0.0; - sum6 = 0.0; + const int kper = k - nx_pppm*(2*k/nx_pppm); + const int lper = l - ny_pppm*(2*l/ny_pppm); + const int mper = m - nz_pppm*(2*m/nz_pppm); - for (nx = -nbx; nx <= nbx; nx++) { - qx = unitkx*(kper+nx_pppm*nx); - sx = exp(-0.25*square(qx/g_ewald)); - argx = 0.5*qx*xprd/nx_pppm; - wx = powsinxx(argx,twoorder); + sqk = square(unitkx*kper) + square(unitky*lper) + square(unitkz*mper); + if (sqk == 0.0) continue; - for (ny = -nby; ny <= nby; ny++) { - qy = unitky*(lper+ny_pppm*ny); - sy = exp(-0.25*square(qy/g_ewald)); - argy = 0.5*qy*yprd/ny_pppm; - wy = powsinxx(argy,twoorder); + sum1 = sum2 = sum3 = sum4 = sum5 = sum6 = 0.0; - for (nz = -nbz; nz <= nbz; nz++) { - qz = unitkz*(mper+nz_pppm*nz); - sz = exp(-0.25*square(qz/g_ewald)); - argz = 0.5*qz*zprd_slab/nz_pppm; - wz = powsinxx(argz,twoorder); + for (nx = -nbx; nx <= nbx; nx++) { + qx = unitkx*(kper+nx_pppm*nx); + sx = exp(-0.25*square(qx/g_ewald)); + argx = 0.5*qx*xprd/nx_pppm; + wx = powsinxx(argx,twoorder); - dot2 = qx*qx + qy*qy + qz*qz; - u1 = sx*sy*sz; - u2 = wx*wy*wz; - sum1 += u1*u1/dot2*MY_4PI*MY_4PI; - sum2 += u1*u1*u2*u2*MY_4PI*MY_4PI; - sum3 += u2; - sum4 += dot2*u2; - sum5 += u2*powint(-1.0,nx+ny+nz); - sum6 += dot2*u2*powint(-1.0,nx+ny+nz); - } - } - } - qopt += sum1 - sum2/(0.5*(sum3*sum4 + sum5*sum6)); + for (ny = -nby; ny <= nby; ny++) { + qy = unitky*(lper+ny_pppm*ny); + sy = exp(-0.25*square(qy/g_ewald)); + argy = 0.5*qy*yprd/ny_pppm; + wy = powsinxx(argy,twoorder); + + for (nz = -nbz; nz <= nbz; nz++) { + qz = unitkz*(mper+nz_pppm*nz); + sz = exp(-0.25*square(qz/g_ewald)); + argz = 0.5*qz*zprd_slab/nz_pppm; + wz = powsinxx(argz,twoorder); + + dot2 = qx*qx + qy*qy + qz*qz; + u1 = sx*sy*sz; + u2 = wx*wy*wz; + sum1 += u1*u1/dot2*MY_4PI*MY_4PI; + sum2 += u1*u1*u2*u2*MY_4PI*MY_4PI; + sum3 += u2; + sum4 += dot2*u2; + sum5 += u2*powint(-1.0,nx+ny+nz); + sum6 += dot2*u2*powint(-1.0,nx+ny+nz); } } } + + qopt += sum1 - sum2/(0.5*(sum3*sum4 + sum5*sum6)); } + double qopt_all; MPI_Allreduce(&qopt,&qopt_all,1,MPI_DOUBLE,MPI_SUM,world); return qopt_all; diff --git a/src/KSPACE/pppm_stagger.h b/src/KSPACE/pppm_stagger.h index 80161a3707..2f4cf9fb9b 100644 --- a/src/KSPACE/pppm_stagger.h +++ b/src/KSPACE/pppm_stagger.h @@ -50,7 +50,6 @@ class PPPMStagger : public PPPM { virtual void fieldforce_ad(); virtual void fieldforce_peratom(); - inline double gf_denom2(const double &x, const double &y, const double &z) const { diff --git a/src/KSPACE/remap.cpp b/src/KSPACE/remap.cpp index d4cfdea2b0..41ba1a6782 100644 --- a/src/KSPACE/remap.cpp +++ b/src/KSPACE/remap.cpp @@ -252,7 +252,7 @@ struct remap_plan_3d *remap_3d_create_plan( // allocate memory for plan data struct plan = (struct remap_plan_3d *) malloc(sizeof(struct remap_plan_3d)); - if (plan == NULL) return NULL; + if (plan == nullptr) return nullptr; plan->usecollective = usecollective; // store parameters in local data structs @@ -284,10 +284,10 @@ struct remap_plan_3d *remap_3d_create_plan( // combine output extents across all procs inarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (inarray == NULL) return NULL; + if (inarray == nullptr) return nullptr; outarray = (struct extent_3d *) malloc(nprocs*sizeof(struct extent_3d)); - if (outarray == NULL) return NULL; + if (outarray == nullptr) return nullptr; MPI_Allgather(&out,sizeof(struct extent_3d),MPI_BYTE, outarray,sizeof(struct extent_3d),MPI_BYTE,comm); @@ -313,8 +313,8 @@ struct remap_plan_3d *remap_3d_create_plan( plan->packplan = (struct pack_plan_3d *) malloc(nsend*sizeof(struct pack_plan_3d)); - if (plan->send_offset == NULL || plan->send_size == NULL || - plan->send_proc == NULL || plan->packplan == NULL) return NULL; + if (plan->send_offset == nullptr || plan->send_size == nullptr || + plan->send_proc == nullptr || plan->packplan == nullptr) return nullptr; } // store send info, with self as last entry @@ -395,9 +395,9 @@ struct remap_plan_3d *remap_3d_create_plan( plan->unpackplan = (struct pack_plan_3d *) malloc(nrecv*sizeof(struct pack_plan_3d)); - if (plan->recv_offset == NULL || plan->recv_size == NULL || - plan->recv_proc == NULL || plan->recv_bufloc == NULL || - plan->request == NULL || plan->unpackplan == NULL) return NULL; + if (plan->recv_offset == nullptr || plan->recv_size == nullptr || + plan->recv_proc == nullptr || plan->recv_bufloc == nullptr || + plan->request == nullptr || plan->unpackplan == nullptr) return nullptr; } // store recv info, with self as last entry @@ -456,7 +456,7 @@ struct remap_plan_3d *remap_3d_create_plan( // create sub-comm rank list if (plan->usecollective) { - plan->commringlist = NULL; + plan->commringlist = nullptr; // merge recv and send rank lists // ask Steve Plimpton about method to more accurately determine @@ -578,7 +578,7 @@ struct remap_plan_3d *remap_3d_create_plan( // find biggest send message (not including self) and malloc space for it - plan->sendbuf = NULL; + plan->sendbuf = nullptr; size = 0; for (nsend = 0; nsend < plan->nsend; nsend++) @@ -586,20 +586,20 @@ struct remap_plan_3d *remap_3d_create_plan( if (size) { plan->sendbuf = (FFT_SCALAR *) malloc(size*sizeof(FFT_SCALAR)); - if (plan->sendbuf == NULL) return NULL; + if (plan->sendbuf == nullptr) return nullptr; } // if requested, allocate internal scratch space for recvs, // only need it if I will receive any data (including self) - plan->scratch = NULL; + plan->scratch = nullptr; if (memory == 1) { if (nrecv > 0) { plan->scratch = (FFT_SCALAR *) malloc(nqty*out.isize*out.jsize*out.ksize * sizeof(FFT_SCALAR)); - if (plan->scratch == NULL) return NULL; + if (plan->scratch == nullptr) return nullptr; } } @@ -643,7 +643,7 @@ void remap_3d_destroy_plan(struct remap_plan_3d *plan) MPI_Comm_free(&plan->comm); if (plan->usecollective) { - if (plan->commringlist != NULL) + if (plan->commringlist != nullptr) free(plan->commringlist); } diff --git a/src/KSPACE/remap_wrap.cpp b/src/KSPACE/remap_wrap.cpp index 7929cd053c..de85339474 100644 --- a/src/KSPACE/remap_wrap.cpp +++ b/src/KSPACE/remap_wrap.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "remap_wrap.h" -#include + #include "error.h" using namespace LAMMPS_NS; @@ -31,7 +31,7 @@ Remap::Remap(LAMMPS *lmp, MPI_Comm comm, in_ilo,in_ihi,in_jlo,in_jhi,in_klo,in_khi, out_ilo,out_ihi,out_jlo,out_jhi,out_klo,out_khi, nqty,permute,memory,precision,usecollective); - if (plan == NULL) error->one(FLERR,"Could not create 3d remap plan"); + if (plan == nullptr) error->one(FLERR,"Could not create 3d remap plan"); } /* ---------------------------------------------------------------------- */ diff --git a/src/LATTE/fix_latte.cpp b/src/LATTE/fix_latte.cpp index 7d4e89272d..055e62c418 100644 --- a/src/LATTE/fix_latte.cpp +++ b/src/LATTE/fix_latte.cpp @@ -74,10 +74,10 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : thermo_virial = 1; // store ID of compute pe/atom used to generate Coulomb potential for LATTE - // NULL means LATTE will compute Coulombic potential + // null pointer means LATTE will compute Coulombic potential coulomb = 0; - id_pe = NULL; + id_pe = nullptr; if (strcmp(arg[3],"NULL") != 0) { coulomb = 1; @@ -97,8 +97,8 @@ FixLatte::FixLatte(LAMMPS *lmp, int narg, char **arg) : // initializations nmax = 0; - qpotential = NULL; - flatte = NULL; + qpotential = nullptr; + flatte = nullptr; latte_energy = 0.0; } @@ -136,7 +136,7 @@ void FixLatte::init() error->all(FLERR,"Fix latte requires 3d problem"); if (coulomb) { - if (atom->q_flag == 0 || force->pair == NULL || force->kspace == NULL) + if (atom->q_flag == 0 || force->pair == nullptr || force->kspace == nullptr) error->all(FLERR,"Fix latte cannot compute Coulomb potential"); int ipe = modify->find_compute(id_pe); @@ -154,7 +154,7 @@ void FixLatte::init() // create qpotential & flatte if needed // for now, assume nlocal will never change - if (coulomb && qpotential == NULL) { + if (coulomb && qpotential == nullptr) { memory->create(qpotential,atom->nlocal,"latte:qpotential"); memory->create(flatte,atom->nlocal,3,"latte:flatte"); } diff --git a/src/MANYBODY/fix_qeq_comb.cpp b/src/MANYBODY/fix_qeq_comb.cpp index 31d62f0645..bddec9e2ec 100644 --- a/src/MANYBODY/fix_qeq_comb.cpp +++ b/src/MANYBODY/fix_qeq_comb.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_comb.h" -#include + #include #include #include "pair_comb.h" @@ -30,8 +30,8 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -39,7 +39,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(NULL), comb(NULL), comb3(NULL), qf(NULL), q1(NULL), q2(NULL) + fp(nullptr), comb(nullptr), comb3(nullptr), qf(nullptr), q1(nullptr), q2(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix qeq/comb command"); @@ -49,8 +49,8 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), respa_level_support = 1; ilevel_respa = 0; - nevery = force->inumeric(FLERR,arg[3]); - precision = force->numeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + precision = utils::numeric(FLERR,arg[4],false,lmp); if (nevery <= 0 || precision <= 0.0) error->all(FLERR,"Illegal fix qeq/comb command"); @@ -65,7 +65,7 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), if (iarg+2 > narg) error->all(FLERR,"Illegal fix qeq/comb command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,std::string("Cannot open fix qeq/comb file ") + arg[iarg+1]); } @@ -85,8 +85,8 @@ FixQEQComb::FixQEQComb(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) qf[i] = 0.0; - comb = NULL; - comb3 = NULL; + comb = nullptr; + comb3 = nullptr; comm_forward = 1; } @@ -121,7 +121,7 @@ void FixQEQComb::init() comb = (PairComb *) force->pair_match("^comb",0); comb3 = (PairComb3 *) force->pair_match("^comb3",0); - if (comb == NULL && comb3 == NULL) + if (comb == nullptr && comb3 == nullptr) error->all(FLERR,"Must use pair_style comb or comb3 with fix qeq/comb"); if (utils::strmatch(update->integrate_style,"^respa")) { diff --git a/src/MANYBODY/pair_adp.cpp b/src/MANYBODY/pair_adp.cpp index 74fd03e080..f293e51906 100644 --- a/src/MANYBODY/pair_adp.cpp +++ b/src/MANYBODY/pair_adp.cpp @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #include "pair_adp.h" -#include + #include -#include + #include #include "atom.h" #include "force.h" @@ -28,7 +28,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -41,25 +41,25 @@ PairADP::PairADP(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; nmax = 0; - rho = NULL; - fp = NULL; - mu = NULL; - lambda = NULL; - map = NULL; + rho = nullptr; + fp = nullptr; + mu = nullptr; + lambda = nullptr; + map = nullptr; - setfl = NULL; + setfl = nullptr; - frho = NULL; - rhor = NULL; - z2r = NULL; - u2r = NULL; - w2r = NULL; + frho = nullptr; + rhor = nullptr; + z2r = nullptr; + u2r = nullptr; + w2r = nullptr; - frho_spline = NULL; - rhor_spline = NULL; - z2r_spline = NULL; - u2r_spline = NULL; - w2r_spline = NULL; + frho_spline = nullptr; + rhor_spline = nullptr; + z2r_spline = nullptr; + u2r_spline = nullptr; + w2r_spline = nullptr; // set comm size needed by this Pair @@ -465,7 +465,7 @@ void PairADP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -610,7 +610,7 @@ void PairADP::read_file(char *filename) reader.next_dvector(&file->w2r[i][j][1], file->nr); } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/MANYBODY/pair_airebo.cpp b/src/MANYBODY/pair_airebo.cpp index 085905192e..470dbd838d 100644 --- a/src/MANYBODY/pair_airebo.cpp +++ b/src/MANYBODY/pair_airebo.cpp @@ -21,23 +21,23 @@ ------------------------------------------------------------------------- */ #include "pair_airebo.h" -#include -#include -#include + #include "atom.h" -#include "neighbor.h" -#include "force.h" #include "comm.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "my_page.h" +#include "error.h" +#include "force.h" #include "math_special.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "my_page.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "potential_file_reader.h" -#include "fmt/format.h" +#include "text_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathSpecial; @@ -61,13 +61,13 @@ PairAIREBO::PairAIREBO(LAMMPS *lmp) pvector = new double[nextra]; maxlocal = 0; - REBO_numneigh = NULL; - REBO_firstneigh = NULL; - ipage = NULL; + REBO_numneigh = nullptr; + REBO_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - nC = nH = NULL; - map = NULL; + nC = nH = nullptr; + map = nullptr; manybody_flag = 1; sigwid = 0.84; @@ -154,15 +154,15 @@ void PairAIREBO::settings(int narg, char **arg) if (narg != 1 && narg != 3 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - cutlj = force->numeric(FLERR,arg[0]); + cutlj = utils::numeric(FLERR,arg[0],false,lmp); if (narg >= 3) { - ljflag = force->inumeric(FLERR,arg[1]); - torflag = force->inumeric(FLERR,arg[2]); + ljflag = utils::inumeric(FLERR,arg[1],false,lmp); + torflag = utils::inumeric(FLERR,arg[2],false,lmp); } if (narg == 4) { sigcut = cutlj; - sigmin = force->numeric(FLERR,arg[3]); + sigmin = utils::numeric(FLERR,arg[3],false,lmp); sigwid = sigcut - sigmin; } @@ -185,7 +185,7 @@ void PairAIREBO::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to C and H - // map[i] = which element (0,1) the Ith atom type is, -1 if NULL + // map[i] = which element (0,1) the Ith atom type is, -1 if "NULL" for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -245,7 +245,7 @@ void PairAIREBO::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -3634,12 +3634,12 @@ void PairAIREBO::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { std::string msg = fmt::format("ERROR reading {} section in {} file\n" "REASON: {}\n", current_section, potential_name, e.what()); error->one(FLERR, msg); - } catch (FileReaderException & fre) { + } catch (FileReaderException &fre) { error->one(FLERR, fre.what()); std::string msg = fmt::format("ERROR reading {} section in {} file\n" "REASON: {}\n", diff --git a/src/MANYBODY/pair_airebo.h b/src/MANYBODY/pair_airebo.h index ab02533cec..7539cc5e7f 100644 --- a/src/MANYBODY/pair_airebo.h +++ b/src/MANYBODY/pair_airebo.h @@ -40,7 +40,7 @@ class PairAIREBO : public Pair { enum { AIREBO, REBO_2, AIREBO_M }; // for telling class variants apart in shared code protected: - int *map; // 0 (C), 1 (H), or -1 (NULL) for each type + int *map; // 0 (C), 1 (H), or -1 ("NULL") for each type int variant; int ljflag,torflag; // 0/1 if LJ/Morse,torsion terms included diff --git a/src/MANYBODY/pair_atm.cpp b/src/MANYBODY/pair_atm.cpp index e943b6bfdd..a6bf0ac400 100644 --- a/src/MANYBODY/pair_atm.cpp +++ b/src/MANYBODY/pair_atm.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_atm.h" -#include + #include #include "atom.h" #include "citeme.h" @@ -27,7 +27,7 @@ #include "neigh_list.h" #include "neigh_request.h" #include "neighbor.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -210,8 +210,8 @@ void PairATM::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - cut_triple = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_triple = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- @@ -224,11 +224,11 @@ void PairATM::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi,klo,khi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); - force->bounds(FLERR,arg[2],atom->ntypes,klo,khi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); + utils::bounds(FLERR,arg[2],1,atom->ntypes,klo,khi,error); - double nu_one = force->numeric(FLERR,arg[3]); + double nu_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -311,10 +311,10 @@ void PairATM::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) for (k = j; k <= atom->ntypes; k++) { - if (me == 0) utils::sfread(FLERR,&nu[i][j][k],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nu[i][j][k],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&nu[i][j][k],1,MPI_DOUBLE,0,world); } } @@ -339,8 +339,8 @@ void PairATM::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_triple,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_triple,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_triple,1,MPI_DOUBLE,0,world); diff --git a/src/MANYBODY/pair_bop.cpp b/src/MANYBODY/pair_bop.cpp index 5b080c9f0e..c47fc656c1 100644 --- a/src/MANYBODY/pair_bop.cpp +++ b/src/MANYBODY/pair_bop.cpp @@ -33,22 +33,21 @@ ------------------------------------------------------------------------- */ #include "pair_bop.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "potential_file_reader.h" +#include "text_file_reader.h" +#include "tokenizer.h" + #include #include -#include -#include -#include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" -#include "potential_file_reader.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -65,114 +64,114 @@ PairBOP::PairBOP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; allocated = 0; - BOP_index = NULL; - BOP_index3 = NULL; - BOP_total = NULL; - BOP_total3 = NULL; - map = NULL; - pi_a = NULL; - pro_delta = NULL; - pi_delta = NULL; - pi_p = NULL; - pi_c = NULL; - r1 = NULL; - sigma_r0 = NULL; - pi_r0 = NULL; - phi_r0 = NULL; - sigma_rc = NULL; - pi_rc = NULL; - phi_rc = NULL; - sigma_beta0 = NULL; - pi_beta0 = NULL; - phi0 = NULL; - sigma_n = NULL; - pi_n = NULL; - phi_m = NULL; - sigma_nc = NULL; - pi_nc = NULL; - phi_nc = NULL; - pro = NULL; - sigma_delta = NULL; - sigma_c = NULL; - sigma_a = NULL; - sigma_f = NULL; - sigma_k = NULL; - small3 = NULL; - rcut = NULL; - rcut3 = NULL; - rcutsq = NULL; - rcutsq3 = NULL; - dr = NULL; - rdr = NULL; - dr3 = NULL; - rdr3 = NULL; - disij = NULL; - rij = NULL; - neigh_index = NULL; - neigh_index3 = NULL; - neigh_flag = NULL; - neigh_flag3 = NULL; - cosAng = NULL; - betaS = NULL; - dBetaS = NULL; - betaP = NULL; - dBetaP = NULL; - repul = NULL; - dRepul = NULL; - itypeSigBk = NULL; - itypePiBk = NULL; - pBetaS = NULL; - pBetaS1 = NULL; - pBetaS2 = NULL; - pBetaS3 = NULL; - pBetaS4 = NULL; - pBetaS5 = NULL; - pBetaS6 = NULL; - pLong = NULL; - pLong1 = NULL; - pLong2 = NULL; - pLong3 = NULL; - pLong4 = NULL; - pLong5 = NULL; - pLong6 = NULL; - pBetaP = NULL; - pBetaP1 = NULL; - pBetaP2 = NULL; - pBetaP3 = NULL; - pBetaP4 = NULL; - pBetaP5 = NULL; - pBetaP6 = NULL; - pRepul = NULL; - pRepul1 = NULL; - pRepul2 = NULL; - pRepul3 = NULL; - pRepul4 = NULL; - pRepul5 = NULL; - pRepul6 = NULL; - FsigBO = NULL; - FsigBO1 = NULL; - FsigBO2 = NULL; - FsigBO3 = NULL; - FsigBO4 = NULL; - FsigBO5 = NULL; - FsigBO6 = NULL; - rcmin = NULL; - rcmax = NULL; - rcmaxp = NULL; - setflag = NULL; - cutsq = NULL; - cutghost = NULL; + BOP_index = nullptr; + BOP_index3 = nullptr; + BOP_total = nullptr; + BOP_total3 = nullptr; + map = nullptr; + pi_a = nullptr; + pro_delta = nullptr; + pi_delta = nullptr; + pi_p = nullptr; + pi_c = nullptr; + r1 = nullptr; + sigma_r0 = nullptr; + pi_r0 = nullptr; + phi_r0 = nullptr; + sigma_rc = nullptr; + pi_rc = nullptr; + phi_rc = nullptr; + sigma_beta0 = nullptr; + pi_beta0 = nullptr; + phi0 = nullptr; + sigma_n = nullptr; + pi_n = nullptr; + phi_m = nullptr; + sigma_nc = nullptr; + pi_nc = nullptr; + phi_nc = nullptr; + pro = nullptr; + sigma_delta = nullptr; + sigma_c = nullptr; + sigma_a = nullptr; + sigma_f = nullptr; + sigma_k = nullptr; + small3 = nullptr; + rcut = nullptr; + rcut3 = nullptr; + rcutsq = nullptr; + rcutsq3 = nullptr; + dr = nullptr; + rdr = nullptr; + dr3 = nullptr; + rdr3 = nullptr; + disij = nullptr; + rij = nullptr; + neigh_index = nullptr; + neigh_index3 = nullptr; + neigh_flag = nullptr; + neigh_flag3 = nullptr; + cosAng = nullptr; + betaS = nullptr; + dBetaS = nullptr; + betaP = nullptr; + dBetaP = nullptr; + repul = nullptr; + dRepul = nullptr; + itypeSigBk = nullptr; + itypePiBk = nullptr; + pBetaS = nullptr; + pBetaS1 = nullptr; + pBetaS2 = nullptr; + pBetaS3 = nullptr; + pBetaS4 = nullptr; + pBetaS5 = nullptr; + pBetaS6 = nullptr; + pLong = nullptr; + pLong1 = nullptr; + pLong2 = nullptr; + pLong3 = nullptr; + pLong4 = nullptr; + pLong5 = nullptr; + pLong6 = nullptr; + pBetaP = nullptr; + pBetaP1 = nullptr; + pBetaP2 = nullptr; + pBetaP3 = nullptr; + pBetaP4 = nullptr; + pBetaP5 = nullptr; + pBetaP6 = nullptr; + pRepul = nullptr; + pRepul1 = nullptr; + pRepul2 = nullptr; + pRepul3 = nullptr; + pRepul4 = nullptr; + pRepul5 = nullptr; + pRepul6 = nullptr; + FsigBO = nullptr; + FsigBO1 = nullptr; + FsigBO2 = nullptr; + FsigBO3 = nullptr; + FsigBO4 = nullptr; + FsigBO5 = nullptr; + FsigBO6 = nullptr; + rcmin = nullptr; + rcmax = nullptr; + rcmaxp = nullptr; + setflag = nullptr; + cutsq = nullptr; + cutghost = nullptr; - gfunc = NULL; - gfunc1 = NULL; - gfunc2 = NULL; - gfunc3 = NULL; - gfunc4 = NULL; - gfunc5 = NULL; - gfunc6 = NULL; - gpara = NULL; - bt_sg=NULL; - bt_pi=NULL; + gfunc = nullptr; + gfunc1 = nullptr; + gfunc2 = nullptr; + gfunc3 = nullptr; + gfunc4 = nullptr; + gfunc5 = nullptr; + gfunc6 = nullptr; + gpara = nullptr; + bt_sg=nullptr; + bt_pi=nullptr; } /* ---------------------------------------------------------------------- @@ -5224,9 +5223,9 @@ void _noopt PairBOP::read_table(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); - } catch (FileReaderException & fre) { + } catch (FileReaderException &fre) { error->one(FLERR, fre.what()); } } @@ -5628,12 +5627,12 @@ void PairBOP::memory_theta_destroy() memory->destroy(neigh_flag3); memory->destroy(neigh_index); memory->destroy(neigh_index3); - itypeSigBk = NULL; - itypePiBk = NULL; - neigh_flag = NULL; - neigh_flag3 = NULL; - neigh_index = NULL; - neigh_index3 = NULL; + itypeSigBk = nullptr; + itypePiBk = nullptr; + neigh_flag = nullptr; + neigh_flag3 = nullptr; + neigh_index = nullptr; + neigh_index3 = nullptr; if(otfly==0) { memory->destroy(cosAng); memory->destroy(dcAng); @@ -5681,7 +5680,7 @@ void PairBOP::grow_pi(int n1, int n2) } } memory->destroy(bt_pi); - bt_pi=NULL; + bt_pi=nullptr; bt_pi = (B_PI *) memory->smalloc(n2*sizeof(B_PI),"BOP:bt_pi"); for(i=0;idestroy(bt_sg); - bt_sg=NULL; + bt_sg=nullptr; bt_sg = (B_SG *) memory->smalloc(n2*sizeof(B_SG),"BOP:bt_sg"); for(i=0;i + #include -#include + #include #include "atom.h" #include "comm.h" @@ -34,7 +34,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -55,30 +55,30 @@ PairComb::PairComb(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nmax = 0; - NCo = NULL; - bbij = NULL; - map = NULL; - esm = NULL; + NCo = nullptr; + bbij = nullptr; + map = nullptr; + esm = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; - intype = NULL; - fafb = NULL; - dfafb = NULL; - ddfafb = NULL; - phin = NULL; - dphin = NULL; - erpaw = NULL; + intype = nullptr; + fafb = nullptr; + dfafb = nullptr; + ddfafb = nullptr; + phin = nullptr; + dphin = nullptr; + erpaw = nullptr; - sht_num = NULL; - sht_first = NULL; + sht_num = nullptr; + sht_first = nullptr; - ipage = NULL; + ipage = nullptr; pgsize = oneatom = 0; // set comm size needed by this Pair @@ -456,7 +456,7 @@ void PairComb::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -465,7 +465,7 @@ void PairComb::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -542,7 +542,7 @@ void PairComb::init_style() //for (i = 0; i < modify->nfix; i++) // if (strcmp(modify->fix[i]->style,"qeq") == 0) break; //if (i < modify->nfix) fixqeq = (FixQEQ *) modify->fix[i]; - //else fixqeq = NULL; + //else fixqeq = nullptr; // need a full neighbor list @@ -554,7 +554,7 @@ void PairComb::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -679,7 +679,7 @@ void PairComb::read_file(char *file) params[nparams].cml2 = values.next_double(); params[nparams].coulcut = values.next_double(); params[nparams].hfocor = values.next_double(); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_comb3.cpp b/src/MANYBODY/pair_comb3.cpp index 385e3ca35d..534fcdafd5 100644 --- a/src/MANYBODY/pair_comb3.cpp +++ b/src/MANYBODY/pair_comb3.cpp @@ -18,25 +18,24 @@ ------------------------------------------------------------------------- */ #include "pair_comb3.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "my_page.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" #include "group.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "my_page.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" #include "potential_file_reader.h" -#include "fmt/format.h" +#include "text_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -55,38 +54,38 @@ PairComb3::PairComb3(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; nmax = 0; - NCo = NULL; - bbij = NULL; - map = NULL; - esm = NULL; + NCo = nullptr; + bbij = nullptr; + map = nullptr; + esm = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; - intype = NULL; - afb = NULL; - dafb = NULL; - fafb = NULL; - dfafb = NULL; - ddfafb = NULL; - phin = NULL; - dphin = NULL; - erpaw = NULL; - vvdw = NULL; - vdvdw = NULL; - dpl = NULL; - xcctmp = NULL; - xchtmp = NULL; - xcotmp = NULL; + intype = nullptr; + afb = nullptr; + dafb = nullptr; + fafb = nullptr; + dfafb = nullptr; + ddfafb = nullptr; + phin = nullptr; + dphin = nullptr; + erpaw = nullptr; + vvdw = nullptr; + vdvdw = nullptr; + dpl = nullptr; + xcctmp = nullptr; + xchtmp = nullptr; + xcotmp = nullptr; - sht_num = NULL; - sht_first = NULL; + sht_num = nullptr; + sht_first = nullptr; - ipage = NULL; + ipage = nullptr; pgsize = oneatom = 0; cflag = 0; @@ -193,7 +192,7 @@ void PairComb3::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -202,7 +201,7 @@ void PairComb3::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -278,7 +277,7 @@ void PairComb3::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -451,9 +450,9 @@ void PairComb3::read_lib() } } - } catch (FileReaderException & fre) { + } catch (FileReaderException &fre) { error->one(FLERR, fre.what()); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } @@ -641,7 +640,7 @@ void PairComb3::read_file(char *file) params[nparams].addrep = values.next_double(); params[nparams].pcross = values.next_double(); params[nparams].powermint = int(params[nparams].powerm); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_eam.cpp b/src/MANYBODY/pair_eam.cpp index da2385237b..9325716110 100644 --- a/src/MANYBODY/pair_eam.cpp +++ b/src/MANYBODY/pair_eam.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "pair_eam.h" -#include + #include -#include + #include #include "atom.h" #include "force.h" @@ -28,7 +28,7 @@ #include "memory.h" #include "error.h" #include "update.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -46,26 +46,26 @@ PairEAM::PairEAM(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nmax = 0; - rho = NULL; - fp = NULL; - numforce = NULL; - map = NULL; - type2frho = NULL; + rho = nullptr; + fp = nullptr; + numforce = nullptr; + map = nullptr; + type2frho = nullptr; nfuncfl = 0; - funcfl = NULL; + funcfl = nullptr; - setfl = NULL; - fs = NULL; + setfl = nullptr; + fs = nullptr; - frho = NULL; - rhor = NULL; - z2r = NULL; - scale = NULL; + frho = nullptr; + rhor = nullptr; + z2r = nullptr; + scale = nullptr; - frho_spline = NULL; - rhor_spline = NULL; - z2r_spline = NULL; + frho_spline = nullptr; + rhor_spline = nullptr; + z2r_spline = nullptr; // set comm size needed by this Pair @@ -90,8 +90,8 @@ PairEAM::~PairEAM() memory->destroy(cutsq); delete [] map; delete [] type2frho; - map = NULL; - type2frho = NULL; + map = nullptr; + type2frho = nullptr; memory->destroy(type2rhor); memory->destroy(type2z2r); memory->destroy(scale); @@ -105,7 +105,7 @@ PairEAM::~PairEAM() memory->destroy(funcfl[i].zr); } memory->sfree(funcfl); - funcfl = NULL; + funcfl = nullptr; } if (setfl) { @@ -116,7 +116,7 @@ PairEAM::~PairEAM() memory->destroy(setfl->rhor); memory->destroy(setfl->z2r); delete setfl; - setfl = NULL; + setfl = nullptr; } if (fs) { @@ -127,7 +127,7 @@ PairEAM::~PairEAM() memory->destroy(fs->rhor); memory->destroy(fs->z2r); delete fs; - fs = NULL; + fs = nullptr; } memory->destroy(frho); @@ -378,8 +378,8 @@ void PairEAM::coeff(int narg, char **arg) // parse pair of atom types int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read funcfl file if hasn't already been read // store filename in Funcfl data struct @@ -506,7 +506,7 @@ void PairEAM::read_file(char *filename) for (int j = 1; j <= file->nr; ++j) file->zr[j] *= sqrt_conv; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } @@ -937,5 +937,5 @@ void *PairEAM::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/MANYBODY/pair_eam_alloy.cpp b/src/MANYBODY/pair_eam_alloy.cpp index 3e33d40ee4..5307edee1a 100644 --- a/src/MANYBODY/pair_eam_alloy.cpp +++ b/src/MANYBODY/pair_eam_alloy.cpp @@ -16,16 +16,15 @@ ------------------------------------------------------------------------- */ #include "pair_eam_alloy.h" -#include -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include using namespace LAMMPS_NS; @@ -71,7 +70,7 @@ void PairEAMAlloy::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -185,7 +184,7 @@ void PairEAMAlloy::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/MANYBODY/pair_eam_cd.cpp b/src/MANYBODY/pair_eam_cd.cpp index 01c8a3fffe..01ec02dd2e 100644 --- a/src/MANYBODY/pair_eam_cd.cpp +++ b/src/MANYBODY/pair_eam_cd.cpp @@ -18,9 +18,9 @@ ------------------------------------------------------------------------- */ #include "pair_eam_cd.h" -#include + #include -#include + #include #include "atom.h" #include "force.h" @@ -29,8 +29,8 @@ #include "memory.h" #include "error.h" #include "tokenizer.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; @@ -44,9 +44,9 @@ PairEAMCD::PairEAMCD(LAMMPS *lmp, int _cdeamVersion) restartinfo = 0; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); - rhoB = NULL; - D_values = NULL; - hcoeff = NULL; + rhoB = nullptr; + D_values = nullptr; + hcoeff = nullptr; // Set communication buffer sizes needed by this pair style. @@ -504,15 +504,15 @@ void PairEAMCD::read_h_coeff(char *filename) char line[MAXLINE]; char nextline[MAXLINE]; int convert_flag = unit_convert_flag; - fptr = force->open_potential(filename, &convert_flag); - if (fptr == NULL) + fptr = utils::open_potential(filename, lmp, &convert_flag); + if (fptr == nullptr) error->one(FLERR,fmt::format("Cannot open EAMCD potential file {}", filename)); // h coefficients are stored at the end of the file. // Skip to last line of file. - while(fgets(nextline, MAXLINE, fptr) != NULL) { + while(fgets(nextline, MAXLINE, fptr) != nullptr) { strcpy(line, nextline); } diff --git a/src/MANYBODY/pair_eam_cd.h b/src/MANYBODY/pair_eam_cd.h index ee84fb09c5..8f306d1019 100644 --- a/src/MANYBODY/pair_eam_cd.h +++ b/src/MANYBODY/pair_eam_cd.h @@ -49,7 +49,7 @@ public: /// Reports the memory usage of this pair style to LAMMPS. double memory_usage(); - void *extract(const char *, int &) { return NULL; } + void *extract(const char *, int &) { return nullptr; } /// Parses the coefficients of the h polynomial from the end of the EAM file. void read_h_coeff(char* filename); diff --git a/src/MANYBODY/pair_eam_fs.cpp b/src/MANYBODY/pair_eam_fs.cpp index fbe6bee529..6c721c81f8 100644 --- a/src/MANYBODY/pair_eam_fs.cpp +++ b/src/MANYBODY/pair_eam_fs.cpp @@ -16,16 +16,15 @@ ------------------------------------------------------------------------- */ #include "pair_eam_fs.h" -#include -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include using namespace LAMMPS_NS; @@ -71,7 +70,7 @@ void PairEAMFS::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -190,7 +189,7 @@ void PairEAMFS::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/MANYBODY/pair_eim.cpp b/src/MANYBODY/pair_eim.cpp index 4321bd9f8b..620fa88d32 100644 --- a/src/MANYBODY/pair_eim.cpp +++ b/src/MANYBODY/pair_eim.cpp @@ -16,20 +16,18 @@ ------------------------------------------------------------------------- */ #include "pair_eim.h" -#include + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" +#include "tokenizer.h" + #include #include -#include "atom.h" -#include "force.h" -#include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" -#include "potential_file_reader.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -43,25 +41,25 @@ PairEIM::PairEIM(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); - setfl = NULL; + setfl = nullptr; nmax = 0; - rho = NULL; - fp = NULL; - map = NULL; + rho = nullptr; + fp = nullptr; + map = nullptr; nelements = 0; - elements = NULL; + elements = nullptr; - negativity = NULL; - q0 = NULL; - cutforcesq = NULL; - Fij = NULL; - Gij = NULL; - phiij = NULL; + negativity = nullptr; + q0 = nullptr; + cutforcesq = nullptr; + Fij = nullptr; + Gij = nullptr; + phiij = nullptr; - Fij_spline = NULL; - Gij_spline = NULL; - phiij_spline = NULL; + Fij_spline = nullptr; + Gij_spline = nullptr; + phiij_spline = nullptr; // set comm size needed by this Pair @@ -390,7 +388,7 @@ void PairEIM::coeff(int narg, char **arg) read_file(arg[2+nelements]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3 + nelements; i < narg; i++) { m = i - (3+nelements) + 1; @@ -1061,10 +1059,10 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp, } int unit_convert = auto_convert; - FILE *fp = force->open_potential(filename.c_str(), &unit_convert); + FILE *fp = utils::open_potential(filename, lmp, &unit_convert); conversion_factor = utils::get_conversion_factor(utils::ENERGY,unit_convert); - if (fp == NULL) { + if (fp == nullptr) { error->one(FLERR, fmt::format("cannot open eim potential file {}", filename)); } @@ -1073,7 +1071,7 @@ EIMPotentialFileReader::EIMPotentialFileReader(LAMMPS *lmp, fclose(fp); } -std::pair EIMPotentialFileReader::get_pair(const std::string & a, const std::string & b) { +std::pair EIMPotentialFileReader::get_pair(const std::string &a, const std::string &b) { if (a < b) { return std::make_pair(a, b); } diff --git a/src/MANYBODY/pair_eim.h b/src/MANYBODY/pair_eim.h index 1266ffd242..75f8ea6bea 100644 --- a/src/MANYBODY/pair_eim.h +++ b/src/MANYBODY/pair_eim.h @@ -21,7 +21,7 @@ PairStyle(eim,PairEIM) #define LMP_PAIR_EIM_H #include "pair.h" -#include + #include namespace LAMMPS_NS { diff --git a/src/MANYBODY/pair_gw.cpp b/src/MANYBODY/pair_gw.cpp index 0928d14696..4b5901fd81 100644 --- a/src/MANYBODY/pair_gw.cpp +++ b/src/MANYBODY/pair_gw.cpp @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #include "pair_gw.h" -#include + #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -29,7 +29,7 @@ #include "comm.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -51,11 +51,11 @@ PairGW::PairGW(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; } /* ---------------------------------------------------------------------- @@ -283,7 +283,7 @@ void PairGW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -292,7 +292,7 @@ void PairGW::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -370,7 +370,7 @@ double PairGW::init_one(int i, int j) void PairGW::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -443,7 +443,7 @@ void PairGW::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_gw_zbl.cpp b/src/MANYBODY/pair_gw_zbl.cpp index 1a2bf5eb5d..a66c9bb795 100644 --- a/src/MANYBODY/pair_gw_zbl.cpp +++ b/src/MANYBODY/pair_gw_zbl.cpp @@ -17,21 +17,18 @@ ------------------------------------------------------------------------- */ #include "pair_gw_zbl.h" -#include -#include -#include -#include -#include "atom.h" -#include "update.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" -#include "potential_file_reader.h" +#include "comm.h" +#include "error.h" #include "math_const.h" +#include "memory.h" +#include "potential_file_reader.h" +#include "tokenizer.h" +#include "update.h" + +#include +#include + using namespace LAMMPS_NS; using namespace MathConst; @@ -64,7 +61,7 @@ PairGWZBL::PairGWZBL(LAMMPS *lmp) : PairGW(lmp) void PairGWZBL::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 @@ -141,7 +138,7 @@ void PairGWZBL::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_lcbop.cpp b/src/MANYBODY/pair_lcbop.cpp index 7c29f44afc..760ffc8cd8 100644 --- a/src/MANYBODY/pair_lcbop.cpp +++ b/src/MANYBODY/pair_lcbop.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lcbop.h" -#include + #include #include #include "atom.h" @@ -29,7 +29,7 @@ #include "my_page.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -48,13 +48,13 @@ PairLCBOP::PairLCBOP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; maxlocal = 0; - SR_numneigh = NULL; - SR_firstneigh = NULL; - ipage = NULL; + SR_numneigh = nullptr; + SR_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - N = NULL; - M = NULL; + N = nullptr; + M = nullptr; } /* ---------------------------------------------------------------------- @@ -135,8 +135,8 @@ void PairLCBOP::coeff(int narg, char **arg) if (strcmp(arg[0],"*") != 0 || strcmp(arg[1],"*") != 0) error->all(FLERR,"Incorrect args for pair coefficients"); - // read args that map atom types to C and NULL - // map[i] = which element (0 for C) the Ith atom type is, -1 if NULL + // read args that map atom types to C and "NULL" + // map[i] = which element (0 for C) the Ith atom type is, -1 if "NULL" for (int i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -193,7 +193,7 @@ void PairLCBOP::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -969,8 +969,8 @@ void PairLCBOP::read_file(char *filename) // read file on proc 0 if (me == 0) { - FILE *fp = force->open_potential(filename); - if (fp == NULL) { + FILE *fp = utils::open_potential(filename,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open LCBOP potential file %s",filename); error->one(FLERR,str); diff --git a/src/MANYBODY/pair_lcbop.h b/src/MANYBODY/pair_lcbop.h index c7a7fab46d..dacbe74158 100644 --- a/src/MANYBODY/pair_lcbop.h +++ b/src/MANYBODY/pair_lcbop.h @@ -39,7 +39,7 @@ class PairLCBOP : public Pair { protected: int **pages; // neighbor list pages - int *map; // 0 (C) or -1 (NULL) for each type + int *map; // 0 (C) or -1 ("NULL") for each type int me; diff --git a/src/MANYBODY/pair_nb3b_harmonic.cpp b/src/MANYBODY/pair_nb3b_harmonic.cpp index dc537a7b58..6151c8ce22 100644 --- a/src/MANYBODY/pair_nb3b_harmonic.cpp +++ b/src/MANYBODY/pair_nb3b_harmonic.cpp @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #include "pair_nb3b_harmonic.h" -#include + #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -29,7 +29,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -50,11 +50,11 @@ PairNb3bHarmonic::PairNb3bHarmonic(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; } /* ---------------------------------------------------------------------- @@ -198,7 +198,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -207,7 +207,7 @@ void PairNb3bHarmonic::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -344,7 +344,7 @@ void PairNb3bHarmonic::read_file(char *file) params[nparams].cutoff = values.next_double(); if (unit_convert) params[nparams].k_theta *= conversion_factor; - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_polymorphic.cpp b/src/MANYBODY/pair_polymorphic.cpp index 502580719a..5520cad274 100644 --- a/src/MANYBODY/pair_polymorphic.cpp +++ b/src/MANYBODY/pair_polymorphic.cpp @@ -17,21 +17,20 @@ ------------------------------------------------------------------------- */ #include "pair_polymorphic.h" -#include -#include -#include -#include + #include "atom.h" -#include "neighbor.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "neighbor.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; @@ -480,7 +479,7 @@ void PairPolymorphic::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -613,7 +612,7 @@ void PairPolymorphic::read_file(char *file) if ((ng == 0) || (nr == 0) || (nx == 0)) error->one(FLERR,"Error reading potential file header"); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR,"Potential file incompatible with this pair style version"); } @@ -632,7 +631,7 @@ void PairPolymorphic::read_file(char *file) p.cutsq = p.cut*p.cut; p.xi = values.next_double(); } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } @@ -910,7 +909,7 @@ void PairPolymorphic::write_tables(int npts) { char tag[6] = ""; if (comm->me != 0) sprintf(tag,"%d",comm->me); - FILE* fp = NULL; + FILE* fp = nullptr; double xmin,xmax,x,uf,vf,wf,pf,gf,ff,ufp,vfp,wfp,pfp,gfp,ffp; char line[MAXLINE]; for (int i = 0; i < nelements; i++) { diff --git a/src/MANYBODY/pair_polymorphic.h b/src/MANYBODY/pair_polymorphic.h index 18956699d7..2593905b22 100644 --- a/src/MANYBODY/pair_polymorphic.h +++ b/src/MANYBODY/pair_polymorphic.h @@ -22,7 +22,6 @@ PairStyle(polymorphic,PairPolymorphic) #include "pair.h" #include -#include namespace LAMMPS_NS { diff --git a/src/MANYBODY/pair_sw.cpp b/src/MANYBODY/pair_sw.cpp index f6b5a803d2..aff333902f 100644 --- a/src/MANYBODY/pair_sw.cpp +++ b/src/MANYBODY/pair_sw.cpp @@ -16,21 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_sw.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" #include "error.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "utils.h" -#include "tokenizer.h" +#include "neighbor.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; @@ -47,14 +46,14 @@ PairSW::PairSW(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -263,7 +262,7 @@ void PairSW::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -272,7 +271,7 @@ void PairSW::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -415,7 +414,7 @@ void PairSW::read_file(char *file) params[nparams].powerp = values.next_double(); params[nparams].powerq = values.next_double(); params[nparams].tol = values.next_double(); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_tersoff.cpp b/src/MANYBODY/pair_tersoff.cpp index c57740963f..d6d5307ef7 100644 --- a/src/MANYBODY/pair_tersoff.cpp +++ b/src/MANYBODY/pair_tersoff.cpp @@ -16,24 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff.h" -#include -#include -#include -#include -#include "atom.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" -#include "potential_file_reader.h" +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "force.h" #include "math_const.h" #include "math_special.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "potential_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -52,14 +50,14 @@ PairTersoff::PairTersoff(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -308,7 +306,7 @@ void PairTersoff::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -317,7 +315,7 @@ void PairTersoff::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -468,7 +466,7 @@ void PairTersoff::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_tersoff_mod.cpp b/src/MANYBODY/pair_tersoff_mod.cpp index d1ab6f2034..b319977a09 100644 --- a/src/MANYBODY/pair_tersoff_mod.cpp +++ b/src/MANYBODY/pair_tersoff_mod.cpp @@ -17,20 +17,17 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_mod.h" -#include -#include -#include -#include -#include "atom.h" -#include "force.h" + #include "comm.h" +#include "error.h" #include "math_const.h" #include "math_special.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "tokenizer.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -124,7 +121,7 @@ void PairTersoffMOD::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_tersoff_mod_c.cpp b/src/MANYBODY/pair_tersoff_mod_c.cpp index ff8916cdcd..8fac2ff162 100644 --- a/src/MANYBODY/pair_tersoff_mod_c.cpp +++ b/src/MANYBODY/pair_tersoff_mod_c.cpp @@ -16,18 +16,15 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_mod_c.h" -#include -#include -#include -#include -#include "atom.h" -#include "force.h" + #include "comm.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; @@ -117,7 +114,7 @@ void PairTersoffMODC::read_file(char *file) params[nparams].bigb *= conversion_factor; params[nparams].c0 *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_tersoff_zbl.cpp b/src/MANYBODY/pair_tersoff_zbl.cpp index 141cb45964..ef6b1079ff 100644 --- a/src/MANYBODY/pair_tersoff_zbl.cpp +++ b/src/MANYBODY/pair_tersoff_zbl.cpp @@ -17,21 +17,18 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_zbl.h" -#include -#include -#include -#include -#include "atom.h" -#include "update.h" -#include "force.h" + #include "comm.h" -#include "memory.h" #include "error.h" #include "math_const.h" #include "math_special.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -143,7 +140,7 @@ void PairTersoffZBL::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_vashishta.cpp b/src/MANYBODY/pair_vashishta.cpp index 815854a34b..61828949c7 100644 --- a/src/MANYBODY/pair_vashishta.cpp +++ b/src/MANYBODY/pair_vashishta.cpp @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #include "pair_vashishta.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -29,7 +29,7 @@ #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -48,15 +48,15 @@ PairVashishta::PairVashishta(LAMMPS *lmp) : Pair(lmp) unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; r0max = 0.0; maxshort = 10; - neighshort = NULL; + neighshort = nullptr; } /* ---------------------------------------------------------------------- @@ -269,7 +269,7 @@ void PairVashishta::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -278,7 +278,7 @@ void PairVashishta::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -432,7 +432,7 @@ void PairVashishta::read_file(char *file) params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MANYBODY/pair_vashishta_table.cpp b/src/MANYBODY/pair_vashishta_table.cpp index bf39183b9d..8939efc78f 100644 --- a/src/MANYBODY/pair_vashishta_table.cpp +++ b/src/MANYBODY/pair_vashishta_table.cpp @@ -30,8 +30,8 @@ using namespace LAMMPS_NS; PairVashishtaTable::PairVashishtaTable(LAMMPS *lmp) : PairVashishta(lmp) { - forceTable = NULL; - potentialTable = NULL; + forceTable = nullptr; + potentialTable = nullptr; } /* ---------------------------------------------------------------------- @@ -230,8 +230,8 @@ void PairVashishtaTable::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - ntable = force->inumeric(FLERR,arg[0]); - tabinner = force->numeric(FLERR,arg[1]); + ntable = utils::inumeric(FLERR,arg[0],false,lmp); + tabinner = utils::numeric(FLERR,arg[1],false,lmp); if (tabinner <= 0.0) error->all(FLERR,"Illegal inner cutoff for tabulation"); @@ -252,8 +252,8 @@ void PairVashishtaTable::create_tables() { memory->destroy(forceTable); memory->destroy(potentialTable); - forceTable = NULL; - potentialTable = NULL; + forceTable = nullptr; + potentialTable = nullptr; tabinnersq = tabinner*tabinner; diff --git a/src/MC/fix_atom_swap.cpp b/src/MC/fix_atom_swap.cpp index 9a4a0b6a7f..217646b92d 100644 --- a/src/MC/fix_atom_swap.cpp +++ b/src/MC/fix_atom_swap.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_atom_swap.h" -#include + #include #include #include @@ -50,10 +50,10 @@ using namespace FixConst; FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), type_list(NULL), mu(NULL), qtype(NULL), - sqrt_mass_ratio(NULL), local_swap_iatom_list(NULL), - local_swap_jatom_list(NULL), local_swap_atom_list(NULL), - random_equal(NULL), random_unequal(NULL), c_pe(NULL) + idregion(nullptr), type_list(nullptr), mu(nullptr), qtype(nullptr), + sqrt_mass_ratio(nullptr), local_swap_iatom_list(nullptr), + local_swap_jatom_list(nullptr), local_swap_atom_list(nullptr), + random_equal(nullptr), random_unequal(nullptr), c_pe(nullptr) { if (narg < 10) error->all(FLERR,"Illegal fix atom/swap command"); @@ -68,10 +68,10 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : // required args - nevery = force->inumeric(FLERR,arg[3]); - ncycles = force->inumeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); - double temperature = force->numeric(FLERR,arg[6]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + ncycles = utils::inumeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); + double temperature = utils::numeric(FLERR,arg[6],false,lmp); beta = 1.0/(force->boltz*temperature); if (nevery <= 0) error->all(FLERR,"Illegal fix atom/swap command"); @@ -105,9 +105,9 @@ FixAtomSwap::FixAtomSwap(LAMMPS *lmp, int narg, char **arg) : nswap_successes = 0.0; atom_swap_nmax = 0; - local_swap_atom_list = NULL; - local_swap_iatom_list = NULL; - local_swap_jatom_list = NULL; + local_swap_atom_list = nullptr; + local_swap_iatom_list = nullptr; + local_swap_jatom_list = nullptr; // set comm size needed by this Fix @@ -161,7 +161,7 @@ void FixAtomSwap::options(int narg, char **arg) while (iarg < narg) { if (isalpha(arg[iarg][0])) break; if (nswaptypes >= atom->ntypes) error->all(FLERR,"Illegal fix atom/swap command"); - type_list[nswaptypes] = force->numeric(FLERR,arg[iarg]); + type_list[nswaptypes] = utils::numeric(FLERR,arg[iarg],false,lmp); nswaptypes++; iarg++; } @@ -172,7 +172,7 @@ void FixAtomSwap::options(int narg, char **arg) if (isalpha(arg[iarg][0])) break; nmutypes++; if (nmutypes > atom->ntypes) error->all(FLERR,"Illegal fix atom/swap command"); - mu[nmutypes] = force->numeric(FLERR,arg[iarg]); + mu[nmutypes] = utils::numeric(FLERR,arg[iarg],false,lmp); iarg++; } } else error->all(FLERR,"Illegal fix atom/swap command"); diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 2e8200f751..a024bc20de 100644 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_bond_break.h" -#include + #include #include "update.h" #include "respa.h" @@ -33,15 +33,15 @@ using namespace FixConst; FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - partner(NULL), finalpartner(NULL), distsq(NULL), probability(NULL), - broken(NULL), copy(NULL), random(NULL) + partner(nullptr), finalpartner(nullptr), distsq(nullptr), probability(nullptr), + broken(nullptr), copy(nullptr), random(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix bond/break command"); MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix bond/break command"); force_reneighbor = 1; @@ -51,8 +51,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - btype = force->inumeric(FLERR,arg[4]); - cutoff = force->numeric(FLERR,arg[5]); + btype = utils::inumeric(FLERR,arg[4],false,lmp); + cutoff = utils::numeric(FLERR,arg[5],false,lmp); if (btype < 1 || btype > atom->nbondtypes) error->all(FLERR,"Invalid bond type in fix bond/break command"); @@ -69,8 +69,8 @@ FixBondBreak::FixBondBreak(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"prob") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/break command"); - fraction = force->numeric(FLERR,arg[iarg+1]); - seed = force->inumeric(FLERR,arg[iarg+2]); + fraction = utils::numeric(FLERR,arg[iarg+1],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (fraction < 0.0 || fraction > 1.0) error->all(FLERR,"Illegal fix bond/break command"); if (seed <= 0) error->all(FLERR,"Illegal fix bond/break command"); diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 9639832db9..ca34c8bfea 100644 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_bond_create.h" -#include + #include #include "update.h" #include "respa.h" @@ -40,14 +40,14 @@ using namespace MathConst; FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - bondcount(NULL), partner(NULL), finalpartner(NULL), distsq(NULL), - probability(NULL), created(NULL), copy(NULL), random(NULL), list(NULL) + bondcount(nullptr), partner(nullptr), finalpartner(nullptr), distsq(nullptr), + probability(nullptr), created(nullptr), copy(nullptr), random(nullptr), list(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix bond/create command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix bond/create command"); force_reneighbor = 1; @@ -57,10 +57,10 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - iatomtype = force->inumeric(FLERR,arg[4]); - jatomtype = force->inumeric(FLERR,arg[5]); - double cutoff = force->numeric(FLERR,arg[6]); - btype = force->inumeric(FLERR,arg[7]); + iatomtype = utils::inumeric(FLERR,arg[4],false,lmp); + jatomtype = utils::inumeric(FLERR,arg[5],false,lmp); + double cutoff = utils::numeric(FLERR,arg[6],false,lmp); + btype = utils::inumeric(FLERR,arg[7],false,lmp); if (iatomtype < 1 || iatomtype > atom->ntypes || jatomtype < 1 || jatomtype > atom->ntypes) @@ -90,49 +90,49 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"iparam") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command"); - imaxbond = force->inumeric(FLERR,arg[iarg+1]); - inewtype = force->inumeric(FLERR,arg[iarg+2]); + imaxbond = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + inewtype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (imaxbond < 0) error->all(FLERR,"Illegal fix bond/create command"); if (inewtype < 1 || inewtype > atom->ntypes) error->all(FLERR,"Invalid atom type in fix bond/create command"); iarg += 3; } else if (strcmp(arg[iarg],"jparam") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command"); - jmaxbond = force->inumeric(FLERR,arg[iarg+1]); - jnewtype = force->inumeric(FLERR,arg[iarg+2]); + jmaxbond = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + jnewtype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (jmaxbond < 0) error->all(FLERR,"Illegal fix bond/create command"); if (jnewtype < 1 || jnewtype > atom->ntypes) error->all(FLERR,"Invalid atom type in fix bond/create command"); iarg += 3; } else if (strcmp(arg[iarg],"prob") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create command"); - fraction = force->numeric(FLERR,arg[iarg+1]); - seed = force->inumeric(FLERR,arg[iarg+2]); + fraction = utils::numeric(FLERR,arg[iarg+1],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (fraction < 0.0 || fraction > 1.0) error->all(FLERR,"Illegal fix bond/create command"); if (seed <= 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 3; } else if (strcmp(arg[iarg],"atype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/create command"); - atype = force->inumeric(FLERR,arg[iarg+1]); + atype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"dtype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/create command"); - dtype = force->inumeric(FLERR,arg[iarg+1]); + dtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (dtype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"itype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/create command"); - itype = force->inumeric(FLERR,arg[iarg+1]); + itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (itype < 0) error->all(FLERR,"Illegal fix bond/create command"); iarg += 2; } else if (strcmp(arg[iarg],"aconstrain") == 0 && strcmp(style,"bond/create/angle") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix bond/create/angle command"); - amin = force->numeric(FLERR,arg[iarg+1]); - amax = force->inumeric(FLERR,arg[iarg+2]); + amin = utils::numeric(FLERR,arg[iarg+1],false,lmp); + amax = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (amin >= amax) error->all(FLERR,"Illegal fix bond/create/angle command"); if (amin < 0 || amin > 180) @@ -163,9 +163,9 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : // register with Atom class // bondcount values will be initialized in setup() - bondcount = NULL; + bondcount = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); countflag = 0; // set comm sizes needed by this fix @@ -177,11 +177,11 @@ FixBondCreate::FixBondCreate(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; maxcreate = 0; - created = NULL; + created = nullptr; // copy = special list for one atom // size = ms^2 + ms is sufficient @@ -204,7 +204,7 @@ FixBondCreate::~FixBondCreate() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete random; @@ -237,7 +237,7 @@ void FixBondCreate::init() // check cutoff for iatomtype,jatomtype - if (force->pair == NULL || cutsq > force->pair->cutsq[iatomtype][jatomtype]) + if (force->pair == nullptr || cutsq > force->pair->cutsq[iatomtype][jatomtype]) error->all(FLERR,"Fix bond/create cutoff is longer than pairwise cutoff"); // warn if more than one fix bond/create or also a fix bond/break diff --git a/src/MC/fix_bond_swap.cpp b/src/MC/fix_bond_swap.cpp index 8d3ff14f48..9b1f14516a 100644 --- a/src/MC/fix_bond_swap.cpp +++ b/src/MC/fix_bond_swap.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_bond_swap.h" -#include + #include #include #include "atom.h" @@ -52,14 +52,14 @@ static const char cite_fix_bond_swap[] = FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tflag(0), alist(NULL), id_temp(NULL), type(NULL), x(NULL), list(NULL), - temperature(NULL), random(NULL) + tflag(0), alist(nullptr), id_temp(nullptr), type(nullptr), x(nullptr), list(nullptr), + temperature(nullptr), random(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_swap); if (narg != 7) error->all(FLERR,"Illegal fix bond/swap command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix bond/swap command"); force_reneighbor = 1; @@ -69,13 +69,13 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - fraction = force->numeric(FLERR,arg[4]); - double cutoff = force->numeric(FLERR,arg[5]); + fraction = utils::numeric(FLERR,arg[4],false,lmp); + double cutoff = utils::numeric(FLERR,arg[5],false,lmp); cutsq = cutoff*cutoff; // initialize Marsaglia RNG with processor-unique seed - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); random = new RanMars(lmp,seed + comm->me); // error check @@ -96,7 +96,7 @@ FixBondSwap::FixBondSwap(LAMMPS *lmp, int narg, char **arg) : // initialize atom list nmax = 0; - alist = NULL; + alist = nullptr; naccept = foursome = 0; } @@ -130,7 +130,7 @@ void FixBondSwap::init() { // require an atom style with molecule IDs - if (atom->molecule == NULL) + if (atom->molecule == nullptr) error->all(FLERR, "Must use atom style with molecule IDs with fix bond/swap"); @@ -143,13 +143,13 @@ void FixBondSwap::init() // no dihedral or improper potentials allowed // special bonds must be 0 1 1 - if (force->pair == NULL || force->bond == NULL) + if (force->pair == nullptr || force->bond == nullptr) error->all(FLERR,"Fix bond/swap requires pair and bond styles"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support fix bond/swap"); - if (force->angle == NULL && atom->nangles > 0 && comm->me == 0) + if (force->angle == nullptr && atom->nangles > 0 && comm->me == 0) error->warning(FLERR,"Fix bond/swap will ignore defined angles"); if (force->dihedral || force->improper) diff --git a/src/MC/fix_gcmc.cpp b/src/MC/fix_gcmc.cpp index f977f59c53..4aa3821e65 100644 --- a/src/MC/fix_gcmc.cpp +++ b/src/MC/fix_gcmc.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_gcmc.h" -#include + #include #include #include "atom.h" @@ -66,14 +66,14 @@ enum{MOVEATOM,MOVEMOL}; // movemode FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), full_flag(0), ngroups(0), groupstrings(NULL), ngrouptypes(0), grouptypestrings(NULL), - grouptypebits(NULL), grouptypes(NULL), local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), - random_equal(NULL), random_unequal(NULL), - fixrigid(NULL), fixshake(NULL), idrigid(NULL), idshake(NULL) + idregion(nullptr), full_flag(0), ngroups(0), groupstrings(nullptr), ngrouptypes(0), grouptypestrings(nullptr), + grouptypebits(nullptr), grouptypes(nullptr), local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), + random_equal(nullptr), random_unequal(nullptr), + fixrigid(nullptr), fixshake(nullptr), idrigid(nullptr), idshake(nullptr) { if (narg < 11) error->all(FLERR,"Illegal fix gcmc command"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Fix gcmc does not (yet) work with atom_style template"); dynamic_group_allow = 1; @@ -87,14 +87,14 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : // required args - nevery = force->inumeric(FLERR,arg[3]); - nexchanges = force->inumeric(FLERR,arg[4]); - nmcmoves = force->inumeric(FLERR,arg[5]); - ngcmc_type = force->inumeric(FLERR,arg[6]); - seed = force->inumeric(FLERR,arg[7]); - reservoir_temperature = force->numeric(FLERR,arg[8]); - chemical_potential = force->numeric(FLERR,arg[9]); - displace = force->numeric(FLERR,arg[10]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nexchanges = utils::inumeric(FLERR,arg[4],false,lmp); + nmcmoves = utils::inumeric(FLERR,arg[5],false,lmp); + ngcmc_type = utils::inumeric(FLERR,arg[6],false,lmp); + seed = utils::inumeric(FLERR,arg[7],false,lmp); + reservoir_temperature = utils::numeric(FLERR,arg[8],false,lmp); + chemical_potential = utils::numeric(FLERR,arg[9],false,lmp); + displace = utils::numeric(FLERR,arg[10],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix gcmc command"); if (nexchanges < 0) error->all(FLERR,"Illegal fix gcmc command"); @@ -167,16 +167,16 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix gcmc molecule must have atom types"); if (ngcmc_type != 0) error->all(FLERR,"Atom type must be zero in fix gcmc mol command"); - if (onemols[imol]->qflag == 1 && atom->q == NULL) + if (onemols[imol]->qflag == 1 && atom->q == nullptr) error->all(FLERR,"Fix gcmc molecule has charges, but atom style does not"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix gcmc molecule template ID must be same " "as atom_style template ID"); onemols[imol]->check_attributes(0); } - if (charge_flag && atom->q == NULL) + if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix gcmc atom has charge, but atom style does not"); if (rigidflag && exchmode == EXCHATOM) @@ -219,7 +219,7 @@ FixGCMC::FixGCMC(LAMMPS *lmp, int narg, char **arg) : ninsertion_successes = 0.0; gcmc_nmax = 0; - local_gas_list = NULL; + local_gas_list = nullptr; } /* ---------------------------------------------------------------------- @@ -258,12 +258,12 @@ void FixGCMC::options(int narg, char **arg) full_flag = false; ngroups = 0; int ngroupsmax = 0; - groupstrings = NULL; + groupstrings = nullptr; ngrouptypes = 0; int ngrouptypesmax = 0; - grouptypestrings = NULL; - grouptypes = NULL; - grouptypebits = NULL; + grouptypestrings = nullptr; + grouptypes = nullptr; + grouptypebits = nullptr; energy_intra = 0.0; tfac_insert = 1.0; overlap_cutoffsq = 0.0; @@ -287,9 +287,9 @@ void FixGCMC::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"mcmoves") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix gcmc command"); - patomtrans = force->numeric(FLERR,arg[iarg+1]); - pmoltrans = force->numeric(FLERR,arg[iarg+2]); - pmolrotate = force->numeric(FLERR,arg[iarg+3]); + patomtrans = utils::numeric(FLERR,arg[iarg+1],false,lmp); + pmoltrans = utils::numeric(FLERR,arg[iarg+2],false,lmp); + pmolrotate = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (patomtrans < 0 || pmoltrans < 0 || pmolrotate < 0) error->all(FLERR,"Illegal fix gcmc command"); pmctot = patomtrans + pmoltrans + pmolrotate; @@ -308,21 +308,21 @@ void FixGCMC::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"maxangle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - max_rotation_angle = force->numeric(FLERR,arg[iarg+1]); + max_rotation_angle = utils::numeric(FLERR,arg[iarg+1],false,lmp); max_rotation_angle *= MY_PI/180; iarg += 2; } else if (strcmp(arg[iarg],"pressure") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - pressure = force->numeric(FLERR,arg[iarg+1]); + pressure = utils::numeric(FLERR,arg[iarg+1],false,lmp); pressure_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"fugacity_coeff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - fugacity_coeff = force->numeric(FLERR,arg[iarg+1]); + fugacity_coeff = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - charge = force->numeric(FLERR,arg[iarg+1]); + charge = utils::numeric(FLERR,arg[iarg+1],false,lmp); charge_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"rigid") == 0) { @@ -369,7 +369,7 @@ void FixGCMC::options(int narg, char **arg) ngrouptypesmax*sizeof(char *), "fix_gcmc:grouptypestrings"); } - grouptypes[ngrouptypes] = force->inumeric(FLERR,arg[iarg+1]); + grouptypes[ngrouptypes] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); int n = strlen(arg[iarg+2]) + 1; grouptypestrings[ngrouptypes] = new char[n]; strcpy(grouptypestrings[ngrouptypes],arg[iarg+2]); @@ -377,25 +377,25 @@ void FixGCMC::options(int narg, char **arg) iarg += 3; } else if (strcmp(arg[iarg],"intra_energy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - energy_intra = force->numeric(FLERR,arg[iarg+1]); + energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tfac_insert") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - tfac_insert = force->numeric(FLERR,arg[iarg+1]); + tfac_insert = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overlap_cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - double rtmp = force->numeric(FLERR,arg[iarg+1]); + double rtmp = utils::numeric(FLERR,arg[iarg+1],false,lmp); overlap_cutoffsq = rtmp*rtmp; overlap_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"min") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - min_ngas = force->numeric(FLERR,arg[iarg+1]); + min_ngas = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix gcmc command"); - max_ngas = force->numeric(FLERR,arg[iarg+1]); + max_ngas = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal fix gcmc command"); } @@ -481,7 +481,7 @@ void FixGCMC::init() if (!full_flag) { if ((force->kspace) || - (force->pair == NULL) || + (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("^hybrid",0)) || (force->pair_match("^eam",0)) || @@ -534,7 +534,8 @@ void FixGCMC::init() } if (exchmode == EXCHMOL || movemode == MOVEMOL) - if (atom->molecule_flag == 0 || !atom->tag_enable || !atom->map_style) + if (atom->molecule_flag == 0 || !atom->tag_enable + || (atom->map_style == Atom::MAP_NONE)) error->all(FLERR, "Fix gcmc molecule command requires that " "atoms have molecule attributes"); @@ -542,7 +543,7 @@ void FixGCMC::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix gcmc rigid fix does not exist"); @@ -557,7 +558,7 @@ void FixGCMC::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix gcmc shake fix does not exist"); @@ -905,7 +906,7 @@ void FixGCMC::attempt_atomic_deletion() if (success_all) { atom->natoms--; if (atom->tag_enable) { - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -1018,7 +1019,7 @@ void FixGCMC::attempt_atomic_insertion() atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -1262,7 +1263,7 @@ void FixGCMC::attempt_molecule_deletion() } else i++; } atom->natoms -= natoms_per_molecule; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); @@ -1456,7 +1457,7 @@ void FixGCMC::attempt_molecule_insertion() atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); @@ -1591,7 +1592,7 @@ void FixGCMC::attempt_atomic_deletion_full() atom->nlocal--; } atom->natoms--; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); ndeletion_successes += 1.0; energy_stored = energy_after; } else { @@ -1689,7 +1690,7 @@ void FixGCMC::attempt_atomic_insertion_full() atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -1963,7 +1964,7 @@ void FixGCMC::attempt_molecule_deletion_full() } else i++; } atom->natoms -= natoms_per_molecule; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); ndeletion_successes += 1.0; energy_stored = energy_after; } else { @@ -2147,7 +2148,7 @@ void FixGCMC::attempt_molecule_insertion_full() atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); diff --git a/src/MC/fix_tfmc.cpp b/src/MC/fix_tfmc.cpp index e57f1cdf4a..20b72dc269 100644 --- a/src/MC/fix_tfmc.cpp +++ b/src/MC/fix_tfmc.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_tfmc.h" -#include + #include #include #include @@ -37,16 +37,16 @@ using namespace FixConst; FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xd(NULL), rotflag(0), random_num(NULL) + xd(nullptr), rotflag(0), random_num(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix tfmc command"); // although we are not doing MD, we would like to use tfMC as an MD "drop in" time_integrate = 1; - d_max = force->numeric(FLERR,arg[3]); - T_set = force->numeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); + d_max = utils::numeric(FLERR,arg[3],false,lmp); + T_set = utils::numeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); if (d_max <= 0) error->all(FLERR,"Fix tfmc displacement length must be > 0"); if (T_set <= 0) error->all(FLERR,"Fix tfmc temperature must be > 0"); @@ -62,9 +62,9 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"com") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix tfmc command"); comflag = 1; - xflag = force->inumeric(FLERR,arg[iarg+1]); - yflag = force->inumeric(FLERR,arg[iarg+2]); - zflag = force->inumeric(FLERR,arg[iarg+3]); + xflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + yflag = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + zflag = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"rot") == 0) { if (iarg+1 > narg) error->all(FLERR,"Illegal fix tfmc command"); @@ -83,7 +83,7 @@ FixTFMC::FixTFMC(LAMMPS *lmp, int narg, char **arg) : comflag = 0; if (rotflag) { - xd = NULL; + xd = nullptr; nmax = -1; } @@ -97,7 +97,7 @@ FixTFMC::~FixTFMC() delete random_num; if (rotflag) { memory->destroy(xd); - xd = NULL; + xd = nullptr; nmax = -1; } } diff --git a/src/MC/fix_widom.cpp b/src/MC/fix_widom.cpp index af904bfe6a..e45b4b76b6 100644 --- a/src/MC/fix_widom.cpp +++ b/src/MC/fix_widom.cpp @@ -15,38 +15,35 @@ Contributing author: Evangelos Voyiatzis (Royal DSM) ------------------------------------------------------------------------- */ -#include -#include -#include #include "fix_widom.h" + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "atom_vec_hybrid.h" -#include "molecule.h" -#include "update.h" -#include "modify.h" -#include "fix.h" +#include "bond.h" #include "comm.h" #include "compute.h" -#include "group.h" -#include "domain.h" -#include "region.h" -#include "random_park.h" -#include "force.h" -#include "pair.h" -#include "bond.h" -#include "angle.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "group.h" #include "improper.h" #include "kspace.h" -#include "math_extra.h" #include "math_const.h" +#include "math_extra.h" #include "memory.h" -#include "error.h" -#include "thermo.h" -#include "output.h" +#include "modify.h" +#include "molecule.h" #include "neighbor.h" -#include +#include "pair.h" +#include "random_park.h" +#include "region.h" +#include "update.h" + +#include +#include using namespace std; using namespace LAMMPS_NS; @@ -61,14 +58,14 @@ enum{EXCHATOM,EXCHMOL}; // exchmode FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), full_flag(0), - local_gas_list(NULL), molcoords(NULL), molq(NULL), molimage(NULL), - random_equal(NULL) + idregion(nullptr), full_flag(0), + local_gas_list(nullptr), molcoords(nullptr), molq(nullptr), molimage(nullptr), + random_equal(nullptr) { - if (narg < 8) error->all(FLERR,"Illegal fix Widom command"); + if (narg < 8) error->all(FLERR,"Illegal fix widom command"); - if (atom->molecular == 2) - error->all(FLERR,"Fix Widom does not (yet) work with atom_style template"); + if (atom->molecular == Atom::TEMPLATE) + error->all(FLERR,"Fix widom does not (yet) work with atom_style template"); dynamic_group_allow = 1; @@ -83,17 +80,17 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : // required args - nevery = force->inumeric(FLERR,arg[3]); - ninsertions = force->inumeric(FLERR,arg[4]); - nwidom_type = force->inumeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); - insertion_temperature = force->numeric(FLERR,arg[7]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + ninsertions = utils::inumeric(FLERR,arg[4],false,lmp); + nwidom_type = utils::inumeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); + insertion_temperature = utils::numeric(FLERR,arg[7],false,lmp); - if (nevery <= 0) error->all(FLERR,"Illegal fix Widom command"); - if (ninsertions < 0) error->all(FLERR,"Illegal fix Widom command"); - if (seed <= 0) error->all(FLERR,"Illegal fix Widom command"); + if (nevery <= 0) error->all(FLERR,"Illegal fix widom command"); + if (ninsertions < 0) error->all(FLERR,"Illegal fix widom command"); + if (seed <= 0) error->all(FLERR,"Illegal fix widom command"); if (insertion_temperature < 0.0) - error->all(FLERR,"Illegal fix Widom command"); + error->all(FLERR,"Illegal fix widom command"); // read options from end of input line @@ -109,9 +106,9 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : region_zlo = region_zhi = 0.0; if (regionflag) { if (domain->regions[iregion]->bboxflag == 0) - error->all(FLERR,"Fix Widom region does not support a bounding box"); + error->all(FLERR,"Fix widom region does not support a bounding box"); if (domain->regions[iregion]->dynamic_check()) - error->all(FLERR,"Fix Widom region cannot be dynamic"); + error->all(FLERR,"Fix widom region cannot be dynamic"); region_xlo = domain->regions[iregion]->extent_xlo; region_xhi = domain->regions[iregion]->extent_xhi; @@ -123,7 +120,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : if (region_xlo < domain->boxlo[0] || region_xhi > domain->boxhi[0] || region_ylo < domain->boxlo[1] || region_yhi > domain->boxhi[1] || region_zlo < domain->boxlo[2] || region_zhi > domain->boxhi[2]) - error->all(FLERR,"Fix Widom region extends outside simulation box"); + error->all(FLERR,"Fix widom region extends outside simulation box"); // estimate region volume using MC trials @@ -149,21 +146,21 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : if (exchmode == EXCHMOL) { if (onemols[imol]->xflag == 0) - error->all(FLERR,"Fix Widom molecule must have coordinates"); + error->all(FLERR,"Fix widom molecule must have coordinates"); if (onemols[imol]->typeflag == 0) - error->all(FLERR,"Fix Widom molecule must have atom types"); + error->all(FLERR,"Fix widom molecule must have atom types"); if (nwidom_type != 0) - error->all(FLERR,"Atom type must be zero in fix Widom mol command"); - if (onemols[imol]->qflag == 1 && atom->q == NULL) - error->all(FLERR,"Fix Widom molecule has charges, but atom style does not"); + error->all(FLERR,"Atom type must be zero in fix widom mol command"); + if (onemols[imol]->qflag == 1 && atom->q == nullptr) + error->all(FLERR,"Fix widom molecule has charges, but atom style does not"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) - error->all(FLERR,"Fix Widom molecule template ID must be same " + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) + error->all(FLERR,"Fix widom molecule template ID must be same " "as atom_style template ID"); onemols[imol]->check_attributes(0); } - if (charge_flag && atom->q == NULL) + if (charge_flag && atom->q == nullptr) error->all(FLERR,"Fix Widom atom has charge, but atom style does not"); // setup of array of coordinates for molecule insertion @@ -180,7 +177,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : // zero out counters widom_nmax = 0; - local_gas_list = NULL; + local_gas_list = nullptr; } /* ---------------------------------------------------------------------- @@ -189,7 +186,7 @@ FixWidom::FixWidom(LAMMPS *lmp, int narg, char **arg) : void FixWidom::options(int narg, char **arg) { - if (narg < 0) error->all(FLERR,"Illegal fix Widom command"); + if (narg < 0) error->all(FLERR,"Illegal fix widom command"); // defaults @@ -211,40 +208,40 @@ void FixWidom::options(int narg, char **arg) int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"mol") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); imol = atom->find_molecule(arg[iarg+1]); if (imol == -1) - error->all(FLERR,"Molecule template ID for fix Widom does not exist"); + error->all(FLERR,"Molecule template ID for fix widom does not exist"); if (atom->molecules[imol]->nset > 1 && comm->me == 0) error->warning(FLERR,"Molecule template for " - "fix Widom has multiple molecules"); + "fix widom has multiple molecules"); exchmode = EXCHMOL; onemols = atom->molecules; nmol = onemols[imol]->nset; iarg += 2; } else if (strcmp(arg[iarg],"region") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); iregion = domain->find_region(arg[iarg+1]); if (iregion == -1) - error->all(FLERR,"Region ID for fix Widom does not exist"); + error->all(FLERR,"Region ID for fix widom does not exist"); int n = strlen(arg[iarg+1]) + 1; idregion = new char[n]; strcpy(idregion,arg[iarg+1]); regionflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); - charge = force->numeric(FLERR,arg[iarg+1]); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); + charge = utils::numeric(FLERR,arg[iarg+1],false,lmp); charge_flag = true; iarg += 2; } else if (strcmp(arg[iarg],"full_energy") == 0) { full_flag = true; iarg += 1; } else if (strcmp(arg[iarg],"intra_energy") == 0) { - if (iarg+2 > narg) error->all(FLERR,"Illegal fix Widom command"); - energy_intra = force->numeric(FLERR,arg[iarg+1]); + if (iarg+2 > narg) error->all(FLERR,"Illegal fix widom command"); + energy_intra = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; - } else error->all(FLERR,"Illegal fix Widom command"); + } else error->all(FLERR,"Illegal fix widom command"); } } @@ -286,7 +283,7 @@ void FixWidom::init() // decide whether to switch to the full_energy option if (!full_flag) { if ((force->kspace) || - (force->pair == NULL) || + (force->pair == nullptr) || (force->pair->single_enable == 0) || (force->pair_match("hybrid",0)) || (force->pair_match("eam",0)) || @@ -294,7 +291,7 @@ void FixWidom::init() ) { full_flag = true; if (comm->me == 0) - error->warning(FLERR,"Fix Widom using full_energy option"); + error->warning(FLERR,"Fix widom using full_energy option"); } } @@ -302,7 +299,7 @@ void FixWidom::init() if (exchmode == EXCHATOM) { if (nwidom_type <= 0 || nwidom_type > atom->ntypes) - error->all(FLERR,"Invalid atom type in fix Widom command"); + error->all(FLERR,"Invalid atom type in fix widom command"); } // if molecules are exchanged or moved, check for unset mol IDs @@ -317,17 +314,18 @@ void FixWidom::init() MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall && comm->me == 0) error->all(FLERR, - "All mol IDs should be set for fix Widom group atoms"); + "All mol IDs should be set for fix widom group atoms"); } if (exchmode == EXCHMOL) - if (atom->molecule_flag == 0 || !atom->tag_enable || !atom->map_style) + if (atom->molecule_flag == 0 || !atom->tag_enable + || (atom->map_style == Atom::MAP_NONE)) error->all(FLERR, - "Fix Widom molecule command requires that " + "Fix widom molecule command requires that " "atoms have molecule attributes"); if (domain->dimension == 2) - error->all(FLERR,"Cannot use fix Widom in a 2d simulation"); + error->all(FLERR,"Cannot use fix widom in a 2d simulation"); // create a new group for interaction exclusions // used for attempted atom or molecule deletions @@ -390,7 +388,7 @@ void FixWidom::init() } else gas_mass = atom->mass[nwidom_type]; if (gas_mass <= 0.0) - error->all(FLERR,"Illegal fix Widom gas mass <= 0"); + error->all(FLERR,"Illegal fix widom gas mass <= 0"); // check that no deletable atoms are in atom->firstgroup // deleting such an atom would not leave firstgroup atoms first @@ -407,7 +405,7 @@ void FixWidom::init() MPI_Allreduce(&flag,&flagall,1,MPI_INT,MPI_SUM,world); if (flagall) - error->all(FLERR,"Cannot do Widom on atoms in atom_modify first group"); + error->all(FLERR,"Cannot use fix widom on atoms in atom_modify first group"); } // compute beta @@ -420,7 +418,7 @@ void FixWidom::init() // full_flag on molecules on more than one processor. // Print error if this is the current mode if (full_flag && (exchmode == EXCHMOL) && comm->nprocs > 1) - error->all(FLERR,"fix Widom does currently not support full_energy option with molecules on more than 1 MPI process."); + error->all(FLERR,"fix widom does currently not support full_energy option with molecules on more than 1 MPI process."); } @@ -538,7 +536,7 @@ void FixWidom::attempt_atomic_insertion() if (triclinic == 0) { domain->remap(coord); if (!domain->inside(coord)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); if (coord[0] >= sublo[0] && coord[0] < subhi[0] && coord[1] >= sublo[1] && coord[1] < subhi[1] && coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1; @@ -651,7 +649,7 @@ void FixWidom::attempt_molecule_insertion() xtmp[2] = molcoords[i][2]; domain->remap(xtmp); if (!domain->inside(xtmp)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); procflag[i] = false; if (triclinic == 0) { @@ -740,7 +738,7 @@ void FixWidom::attempt_atomic_insertion_full() if (triclinic == 0) { domain->remap(coord); if (!domain->inside(coord)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); if (coord[0] >= sublo[0] && coord[0] < subhi[0] && coord[1] >= sublo[1] && coord[1] < subhi[1] && coord[2] >= sublo[2] && coord[2] < subhi[2]) proc_flag = 1; @@ -767,7 +765,7 @@ void FixWidom::attempt_atomic_insertion_full() atom->natoms++; if (atom->tag_enable) { atom->tag_extend(); - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); } atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); @@ -806,7 +804,7 @@ void FixWidom::attempt_molecule_insertion_full() MPI_Allreduce(&maxmol,&maxmol_all,1,MPI_LMP_TAGINT,MPI_MAX,world); maxmol_all++; if (maxmol_all >= MAXTAGINT) - error->all(FLERR,"Fix Widom ran out of available molecule IDs"); + error->all(FLERR,"Fix widom ran out of available molecule IDs"); int insertion_molecule = maxmol_all; tagint maxtag = 0; @@ -886,7 +884,7 @@ void FixWidom::attempt_molecule_insertion_full() imageint imagetmp = imagezero; domain->remap(xtmp,imagetmp); if (!domain->inside(xtmp)) - error->one(FLERR,"Fix Widom put atom outside box"); + error->one(FLERR,"Fix widom put atom outside box"); int proc_flag = 0; if (triclinic == 0) { @@ -907,7 +905,7 @@ void FixWidom::attempt_molecule_insertion_full() atom->image[m] = imagetmp; atom->molecule[m] = insertion_molecule; if (maxtag_all+i+1 >= MAXTAGINT) - error->all(FLERR,"Fix Widom ran out of available atom IDs"); + error->all(FLERR,"Fix widom ran out of available atom IDs"); atom->tag[m] = maxtag_all + i + 1; atom->v[m][0] = 0; atom->v[m][1] = 0; @@ -925,7 +923,7 @@ void FixWidom::attempt_molecule_insertion_full() atom->nangles += onemols[imol]->nangles; atom->ndihedrals += onemols[imol]->ndihedrals; atom->nimpropers += onemols[imol]->nimpropers; - if (atom->map_style) atom->map_init(); + if (atom->map_style != Atom::MAP_NONE) atom->map_init(); atom->nghost = 0; if (triclinic) domain->x2lamda(atom->nlocal); comm->borders(); diff --git a/src/MC/fix_widom.h b/src/MC/fix_widom.h index 05060e76ac..19102e4f4a 100644 --- a/src/MC/fix_widom.h +++ b/src/MC/fix_widom.h @@ -20,7 +20,6 @@ FixStyle(widom,FixWidom) #ifndef LMP_FIX_WIDOM_H #define LMP_FIX_WIDOM_H -#include #include "fix.h" namespace LAMMPS_NS { diff --git a/src/MC/pair_dsmc.cpp b/src/MC/pair_dsmc.cpp index ed03ca6ffc..f4bac9b8cb 100644 --- a/src/MC/pair_dsmc.cpp +++ b/src/MC/pair_dsmc.cpp @@ -16,19 +16,17 @@ ------------------------------------------------------------------------- */ #include "pair_dsmc.h" -#include -#include -#include + #include "atom.h" #include "comm.h" +#include "domain.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" -#include "domain.h" -#include "update.h" #include "random_mars.h" -#include "utils.h" -#include "fmt/format.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -40,8 +38,8 @@ PairDSMC::PairDSMC(LAMMPS *lmp) : Pair(lmp) total_number_of_collisions = 0; max_particles = max_particle_list = 0; - next_particle = NULL; - random = NULL; + next_particle = nullptr; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -209,12 +207,12 @@ void PairDSMC::settings(int narg, char **arg) if (narg != 6) error->all(FLERR,"Illegal pair_style command"); cut_global = 0.0; - max_cell_size = force->numeric(FLERR,arg[0]); - seed = force->inumeric(FLERR,arg[1]); - weighting = force->numeric(FLERR,arg[2]); - T_ref = force->numeric(FLERR,arg[3]); - recompute_vsigmamax_stride = force->inumeric(FLERR,arg[4]); - vsigmamax_samples = force->inumeric(FLERR,arg[5]); + max_cell_size = utils::numeric(FLERR,arg[0],false,lmp); + seed = utils::inumeric(FLERR,arg[1],false,lmp); + weighting = utils::numeric(FLERR,arg[2],false,lmp); + T_ref = utils::numeric(FLERR,arg[3],false,lmp); + recompute_vsigmamax_stride = utils::inumeric(FLERR,arg[4],false,lmp); + vsigmamax_samples = utils::inumeric(FLERR,arg[5],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -245,13 +243,13 @@ void PairDSMC::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double sigma_one = force->numeric(FLERR,arg[2]); + double sigma_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -344,12 +342,12 @@ void PairDSMC::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -377,11 +375,11 @@ void PairDSMC::write_restart_settings(FILE *fp) void PairDSMC::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&max_cell_size,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&max_cell_size,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/MESSAGE/fix_client_md.cpp b/src/MESSAGE/fix_client_md.cpp index 1cbce3a7f9..ab9bbfa14c 100644 --- a/src/MESSAGE/fix_client_md.cpp +++ b/src/MESSAGE/fix_client_md.cpp @@ -42,7 +42,7 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : { if (lmp->clientserver != 1) error->all(FLERR,"Fix client/md requires LAMMPS be running as a client"); - if (!atom->map_style) error->all(FLERR,"Fix client/md requires atom map"); + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix client/md requires atom map"); if (sizeof(tagint) != 4) error->all(FLERR,"Fix client/md only supports 32-bit atom IDs"); @@ -62,7 +62,7 @@ FixClientMD::FixClientMD(LAMMPS *lmp, int narg, char **arg) : box[0][2] = box[1][2] = box[2][0] = box[2][1] = box[2][2] = 0.0; maxatom = 0; - xpbc = NULL; + xpbc = nullptr; // unit conversion factors for REAL // otherwise not needed diff --git a/src/MESSAGE/message.cpp b/src/MESSAGE/message.cpp index b83be0339c..b43a2686a2 100644 --- a/src/MESSAGE/message.cpp +++ b/src/MESSAGE/message.cpp @@ -116,6 +116,6 @@ void Message::quit() // clean-up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; lmp->clientserver = 0; } diff --git a/src/MESSAGE/server_mc.cpp b/src/MESSAGE/server_mc.cpp index af7850a0e9..d42dfa7512 100644 --- a/src/MESSAGE/server_mc.cpp +++ b/src/MESSAGE/server_mc.cpp @@ -47,7 +47,7 @@ void ServerMC::loop() if (domain->box_exist == 0) error->all(FLERR,"Server command before simulation box is defined"); - if (!atom->map_style) error->all(FLERR,"Server mc requires atom map"); + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Server mc requires atom map"); if (atom->tag_enable == 0) error->all(FLERR,"Server mc requires atom IDs"); if (sizeof(tagint) != 4) error->all(FLERR,"Server mc requires 32-bit atom IDs"); @@ -77,7 +77,7 @@ void ServerMC::loop() cs->send(msgID,2); cs->pack_double(1,dval); - double *coords = NULL; + double *coords = nullptr; if (atom->nlocal) coords = &atom->x[0][0]; cs->pack_parallel(2,4,atom->nlocal,atom->tag,3,coords); @@ -143,5 +143,5 @@ void ServerMC::loop() // clean up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; } diff --git a/src/MESSAGE/server_md.cpp b/src/MESSAGE/server_md.cpp index 418162e5d9..2d6b07490f 100644 --- a/src/MESSAGE/server_md.cpp +++ b/src/MESSAGE/server_md.cpp @@ -46,7 +46,7 @@ ServerMD::ServerMD(LAMMPS *lmp) : Pointers(lmp) if (domain->box_exist == 0) error->all(FLERR,"Server command before simulation box is defined"); - if (!atom->map_style) error->all(FLERR,"Server md requires atom map"); + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Server md requires atom map"); if (atom->tag_enable == 0) error->all(FLERR,"Server md requires atom IDs"); if (sizeof(tagint) != 4) error->all(FLERR,"Server md requires 32-bit atom IDs"); @@ -64,7 +64,7 @@ ServerMD::ServerMD(LAMMPS *lmp) : Pointers(lmp) pconvert = 1.0 / 0.986923; // atmospheres -> bars } - fcopy = NULL; + fcopy = nullptr; } /* ---------------------------------------------------------------------- */ @@ -107,15 +107,15 @@ void ServerMD::loop() if (msgID == SETUP) { int dim = 0; - int *periodicity = NULL; + int *periodicity = nullptr; int natoms = -1; int ntypes = -1; - double *origin = NULL; - double *box = NULL; - int *types = NULL; - double *coords = NULL; - char *unit_style = NULL; - double *charge = NULL; + double *origin = nullptr; + double *box = nullptr; + int *types = nullptr; + double *coords = nullptr; + char *unit_style = nullptr; + double *charge = nullptr; for (int ifield = 0; ifield < nfield; ifield++) { if (fieldID[ifield] == DIM) { @@ -185,7 +185,7 @@ void ServerMD::loop() int nlocal = 0; for (int i = 0; i < natoms; i++) { - if (!domain->ownatom(i+1,&coords[3*i],NULL,0)) continue; + if (!domain->ownatom(i+1,&coords[3*i],nullptr,0)) continue; atom->avec->create_atom(types[i],&coords[3*i]); atom->tag[nlocal] = i+1; if (charge) atom->q[nlocal] = charge[i]; @@ -226,9 +226,9 @@ void ServerMD::loop() } else if (msgID == STEP) { - double *coords = NULL; - double *origin = NULL; - double *box = NULL; + double *coords = nullptr; + double *origin = nullptr; + double *box = nullptr; for (int ifield = 0; ifield < nfield; ifield++) { if (fieldID[ifield] == COORDS) { @@ -314,7 +314,7 @@ void ServerMD::loop() // clean up delete cs; - lmp->cslib = NULL; + lmp->cslib = nullptr; } /* ---------------------------------------------------------------------- @@ -349,7 +349,7 @@ void ServerMD::send_fev(int msgID) cs->send(msgID,3); - double *forces = NULL; + double *forces = nullptr; if (atom->nlocal) { if (units != REAL) forces = &atom->f[0][0]; else { diff --git a/src/MISC/compute_msd_nongauss.cpp b/src/MISC/compute_msd_nongauss.cpp index 6123bf49af..7f4e6b1f3c 100644 --- a/src/MISC/compute_msd_nongauss.cpp +++ b/src/MISC/compute_msd_nongauss.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_msd_nongauss.h" -#include + #include "atom.h" #include "update.h" #include "group.h" diff --git a/src/MISC/compute_ti.cpp b/src/MISC/compute_ti.cpp index 06188de238..f984aeac2e 100644 --- a/src/MISC/compute_ti.cpp +++ b/src/MISC/compute_ti.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_ti.h" -#include + #include #include "atom.h" #include "update.h" @@ -28,6 +28,7 @@ #include "variable.h" #include "error.h" + using namespace LAMMPS_NS; enum{PAIR,TAIL,KSPACE}; @@ -35,8 +36,8 @@ enum{PAIR,TAIL,KSPACE}; /* ---------------------------------------------------------------------- */ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), nterms(0), which(NULL), ivar1(NULL), ivar2(NULL), - ilo(NULL), ihi(NULL), var1(NULL), var2(NULL), pptr(NULL), pstyle(NULL) + Compute(lmp, narg, arg), nterms(0), which(nullptr), ivar1(nullptr), ivar2(nullptr), + ilo(nullptr), ihi(nullptr), var1(nullptr), var2(nullptr), pptr(nullptr), pstyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute ti command"); @@ -63,7 +64,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : pptr = new Pair*[nterms]; pstyle = new char*[nterms]; - for (int m = 0; m < nterms; m++) pstyle[m] = NULL; + for (int m = 0; m < nterms; m++) pstyle[m] = nullptr; // parse keywords @@ -79,7 +80,7 @@ ComputeTI::ComputeTI(LAMMPS *lmp, int narg, char **arg) : int n = strlen(arg[iarg]) + 1; pstyle[nterms] = new char[n]; strcpy(pstyle[nterms],arg[iarg]); - force->bounds(FLERR,arg[iarg+1],atom->ntypes,ilo[nterms],ihi[nterms]); + utils::bounds(FLERR,arg[iarg+1],1,atom->ntypes,ilo[nterms],ihi[nterms],error); iarg += 1; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { @@ -135,16 +136,16 @@ void ComputeTI::init() if (which[m] == PAIR) { pptr[m] = force->pair_match(pstyle[m],1); - if (pptr[m] == NULL) + if (pptr[m] == nullptr) error->all(FLERR,"Compute ti pair style does not exist"); } else if (which[m] == TAIL) { - if (force->pair == NULL || force->pair->tail_flag == 0) + if (force->pair == nullptr || force->pair->tail_flag == 0) error->all(FLERR,"Compute ti tail when pair style does not " "compute tail corrections"); } else if (which[m] == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Compute ti kspace style does not exist"); } } diff --git a/src/MISC/dump_xtc.cpp b/src/MISC/dump_xtc.cpp index a28d6acdfa..1a1e01b16c 100644 --- a/src/MISC/dump_xtc.cpp +++ b/src/MISC/dump_xtc.cpp @@ -24,7 +24,7 @@ #include "dump_xtc.h" #include -#include + #include #include #include "domain.h" @@ -53,7 +53,7 @@ int xdr3dfcoord(XDR *, float *, int *, float *); /* ---------------------------------------------------------------------- */ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - coords(NULL) + coords(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump xtc command"); if (binary || compressed || multifile || multiproc) @@ -62,7 +62,7 @@ DumpXTC::DumpXTC(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), size_one = 3; sort_flag = 1; sortcol = 0; - format_default = NULL; + format_default = nullptr; flush_flag = 0; unwrap_flag = 0; precision = 1000.0; @@ -137,9 +137,9 @@ void DumpXTC::init_style() void DumpXTC::openfile() { // XTC maintains it's own XDR file ptr - // set fp to NULL so parent dump class will not use it + // set fp to a null pointer so parent dump class will not use it - fp = NULL; + fp = nullptr; if (me == 0) if (xdropen(&xd,filename,"w") == 0) error->one(FLERR,"Cannot open dump file"); } @@ -283,7 +283,7 @@ int DumpXTC::modify_param(int narg, char **arg) return 2; } else if (strcmp(arg[0],"precision") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - precision = force->numeric(FLERR,arg[1]); + precision = utils::numeric(FLERR,arg[1],false,lmp); if ((fabs(precision-10.0) > EPS) && (fabs(precision-100.0) > EPS) && (fabs(precision-1000.0) > EPS) && (fabs(precision-10000.0) > EPS) && (fabs(precision-100000.0) > EPS) && @@ -292,13 +292,13 @@ int DumpXTC::modify_param(int narg, char **arg) return 2; } else if (strcmp(arg[0],"sfactor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - sfactor = force->numeric(FLERR,arg[1]); + sfactor = utils::numeric(FLERR,arg[1],false,lmp); if (sfactor <= 0.0) error->all(FLERR,"Illegal dump_modify sfactor value (must be > 0.0)"); return 2; } else if (strcmp(arg[0],"tfactor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - tfactor = force->numeric(FLERR,arg[1]); + tfactor = utils::numeric(FLERR,arg[1],false,lmp); if (tfactor <= 0.0) error->all(FLERR,"Illegal dump_modify tfactor value (must be > 0.0)"); return 2; @@ -310,9 +310,9 @@ int DumpXTC::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf and global coords array ------------------------------------------------------------------------- */ -bigint DumpXTC::memory_usage() +double DumpXTC::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); return bytes; } @@ -364,8 +364,8 @@ void DumpXTC::write_frame() static FILE *xdrfiles[MAXID]; static XDR *xdridptr[MAXID]; static char xdrmodes[MAXID]; -static int *ip = NULL; -static int *buf = NULL; +static int *ip = nullptr; +static int *buf = nullptr; /*___________________________________________________________________________ | @@ -414,12 +414,12 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) if (init_done == 0) { for (xdrid = 1; xdrid < MAXID; xdrid++) { - xdridptr[xdrid] = NULL; + xdridptr[xdrid] = nullptr; } init_done = 1; } xdrid = 1; - while (xdrid < MAXID && xdridptr[xdrid] != NULL) { + while (xdrid < MAXID && xdridptr[xdrid] != nullptr) { xdrid++; } if (xdrid == MAXID) { @@ -433,8 +433,8 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) lmode = XDR_DECODE; } xdrfiles[xdrid] = fopen(filename, type); - if (xdrfiles[xdrid] == NULL) { - xdrs = NULL; + if (xdrfiles[xdrid] == nullptr) { + xdrs = nullptr; return 0; } xdrmodes[xdrid] = *type; @@ -444,7 +444,7 @@ int xdropen(XDR *xdrs, const char *filename, const char *type) * (C users are expected to pass the address of an already allocated * XDR staructure) */ - if (xdrs == NULL) { + if (xdrs == nullptr) { xdridptr[xdrid] = (XDR *) malloc(sizeof(XDR)); xdrstdio_create(xdridptr[xdrid], xdrfiles[xdrid], lmode); } else { @@ -468,7 +468,7 @@ int xdrclose(XDR *xdrs) { int xdrid; - if (xdrs == NULL) { + if (xdrs == nullptr) { fprintf(stderr, "xdrclose: passed a NULL pointer\n"); exit(1); } @@ -477,7 +477,7 @@ int xdrclose(XDR *xdrs) xdr_destroy(xdrs); fclose(xdrfiles[xdrid]); - xdridptr[xdrid] = NULL; + xdridptr[xdrid] = nullptr; return 1; } } @@ -495,8 +495,8 @@ void xdrfreebuf() { if (ip) free(ip); if (buf) free(buf); - ip = NULL; - buf = NULL; + ip = nullptr; + buf = nullptr; } @@ -555,7 +555,7 @@ static int sizeofint(const int size) unsigned int num = 1; int num_of_bits = 0; - while (size >= num && num_of_bits < 32) { + while (size >= (int) num && num_of_bits < 32) { num_of_bits++; num <<= 1; } @@ -596,7 +596,7 @@ static int sizeofints( const int num_of_ints, unsigned int sizes[]) } num = 1; num_of_bytes--; - while (bytes[num_of_bytes] >= num) { + while ((int)bytes[num_of_bytes] >= num) { num_of_bits++; num *= 2; } @@ -650,13 +650,13 @@ static void sendints(int buf[], const int num_of_ints, const int num_of_bits, } num_of_bytes = bytecnt; } - if (num_of_bits >= num_of_bytes * 8) { - for (i = 0; i < num_of_bytes; i++) { + if (num_of_bits >= (int)num_of_bytes * 8) { + for (i = 0; i < (int)num_of_bytes; i++) { sendbits(buf, 8, bytes[i]); } sendbits(buf, num_of_bits - num_of_bytes * 8, 0); } else { - for (i = 0; i < num_of_bytes-1; i++) { + for (i = 0; i < (int)num_of_bytes-1; i++) { sendbits(buf, 8, bytes[i]); } sendbits(buf, num_of_bits- (num_of_bytes -1) * 8, bytes[i]); @@ -691,7 +691,7 @@ static int receivebits(int buf[], int num_of_bits) num_of_bits -=8; } if (num_of_bits > 0) { - if (lastbits < num_of_bits) { + if ((int)lastbits < num_of_bits) { lastbits += 8; lastbyte = (lastbyte << 8) | cbuf[cnt++]; } @@ -815,28 +815,28 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) } xdr_float(xdrs, precision); - if (ip == NULL) { + if (ip == nullptr) { ip = (int *) malloc(size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) malloc(bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } oldsize = *size; } else if (*size > oldsize) { ip = (int *) realloc(ip, size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) realloc(buf, bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } @@ -931,11 +931,11 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) lip = ip; luip = (unsigned int *) ip; smallidx = FIRSTIDX; - while (smallidx < LASTIDX && magicints[smallidx] < mindiff) { + while (smallidx < (int)LASTIDX && magicints[smallidx] < mindiff) { smallidx++; } xdr_int(xdrs, &smallidx); - maxidx = MYMIN(LASTIDX, smallidx + 8) ; + maxidx = MYMIN((int)LASTIDX, smallidx + 8) ; minidx = maxidx - 8; /* often this equal smallidx */ smaller = magicints[MYMAX(FIRSTIDX, smallidx-1)] / 2; small = magicints[smallidx] / 2; @@ -1059,28 +1059,28 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) (xdrproc_t)xdr_float)); } xdr_float(xdrs, precision); - if (ip == NULL) { + if (ip == nullptr) { ip = (int *) malloc(size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *) malloc(bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } oldsize = *size; } else if (*size > oldsize) { ip = (int *)realloc(ip, size3 * sizeof(*ip)); - if (ip == NULL) { + if (ip == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } bufsize = (int) (size3 * 1.2); buf = (int *)realloc(buf, bufsize * sizeof(*buf)); - if (buf == NULL) { + if (buf == nullptr) { fprintf(stderr,"malloc failed\n"); exit(1); } @@ -1111,7 +1111,7 @@ int xdr3dfcoord(XDR *xdrs, float *fp, int *size, float *precision) } xdr_int(xdrs, &smallidx); - maxidx = MYMIN(LASTIDX, smallidx + 8) ; + maxidx = MYMIN((int)LASTIDX, smallidx + 8) ; minidx = maxidx - 8; /* often this equal smallidx */ smaller = magicints[MYMAX(FIRSTIDX, smallidx-1)] / 2; small = magicints[smallidx] / 2; diff --git a/src/MISC/dump_xtc.h b/src/MISC/dump_xtc.h index 3fcc89f4ba..e242e7eef0 100644 --- a/src/MISC/dump_xtc.h +++ b/src/MISC/dump_xtc.h @@ -45,7 +45,7 @@ class DumpXTC : public Dump { void write_header(bigint); void pack(tagint *); void write_data(int, double *); - bigint memory_usage(); + double memory_usage(); void write_frame(); }; diff --git a/src/MISC/fix_deposit.cpp b/src/MISC/fix_deposit.cpp index 4d65457340..a4cc2baa6b 100644 --- a/src/MISC/fix_deposit.cpp +++ b/src/MISC/fix_deposit.cpp @@ -12,26 +12,25 @@ ------------------------------------------------------------------------- */ #include "fix_deposit.h" -#include -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "molecule.h" -#include "force.h" -#include "update.h" -#include "modify.h" -#include "fix.h" #include "comm.h" #include "domain.h" -#include "lattice.h" -#include "region.h" -#include "random_park.h" -#include "math_extra.h" -#include "math_const.h" -#include "memory.h" #include "error.h" -#include "fmt/format.h" +#include "fix.h" +#include "lattice.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "modify.h" +#include "molecule.h" +#include "random_park.h" +#include "region.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -45,9 +44,9 @@ enum{DIST_UNIFORM,DIST_GAUSSIAN}; /* ---------------------------------------------------------------------- */ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), idrigid(NULL), - idshake(NULL), onemols(NULL), molfrac(NULL), coords(NULL), imageflags(NULL), - fixrigid(NULL), fixshake(NULL), random(NULL) + Fix(lmp, narg, arg), idregion(nullptr), idrigid(nullptr), + idshake(nullptr), onemols(nullptr), molfrac(nullptr), coords(nullptr), imageflags(nullptr), + fixrigid(nullptr), fixshake(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix deposit command"); @@ -56,10 +55,10 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : // required args - ninsert = force->inumeric(FLERR,arg[3]); - ntype = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); + ninsert = utils::inumeric(FLERR,arg[3],false,lmp); + ntype = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix deposit command"); @@ -114,7 +113,7 @@ FixDeposit::FixDeposit(LAMMPS *lmp, int narg, char **arg) : ntype+onemols[i]->ntypes > atom->ntypes) error->all(FLERR,"Invalid atom type in fix deposit mol command"); - if (atom->molecular == 2 && onemols != atom->avec->onemols) + if (atom->molecular == Atom::TEMPLATE && onemols != atom->avec->onemols) error->all(FLERR,"Fix deposit molecule template ID must be same " "as atom_style template ID"); onemols[i]->check_attributes(0); @@ -234,7 +233,7 @@ void FixDeposit::init() // if rigidflag defined, check for rigid/small fix // its molecule template must be same as this one - fixrigid = NULL; + fixrigid = nullptr; if (rigidflag) { int ifix = modify->find_fix(idrigid); if (ifix < 0) error->all(FLERR,"Fix deposit rigid fix does not exist"); @@ -249,7 +248,7 @@ void FixDeposit::init() // if shakeflag defined, check for SHAKE fix // its molecule template must be same as this one - fixshake = NULL; + fixshake = nullptr; if (shakeflag) { int ifix = modify->find_fix(idshake); if (ifix < 0) error->all(FLERR,"Fix deposit shake fix does not exist"); @@ -544,7 +543,7 @@ void FixDeposit::pre_exchange() atom->molecule[n] = maxmol_all+1; } } - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { atom->molindex[n] = 0; atom->molatom[n] = m; } @@ -614,7 +613,7 @@ void FixDeposit::pre_exchange() maxmol_all++; } } - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -659,13 +658,13 @@ void FixDeposit::options(int narg, char **arg) // defaults iregion = -1; - idregion = NULL; + idregion = nullptr; mode = ATOM; - molfrac = NULL; + molfrac = nullptr; rigidflag = 0; - idrigid = NULL; + idrigid = nullptr; shakeflag = 0; - idshake = NULL; + idshake = nullptr; idnext = 0; globalflag = localflag = 0; lo = hi = deltasq = 0.0; @@ -712,9 +711,9 @@ void FixDeposit::options(int narg, char **arg) } else if (strcmp(arg[iarg],"molfrac") == 0) { if (mode != MOLECULE) error->all(FLERR,"Illegal fix deposit command"); if (iarg+nmol+1 > narg) error->all(FLERR,"Illegal fix deposit command"); - molfrac[0] = force->numeric(FLERR,arg[iarg+1]); + molfrac[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); for (int i = 1; i < nmol; i++) - molfrac[i] = molfrac[i-1] + force->numeric(FLERR,arg[iarg+i+1]); + molfrac[i] = molfrac[i-1] + utils::numeric(FLERR,arg[iarg+i+1],false,lmp); if (molfrac[nmol-1] < 1.0-EPSILON || molfrac[nmol-1] > 1.0+EPSILON) error->all(FLERR,"Illegal fix deposit command"); molfrac[nmol-1] = 1.0; @@ -747,54 +746,54 @@ void FixDeposit::options(int narg, char **arg) if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); globalflag = 1; localflag = 0; - lo = force->numeric(FLERR,arg[iarg+1]); - hi = force->numeric(FLERR,arg[iarg+2]); + lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"local") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command"); localflag = 1; globalflag = 0; - lo = force->numeric(FLERR,arg[iarg+1]); - hi = force->numeric(FLERR,arg[iarg+2]); - deltasq = force->numeric(FLERR,arg[iarg+3]) * - force->numeric(FLERR,arg[iarg+3]); + lo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + hi = utils::numeric(FLERR,arg[iarg+2],false,lmp); + deltasq = utils::numeric(FLERR,arg[iarg+3],false,lmp) * + utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"near") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command"); - nearsq = force->numeric(FLERR,arg[iarg+1]) * - force->numeric(FLERR,arg[iarg+1]); + nearsq = utils::numeric(FLERR,arg[iarg+1],false,lmp) * + utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"attempt") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command"); - maxattempt = force->inumeric(FLERR,arg[iarg+1]); + maxattempt = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"rate") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix deposit command"); rateflag = 1; - rate = force->numeric(FLERR,arg[iarg+1]); + rate = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"vx") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); - vxlo = force->numeric(FLERR,arg[iarg+1]); - vxhi = force->numeric(FLERR,arg[iarg+2]); + vxlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vxhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"vy") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); - vylo = force->numeric(FLERR,arg[iarg+1]); - vyhi = force->numeric(FLERR,arg[iarg+2]); + vylo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vyhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"vz") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deposit command"); - vzlo = force->numeric(FLERR,arg[iarg+1]); - vzhi = force->numeric(FLERR,arg[iarg+2]); + vzlo = utils::numeric(FLERR,arg[iarg+1],false,lmp); + vzhi = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"orient") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command"); orientflag = 1; - rx = force->numeric(FLERR,arg[iarg+1]); - ry = force->numeric(FLERR,arg[iarg+2]); - rz = force->numeric(FLERR,arg[iarg+3]); + rx = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ry = utils::numeric(FLERR,arg[iarg+2],false,lmp); + rz = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (domain->dimension == 2 && (rx != 0.0 || ry != 0.0)) error->all(FLERR,"Illegal fix deposit orient settings"); if (rx == 0.0 && ry == 0.0 && rz == 0.0) @@ -808,17 +807,17 @@ void FixDeposit::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"gaussian") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix deposit command"); - xmid = force->numeric(FLERR,arg[iarg+1]); - ymid = force->numeric(FLERR,arg[iarg+2]); - zmid = force->numeric(FLERR,arg[iarg+3]); - sigma = force->numeric(FLERR,arg[iarg+4]); + xmid = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ymid = utils::numeric(FLERR,arg[iarg+2],false,lmp); + zmid = utils::numeric(FLERR,arg[iarg+3],false,lmp); + sigma = utils::numeric(FLERR,arg[iarg+4],false,lmp); distflag = DIST_GAUSSIAN; iarg += 5; } else if (strcmp(arg[iarg],"target") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deposit command"); - tx = force->numeric(FLERR,arg[iarg+1]); - ty = force->numeric(FLERR,arg[iarg+2]); - tz = force->numeric(FLERR,arg[iarg+3]); + tx = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ty = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tz = utils::numeric(FLERR,arg[iarg+3],false,lmp); targetflag = 1; iarg += 4; } else error->all(FLERR,"Illegal fix deposit command"); @@ -905,5 +904,5 @@ void *FixDeposit::extract(const char *str, int &itype) return &oneradius; } - return NULL; + return nullptr; } diff --git a/src/MISC/fix_efield.cpp b/src/MISC/fix_efield.cpp index 5a13b93b91..d3836f52a5 100644 --- a/src/MISC/fix_efield.cpp +++ b/src/MISC/fix_efield.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_efield.h" -#include + #include #include "atom.h" #include "update.h" @@ -40,8 +40,8 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), - estr(NULL), idregion(NULL), efield(NULL) + Fix(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), + estr(nullptr), idregion(nullptr), efield(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix efield command"); @@ -57,14 +57,14 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : virial_flag = 1; qe2f = force->qe2f; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); } else { - ex = qe2f * force->numeric(FLERR,arg[3]); + ex = qe2f * utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } @@ -73,7 +73,7 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : ystr = new char[n]; strcpy(ystr,&arg[4][2]); } else { - ey = qe2f * force->numeric(FLERR,arg[4]); + ey = qe2f * utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } @@ -82,15 +82,15 @@ FixEfield::FixEfield(LAMMPS *lmp, int narg, char **arg) : zstr = new char[n]; strcpy(zstr,&arg[5][2]); } else { - ez = qe2f * force->numeric(FLERR,arg[5]); + ez = qe2f * utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } // optional args iregion = -1; - idregion = NULL; - estr = NULL; + idregion = nullptr; + estr = nullptr; int iarg = 6; while (iarg < narg) { @@ -272,7 +272,7 @@ void FixEfield::post_force(int vflag) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/MISC/fix_evaporate.cpp b/src/MISC/fix_evaporate.cpp index c7e7af9057..ae2d51448b 100644 --- a/src/MISC/fix_evaporate.cpp +++ b/src/MISC/fix_evaporate.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_evaporate.h" -#include + #include #include "atom.h" #include "atom_vec.h" @@ -33,7 +33,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idregion(NULL), list(NULL), mark(NULL), random(NULL) + Fix(lmp, narg, arg), idregion(nullptr), list(nullptr), mark(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix evaporate command"); @@ -41,13 +41,13 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extscalar = 0; - nevery = force->inumeric(FLERR,arg[3]); - nflux = force->inumeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nflux = utils::inumeric(FLERR,arg[4],false,lmp); iregion = domain->find_region(arg[5]); int n = strlen(arg[5]) + 1; idregion = new char[n]; strcpy(idregion,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); if (nevery <= 0 || nflux <= 0) error->all(FLERR,"Illegal fix evaporate command"); @@ -84,8 +84,8 @@ FixEvaporate::FixEvaporate(LAMMPS *lmp, int narg, char **arg) : ndeleted = 0; nmax = 0; - list = NULL; - mark = NULL; + list = nullptr; + mark = nullptr; } /* ---------------------------------------------------------------------- */ @@ -264,8 +264,8 @@ void FixEvaporate::pre_exchange() // if mol ID > 0, delete any atom in molecule and decrement counters // if mol ID == 0, delete single iatom // logic with ndeltopo is to count # of deleted bonds,angles,etc - // for atom->molecular = 1, do this for each deleted atom in molecule - // for atom->molecular = 2, use Molecule counts for just 1st atom in mol + // for atom->molecular = Atom::MOLECULAR, do this for each deleted atom in molecule + // for atom->molecular = Atom::TEMPLATE, use Molecule counts for just 1st atom in mol MPI_Allreduce(&me,&proc,1,MPI_INT,MPI_MAX,world); MPI_Bcast(&imolecule,1,MPI_LMP_TAGINT,proc,world); @@ -275,7 +275,7 @@ void FixEvaporate::pre_exchange() mark[i] = 1; ndelone++; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow) { if (force->newton_bond) ndeltopo[0] += atom->num_bond[i]; else { @@ -312,7 +312,7 @@ void FixEvaporate::pre_exchange() } } - } else if (molecular == 2) { + } else if (molecular == Atom::TEMPLATE) { if (molatom[i] == 0) { index = molindex[i]; ndeltopo[0] += onemols[index]->nbonds; @@ -376,7 +376,7 @@ void FixEvaporate::pre_exchange() atom->nimpropers -= all[3]; } - if (ndel && atom->map_style) { + if (ndel && (atom->map_style != Atom::MAP_NONE)) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/MISC/fix_gld.cpp b/src/MISC/fix_gld.cpp index ab601ae8cb..7ef5b019ba 100644 --- a/src/MISC/fix_gld.cpp +++ b/src/MISC/fix_gld.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_gld.h" -#include + #include #include #include "atom.h" @@ -41,7 +41,7 @@ using namespace FixConst; FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - step_respa(NULL), prony_c(NULL), prony_tau(NULL), s_gld(NULL), random(NULL) + step_respa(nullptr), prony_c(nullptr), prony_tau(nullptr), s_gld(nullptr), random(nullptr) { int narg_min = 8; // Check to make sure we have the minimal number of inputs @@ -55,16 +55,16 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : // 1 = Group ID (e.g., all) // 2 = gld (name of this fix) // 3 = t_start (Starting target temperature) - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); // 4 = t_stop (Stopping target temperature) - t_stop = force->numeric(FLERR,arg[4]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); // 5 = prony_terms (number of terms in Prony series) - prony_terms = force->inumeric(FLERR,arg[5]); + prony_terms = utils::inumeric(FLERR,arg[5],false,lmp); // 6 = seed (random seed) - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // 7 = series type if(strcmp(arg[7],"pprony") == 0) { @@ -89,18 +89,18 @@ FixGLD::FixGLD(LAMMPS *lmp, int narg, char **arg) : // allocate memory for Prony series timescale coefficients memory->create(prony_tau, prony_terms, "gld:prony_tau"); // allocate memory for Prony series extended variables - s_gld = NULL; + s_gld = nullptr; grow_arrays(atom->nmax); // add callbacks to enable restarts - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // read in the Prony series coefficients int iarg = narg_min; int icoeff = 0; while (iarg < narg && icoeff < prony_terms) { - double pc = force->numeric(FLERR,arg[iarg]); - double ptau = force->numeric(FLERR,arg[iarg+1]); + double pc = utils::numeric(FLERR,arg[iarg],false,lmp); + double ptau = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (pc < 0) error->all(FLERR,"Fix gld c coefficients must be >= 0"); @@ -179,8 +179,8 @@ FixGLD::~FixGLD() memory->destroy(s_gld); // remove callbacks to fix, so atom class stops calling it - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); } /* ---------------------------------------------------------------------- @@ -568,7 +568,7 @@ void FixGLD::unpack_restart(int nlocal, int nth) // skip to the nth set of extended variables // unpack the Nth first values this way because other fixes pack them - + int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MISC/fix_oneway.cpp b/src/MISC/fix_oneway.cpp index 68a27b68be..3508c2fd7e 100644 --- a/src/MISC/fix_oneway.cpp +++ b/src/MISC/fix_oneway.cpp @@ -16,13 +16,14 @@ ------------------------------------------------------------------------- */ #include "fix_oneway.h" -#include + #include "atom.h" #include "domain.h" #include "error.h" -#include "force.h" #include "region.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; @@ -34,11 +35,11 @@ FixOneWay::FixOneWay(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { direction = NONE; regionidx = 0; - regionstr = NULL; + regionstr = nullptr; if (narg < 6) error->all(FLERR,"Illegal fix oneway command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 1) error->all(FLERR,"Illegal fix oneway command"); int len = strlen(arg[4]); diff --git a/src/MISC/fix_orient_bcc.cpp b/src/MISC/fix_orient_bcc.cpp index 8548ee04cf..7d9463f77c 100644 --- a/src/MISC/fix_orient_bcc.cpp +++ b/src/MISC/fix_orient_bcc.cpp @@ -19,25 +19,21 @@ ------------------------------------------------------------------------- */ #include "fix_orient_bcc.h" -#include -#include -#include -#include -#include + #include "atom.h" -#include "update.h" -#include "respa.h" -#include "neighbor.h" +#include "citeme.h" +#include "comm.h" +#include "error.h" +#include "math_const.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "comm.h" -#include "force.h" -#include "math_const.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "neighbor.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -60,7 +56,7 @@ static const char cite_fix_orient_bcc[] = FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xifilename(NULL), chifilename(NULL), order(NULL), nbr(NULL), sort(NULL), list(NULL) + xifilename(nullptr), chifilename(nullptr), order(nullptr), nbr(nullptr), sort(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_bcc); @@ -78,12 +74,12 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - nstats = force->inumeric(FLERR,arg[3]); - direction_of_motion = force->inumeric(FLERR,arg[4]); - a = force->numeric(FLERR,arg[5]); - Vxi = force->numeric(FLERR,arg[6]); - uxif_low = force->numeric(FLERR,arg[7]); - uxif_high = force->numeric(FLERR,arg[8]); + nstats = utils::inumeric(FLERR,arg[3],false,lmp); + direction_of_motion = utils::inumeric(FLERR,arg[4],false,lmp); + a = utils::numeric(FLERR,arg[5],false,lmp); + Vxi = utils::numeric(FLERR,arg[6],false,lmp); + uxif_low = utils::numeric(FLERR,arg[7],false,lmp); + uxif_high = utils::numeric(FLERR,arg[8],false,lmp); if (direction_of_motion == 0) { int n = strlen(arg[9]) + 1; @@ -118,7 +114,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : int count; FILE *inpfile = fopen(xifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/bcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/bcc file open failed"); for (int i = 0; i < 4; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/bcc file read failed"); @@ -128,7 +124,7 @@ FixOrientBCC::FixOrientBCC(LAMMPS *lmp, int narg, char **arg) : fclose(inpfile); inpfile = fopen(chifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/bcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/bcc file open failed"); for (int i = 0; i < 4; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/bcc file read failed"); diff --git a/src/MISC/fix_orient_fcc.cpp b/src/MISC/fix_orient_fcc.cpp index 97c545d189..0677b8d57c 100644 --- a/src/MISC/fix_orient_fcc.cpp +++ b/src/MISC/fix_orient_fcc.cpp @@ -16,25 +16,21 @@ ------------------------------------------------------------------------- */ #include "fix_orient_fcc.h" -#include -#include -#include -#include -#include + #include "atom.h" -#include "update.h" -#include "respa.h" -#include "neighbor.h" +#include "citeme.h" +#include "comm.h" +#include "error.h" +#include "math_const.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "comm.h" -#include "force.h" -#include "math_const.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "neighbor.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -57,8 +53,8 @@ static const char cite_fix_orient_fcc[] = FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xifilename(NULL), chifilename(NULL), order(NULL), nbr(NULL), - sort(NULL), list(NULL) + xifilename(nullptr), chifilename(nullptr), order(nullptr), nbr(nullptr), + sort(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_fcc); @@ -76,12 +72,12 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - nstats = force->inumeric(FLERR,arg[3]); - direction_of_motion = force->inumeric(FLERR,arg[4]); - a = force->numeric(FLERR,arg[5]); - Vxi = force->numeric(FLERR,arg[6]); - uxif_low = force->numeric(FLERR,arg[7]); - uxif_high = force->numeric(FLERR,arg[8]); + nstats = utils::inumeric(FLERR,arg[3],false,lmp); + direction_of_motion = utils::inumeric(FLERR,arg[4],false,lmp); + a = utils::numeric(FLERR,arg[5],false,lmp); + Vxi = utils::numeric(FLERR,arg[6],false,lmp); + uxif_low = utils::numeric(FLERR,arg[7],false,lmp); + uxif_high = utils::numeric(FLERR,arg[8],false,lmp); if (direction_of_motion == 0) { int n = strlen(arg[9]) + 1; @@ -116,7 +112,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : int count; FILE *inpfile = fopen(xifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/fcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/fcc file open failed"); for (int i = 0; i < 6; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/fcc file read failed"); @@ -126,7 +122,7 @@ FixOrientFCC::FixOrientFCC(LAMMPS *lmp, int narg, char **arg) : fclose(inpfile); inpfile = fopen(chifilename,"r"); - if (inpfile == NULL) error->one(FLERR,"Fix orient/fcc file open failed"); + if (inpfile == nullptr) error->one(FLERR,"Fix orient/fcc file open failed"); for (int i = 0; i < 6; i++) { result = fgets(line,IMGMAX,inpfile); if (!result) error->one(FLERR,"Fix orient/fcc file read failed"); diff --git a/src/MISC/fix_thermal_conductivity.cpp b/src/MISC/fix_thermal_conductivity.cpp index d0add6fecb..ac86162e31 100644 --- a/src/MISC/fix_thermal_conductivity.cpp +++ b/src/MISC/fix_thermal_conductivity.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_thermal_conductivity.h" -#include + #include #include "atom.h" #include "force.h" @@ -35,13 +35,13 @@ using namespace FixConst; FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - index_lo(NULL), index_hi(NULL), ke_lo(NULL), ke_hi(NULL) + index_lo(nullptr), index_hi(nullptr), ke_lo(nullptr), ke_hi(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix thermal/conductivity command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix thermal/conductivity command"); scalar_flag = 1; @@ -53,7 +53,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, else if (strcmp(arg[4],"z") == 0) edim = 2; else error->all(FLERR,"Illegal fix thermal/conductivity command"); - nbin = force->inumeric(FLERR,arg[5]); + nbin = utils::inumeric(FLERR,arg[5],false,lmp); if (nbin % 2 || nbin <= 2) error->all(FLERR,"Illegal fix thermal/conductivity command"); @@ -66,7 +66,7 @@ FixThermalConductivity::FixThermalConductivity(LAMMPS *lmp, if (strcmp(arg[iarg],"swap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix thermal/conductivity command"); - nswap = force->inumeric(FLERR,arg[iarg+1]); + nswap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nswap <= 0) error->all(FLERR, "Fix thermal/conductivity swap value must be positive"); diff --git a/src/MISC/fix_ttm.cpp b/src/MISC/fix_ttm.cpp index 529914ec34..a1f5425038 100644 --- a/src/MISC/fix_ttm.cpp +++ b/src/MISC/fix_ttm.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_ttm.h" -#include + #include #include #include "atom.h" @@ -29,8 +29,8 @@ #include "random_mars.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + #include "tokenizer.h" using namespace LAMMPS_NS; @@ -42,11 +42,11 @@ using namespace FixConst; FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - random(NULL), fp(NULL), nsum(NULL), nsum_all(NULL), - gfactor1(NULL), gfactor2(NULL), ratio(NULL), flangevin(NULL), - T_electron(NULL), T_electron_old(NULL), sum_vsq(NULL), sum_mass_vsq(NULL), - sum_vsq_all(NULL), sum_mass_vsq_all(NULL), net_energy_transfer(NULL), - net_energy_transfer_all(NULL) + random(nullptr), fp(nullptr), nsum(nullptr), nsum_all(nullptr), + gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), flangevin(nullptr), + T_electron(nullptr), T_electron_old(nullptr), sum_vsq(nullptr), sum_mass_vsq(nullptr), + sum_vsq_all(nullptr), sum_mass_vsq_all(nullptr), net_energy_transfer(nullptr), + net_energy_transfer_all(nullptr) { if (narg < 15) error->all(FLERR,"Illegal fix ttm command"); @@ -58,23 +58,23 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 1; restart_global = 1; - seed = force->inumeric(FLERR,arg[3]); - electronic_specific_heat = force->numeric(FLERR,arg[4]); - electronic_density = force->numeric(FLERR,arg[5]); - electronic_thermal_conductivity = force->numeric(FLERR,arg[6]); - gamma_p = force->numeric(FLERR,arg[7]); - gamma_s = force->numeric(FLERR,arg[8]); - v_0 = force->numeric(FLERR,arg[9]); - nxnodes = force->inumeric(FLERR,arg[10]); - nynodes = force->inumeric(FLERR,arg[11]); - nznodes = force->inumeric(FLERR,arg[12]); - nfileevery = force->inumeric(FLERR,arg[14]); + seed = utils::inumeric(FLERR,arg[3],false,lmp); + electronic_specific_heat = utils::numeric(FLERR,arg[4],false,lmp); + electronic_density = utils::numeric(FLERR,arg[5],false,lmp); + electronic_thermal_conductivity = utils::numeric(FLERR,arg[6],false,lmp); + gamma_p = utils::numeric(FLERR,arg[7],false,lmp); + gamma_s = utils::numeric(FLERR,arg[8],false,lmp); + v_0 = utils::numeric(FLERR,arg[9],false,lmp); + nxnodes = utils::inumeric(FLERR,arg[10],false,lmp); + nynodes = utils::inumeric(FLERR,arg[11],false,lmp); + nznodes = utils::inumeric(FLERR,arg[12],false,lmp); + nfileevery = utils::inumeric(FLERR,arg[14],false,lmp); if (nfileevery) { if (narg != 16) error->all(FLERR,"Illegal fix ttm command"); if (comm->me == 0) { fp = fopen(arg[15],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open output file {}: {}", arg[15], utils::getsyserror())); } @@ -128,7 +128,7 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes, "TTM:net_energy_transfer_all"); - flangevin = NULL; + flangevin = nullptr; grow_arrays(atom->nmax); // zero out the flangevin array @@ -139,8 +139,8 @@ FixTTM::FixTTM(LAMMPS *lmp, int narg, char **arg) : flangevin[i][2] = 0; } - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // set initial electron temperatures from user input file @@ -341,7 +341,7 @@ void FixTTM::read_initial_electron_temperatures(const char *filename) int ixnode,iynode,iznode; double T_tmp; while (1) { - if (fgets(line,MAXLINE,fpr) == NULL) break; + if (fgets(line,MAXLINE,fpr) == nullptr) break; ValueTokenizer values(line); if (values.has_next()) ixnode = values.next_int(); if (values.has_next()) iynode = values.next_int(); @@ -674,7 +674,7 @@ void FixTTM::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them - + int m = 0; for (int i = 0; i < nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/MISC/fix_viscosity.cpp b/src/MISC/fix_viscosity.cpp index d5a97cd4b0..90e6fcda63 100644 --- a/src/MISC/fix_viscosity.cpp +++ b/src/MISC/fix_viscosity.cpp @@ -17,14 +17,14 @@ ------------------------------------------------------------------------- */ #include "fix_viscosity.h" -#include -#include -#include + #include "atom.h" #include "domain.h" -#include "modify.h" #include "error.h" -#include "force.h" +#include "modify.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -37,13 +37,13 @@ using namespace FixConst; FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pos_index(NULL), neg_index(NULL), pos_delta(NULL), neg_delta(NULL) + pos_index(nullptr), neg_index(nullptr), pos_delta(nullptr), neg_delta(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix viscosity command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix viscosity command"); scalar_flag = 1; @@ -60,7 +60,7 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[5],"z") == 0) pdim = 2; else error->all(FLERR,"Illegal fix viscosity command"); - nbin = force->inumeric(FLERR,arg[6]); + nbin = utils::inumeric(FLERR,arg[6],false,lmp); if (nbin % 2 || nbin <= 2) error->all(FLERR,"Illegal fix viscosity command"); // optional keywords @@ -72,14 +72,14 @@ FixViscosity::FixViscosity(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"swap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command"); - nswap = force->inumeric(FLERR,arg[iarg+1]); + nswap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nswap <= 0) error->all(FLERR,"Fix viscosity swap value must be positive"); iarg += 2; } else if (strcmp(arg[iarg],"vtarget") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix viscosity command"); if (strcmp(arg[iarg+1],"INF") == 0) vtarget = BIG; - else vtarget = force->numeric(FLERR,arg[iarg+1]); + else vtarget = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (vtarget <= 0.0) error->all(FLERR,"Fix viscosity vtarget value must be positive"); iarg += 2; diff --git a/src/MISC/pair_nm_cut.cpp b/src/MISC/pair_nm_cut.cpp index 07731fe93b..4090677a03 100644 --- a/src/MISC/pair_nm_cut.cpp +++ b/src/MISC/pair_nm_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_nm_cut.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -179,7 +179,7 @@ void PairNMCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -202,16 +202,16 @@ void PairNMCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double e0_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); - double nn_one = force->numeric(FLERR,arg[4]); - double mm_one = force->numeric(FLERR,arg[5]); + double e0_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); + double nn_one = utils::numeric(FLERR,arg[4],false,lmp); + double mm_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -319,15 +319,15 @@ void PairNMCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -357,10 +357,10 @@ void PairNMCut::write_restart_settings(FILE *fp) void PairNMCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -422,5 +422,5 @@ void *PairNMCut::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/pair_nm_cut_coul_cut.cpp b/src/MISC/pair_nm_cut_coul_cut.cpp index 270f4080ee..1f0ae96324 100644 --- a/src/MISC/pair_nm_cut_coul_cut.cpp +++ b/src/MISC/pair_nm_cut_coul_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_nm_cut_coul_cut.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -203,9 +203,9 @@ void PairNMCutCoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -231,18 +231,18 @@ void PairNMCutCoulCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double e0_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); - double nn_one = force->numeric(FLERR,arg[4]); - double mm_one = force->numeric(FLERR,arg[5]); + double e0_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); + double nn_one = utils::numeric(FLERR,arg[4],false,lmp); + double mm_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 7) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 8) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 7) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 8) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -370,16 +370,16 @@ void PairNMCutCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -411,11 +411,11 @@ void PairNMCutCoulCut::write_restart_settings(FILE *fp) void PairNMCutCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -493,5 +493,5 @@ void *PairNMCutCoulCut::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/pair_nm_cut_coul_long.cpp b/src/MISC/pair_nm_cut_coul_long.cpp index b63ede2b63..a981204af6 100644 --- a/src/MISC/pair_nm_cut_coul_long.cpp +++ b/src/MISC/pair_nm_cut_coul_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_nm_cut_coul_long.h" -#include + #include #include #include "atom.h" @@ -28,7 +28,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -46,7 +46,7 @@ using namespace MathConst; PairNMCutCoulLong::PairNMCutCoulLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -242,9 +242,9 @@ void PairNMCutCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -267,16 +267,16 @@ void PairNMCutCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double e0_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); - double nn_one = force->numeric(FLERR,arg[4]); - double mm_one = force->numeric(FLERR,arg[5]); + double e0_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); + double nn_one = utils::numeric(FLERR,arg[4],false,lmp); + double mm_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 7) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 7) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -308,13 +308,13 @@ void PairNMCutCoulLong::init_style() cut_coulsq = cut_coul * cut_coul; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -414,15 +414,15 @@ void PairNMCutCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&e0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&nn[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&e0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&r0[i][j],1,MPI_DOUBLE,0,world); @@ -455,13 +455,13 @@ void PairNMCutCoulLong::write_restart_settings(FILE *fp) void PairNMCutCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -576,5 +576,5 @@ void *PairNMCutCoulLong::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"nn") == 0) return (void *) nn; if (strcmp(str,"mm") == 0) return (void *) mm; - return NULL; + return nullptr; } diff --git a/src/MISC/xdr_compat.cpp b/src/MISC/xdr_compat.cpp index 9806b0bbd2..7483b4aa18 100644 --- a/src/MISC/xdr_compat.cpp +++ b/src/MISC/xdr_compat.cpp @@ -352,7 +352,7 @@ xdr_opaque (XDR *xdrs, char *cp, unsigned int cnt) /* * XDR null terminated ASCII strings * xdr_string deals with "C strings" - arrays of bytes that are - * terminated by a NULL character. The parameter cpp references a + * terminated by a nullptr character. The parameter cpp references a * pointer to storage; If the pointer is null, then the necessary * storage is allocated. The last parameter is the max allowed length * of the string as specified by a protocol. @@ -370,13 +370,13 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) switch (xdrs->x_op) { case XDR_FREE: - if (sp == NULL) + if (sp == nullptr) { return TRUE; /* already free */ } /* fall through... */ case XDR_ENCODE: - if (sp == NULL) + if (sp == nullptr) return FALSE; size = strlen (sp); break; @@ -404,9 +404,9 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) { return TRUE; } - if (sp == NULL) + if (sp == nullptr) *cpp = sp = (char *) malloc (nodesize); - if (sp == NULL) + if (sp == nullptr) { (void) fputs ("xdr_string: out of memory\n", stderr); return FALSE; @@ -419,7 +419,7 @@ xdr_string (XDR *xdrs, char **cpp, unsigned int maxsize) case XDR_FREE: free (sp); - *cpp = NULL; + *cpp = nullptr; return TRUE; } return FALSE; @@ -660,7 +660,7 @@ xdrstdio_inline (XDR * /*xdrs*/, int /*len*/) * most of the gains to be had here and require storage * management on this buffer, so we don't do this. */ - return NULL; + return nullptr; } static bool_t diff --git a/src/MLIAP/compute_mliap.cpp b/src/MLIAP/compute_mliap.cpp index 134994f829..fe406772ca 100644 --- a/src/MLIAP/compute_mliap.cpp +++ b/src/MLIAP/compute_mliap.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include "mliap_data.h" #include "mliap_model_linear.h" #include "mliap_model_quadratic.h" @@ -22,7 +22,6 @@ #include "update.h" #include "modify.h" #include "neighbor.h" -#include "neigh_list.h" #include "neigh_request.h" #include "force.h" #include "pair.h" @@ -35,8 +34,8 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; ComputeMLIAP::ComputeMLIAP(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), mliaparray(NULL), - mliaparrayall(NULL), map(NULL) + Compute(lmp, narg, arg), mliaparray(nullptr), + mliaparrayall(nullptr), map(nullptr) { array_flag = 1; extarray = 0; @@ -128,7 +127,7 @@ ComputeMLIAP::~ComputeMLIAP() void ComputeMLIAP::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute mliap requires a pair style be defined"); if (descriptor->cutmax > force->pair->cutforce) diff --git a/src/MLIAP/compute_mliap.h b/src/MLIAP/compute_mliap.h index 5602ace89b..1172111247 100644 --- a/src/MLIAP/compute_mliap.h +++ b/src/MLIAP/compute_mliap.h @@ -21,7 +21,7 @@ ComputeStyle(mliap,ComputeMLIAP) #define LMP_COMPUTE_MLIAP_H #include "compute.h" -#include + namespace LAMMPS_NS { diff --git a/src/MLIAP/mliap_data.cpp b/src/MLIAP/mliap_data.cpp index 7bffd8ec3b..cb29dffd46 100644 --- a/src/MLIAP/mliap_data.cpp +++ b/src/MLIAP/mliap_data.cpp @@ -11,24 +11,13 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include -#include #include "mliap_data.h" -#include "mliap_model_linear.h" -#include "mliap_model_quadratic.h" -#include "mliap_descriptor_snap.h" -#include "compute_mliap.h" + #include "atom.h" -#include "update.h" -#include "modify.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" -#include "pair.h" -#include "comm.h" #include "memory.h" -#include "error.h" +#include "mliap_descriptor.h" +#include "mliap_model.h" +#include "neigh_list.h" using namespace LAMMPS_NS; @@ -36,10 +25,10 @@ MLIAPData::MLIAPData(LAMMPS *lmp, int gradgradflag_in, int *map_in, class MLIAPModel* model_in, class MLIAPDescriptor* descriptor_in, class PairMLIAP* pairmliap_in) : - Pointers(lmp), gradforce(NULL), betas(NULL), descriptors(NULL), gamma(NULL), - gamma_row_index(NULL), gamma_col_index(NULL), egradient(NULL), - numneighs(NULL), iatoms(NULL), ielems(NULL), jatoms(NULL), jelems(NULL), - rij(NULL), graddesc(NULL), model(NULL), descriptor(NULL), list(NULL) + Pointers(lmp), gradforce(nullptr), betas(nullptr), descriptors(nullptr), gamma(nullptr), + gamma_row_index(nullptr), gamma_col_index(nullptr), egradient(nullptr), + numneighs(nullptr), iatoms(nullptr), ielems(nullptr), jatoms(nullptr), jelems(nullptr), + rij(nullptr), graddesc(nullptr), model(nullptr), descriptor(nullptr), list(nullptr) { gradgradflag = gradgradflag_in; map = map_in; diff --git a/src/MLIAP/mliap_data.h b/src/MLIAP/mliap_data.h index 0307d93aee..ffac9ccd4c 100644 --- a/src/MLIAP/mliap_data.h +++ b/src/MLIAP/mliap_data.h @@ -21,7 +21,7 @@ namespace LAMMPS_NS { class MLIAPData : protected Pointers { public: - MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = NULL); + MLIAPData(class LAMMPS*, int, int*, class MLIAPModel*, class MLIAPDescriptor*, class PairMLIAP* = nullptr); ~MLIAPData(); void init(); diff --git a/src/MLIAP/mliap_descriptor.cpp b/src/MLIAP/mliap_descriptor.cpp index d654b33008..63d4241e01 100644 --- a/src/MLIAP/mliap_descriptor.cpp +++ b/src/MLIAP/mliap_descriptor.cpp @@ -12,14 +12,9 @@ ------------------------------------------------------------------------- */ #include "mliap_descriptor.h" -#include "atom.h" -#include "memory.h" -#include "error.h" using namespace LAMMPS_NS; -#define MAXLINE 1024 -#define MAXWORD 3 /* ---------------------------------------------------------------------- */ diff --git a/src/MLIAP/mliap_descriptor_snap.cpp b/src/MLIAP/mliap_descriptor_snap.cpp index 24e8b19a65..21ba68e9a8 100644 --- a/src/MLIAP/mliap_descriptor_snap.cpp +++ b/src/MLIAP/mliap_descriptor_snap.cpp @@ -12,20 +12,17 @@ ------------------------------------------------------------------------- */ #include "mliap_descriptor_snap.h" -#include "pair_mliap.h" -#include "mliap_data.h" -#include -#include -#include -#include + #include "atom.h" -#include "force.h" #include "comm.h" -#include "utils.h" -#include "sna.h" -#include "memory.h" #include "error.h" -#include "fmt/format.h" +#include "memory.h" +#include "mliap_data.h" +#include "pair_mliap.h" +#include "sna.h" + +#include +#include using namespace LAMMPS_NS; @@ -38,10 +35,10 @@ MLIAPDescriptorSNAP::MLIAPDescriptorSNAP(LAMMPS *lmp, char *paramfilename): MLIAPDescriptor(lmp) { nelements = 0; - elements = NULL; - radelem = NULL; - wjelem = NULL; - snaptr = NULL; + elements = nullptr; + radelem = nullptr; + wjelem = nullptr; + snaptr = nullptr; read_paramfile(paramfilename); snaptr = new SNA(lmp, rfac0, twojmax, @@ -376,8 +373,8 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) FILE *fpparam; if (comm->me == 0) { - fpparam = force->open_potential(paramfilename); - if (fpparam == NULL) + fpparam = utils::open_potential(paramfilename,lmp,nullptr); + if (fpparam == nullptr) error->one(FLERR,fmt::format("Cannot open SNAP parameter file {}: {}", paramfilename, utils::getsyserror())); } @@ -389,7 +386,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpparam); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpparam); } else n = strlen(line) + 1; @@ -409,7 +406,7 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) // strip single and double quotes from words char* keywd = strtok(line,"' \t\n\r\f"); - char* keyval = strtok(NULL,"' \t\n\r\f"); + char* keyval = strtok(nullptr,"' \t\n\r\f"); if (comm->me == 0) { utils::logmesg(lmp, fmt::format("SNAP keyword {} {} \n", keywd, keyval)); @@ -430,19 +427,19 @@ void MLIAPDescriptorSNAP::read_paramfile(char *paramfilename) int n = strlen(elemtmp) + 1; elements[ielem] = new char[n]; strcpy(elements[ielem],elemtmp); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } elementsflag = 1; } else if (strcmp(keywd,"radelems") == 0) { for (int ielem = 0; ielem < nelements; ielem++) { radelem[ielem] = atof(keyval); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } radelemflag = 1; } else if (strcmp(keywd,"welems") == 0) { for (int ielem = 0; ielem < nelements; ielem++) { wjelem[ielem] = atof(keyval); - keyval = strtok(NULL,"' \t\n\r\f"); + keyval = strtok(nullptr,"' \t\n\r\f"); } wjelemflag = 1; } diff --git a/src/MLIAP/mliap_model.cpp b/src/MLIAP/mliap_model.cpp index bc760b7a68..7ac1013c4f 100644 --- a/src/MLIAP/mliap_model.cpp +++ b/src/MLIAP/mliap_model.cpp @@ -12,17 +12,12 @@ ------------------------------------------------------------------------- */ #include "mliap_model.h" -#include "pair_mliap.h" -#include -#include -#include "atom.h" -#include "force.h" + #include "comm.h" -#include "utils.h" -#include "neigh_list.h" -#include "memory.h" #include "error.h" -#include "fmt/format.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; @@ -33,7 +28,7 @@ using namespace LAMMPS_NS; MLIAPModel::MLIAPModel(LAMMPS* lmp, char* coefffilename) : Pointers(lmp) { - coeffelem = NULL; + coeffelem = nullptr; if (coefffilename) read_coeffs(coefffilename); else { nparams = 0; @@ -85,8 +80,8 @@ void MLIAPModel::read_coeffs(char *coefffilename) FILE *fpcoeff; if (comm->me == 0) { - fpcoeff = force->open_potential(coefffilename); - if (fpcoeff == NULL) + fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); + if (fpcoeff == nullptr) error->one(FLERR,fmt::format("Cannot open MLIAPModel coeff file {}: {}", coefffilename,utils::getsyserror())); } @@ -99,7 +94,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) while (nwords == 0) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -124,7 +119,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) int iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); nelements = atoi(words[0]); nparams = atoi(words[1]); @@ -139,7 +134,7 @@ void MLIAPModel::read_coeffs(char *coefffilename) for (int icoeff = 0; icoeff < nparams; icoeff++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; diff --git a/src/MLIAP/mliap_model_linear.h b/src/MLIAP/mliap_model_linear.h index 67ba0985a2..326407faa8 100644 --- a/src/MLIAP/mliap_model_linear.h +++ b/src/MLIAP/mliap_model_linear.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { class MLIAPModelLinear : public MLIAPModel { public: - MLIAPModelLinear(LAMMPS*, char* = NULL); + MLIAPModelLinear(LAMMPS*, char* = nullptr); ~MLIAPModelLinear(); virtual int get_nparams(); virtual int get_gamma_nnz(class MLIAPData*); diff --git a/src/MLIAP/mliap_model_quadratic.h b/src/MLIAP/mliap_model_quadratic.h index 188d78661f..b41df18a07 100644 --- a/src/MLIAP/mliap_model_quadratic.h +++ b/src/MLIAP/mliap_model_quadratic.h @@ -20,7 +20,7 @@ namespace LAMMPS_NS { class MLIAPModelQuadratic : public MLIAPModel { public: - MLIAPModelQuadratic(LAMMPS*, char* = NULL); + MLIAPModelQuadratic(LAMMPS*, char* = nullptr); ~MLIAPModelQuadratic(); virtual int get_nparams(); virtual int get_gamma_nnz(class MLIAPData*); diff --git a/src/MLIAP/pair_mliap.cpp b/src/MLIAP/pair_mliap.cpp index f2e042141c..4c6d906787 100644 --- a/src/MLIAP/pair_mliap.cpp +++ b/src/MLIAP/pair_mliap.cpp @@ -11,22 +11,22 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include -#include -#include -#include +#include "pair_mliap.h" + #include "mliap_data.h" #include "mliap_model_linear.h" #include "mliap_model_quadratic.h" #include "mliap_descriptor_snap.h" -#include "pair_mliap.h" + #include "atom.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_request.h" +#include "neighbor.h" + +#include +#include using namespace LAMMPS_NS; diff --git a/src/MOLECULE/angle_charmm.cpp b/src/MOLECULE/angle_charmm.cpp index 161ad90ea3..61051084bb 100644 --- a/src/MOLECULE/angle_charmm.cpp +++ b/src/MOLECULE/angle_charmm.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_charmm.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -196,12 +196,12 @@ void AngleCharmm::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); - double k_ub_one = force->numeric(FLERR,arg[3]); - double r_ub_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); + double k_ub_one = utils::numeric(FLERR,arg[3],false,lmp); + double r_ub_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0 from degrees to radians @@ -246,10 +246,10 @@ void AngleCharmm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r_ub[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_cosine.cpp b/src/MOLECULE/angle_cosine.cpp index 59593d2448..b4190d902d 100644 --- a/src/MOLECULE/angle_cosine.cpp +++ b/src/MOLECULE/angle_cosine.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "angle_cosine.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -156,9 +156,9 @@ void AngleCosine::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -194,7 +194,7 @@ void AngleCosine::read_restart(FILE *fp) { allocate(); - if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); + if (comm->me == 0) utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); for (int i = 1; i <= atom->nangletypes; i++) setflag[i] = 1; diff --git a/src/MOLECULE/angle_cosine_periodic.cpp b/src/MOLECULE/angle_cosine_periodic.cpp index b305ece7dd..1cf0cb8873 100644 --- a/src/MOLECULE/angle_cosine_periodic.cpp +++ b/src/MOLECULE/angle_cosine_periodic.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_cosine_periodic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -27,7 +27,7 @@ #include "math_special.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -201,11 +201,11 @@ void AngleCosinePeriodic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double c_one = force->numeric(FLERR,arg[1]); - int b_one = force->inumeric(FLERR,arg[2]); - int n_one = force->inumeric(FLERR,arg[3]); + double c_one = utils::numeric(FLERR,arg[1],false,lmp); + int b_one = utils::inumeric(FLERR,arg[2],false,lmp); + int n_one = utils::inumeric(FLERR,arg[3],false,lmp); if (n_one <= 0) error->all(FLERR,"Incorrect args for angle coefficients"); int count = 0; @@ -247,9 +247,9 @@ void AngleCosinePeriodic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&b[1],sizeof(int),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&b[1],sizeof(int),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_cosine_squared.cpp b/src/MOLECULE/angle_cosine_squared.cpp index 9056600c3f..dc1a20fd8b 100644 --- a/src/MOLECULE/angle_cosine_squared.cpp +++ b/src/MOLECULE/angle_cosine_squared.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_cosine_squared.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -37,8 +37,8 @@ using namespace MathConst; AngleCosineSquared::AngleCosineSquared(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - theta0 = NULL; + k = nullptr; + theta0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -172,10 +172,10 @@ void AngleCosineSquared::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert theta0 from degrees to radians @@ -216,8 +216,8 @@ void AngleCosineSquared::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_harmonic.cpp b/src/MOLECULE/angle_harmonic.cpp index baeb9a8ed8..19142f94c8 100644 --- a/src/MOLECULE/angle_harmonic.cpp +++ b/src/MOLECULE/angle_harmonic.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "angle_harmonic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -33,8 +33,8 @@ using namespace MathConst; AngleHarmonic::AngleHarmonic(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - theta0 = NULL; + k = nullptr; + theta0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -172,10 +172,10 @@ void AngleHarmonic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert theta0 from degrees to radians @@ -216,8 +216,8 @@ void AngleHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/angle_table.cpp b/src/MOLECULE/angle_table.cpp index 4890a11975..3fbda1cb99 100644 --- a/src/MOLECULE/angle_table.cpp +++ b/src/MOLECULE/angle_table.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "angle_table.h" -#include + #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -28,10 +28,10 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "table_file_reader.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -47,7 +47,7 @@ AngleTable::AngleTable(LAMMPS *lmp) : Angle(lmp) { writedata = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ @@ -190,7 +190,7 @@ void AngleTable::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in angle style table"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of angle table entries"); // delete old tables, since cannot just change settings @@ -205,7 +205,7 @@ void AngleTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -218,7 +218,7 @@ void AngleTable::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); int me; MPI_Comm_rank(world,&me); @@ -311,8 +311,8 @@ void AngleTable::write_restart_settings(FILE *fp) void AngleTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -351,10 +351,10 @@ double AngleTable::single(int type, int i1, int i2, int i3) void AngleTable::null_table(Table *tb) { - tb->afile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->ang = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->afile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->ang = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -411,7 +411,7 @@ void AngleTable::read_table(Table *tb, char *file, char *keyword) tb->afile[i] = values.next_double(); tb->efile[i] = values.next_double(); tb->ffile[i] = values.next_double(); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { ++cerror; } } @@ -526,7 +526,7 @@ void AngleTable::param_extract(Table *tb, char *line) error->one(FLERR,"Invalid keyword in angle table parameters"); } } - } catch(TokenizerException & e) { + } catch(TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MOLECULE/atom_vec_angle.cpp b/src/MOLECULE/atom_vec_angle.cpp index 3dc8c90882..3c69f30add 100644 --- a/src/MOLECULE/atom_vec_angle.cpp +++ b/src/MOLECULE/atom_vec_angle.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = 1; @@ -55,7 +55,7 @@ AtomVecAngle::AtomVecAngle(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = 0; - bond_negative = angle_negative = NULL; + bond_negative = angle_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_bond.cpp b/src/MOLECULE/atom_vec_bond.cpp index 2fa445c8ee..a61a7f9f05 100644 --- a/src/MOLECULE/atom_vec_bond.cpp +++ b/src/MOLECULE/atom_vec_bond.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecBond::AtomVecBond(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = 1; @@ -50,7 +50,7 @@ AtomVecBond::AtomVecBond(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = 0; - bond_negative = NULL; + bond_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_full.cpp b/src/MOLECULE/atom_vec_full.cpp index 866cf796c9..5ec0df9af8 100644 --- a/src/MOLECULE/atom_vec_full.cpp +++ b/src/MOLECULE/atom_vec_full.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = atom->q_flag = 1; @@ -75,7 +75,7 @@ AtomVecFull::AtomVecFull(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; - bond_negative = angle_negative = dihedral_negative = improper_negative = NULL; + bond_negative = angle_negative = dihedral_negative = improper_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_molecular.cpp b/src/MOLECULE/atom_vec_molecular.cpp index e90bec5108..26bb7b3e5a 100644 --- a/src/MOLECULE/atom_vec_molecular.cpp +++ b/src/MOLECULE/atom_vec_molecular.cpp @@ -20,9 +20,9 @@ using namespace LAMMPS_NS; AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 1; + molecular = Atom::MOLECULAR; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 1; - mass_type = 1; + mass_type = PER_TYPE; atom->molecule_flag = 1; @@ -75,7 +75,7 @@ AtomVecMolecular::AtomVecMolecular(LAMMPS *lmp) : AtomVec(lmp) setup_fields(); bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; - bond_negative = angle_negative = dihedral_negative = improper_negative = NULL; + bond_negative = angle_negative = dihedral_negative = improper_negative = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/MOLECULE/atom_vec_template.cpp b/src/MOLECULE/atom_vec_template.cpp index 97d4c865ba..74e8199883 100644 --- a/src/MOLECULE/atom_vec_template.cpp +++ b/src/MOLECULE/atom_vec_template.cpp @@ -12,15 +12,10 @@ ------------------------------------------------------------------------- */ #include "atom_vec_template.h" + #include "atom.h" -#include "molecule.h" -#include "comm.h" -#include "domain.h" -#include "modify.h" -#include "fix.h" -#include "memory.h" #include "error.h" -#include "utils.h" +#include "molecule.h" using namespace LAMMPS_NS; @@ -28,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecTemplate::AtomVecTemplate(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 2; - mass_type = 1; + molecular = Atom::TEMPLATE; + mass_type = PER_TYPE; atom->molecule_flag = 1; diff --git a/src/MOLECULE/bond_fene.cpp b/src/MOLECULE/bond_fene.cpp index 357c37b7a2..f79c56b636 100644 --- a/src/MOLECULE/bond_fene.cpp +++ b/src/MOLECULE/bond_fene.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "bond_fene.h" -#include + #include #include #include "atom.h" @@ -22,8 +22,8 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; @@ -152,12 +152,12 @@ void BondFENE::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -215,10 +215,10 @@ void BondFENE::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -279,5 +279,5 @@ void *BondFENE::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_fene_expand.cpp b/src/MOLECULE/bond_fene_expand.cpp index 9cdc2639a5..8166e63e24 100644 --- a/src/MOLECULE/bond_fene_expand.cpp +++ b/src/MOLECULE/bond_fene_expand.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "bond_fene_expand.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -21,7 +21,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -159,13 +159,13 @@ void BondFENEExpand::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); - double shift_one = force->numeric(FLERR,arg[5]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); + double shift_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -225,11 +225,11 @@ void BondFENEExpand::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&sigma[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/bond_gromos.cpp b/src/MOLECULE/bond_gromos.cpp index 27447d7298..85653a60f3 100644 --- a/src/MOLECULE/bond_gromos.cpp +++ b/src/MOLECULE/bond_gromos.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "bond_gromos.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -24,7 +24,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -123,10 +123,10 @@ void BondGromos::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -167,8 +167,8 @@ void BondGromos::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -204,5 +204,5 @@ void *BondGromos::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_harmonic.cpp b/src/MOLECULE/bond_harmonic.cpp index 5ea60cda46..6e523b4923 100644 --- a/src/MOLECULE/bond_harmonic.cpp +++ b/src/MOLECULE/bond_harmonic.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "bond_harmonic.h" -#include + #include #include #include "atom.h" @@ -21,7 +21,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -124,10 +124,10 @@ void BondHarmonic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -168,8 +168,8 @@ void BondHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -208,7 +208,7 @@ void *BondHarmonic::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"kappa")==0) return (void*) k; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_morse.cpp b/src/MOLECULE/bond_morse.cpp index c644d2be1c..f7e4e6c919 100644 --- a/src/MOLECULE/bond_morse.cpp +++ b/src/MOLECULE/bond_morse.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "bond_morse.h" -#include + #include #include #include "atom.h" @@ -25,7 +25,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -126,11 +126,11 @@ void BondMorse::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double d0_one = force->numeric(FLERR,arg[1]); - double alpha_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); + double d0_one = utils::numeric(FLERR,arg[1],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -173,9 +173,9 @@ void BondMorse::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&d0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&alpha[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&d0[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -213,5 +213,5 @@ void *BondMorse::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_nonlinear.cpp b/src/MOLECULE/bond_nonlinear.cpp index 1451fa29c2..7c74d8f418 100644 --- a/src/MOLECULE/bond_nonlinear.cpp +++ b/src/MOLECULE/bond_nonlinear.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "bond_nonlinear.h" -#include + #include #include #include "atom.h" @@ -21,7 +21,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -123,11 +123,11 @@ void BondNonlinear::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double epsilon_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); - double lamda_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); + double lamda_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -168,9 +168,9 @@ void BondNonlinear::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&lamda[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&epsilon[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&lamda[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&epsilon[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -211,5 +211,5 @@ void *BondNonlinear::extract(const char *str, int &dim) dim = 1; if (strcmp(str,"epsilon")==0) return (void*) epsilon; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/bond_quartic.cpp b/src/MOLECULE/bond_quartic.cpp index 813e322473..e2c2e8f742 100644 --- a/src/MOLECULE/bond_quartic.cpp +++ b/src/MOLECULE/bond_quartic.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "bond_quartic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -25,7 +25,7 @@ #include "pair.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -201,13 +201,13 @@ void BondQuartic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double b1_one = force->numeric(FLERR,arg[2]); - double b2_one = force->numeric(FLERR,arg[3]); - double rc_one = force->numeric(FLERR,arg[4]); - double u0_one = force->numeric(FLERR,arg[5]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double b1_one = utils::numeric(FLERR,arg[2],false,lmp); + double b2_one = utils::numeric(FLERR,arg[3],false,lmp); + double rc_one = utils::numeric(FLERR,arg[4],false,lmp); + double u0_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -229,12 +229,12 @@ void BondQuartic::coeff(int narg, char **arg) void BondQuartic::init_style() { - if (force->pair == NULL || force->pair->single_enable == 0) + if (force->pair == nullptr || force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support bond_style quartic"); if (force->angle || force->dihedral || force->improper) error->all(FLERR, "Bond style quartic cannot be used with 3,4-body interactions"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR, "Bond style quartic cannot be used with atom style template"); @@ -276,11 +276,11 @@ void BondQuartic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&b1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&b2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&rc[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&u0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&b1[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/bond_table.cpp b/src/MOLECULE/bond_table.cpp index 3a1529a155..32bc6432b3 100644 --- a/src/MOLECULE/bond_table.cpp +++ b/src/MOLECULE/bond_table.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "bond_table.h" -#include + #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,10 +26,10 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "table_file_reader.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; @@ -43,7 +43,7 @@ BondTable::BondTable(LAMMPS *lmp) : Bond(lmp) { writedata = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- */ @@ -142,7 +142,7 @@ void BondTable::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in bond style table"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of bond table entries"); // delete old tables, since cannot just change settings @@ -157,7 +157,7 @@ void BondTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -170,7 +170,7 @@ void BondTable::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); int me; MPI_Comm_rank(world,&me); @@ -254,8 +254,8 @@ void BondTable::write_restart_settings(FILE *fp) void BondTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -278,10 +278,10 @@ double BondTable::single(int type, double rsq, int /*i*/, int /*j*/, void BondTable::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -341,7 +341,7 @@ void BondTable::read_table(Table *tb, char *file, char *keyword) tb->rfile[i] = values.next_double(); tb->efile[i] = values.next_double(); tb->ffile[i] = values.next_double(); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { ++cerror; } @@ -491,7 +491,7 @@ void BondTable::param_extract(Table *tb, char *line) error->one(FLERR,"Invalid keyword in bond table parameters"); } } - } catch(TokenizerException & e) { + } catch(TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/MOLECULE/dihedral_charmm.cpp b/src/MOLECULE/dihedral_charmm.cpp index 0163772123..cc615213a0 100644 --- a/src/MOLECULE/dihedral_charmm.cpp +++ b/src/MOLECULE/dihedral_charmm.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_charmm.h" -#include + #include #include #include "atom.h" @@ -29,7 +29,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -330,16 +330,16 @@ void DihedralCharmm::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); // require integer values of shift for backwards compatibility // arbitrary phase angle shift could be allowed, but would break // backwards compatibility and is probably not needed - double k_one = force->numeric(FLERR,arg[1]); - int multiplicity_one = force->inumeric(FLERR,arg[2]); - int shift_one = force->inumeric(FLERR,arg[3]); - double weight_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[2],false,lmp); + int shift_one = utils::inumeric(FLERR,arg[3],false,lmp); + double weight_one = utils::numeric(FLERR,arg[4],false,lmp); if (multiplicity_one < 0) error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients"); @@ -389,7 +389,7 @@ void DihedralCharmm::init_style() " dihedral style charmm for use with CHARMM pair styles"); int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Dihedral charmm is incompatible with Pair style"); lj14_1 = (double **) force->pair->extract("lj14_1",itmp); lj14_2 = (double **) force->pair->extract("lj14_2",itmp); @@ -424,11 +424,11 @@ void DihedralCharmm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_charmmfsw.cpp b/src/MOLECULE/dihedral_charmmfsw.cpp index 39b7e92bd2..a124212117 100644 --- a/src/MOLECULE/dihedral_charmmfsw.cpp +++ b/src/MOLECULE/dihedral_charmmfsw.cpp @@ -19,7 +19,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_charmmfsw.h" -#include + #include #include #include "atom.h" @@ -32,7 +32,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -348,16 +348,16 @@ void DihedralCharmmfsw::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); // require integer values of shift for backwards compatibility // arbitrary phase angle shift could be allowed, but would break // backwards compatibility and is probably not needed - double k_one = force->numeric(FLERR,arg[1]); - int multiplicity_one = force->inumeric(FLERR,arg[2]); - int shift_one = force->inumeric(FLERR,arg[3]); - double weight_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[2],false,lmp); + int shift_one = utils::inumeric(FLERR,arg[3],false,lmp); + double weight_one = utils::numeric(FLERR,arg[4],false,lmp); if (multiplicity_one < 0) error->all(FLERR,"Incorrect multiplicity arg for dihedral coefficients"); @@ -407,7 +407,7 @@ void DihedralCharmmfsw::init_style() " dihedral style charmm for use with CHARMM pair styles"); int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style"); lj14_1 = (double **) force->pair->extract("lj14_1",itmp); lj14_2 = (double **) force->pair->extract("lj14_2",itmp); @@ -428,8 +428,8 @@ void DihedralCharmmfsw::init_style() double *p_cutlj = (double *) force->pair->extract("cut_lj",itmp); double *p_cutcoul = (double *) force->pair->extract("cut_coul",itmp); - if (p_cutcoul == NULL || p_cutljinner == NULL || - p_cutlj == NULL || p_dihedflag == NULL) + if (p_cutcoul == nullptr || p_cutljinner == nullptr || + p_cutlj == nullptr || p_dihedflag == nullptr) error->all(FLERR,"Dihedral charmmfsw is incompatible with Pair style"); dihedflag = *p_dihedflag; @@ -467,11 +467,11 @@ void DihedralCharmmfsw::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&shift[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weight[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&weightflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&multiplicity[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_harmonic.cpp b/src/MOLECULE/dihedral_harmonic.cpp index 48adf07903..87ade01be3 100644 --- a/src/MOLECULE/dihedral_harmonic.cpp +++ b/src/MOLECULE/dihedral_harmonic.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_harmonic.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -274,11 +274,11 @@ void DihedralHarmonic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - int sign_one = force->inumeric(FLERR,arg[2]); - int multiplicity_one = force->inumeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int sign_one = utils::inumeric(FLERR,arg[2],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[3],false,lmp); // require sign = +/- 1 for backwards compatibility // arbitrary phase angle shift could be allowed, but would break @@ -328,9 +328,9 @@ void DihedralHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&sign[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&sign[1],atom->ndihedraltypes,MPI_INT,0,world); diff --git a/src/MOLECULE/dihedral_helix.cpp b/src/MOLECULE/dihedral_helix.cpp index 26461883c6..8c4ba07fb6 100644 --- a/src/MOLECULE/dihedral_helix.cpp +++ b/src/MOLECULE/dihedral_helix.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_helix.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -285,11 +285,11 @@ void DihedralHelix::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double aphi_one = force->numeric(FLERR,arg[1]); - double bphi_one = force->numeric(FLERR,arg[2]); - double cphi_one = force->numeric(FLERR,arg[3]); + double aphi_one = utils::numeric(FLERR,arg[1],false,lmp); + double bphi_one = utils::numeric(FLERR,arg[2],false,lmp); + double cphi_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -323,9 +323,9 @@ void DihedralHelix::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&aphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&bphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&cphi[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&aphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&bphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&cphi[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&aphi[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&bphi[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/dihedral_multi_harmonic.cpp b/src/MOLECULE/dihedral_multi_harmonic.cpp index b5db685247..57c017bd95 100644 --- a/src/MOLECULE/dihedral_multi_harmonic.cpp +++ b/src/MOLECULE/dihedral_multi_harmonic.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_multi_harmonic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -25,7 +25,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -275,13 +275,13 @@ void DihedralMultiHarmonic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double a1_one = force->numeric(FLERR,arg[1]); - double a2_one = force->numeric(FLERR,arg[2]); - double a3_one = force->numeric(FLERR,arg[3]); - double a4_one = force->numeric(FLERR,arg[4]); - double a5_one = force->numeric(FLERR,arg[5]); + double a1_one = utils::numeric(FLERR,arg[1],false,lmp); + double a2_one = utils::numeric(FLERR,arg[2],false,lmp); + double a3_one = utils::numeric(FLERR,arg[3],false,lmp); + double a4_one = utils::numeric(FLERR,arg[4],false,lmp); + double a5_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -319,11 +319,11 @@ void DihedralMultiHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&a1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a5[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&a1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&a2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/dihedral_opls.cpp b/src/MOLECULE/dihedral_opls.cpp index 5dd268b39f..39b979ff23 100644 --- a/src/MOLECULE/dihedral_opls.cpp +++ b/src/MOLECULE/dihedral_opls.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_opls.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -288,12 +288,12 @@ void DihedralOPLS::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k1_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double k1_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); // store 1/2 factor with prefactor @@ -331,10 +331,10 @@ void DihedralOPLS::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k1[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k1[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&k2[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/fix_cmap.cpp b/src/MOLECULE/fix_cmap.cpp index d3b071ebc6..a37f74f5c2 100644 --- a/src/MOLECULE/fix_cmap.cpp +++ b/src/MOLECULE/fix_cmap.cpp @@ -28,9 +28,9 @@ ------------------------------------------------------------------------- */ #include "fix_cmap.h" -#include + #include -#include + #include #include "atom.h" #include "update.h" @@ -41,8 +41,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -62,11 +62,11 @@ using namespace MathConst; FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - crosstermlist(NULL), num_crossterm(NULL), crossterm_type(NULL), - crossterm_atom1(NULL), crossterm_atom2(NULL), crossterm_atom3(NULL), - crossterm_atom4(NULL), crossterm_atom5(NULL), - g_axis(NULL), cmapgrid(NULL), d1cmapgrid(NULL), d2cmapgrid(NULL), - d12cmapgrid(NULL) + crosstermlist(nullptr), num_crossterm(nullptr), crossterm_type(nullptr), + crossterm_atom1(nullptr), crossterm_atom2(nullptr), crossterm_atom3(nullptr), + crossterm_atom4(nullptr), crossterm_atom5(nullptr), + g_axis(nullptr), cmapgrid(nullptr), d1cmapgrid(nullptr), d2cmapgrid(nullptr), + d12cmapgrid(nullptr) { if (narg != 4) error->all(FLERR,"Illegal fix cmap command"); @@ -101,24 +101,24 @@ FixCMAP::FixCMAP(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - num_crossterm = NULL; - crossterm_type = NULL; - crossterm_atom1 = NULL; - crossterm_atom2 = NULL; - crossterm_atom3 = NULL; - crossterm_atom4 = NULL; - crossterm_atom5 = NULL; + num_crossterm = nullptr; + crossterm_type = nullptr; + crossterm_atom1 = nullptr; + crossterm_atom2 = nullptr; + crossterm_atom3 = nullptr; + crossterm_atom4 = nullptr; + crossterm_atom5 = nullptr; nmax_previous = 0; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // local list of crossterms ncmap = 0; maxcrossterm = 0; - crosstermlist = NULL; + crosstermlist = nullptr; } /* --------------------------------------------------------------------- */ @@ -127,8 +127,8 @@ FixCMAP::~FixCMAP() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); memory->destroy(g_axis); memory->destroy(cmapgrid); @@ -631,10 +631,10 @@ void FixCMAP::read_grid_map(char *cmapfile) char *chunk,*line; int i1, i2, i3, i4, i5, i6, j1, j2, j3, j4, j5, j6, counter; - FILE *fp = NULL; + FILE *fp = nullptr; if (comm->me == 0) { - fp = force->open_potential(cmapfile); - if (fp == NULL) + fp = utils::open_potential(cmapfile,lmp,nullptr); + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix cmap file {}: {}", cmapfile, utils::getsyserror())); @@ -654,7 +654,7 @@ void FixCMAP::read_grid_map(char *cmapfile) while (!done) { // only read on rank 0 and broadcast to all other ranks if (comm->me == 0) - done = (fgets(linebuf,MAXLINE,fp) == NULL); + done = (fgets(linebuf,MAXLINE,fp) == nullptr); MPI_Bcast(&done,1,MPI_INT,0,world); if (done) continue; @@ -681,13 +681,13 @@ void FixCMAP::read_grid_map(char *cmapfile) // 6. Glycine before proline map chunk = strtok(line, " \r\n"); - while (chunk != NULL) { + while (chunk != nullptr) { // alanine map if (counter < CMAPDIM*CMAPDIM) { cmapgrid[0][i1][j1] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j1++; if (j1 == CMAPDIM) { j1 = 0; @@ -701,7 +701,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= CMAPDIM*CMAPDIM && counter < 2*CMAPDIM*CMAPDIM) { cmapgrid[1][i2][j2]= atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j2++; if (j2 == CMAPDIM) { j2 = 0; @@ -715,7 +715,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 2*CMAPDIM*CMAPDIM && counter < 3*CMAPDIM*CMAPDIM) { cmapgrid[2][i3][j3] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j3++; if (j3 == CMAPDIM) { j3 = 0; @@ -729,7 +729,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 3*CMAPDIM*CMAPDIM && counter < 4*CMAPDIM*CMAPDIM) { cmapgrid[3][i4][j4] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j4++; if (j4 == CMAPDIM) { j4 = 0; @@ -743,7 +743,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 4*CMAPDIM*CMAPDIM && counter < 5*CMAPDIM*CMAPDIM) { cmapgrid[4][i5][j5] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j5++; if (j5 == CMAPDIM) { j5 = 0; @@ -757,7 +757,7 @@ void FixCMAP::read_grid_map(char *cmapfile) else if (counter >= 5*CMAPDIM*CMAPDIM && counter < 6*CMAPDIM*CMAPDIM) { cmapgrid[5][i6][j6] = atof(chunk); - chunk = strtok(NULL, " \r\n"); + chunk = strtok(nullptr, " \r\n"); j6++; if (j6 == CMAPDIM) { j6 = 0; @@ -1307,7 +1307,7 @@ void FixCMAP::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them - + int n = 0; for (int i = 0; i < nth; i++) n += static_cast (extra[nlocal][n]); diff --git a/src/MOLECULE/improper_cvff.cpp b/src/MOLECULE/improper_cvff.cpp index 0ffb3f3c31..75eeb4a45a 100644 --- a/src/MOLECULE/improper_cvff.cpp +++ b/src/MOLECULE/improper_cvff.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "improper_cvff.h" -#include + #include #include "atom.h" #include "comm.h" @@ -21,7 +21,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -296,11 +296,11 @@ void ImproperCvff::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - int sign_one = force->inumeric(FLERR,arg[2]); - int multiplicity_one = force->inumeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + int sign_one = utils::inumeric(FLERR,arg[2],false,lmp); + int multiplicity_one = utils::inumeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -334,9 +334,9 @@ void ImproperCvff::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&sign[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&sign[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&sign[1],atom->nimpropertypes,MPI_INT,0,world); diff --git a/src/MOLECULE/improper_harmonic.cpp b/src/MOLECULE/improper_harmonic.cpp index e90bc04c90..159574a12d 100644 --- a/src/MOLECULE/improper_harmonic.cpp +++ b/src/MOLECULE/improper_harmonic.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "improper_harmonic.h" -#include + #include #include "atom.h" #include "comm.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -238,10 +238,10 @@ void ImproperHarmonic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians @@ -275,8 +275,8 @@ void ImproperHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/improper_umbrella.cpp b/src/MOLECULE/improper_umbrella.cpp index 5259b6baf4..7a7c07ab02 100644 --- a/src/MOLECULE/improper_umbrella.cpp +++ b/src/MOLECULE/improper_umbrella.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "improper_umbrella.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -276,10 +276,10 @@ void ImproperUmbrella::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double w_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double w_one = utils::numeric(FLERR,arg[2],false,lmp); // convert w0 from degrees to radians @@ -316,9 +316,9 @@ void ImproperUmbrella::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&kw[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&w0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/MOLECULE/pair_hbond_dreiding_lj.cpp b/src/MOLECULE/pair_hbond_dreiding_lj.cpp index 647060eab7..831e8edc1b 100644 --- a/src/MOLECULE/pair_hbond_dreiding_lj.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_lj.cpp @@ -31,6 +31,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -49,7 +50,7 @@ PairHbondDreidingLJ::PairHbondDreidingLJ(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; nparams = maxparam = 0; - params = NULL; + params = nullptr; nextra = 2; pvector = new double[2]; @@ -117,7 +118,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -145,7 +146,7 @@ void PairHbondDreidingLJ::compute(int eflag, int vflag) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; @@ -300,10 +301,10 @@ void PairHbondDreidingLJ::settings(int narg, char **arg) { if (narg != 4) error->all(FLERR,"Illegal pair_style command"); - ap_global = force->inumeric(FLERR,arg[0]); - cut_inner_global = force->numeric(FLERR,arg[1]); - cut_outer_global = force->numeric(FLERR,arg[2]); - cut_angle_global = force->numeric(FLERR,arg[3]) * MY_PI/180.0; + ap_global = utils::inumeric(FLERR,arg[0],false,lmp); + cut_inner_global = utils::numeric(FLERR,arg[1],false,lmp); + cut_outer_global = utils::numeric(FLERR,arg[2],false,lmp); + cut_angle_global = utils::numeric(FLERR,arg[3],false,lmp) * MY_PI/180.0; } /* ---------------------------------------------------------------------- @@ -317,30 +318,30 @@ void PairHbondDreidingLJ::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi,klo,khi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); - force->bounds(FLERR,arg[2],atom->ntypes,klo,khi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); + utils::bounds(FLERR,arg[2],1,atom->ntypes,klo,khi,error); int donor_flag; if (strcmp(arg[3],"i") == 0) donor_flag = 0; else if (strcmp(arg[3],"j") == 0) donor_flag = 1; else error->all(FLERR,"Incorrect args for pair coefficients"); - double epsilon_one = force->numeric(FLERR,arg[4]); - double sigma_one = force->numeric(FLERR,arg[5]); + double epsilon_one = utils::numeric(FLERR,arg[4],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[5],false,lmp); int ap_one = ap_global; - if (narg > 6) ap_one = force->inumeric(FLERR,arg[6]); + if (narg > 6) ap_one = utils::inumeric(FLERR,arg[6],false,lmp); double cut_inner_one = cut_inner_global; double cut_outer_one = cut_outer_global; if (narg > 8) { - cut_inner_one = force->numeric(FLERR,arg[7]); - cut_outer_one = force->numeric(FLERR,arg[8]); + cut_inner_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_outer_one = utils::numeric(FLERR,arg[8],false,lmp); } if (cut_inner_one>cut_outer_one) error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff"); double cut_angle_one = cut_angle_global; - if (narg == 10) cut_angle_one = force->numeric(FLERR,arg[9]) * MY_PI/180.0; + if (narg == 10) cut_angle_one = utils::numeric(FLERR,arg[9],false,lmp) * MY_PI/180.0; // grow params array if necessary if (nparams == maxparam) { @@ -393,11 +394,11 @@ void PairHbondDreidingLJ::init_style() // pair newton on required since are looping over D atoms // and computing forces on A,H which may be on different procs - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Pair style hbond/dreiding requires molecular system"); if (atom->tag_enable == 0) error->all(FLERR,"Pair style hbond/dreiding requires atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair style hbond/dreiding requires an atom map, " "see atom_modify"); if (force->newton_pair == 0) @@ -493,7 +494,7 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype, if (!acceptor[jtype]) return 0.0; int molecular = atom->molecular; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = atom->special[i]; knum = atom->nspecial[i][0]; } else { @@ -509,7 +510,7 @@ double PairHbondDreidingLJ::single(int i, int j, int itype, int jtype, factor_hb = special_lj[sbmask(j)]; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; diff --git a/src/MOLECULE/pair_hbond_dreiding_morse.cpp b/src/MOLECULE/pair_hbond_dreiding_morse.cpp index 44eefc07fd..7aba2697f4 100644 --- a/src/MOLECULE/pair_hbond_dreiding_morse.cpp +++ b/src/MOLECULE/pair_hbond_dreiding_morse.cpp @@ -31,6 +31,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -87,7 +88,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -115,7 +116,7 @@ void PairHbondDreidingMorse::compute(int eflag, int vflag) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; @@ -241,31 +242,31 @@ void PairHbondDreidingMorse::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi,klo,khi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); - force->bounds(FLERR,arg[2],atom->ntypes,klo,khi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); + utils::bounds(FLERR,arg[2],1,atom->ntypes,klo,khi,error); int donor_flag; if (strcmp(arg[3],"i") == 0) donor_flag = 0; else if (strcmp(arg[3],"j") == 0) donor_flag = 1; else error->all(FLERR,"Incorrect args for pair coefficients"); - double d0_one = force->numeric(FLERR,arg[4]); - double alpha_one = force->numeric(FLERR,arg[5]); - double r0_one = force->numeric(FLERR,arg[6]); + double d0_one = utils::numeric(FLERR,arg[4],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[5],false,lmp); + double r0_one = utils::numeric(FLERR,arg[6],false,lmp); int ap_one = ap_global; - if (narg > 7) ap_one = force->inumeric(FLERR,arg[7]); + if (narg > 7) ap_one = utils::inumeric(FLERR,arg[7],false,lmp); double cut_inner_one = cut_inner_global; double cut_outer_one = cut_outer_global; if (narg > 9) { - cut_inner_one = force->numeric(FLERR,arg[8]); - cut_outer_one = force->numeric(FLERR,arg[9]); + cut_inner_one = utils::numeric(FLERR,arg[8],false,lmp); + cut_outer_one = utils::numeric(FLERR,arg[9],false,lmp); } if (cut_inner_one>cut_outer_one) error->all(FLERR,"Pair inner cutoff >= Pair outer cutoff"); double cut_angle_one = cut_angle_global; - if (narg > 10) cut_angle_one = force->numeric(FLERR,arg[10]) * MY_PI/180.0; + if (narg > 10) cut_angle_one = utils::numeric(FLERR,arg[10],false,lmp) * MY_PI/180.0; // grow params array if necessary @@ -320,11 +321,11 @@ void PairHbondDreidingMorse::init_style() // pair newton on required since are looping over D atoms // and computing forces on A,H which may be on different procs - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Pair style hbond/dreiding requires molecular system"); if (atom->tag_enable == 0) error->all(FLERR,"Pair style hbond/dreiding requires atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair style hbond/dreiding requires an atom map, " "see atom_modify"); if (force->newton_pair == 0) @@ -396,7 +397,7 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype, if (!acceptor[jtype]) return 0.0; int molecular = atom->molecular; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = atom->special[i]; knum = atom->nspecial[i][0]; } else { @@ -412,7 +413,7 @@ double PairHbondDreidingMorse::single(int i, int j, int itype, int jtype, factor_hb = special_lj[sbmask(j)]; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; diff --git a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp index 0712f6be73..9b3805a8b6 100644 --- a/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp +++ b/src/MOLECULE/pair_lj_charmm_coul_charmm.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_charmm_coul_charmm.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -224,14 +224,14 @@ void PairLJCharmmCoulCharmm::settings(int narg, char **arg) if (narg != 2 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) { cut_coul_inner = cut_lj_inner; cut_coul = cut_lj; } else { - cut_coul_inner = force->numeric(FLERR,arg[2]); - cut_coul = force->numeric(FLERR,arg[3]); + cut_coul_inner = utils::numeric(FLERR,arg[2],false,lmp); + cut_coul = utils::numeric(FLERR,arg[3],false,lmp); } } @@ -246,16 +246,16 @@ void PairLJCharmmCoulCharmm::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; @@ -375,14 +375,14 @@ void PairLJCharmmCoulCharmm::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -436,12 +436,12 @@ void PairLJCharmmCoulCharmm::write_restart_settings(FILE *fp) void PairLJCharmmCoulCharmm::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -523,5 +523,5 @@ void *PairLJCharmmCoulCharmm::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"implicit") == 0) return (void *) &implicit; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp index 026b96c00c..c311c76f55 100644 --- a/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp +++ b/src/MOLECULE/pair_lj_charmmfsw_coul_charmmfsh.cpp @@ -20,7 +20,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_charmmfsw_coul_charmmfsh.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -250,12 +250,12 @@ void PairLJCharmmfswCoulCharmmfsh::settings(int narg, char **arg) if (narg != 2 && narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) { cut_coul = cut_lj; } else { - cut_coul = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } } @@ -270,16 +270,16 @@ void PairLJCharmmfswCoulCharmmfsh::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 6) { - eps14_one = force->numeric(FLERR,arg[4]); - sigma14_one = force->numeric(FLERR,arg[5]); + eps14_one = utils::numeric(FLERR,arg[4],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[5],false,lmp); } int count = 0; @@ -433,14 +433,14 @@ void PairLJCharmmfswCoulCharmmfsh::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -470,11 +470,11 @@ void PairLJCharmmfswCoulCharmmfsh::write_restart_settings(FILE *fp) void PairLJCharmmfswCoulCharmmfsh::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); @@ -560,5 +560,5 @@ void *PairLJCharmmfswCoulCharmmfsh::extract(const char *str, int &dim) if (strcmp(str,"cut_lj") == 0) return (void *) &cut_lj; if (strcmp(str,"dihedflag") == 0) return (void *) &dihedflag; - return NULL; + return nullptr; } diff --git a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp index 673fb83066..d8ab817e7d 100644 --- a/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp +++ b/src/MOLECULE/pair_lj_cut_tip4p_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_tip4p_cut.h" -#include + #include #include #include "atom.h" @@ -30,7 +30,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -43,8 +43,8 @@ PairLJCutTIP4PCut::PairLJCutTIP4PCut(LAMMPS *lmp) : Pair(lmp) writedata = 1; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -425,15 +425,15 @@ void PairLJCutTIP4PCut::settings(int narg, char **arg) { if (narg < 6 || narg > 7) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[5]); + cut_lj_global = utils::numeric(FLERR,arg[5],false,lmp); if (narg == 6) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[6]); + else cut_coul = utils::numeric(FLERR,arg[6],false,lmp); cut_coulsq = cut_coul * cut_coul; cut_coulsqplus = (cut_coul + 2.0*qdist) * (cut_coul + 2.0*qdist); @@ -457,14 +457,14 @@ void PairLJCutTIP4PCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -494,9 +494,9 @@ void PairLJCutTIP4PCut::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/cut requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); neighbor->request(this,instance_me); @@ -618,13 +618,13 @@ void PairLJCutTIP4PCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -660,17 +660,17 @@ void PairLJCutTIP4PCut::write_restart_settings(FILE *fp) void PairLJCutTIP4PCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -740,7 +740,7 @@ void *PairLJCutTIP4PCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- memory usage of hneigh diff --git a/src/MOLECULE/pair_tip4p_cut.cpp b/src/MOLECULE/pair_tip4p_cut.cpp index 334dbf89c8..7757e96496 100644 --- a/src/MOLECULE/pair_tip4p_cut.cpp +++ b/src/MOLECULE/pair_tip4p_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_tip4p_cut.h" -#include + #include #include "atom.h" #include "force.h" @@ -28,7 +28,7 @@ #include "comm.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -39,8 +39,8 @@ PairTIP4PCut::PairTIP4PCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -373,12 +373,12 @@ void PairTIP4PCut::settings(int narg, char **arg) { if (narg != 6) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); - cut_coul = force->numeric(FLERR,arg[5]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); + cut_coul = utils::numeric(FLERR,arg[5],false,lmp); cut_coulsq = cut_coul * cut_coul; cut_coulsqplus = (cut_coul + 2.0*qdist) * (cut_coul + 2.0*qdist); @@ -395,8 +395,8 @@ void PairTIP4PCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -423,9 +423,9 @@ void PairTIP4PCut::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/cut requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); neighbor->request(this,instance_me); @@ -475,7 +475,7 @@ void PairTIP4PCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -502,13 +502,13 @@ void PairTIP4PCut::write_restart_settings(FILE *fp) void PairTIP4PCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); diff --git a/src/MPIIO/dump_atom_mpiio.cpp b/src/MPIIO/dump_atom_mpiio.cpp index 9d15e8b1a8..812cec21a3 100644 --- a/src/MPIIO/dump_atom_mpiio.cpp +++ b/src/MPIIO/dump_atom_mpiio.cpp @@ -18,7 +18,7 @@ #include "omp_compat.h" #include "dump_atom_mpiio.h" #include -#include + #include #include "domain.h" #include "update.h" @@ -186,7 +186,7 @@ void DumpAtomMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing diff --git a/src/MPIIO/dump_cfg_mpiio.cpp b/src/MPIIO/dump_cfg_mpiio.cpp index bca19e58c8..f598f25998 100644 --- a/src/MPIIO/dump_cfg_mpiio.cpp +++ b/src/MPIIO/dump_cfg_mpiio.cpp @@ -17,15 +17,16 @@ #include "omp_compat.h" #include "dump_cfg_mpiio.h" -#include -#include -#include + #include "atom.h" #include "domain.h" #include "update.h" #include "memory.h" #include "error.h" +#include +#include + #ifdef LMP_USER_IO_TIMER #include #include @@ -206,7 +207,7 @@ void DumpCFGMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing diff --git a/src/MPIIO/dump_custom_mpiio.cpp b/src/MPIIO/dump_custom_mpiio.cpp index 3f9c09738e..065b04801e 100644 --- a/src/MPIIO/dump_custom_mpiio.cpp +++ b/src/MPIIO/dump_custom_mpiio.cpp @@ -18,7 +18,7 @@ #include "omp_compat.h" #include "dump_custom_mpiio.h" #include -#include + #include #include "domain.h" #include "input.h" @@ -202,7 +202,7 @@ void DumpCustomMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing @@ -247,8 +247,8 @@ void DumpCustomMPIIO::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { diff --git a/src/MPIIO/dump_xyz_mpiio.cpp b/src/MPIIO/dump_xyz_mpiio.cpp index d1b2d5079a..959a454103 100644 --- a/src/MPIIO/dump_xyz_mpiio.cpp +++ b/src/MPIIO/dump_xyz_mpiio.cpp @@ -18,7 +18,7 @@ #include "omp_compat.h" #include "dump_xyz_mpiio.h" #include -#include + #include #include "domain.h" #include "update.h" @@ -198,7 +198,7 @@ void DumpXYZMPIIO::write() } if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // determine how much data needs to be written for setting the file size and prepocess it prior to writing @@ -239,7 +239,7 @@ void DumpXYZMPIIO::init_style() // initialize typenames array to be backward compatible by default // a 32-bit int can be maximally 10 digits plus sign - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[12]; diff --git a/src/MPIIO/restart_mpiio.cpp b/src/MPIIO/restart_mpiio.cpp index 66c7d8a417..b2caa411e3 100644 --- a/src/MPIIO/restart_mpiio.cpp +++ b/src/MPIIO/restart_mpiio.cpp @@ -16,8 +16,7 @@ ------------------------------------------------------------------------- */ #include "restart_mpiio.h" -#include -#include + #include "error.h" using namespace LAMMPS_NS; diff --git a/src/MSCG/fix_mscg.cpp b/src/MSCG/fix_mscg.cpp index caa9a528a7..650c25cd4d 100644 --- a/src/MSCG/fix_mscg.cpp +++ b/src/MSCG/fix_mscg.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "fix_mscg.h" -#include + #include -#include + #include "mscg.h" #include "atom.h" #include "comm.h" @@ -43,7 +43,7 @@ FixMSCG::FixMSCG(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal fix mscg command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix mscg command"); me = comm->me; @@ -65,7 +65,7 @@ FixMSCG::FixMSCG(LAMMPS *lmp, int narg, char **arg) : nframes = n_frames = block_size = 0; range_flag = 0; name_flag = 0; - f = NULL; + f = nullptr; type_names = new char*[natoms]; for (int i = 0; i < natoms; i++) type_names[i] = new char[24]; diff --git a/src/Makefile b/src/Makefile index 4528c027cf..149dedd35b 100644 --- a/src/Makefile +++ b/src/Makefile @@ -85,8 +85,8 @@ PACKUSERUC = $(call uppercase,$(PACKUSER)) YESDIR = $(call uppercase,$(@:yes-%=%)) NODIR = $(call uppercase,$(@:no-%=%)) -LIBDIR = $($(@:lib-%=%)) -LIBUSERDIR = $($(@:lib-user-%=%)) +LIBDIR = $(@:lib-%=%) +LIBUSERDIR = $(@:lib-user-%=%) # List of all targets @@ -364,7 +364,7 @@ yes-%: @if [ ! -e Makefile.package.settings ]; \ then cp Makefile.package.settings.empty Makefile.package.settings; fi @if [ ! -e $(YESDIR) ]; then \ - echo "Package $(@:yes-%=%) does not exist"; \ + echo "Package $(YESDIR) does not exist"; exit 1; \ elif [ -e $(YESDIR)/Install.sh ]; then \ echo "Installing package $(@:yes-%=%)"; \ cd $(YESDIR); $(SHELL) Install.sh 1; cd ..; \ @@ -378,7 +378,7 @@ yes-%: no-%: @if [ ! -e $(NODIR) ]; then \ - echo "Package $(@:no-%=%) does not exist"; \ + echo "Package $(NODIR) does not exist"; exit 1; \ elif [ -e $(NODIR)/Install.sh ]; then \ echo "Uninstalling package $(@:no-%=%)"; \ cd $(NODIR); $(SHELL) Install.sh 0; cd ..; \ diff --git a/src/OPT/pair_eam_opt.cpp b/src/OPT/pair_eam_opt.cpp index e6b6fb72f4..82510e8177 100644 --- a/src/OPT/pair_eam_opt.cpp +++ b/src/OPT/pair_eam_opt.cpp @@ -21,7 +21,7 @@ #include "pair_eam_opt.h" #include -#include + #include "atom.h" #include "comm.h" #include "force.h" diff --git a/src/OPT/pair_lj_charmm_coul_long_opt.cpp b/src/OPT/pair_lj_charmm_coul_long_opt.cpp index 3dc6bdb6b4..a7fbfb823a 100644 --- a/src/OPT/pair_lj_charmm_coul_long_opt.cpp +++ b/src/OPT/pair_lj_charmm_coul_long_opt.cpp @@ -20,7 +20,7 @@ #include "pair_lj_charmm_coul_long_opt.h" #include -#include + #include "atom.h" #include "force.h" #include "neigh_list.h" diff --git a/src/OPT/pair_lj_cut_opt.cpp b/src/OPT/pair_lj_cut_opt.cpp index 3b3a19a9e8..a31f521ecc 100644 --- a/src/OPT/pair_lj_cut_opt.cpp +++ b/src/OPT/pair_lj_cut_opt.cpp @@ -19,7 +19,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_opt.h" -#include + #include "atom.h" #include "force.h" #include "neigh_list.h" diff --git a/src/OPT/pair_morse_opt.cpp b/src/OPT/pair_morse_opt.cpp index 1d2e226777..89d254ee04 100644 --- a/src/OPT/pair_morse_opt.cpp +++ b/src/OPT/pair_morse_opt.cpp @@ -20,7 +20,7 @@ #include "pair_morse_opt.h" #include -#include + #include "atom.h" #include "force.h" #include "neigh_list.h" diff --git a/src/OPT/pair_ufm_opt.cpp b/src/OPT/pair_ufm_opt.cpp index d824d82e6c..2cb5323745 100644 --- a/src/OPT/pair_ufm_opt.cpp +++ b/src/OPT/pair_ufm_opt.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_ufm_opt.h" -#include + #include #include "atom.h" #include "force.h" diff --git a/src/PERI/atom_vec_peri.cpp b/src/PERI/atom_vec_peri.cpp index 5ce74575ba..a29b658199 100644 --- a/src/PERI/atom_vec_peri.cpp +++ b/src/PERI/atom_vec_peri.cpp @@ -16,13 +16,14 @@ ------------------------------------------------------------------------- */ #include "atom_vec_peri.h" -#include -#include + #include "atom.h" #include "citeme.h" -#include "memory.h" #include "error.h" +#include +#include + using namespace LAMMPS_NS; static const char cite_peri_package[] = @@ -42,7 +43,7 @@ AtomVecPeri::AtomVecPeri(LAMMPS *lmp) : AtomVec(lmp) { if (lmp->citeme) lmp->citeme->add(cite_peri_package); - molecular = 0; + molecular = Atom::ATOMIC; atom->rmass_flag = 1; atom->peri_flag = 1; diff --git a/src/PERI/compute_damage_atom.cpp b/src/PERI/compute_damage_atom.cpp index 8bea52f1cf..9e4c886900 100644 --- a/src/PERI/compute_damage_atom.cpp +++ b/src/PERI/compute_damage_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDamageAtom::ComputeDamageAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), damage(NULL) + Compute(lmp, narg, arg), damage(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute damage/atom command"); diff --git a/src/PERI/compute_dilatation_atom.cpp b/src/PERI/compute_dilatation_atom.cpp index 65a25cda03..bf8d345f29 100644 --- a/src/PERI/compute_dilatation_atom.cpp +++ b/src/PERI/compute_dilatation_atom.cpp @@ -43,7 +43,7 @@ ComputeDilatationAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - dilatation = NULL; + dilatation = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/compute_plasticity_atom.cpp b/src/PERI/compute_plasticity_atom.cpp index d90e211506..5d0d554986 100644 --- a/src/PERI/compute_plasticity_atom.cpp +++ b/src/PERI/compute_plasticity_atom.cpp @@ -44,7 +44,7 @@ ComputePlasticityAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - plasticity = NULL; + plasticity = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/PERI/fix_peri_neigh.cpp b/src/PERI/fix_peri_neigh.cpp index 022eb0bab6..f799221d1e 100644 --- a/src/PERI/fix_peri_neigh.cpp +++ b/src/PERI/fix_peri_neigh.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_peri_neigh.h" -#include + #include #include "pair_peri_lps.h" #include "pair_peri_ves.h" @@ -56,19 +56,19 @@ FixPeriNeigh::FixPeriNeigh(LAMMPS *lmp,int narg, char **arg) : // set maxpartner = 1 as placeholder maxpartner = 1; - npartner = NULL; - partner = NULL; - deviatorextention = NULL; - deviatorBackextention = NULL; - deviatorPlasticextension = NULL; - lambdaValue = NULL; - r0 = NULL; - vinter = NULL; - wvolume = NULL; + npartner = nullptr; + partner = nullptr; + deviatorextention = nullptr; + deviatorBackextention = nullptr; + deviatorPlasticextension = nullptr; + lambdaValue = nullptr; + r0 = nullptr; + vinter = nullptr; + wvolume = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // initialize npartner to 0 so atom migration is OK the 1st time @@ -86,8 +86,8 @@ FixPeriNeigh::~FixPeriNeigh() { // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays @@ -228,13 +228,13 @@ void FixPeriNeigh::setup(int /*vflag*/) memory->destroy(r0); memory->destroy(npartner); - npartner = NULL; - partner = NULL; - deviatorextention = NULL; - deviatorBackextention = NULL; - deviatorPlasticextension = NULL; - lambdaValue = NULL; - r0 = NULL; + npartner = nullptr; + partner = nullptr; + deviatorextention = nullptr; + deviatorBackextention = nullptr; + deviatorPlasticextension = nullptr; + lambdaValue = nullptr; + r0 = nullptr; grow_arrays(atom->nmax); // create partner list and r0 values from neighbor list @@ -301,9 +301,9 @@ void FixPeriNeigh::setup(int /*vflag*/) double **x0 = atom->x0; double half_lc = 0.5*(domain->lattice->xlattice); double vfrac_scale; - PairPeriLPS *pairlps = NULL; - PairPeriVES *pairves = NULL; - PairPeriEPS *paireps = NULL; + PairPeriLPS *pairlps = nullptr; + PairPeriVES *pairves = nullptr; + PairPeriEPS *paireps = nullptr; if (isLPS) pairlps = static_cast(anypair); else if (isVES) diff --git a/src/PERI/pair_peri_eps.cpp b/src/PERI/pair_peri_eps.cpp index cae33fe580..33a75f506f 100644 --- a/src/PERI/pair_peri_eps.cpp +++ b/src/PERI/pair_peri_eps.cpp @@ -16,24 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_peri_eps.h" -#include + +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix_peri_neigh.h" +#include "force.h" +#include "lattice.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neighbor.h" + #include #include -#include -#include "atom.h" -#include "domain.h" -#include "lattice.h" -#include "force.h" -#include "modify.h" -#include "fix.h" -#include "fix_peri_neigh.h" -#include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "math_const.h" -#include "error.h" -#include "utils.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -49,14 +47,14 @@ PairPeriEPS::PairPeriEPS(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = -1; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; - m_yieldstress = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; + m_yieldstress = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -221,7 +219,7 @@ void PairPeriEPS::compute(int eflag, int vflag) // ******** temp array to store Plastic extension *********** /// // create on heap to reduce stack use and to allow for faster zeroing - double **deviatorPlasticExtTemp = NULL; + double **deviatorPlasticExtTemp = nullptr; if (nlocal*maxpartner > 0) { memory->create(deviatorPlasticExtTemp,nlocal,maxpartner,"pair:plastext"); memset(&(deviatorPlasticExtTemp[0][0]),0,sizeof(double)*nlocal*maxpartner); @@ -450,15 +448,15 @@ void PairPeriEPS::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double bulkmodulus_one = force->numeric(FLERR,arg[2]); - double shearmodulus_one = force->numeric(FLERR,arg[3]); - double cut_one = force->numeric(FLERR,arg[4]); - double s00_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); - double myieldstress_one = force->numeric(FLERR,arg[7]); + double bulkmodulus_one = utils::numeric(FLERR,arg[2],false,lmp); + double shearmodulus_one = utils::numeric(FLERR,arg[3],false,lmp); + double cut_one = utils::numeric(FLERR,arg[4],false,lmp); + double s00_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); + double myieldstress_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -504,10 +502,10 @@ void PairPeriEPS::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); - if (domain->lattice == NULL) + if (domain->lattice == nullptr) error->all(FLERR,"Pair peri requires a lattice be defined"); if (domain->lattice->xlattice != domain->lattice->ylattice || domain->lattice->xlattice != domain->lattice->zlattice || @@ -561,16 +559,16 @@ void PairPeriEPS::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_yieldstress[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_yieldstress[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_lps.cpp b/src/PERI/pair_peri_lps.cpp index 65c6c30e19..be16dfe925 100644 --- a/src/PERI/pair_peri_lps.cpp +++ b/src/PERI/pair_peri_lps.cpp @@ -16,24 +16,21 @@ ------------------------------------------------------------------------- */ #include "pair_peri_lps.h" -#include -#include -#include -#include + #include "atom.h" -#include "domain.h" -#include "lattice.h" -#include "force.h" -#include "modify.h" -#include "fix.h" -#include "fix_peri_neigh.h" #include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" +#include "domain.h" #include "error.h" -#include "utils.h" +#include "fix_peri_neigh.h" +#include "force.h" +#include "lattice.h" #include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neighbor.h" + +#include using namespace LAMMPS_NS; @@ -48,13 +45,13 @@ PairPeriLPS::PairPeriLPS(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -378,14 +375,14 @@ void PairPeriLPS::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double bulkmodulus_one = force->numeric(FLERR,arg[2]); - double shearmodulus_one = force->numeric(FLERR,arg[3]); - double cut_one = force->numeric(FLERR,arg[4]); - double s00_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); + double bulkmodulus_one = utils::numeric(FLERR,arg[2],false,lmp); + double shearmodulus_one = utils::numeric(FLERR,arg[3],false,lmp); + double cut_one = utils::numeric(FLERR,arg[4],false,lmp); + double s00_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -430,7 +427,7 @@ void PairPeriLPS::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); if (domain->lattice->xlattice != domain->lattice->ylattice || @@ -484,15 +481,15 @@ void PairPeriLPS::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_pmb.cpp b/src/PERI/pair_peri_pmb.cpp index 7c900b5c4e..38fe7f1670 100644 --- a/src/PERI/pair_peri_pmb.cpp +++ b/src/PERI/pair_peri_pmb.cpp @@ -16,24 +16,21 @@ ------------------------------------------------------------------------- */ #include "pair_peri_pmb.h" -#include + +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix_peri_neigh.h" +#include "force.h" +#include "lattice.h" +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neighbor.h" + #include #include -#include -#include -#include "atom.h" -#include "domain.h" -#include "lattice.h" -#include "force.h" -#include "modify.h" -#include "fix.h" -#include "fix_peri_neigh.h" -#include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "utils.h" using namespace LAMMPS_NS; @@ -47,12 +44,12 @@ PairPeriPMB::PairPeriPMB(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; + s0_new = nullptr; - kspring = NULL; - s00 = NULL; - alpha = NULL; - cut = NULL; + kspring = nullptr; + s00 = nullptr; + alpha = nullptr; + cut = nullptr; } /* ---------------------------------------------------------------------- */ @@ -311,13 +308,13 @@ void PairPeriPMB::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double kspring_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); - double s00_one = force->numeric(FLERR,arg[4]); - double alpha_one = force->numeric(FLERR,arg[5]); + double kspring_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); + double s00_one = utils::numeric(FLERR,arg[4],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -360,7 +357,7 @@ void PairPeriPMB::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); if (domain->lattice->xlattice != domain->lattice->ylattice || @@ -413,14 +410,14 @@ void PairPeriPMB::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&kspring[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kspring[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&kspring[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&s00[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/PERI/pair_peri_ves.cpp b/src/PERI/pair_peri_ves.cpp index ed9babf5ed..ae18a3e419 100644 --- a/src/PERI/pair_peri_ves.cpp +++ b/src/PERI/pair_peri_ves.cpp @@ -16,25 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_peri_ves.h" -#include -#include -#include -#include + #include "atom.h" -#include "domain.h" -#include "lattice.h" -#include "force.h" -#include "modify.h" -#include "fix.h" -#include "fix_peri_neigh.h" #include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" +#include "domain.h" #include "error.h" -#include "utils.h" +#include "fix_peri_neigh.h" +#include "force.h" +#include "lattice.h" +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neighbor.h" #include "update.h" +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -48,15 +45,15 @@ PairPeriVES::PairPeriVES(LAMMPS *lmp) : Pair(lmp) ifix_peri = -1; nmax = 0; - s0_new = NULL; - theta = NULL; + s0_new = nullptr; + theta = nullptr; - bulkmodulus = NULL; - shearmodulus = NULL; - s00 = alpha = NULL; - cut = NULL; - m_lambdai = NULL; - m_taubi = NULL; + bulkmodulus = nullptr; + shearmodulus = nullptr; + s00 = alpha = nullptr; + cut = nullptr; + m_lambdai = nullptr; + m_taubi = nullptr; // set comm size needed by this Pair // comm_reverse not needed @@ -426,16 +423,16 @@ void PairPeriVES::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double bulkmodulus_one = force->numeric(FLERR,arg[2]); - double shearmodulus_one = force->numeric(FLERR,arg[3]); - double cut_one = force->numeric(FLERR,arg[4]); - double s00_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); - double mlambdai_one = force->numeric(FLERR,arg[7]); - double mtaui_one = force->numeric(FLERR,arg[8]); + double bulkmodulus_one = utils::numeric(FLERR,arg[2],false,lmp); + double shearmodulus_one = utils::numeric(FLERR,arg[3],false,lmp); + double cut_one = utils::numeric(FLERR,arg[4],false,lmp); + double s00_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); + double mlambdai_one = utils::numeric(FLERR,arg[7],false,lmp); + double mtaui_one = utils::numeric(FLERR,arg[8],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -484,10 +481,10 @@ void PairPeriVES::init_style() if (!atom->peri_flag) error->all(FLERR,"Pair style peri requires atom style peri"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair peri requires an atom map, see atom_modify"); - if (domain->lattice == NULL) + if (domain->lattice == nullptr) error->all(FLERR,"Pair peri requires a lattice be defined"); if (domain->lattice->xlattice != domain->lattice->ylattice || domain->lattice->xlattice != domain->lattice->zlattice || @@ -542,17 +539,17 @@ void PairPeriVES::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_lambdai[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&m_taubi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&bulkmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shearmodulus[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&s00[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_lambdai[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&m_taubi[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&bulkmodulus[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&shearmodulus[i][j],1,MPI_DOUBLE,0,world); diff --git a/src/POEMS/fix_poems.cpp b/src/POEMS/fix_poems.cpp index b0b1287717..414c55d502 100644 --- a/src/POEMS/fix_poems.cpp +++ b/src/POEMS/fix_poems.cpp @@ -18,10 +18,10 @@ ------------------------------------------------------------------------- */ #include "fix_poems.h" -#include + #include #include -#include + #include "workspace.h" #include "atom.h" #include "domain.h" @@ -34,8 +34,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "math_eigen.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -44,7 +43,6 @@ using namespace FixConst; #define DELTA 128 #define TOLERANCE 1.0e-6 #define EPSILON 1.0e-7 -#define MAXJACOBI 50 static const char cite_fix_poems[] = "fix poems command:\n\n" @@ -62,12 +60,12 @@ static const char cite_fix_poems[] = ------------------------------------------------------------------------- */ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), natom2body(NULL), - atom2body(NULL), displace(NULL), nrigid(NULL), masstotal(NULL), - xcm(NULL), vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL), - ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL), - torque(NULL), sum(NULL), all(NULL), jointbody(NULL), - xjoint(NULL), freelist(NULL), poems(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), natom2body(nullptr), + atom2body(nullptr), displace(nullptr), nrigid(nullptr), masstotal(nullptr), + xcm(nullptr), vcm(nullptr), fcm(nullptr), inertia(nullptr), ex_space(nullptr), + ey_space(nullptr), ez_space(nullptr), angmom(nullptr), omega(nullptr), + torque(nullptr), sum(nullptr), all(nullptr), jointbody(nullptr), + xjoint(nullptr), freelist(nullptr), poems(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_poems); @@ -84,11 +82,11 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with atom class - natom2body = NULL; - atom2body = NULL; - displace = NULL; + natom2body = nullptr; + atom2body = nullptr; + displace = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize each atom to belong to no rigid bodies @@ -99,7 +97,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : // readfile() and jointbuild() use global atom IDs int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -157,7 +155,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"molecule") == 0) { if (narg != 4) error->all(FLERR,"Illegal fix poems command"); - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR, "Must use a molecular atom style with fix poems molecule"); @@ -260,7 +258,7 @@ FixPOEMS::FixPOEMS(LAMMPS *lmp, int narg, char **arg) : if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } // create POEMS instance @@ -291,7 +289,7 @@ FixPOEMS::~FixPOEMS() // if atom class still exists: // unregister this fix so atom class doesn't invoke it any more - if (atom) atom->delete_callback(id,0); + if (atom) atom->delete_callback(id,Atom::GROW); // delete locally stored arrays @@ -492,7 +490,7 @@ void FixPOEMS::init() tensor[1][2] = tensor[2][1] = all[ibody][4]; tensor[0][2] = tensor[2][0] = all[ibody][5]; - ierror = jacobi(tensor,inertia[ibody],evectors); + ierror = MathEigen::jacobi3(tensor,inertia[ibody],evectors); if (ierror) error->all(FLERR,"Insufficient Jacobi rotations for POEMS body"); ex_space[ibody][0] = evectors[0][0]; @@ -944,7 +942,7 @@ void FixPOEMS::readfile(char *file) if (me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix poems file %s",file); error->one(FLERR,str); @@ -952,7 +950,7 @@ void FixPOEMS::readfile(char *file) } nbody = 0; - char *line = NULL; + char *line = nullptr; int maxline = 0; char *ptr; int nlocal = atom->nlocal; @@ -965,10 +963,10 @@ void FixPOEMS::readfile(char *file) MPI_Bcast(line,nlen,MPI_CHAR,0,world); ptr = strtok(line," ,\t\n\0"); - if (ptr == NULL || ptr[0] == '#') continue; - ptr = strtok(NULL," ,\t\n\0"); + if (ptr == nullptr || ptr[0] == '#') continue; + ptr = strtok(nullptr," ,\t\n\0"); - while ((ptr = strtok(NULL," ,\t\n\0"))) { + while ((ptr = strtok(nullptr," ,\t\n\0"))) { id = atoi(ptr); i = atom->map(id); if (i < 0 || i >= nlocal) continue; @@ -995,7 +993,7 @@ int FixPOEMS::readline(FILE *fp, char **pline, int *pmaxline) maxline += DELTA; memory->grow(line,maxline,"fix_poems:line"); } - if (fgets(&line[n],maxline-n,fp) == NULL) { + if (fgets(&line[n],maxline-n,fp) == nullptr) { n = 0; break; } @@ -1030,7 +1028,7 @@ void FixPOEMS::jointbuild() mjoint += natom2body[i]-1; } - tagint **mylist = NULL; + tagint **mylist = nullptr; if (mjoint) memory->create(mylist,mjoint,3,"poems:mylist"); mjoint = 0; @@ -1047,7 +1045,7 @@ void FixPOEMS::jointbuild() // jlist = mylist concatenated across all procs via MPI_Allgatherv MPI_Allreduce(&mjoint,&njoint,1,MPI_INT,MPI_SUM,world); - tagint **jlist = NULL; + tagint **jlist = nullptr; if (njoint) memory->create(jlist,njoint,3,"poems:jlist"); int nprocs; @@ -1069,7 +1067,7 @@ void FixPOEMS::jointbuild() MPI_Allgatherv(mylist[0],3*mjoint,MPI_LMP_TAGINT,jlist[0], recvcounts,displs,MPI_LMP_TAGINT,world); else - MPI_Allgatherv(NULL,3*mjoint,MPI_LMP_TAGINT,jlist[0], + MPI_Allgatherv(nullptr,3*mjoint,MPI_LMP_TAGINT,jlist[0], recvcounts,displs,MPI_LMP_TAGINT,world); } @@ -1107,9 +1105,9 @@ void FixPOEMS::jointbuild() // each proc sets myjoint if it owns joint atom // MPI_Allreduce gives all procs the xjoint coords - jointbody = NULL; - xjoint = NULL; - double **myjoint = NULL; + jointbody = nullptr; + xjoint = nullptr; + double **myjoint = nullptr; if (njoint) { memory->create(jointbody,njoint,2,"poems:jointbody"); memory->create(xjoint,njoint,3,"poems:xjoint"); @@ -1146,7 +1144,7 @@ void FixPOEMS::jointbuild() for (i = 0; i < nbody; i++) if (mark[i]) nfree++; if (nfree) freelist = new int[nfree]; - else freelist = NULL; + else freelist = nullptr; nfree = 0; for (i = 0; i < nbody; i++) if (mark[i]) freelist[nfree++] = i + 1; @@ -1283,88 +1281,6 @@ int FixPOEMS::loopcheck(int nvert, int nedge, tagint **elist) return 0; } -/* ---------------------------------------------------------------------- - compute evalues and evectors of 3x3 real symmetric matrix - based on Jacobi rotations - adapted from Numerical Recipes jacobi() function -------------------------------------------------------------------------- */ - -int FixPOEMS::jacobi(double **matrix, double *evalues, double **evectors) -{ - int i,j,k; - double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3]; - - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) evectors[i][j] = 0.0; - evectors[i][i] = 1.0; - } - for (i = 0; i < 3; i++) { - b[i] = evalues[i] = matrix[i][i]; - z[i] = 0.0; - } - - for (int iter = 1; iter <= MAXJACOBI; iter++) { - sm = 0.0; - for (i = 0; i < 2; i++) - for (j = i+1; j < 3; j++) - sm += fabs(matrix[i][j]); - if (sm == 0.0) return 0; - - if (iter < 4) tresh = 0.2*sm/(3*3); - else tresh = 0.0; - - for (i = 0; i < 2; i++) { - for (j = i+1; j < 3; j++) { - g = 100.0*fabs(matrix[i][j]); - if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i]) - && fabs(evalues[j])+g == fabs(evalues[j])) - matrix[i][j] = 0.0; - else if (fabs(matrix[i][j]) > tresh) { - h = evalues[j]-evalues[i]; - if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h; - else { - theta = 0.5*h/(matrix[i][j]); - t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta)); - if (theta < 0.0) t = -t; - } - c = 1.0/sqrt(1.0+t*t); - s = t*c; - tau = s/(1.0+c); - h = t*matrix[i][j]; - z[i] -= h; - z[j] += h; - evalues[i] -= h; - evalues[j] += h; - matrix[i][j] = 0.0; - for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau); - for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau); - for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau); - for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau); - } - } - } - - for (i = 0; i < 3; i++) { - evalues[i] = b[i] += z[i]; - z[i] = 0.0; - } - } - return 1; -} - -/* ---------------------------------------------------------------------- - perform a single Jacobi rotation -------------------------------------------------------------------------- */ - -void FixPOEMS::rotate(double **matrix, int i, int j, int k, int l, - double s, double tau) -{ - double g = matrix[i][j]; - double h = matrix[k][l]; - matrix[i][j] = g-s*(h+g*tau); - matrix[k][l] = h+s*(g-h*tau); -} - /* ---------------------------------------------------------------------- compute omega from angular momentum w = omega = angular velocity in space frame diff --git a/src/POEMS/fix_poems.h b/src/POEMS/fix_poems.h index 6892c51d7e..7c81889639 100644 --- a/src/POEMS/fix_poems.h +++ b/src/POEMS/fix_poems.h @@ -106,8 +106,6 @@ class FixPOEMS : public Fix { void jointbuild(); void sortlist(int, tagint **); int loopcheck(int, int, tagint **); - int jacobi(double **, double *, double **); - void rotate(double **, int, int, int, int, double, double); void omega_from_mq(double *, double *, double *, double *, double *, double *); void set_v(); diff --git a/src/PYTHON/fix_python_invoke.cpp b/src/PYTHON/fix_python_invoke.cpp index 57ea2e9148..8966d9a9db 100644 --- a/src/PYTHON/fix_python_invoke.cpp +++ b/src/PYTHON/fix_python_invoke.cpp @@ -16,13 +16,14 @@ ------------------------------------------------------------------------- */ #include "fix_python_invoke.h" -#include // IWYU pragma: keep -#include -#include "force.h" -#include "update.h" + #include "error.h" #include "lmppython.h" #include "python_compat.h" +#include "update.h" + +#include +#include // IWYU pragma: export using namespace LAMMPS_NS; using namespace FixConst; @@ -34,7 +35,7 @@ FixPythonInvoke::FixPythonInvoke(LAMMPS *lmp, int narg, char **arg) : { if (narg != 6) error->all(FLERR,"Illegal fix python/invoke command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix python/invoke command"); // ensure Python interpreter is initialized diff --git a/src/PYTHON/fix_python_move.cpp b/src/PYTHON/fix_python_move.cpp index be63b851a2..6aec1d785a 100644 --- a/src/PYTHON/fix_python_move.cpp +++ b/src/PYTHON/fix_python_move.cpp @@ -16,12 +16,14 @@ ------------------------------------------------------------------------- */ #include "fix_python_move.h" -#include // IWYU pragma: keep -#include -#include "lmppython.h" + #include "error.h" +#include "lmppython.h" #include "python_compat.h" +#include +#include // IWYU pragma: export + using namespace LAMMPS_NS; using namespace FixConst; @@ -35,7 +37,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : python->init(); - py_move = NULL; + py_move = nullptr; PyGILState_STATE gstate = PyGILState_Ensure(); @@ -48,7 +50,7 @@ FixPythonMove::FixPythonMove(LAMMPS *lmp, int narg, char **arg) : char * full_cls_name = arg[3]; char * lastpos = strrchr(full_cls_name, '.'); - if (lastpos == NULL) { + if (lastpos == nullptr) { error->all(FLERR,"Fix python/integrate requires fully qualified class name"); } @@ -136,7 +138,7 @@ void FixPythonMove::init() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'init' method'"); } - PyObject * result = PyEval_CallObject(py_init, NULL); + PyObject * result = PyEval_CallObject(py_init, nullptr); PyGILState_Release(gstate); } @@ -172,7 +174,7 @@ void FixPythonMove::final_integrate() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'final_integrate' method'"); } - PyObject * result = PyEval_CallObject(py_final_integrate, NULL); + PyObject * result = PyEval_CallObject(py_final_integrate, nullptr); PyGILState_Release(gstate); } @@ -227,6 +229,6 @@ void FixPythonMove::reset_dt() PyGILState_Release(gstate); error->all(FLERR,"Could not find 'reset_dt' method'"); } - PyObject * result = PyEval_CallObject(py_reset_dt, NULL); + PyObject * result = PyEval_CallObject(py_reset_dt, nullptr); PyGILState_Release(gstate); } diff --git a/src/PYTHON/pair_python.cpp b/src/PYTHON/pair_python.cpp index 8fbb3e6f8b..e24daf3116 100644 --- a/src/PYTHON/pair_python.cpp +++ b/src/PYTHON/pair_python.cpp @@ -16,17 +16,18 @@ ------------------------------------------------------------------------- */ #include "pair_python.h" -#include // IWYU pragma: keep -#include -#include + #include "atom.h" -#include "force.h" -#include "memory.h" -#include "update.h" -#include "neigh_list.h" -#include "lmppython.h" #include "error.h" +#include "force.h" +#include "lmppython.h" +#include "memory.h" +#include "neigh_list.h" #include "python_compat.h" +#include "update.h" + +#include +#include // IWYU pragma: export using namespace LAMMPS_NS; @@ -42,8 +43,8 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) { cut_global = 0.0; centroidstressflag = 1; - py_potential = NULL; - skip_types = NULL; + py_potential = nullptr; + skip_types = nullptr; python->init(); @@ -53,7 +54,7 @@ PairPython::PairPython(LAMMPS *lmp) : Pair(lmp) { // if LAMMPS_POTENTIALS environment variable is set, add it to PYTHONPATH as well const char * potentials_path = getenv("LAMMPS_POTENTIALS"); - if (potentials_path != NULL) { + if (potentials_path != nullptr) { PyList_Append(py_path, PY_STRING_FROM_STRING(potentials_path)); } } @@ -233,7 +234,7 @@ void PairPython::settings(int narg, char **arg) if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- @@ -258,7 +259,7 @@ void PairPython::coeff(int narg, char **arg) char * full_cls_name = arg[2]; char * lastpos = strrchr(full_cls_name, '.'); - if (lastpos == NULL) { + if (lastpos == nullptr) { error->all(FLERR,"Python pair style requires fully qualified class name"); } @@ -296,7 +297,7 @@ void PairPython::coeff(int narg, char **arg) delete [] module_name; delete [] cls_name; - PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, NULL); + PyObject * py_pair_instance = PyObject_CallObject(py_pair_type, nullptr); if (!py_pair_instance) { PyErr_Print(); PyErr_Clear(); diff --git a/src/PYTHON/python_compat.h b/src/PYTHON/python_compat.h index 175d797ffa..97946349b2 100644 --- a/src/PYTHON/python_compat.h +++ b/src/PYTHON/python_compat.h @@ -14,19 +14,21 @@ #ifndef LMP_PYTHON_COMPAT_H #define LMP_PYTHON_COMPAT_H +#include + // Wrap API changes between Python 2 and 3 using macros #if PY_MAJOR_VERSION == 2 #define PY_INT_FROM_LONG(X) PyInt_FromLong(X) #define PY_INT_AS_LONG(X) PyInt_AsLong(X) #define PY_STRING_FROM_STRING(X) PyString_FromString(X) -#define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, NULL) +#define PY_VOID_POINTER(X) PyCObject_FromVoidPtr((void *) X, nullptr) #define PY_STRING_AS_STRING(X) PyString_AsString(X) #elif PY_MAJOR_VERSION == 3 #define PY_INT_FROM_LONG(X) PyLong_FromLong(X) #define PY_INT_AS_LONG(X) PyLong_AsLong(X) #define PY_STRING_FROM_STRING(X) PyUnicode_FromString(X) -#define PY_VOID_POINTER(X) PyCapsule_New((void *) X, NULL, NULL) +#define PY_VOID_POINTER(X) PyCapsule_New((void *) X, nullptr, nullptr) #define PY_STRING_AS_STRING(X) PyUnicode_AsUTF8(X) #endif diff --git a/src/PYTHON/python_impl.cpp b/src/PYTHON/python_impl.cpp index b1183677d4..c6482d36fd 100644 --- a/src/PYTHON/python_impl.cpp +++ b/src/PYTHON/python_impl.cpp @@ -12,19 +12,19 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- - Contributing author: Richard Berger and Axel Kohlmeyer (Temple U) + Contributing authors: Richard Berger and Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ #include "python_impl.h" -#include -#include -#include // IWYU pragma: keep -#include "force.h" -#include "input.h" -#include "variable.h" -#include "memory.h" + #include "error.h" +#include "input.h" +#include "memory.h" #include "python_compat.h" +#include "variable.h" + +#include +#include // IWYU pragma: export using namespace LAMMPS_NS; @@ -38,15 +38,15 @@ enum{NONE,INT,DOUBLE,STRING,PTR}; PythonImpl::PythonImpl(LAMMPS *lmp) : Pointers(lmp) { ninput = noutput = 0; - istr = NULL; - ostr = NULL; - format = NULL; + istr = nullptr; + ostr = nullptr; + format = nullptr; length_longstr = 0; // pfuncs stores interface info for each Python function nfunc = 0; - pfuncs = NULL; + pfuncs = nullptr; // one-time initialization of Python interpreter // pyMain stores pointer to main module @@ -104,7 +104,7 @@ void PythonImpl::command(int narg, char **arg) int ifunc = find(arg[0]); if (ifunc < 0) error->all(FLERR,"Python invoke of undefined function"); - char *str = NULL; + char *str = nullptr; if (noutput) { str = input->variable->pythonstyle(pfuncs[ifunc].ovarname, pfuncs[ifunc].name); @@ -122,7 +122,7 @@ void PythonImpl::command(int narg, char **arg) int err; FILE *fp = fopen(arg[2],"r"); - if (fp == NULL) + if (fp == nullptr) err = execute_string(arg[2]); else err = execute_file(arg[2]); @@ -136,19 +136,19 @@ void PythonImpl::command(int narg, char **arg) // parse optional args, invoke is not allowed in this mode ninput = noutput = 0; - istr = NULL; - ostr = NULL; - format = NULL; + istr = nullptr; + ostr = nullptr; + format = nullptr; length_longstr = 0; - char *pyfile = NULL; - char *herestr = NULL; + char *pyfile = nullptr; + char *herestr = nullptr; int existflag = 0; int iarg = 1; while (iarg < narg) { if (strcmp(arg[iarg],"input") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); - ninput = force->inumeric(FLERR,arg[iarg+1]); + ninput = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ninput < 0) error->all(FLERR,"Invalid python command"); iarg += 2; istr = new char*[ninput]; @@ -168,7 +168,7 @@ void PythonImpl::command(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"length") == 0) { if (iarg+2 > narg) error->all(FLERR,"Invalid python command"); - length_longstr = force->inumeric(FLERR,arg[iarg+1]); + length_longstr = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (length_longstr <= 0) error->all(FLERR,"Invalid python command"); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { @@ -206,7 +206,7 @@ void PythonImpl::command(int narg, char **arg) if (pyfile) { FILE *fp = fopen(pyfile,"r"); - if (fp == NULL) { + if (fp == nullptr) { PyGILState_Release(gstate); error->all(FLERR,"Could not open Python file"); } @@ -235,12 +235,14 @@ void PythonImpl::command(int narg, char **arg) if (!pFunc) { PyGILState_Release(gstate); - error->all(FLERR,"Could not find Python function"); + error->all(FLERR,fmt::format("Could not find Python function {}", + pfuncs[ifunc].name)); } if (!PyCallable_Check(pFunc)) { PyGILState_Release(gstate); - error->all(FLERR,"Python function is not callable"); + error->all(FLERR,fmt::format("Python function {} is not callable", + pfuncs[ifunc].name)); } pfuncs[ifunc].pFunc = (void *) pFunc; @@ -422,7 +424,7 @@ int PythonImpl::create_entry(char *name) pfuncs[ifunc].svalue = new char*[ninput]; for (int i = 0; i < ninput; i++) { - pfuncs[ifunc].svalue[i] = NULL; + pfuncs[ifunc].svalue[i] = nullptr; char type = format[i]; if (type == 'i') { pfuncs[ifunc].itype[i] = INT; @@ -433,7 +435,7 @@ int PythonImpl::create_entry(char *name) strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); } else { pfuncs[ifunc].ivarflag[i] = 0; - pfuncs[ifunc].ivalue[i] = force->inumeric(FLERR,istr[i]); + pfuncs[ifunc].ivalue[i] = utils::inumeric(FLERR,istr[i],false,lmp); } } else if (type == 'f') { pfuncs[ifunc].itype[i] = DOUBLE; @@ -444,7 +446,7 @@ int PythonImpl::create_entry(char *name) strcpy(pfuncs[ifunc].svalue[i],&istr[i][2]); } else { pfuncs[ifunc].ivarflag[i] = 0; - pfuncs[ifunc].dvalue[i] = force->numeric(FLERR,istr[i]); + pfuncs[ifunc].dvalue[i] = utils::numeric(FLERR,istr[i],false,lmp); } } else if (type == 's') { pfuncs[ifunc].itype[i] = STRING; @@ -470,8 +472,8 @@ int PythonImpl::create_entry(char *name) // process output as value or variable - pfuncs[ifunc].ovarname = NULL; - pfuncs[ifunc].longstr = NULL; + pfuncs[ifunc].ovarname = nullptr; + pfuncs[ifunc].longstr = nullptr; if (!noutput) return ifunc; char type = format[ninput]; @@ -512,7 +514,7 @@ int PythonImpl::execute_string(char *cmd) int PythonImpl::execute_file(char *fname) { FILE *fp = fopen(fname,"r"); - if (fp == NULL) return -1; + if (fp == nullptr) return -1; PyGILState_STATE gstate = PyGILState_Ensure(); int err = PyRun_SimpleFile(fp,fname); diff --git a/src/Purge.list b/src/Purge.list index ebe1a9c484..0251f923be 100644 --- a/src/Purge.list +++ b/src/Purge.list @@ -49,6 +49,8 @@ packages_ntopo.h # other auto-generated files lmpinstalledpkgs.h lmpgitversion.h +# removed on 9 Sep 2020 +mergesort.h # renamed on 8 May 2020 fix_meso.cpp fix_meso.h diff --git a/src/QEQ/fix_qeq.cpp b/src/QEQ/fix_qeq.cpp index 63fa3caefe..29930f6790 100644 --- a/src/QEQ/fix_qeq.cpp +++ b/src/QEQ/fix_qeq.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_qeq.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -37,18 +37,18 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), list(NULL), chi(NULL), eta(NULL), - gamma(NULL), zeta(NULL), zcore(NULL), chizj(NULL), shld(NULL), - s(NULL), t(NULL), s_hist(NULL), t_hist(NULL), Hdia_inv(NULL), b_s(NULL), - b_t(NULL), p(NULL), q(NULL), r(NULL), d(NULL), - qf(NULL), q1(NULL), q2(NULL), qv(NULL) + Fix(lmp, narg, arg), list(nullptr), chi(nullptr), eta(nullptr), + gamma(nullptr), zeta(nullptr), zcore(nullptr), chizj(nullptr), shld(nullptr), + s(nullptr), t(nullptr), s_hist(nullptr), t_hist(nullptr), Hdia_inv(nullptr), b_s(nullptr), + b_t(nullptr), p(nullptr), q(nullptr), r(nullptr), d(nullptr), + qf(nullptr), q1(nullptr), q2(nullptr), qv(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix qeq command"); - nevery = force->inumeric(FLERR,arg[3]); - cutoff = force->numeric(FLERR,arg[4]); - tolerance = force->numeric(FLERR,arg[5]); - maxiter = force->inumeric(FLERR,arg[6]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + cutoff = utils::numeric(FLERR,arg[4],false,lmp); + tolerance = utils::numeric(FLERR,arg[5],false,lmp); + maxiter = utils::inumeric(FLERR,arg[6],false,lmp); // check for sane arguments if ((nevery <= 0) || (cutoff <= 0.0) || (tolerance <= 0.0) || (maxiter <= 0)) @@ -58,50 +58,50 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : swa = 0.0; swb = cutoff; - shld = NULL; + shld = nullptr; nlocal = n_cap = 0; nall = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; - s = NULL; - t = NULL; + s = nullptr; + t = nullptr; nprev = 5; - Hdia_inv = NULL; - b_s = NULL; - b_t = NULL; + Hdia_inv = nullptr; + b_s = nullptr; + b_t = nullptr; // CG - p = NULL; - q = NULL; - r = NULL; - d = NULL; + p = nullptr; + q = nullptr; + r = nullptr; + d = nullptr; // H matrix - H.firstnbr = NULL; - H.numnbrs = NULL; - H.jlist = NULL; - H.val = NULL; + H.firstnbr = nullptr; + H.numnbrs = nullptr; + H.jlist = nullptr; + H.val = nullptr; // others cutoff_sq = cutoff*cutoff; - chizj = NULL; - qf = NULL; - q1 = NULL; - q2 = NULL; + chizj = nullptr; + qf = nullptr; + q1 = nullptr; + q2 = nullptr; streitz_flag = 0; reax_flag = 0; - qv = NULL; + qv = nullptr; comm_forward = comm_reverse = 1; // perform initial allocation of atom-based arrays // register with Atom class - s_hist = t_hist = NULL; + s_hist = t_hist = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); for( int i = 0; i < atom->nmax; i++ ) for (int j = 0; j < nprev; ++j ) @@ -122,7 +122,7 @@ FixQEq::FixQEq(LAMMPS *lmp, int narg, char **arg) : FixQEq::~FixQEq() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(s_hist); memory->destroy(t_hist); @@ -707,8 +707,8 @@ void FixQEq::read_file(char *file) FILE *fp; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix qeq parameter file %s",file); error->one(FLERR,str); @@ -726,7 +726,7 @@ void FixQEq::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -751,15 +751,15 @@ void FixQEq::read_file(char *file) for (n=0, words[n] = strtok(line," \t\n\r\f"); n < 6; - words[++n] = strtok(NULL," \t\n\r\f")); + words[++n] = strtok(nullptr," \t\n\r\f")); - force->bounds(FLERR,words[0],ntypes,nlo,nhi); + utils::bounds(FLERR,words[0],1,ntypes,nlo,nhi,error); for (n=nlo; n <=nhi; ++n) { - chi[n] = force->numeric(FLERR,words[1]); - eta[n] = force->numeric(FLERR,words[2]); - gamma[n] = force->numeric(FLERR,words[3]); - zeta[n] = force->numeric(FLERR,words[4]); - zcore[n] = force->numeric(FLERR,words[5]); + chi[n] = utils::numeric(FLERR,words[1],false,lmp); + eta[n] = utils::numeric(FLERR,words[2],false,lmp); + gamma[n] = utils::numeric(FLERR,words[3],false,lmp); + zeta[n] = utils::numeric(FLERR,words[4],false,lmp); + zcore[n] = utils::numeric(FLERR,words[5],false,lmp); setflag[n] = 1; } } diff --git a/src/QEQ/fix_qeq_dynamic.cpp b/src/QEQ/fix_qeq_dynamic.cpp index a2cc683b56..7f50736b18 100644 --- a/src/QEQ/fix_qeq_dynamic.cpp +++ b/src/QEQ/fix_qeq_dynamic.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_dynamic.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" diff --git a/src/QEQ/fix_qeq_fire.cpp b/src/QEQ/fix_qeq_fire.cpp index 265528a089..10cdc5d3ca 100644 --- a/src/QEQ/fix_qeq_fire.cpp +++ b/src/QEQ/fix_qeq_fire.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_fire.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -66,8 +66,8 @@ FixQEqFire::FixQEqFire(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix qeq/fire command"); } - comb = NULL; - comb3 = NULL; + comb = nullptr; + comb3 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/QEQ/fix_qeq_shielded.cpp b/src/QEQ/fix_qeq_shielded.cpp index 37951adb1a..306f3f61e3 100644 --- a/src/QEQ/fix_qeq_shielded.cpp +++ b/src/QEQ/fix_qeq_shielded.cpp @@ -78,12 +78,12 @@ void FixQEqShielded::init() void FixQEqShielded::extract_reax() { Pair *pair = force->pair_match("^reax/c",0); - if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); + if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/shielded"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); - if (chi == NULL || eta == NULL || gamma == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr) error->all(FLERR, "Fix qeq/slater could not extract params from pair reax/c"); } diff --git a/src/QEQ/fix_qeq_slater.cpp b/src/QEQ/fix_qeq_slater.cpp index 4f5369eb87..7c7dc159b1 100644 --- a/src/QEQ/fix_qeq_slater.cpp +++ b/src/QEQ/fix_qeq_slater.cpp @@ -17,7 +17,7 @@ #include "fix_qeq_slater.h" #include -#include + #include #include "atom.h" #include "comm.h" @@ -88,15 +88,15 @@ void FixQEqSlater::init() void FixQEqSlater::extract_streitz() { Pair *pair = force->pair_match("coul/streitz",1); - if (pair == NULL) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); + if (pair == nullptr) error->all(FLERR,"No pair coul/streitz for fix qeq/slater"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); zeta = (double *) pair->extract("zeta",tmp); zcore = (double *) pair->extract("zcore",tmp); - if (chi == NULL || eta == NULL || gamma == NULL - || zeta == NULL || zcore == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr + || zeta == nullptr || zcore == nullptr) error->all(FLERR, "Fix qeq/slater could not extract params from pair coul/streitz"); diff --git a/src/REPLICA/compute_event_displace.cpp b/src/REPLICA/compute_event_displace.cpp index a6abcce85d..8efaab7c7a 100644 --- a/src/REPLICA/compute_event_displace.cpp +++ b/src/REPLICA/compute_event_displace.cpp @@ -16,16 +16,16 @@ ------------------------------------------------------------------------- */ #include "compute_event_displace.h" -#include -#include + #include "atom.h" #include "domain.h" -#include "modify.h" -#include "fix_event.h" #include "error.h" -#include "force.h" +#include "fix_event.h" +#include "modify.h" #include "update.h" +#include + using namespace LAMMPS_NS; #define INVOKED_SCALAR 1 @@ -33,21 +33,21 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeEventDisplace::ComputeEventDisplace(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_event(NULL), fix_event(NULL) + Compute(lmp, narg, arg), id_event(nullptr), fix_event(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute event/displace command"); scalar_flag = 1; extscalar = 0; - double displace_dist = force->numeric(FLERR,arg[3]); + double displace_dist = utils::numeric(FLERR,arg[3],false,lmp); if (displace_dist <= 0.0) error->all(FLERR,"Distance must be > 0 for compute event/displace"); displace_distsq = displace_dist * displace_dist; // fix event ID will be set later by accelerated dynamics method - id_event = NULL; + id_event = nullptr; } /* ---------------------------------------------------------------------- */ @@ -65,7 +65,7 @@ void ComputeEventDisplace::init() // if set by PRD, then find fix which stores original atom coords // check if it is correct style - if (id_event != NULL) { + if (id_event != nullptr) { int ifix = modify->find_fix(id_event); if (ifix < 0) error->all(FLERR, "Could not find compute event/displace fix ID"); @@ -88,7 +88,7 @@ double ComputeEventDisplace::compute_scalar() { invoked_scalar = update->ntimestep; - if (id_event == NULL) return 0.0; + if (id_event == nullptr) return 0.0; double event = 0.0; double **xevent = fix_event->array_atom; @@ -150,7 +150,7 @@ int ComputeEventDisplace::all_events() { invoked_scalar = update->ntimestep; - if (id_event == NULL) return 0.0; + if (id_event == nullptr) return 0.0; int event = 0; double **xevent = fix_event->array_atom; @@ -204,8 +204,8 @@ int ComputeEventDisplace::all_events() void ComputeEventDisplace::reset_extra_compute_fix(const char *id_new) { delete [] id_event; - id_event = NULL; - if (id_new == NULL) return; + id_event = nullptr; + if (id_new == nullptr) return; int n = strlen(id_new) + 1; id_event = new char[n]; diff --git a/src/REPLICA/fix_event.cpp b/src/REPLICA/fix_event.cpp index 41f91332cb..92efcef7ba 100644 --- a/src/REPLICA/fix_event.cpp +++ b/src/REPLICA/fix_event.cpp @@ -27,8 +27,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), xevent(NULL), xold(NULL), vold(NULL), - imageold(NULL), xorig(NULL), vorig(NULL), imageorig(NULL) + Fix(lmp, narg, arg), xevent(nullptr), xold(nullptr), vold(nullptr), + imageold(nullptr), xorig(nullptr), vorig(nullptr), imageorig(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix event command"); @@ -38,7 +38,7 @@ FixEvent::FixEvent(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -47,7 +47,7 @@ FixEvent::~FixEvent() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored array diff --git a/src/REPLICA/fix_event_hyper.cpp b/src/REPLICA/fix_event_hyper.cpp index ddbe10adc9..ba784cc3e9 100644 --- a/src/REPLICA/fix_event_hyper.cpp +++ b/src/REPLICA/fix_event_hyper.cpp @@ -12,6 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_event_hyper.h" + #include "comm.h" #include "error.h" #include "update.h" diff --git a/src/REPLICA/fix_hyper.cpp b/src/REPLICA/fix_hyper.cpp index 472d0bbb44..733578caa1 100644 --- a/src/REPLICA/fix_hyper.cpp +++ b/src/REPLICA/fix_hyper.cpp @@ -35,6 +35,6 @@ void *FixHyper::extract(const char *str, int &dim) if (strcmp(str,"hyperflag") == 0) { return &hyperflag; } - return NULL; + return nullptr; } diff --git a/src/REPLICA/fix_hyper_global.cpp b/src/REPLICA/fix_hyper_global.cpp index bc5df921c6..811346d959 100644 --- a/src/REPLICA/fix_hyper_global.cpp +++ b/src/REPLICA/fix_hyper_global.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_hyper_global.h" -#include + #include #include #include "atom.h" @@ -41,9 +41,9 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : - FixHyper(lmp, narg, arg), blist(NULL), xold(NULL), tagold(NULL) + FixHyper(lmp, narg, arg), blist(nullptr), xold(nullptr), tagold(nullptr) { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix hyper/global command requires atom map"); if (narg != 7) error->all(FLERR,"Illegal fix hyper/global command"); @@ -56,10 +56,10 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : extscalar = 0; extvector = 0; - cutbond = force->numeric(FLERR,arg[3]); - qfactor = force->numeric(FLERR,arg[4]); - vmax = force->numeric(FLERR,arg[5]); - tequil = force->numeric(FLERR,arg[6]); + cutbond = utils::numeric(FLERR,arg[3],false,lmp); + qfactor = utils::numeric(FLERR,arg[4],false,lmp); + vmax = utils::numeric(FLERR,arg[5],false,lmp); + tequil = utils::numeric(FLERR,arg[6],false,lmp); if (cutbond < 0.0 || qfactor <= 0.0 || vmax < 0.0 || tequil <= 0.0) error->all(FLERR,"Illegal fix hyper/global command"); @@ -70,12 +70,12 @@ FixHyperGlobal::FixHyperGlobal(LAMMPS *lmp, int narg, char **arg) : maxbond = 0; nblocal = 0; - blist = NULL; + blist = nullptr; maxold = 0; - xold = NULL; - tagold = NULL; - old2now = NULL; + xold = nullptr; + tagold = nullptr; + old2now = nullptr; me = comm->me; firstflag = 1; @@ -125,7 +125,7 @@ void FixHyperGlobal::init() if (force->newton_pair == 0) error->all(FLERR,"Hyper global requires newton pair on"); - if (atom->molecular && me == 0) + if ((atom->molecular != Atom::ATOMIC) && (me == 0)) error->warning(FLERR,"Hyper global for molecular systems " "requires care in defining hyperdynamic bonds"); diff --git a/src/REPLICA/fix_hyper_local.cpp b/src/REPLICA/fix_hyper_local.cpp index d5311fc37d..3dec6bdc10 100644 --- a/src/REPLICA/fix_hyper_local.cpp +++ b/src/REPLICA/fix_hyper_local.cpp @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #include "fix_hyper_local.h" -#include + #include #include -#include + #include "atom.h" #include "update.h" #include "group.h" @@ -30,7 +30,7 @@ #include "math_extra.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -47,14 +47,14 @@ enum{IGNORE,WARN,ERROR}; /* ---------------------------------------------------------------------- */ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : - FixHyper(lmp, narg, arg), blist(NULL), biascoeff(NULL), numbond(NULL), - maxhalf(NULL), eligible(NULL), maxhalfstrain(NULL), old2now(NULL), - tagold(NULL), xold(NULL), maxstrain(NULL), maxstrain_domain(NULL), - biasflag(NULL), bias(NULL), cpage(NULL), clist(NULL), numcoeff(NULL) + FixHyper(lmp, narg, arg), blist(nullptr), biascoeff(nullptr), numbond(nullptr), + maxhalf(nullptr), eligible(nullptr), maxhalfstrain(nullptr), old2now(nullptr), + tagold(nullptr), xold(nullptr), maxstrain(nullptr), maxstrain_domain(nullptr), + biasflag(nullptr), bias(nullptr), cpage(nullptr), clist(nullptr), numcoeff(nullptr) { // error checks - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix hyper/local command requires atom map"); // parse args @@ -75,13 +75,13 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : extscalar = 0; extvector = 0; - cutbond = force->numeric(FLERR,arg[3]); - qfactor = force->numeric(FLERR,arg[4]); - vmax = force->numeric(FLERR,arg[5]); - tequil = force->numeric(FLERR,arg[6]); - dcut = force->numeric(FLERR,arg[7]); - alpha_user = force->numeric(FLERR,arg[8]); - boost_target = force->numeric(FLERR,arg[9]); + cutbond = utils::numeric(FLERR,arg[3],false,lmp); + qfactor = utils::numeric(FLERR,arg[4],false,lmp); + vmax = utils::numeric(FLERR,arg[5],false,lmp); + tequil = utils::numeric(FLERR,arg[6],false,lmp); + dcut = utils::numeric(FLERR,arg[7],false,lmp); + alpha_user = utils::numeric(FLERR,arg[8],false,lmp); + boost_target = utils::numeric(FLERR,arg[9],false,lmp); if (cutbond < 0.0 || qfactor < 0.0 || vmax < 0.0 || tequil <= 0.0 || dcut <= 0.0 || alpha_user <= 0.0 || boost_target < 1.0) @@ -105,13 +105,13 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"bound") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix hyper/local command"); - boundfrac = force->numeric(FLERR,arg[iarg+1]); + boundfrac = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (boundfrac < 0.0) boundflag = 0; else boundflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"reset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix hyper/local command"); - resetfreq = force->inumeric(FLERR,arg[iarg+1]); + resetfreq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (resetfreq < -1) error->all(FLERR,"Illegal fix hyper/local command"); iarg += 2; } else if (strcmp(arg[iarg],"check/ghost") == 0) { @@ -120,7 +120,7 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"check/bias") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix hyper/local command"); checkbias = 1; - checkbias_every = force->inumeric(FLERR,arg[iarg+1]); + checkbias_every = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (strcmp(arg[iarg+2],"error") == 0) checkbias_flag = ERROR; else if (strcmp(arg[iarg+2],"warn") == 0) checkbias_flag = WARN; else if (strcmp(arg[iarg+2],"ignore") == 0) checkbias_flag = IGNORE; @@ -132,28 +132,28 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : // per-atom data structs maxbond = nblocal = 0; - blist = NULL; - biascoeff = NULL; + blist = nullptr; + biascoeff = nullptr; allbonds = 0; maxatom = 0; - maxstrain = NULL; - maxstrain_domain = NULL; - biasflag = NULL; + maxstrain = nullptr; + maxstrain_domain = nullptr; + biasflag = nullptr; maxlocal = nlocal_old = 0; - numbond = NULL; - maxhalf = NULL; - eligible = NULL; - maxhalfstrain = NULL; + numbond = nullptr; + maxhalf = nullptr; + eligible = nullptr; + maxhalfstrain = nullptr; maxall = nall_old = 0; - xold = NULL; - tagold = NULL; - old2now = NULL; + xold = nullptr; + tagold = nullptr; + old2now = nullptr; nbias = maxbias = 0; - bias = NULL; + bias = nullptr; // data structs for persisting bias coeffs when bond list is reformed // maxbondperatom = max # of bonds any atom is part of @@ -162,9 +162,9 @@ FixHyperLocal::FixHyperLocal(LAMMPS *lmp, int narg, char **arg) : maxcoeff = 0; maxbondperatom = FCCBONDS; - numcoeff = NULL; - clist = NULL; - cpage = new MyPage; + numcoeff = nullptr; + clist = nullptr; + cpage = new MyPage; cpage->init(maxbondperatom,1024*maxbondperatom,1); // set comm sizes needed by this fix @@ -274,7 +274,7 @@ void FixHyperLocal::init() if (force->newton_pair == 0) error->all(FLERR,"Hyper local requires newton pair on"); - if (atom->molecular && me == 0) + if ((atom->molecular != Atom::ATOMIC) && (me == 0)) error->warning(FLERR,"Hyper local for molecular systems " "requires care in defining hyperdynamic bonds"); @@ -976,14 +976,14 @@ void FixHyperLocal::build_bond_list(int natom) memory->sfree(clist); maxcoeff = atom->nmax; memory->create(numcoeff,maxcoeff,"hyper/local:numcoeff"); - clist = (OneCoeff **) memory->smalloc(maxcoeff*sizeof(OneCoeff *), + clist = (HyperOneCoeff **) memory->smalloc(maxcoeff*sizeof(HyperOneCoeff *), "hyper/local:clist"); } while (1) { if (firstflag) break; for (i = 0; i < nall; i++) numcoeff[i] = 0; - for (i = 0; i < nall; i++) clist[i] = NULL; + for (i = 0; i < nall; i++) clist[i] = nullptr; cpage->reset(); for (m = 0; m < nblocal; m++) { @@ -1741,7 +1741,7 @@ double FixHyperLocal::memory_usage() bytes += 2*maxall * sizeof(double); // maxstrain,maxstrain_domain if (checkbias) bytes += maxall * sizeof(tagint); // biasflag bytes += maxcoeff * sizeof(int); // numcoeff - bytes += maxcoeff * sizeof(OneCoeff *); // clist - bytes += maxlocal*maxbondperatom * sizeof(OneCoeff); // cpage estimate + bytes += maxcoeff * sizeof(HyperOneCoeff *); // clist + bytes += maxlocal*maxbondperatom * sizeof(HyperOneCoeff); // cpage estimate return bytes; } diff --git a/src/REPLICA/fix_hyper_local.h b/src/REPLICA/fix_hyper_local.h index 4fb54d166c..aa3f050bb9 100644 --- a/src/REPLICA/fix_hyper_local.h +++ b/src/REPLICA/fix_hyper_local.h @@ -23,6 +23,8 @@ FixStyle(hyper/local,FixHyperLocal) #include "fix_hyper.h" namespace LAMMPS_NS { + // forward declaration. struct HyperOneCoeff is defined in my_page.h + struct HyperOneCoeff; class FixHyperLocal : public FixHyper { public: @@ -183,13 +185,8 @@ class FixHyperLocal : public FixHyper { // data structs for persisting bias coeffs when bond list is reformed - struct OneCoeff { - double biascoeff; - tagint tag; - }; - - MyPage *cpage; // pages of OneCoeff datums for clist - OneCoeff **clist; // ptrs to vectors of bias coeffs for each atom + MyPage *cpage;// pages of OneCoeff datums for clist + HyperOneCoeff **clist; // ptrs to vectors of bias coeffs for each atom int *numcoeff; // # of bias coeffs per atom (one per bond) int maxcoeff; // allocate sized of clist and numcoeff diff --git a/src/REPLICA/fix_neb.cpp b/src/REPLICA/fix_neb.cpp index b3af01fda4..a739ec754c 100644 --- a/src/REPLICA/fix_neb.cpp +++ b/src/REPLICA/fix_neb.cpp @@ -17,22 +17,21 @@ ------------------------------------------------------------------------- */ #include "fix_neb.h" -#include -#include -#include -#include + +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "group.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" #include "universe.h" #include "update.h" -#include "atom.h" -#include "domain.h" -#include "comm.h" -#include "modify.h" -#include "compute.h" -#include "group.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "math_const.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -46,17 +45,17 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_pe(NULL), pe(NULL), nlenall(NULL), xprev(NULL), xnext(NULL), - fnext(NULL), springF(NULL), tangent(NULL), xsend(NULL), xrecv(NULL), - fsend(NULL), frecv(NULL), tagsend(NULL), tagrecv(NULL), - xsendall(NULL), xrecvall(NULL), fsendall(NULL), frecvall(NULL), - tagsendall(NULL), tagrecvall(NULL), counts(NULL), - displacements(NULL) + id_pe(nullptr), pe(nullptr), nlenall(nullptr), xprev(nullptr), xnext(nullptr), + fnext(nullptr), springF(nullptr), tangent(nullptr), xsend(nullptr), xrecv(nullptr), + fsend(nullptr), frecv(nullptr), tagsend(nullptr), tagrecv(nullptr), + xsendall(nullptr), xrecvall(nullptr), fsendall(nullptr), frecvall(nullptr), + tagsendall(nullptr), tagrecvall(nullptr), counts(nullptr), + displacements(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix neb command"); - kspring = force->numeric(FLERR,arg[3]); + kspring = utils::numeric(FLERR,arg[3],false,lmp); if (kspring <= 0.0) error->all(FLERR,"Illegal fix neb command"); // optional params @@ -85,7 +84,7 @@ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"perp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix neb command"); PerpSpring = true; - kspringPerp = force->numeric(FLERR,arg[iarg+1]); + kspringPerp = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (kspringPerp == 0.0) PerpSpring = false; if (kspringPerp < 0.0) error->all(FLERR,"Illegal fix neb command"); iarg += 2; @@ -94,22 +93,22 @@ FixNEB::FixNEB(LAMMPS *lmp, int narg, char **arg) : if (iarg+3 > narg) error->all(FLERR,"Illegal fix neb command"); if (strcmp(arg[iarg+1],"first") == 0) { FreeEndIni = true; - kspringIni = force->numeric(FLERR,arg[iarg+2]); + kspringIni = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else if (strcmp(arg[iarg+1],"last") == 0) { FreeEndFinal = true; FinalAndInterWithRespToEIni = false; FreeEndFinalWithRespToEIni = false; - kspringFinal = force->numeric(FLERR,arg[iarg+2]); + kspringFinal = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else if (strcmp(arg[iarg+1],"last/efirst") == 0) { FreeEndFinal = false; FinalAndInterWithRespToEIni = false; FreeEndFinalWithRespToEIni = true; - kspringFinal = force->numeric(FLERR,arg[iarg+2]); + kspringFinal = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else if (strcmp(arg[iarg+1],"last/efirst/middle") == 0) { FreeEndFinal = false; FinalAndInterWithRespToEIni = true; FreeEndFinalWithRespToEIni = true; - kspringFinal = force->numeric(FLERR,arg[iarg+2]); + kspringFinal = utils::numeric(FLERR,arg[iarg+2],false,lmp); } else error->all(FLERR,"Illegal fix neb command"); iarg += 3; @@ -238,7 +237,7 @@ void FixNEB::init() if (atom->nmax > maxlocal) reallocate(); - if (MULTI_PROC && counts == NULL) { + if ((cmode == MULTI_PROC) && (counts == nullptr)) { memory->create(xsendall,ntotal,3,"neb:xsendall"); memory->create(xrecvall,ntotal,3,"neb:xrecvall"); memory->create(fsendall,ntotal,3,"neb:fsendall"); @@ -786,9 +785,9 @@ void FixNEB::inter_replica_comm() MPI_Gatherv(fsend[0],3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, xsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } diff --git a/src/REPLICA/hyper.cpp b/src/REPLICA/hyper.cpp index 6a2891dee1..b015839f64 100644 --- a/src/REPLICA/hyper.cpp +++ b/src/REPLICA/hyper.cpp @@ -12,28 +12,25 @@ ------------------------------------------------------------------------- */ #include "hyper.h" -#include -#include -#include -#include "update.h" -#include "domain.h" -#include "region.h" -#include "integrate.h" -#include "min.h" -#include "force.h" -#include "neighbor.h" -#include "modify.h" + #include "compute_event_displace.h" -#include "fix_hyper.h" -#include "fix_event_hyper.h" -#include "output.h" +#include "domain.h" #include "dump.h" -#include "finish.h" -#include "timer.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "finish.h" +#include "fix_event_hyper.h" +#include "fix_hyper.h" +#include "integrate.h" +#include "memory.h" +#include "min.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "region.h" +#include "timer.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -41,7 +38,7 @@ enum{NOHYPER,GLOBAL,LOCAL}; /* ---------------------------------------------------------------------- */ -Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(NULL) {} +Hyper::Hyper(LAMMPS *lmp) : Pointers(lmp), dumplist(nullptr) {} /* ---------------------------------------------------------------------- perform hyperdynamics simulation @@ -59,8 +56,8 @@ void Hyper::command(int narg, char **arg) if (narg < 4) error->all(FLERR,"Illegal hyper command"); - int nsteps = force->inumeric(FLERR,arg[0]); - t_event = force->inumeric(FLERR,arg[1]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + t_event = utils::inumeric(FLERR,arg[1],false,lmp); char *id_fix = new char[strlen(arg[2])+1]; strcpy(id_fix,arg[2]); @@ -94,7 +91,7 @@ void Hyper::command(int narg, char **arg) fix_hyper = (FixHyper *) modify->fix[ifix]; int dim; int *hyperflag = (int *) fix_hyper->extract("hyperflag",dim); - if (hyperflag == NULL || *hyperflag == 0) + if (hyperflag == nullptr || *hyperflag == 0) error->all(FLERR,"Hyper fix is not a valid hyperdynamics fix"); if (*hyperflag == 1) hyperstyle = GLOBAL; if (*hyperflag == 2) hyperstyle = LOCAL; @@ -356,7 +353,7 @@ void Hyper::command(int narg, char **arg) delete finish; modify->delete_fix("hyper_event"); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -452,17 +449,17 @@ void Hyper::options(int narg, char **arg) maxeval = 50; dumpflag = 0; ndump = 0; - dumplist = NULL; + dumplist = nullptr; rebond = 0; int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"min") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal hyper command"); - etol = force->numeric(FLERR,arg[iarg+1]); - ftol = force->numeric(FLERR,arg[iarg+2]); - maxiter = force->inumeric(FLERR,arg[iarg+3]); - maxeval = force->inumeric(FLERR,arg[iarg+4]); + etol = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol = utils::numeric(FLERR,arg[iarg+2],false,lmp); + maxiter = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + maxeval = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (maxiter < 0) error->all(FLERR,"Illegal hyper command"); iarg += 5; @@ -478,7 +475,7 @@ void Hyper::options(int narg, char **arg) } else if (strcmp(arg[iarg],"rebond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal hyper command"); - rebond = force->inumeric(FLERR,arg[iarg+1]); + rebond = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal hyper command"); diff --git a/src/REPLICA/neb.cpp b/src/REPLICA/neb.cpp index 5a1f942815..37d69e674f 100644 --- a/src/REPLICA/neb.cpp +++ b/src/REPLICA/neb.cpp @@ -12,28 +12,26 @@ ------------------------------------------------------------------------- */ #include "neb.h" -#include -#include -#include -#include -#include "universe.h" + #include "atom.h" -#include "update.h" -#include "domain.h" #include "comm.h" -#include "min.h" -#include "modify.h" +#include "domain.h" +#include "error.h" +#include "finish.h" #include "fix.h" #include "fix_neb.h" +#include "math_const.h" +#include "memory.h" +#include "min.h" +#include "modify.h" #include "output.h" #include "thermo.h" -#include "finish.h" #include "timer.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "math_const.h" -#include "utils.h" +#include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -110,11 +108,11 @@ void NEB::command(int narg, char **arg) if (narg < 6) error->universe_all(FLERR,"Illegal NEB command"); - etol = force->numeric(FLERR,arg[0]); - ftol = force->numeric(FLERR,arg[1]); - n1steps = force->inumeric(FLERR,arg[2]); - n2steps = force->inumeric(FLERR,arg[3]); - nevery = force->inumeric(FLERR,arg[4]); + etol = utils::numeric(FLERR,arg[0],false,lmp); + ftol = utils::numeric(FLERR,arg[1],false,lmp); + n1steps = utils::inumeric(FLERR,arg[2],false,lmp); + n2steps = utils::inumeric(FLERR,arg[3],false,lmp); + nevery = utils::inumeric(FLERR,arg[4],false,lmp); // error checks @@ -135,7 +133,7 @@ void NEB::command(int narg, char **arg) // error checks if (nreplica == 1) error->all(FLERR,"Cannot use NEB with a single replica"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use NEB unless atom map exists"); // process file-style setting to setup initial configs for all replicas @@ -393,7 +391,7 @@ void NEB::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of NEB file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of NEB file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -409,7 +407,7 @@ void NEB::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of NEB file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of NEB file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -462,7 +460,7 @@ void NEB::readfile(char *file, int flag) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); // adjust atom coord based on replica fraction // for flag = 0, interpolate for intermediate and final replicas @@ -563,7 +561,7 @@ void NEB::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/REPLICA/prd.cpp b/src/REPLICA/prd.cpp index 633fcefc80..67bf3202ac 100644 --- a/src/REPLICA/prd.cpp +++ b/src/REPLICA/prd.cpp @@ -16,32 +16,29 @@ ------------------------------------------------------------------------- */ #include "prd.h" -#include -#include -#include + +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "fix_event_prd.h" +#include "integrate.h" +#include "memory.h" +#include "min.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "random_mars.h" +#include "random_park.h" +#include "region.h" +#include "timer.h" #include "universe.h" #include "update.h" -#include "atom.h" -#include "domain.h" -#include "region.h" -#include "comm.h" #include "velocity.h" -#include "integrate.h" -#include "min.h" -#include "neighbor.h" -#include "modify.h" -#include "compute.h" -#include "fix.h" -#include "fix_event_prd.h" -#include "force.h" -#include "random_park.h" -#include "random_mars.h" -#include "output.h" -#include "finish.h" -#include "timer.h" -#include "memory.h" -#include "error.h" -#include "utils.h" + +#include using namespace LAMMPS_NS; @@ -64,7 +61,7 @@ void PRD::command(int narg, char **arg) if (domain->box_exist == 0) error->all(FLERR,"PRD command before simulation box is defined"); if (universe->nworlds != universe->nprocs && - atom->map_style == 0) + atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use PRD with multi-processor replicas " "unless atom map exists"); if (universe->nworlds == 1 && comm->me == 0) @@ -74,15 +71,15 @@ void PRD::command(int narg, char **arg) // read as double so can cast to bigint - int nsteps = force->inumeric(FLERR,arg[0]); - t_event = force->inumeric(FLERR,arg[1]); - n_dephase = force->inumeric(FLERR,arg[2]); - t_dephase = force->inumeric(FLERR,arg[3]); - t_corr = force->inumeric(FLERR,arg[4]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + t_event = utils::inumeric(FLERR,arg[1],false,lmp); + n_dephase = utils::inumeric(FLERR,arg[2],false,lmp); + t_dephase = utils::inumeric(FLERR,arg[3],false,lmp); + t_corr = utils::inumeric(FLERR,arg[4],false,lmp); char *id_compute = new char[strlen(arg[5])+1]; strcpy(id_compute,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); options(narg-7,&arg[7]); @@ -120,9 +117,9 @@ void PRD::command(int narg, char **arg) natoms = atom->natoms; - tagall = NULL; - xall = NULL; - imageall = NULL; + tagall = nullptr; + xall = nullptr; + imageall = nullptr; if (cmode != SINGLE_PROC_DIRECT) { memory->create(tagall,natoms,"prd:tagall"); @@ -130,8 +127,8 @@ void PRD::command(int narg, char **arg) memory->create(imageall,natoms,"prd:imageall"); } - counts = NULL; - displacements = NULL; + counts = nullptr; + displacements = nullptr; if (cmode == MULTI_PROC) { memory->create(counts,nprocs,"prd:counts"); @@ -468,7 +465,7 @@ void PRD::command(int narg, char **arg) modify->delete_compute("prd_temp"); modify->delete_fix("prd_event"); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -892,17 +889,17 @@ void PRD::options(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"min") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal prd command"); - etol = force->numeric(FLERR,arg[iarg+1]); - ftol = force->numeric(FLERR,arg[iarg+2]); - maxiter = force->inumeric(FLERR,arg[iarg+3]); - maxeval = force->inumeric(FLERR,arg[iarg+4]); + etol = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol = utils::numeric(FLERR,arg[iarg+2],false,lmp); + maxiter = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + maxeval = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (maxiter < 0) error->all(FLERR,"Illegal prd command"); iarg += 5; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal prd command"); temp_flag = 1; - temp_dephase = force->numeric(FLERR,arg[iarg+1]); + temp_dephase = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (temp_dephase <= 0.0) error->all(FLERR,"Illegal prd command"); iarg += 2; @@ -911,16 +908,16 @@ void PRD::options(int narg, char **arg) delete [] loop_setting; delete [] dist_setting; - if (strcmp(arg[iarg+1],"all") == 0) loop_setting = NULL; - else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = NULL; - else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = NULL; + if (strcmp(arg[iarg+1],"all") == 0) loop_setting = nullptr; + else if (strcmp(arg[iarg+1],"local") == 0) loop_setting = nullptr; + else if (strcmp(arg[iarg+1],"geom") == 0) loop_setting = nullptr; else error->all(FLERR,"Illegal prd command"); int n = strlen(arg[iarg+1]) + 1; loop_setting = new char[n]; strcpy(loop_setting,arg[iarg+1]); - if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = NULL; - else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = NULL; + if (strcmp(arg[iarg+2],"uniform") == 0) dist_setting = nullptr; + else if (strcmp(arg[iarg+2],"gaussian") == 0) dist_setting = nullptr; else error->all(FLERR,"Illegal prd command"); n = strlen(arg[iarg+2]) + 1; dist_setting = new char[n]; diff --git a/src/REPLICA/tad.cpp b/src/REPLICA/tad.cpp index a629ee6b04..d0046b527c 100644 --- a/src/REPLICA/tad.cpp +++ b/src/REPLICA/tad.cpp @@ -16,28 +16,28 @@ ------------------------------------------------------------------------- */ #include "tad.h" -#include -#include -#include -#include "universe.h" -#include "update.h" + #include "atom.h" -#include "domain.h" -#include "integrate.h" -#include "min.h" -#include "neighbor.h" -#include "modify.h" -#include "neb.h" #include "compute.h" +#include "domain.h" +#include "error.h" +#include "finish.h" #include "fix_event_tad.h" #include "fix_store.h" #include "force.h" -#include "output.h" -#include "finish.h" -#include "timer.h" +#include "integrate.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "min.h" +#include "modify.h" +#include "neb.h" +#include "neighbor.h" +#include "output.h" +#include "timer.h" +#include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -50,7 +50,7 @@ TAD::TAD(LAMMPS *lmp) : Pointers(lmp) {} TAD::~TAD() { memory->sfree(fix_event_list); - if (neb_logfilename != NULL) delete [] neb_logfilename; + if (neb_logfilename != nullptr) delete [] neb_logfilename; delete [] min_style; delete [] min_style_neb; } @@ -62,7 +62,7 @@ TAD::~TAD() void TAD::command(int narg, char **arg) { - fix_event_list = NULL; + fix_event_list = nullptr; n_event_list = 0; nmax_event_list = 0; nmin_event_list = 10; @@ -77,17 +77,17 @@ void TAD::command(int narg, char **arg) error->all(FLERR,"Can only use TAD with 1-processor replicas for NEB"); if (atom->sortfreq > 0) error->all(FLERR,"Cannot use TAD with atom_modify sort enabled for NEB"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use TAD unless atom map exists for NEB"); if (narg < 7) error->universe_all(FLERR,"Illegal tad command"); - nsteps = force->inumeric(FLERR,arg[0]); - t_event = force->inumeric(FLERR,arg[1]); - templo = force->numeric(FLERR,arg[2]); - temphi = force->numeric(FLERR,arg[3]); - delta_conf = force->numeric(FLERR,arg[4]); - tmax = force->numeric(FLERR,arg[5]); + nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + t_event = utils::inumeric(FLERR,arg[1],false,lmp); + templo = utils::numeric(FLERR,arg[2],false,lmp); + temphi = utils::numeric(FLERR,arg[3],false,lmp); + delta_conf = utils::numeric(FLERR,arg[4],false,lmp); + tmax = utils::numeric(FLERR,arg[5],false,lmp); char *id_compute = new char[strlen(arg[6])+1]; strcpy(id_compute,arg[6]); @@ -226,8 +226,8 @@ void TAD::command(int narg, char **arg) ulogfile_lammps = universe->ulogfile; uscreen_lammps = universe->uscreen; - ulogfile_neb = NULL; - uscreen_neb = NULL; + ulogfile_neb = nullptr; + uscreen_neb = nullptr; if (me_universe == 0 && neb_logfilename) ulogfile_neb = fopen(neb_logfilename,"w"); @@ -421,7 +421,7 @@ void TAD::command(int narg, char **arg) modify->delete_fix("tad_revert"); delete_event_list(); - compute_event->reset_extra_compute_fix(NULL); + compute_event->reset_extra_compute_fix(nullptr); } /* ---------------------------------------------------------------------- @@ -586,16 +586,16 @@ void TAD::options(int narg, char **arg) min_style_neb = new char[n]; strcpy(min_style_neb,"quickmin"); dt_neb = update->dt; - neb_logfilename = NULL; + neb_logfilename = nullptr; int iarg = 0; while (iarg < narg) { if (strcmp(arg[iarg],"min") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal tad command"); - etol = force->numeric(FLERR,arg[iarg+1]); - ftol = force->numeric(FLERR,arg[iarg+2]); - maxiter = force->inumeric(FLERR,arg[iarg+3]); - maxeval = force->inumeric(FLERR,arg[iarg+4]); + etol = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol = utils::numeric(FLERR,arg[iarg+2],false,lmp); + maxiter = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + maxeval = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (maxiter < 0 || maxeval < 0 || etol < 0.0 || ftol < 0.0 ) error->all(FLERR,"Illegal tad command"); @@ -603,11 +603,11 @@ void TAD::options(int narg, char **arg) } else if (strcmp(arg[iarg],"neb") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal tad command"); - etol_neb = force->numeric(FLERR,arg[iarg+1]); - ftol_neb = force->numeric(FLERR,arg[iarg+2]); - n1steps_neb = force->inumeric(FLERR,arg[iarg+3]); - n2steps_neb = force->inumeric(FLERR,arg[iarg+4]); - nevery_neb = force->inumeric(FLERR,arg[iarg+5]); + etol_neb = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ftol_neb = utils::numeric(FLERR,arg[iarg+2],false,lmp); + n1steps_neb = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + n2steps_neb = utils::inumeric(FLERR,arg[iarg+4],false,lmp); + nevery_neb = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (etol_neb < 0.0 || ftol_neb < 0.0 || n1steps_neb < 0 || n2steps_neb < 0 || nevery_neb < 0) error->all(FLERR,"Illegal tad command"); @@ -623,14 +623,14 @@ void TAD::options(int narg, char **arg) } else if (strcmp(arg[iarg],"neb_step") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal tad command"); - dt_neb = force->numeric(FLERR,arg[iarg+1]); + dt_neb = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dt_neb <= 0.0) error->all(FLERR,"Illegal tad command"); iarg += 2; } else if (strcmp(arg[iarg],"neb_log") == 0) { delete [] neb_logfilename; if (iarg+2 > narg) error->all(FLERR,"Illegal tad command"); - if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = NULL; + if (strcmp(arg[iarg+1],"none") == 0) neb_logfilename = nullptr; else { int n = strlen(arg[iarg+1]) + 1; neb_logfilename = new char[n]; @@ -885,7 +885,7 @@ void TAD::delete_event_list() { modify->delete_fix(str); } memory->sfree(fix_event_list); - fix_event_list = NULL; + fix_event_list = nullptr; n_event_list = 0; nmax_event_list = 0; diff --git a/src/REPLICA/temper.cpp b/src/REPLICA/temper.cpp index a4c67108d3..0d15be2aa6 100644 --- a/src/REPLICA/temper.cpp +++ b/src/REPLICA/temper.cpp @@ -16,22 +16,23 @@ ------------------------------------------------------------------------- */ #include "temper.h" -#include -#include -#include "universe.h" -#include "domain.h" + #include "atom.h" -#include "update.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "fix.h" +#include "force.h" #include "integrate.h" #include "modify.h" -#include "compute.h" -#include "force.h" -#include "fix.h" #include "random_park.h" -#include "finish.h" #include "timer.h" -#include "error.h" -#include "utils.h" +#include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -67,9 +68,9 @@ void Temper::command(int narg, char **arg) if (narg != 6 && narg != 7) error->universe_all(FLERR,"Illegal temper command"); - int nsteps = force->inumeric(FLERR,arg[0]); - nevery = force->inumeric(FLERR,arg[1]); - double temp = force->numeric(FLERR,arg[2]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + nevery = utils::inumeric(FLERR,arg[1],false,lmp); + double temp = utils::numeric(FLERR,arg[2],false,lmp); // ignore temper command, if walltime limit was already reached @@ -80,11 +81,11 @@ void Temper::command(int narg, char **arg) if (whichfix == modify->nfix) error->universe_all(FLERR,"Tempering fix ID is not defined"); - seed_swap = force->inumeric(FLERR,arg[4]); - seed_boltz = force->inumeric(FLERR,arg[5]); + seed_swap = utils::inumeric(FLERR,arg[4],false,lmp); + seed_boltz = utils::inumeric(FLERR,arg[5],false,lmp); my_set_temp = universe->iworld; - if (narg == 7) my_set_temp = force->inumeric(FLERR,arg[6]); + if (narg == 7) my_set_temp = utils::inumeric(FLERR,arg[6],false,lmp); if ((my_set_temp < 0) || (my_set_temp >= universe->nworlds)) error->universe_one(FLERR,"Illegal temperature index"); @@ -146,7 +147,7 @@ void Temper::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/REPLICA/verlet_split.cpp b/src/REPLICA/verlet_split.cpp index a5ed1a671d..41ee3b1911 100644 --- a/src/REPLICA/verlet_split.cpp +++ b/src/REPLICA/verlet_split.cpp @@ -42,7 +42,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : - Verlet(lmp, narg, arg), qsize(NULL), qdisp(NULL), xsize(NULL), xdisp(NULL), f_kspace(NULL) + Verlet(lmp, narg, arg), qsize(nullptr), qdisp(nullptr), xsize(nullptr), xdisp(nullptr), f_kspace(nullptr) { // error checks on partitions @@ -194,7 +194,7 @@ VerletSplit::VerletSplit(LAMMPS *lmp, int narg, char **arg) : // allocate dummy version for Kspace partition maxatom = 0; - f_kspace = NULL; + f_kspace = nullptr; if (!master) memory->create(f_kspace,1,1,"verlet/split:f_kspace"); } @@ -289,7 +289,7 @@ void VerletSplit::run(int n) Fix *fix_omp; int ifix = modify->find_fix("package_omp"); - if (ifix < 0) fix_omp = NULL; + if (ifix < 0) fix_omp = nullptr; else fix_omp = modify->fix[ifix]; // flags for timestepping iterations @@ -580,8 +580,8 @@ void VerletSplit::k2r_comm() memory usage of Kspace force array on master procs ------------------------------------------------------------------------- */ -bigint VerletSplit::memory_usage() +double VerletSplit::memory_usage() { - bigint bytes = maxatom*3 * sizeof(double); + double bytes = maxatom*3 * sizeof(double); return bytes; } diff --git a/src/REPLICA/verlet_split.h b/src/REPLICA/verlet_split.h index b3ee87e580..f31ebdfa17 100644 --- a/src/REPLICA/verlet_split.h +++ b/src/REPLICA/verlet_split.h @@ -32,7 +32,7 @@ class VerletSplit : public Verlet { void setup(int); void setup_minimal(int); void run(int); - bigint memory_usage(); + double memory_usage(); private: int master; // 1 if an Rspace proc, 0 if Kspace diff --git a/src/RIGID/compute_erotate_rigid.cpp b/src/RIGID/compute_erotate_rigid.cpp index e15c0deb82..43e636963f 100644 --- a/src/RIGID/compute_erotate_rigid.cpp +++ b/src/RIGID/compute_erotate_rigid.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeERotateRigid::ComputeERotateRigid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), rfix(NULL) + Compute(lmp, narg, arg), rfix(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute erotate/rigid command"); diff --git a/src/RIGID/compute_ke_rigid.cpp b/src/RIGID/compute_ke_rigid.cpp index 031919b7a9..6ce4440d05 100644 --- a/src/RIGID/compute_ke_rigid.cpp +++ b/src/RIGID/compute_ke_rigid.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeKERigid::ComputeKERigid(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), rfix(NULL) + Compute(lmp, narg, arg), rfix(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute ke/rigid command"); diff --git a/src/RIGID/compute_rigid_local.cpp b/src/RIGID/compute_rigid_local.cpp index 57f69a64e2..c100db82e8 100644 --- a/src/RIGID/compute_rigid_local.cpp +++ b/src/RIGID/compute_rigid_local.cpp @@ -33,7 +33,7 @@ enum{ID,MOL,MASS,X,Y,Z,XU,YU,ZU,VX,VY,VZ,FX,FY,FZ,IX,IY,IZ, ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - rstyle(NULL), idrigid(NULL), fixrigid(NULL), vlocal(NULL), alocal(NULL) + rstyle(nullptr), idrigid(nullptr), fixrigid(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute rigid/local command"); @@ -89,8 +89,8 @@ ComputeRigidLocal::ComputeRigidLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; ncount = nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -115,8 +115,8 @@ void ComputeRigidLocal::init() fixrigid = (FixRigidSmall *) modify->fix[ifix]; int flag = 0; - if (strstr(fixrigid->style,"rigid/") == NULL) flag = 1; - if (strstr(fixrigid->style,"/small") == NULL) flag = 1; + if (strstr(fixrigid->style,"rigid/") == nullptr) flag = 1; + if (strstr(fixrigid->style,"/small") == nullptr) flag = 1; if (flag) error->all(FLERR,"Compute rigid/local does not use fix rigid/small fix"); diff --git a/src/RIGID/fix_ehex.cpp b/src/RIGID/fix_ehex.cpp index a5efc22d11..c325707dda 100644 --- a/src/RIGID/fix_ehex.cpp +++ b/src/RIGID/fix_ehex.cpp @@ -23,7 +23,7 @@ ------------------------------------------------------------------------- */ #include "fix_ehex.h" -#include + #include #include #include "atom.h" @@ -45,8 +45,8 @@ enum{CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL), x(NULL), f(NULL), v(NULL), - mass(NULL), rmass(NULL), type(NULL), scalingmask(NULL) + idregion(nullptr), x(nullptr), f(nullptr), v(nullptr), + mass(nullptr), rmass(nullptr), type(nullptr), scalingmask(nullptr) { MPI_Comm_rank(world, &me); @@ -59,13 +59,13 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), // apply fix every nevery timesteps - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix ehex command"); // heat flux into the reservoir - heat_input = force->numeric(FLERR,arg[4]); + heat_input = utils::numeric(FLERR,arg[4],false,lmp); // optional args @@ -127,9 +127,9 @@ FixEHEX::FixEHEX(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), error->all(FLERR, "You can only use the keyword 'com' together with the keyword 'constrain' "); scale = 1.0; - scalingmask = NULL; + scalingmask = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); } @@ -145,7 +145,7 @@ void FixEHEX::grow_arrays(int nmax) { FixEHEX::~FixEHEX() { - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete [] idregion; memory->destroy(scalingmask); @@ -177,7 +177,7 @@ void FixEHEX::init() if (group->count(igroup) == 0) error->all(FLERR,"Fix ehex group has no atoms"); - fshake = NULL; + fshake = nullptr; if (constraints) { // check if constraining algorithm is used (FixRattle inherits from FixShake) @@ -335,7 +335,7 @@ void FixEHEX::update_scalingmask() { // prematch region - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -354,7 +354,7 @@ void FixEHEX::update_scalingmask() { m = fshake->list[i]; // check if the centre of mass of the cluster is inside the region - // if region == NULL, just check the group information of all sites + // if region == nullptr, just check the group information of all sites if (fshake->shake_flag[m] == 1) nsites = 3; else if (fshake->shake_flag[m] == 2) nsites = 2; diff --git a/src/RIGID/fix_rattle.cpp b/src/RIGID/fix_rattle.cpp index ff31ab9755..07787bcbfe 100644 --- a/src/RIGID/fix_rattle.cpp +++ b/src/RIGID/fix_rattle.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_rattle.h" -#include + #include #include #include "atom.h" @@ -59,7 +59,7 @@ FixRattle::FixRattle(LAMMPS *lmp, int narg, char **arg) : // allocate memory for unconstrained velocity update - vp = NULL; + vp = nullptr; grow_arrays(atom->nmax); // default communication mode diff --git a/src/RIGID/fix_rigid.cpp b/src/RIGID/fix_rigid.cpp index 0d15f22090..d2f4f5f6c8 100644 --- a/src/RIGID/fix_rigid.cpp +++ b/src/RIGID/fix_rigid.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_rigid.h" -#include + #include -#include + #include #include "math_extra.h" +#include "math_eigen.h" #include "atom.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" @@ -35,8 +36,8 @@ #include "memory.h" #include "error.h" #include "rigid_const.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -46,16 +47,16 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), - inpfile(NULL), nrigid(NULL), mol2body(NULL), body2mol(NULL), - body(NULL), displace(NULL), masstotal(NULL), xcm(NULL), - vcm(NULL), fcm(NULL), inertia(NULL), ex_space(NULL), - ey_space(NULL), ez_space(NULL), angmom(NULL), omega(NULL), - torque(NULL), quat(NULL), imagebody(NULL), fflag(NULL), - tflag(NULL), langextra(NULL), sum(NULL), all(NULL), - remapflag(NULL), xcmimage(NULL), eflags(NULL), orient(NULL), - dorient(NULL), id_dilate(NULL), id_gravity(NULL), random(NULL), - avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), + inpfile(nullptr), nrigid(nullptr), mol2body(nullptr), body2mol(nullptr), + body(nullptr), displace(nullptr), masstotal(nullptr), xcm(nullptr), + vcm(nullptr), fcm(nullptr), inertia(nullptr), ex_space(nullptr), + ey_space(nullptr), ez_space(nullptr), angmom(nullptr), omega(nullptr), + torque(nullptr), quat(nullptr), imagebody(nullptr), fflag(nullptr), + tflag(nullptr), langextra(nullptr), sum(nullptr), all(nullptr), + remapflag(nullptr), xcmimage(nullptr), eflags(nullptr), orient(nullptr), + dorient(nullptr), id_dilate(nullptr), id_gravity(nullptr), random(nullptr), + avec_ellipsoid(nullptr), avec_line(nullptr), avec_tri(nullptr) { int i,ibody; @@ -76,14 +77,14 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // register with Atom class extended = orientflag = dorientflag = 0; - body = NULL; - xcmimage = NULL; - displace = NULL; - eflags = NULL; - orient = NULL; - dorient = NULL; + body = nullptr; + xcmimage = nullptr; + displace = nullptr; + eflags = nullptr; + orient = nullptr; + dorient = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // parse args for rigid body specification // set nbody and body[i] for each atom @@ -91,8 +92,8 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix rigid command"); int iarg; - mol2body = NULL; - body2mol = NULL; + mol2body = nullptr; + body2mol = nullptr; // single rigid body // nbody = 1 @@ -226,7 +227,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"group") == 0) { if (narg < 5) error->all(FLERR,"Illegal fix rigid command"); rstyle = GROUP; - nbody = force->inumeric(FLERR,arg[4]); + nbody = utils::inumeric(FLERR,arg[4],false,lmp); if (nbody <= 0) error->all(FLERR,"Illegal fix rigid command"); if (narg < 5+nbody) error->all(FLERR,"Illegal fix rigid command"); iarg = 5+nbody; @@ -322,9 +323,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : t_order = 3; p_chain = 10; - inpfile = NULL; - id_gravity = NULL; - id_dilate = NULL; + inpfile = nullptr; + id_gravity = nullptr; + id_dilate = nullptr; pcouple = NONE; pstyle = ANISO; @@ -340,7 +341,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+5 > narg) error->all(FLERR,"Illegal fix rigid command"); int mlo,mhi; - force->bounds(FLERR,arg[iarg+1],nbody,mlo,mhi); + utils::bounds(FLERR,arg[iarg+1],1,nbody,mlo,mhi,error); double xflag,yflag,zflag; if (strcmp(arg[iarg+2],"off") == 0) xflag = 0.0; @@ -371,7 +372,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+5 > narg) error->all(FLERR,"Illegal fix rigid command"); int mlo,mhi; - force->bounds(FLERR,arg[iarg+1],nbody,mlo,mhi); + utils::bounds(FLERR,arg[iarg+1],1,nbody,mlo,mhi,error); double xflag,yflag,zflag; if (strcmp(arg[iarg+2],"off") == 0) xflag = 0.0; @@ -404,10 +405,10 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : strcmp(style,"rigid/omp") != 0 && strcmp(style,"rigid/nve/omp") != 0) error->all(FLERR,"Illegal fix rigid command"); langflag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); - seed = force->inumeric(FLERR,arg[iarg+4]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix rigid langevin period must be > 0.0"); if (seed <= 0) error->all(FLERR,"Illegal fix rigid command"); @@ -418,9 +419,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/n.t")) error->all(FLERR,"Illegal fix rigid command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"iso") == 0) { @@ -428,10 +429,10 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -443,10 +444,10 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -458,9 +459,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; iarg += 4; @@ -468,9 +469,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; iarg += 4; @@ -478,9 +479,9 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; iarg += 4; @@ -515,16 +516,16 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/n.t")) error->all(FLERR,"Illegal fix rigid command"); - t_chain = force->inumeric(FLERR,arg[iarg+1]); - t_iter = force->inumeric(FLERR,arg[iarg+2]); - t_order = force->inumeric(FLERR,arg[iarg+3]); + t_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + t_iter = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + t_order = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid command"); if (!utils::strmatch(style,"^rigid/np.")) error->all(FLERR,"Illegal fix rigid command"); - p_chain = force->inumeric(FLERR,arg[iarg+1]); + p_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"infile") == 0) { @@ -567,7 +568,7 @@ FixRigid::FixRigid(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed if (langflag) random = new RanMars(lmp,seed + me); - else random = NULL; + else random = nullptr; // initialize vector output quantities in case accessed before run @@ -619,7 +620,7 @@ FixRigid::~FixRigid() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete random; delete [] inpfile; @@ -970,7 +971,7 @@ void FixRigid::apply_langevin_thermostat() { if (me == 0) { double gamma1,gamma2; - + double wbody[3],tbody[3]; double delta = update->ntimestep - update->beginstep; if (delta != 0.0) delta /= update->endstep - update->beginstep; t_target = t_start + delta * (t_stop-t_start); @@ -991,12 +992,23 @@ void FixRigid::apply_langevin_thermostat() gamma1 = -1.0 / t_period / ftm2v; gamma2 = tsqrt * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v; - langextra[i][3] = inertia[i][0]*gamma1*omega[i][0] + + + // convert omega from space frame to body frame + + MathExtra::transpose_matvec(ex_space[i],ey_space[i],ez_space[i],omega[i],wbody); + + // compute langevin torques in the body frame + + tbody[0] = inertia[i][0]*gamma1*wbody[0] + sqrt(inertia[i][0])*gamma2*(random->uniform()-0.5); - langextra[i][4] = inertia[i][1]*gamma1*omega[i][1] + + tbody[1] = inertia[i][1]*gamma1*wbody[1] + sqrt(inertia[i][1])*gamma2*(random->uniform()-0.5); - langextra[i][5] = inertia[i][2]*gamma1*omega[i][2] + + tbody[2] = inertia[i][2]*gamma1*wbody[2] + sqrt(inertia[i][2])*gamma2*(random->uniform()-0.5); + + // convert langevin torques from body frame back to space frame + + MathExtra::matvec(ex_space[i],ey_space[i],ez_space[i],tbody,&langextra[i][3]); } } @@ -1930,7 +1942,7 @@ void FixRigid::setup_bodies_static() // overwrite Cartesian inertia tensor with file values - if (inpfile) readfile(1,NULL,all,NULL,NULL,NULL,inbody); + if (inpfile) readfile(1,nullptr,all,nullptr,nullptr,nullptr,inbody); // diagonalize inertia tensor for each body via Jacobi rotations // inertia = 3 eigenvalues = principal moments of inertia @@ -1948,7 +1960,7 @@ void FixRigid::setup_bodies_static() tensor[0][2] = tensor[2][0] = all[ibody][4]; tensor[0][1] = tensor[1][0] = all[ibody][5]; - ierror = MathExtra::jacobi(tensor,inertia[ibody],evectors); + ierror = MathEigen::jacobi3(tensor,inertia[ibody],evectors); if (ierror) error->all(FLERR, "Insufficient Jacobi rotations for rigid body"); @@ -2281,12 +2293,12 @@ void FixRigid::readfile(int which, double *vec, if (me == 0) { fp = fopen(inpfile,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid file {}: {}", inpfile,utils::getsyserror())); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of fix rigid file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -2327,7 +2339,7 @@ void FixRigid::readfile(int which, double *vec, values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); id = atoi(values[0]); if (rstyle == MOLECULE) { @@ -2390,7 +2402,7 @@ void FixRigid::write_restart_file(const char *file) auto outfile = std::string(file) + ".rigid"; FILE *fp = fopen(outfile.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", outfile,utils::getsyserror())); @@ -2711,7 +2723,7 @@ void *FixRigid::extract(const char *str, int &dim) return &t_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_rigid_nh.cpp b/src/RIGID/fix_rigid_nh.cpp index 1df7f34532..0aa5f99765 100644 --- a/src/RIGID/fix_rigid_nh.cpp +++ b/src/RIGID/fix_rigid_nh.cpp @@ -42,12 +42,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : - FixRigid(lmp, narg, arg), conjqm(NULL), w(NULL), - wdti1(NULL), wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), - eta_t(NULL), eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), - f_eta_t(NULL), f_eta_r(NULL), q_b(NULL), eta_b(NULL), - eta_dot_b(NULL), f_eta_b(NULL), rfix(NULL), id_temp(NULL), - id_press(NULL), temperature(NULL), pressure(NULL) + FixRigid(lmp, narg, arg), conjqm(nullptr), w(nullptr), + wdti1(nullptr), wdti2(nullptr), wdti4(nullptr), q_t(nullptr), q_r(nullptr), + eta_t(nullptr), eta_r(nullptr), eta_dot_t(nullptr), eta_dot_r(nullptr), + f_eta_t(nullptr), f_eta_r(nullptr), q_b(nullptr), eta_b(nullptr), + eta_dot_b(nullptr), f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), + id_press(nullptr), temperature(nullptr), pressure(nullptr) { // error checks: could be moved up to FixRigid @@ -145,7 +145,7 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : // rigid body pointers nrigidfix = 0; - rfix = NULL; + rfix = nullptr; vol0 = 0.0; t0 = 1.0; @@ -153,8 +153,8 @@ FixRigidNH::FixRigidNH(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; } /* ---------------------------------------------------------------------- */ @@ -304,7 +304,7 @@ void FixRigidNH::init() if (rfix) delete [] rfix; nrigidfix = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigidfix++; diff --git a/src/RIGID/fix_rigid_nh.h b/src/RIGID/fix_rigid_nh.h index 1126e7bb50..a8850413eb 100644 --- a/src/RIGID/fix_rigid_nh.h +++ b/src/RIGID/fix_rigid_nh.h @@ -64,7 +64,7 @@ class FixRigidNH : public FixRigid { double mtk_term1,mtk_term2; // Martyna-Tobias-Klein corrections - double t_current,t_target; + double t_current; double p_current[3],p_target[3]; char *id_temp,*id_press; diff --git a/src/RIGID/fix_rigid_nh_small.cpp b/src/RIGID/fix_rigid_nh_small.cpp index 5b75640549..b599868ecd 100644 --- a/src/RIGID/fix_rigid_nh_small.cpp +++ b/src/RIGID/fix_rigid_nh_small.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "fix_rigid_nh_small.h" -#include + #include #include #include "math_extra.h" @@ -44,12 +44,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : - FixRigidSmall(lmp, narg, arg), w(NULL), wdti1(NULL), - wdti2(NULL), wdti4(NULL), q_t(NULL), q_r(NULL), eta_t(NULL), - eta_r(NULL), eta_dot_t(NULL), eta_dot_r(NULL), f_eta_t(NULL), - f_eta_r(NULL), q_b(NULL), eta_b(NULL), eta_dot_b(NULL), - f_eta_b(NULL), rfix(NULL), id_temp(NULL), id_press(NULL), - temperature(NULL), pressure(NULL) + FixRigidSmall(lmp, narg, arg), w(nullptr), wdti1(nullptr), + wdti2(nullptr), wdti4(nullptr), q_t(nullptr), q_r(nullptr), eta_t(nullptr), + eta_r(nullptr), eta_dot_t(nullptr), eta_dot_r(nullptr), f_eta_t(nullptr), + f_eta_r(nullptr), q_b(nullptr), eta_b(nullptr), eta_dot_b(nullptr), + f_eta_b(nullptr), rfix(nullptr), id_temp(nullptr), id_press(nullptr), + temperature(nullptr), pressure(nullptr) { // error checks @@ -159,7 +159,7 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : // rigid body pointers nrigidfix = 0; - rfix = NULL; + rfix = nullptr; vol0 = 0.0; t0 = 1.0; @@ -167,8 +167,8 @@ FixRigidNHSmall::FixRigidNHSmall(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; } /* ---------------------------------------------------------------------- */ @@ -301,7 +301,7 @@ void FixRigidNHSmall::init() if (rfix) delete [] rfix; nrigidfix = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigidfix++; diff --git a/src/RIGID/fix_rigid_small.cpp b/src/RIGID/fix_rigid_small.cpp index f12c53bf3a..7699e49c41 100644 --- a/src/RIGID/fix_rigid_small.cpp +++ b/src/RIGID/fix_rigid_small.cpp @@ -12,12 +12,13 @@ ------------------------------------------------------------------------- */ #include "fix_rigid_small.h" -#include + #include -#include + #include #include #include "math_extra.h" +#include "math_eigen.h" #include "atom.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" @@ -39,8 +40,8 @@ #include "memory.h" #include "error.h" #include "rigid_const.h" -#include "utils.h" -#include "fmt/format.h" + + #include @@ -54,12 +55,12 @@ using namespace RigidConst; /* ---------------------------------------------------------------------- */ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), step_respa(NULL), - inpfile(NULL), body(NULL), bodyown(NULL), bodytag(NULL), atom2body(NULL), - xcmimage(NULL), displace(NULL), eflags(NULL), orient(NULL), dorient(NULL), - avec_ellipsoid(NULL), avec_line(NULL), avec_tri(NULL), counts(NULL), - itensor(NULL), mass_body(NULL), langextra(NULL), random(NULL), - id_dilate(NULL), id_gravity(NULL), onemols(NULL) + Fix(lmp, narg, arg), step_respa(nullptr), + inpfile(nullptr), body(nullptr), bodyown(nullptr), bodytag(nullptr), atom2body(nullptr), + xcmimage(nullptr), displace(nullptr), eflags(nullptr), orient(nullptr), dorient(nullptr), + avec_ellipsoid(nullptr), avec_line(nullptr), avec_tri(nullptr), counts(nullptr), + itensor(nullptr), mass_body(nullptr), langextra(nullptr), random(nullptr), + id_dilate(nullptr), id_gravity(nullptr), onemols(nullptr) { int i; @@ -82,21 +83,21 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // register with Atom class extended = orientflag = dorientflag = customflag = 0; - bodyown = NULL; - bodytag = NULL; - atom2body = NULL; - xcmimage = NULL; - displace = NULL; - eflags = NULL; - orient = NULL; - dorient = NULL; + bodyown = nullptr; + bodytag = nullptr; + atom2body = nullptr; + xcmimage = nullptr; + displace = nullptr; + eflags = nullptr; + orient = nullptr; + dorient = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // parse args for rigid body specification int *mask = atom->mask; - tagint *bodyID = NULL; + tagint *bodyID = nullptr; int nlocal = atom->nlocal; if (narg < 4) error->all(FLERR,"Illegal fix rigid/small command"); @@ -158,7 +159,7 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Unsupported fix rigid custom property"); } else error->all(FLERR,"Illegal fix rigid/small command"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix rigid/small requires an atom map, see atom_modify"); // maxmol = largest bodyID # @@ -178,14 +179,14 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : int seed; langflag = 0; - inpfile = NULL; - onemols = NULL; + inpfile = nullptr; + onemols = nullptr; reinitflag = 1; tstat_flag = 0; pstat_flag = 0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; t_chain = 10; t_iter = 1; t_order = 3; @@ -210,10 +211,10 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : (strcmp(style,"rigid/nph/small") != 0)) error->all(FLERR,"Illegal fix rigid/small command"); langflag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); - seed = force->inumeric(FLERR,arg[iarg+4]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); + seed = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix rigid/small langevin period must be > 0.0"); if (seed <= 0) error->all(FLERR,"Illegal fix rigid/small command"); @@ -252,9 +253,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/n.t/small")) error->all(FLERR,"Illegal fix rigid command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"iso") == 0) { @@ -262,10 +263,10 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (domain->dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -277,10 +278,10 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (domain->dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -292,9 +293,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; iarg += 4; @@ -302,9 +303,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; iarg += 4; @@ -312,9 +313,9 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; iarg += 4; @@ -349,16 +350,16 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/n.t/small")) error->all(FLERR,"Illegal fix rigid/small command"); - t_chain = force->inumeric(FLERR,arg[iarg+1]); - t_iter = force->inumeric(FLERR,arg[iarg+2]); - t_order = force->inumeric(FLERR,arg[iarg+3]); + t_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + t_iter = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + t_order = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix rigid/small command"); if (!utils::strmatch(style,"^rigid/np./small")) error->all(FLERR,"Illegal fix rigid/small command"); - p_chain = force->inumeric(FLERR,arg[iarg+1]); + p_chain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"gravity") == 0) { @@ -477,13 +478,13 @@ FixRigidSmall::FixRigidSmall(LAMMPS *lmp, int narg, char **arg) : // initialize Marsaglia RNG with processor-unique seed maxlang = 0; - langextra = NULL; - random = NULL; + langextra = nullptr; + random = nullptr; if (langflag) random = new RanMars(lmp,seed + comm->me); // mass vector for granular pair styles - mass_body = NULL; + mass_body = nullptr; nmax_mass = 0; // wait to setup bodies until comm stencils are defined @@ -497,7 +498,7 @@ FixRigidSmall::~FixRigidSmall() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays @@ -818,6 +819,7 @@ void FixRigidSmall::initial_integrate(int vflag) void FixRigidSmall::apply_langevin_thermostat() { double gamma1,gamma2; + double wbody[3],tbody[3]; // grow langextra if needed @@ -837,12 +839,15 @@ void FixRigidSmall::apply_langevin_thermostat() double mvv2e = force->mvv2e; double ftm2v = force->ftm2v; - double *vcm,*omega,*inertia; + double *vcm,*omega,*inertia,*ex_space,*ey_space,*ez_space; for (int ibody = 0; ibody < nlocal_body; ibody++) { vcm = body[ibody].vcm; omega = body[ibody].omega; inertia = body[ibody].inertia; + ex_space = body[ibody].ex_space; + ey_space = body[ibody].ey_space; + ez_space = body[ibody].ez_space; gamma1 = -body[ibody].mass / t_period / ftm2v; gamma2 = sqrt(body[ibody].mass) * tsqrt * @@ -853,12 +858,23 @@ void FixRigidSmall::apply_langevin_thermostat() gamma1 = -1.0 / t_period / ftm2v; gamma2 = tsqrt * sqrt(24.0*boltz/t_period/dt/mvv2e) / ftm2v; - langextra[ibody][3] = inertia[0]*gamma1*omega[0] + + + // convert omega from space frame to body frame + + MathExtra::transpose_matvec(ex_space,ey_space,ez_space,omega,wbody); + + // compute langevin torques in the body frame + + tbody[0] = inertia[0]*gamma1*wbody[0] + sqrt(inertia[0])*gamma2*(random->uniform()-0.5); - langextra[ibody][4] = inertia[1]*gamma1*omega[1] + + tbody[1] = inertia[1]*gamma1*wbody[1] + sqrt(inertia[1])*gamma2*(random->uniform()-0.5); - langextra[ibody][5] = inertia[2]*gamma1*omega[2] + + tbody[2] = inertia[2]*gamma1*wbody[2] + sqrt(inertia[2])*gamma2*(random->uniform()-0.5); + + // convert langevin torques from body frame back to space frame + + MathExtra::matvec(ex_space,ey_space,ez_space,tbody,&langextra[ibody][3]); } } @@ -1965,7 +1981,7 @@ void FixRigidSmall::setup_bodies_static() if (inpfile) { memory->create(inbody,nlocal_body,"rigid/small:inbody"); for (ibody = 0; ibody < nlocal_body; ibody++) inbody[ibody] = 0; - readfile(0,NULL,inbody); + readfile(0,nullptr,inbody); } // remap the xcm of each body back into simulation box @@ -2085,7 +2101,7 @@ void FixRigidSmall::setup_bodies_static() tensor[0][1] = tensor[1][0] = itensor[ibody][5]; inertia = body[ibody].inertia; - ierror = MathExtra::jacobi(tensor,inertia,evectors); + ierror = MathEigen::jacobi3(tensor,inertia,evectors); if (ierror) error->all(FLERR, "Insufficient Jacobi rotations for rigid body"); @@ -2445,12 +2461,12 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) if (me == 0) { fp = fopen(inpfile,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid/small file {}: {}", inpfile,utils::getsyserror())); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) + if (eof == nullptr) error->one(FLERR,"Unexpected end of fix rigid/small file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; @@ -2490,7 +2506,7 @@ void FixRigidSmall::readfile(int which, double **array, int *inbody) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); id = ATOTAGINT(values[0]); if (id <= 0 || id > maxmol) @@ -2559,7 +2575,7 @@ void FixRigidSmall::write_restart_file(const char *file) if (me == 0) { auto outfile = std::string(file) + ".rigid"; fp = fopen(outfile.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix rigid restart file {}: {}", outfile,utils::getsyserror())); @@ -3432,7 +3448,7 @@ void *FixRigidSmall::extract(const char *str, int &dim) return mass_body; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/RIGID/fix_shake.cpp b/src/RIGID/fix_shake.cpp index a216526528..564a66273e 100644 --- a/src/RIGID/fix_shake.cpp +++ b/src/RIGID/fix_shake.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_shake.h" -#include + #include #include #include @@ -32,8 +32,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -47,16 +47,16 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), bond_flag(NULL), angle_flag(NULL), - type_flag(NULL), mass_list(NULL), bond_distance(NULL), angle_distance(NULL), - loop_respa(NULL), step_respa(NULL), x(NULL), v(NULL), f(NULL), ftmp(NULL), - vtmp(NULL), mass(NULL), rmass(NULL), type(NULL), shake_flag(NULL), - shake_atom(NULL), shake_type(NULL), xshake(NULL), nshake(NULL), - list(NULL), b_count(NULL), b_count_all(NULL), b_ave(NULL), b_max(NULL), - b_min(NULL), b_ave_all(NULL), b_max_all(NULL), b_min_all(NULL), - a_count(NULL), a_count_all(NULL), a_ave(NULL), a_max(NULL), a_min(NULL), - a_ave_all(NULL), a_max_all(NULL), a_min_all(NULL), atommols(NULL), - onemols(NULL) + Fix(lmp, narg, arg), bond_flag(nullptr), angle_flag(nullptr), + type_flag(nullptr), mass_list(nullptr), bond_distance(nullptr), angle_distance(nullptr), + loop_respa(nullptr), step_respa(nullptr), x(nullptr), v(nullptr), f(nullptr), ftmp(nullptr), + vtmp(nullptr), mass(nullptr), rmass(nullptr), type(nullptr), shake_flag(nullptr), + shake_atom(nullptr), shake_type(nullptr), xshake(nullptr), nshake(nullptr), + list(nullptr), b_count(nullptr), b_count_all(nullptr), b_ave(nullptr), b_max(nullptr), + b_min(nullptr), b_ave_all(nullptr), b_max_all(nullptr), b_min_all(nullptr), + a_count(nullptr), a_count_all(nullptr), a_ave(nullptr), a_max(nullptr), a_min(nullptr), + a_ave_all(nullptr), a_max_all(nullptr), a_min_all(nullptr), atommols(nullptr), + onemols(nullptr) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -70,22 +70,22 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // error check molecular = atom->molecular; - if (molecular == 0) + if (molecular == Atom::ATOMIC) error->all(FLERR,"Cannot use fix shake with non-molecular system"); // perform initial allocation of atom-based arrays // register with Atom class - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; - xshake = NULL; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; + xshake = nullptr; - ftmp = NULL; - vtmp = NULL; + ftmp = nullptr; + vtmp = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // set comm size needed by this fix @@ -95,9 +95,9 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : if (narg < 8) error->all(FLERR,"Illegal fix shake command"); - tolerance = force->numeric(FLERR,arg[3]); - max_iter = force->inumeric(FLERR,arg[4]); - output_every = force->inumeric(FLERR,arg[5]); + tolerance = utils::numeric(FLERR,arg[3],false,lmp); + max_iter = utils::inumeric(FLERR,arg[4],false,lmp); + output_every = utils::inumeric(FLERR,arg[5],false,lmp); // parse SHAKE args for bond and angle types // will be used by find_clusters @@ -131,25 +131,25 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // read numeric args of b,a,t,m else if (mode == 'b') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nbondtypes) error->all(FLERR,"Invalid bond type index for fix shake"); bond_flag[i] = 1; } else if (mode == 'a') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nangletypes) error->all(FLERR,"Invalid angle type index for fix shake"); angle_flag[i] = 1; } else if (mode == 't') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->ntypes) error->all(FLERR,"Invalid atom type index for fix shake"); type_flag[i] = 1; } else if (mode == 'm') { - double massone = force->numeric(FLERR,arg[next]); + double massone = utils::numeric(FLERR,arg[next],false,lmp); if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix shake"); if (nmass == atom->ntypes) error->all(FLERR,"Too many masses for fix shake"); @@ -161,7 +161,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // parse optional args - onemols = NULL; + onemols = nullptr; int iarg = next; while (iarg < narg) { @@ -233,7 +233,7 @@ FixShake::FixShake(LAMMPS *lmp, int narg, char **arg) : // initialize list of SHAKE clusters to constrain maxlist = 0; - list = NULL; + list = nullptr; } /* ---------------------------------------------------------------------- */ @@ -242,7 +242,7 @@ FixShake::~FixShake() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // set bond_type and angle_type back to positive for SHAKE clusters // must set for all SHAKE bonds and angles stored by each atom @@ -367,7 +367,7 @@ void FixShake::init() // set equilibrium bond distances - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond potential must be defined for SHAKE"); for (i = 1; i <= atom->nbondtypes; i++) bond_distance[i] = force->bond->equilibrium_distance(i); @@ -378,7 +378,7 @@ void FixShake::init() for (i = 1; i <= atom->nangletypes; i++) { if (angle_flag[i] == 0) continue; - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Angle potential must be defined for SHAKE"); // scan all atoms for a SHAKE angle cluster @@ -715,7 +715,7 @@ void FixShake::find_clusters() // ----------------------------------------------------- int max = 0; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { for (i = 0; i < nlocal; i++) max = MAX(max,nspecial[i][0]); } else { for (i = 0; i < nlocal; i++) { @@ -749,7 +749,7 @@ void FixShake::find_clusters() // set npartner and partner_tag from special arrays // ----------------------------------------------------- - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { for (i = 0; i < nlocal; i++) { npartner[i] = nspecial[i][0]; for (j = 0; j < npartner[i]; j++) @@ -2568,7 +2568,7 @@ int FixShake::bondtype_findset(int i, tagint n1, tagint n2, int setflag) int m,nbonds; int *btype; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { tagint *tag = atom->tag; tagint **bond_atom = atom->bond_atom; nbonds = atom->num_bond[i]; @@ -2595,10 +2595,10 @@ int FixShake::bondtype_findset(int i, tagint n1, tagint n2, int setflag) if (m < nbonds) { if (setflag == 0) { - if (molecular == 1) return atom->bond_type[i][m]; + if (molecular == Atom::MOLECULAR) return atom->bond_type[i][m]; else return btype[m]; } - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if ((setflag < 0 && atom->bond_type[i][m] > 0) || (setflag > 0 && atom->bond_type[i][m] < 0)) atom->bond_type[i][m] = -atom->bond_type[i][m]; @@ -2624,7 +2624,7 @@ int FixShake::angletype_findset(int i, tagint n1, tagint n2, int setflag) int m,nangles; int *atype; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { tagint **angle_atom1 = atom->angle_atom1; tagint **angle_atom3 = atom->angle_atom3; nangles = atom->num_angle[i]; @@ -2652,10 +2652,10 @@ int FixShake::angletype_findset(int i, tagint n1, tagint n2, int setflag) if (m < nangles) { if (setflag == 0) { - if (molecular == 1) return atom->angle_type[i][m]; + if (molecular == Atom::MOLECULAR) return atom->angle_type[i][m]; else return atype[m]; } - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if ((setflag < 0 && atom->angle_type[i][m] > 0) || (setflag > 0 && atom->angle_type[i][m] < 0)) atom->angle_type[i][m] = -atom->angle_type[i][m]; @@ -2976,7 +2976,7 @@ void *FixShake::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"onemol") == 0) return onemols; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/SHOCK/fix_append_atoms.cpp b/src/SHOCK/fix_append_atoms.cpp index 1a6b128cd5..428dfc67e4 100644 --- a/src/SHOCK/fix_append_atoms.cpp +++ b/src/SHOCK/fix_append_atoms.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_append_atoms.h" -#include + #include #include #include "atom.h" @@ -35,8 +35,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), randomx(NULL), randomt(NULL), basistype(NULL), - spatialid(NULL), gfactor1(NULL), gfactor2(NULL) + Fix(lmp, narg, arg), randomx(nullptr), randomt(nullptr), basistype(nullptr), + spatialid(nullptr), gfactor1(nullptr), gfactor2(nullptr) { force_reneighbor = 1; next_reneighbor = -1; @@ -48,7 +48,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : scaleflag = 1; spatflag=0; - spatialid = NULL; + spatialid = nullptr; xloflag = xhiflag = yloflag = yhiflag = zloflag = zhiflag = 0; tempflag = 0; @@ -58,8 +58,8 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : rany = 0.0; ranz = 0.0; - randomx = NULL; - randomt = NULL; + randomx = nullptr; + randomt = nullptr; if (domain->lattice->nbasis == 0) error->all(FLERR,"Fix append/atoms requires a lattice be defined"); @@ -114,7 +114,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Append boundary must be shrink/minimum"); } else if (strcmp(arg[iarg],"freq") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command"); - freq = force->inumeric(FLERR,arg[iarg+1]); + freq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"spatial") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command"); @@ -123,7 +123,7 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : "Bad fix ID in fix append/atoms command"); spatflag = 1; int n = strlen(arg[iarg+1]); - spatlead = force->numeric(FLERR,arg[iarg+2]); + spatlead = utils::numeric(FLERR,arg[iarg+2],false,lmp); char *suffix = new char[n]; strcpy(suffix,&arg[iarg+1][2]); n = strlen(suffix) + 1; @@ -133,15 +133,15 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : iarg += 3; } else if (strcmp(arg[iarg],"basis") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix append/atoms command"); - int ibasis = force->inumeric(FLERR,arg[iarg+1]); - int itype = force->inumeric(FLERR,arg[iarg+2]); + int ibasis = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int itype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Invalid basis setting in fix append/atoms command"); basistype[ibasis-1] = itype; iarg += 3; } else if (strcmp(arg[iarg],"size") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command"); - size = force->numeric(FLERR,arg[iarg+1]); + size = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"units") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix append/atoms command"); @@ -152,20 +152,20 @@ FixAppendAtoms::FixAppendAtoms(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"random") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix append/atoms command"); ranflag = 1; - ranx = force->numeric(FLERR,arg[iarg+1]); - rany = force->numeric(FLERR,arg[iarg+2]); - ranz = force->numeric(FLERR,arg[iarg+3]); - xseed = force->inumeric(FLERR,arg[iarg+4]); + ranx = utils::numeric(FLERR,arg[iarg+1],false,lmp); + rany = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ranz = utils::numeric(FLERR,arg[iarg+3],false,lmp); + xseed = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (xseed <= 0) error->all(FLERR,"Illegal fix append/atoms command"); randomx = new RanMars(lmp,xseed + comm->me); iarg += 5; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix append/atoms command"); tempflag = 1; - t_target = force->numeric(FLERR,arg[iarg+1]); - t_period = force->numeric(FLERR,arg[iarg+2]); - tseed = force->inumeric(FLERR,arg[iarg+3]); - t_extent = force->numeric(FLERR,arg[iarg+4]); + t_target = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tseed = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + t_extent = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (t_target <= 0) error->all(FLERR,"Illegal fix append/atoms command"); if (t_period <= 0) error->all(FLERR,"Illegal fix append/atoms command"); if (t_extent <= 0) error->all(FLERR,"Illegal fix append/atoms command"); @@ -515,7 +515,7 @@ void FixAppendAtoms::pre_exchange() if (atom->natoms < 0) error->all(FLERR,"Too many total atoms"); if (atom->tag_enable) atom->tag_extend(); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/SHOCK/fix_msst.cpp b/src/SHOCK/fix_msst.cpp index c9591e92ac..1b2e73726b 100644 --- a/src/SHOCK/fix_msst.cpp +++ b/src/SHOCK/fix_msst.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "fix_msst.h" -#include + #include #include #include "atom.h" @@ -32,8 +32,8 @@ #include "domain.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -41,9 +41,9 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), old_velocity(NULL), rfix(NULL), - id_temp(NULL), id_press(NULL), id_pe(NULL), temperature(NULL), - pressure(NULL), pe(NULL) + Fix(lmp, narg, arg), old_velocity(nullptr), rfix(nullptr), + id_temp(nullptr), id_press(nullptr), id_pe(nullptr), temperature(nullptr), + pressure(nullptr), pe(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix msst command"); @@ -90,7 +90,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : box_change |= BOX_CHANGE_Z; } else error->all(FLERR,"Illegal fix msst command"); - velocity = force->numeric(FLERR,arg[4]); + velocity = utils::numeric(FLERR,arg[4],false,lmp); if (velocity < 0) error->all(FLERR,"Illegal fix msst command"); // optional args @@ -99,30 +99,30 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"q") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - qmass = force->numeric(FLERR,arg[iarg+1]); + qmass = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mu") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - mu = force->numeric(FLERR,arg[iarg+1]); + mu = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"p0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - p0 = force->numeric(FLERR,arg[iarg+1]); + p0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); p0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"v0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - v0 = force->numeric(FLERR,arg[iarg+1]); + v0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); v0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"e0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - e0 = force->numeric(FLERR,arg[iarg+1]); + e0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); e0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"tscale") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - tscale = force->numeric(FLERR,arg[iarg+1]); + tscale = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (tscale < 0.0 || tscale > 1.0) error->all(FLERR,"Fix msst tscale must satisfy 0 <= tscale < 1"); iarg += 2; @@ -134,7 +134,7 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"beta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix msst command"); - beta = force->numeric(FLERR,arg[iarg+1]); + beta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (beta < 0.0 || beta > 1.0) error->all(FLERR,"Illegal fix msst command"); iarg += 2; @@ -206,10 +206,10 @@ FixMSST::FixMSST(LAMMPS *lmp, int narg, char **arg) : omega[0] = omega[1] = omega[2] = 0.0; nrigid = 0; - rfix = NULL; + rfix = nullptr; maxold = -1; - old_velocity = NULL; + old_velocity = nullptr; } /* ---------------------------------------------------------------------- */ @@ -246,7 +246,7 @@ int FixMSST::setmask() void FixMSST::init() { - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix msst without per-type mass defined"); // set compute ptrs @@ -287,7 +287,7 @@ void FixMSST::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^rigid") || @@ -306,7 +306,7 @@ void FixMSST::init() for (int i = 0; i < modify->nfix; i++) if (utils::strmatch(modify->fix[i]->style,"^external$")) fix_external = (FixExternal *) modify->fix[i]; - if (fix_external == NULL) + if (fix_external == nullptr) error->all(FLERR,"Fix msst dftb cannot be used w/out fix external"); } } diff --git a/src/SHOCK/fix_nphug.cpp b/src/SHOCK/fix_nphug.cpp index 8ad787d759..20fa909af2 100644 --- a/src/SHOCK/fix_nphug.cpp +++ b/src/SHOCK/fix_nphug.cpp @@ -30,7 +30,7 @@ enum{ISO,ANISO,TRICLINIC}; // same as fix_nh.cpp /* ---------------------------------------------------------------------- */ FixNPHug::FixNPHug(LAMMPS *lmp, int narg, char **arg) : - FixNH(lmp, narg, arg), pe(NULL), id_pe(NULL) + FixNH(lmp, narg, arg), pe(nullptr), id_pe(nullptr) { // Prevent masses from being updated every timestep @@ -439,17 +439,17 @@ int FixNPHug::modify_param(int narg, char **arg) { if (strcmp(arg[0],"e0") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix nphug command"); - e0 = force->numeric(FLERR,arg[1]); + e0 = utils::numeric(FLERR,arg[1],false,lmp); e0_set = 1; return 2; } else if (strcmp(arg[0],"v0") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix nphug command"); - v0 = force->numeric(FLERR,arg[1]); + v0 = utils::numeric(FLERR,arg[1],false,lmp); v0_set = 1; return 2; } else if (strcmp(arg[0],"p0") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix nphug command"); - p0 = force->numeric(FLERR,arg[1]); + p0 = utils::numeric(FLERR,arg[1],false,lmp); p0_set = 1; return 2; } diff --git a/src/SHOCK/fix_wall_piston.cpp b/src/SHOCK/fix_wall_piston.cpp index 5a359d9f6f..b375370226 100644 --- a/src/SHOCK/fix_wall_piston.cpp +++ b/src/SHOCK/fix_wall_piston.cpp @@ -31,15 +31,15 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), randomt(NULL), gfactor1(NULL), gfactor2(NULL) + Fix(lmp, narg, arg), randomt(nullptr), gfactor1(nullptr), gfactor2(nullptr) { force_reneighbor = 1; next_reneighbor = -1; if (narg < 4) error->all(FLERR,"Illegal fix wall/piston command"); - randomt = NULL; - gfactor1 = gfactor2 = NULL; + randomt = nullptr; + gfactor1 = gfactor2 = nullptr; tempflag = 0; scaleflag = 1; roughflag = 0; @@ -71,19 +71,19 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Fix wall/piston command only available at zlo"); else if (strcmp(arg[iarg],"vel") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/piston command"); - vz = force->numeric(FLERR,arg[iarg+1]); + vz = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"pos") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix wall/piston command"); - z0 = force->numeric(FLERR,arg[iarg+1]); + z0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"temp") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal fix wall/piston command"); tempflag = 1; - t_target = force->numeric(FLERR,arg[iarg+1]); - t_period = force->numeric(FLERR,arg[iarg+2]); - tseed = force->inumeric(FLERR,arg[iarg+3]); - t_extent = force->numeric(FLERR,arg[iarg+4]); + t_target = utils::numeric(FLERR,arg[iarg+1],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+2],false,lmp); + tseed = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + t_extent = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (t_target <= 0) error->all(FLERR,"Illegal fix wall/piston command"); if (t_period <= 0) error->all(FLERR,"Illegal fix wall/piston command"); if (t_extent <= 0) error->all(FLERR,"Illegal fix wall/piston command"); @@ -94,7 +94,7 @@ FixWallPiston::FixWallPiston(LAMMPS *lmp, int narg, char **arg) : iarg += 5; } else if (strcmp(arg[iarg],"rough") == 0) { roughflag = 1; - roughdist = force->numeric(FLERR,arg[iarg+1]); + roughdist = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"ramp") == 0) { rampflag = 1; diff --git a/src/SNAP/compute_sna_atom.cpp b/src/SNAP/compute_sna_atom.cpp index 4a57f31ec3..66d6abfb78 100644 --- a/src/SNAP/compute_sna_atom.cpp +++ b/src/SNAP/compute_sna_atom.cpp @@ -13,7 +13,7 @@ #include "compute_sna_atom.h" #include -#include + #include "sna.h" #include "atom.h" #include "update.h" @@ -30,13 +30,13 @@ using namespace LAMMPS_NS; ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), sna(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), sna(nullptr), + radelem(nullptr), wjelem(nullptr) { double rmin0, rfac0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -114,9 +114,9 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/atom command"); chemflag = 1; memory->create(map,ntypes+1,"compute_sna_atom:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute sna/atom command"); map[i+1] = jelem; @@ -145,7 +145,7 @@ ComputeSNAAtom::ComputeSNAAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - sna = NULL; + sna = nullptr; } /* ---------------------------------------------------------------------- */ @@ -163,7 +163,7 @@ ComputeSNAAtom::~ComputeSNAAtom() void ComputeSNAAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute sna/atom requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snad_atom.cpp b/src/SNAP/compute_snad_atom.cpp index cd0c0cbc41..e08679a374 100644 --- a/src/SNAP/compute_snad_atom.cpp +++ b/src/SNAP/compute_snad_atom.cpp @@ -13,7 +13,7 @@ #include "compute_snad_atom.h" #include -#include + #include "sna.h" #include "atom.h" #include "update.h" @@ -30,13 +30,13 @@ using namespace LAMMPS_NS; ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snad(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snad(nullptr), + radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -112,9 +112,9 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute snad/atom command"); chemflag = 1; memory->create(map,ntypes+1,"compute_snad_atom:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute snad/atom command"); map[i+1] = jelem; @@ -147,7 +147,7 @@ ComputeSNADAtom::ComputeSNADAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - snad = NULL; + snad = nullptr; } /* ---------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ ComputeSNADAtom::~ComputeSNADAtom() void ComputeSNADAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snad/atom requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snap.cpp b/src/SNAP/compute_snap.cpp index 613fc1a862..5537d2c933 100644 --- a/src/SNAP/compute_snap.cpp +++ b/src/SNAP/compute_snap.cpp @@ -13,7 +13,7 @@ #include "compute_snap.h" #include -#include + #include "sna.h" #include "atom.h" #include "update.h" @@ -32,9 +32,9 @@ using namespace LAMMPS_NS; enum{SCALAR,VECTOR,ARRAY}; ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snap(NULL), - snapall(NULL), snap_peratom(NULL), radelem(NULL), wjelem(NULL), - snaptr(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snap(nullptr), + snapall(nullptr), snap_peratom(nullptr), radelem(nullptr), wjelem(nullptr), + snaptr(nullptr) { array_flag = 1; @@ -42,8 +42,8 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -118,9 +118,9 @@ ComputeSnap::ComputeSnap(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute snap command"); chemflag = 1; memory->create(map,ntypes+1,"compute_snap:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute snap command"); map[i+1] = jelem; @@ -180,7 +180,7 @@ ComputeSnap::~ComputeSnap() void ComputeSnap::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snap requires a pair style be defined"); if (cutmax > force->pair->cutforce) diff --git a/src/SNAP/compute_snav_atom.cpp b/src/SNAP/compute_snav_atom.cpp index 2d33c35563..cace5e532f 100644 --- a/src/SNAP/compute_snav_atom.cpp +++ b/src/SNAP/compute_snav_atom.cpp @@ -13,7 +13,7 @@ #include "compute_snav_atom.h" #include -#include + #include "sna.h" #include "atom.h" #include "update.h" @@ -29,13 +29,13 @@ using namespace LAMMPS_NS; ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), cutsq(NULL), list(NULL), snav(NULL), - radelem(NULL), wjelem(NULL) + Compute(lmp, narg, arg), cutsq(nullptr), list(nullptr), snav(nullptr), + radelem(nullptr), wjelem(nullptr) { double rfac0, rmin0; int twojmax, switchflag, bzeroflag, bnormflag, wselfallflag; - radelem = NULL; - wjelem = NULL; + radelem = nullptr; + wjelem = nullptr; int ntypes = atom->ntypes; int nargmin = 6+2*ntypes; @@ -107,9 +107,9 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal compute sna/atom command"); chemflag = 1; memory->create(map,ntypes+1,"compute_sna_atom:map"); - nelements = force->inumeric(FLERR,arg[iarg+1]); + nelements = utils::inumeric(FLERR,arg[iarg+1],false,lmp); for(int i = 0; i < ntypes; i++) { - int jelem = force->inumeric(FLERR,arg[iarg+2+i]); + int jelem = utils::inumeric(FLERR,arg[iarg+2+i],false,lmp); if (jelem < 0 || jelem >= nelements) error->all(FLERR,"Illegal compute snav/atom command"); map[i+1] = jelem; @@ -140,7 +140,7 @@ ComputeSNAVAtom::ComputeSNAVAtom(LAMMPS *lmp, int narg, char **arg) : peratom_flag = 1; nmax = 0; - snav = NULL; + snav = nullptr; } @@ -160,7 +160,7 @@ ComputeSNAVAtom::~ComputeSNAVAtom() void ComputeSNAVAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute snav/atom requires a pair style be defined"); // TODO: Not sure what to do with this error check since cutoff radius is not // a single number diff --git a/src/SNAP/pair_snap.cpp b/src/SNAP/pair_snap.cpp index 63867f1691..e3b8fdfa98 100644 --- a/src/SNAP/pair_snap.cpp +++ b/src/SNAP/pair_snap.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "pair_snap.h" -#include + #include -#include + #include #include "atom.h" #include "force.h" @@ -25,7 +25,7 @@ #include "sna.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -42,15 +42,15 @@ PairSNAP::PairSNAP(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; - radelem = NULL; - wjelem = NULL; - coeffelem = NULL; + elements = nullptr; + radelem = nullptr; + wjelem = nullptr; + coeffelem = nullptr; beta_max = 0; - beta = NULL; - bispectrum = NULL; - snaptr = NULL; + beta = nullptr; + bispectrum = nullptr; + snaptr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -515,8 +515,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) FILE *fpcoeff; if (comm->me == 0) { - fpcoeff = force->open_potential(coefffilename); - if (fpcoeff == NULL) { + fpcoeff = utils::open_potential(coefffilename,lmp,nullptr); + if (fpcoeff == nullptr) { char str[128]; snprintf(str,128,"Cannot open SNAP coefficient file %s",coefffilename); error->one(FLERR,str); @@ -531,7 +531,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) while (nwords == 0) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -556,7 +556,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) int iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); nelements = atoi(words[0]); ncoeffall = atoi(words[1]); @@ -574,7 +574,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -592,9 +592,9 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) iword = 0; words[iword] = strtok(line,"' \t\n\r\f"); iword = 1; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); iword = 2; - words[iword] = strtok(NULL,"' \t\n\r\f"); + words[iword] = strtok(nullptr,"' \t\n\r\f"); char* elemtmp = words[0]; int n = strlen(elemtmp) + 1; @@ -615,7 +615,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) for (int icoeff = 0; icoeff < ncoeffall; icoeff++) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpcoeff); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpcoeff); } else n = strlen(line) + 1; @@ -662,8 +662,8 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) FILE *fpparam; if (comm->me == 0) { - fpparam = force->open_potential(paramfilename); - if (fpparam == NULL) { + fpparam = utils::open_potential(paramfilename,lmp,nullptr); + if (fpparam == nullptr) { char str[128]; snprintf(str,128,"Cannot open SNAP parameter file %s",paramfilename); error->one(FLERR,str); @@ -674,7 +674,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fpparam); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fpparam); } else n = strlen(line) + 1; @@ -697,7 +697,7 @@ void PairSNAP::read_files(char *coefffilename, char *paramfilename) // strip single and double quotes from words char* keywd = strtok(line,"' \t\n\r\f"); - char* keyval = strtok(NULL,"' \t\n\r\f"); + char* keyval = strtok(nullptr,"' \t\n\r\f"); if (comm->me == 0) { if (screen) fprintf(screen,"SNAP keyword %s %s \n",keywd,keyval); diff --git a/src/SNAP/sna.cpp b/src/SNAP/sna.cpp index e003ec7ca8..ae250c6f76 100644 --- a/src/SNAP/sna.cpp +++ b/src/SNAP/sna.cpp @@ -134,16 +134,16 @@ SNA::SNA(LAMMPS* lmp, double rfac0_in, int twojmax_in, compute_ncoeff(); - rij = NULL; - inside = NULL; - wj = NULL; - rcutij = NULL; - element = NULL; + rij = nullptr; + inside = nullptr; + wj = nullptr; + rcutij = nullptr; + element = nullptr; nmax = 0; - idxz = NULL; - idxb = NULL; - ulist_r_ij = NULL; - ulist_i_ij = NULL; + idxz = nullptr; + idxb = nullptr; + ulist_r_ij = nullptr; + ulist_i_ij = nullptr; build_indexlist(); create_twojmax_arrays(); @@ -1332,7 +1332,7 @@ void SNA::create_twojmax_arrays() if (bzero_flag) memory->create(bzero, twojmax+1,"sna:bzero"); else - bzero = NULL; + bzero = nullptr; } diff --git a/src/SPIN/atom_vec_spin.cpp b/src/SPIN/atom_vec_spin.cpp index ef0a79a8d3..ae73d65f1c 100644 --- a/src/SPIN/atom_vec_spin.cpp +++ b/src/SPIN/atom_vec_spin.cpp @@ -34,8 +34,8 @@ using namespace LAMMPS_NS; AtomVecSpin::AtomVecSpin(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->sp_flag = 1; diff --git a/src/SPIN/compute_spin.cpp b/src/SPIN/compute_spin.cpp index 94eff27f53..32f9e73518 100644 --- a/src/SPIN/compute_spin.cpp +++ b/src/SPIN/compute_spin.cpp @@ -22,7 +22,7 @@ ------------------------------------------------------------------------- */ #include "compute_spin.h" -#include + #include #include #include "atom.h" @@ -41,7 +41,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ComputeSpin::ComputeSpin(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), pair(NULL), spin_pairs(NULL) + Compute(lmp, narg, arg), pair(nullptr), spin_pairs(nullptr) { if ((narg != 3) && (narg != 4)) error->all(FLERR,"Illegal compute compute/spin command"); diff --git a/src/SPIN/fix_langevin_spin.cpp b/src/SPIN/fix_langevin_spin.cpp index 6b9ad517bb..2b3aa363f6 100644 --- a/src/SPIN/fix_langevin_spin.cpp +++ b/src/SPIN/fix_langevin_spin.cpp @@ -34,7 +34,7 @@ #include "random_mars.h" #include "respa.h" #include "update.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -43,7 +43,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_temp(NULL), random(NULL) + Fix(lmp, narg, arg), id_temp(nullptr), random(nullptr) { if (narg != 6) error->all(FLERR,"Illegal langevin/spin command"); @@ -53,9 +53,9 @@ FixLangevinSpin::FixLangevinSpin(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; nevery = 1; - temp = force->numeric(FLERR,arg[3]); - alpha_t = force->numeric(FLERR,arg[4]); - seed = force->inumeric(FLERR,arg[5]); + temp = utils::numeric(FLERR,arg[3],false,lmp); + alpha_t = utils::numeric(FLERR,arg[4],false,lmp); + seed = utils::inumeric(FLERR,arg[5],false,lmp); if (alpha_t < 0.0) { error->all(FLERR,"Illegal langevin/spin command"); diff --git a/src/SPIN/fix_neb_spin.cpp b/src/SPIN/fix_neb_spin.cpp index 5acbbf59e8..b2982e7bc0 100644 --- a/src/SPIN/fix_neb_spin.cpp +++ b/src/SPIN/fix_neb_spin.cpp @@ -22,7 +22,7 @@ ------------------------------------------------------------------------- */ #include "fix_neb_spin.h" -#include + #include #include #include "universe.h" @@ -46,18 +46,18 @@ enum{SINGLE_PROC_DIRECT,SINGLE_PROC_MAP,MULTI_PROC}; /* ---------------------------------------------------------------------- */ FixNEBSpin::FixNEBSpin(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(NULL), pe(NULL), nlenall(NULL), xprev(NULL), - xnext(NULL), fnext(NULL), spprev(NULL), spnext(NULL), fmnext(NULL), springF(NULL), - tangent(NULL), xsend(NULL), xrecv(NULL), fsend(NULL), frecv(NULL), spsend(NULL), - sprecv(NULL), fmsend(NULL), fmrecv(NULL), tagsend(NULL), tagrecv(NULL), - xsendall(NULL), xrecvall(NULL), fsendall(NULL), frecvall(NULL), spsendall(NULL), - sprecvall(NULL), fmsendall(NULL), fmrecvall(NULL), tagsendall(NULL), tagrecvall(NULL), - counts(NULL), displacements(NULL) + Fix(lmp, narg, arg), id_pe(nullptr), pe(nullptr), nlenall(nullptr), xprev(nullptr), + xnext(nullptr), fnext(nullptr), spprev(nullptr), spnext(nullptr), fmnext(nullptr), springF(nullptr), + tangent(nullptr), xsend(nullptr), xrecv(nullptr), fsend(nullptr), frecv(nullptr), spsend(nullptr), + sprecv(nullptr), fmsend(nullptr), fmrecv(nullptr), tagsend(nullptr), tagrecv(nullptr), + xsendall(nullptr), xrecvall(nullptr), fsendall(nullptr), frecvall(nullptr), spsendall(nullptr), + sprecvall(nullptr), fmsendall(nullptr), fmrecvall(nullptr), tagsendall(nullptr), tagrecvall(nullptr), + counts(nullptr), displacements(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix neb_spin command"); - kspring = force->numeric(FLERR,arg[3]); + kspring = utils::numeric(FLERR,arg[3],false,lmp); if (kspring <= 0.0) error->all(FLERR,"Illegal fix neb command"); // optional params @@ -229,7 +229,7 @@ void FixNEBSpin::init() if (atom->nmax > maxlocal) reallocate(); - if (MULTI_PROC && counts == NULL) { + if (MULTI_PROC && counts == nullptr) { memory->create(xsendall,ntotal,3,"neb:xsendall"); memory->create(xrecvall,ntotal,3,"neb:xrecvall"); memory->create(fsendall,ntotal,3,"neb:fsendall"); @@ -861,9 +861,9 @@ void FixNEBSpin::inter_replica_comm() MPI_Gatherv(fsend[0],3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, xsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fsendall[0],counts,displacements,MPI_DOUBLE,0,world); } if (spsend) { @@ -872,9 +872,9 @@ void FixNEBSpin::inter_replica_comm() MPI_Gatherv(fmsend[0],3*m,MPI_DOUBLE, fmsendall[0],counts,displacements,MPI_DOUBLE,0,world); } else { - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, spsendall[0],counts,displacements,MPI_DOUBLE,0,world); - MPI_Gatherv(NULL,3*m,MPI_DOUBLE, + MPI_Gatherv(nullptr,3*m,MPI_DOUBLE, fmsendall[0],counts,displacements,MPI_DOUBLE,0,world); } diff --git a/src/SPIN/fix_nve_spin.cpp b/src/SPIN/fix_nve_spin.cpp index 462a359d99..364994741e 100644 --- a/src/SPIN/fix_nve_spin.cpp +++ b/src/SPIN/fix_nve_spin.cpp @@ -60,9 +60,9 @@ enum{NONE}; FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pair(NULL), spin_pairs(NULL), - rsec(NULL), stack_head(NULL), stack_foot(NULL), - backward_stacks(NULL), forward_stacks(NULL) + pair(nullptr), spin_pairs(nullptr), + rsec(nullptr), stack_head(nullptr), stack_foot(nullptr), + backward_stacks(nullptr), forward_stacks(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_nve_spin); @@ -77,7 +77,7 @@ FixNVESpin::FixNVESpin(LAMMPS *lmp, int narg, char **arg) : // checking if map array or hash is defined - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix NVE/spin requires an atom map, see atom_modify"); // defining sector_flag diff --git a/src/SPIN/fix_precession_spin.cpp b/src/SPIN/fix_precession_spin.cpp index b788d27d05..f4dfddd3ca 100644 --- a/src/SPIN/fix_precession_spin.cpp +++ b/src/SPIN/fix_precession_spin.cpp @@ -22,7 +22,7 @@ ------------------------------------------------------------------------- */ #include "fix_precession_spin.h" -#include + #include #include #include "atom.h" @@ -44,7 +44,7 @@ enum{CONSTANT,EQUAL}; /* ---------------------------------------------------------------------- */ -FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(NULL) +FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), emag(nullptr) { if (narg < 7) error->all(FLERR,"Illegal precession/spin command"); @@ -59,7 +59,7 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm respa_level_support = 1; ilevel_respa = 0; - magstr = NULL; + magstr = nullptr; magfieldstyle = CONSTANT; H_field = 0.0; @@ -80,33 +80,33 @@ FixPrecessionSpin::FixPrecessionSpin(LAMMPS *lmp, int narg, char **arg) : Fix(lm if (strcmp(arg[iarg],"zeeman") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix precession/spin command"); zeeman_flag = 1; - H_field = force->numeric(FLERR,arg[iarg+1]); - nhx = force->numeric(FLERR,arg[iarg+2]); - nhy = force->numeric(FLERR,arg[iarg+3]); - nhz = force->numeric(FLERR,arg[iarg+4]); + H_field = utils::numeric(FLERR,arg[iarg+1],false,lmp); + nhx = utils::numeric(FLERR,arg[iarg+2],false,lmp); + nhy = utils::numeric(FLERR,arg[iarg+3],false,lmp); + nhz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"anisotropy") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix precession/spin command"); aniso_flag = 1; - Ka = force->numeric(FLERR,arg[iarg+1]); - nax = force->numeric(FLERR,arg[iarg+2]); - nay = force->numeric(FLERR,arg[iarg+3]); - naz = force->numeric(FLERR,arg[iarg+4]); + Ka = utils::numeric(FLERR,arg[iarg+1],false,lmp); + nax = utils::numeric(FLERR,arg[iarg+2],false,lmp); + nay = utils::numeric(FLERR,arg[iarg+3],false,lmp); + naz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"cubic") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix precession/spin command"); cubic_flag = 1; - k1c = force->numeric(FLERR,arg[iarg+1]); - k2c = force->numeric(FLERR,arg[iarg+2]); - nc1x = force->numeric(FLERR,arg[iarg+3]); - nc1y = force->numeric(FLERR,arg[iarg+4]); - nc1z = force->numeric(FLERR,arg[iarg+5]); - nc2x = force->numeric(FLERR,arg[iarg+6]); - nc2y = force->numeric(FLERR,arg[iarg+7]); - nc2z = force->numeric(FLERR,arg[iarg+8]); - nc3x = force->numeric(FLERR,arg[iarg+9]); - nc3y = force->numeric(FLERR,arg[iarg+10]); - nc3z = force->numeric(FLERR,arg[iarg+11]); + k1c = utils::numeric(FLERR,arg[iarg+1],false,lmp); + k2c = utils::numeric(FLERR,arg[iarg+2],false,lmp); + nc1x = utils::numeric(FLERR,arg[iarg+3],false,lmp); + nc1y = utils::numeric(FLERR,arg[iarg+4],false,lmp); + nc1z = utils::numeric(FLERR,arg[iarg+5],false,lmp); + nc2x = utils::numeric(FLERR,arg[iarg+6],false,lmp); + nc2y = utils::numeric(FLERR,arg[iarg+7],false,lmp); + nc2z = utils::numeric(FLERR,arg[iarg+8],false,lmp); + nc3x = utils::numeric(FLERR,arg[iarg+9],false,lmp); + nc3y = utils::numeric(FLERR,arg[iarg+10],false,lmp); + nc3z = utils::numeric(FLERR,arg[iarg+11],false,lmp); iarg += 12; } else error->all(FLERR,"Illegal precession/spin command"); } diff --git a/src/SPIN/fix_setforce_spin.cpp b/src/SPIN/fix_setforce_spin.cpp index ec738b7522..1f38ee43ec 100644 --- a/src/SPIN/fix_setforce_spin.cpp +++ b/src/SPIN/fix_setforce_spin.cpp @@ -52,7 +52,7 @@ void FixSetForceSpin::post_force(int /*vflag*/) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -124,7 +124,7 @@ void FixSetForceSpin::single_setforce_spin(int i, double fmi[3]) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -195,7 +195,7 @@ void FixSetForceSpin::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == ilevel_respa) post_force(vflag); else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/SPIN/min_spin.cpp b/src/SPIN/min_spin.cpp index f6a6b90891..f36f11f2a9 100644 --- a/src/SPIN/min_spin.cpp +++ b/src/SPIN/min_spin.cpp @@ -18,17 +18,17 @@ ------------------------------------------------------------------------- */ #include "min_spin.h" -#include -#include -#include -#include "universe.h" + #include "atom.h" -#include "force.h" -#include "update.h" -#include "output.h" -#include "timer.h" #include "error.h" #include "math_const.h" +#include "output.h" +#include "timer.h" +#include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -78,12 +78,12 @@ int MinSpin::modify_param(int narg, char **arg) { if (strcmp(arg[0],"alpha_damp") == 0) { if (narg < 2) error->all(FLERR,"Illegal min_modify command"); - alpha_damp = force->numeric(FLERR,arg[1]); + alpha_damp = utils::numeric(FLERR,arg[1],false,lmp); return 2; } if (strcmp(arg[0],"discrete_factor") == 0) { if (narg < 2) error->all(FLERR,"Illegal min_modify command"); - discrete_factor = force->numeric(FLERR,arg[1]); + discrete_factor = utils::numeric(FLERR,arg[1],false,lmp); return 2; } return 0; diff --git a/src/SPIN/min_spin_cg.cpp b/src/SPIN/min_spin_cg.cpp index de1ef39f66..817c149390 100644 --- a/src/SPIN/min_spin_cg.cpp +++ b/src/SPIN/min_spin_cg.cpp @@ -21,25 +21,22 @@ preprint arXiv:1904.02669. ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "min_spin_cg.h" -#include "universe.h" + #include "atom.h" #include "citeme.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "update.h" +#include "math_const.h" +#include "memory.h" #include "output.h" #include "timer.h" -#include "error.h" -#include "memory.h" -#include "modify.h" -#include "math_special.h" -#include "math_const.h" #include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -63,7 +60,7 @@ static const char cite_minstyle_spin_cg[] = /* ---------------------------------------------------------------------- */ MinSpinCG::MinSpinCG(LAMMPS *lmp) : - Min(lmp), g_old(NULL), g_cur(NULL), p_s(NULL), sp_copy(NULL) + Min(lmp), g_old(nullptr), g_cur(nullptr), p_s(nullptr), sp_copy(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_cg); nlocal_max = 0; @@ -148,7 +145,7 @@ int MinSpinCG::modify_param(int narg, char **arg) { if (strcmp(arg[0],"discrete_factor") == 0) { if (narg < 2) error->all(FLERR,"Illegal fix_modify command"); - discrete_factor = force->numeric(FLERR,arg[1]); + discrete_factor = utils::numeric(FLERR,arg[1],false,lmp); return 2; } return 0; diff --git a/src/SPIN/min_spin_lbfgs.cpp b/src/SPIN/min_spin_lbfgs.cpp index df12782528..edabcf6bbf 100644 --- a/src/SPIN/min_spin_lbfgs.cpp +++ b/src/SPIN/min_spin_lbfgs.cpp @@ -21,24 +21,22 @@ preprint arXiv:1904.02669. ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "min_spin_lbfgs.h" + #include "atom.h" #include "citeme.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "update.h" +#include "math_const.h" +#include "memory.h" #include "output.h" #include "timer.h" -#include "error.h" -#include "memory.h" -#include "modify.h" -#include "math_special.h" -#include "math_const.h" #include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -62,7 +60,7 @@ static const char cite_minstyle_spin_lbfgs[] = /* ---------------------------------------------------------------------- */ MinSpinLBFGS::MinSpinLBFGS(LAMMPS *lmp) : - Min(lmp), g_old(NULL), g_cur(NULL), p_s(NULL), rho(NULL), ds(NULL), dy(NULL), sp_copy(NULL) + Min(lmp), g_old(nullptr), g_cur(nullptr), p_s(nullptr), rho(nullptr), ds(nullptr), dy(nullptr), sp_copy(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_minstyle_spin_lbfgs); nlocal_max = 0; @@ -156,7 +154,7 @@ int MinSpinLBFGS::modify_param(int narg, char **arg) if (strcmp(arg[0],"discrete_factor") == 0) { if (narg < 2) error->all(FLERR,"Illegal min_modify command"); double discrete_factor; - discrete_factor = force->numeric(FLERR,arg[1]); + discrete_factor = utils::numeric(FLERR,arg[1],false,lmp); maxepsrot = MY_2PI / (10 * discrete_factor); return 2; } diff --git a/src/SPIN/neb_spin.cpp b/src/SPIN/neb_spin.cpp index 168e288181..31122ec678 100644 --- a/src/SPIN/neb_spin.cpp +++ b/src/SPIN/neb_spin.cpp @@ -22,29 +22,26 @@ ------------------------------------------------------------------------- */ #include "neb_spin.h" -#include -#include -#include -#include -#include "citeme.h" -#include "force.h" -#include "universe.h" + #include "atom.h" -#include "update.h" -#include "domain.h" +#include "citeme.h" #include "comm.h" -#include "min.h" -#include "modify.h" +#include "domain.h" +#include "error.h" +#include "finish.h" #include "fix.h" #include "fix_neb_spin.h" +#include "memory.h" +#include "min.h" +#include "modify.h" #include "output.h" #include "thermo.h" -#include "finish.h" #include "timer.h" -#include "memory.h" -#include "error.h" -#include "math_const.h" -#include "utils.h" +#include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -94,11 +91,11 @@ void NEBSpin::command(int narg, char **arg) if (narg < 6) error->universe_all(FLERR,"Illegal NEBSpin command"); - etol = force->numeric(FLERR,arg[0]); - ttol = force->numeric(FLERR,arg[1]); - n1steps = force->inumeric(FLERR,arg[2]); - n2steps = force->inumeric(FLERR,arg[3]); - nevery = force->inumeric(FLERR,arg[4]); + etol = utils::numeric(FLERR,arg[0],false,lmp); + ttol = utils::numeric(FLERR,arg[1],false,lmp); + n1steps = utils::inumeric(FLERR,arg[2],false,lmp); + n2steps = utils::inumeric(FLERR,arg[3],false,lmp); + nevery = utils::inumeric(FLERR,arg[4],false,lmp); // error checks @@ -126,7 +123,7 @@ void NEBSpin::command(int narg, char **arg) // error checks if (nreplica == 1) error->all(FLERR,"Cannot use NEBSpin with a single replica"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use NEBSpin unless atom map exists"); // process file-style setting to setup initial configs for all replicas @@ -301,7 +298,7 @@ void NEBSpin::run() fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc EBF EBR RDT " "RD1 PE1 RD2 PE2 ... RDN PEN " - "GradV0dottan DN0... GradVNdottan DNN\n"); + "GradV0dottan DN0 ... GradVNdottan DNN\n"); } else { fprintf(uscreen,"Step MaxReplicaTorque MaxAtomTorque " "GradV0 GradV1 GradVc " @@ -387,7 +384,7 @@ void NEBSpin::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -401,7 +398,7 @@ void NEBSpin::readfile(char *file, int flag) open(file); while (1) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of neb/spin file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of neb/spin file"); start = &line[strspn(line," \t\n\v\f\r")]; if (*start != '\0' && *start != '#') break; } @@ -455,7 +452,7 @@ void NEBSpin::readfile(char *file, int flag) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); // adjust spin coord based on replica fraction // for flag = 0, interpolate for intermediate and final replicas @@ -708,7 +705,7 @@ void NEBSpin::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/SPIN/pair_spin.cpp b/src/SPIN/pair_spin.cpp index b0965d1271..53dd6530bf 100644 --- a/src/SPIN/pair_spin.cpp +++ b/src/SPIN/pair_spin.cpp @@ -42,7 +42,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ -PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(NULL) +PairSpin::PairSpin(LAMMPS *lmp) : Pair(lmp), emag(nullptr) { hbar = force->hplanck/MY_2PI; single_enable = 0; diff --git a/src/SPIN/pair_spin.h b/src/SPIN/pair_spin.h index 8bbb27ed06..9db2bd4177 100644 --- a/src/SPIN/pair_spin.h +++ b/src/SPIN/pair_spin.h @@ -27,7 +27,7 @@ friend class FixNVESpin; virtual void coeff(int, char **) {} virtual void init_style(); virtual double init_one(int, int) {return 0.0;} - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void compute(int, int) {} virtual void compute_single_pair(int, double *) {} diff --git a/src/SPIN/pair_spin_dipole_cut.cpp b/src/SPIN/pair_spin_dipole_cut.cpp index cdae3c0bab..b482792e12 100644 --- a/src/SPIN/pair_spin_dipole_cut.cpp +++ b/src/SPIN/pair_spin_dipole_cut.cpp @@ -22,20 +22,17 @@ ------------------------------------------------------------------------- */ #include "pair_spin_dipole_cut.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "neigh_list.h" -#include "fix.h" +#include "error.h" #include "force.h" #include "math_const.h" #include "memory.h" -#include "modify.h" -#include "error.h" -#include "update.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -76,7 +73,7 @@ void PairSpinDipoleCut::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_long_global = force->numeric(FLERR,arg[0]); + cut_spin_long_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -105,10 +102,10 @@ void PairSpinDipoleCut::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args in pair_style command"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double spin_long_cut_one = force->numeric(FLERR,arg[2]); + double spin_long_cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -157,7 +154,7 @@ void *PairSpinDipoleCut::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -382,7 +379,7 @@ void PairSpinDipoleCut::compute_dipolar(int /* i */, int /* j */, double eij[3], ------------------------------------------------------------------------- */ void PairSpinDipoleCut::compute_dipolar_mech(int /* i */, int /* j */, double eij[3], - double fi[3], double spi[3], double spj[3], double r2inv) + double fi[3], double spi[4], double spj[4], double r2inv) { double sisj,sieij,sjeij; double gigjri4,bij,pre; @@ -451,11 +448,11 @@ void PairSpinDipoleCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } @@ -480,8 +477,8 @@ void PairSpinDipoleCut::write_restart_settings(FILE *fp) void PairSpinDipoleCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_dipole_long.cpp b/src/SPIN/pair_spin_dipole_long.cpp index aeb916cfae..364c2025c8 100644 --- a/src/SPIN/pair_spin_dipole_long.cpp +++ b/src/SPIN/pair_spin_dipole_long.cpp @@ -17,21 +17,18 @@ ------------------------------------------------------------------------- */ #include "pair_spin_dipole_long.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "neigh_list.h" -#include "fix.h" +#include "error.h" #include "force.h" #include "kspace.h" #include "math_const.h" #include "memory.h" -#include "modify.h" -#include "error.h" -#include "update.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -81,7 +78,7 @@ void PairSpinDipoleLong::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_long_global = force->numeric(FLERR,arg[0]); + cut_spin_long_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -109,10 +106,10 @@ void PairSpinDipoleLong::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args in pair_style command"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double spin_long_cut_one = force->numeric(FLERR,arg[2]); + double spin_long_cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -136,7 +133,7 @@ void PairSpinDipoleLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -177,7 +174,7 @@ void *PairSpinDipoleLong::extract(const char *str, int &dim) dim = 0; return (void *) &mix_flag; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -456,7 +453,7 @@ void PairSpinDipoleLong::compute_long(int /* i */, int /* j */, double eij[3], ------------------------------------------------------------------------- */ void PairSpinDipoleLong::compute_long_mech(int /* i */, int /* j */, double eij[3], - double bij[4], double fi[3], double spi[3], double spj[3]) + double bij[4], double fi[3], double spi[4], double spj[4]) { double sisj,sieij,sjeij,b2,b3; double g1,g2,g1b2_g2b3,gigj,pre; @@ -530,11 +527,11 @@ void PairSpinDipoleLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long[i][j],sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long[i][j],1,MPI_INT,0,world); } @@ -559,8 +556,8 @@ void PairSpinDipoleLong::write_restart_settings(FILE *fp) void PairSpinDipoleLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_long_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_long_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_dmi.cpp b/src/SPIN/pair_spin_dmi.cpp index c6b0564463..e2ddd708df 100644 --- a/src/SPIN/pair_spin_dmi.cpp +++ b/src/SPIN/pair_spin_dmi.cpp @@ -22,19 +22,16 @@ ------------------------------------------------------------------------- */ #include "pair_spin_dmi.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "error.h" #include "force.h" -#include "fix.h" -#include "neigh_list.h" #include "memory.h" -#include "modify.h" -#include "update.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; @@ -65,7 +62,7 @@ void PairSpinDmi::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_dmi_global = force->numeric(FLERR,arg[0]); + cut_spin_dmi_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -98,14 +95,14 @@ void PairSpinDmi::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args in pair_style command"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - const double rij = force->numeric(FLERR,arg[3]); - const double dm = (force->numeric(FLERR,arg[4])); - double dmx = force->numeric(FLERR,arg[5]); - double dmy = force->numeric(FLERR,arg[6]); - double dmz = force->numeric(FLERR,arg[7]); + const double rij = utils::numeric(FLERR,arg[3],false,lmp); + const double dm = utils::numeric(FLERR,arg[4],false,lmp); + double dmx = utils::numeric(FLERR,arg[5],false,lmp); + double dmy = utils::numeric(FLERR,arg[6],false,lmp); + double dmz = utils::numeric(FLERR,arg[7],false,lmp); double inorm = 1.0/(dmx*dmx+dmy*dmy+dmz*dmz); dmx *= inorm; @@ -159,7 +156,7 @@ void *PairSpinDmi::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_dmi_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -480,18 +477,18 @@ void PairSpinDmi::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&DM[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmx[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmy[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_dmz[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmx[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmy[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&vmech_dmz[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_dmi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&DM[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmx[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmy[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_dmz[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmx[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmy[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&vmech_dmz[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_dmi[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&DM[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&v_dmx[i][j],1,MPI_DOUBLE,0,world); @@ -525,9 +522,9 @@ void PairSpinDmi::write_restart_settings(FILE *fp) void PairSpinDmi::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_dmi_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_dmi_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_dmi_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_exchange.cpp b/src/SPIN/pair_spin_exchange.cpp index 5c5d5cb1a4..ba9bddb7c8 100644 --- a/src/SPIN/pair_spin_exchange.cpp +++ b/src/SPIN/pair_spin_exchange.cpp @@ -22,19 +22,16 @@ ------------------------------------------------------------------------- */ #include "pair_spin_exchange.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "error.h" -#include "fix.h" #include "force.h" -#include "neigh_list.h" #include "memory.h" -#include "modify.h" -#include "update.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; @@ -62,7 +59,7 @@ void PairSpinExchange::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_exchange_global = force->numeric(FLERR,arg[0]); + cut_spin_exchange_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -92,15 +89,15 @@ void PairSpinExchange::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args in pair_style command"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // get exchange arguments from input command - const double rc = force->numeric(FLERR,arg[3]); - const double j1 = force->numeric(FLERR,arg[4]); - const double j2 = force->numeric(FLERR,arg[5]); - const double j3 = force->numeric(FLERR,arg[6]); + const double rc = utils::numeric(FLERR,arg[3],false,lmp); + const double j1 = utils::numeric(FLERR,arg[4],false,lmp); + const double j2 = utils::numeric(FLERR,arg[5],false,lmp); + const double j3 = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -144,7 +141,7 @@ void *PairSpinExchange::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_exchange_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -470,15 +467,15 @@ void PairSpinExchange::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&J1_mag[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&J3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_exchange[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&J1_mag[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&J1_mech[i][j],1,MPI_DOUBLE,0,world); @@ -509,9 +506,9 @@ void PairSpinExchange::write_restart_settings(FILE *fp) void PairSpinExchange::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_exchange_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_exchange_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_magelec.cpp b/src/SPIN/pair_spin_magelec.cpp index 741305fbf4..849590bad2 100644 --- a/src/SPIN/pair_spin_magelec.cpp +++ b/src/SPIN/pair_spin_magelec.cpp @@ -22,19 +22,16 @@ ------------------------------------------------------------------------- */ #include "pair_spin_magelec.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "error.h" -#include "fix.h" #include "force.h" -#include "neigh_list.h" #include "memory.h" -#include "modify.h" -#include "update.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; @@ -64,7 +61,7 @@ void PairSpinMagelec::settings(int narg, char **arg) PairSpin::settings(narg,arg); - cut_spin_magelec_global = force->numeric(FLERR,arg[0]); + cut_spin_magelec_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -95,14 +92,14 @@ void PairSpinMagelec::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args in pair_style command"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - const double rij = force->numeric(FLERR,arg[3]); - const double magelec = (force->numeric(FLERR,arg[4])); - double mex = force->numeric(FLERR,arg[5]); - double mey = force->numeric(FLERR,arg[6]); - double mez = force->numeric(FLERR,arg[7]); + const double rij = utils::numeric(FLERR,arg[3],false,lmp); + const double magelec = utils::numeric(FLERR,arg[4],false,lmp); + double mex = utils::numeric(FLERR,arg[5],false,lmp); + double mey = utils::numeric(FLERR,arg[6],false,lmp); + double mez = utils::numeric(FLERR,arg[7],false,lmp); double inorm = 1.0/(mex*mex+mey*mey+mez*mez); mex *= inorm; @@ -152,7 +149,7 @@ void *PairSpinMagelec::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_magelec_global; - return NULL; + return nullptr; } @@ -468,15 +465,15 @@ void PairSpinMagelec::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&ME[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mex[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mey[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&v_mez[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_magelec[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&ME[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mex[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mey[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&v_mez[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_magelec[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&ME[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&v_mex[i][j],1,MPI_DOUBLE,0,world); @@ -506,9 +503,9 @@ void PairSpinMagelec::write_restart_settings(FILE *fp) void PairSpinMagelec::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_magelec_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_magelec_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_magelec_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SPIN/pair_spin_neel.cpp b/src/SPIN/pair_spin_neel.cpp index 4fd8ecc215..1e50ee48a6 100644 --- a/src/SPIN/pair_spin_neel.cpp +++ b/src/SPIN/pair_spin_neel.cpp @@ -22,19 +22,16 @@ ------------------------------------------------------------------------- */ #include "pair_spin_neel.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "error.h" -#include "fix.h" #include "force.h" -#include "neigh_list.h" #include "memory.h" -#include "modify.h" -#include "update.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; @@ -66,7 +63,7 @@ void PairSpinNeel::settings(int narg, char **arg) { PairSpin::settings(narg,arg); - cut_spin_neel_global = force->numeric(FLERR,arg[0]); + cut_spin_neel_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -99,16 +96,16 @@ void PairSpinNeel::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args in pair_style command"); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - const double rij = force->numeric(FLERR,arg[3]); - const double k1 = force->numeric(FLERR,arg[4]); - const double k2 = force->numeric(FLERR,arg[5]); - const double k3 = force->numeric(FLERR,arg[6]); - const double l1 = force->numeric(FLERR,arg[7]); - const double l2 = force->numeric(FLERR,arg[8]); - const double l3 = force->numeric(FLERR,arg[9]); + const double rij = utils::numeric(FLERR,arg[3],false,lmp); + const double k1 = utils::numeric(FLERR,arg[4],false,lmp); + const double k2 = utils::numeric(FLERR,arg[5],false,lmp); + const double k3 = utils::numeric(FLERR,arg[6],false,lmp); + const double l1 = utils::numeric(FLERR,arg[7],false,lmp); + const double l2 = utils::numeric(FLERR,arg[8],false,lmp); + const double l3 = utils::numeric(FLERR,arg[9],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -159,7 +156,7 @@ void *PairSpinNeel::extract(const char *str, int &dim) { dim = 0; if (strcmp(str,"cut") == 0) return (void *) &cut_spin_neel_global; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ @@ -684,19 +681,19 @@ void PairSpinNeel::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&g1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&g3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q1_mech[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&q3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_spin_neel[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&g1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&g3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q1_mech[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&q3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_spin_neel[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&g1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&g1_mech[i][j],1,MPI_DOUBLE,0,world); @@ -730,9 +727,9 @@ void PairSpinNeel::write_restart_settings(FILE *fp) void PairSpinNeel::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_spin_neel_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_spin_neel_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_spin_neel_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/SRD/fix_srd.cpp b/src/SRD/fix_srd.cpp index 8f15128399..50a27b5fae 100644 --- a/src/SRD/fix_srd.cpp +++ b/src/SRD/fix_srd.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_srd.h" -#include + #include #include #include "math_extra.h" @@ -77,12 +77,12 @@ static const char cite_fix_srd[] = /* ---------------------------------------------------------------------- */ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - wallfix(NULL), wallwhich(NULL), xwall(NULL), xwallhold(NULL), - vwall(NULL), fwall(NULL), avec_ellipsoid(NULL), avec_line(NULL), - avec_tri(NULL), random(NULL), randomshift(NULL), flocal(NULL), - tlocal(NULL), biglist(NULL), binhead(NULL), binnext(NULL), sbuf1(NULL), - sbuf2(NULL), rbuf1(NULL), rbuf2(NULL), nbinbig(NULL), binbig(NULL), - binsrd(NULL), stencil(NULL) + wallfix(nullptr), wallwhich(nullptr), xwall(nullptr), xwallhold(nullptr), + vwall(nullptr), fwall(nullptr), avec_ellipsoid(nullptr), avec_line(nullptr), + avec_tri(nullptr), random(nullptr), randomshift(nullptr), flocal(nullptr), + tlocal(nullptr), biglist(nullptr), binhead(nullptr), binnext(nullptr), sbuf1(nullptr), + sbuf2(nullptr), rbuf1(nullptr), rbuf2(nullptr), nbinbig(nullptr), binbig(nullptr), + binsrd(nullptr), stencil(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_srd); @@ -94,15 +94,15 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), global_freq = 1; extvector = 0; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); bigexist = 1; if (strcmp(arg[4],"NULL") == 0) bigexist = 0; else biggroup = group->find(arg[4]); - temperature_srd = force->numeric(FLERR,arg[5]); - gridsrd = force->numeric(FLERR,arg[6]); - int seed = force->inumeric(FLERR,arg[7]); + temperature_srd = utils::numeric(FLERR,arg[5],false,lmp); + gridsrd = utils::numeric(FLERR,arg[6],false,lmp); + int seed = utils::inumeric(FLERR,arg[7],false,lmp); // parse options @@ -125,7 +125,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), while (iarg < narg) { if (strcmp(arg[iarg],"lamda") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - lamda = force->numeric(FLERR,arg[iarg+1]); + lamda = utils::numeric(FLERR,arg[iarg+1],false,lmp); lamdaflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"collision") == 0) { @@ -155,22 +155,22 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), iarg += 2; } else if (strcmp(arg[iarg],"radius") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - radfactor = force->numeric(FLERR,arg[iarg+1]); + radfactor = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"bounce") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - maxbounceallow = force->inumeric(FLERR,arg[iarg+1]); + maxbounceallow = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"search") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); - gridsearch = force->numeric(FLERR,arg[iarg+1]); + gridsearch = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"cubic") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix srd command"); if (strcmp(arg[iarg+1],"error") == 0) cubicflag = CUBIC_ERROR; else if (strcmp(arg[iarg+1],"warn") == 0) cubicflag = CUBIC_WARN; else error->all(FLERR,"Illegal fix srd command"); - cubictol = force->numeric(FLERR,arg[iarg+2]); + cubictol = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"shift") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix srd command"); @@ -178,7 +178,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), else if (strcmp(arg[iarg+1],"yes") == 0) shiftuser = SHIFT_YES; else if (strcmp(arg[iarg+1],"possible") == 0) shiftuser = SHIFT_POSSIBLE; else error->all(FLERR,"Illegal fix srd command"); - shiftseed = force->inumeric(FLERR,arg[iarg+2]); + shiftseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"tstat") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix srd command"); @@ -232,7 +232,7 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), if (shiftuser == SHIFT_YES || shiftuser == SHIFT_POSSIBLE) randomshift = new RanPark(lmp,shiftseed); - else randomshift = NULL; + else randomshift = nullptr; // initialize data structs and flags @@ -240,31 +240,31 @@ FixSRD::FixSRD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), else biggroupbit = 0; nmax = 0; - binhead = NULL; + binhead = nullptr; maxbin1 = 0; - binnext = NULL; + binnext = nullptr; maxbuf = 0; - sbuf1 = sbuf2 = rbuf1 = rbuf2 = NULL; + sbuf1 = sbuf2 = rbuf1 = rbuf2 = nullptr; shifts[0].maxvbin = shifts[1].maxvbin = 0; - shifts[0].vbin = shifts[1].vbin = NULL; + shifts[0].vbin = shifts[1].vbin = nullptr; shifts[0].maxbinsq = shifts[1].maxbinsq = 0; for (int ishift = 0; ishift < 2; ishift++) for (int iswap = 0; iswap < 6; iswap++) shifts[ishift].bcomm[iswap].sendlist = - shifts[ishift].bcomm[iswap].recvlist = NULL; + shifts[ishift].bcomm[iswap].recvlist = nullptr; maxbin2 = 0; - nbinbig = NULL; - binbig = NULL; - binsrd = NULL; + nbinbig = nullptr; + binbig = nullptr; + binsrd = nullptr; nstencil = maxstencil = 0; - stencil = NULL; + stencil = nullptr; maxbig = 0; - biglist = NULL; + biglist = nullptr; stats_flag = 1; for (int i = 0; i < size_vector; i++) stats_all[i] = 0.0; @@ -1367,7 +1367,7 @@ void FixSRD::collisions_single() else slip_wall(v[i],j,norm,vsnew); } else { if (type != WALL) noslip(v[i],v[j],x[j],big,-1, xscoll,norm,vsnew); - else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew); + else noslip(v[i],nullptr,x[j],big,j,xscoll,norm,vsnew); } if (dimension == 2) vsnew[2] = 0.0; @@ -1387,7 +1387,7 @@ void FixSRD::collisions_single() // BIG particle is not torqued if sphere and SLIP collision if (collidestyle == SLIP && type == SPHERE) - force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL); + force_torque(v[i],vsnew,xscoll,xbcoll,f[j],nullptr); else if (type != WALL) force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]); else if (type == WALL) @@ -1557,7 +1557,7 @@ void FixSRD::collisions_multi() else slip_wall(v[i],j,norm,vsnew); } else { if (type != WALL) noslip(v[i],v[j],x[j],big,-1,xscoll,norm,vsnew); - else noslip(v[i],NULL,x[j],big,j,xscoll,norm,vsnew); + else noslip(v[i],nullptr,x[j],big,j,xscoll,norm,vsnew); } if (dimension == 2) vsnew[2] = 0.0; @@ -1576,7 +1576,7 @@ void FixSRD::collisions_multi() // BIG particle is not torqued if sphere and SLIP collision if (collidestyle == SLIP && type == SPHERE) - force_torque(v[i],vsnew,xscoll,xbcoll,f[j],NULL); + force_torque(v[i],vsnew,xscoll,xbcoll,f[j],nullptr); else if (type != WALL) force_torque(v[i],vsnew,xscoll,xbcoll,f[j],torque[j]); else if (type == WALL) diff --git a/src/SRD/fix_wall_srd.cpp b/src/SRD/fix_wall_srd.cpp index ab113df28a..aa8a4140ab 100644 --- a/src/SRD/fix_wall_srd.cpp +++ b/src/SRD/fix_wall_srd.cpp @@ -12,18 +12,18 @@ ------------------------------------------------------------------------- */ #include "fix_wall_srd.h" -#include -#include -#include "fix.h" + #include "domain.h" -#include "lattice.h" +#include "error.h" +#include "fix.h" #include "input.h" +#include "lattice.h" +#include "memory.h" #include "modify.h" #include "update.h" #include "variable.h" -#include "memory.h" -#include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -34,7 +34,7 @@ enum{NONE,EDGE,CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), nwall(0), fwall(NULL), fwall_all(NULL) + Fix(lmp, narg, arg), nwall(0), fwall(nullptr), fwall_all(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix wall/srd command"); @@ -76,7 +76,7 @@ FixWallSRD::FixWallSRD(LAMMPS *lmp, int narg, char **arg) : strcpy(varstr[nwall],&arg[iarg+1][2]); } else { wallstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } nwall++; diff --git a/src/USER-ADIOS/dump_atom_adios.cpp b/src/USER-ADIOS/dump_atom_adios.cpp index 3012223ac7..fe6c67f60f 100644 --- a/src/USER-ADIOS/dump_atom_adios.cpp +++ b/src/USER-ADIOS/dump_atom_adios.cpp @@ -190,7 +190,7 @@ void DumpAtomADIOS::write() if (sort_flag && sortcol == 0) pack(ids); else - pack(NULL); + pack(nullptr); if (sort_flag) sort(); @@ -337,9 +337,9 @@ void DumpAtomADIOS::init_style() internal->io.DefineAttribute("boundarystr", boundstr); internal->io.DefineAttribute("LAMMPS/dump_style", "atom"); internal->io.DefineAttribute("LAMMPS/version", - universe->version); + lmp->version); internal->io.DefineAttribute("LAMMPS/num_ver", - universe->num_ver); + std::to_string(lmp->num_ver)); internal->io.DefineVariable( "nme", {adios2::LocalValueDim}); // local dimension variable diff --git a/src/USER-ADIOS/dump_custom_adios.cpp b/src/USER-ADIOS/dump_custom_adios.cpp index f7015ef696..145b3ac3e5 100644 --- a/src/USER-ADIOS/dump_custom_adios.cpp +++ b/src/USER-ADIOS/dump_custom_adios.cpp @@ -274,7 +274,7 @@ void DumpCustomADIOS::write() if (sort_flag && sortcol == 0) pack(ids); else - pack(NULL); + pack(nullptr); if (sort_flag) sort(); @@ -424,9 +424,9 @@ void DumpCustomADIOS::init_style() internal->io.DefineAttribute("boundarystr", boundstr); internal->io.DefineAttribute("LAMMPS/dump_style", "custom"); internal->io.DefineAttribute("LAMMPS/version", - universe->version); + lmp->version); internal->io.DefineAttribute("LAMMPS/num_ver", - universe->num_ver); + std::to_string(lmp->num_ver)); internal->io.DefineVariable( "nme", {adios2::LocalValueDim}); // local dimension variable diff --git a/src/USER-ADIOS/reader_adios.cpp b/src/USER-ADIOS/reader_adios.cpp index d1e7313439..89a9ae698a 100644 --- a/src/USER-ADIOS/reader_adios.cpp +++ b/src/USER-ADIOS/reader_adios.cpp @@ -73,7 +73,7 @@ public: ReaderADIOS::ReaderADIOS(LAMMPS *lmp) : Reader(lmp) { - fieldindex = NULL; + fieldindex = nullptr; nAtoms = 0; nAtomsTotal = 0; atomOffset = 0; @@ -230,7 +230,7 @@ void ReaderADIOS::skip() { internal->fh.EndStep(); } match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ diff --git a/src/USER-ATC/fix_atc.cpp b/src/USER-ATC/fix_atc.cpp index 2165132856..1e1f11b5a7 100644 --- a/src/USER-ATC/fix_atc.cpp +++ b/src/USER-ATC/fix_atc.cpp @@ -12,23 +12,15 @@ ------------------------------------------------------------------------- */ #include "fix_atc.h" -#include -#include -#include -#include "fix_nve.h" + #include "atom.h" -#include "force.h" -#include "update.h" -#include "respa.h" -#include "error.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "pointers.h" #include "comm.h" +#include "error.h" #include "group.h" +#include "neigh_request.h" +#include "neighbor.h" #include "ATC_Method.h" -#include "ATC_Transfer.h" #include "ATC_TransferKernel.h" #include "ATC_TransferPartitionOfUnity.h" #include "ATC_CouplingEnergy.h" @@ -37,6 +29,8 @@ #include "ATC_CouplingMomentumEnergy.h" #include "LammpsInterface.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; using std::string; @@ -54,7 +48,7 @@ using std::string; /* ------------------------------------------------------------------------- */ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - lammps_(lmp), atc_(NULL) + lammps_(lmp), atc_(nullptr) { // ID GROUP atc PHYSICSTYPE [PARAMETERFILE] if (narg < 4 || narg > 5) lmp->error->all(FLERR,"Illegal fix atc command"); @@ -480,7 +474,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), throw; } - lmp->atom->add_callback(0); + lmp->atom->add_callback(Atom::GROW); // we write our own restart file restart_global = 0; @@ -513,7 +507,7 @@ FixATC::FixATC(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), /*----------------------------------------------------------------------- */ FixATC::~FixATC() { - if (lmp->atom) lmp->atom->delete_callback(id,0); + if (lmp->atom) lmp->atom->delete_callback(id,Atom::GROW); if (atc_) delete atc_; } diff --git a/src/USER-ATC/fix_atc.h b/src/USER-ATC/fix_atc.h index 2512c658db..5bf26f6eaa 100644 --- a/src/USER-ATC/fix_atc.h +++ b/src/USER-ATC/fix_atc.h @@ -8,7 +8,6 @@ FixStyle(atc,FixATC) #define FIX_ATC_H #include "fix.h" -#include "pointers.h" // access to lammps pointers namespace ATC { class ATC_Method; diff --git a/src/USER-AWPMD/atom_vec_wavepacket.cpp b/src/USER-AWPMD/atom_vec_wavepacket.cpp index 0d11e983ad..4b7575d2dd 100644 --- a/src/USER-AWPMD/atom_vec_wavepacket.cpp +++ b/src/USER-AWPMD/atom_vec_wavepacket.cpp @@ -16,9 +16,10 @@ ------------------------------------------------------------------------- */ #include "atom_vec_wavepacket.h" -#include + #include "atom.h" -#include "error.h" + +#include using namespace LAMMPS_NS; @@ -26,8 +27,8 @@ using namespace LAMMPS_NS; AtomVecWavepacket::AtomVecWavepacket(LAMMPS *lmp) : AtomVec(lmp) { - mass_type = 1; - molecular = 0; + mass_type = PER_TYPE; + molecular = Atom::ATOMIC; forceclearflag = 1; atom->wavepacket_flag = 1; diff --git a/src/USER-AWPMD/fix_nve_awpmd.cpp b/src/USER-AWPMD/fix_nve_awpmd.cpp index 2aa2e7680b..e68f096ab1 100644 --- a/src/USER-AWPMD/fix_nve_awpmd.cpp +++ b/src/USER-AWPMD/fix_nve_awpmd.cpp @@ -22,7 +22,7 @@ #include "update.h" #include "respa.h" #include "error.h" -#include "utils.h" + #include "TCP/wpmd_split.h" @@ -36,8 +36,6 @@ FixNVEAwpmd::FixNVEAwpmd(LAMMPS *lmp, int narg, char **arg) : { if (!atom->wavepacket_flag) error->all(FLERR,"Fix nve/awpmd requires atom style wavepacket"); - //if (!atom->mass_type != 1) - // error->all(FLERR,"Fix nve/awpmd requires per type mass"); time_integrate = 1; } diff --git a/src/USER-AWPMD/pair_awpmd_cut.cpp b/src/USER-AWPMD/pair_awpmd_cut.cpp index e382a1cb9c..870a154073 100644 --- a/src/USER-AWPMD/pair_awpmd_cut.cpp +++ b/src/USER-AWPMD/pair_awpmd_cut.cpp @@ -16,29 +16,30 @@ ------------------------------------------------------------------------- */ #include "pair_awpmd_cut.h" -#include -#include -#include -#include -#include + #include "atom.h" -#include "update.h" -#include "min.h" -#include "domain.h" #include "comm.h" +#include "domain.h" +#include "error.h" #include "force.h" -#include "neighbor.h" +#include "memory.h" +#include "min.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" -#include "utils.h" +#include "neighbor.h" +#include "update.h" #include "logexc.h" #include "vector_3.h" #include "TCP/wpmd.h" #include "TCP/wpmd_split.h" +#include +#include +#include +#include +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -48,8 +49,8 @@ PairAWPMDCut::PairAWPMDCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - min_var = NULL; - min_varforce = NULL; + min_var = nullptr; + min_varforce = nullptr; nextra = 4; pvector = new double[nextra]; @@ -81,7 +82,7 @@ PairAWPMDCut::~PairAWPMDCut() struct cmp_x{ double **xx; double tol; - cmp_x(double **xx_=NULL, double tol_=1e-12):xx(xx_),tol(tol_){} + cmp_x(double **xx_=nullptr, double tol_=1e-12):xx(xx_),tol(tol_){} bool operator()(const pair &left, const pair &right) const { if(left.first==right.first){ double d=xx[left.second][0]-xx[right.second][0]; @@ -237,10 +238,10 @@ void PairAWPMDCut::compute(int eflag, int vflag) etmap[etag[i]].push_back(i); } else - error->all(FLERR,fmt("Invalid spin value (%d) for particle %d !",spin[i],i)); + error->all(FLERR,logfmt("Invalid spin value (%d) for particle %d !",spin[i],i)); } // ion force vector - Vector_3 *fi=NULL; + Vector_3 *fi=nullptr; if(wpmd->ni) fi= new Vector_3[wpmd->ni]; @@ -254,7 +255,7 @@ void PairAWPMDCut::compute(int eflag, int vflag) for(size_t k=0;kall(FLERR,fmt("WP splits for one electron should have the same spin (at particles %d, %d)!",el[0],i)); + error->all(FLERR,logfmt("WP splits for one electron should have the same spin (at particles %d, %d)!",el[0],i)); double m= atom->mass ? atom->mass[type[i]] : force->e_mass; Vector_3 xx=Vector_3(x[i][0],x[i][1],x[i][2]); Vector_3 rv=m*Vector_3(v[i][0],v[i][1],v[i][2]); @@ -268,7 +269,7 @@ void PairAWPMDCut::compute(int eflag, int vflag) atom->ervel[i]=pv/(m*ermscale); } } - wpmd->set_pbc(NULL); // not required for LAMMPS + wpmd->set_pbc(nullptr); // not required for LAMMPS wpmd->interaction(0x1|0x4|0x10,fi); // get forces from the AWPMD solver object @@ -407,7 +408,7 @@ void PairAWPMDCut::allocate() void PairAWPMDCut::settings(int narg, char **arg){ if (narg < 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); ermscale=1.; width_pbc=0.; @@ -427,21 +428,21 @@ void PairAWPMDCut::settings(int narg, char **arg){ i++; if(i>=narg) error->all(FLERR,"Setting 'fix' should be followed by a number in awpmd/cut"); - wpmd->w0=force->numeric(FLERR,arg[i]); + wpmd->w0=utils::numeric(FLERR,arg[i],false,lmp); } else if(!strcmp(arg[i],"harm")){ wpmd->constraint=AWPMD::HARM; i++; if(i>=narg) error->all(FLERR,"Setting 'harm' should be followed by a number in awpmd/cut"); - wpmd->w0=force->numeric(FLERR,arg[i]); + wpmd->w0=utils::numeric(FLERR,arg[i],false,lmp); wpmd->set_harm_constr(wpmd->w0); } else if(!strcmp(arg[i],"pbc")){ i++; if(i>=narg) error->all(FLERR,"Setting 'pbc' should be followed by a number in awpmd/cut"); - width_pbc=force->numeric(FLERR,arg[i]); + width_pbc=utils::numeric(FLERR,arg[i],false,lmp); } else if(!strcmp(arg[i],"relax")) wpmd->constraint=AWPMD::RELAX; @@ -449,7 +450,7 @@ void PairAWPMDCut::settings(int narg, char **arg){ i++; if(i>=narg) error->all(FLERR,"Setting 'ermscale' should be followed by a number in awpmd/cut"); - ermscale=force->numeric(FLERR,arg[i]); + ermscale=utils::numeric(FLERR,arg[i],false,lmp); } else if(!strcmp(arg[i],"flex_press")) flexible_pressure_flag = 1; @@ -484,11 +485,11 @@ void PairAWPMDCut::coeff(int narg, char **arg) } int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -601,10 +602,10 @@ void PairAWPMDCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -628,9 +629,9 @@ void PairAWPMDCut::write_restart_settings(FILE *fp) void PairAWPMDCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-BOCS/compute_pressure_bocs.cpp b/src/USER-BOCS/compute_pressure_bocs.cpp index d0a24b99a3..b91a790d15 100644 --- a/src/USER-BOCS/compute_pressure_bocs.cpp +++ b/src/USER-BOCS/compute_pressure_bocs.cpp @@ -15,24 +15,23 @@ ------------------------------------------------------------------------- */ #include "compute_pressure_bocs.h" -#include -#include -#include -#include + +#include "angle.h" #include "atom.h" -#include "update.h" +#include "bond.h" +#include "dihedral.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "force.h" -#include "pair.h" -#include "bond.h" -#include "angle.h" -#include "dihedral.h" #include "improper.h" #include "kspace.h" -#include "error.h" +#include "modify.h" +#include "pair.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; @@ -40,7 +39,7 @@ using namespace LAMMPS_NS; ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vptr(NULL), id_temp(NULL) + vptr(nullptr), id_temp(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pressure/bocs command"); if (igroup) error->all(FLERR,"Compute pressure/bocs must use group all"); @@ -53,12 +52,12 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : timeflag = 1; p_match_flag = 0; - phi_coeff = NULL; + phi_coeff = nullptr; // store temperature ID used by pressure computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -105,13 +104,16 @@ ComputePressureBocs::ComputePressureBocs(LAMMPS *lmp, int narg, char **arg) : // error check - if (keflag && id_temp == NULL) + if (keflag && id_temp == nullptr) error->all(FLERR,"Compute pressure/bocs requires temperature ID " "to include kinetic energy"); vector = new double[size_vector]; nvirial = 0; - vptr = NULL; + vptr = nullptr; + + splines = nullptr; + spline_length = 0; } /* ---------------------------------------------------------------------- */ @@ -147,13 +149,15 @@ void ComputePressureBocs::init() delete [] vptr; nvirial = 0; - vptr = NULL; + vptr = nullptr; if (pairflag && force->pair) nvirial++; - if (bondflag && atom->molecular && force->bond) nvirial++; - if (angleflag && atom->molecular && force->angle) nvirial++; - if (dihedralflag && atom->molecular && force->dihedral) nvirial++; - if (improperflag && atom->molecular && force->improper) nvirial++; + if (atom->molecular != Atom::ATOMIC) { + if (bondflag && force->bond) nvirial++; + if (angleflag && force->angle) nvirial++; + if (dihedralflag && force->dihedral) nvirial++; + if (improperflag && force->improper) nvirial++; + } if (fixflag) for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->virial_flag) nvirial++; @@ -177,7 +181,7 @@ void ComputePressureBocs::init() // flag Kspace contribution separately, since not summed across procs if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial; - else kspace_virial = NULL; + else kspace_virial = nullptr; } /* Extra functions added for BOCS */ @@ -212,13 +216,11 @@ double ComputePressureBocs::find_index(double * grid, double value) if (value >= grid[i] && value <= (grid[i] + spacing)) { return i; } + error->all(FLERR, fmt::format("find_index could not find value in grid for value: {}", value)); for (int i = 0; i < gridsize; ++i) { fprintf(stderr, "grid %d: %f\n",i,grid[i]); } - char * errmsg = (char *) calloc(100,sizeof(char)); - sprintf(errmsg,"Value %f does not fall within spline grid.\n",value); - error->all(FLERR,errmsg); exit(1); } @@ -233,12 +235,12 @@ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, int i = find_index(grid[0],vCG); double correction, deltax = vCG - grid[0][i]; - if (basis_type == 1) + if (basis_type == BASIS_LINEAR_SPLINE) { correction = grid[1][i] + (deltax) * ( grid[1][i+1] - grid[1][i] ) / ( grid[0][i+1] - grid[0][i] ); } - else if (basis_type == 2) + else if (basis_type == BASIS_CUBIC_SPLINE) { correction = grid[1][i] + (grid[2][i] * deltax) + (grid[3][i] * pow(deltax,2)) + (grid[4][i] * pow(deltax,3)); @@ -257,7 +259,7 @@ double ComputePressureBocs::get_cg_p_corr(double ** grid, int basis_type, void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, double *sent_phi_coeff, int sent_N_mol, double sent_vavg) { - if (basis_type == 0) { p_basis_type = 0; } + if (basis_type == BASIS_ANALYTIC) { p_basis_type = BASIS_ANALYTIC; } else { error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n"); @@ -281,8 +283,8 @@ void ComputePressureBocs::send_cg_info(int basis_type, int sent_N_basis, void ComputePressureBocs::send_cg_info(int basis_type, double ** in_splines, int gridsize) { - if (basis_type == 1) { p_basis_type = 1; } - else if (basis_type == 2) { p_basis_type = 2; } + if (basis_type == BASIS_LINEAR_SPLINE) { p_basis_type = BASIS_LINEAR_SPLINE; } + else if (basis_type == BASIS_CUBIC_SPLINE) { p_basis_type = BASIS_CUBIC_SPLINE; } else { error->all(FLERR,"Incorrect basis type passed to ComputePressureBocs\n"); @@ -318,11 +320,11 @@ double ComputePressureBocs::compute_scalar() volume = (domain->xprd * domain->yprd * domain->zprd); /* MRD NJD if block */ - if ( p_basis_type == 0 ) + if ( p_basis_type == BASIS_ANALYTIC ) { correction = get_cg_p_corr(N_basis,phi_coeff,N_mol,vavg,volume); } - else if ( p_basis_type == 1 || p_basis_type == 2 ) + else if ( p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE ) { correction = get_cg_p_corr(splines, p_basis_type, volume); } diff --git a/src/USER-BOCS/compute_pressure_bocs.h b/src/USER-BOCS/compute_pressure_bocs.h index 4fb932c508..6592d5b35e 100644 --- a/src/USER-BOCS/compute_pressure_bocs.h +++ b/src/USER-BOCS/compute_pressure_bocs.h @@ -27,7 +27,15 @@ ComputeStyle(PRESSURE/BOCS,ComputePressureBocs) #include "compute.h" namespace LAMMPS_NS { -// ComputePressure -> ComputePressureBocs MRD NJD + // Enumerate the p_basis_type magic values to improve readability: + enum{BASIS_ANALYTIC, BASIS_LINEAR_SPLINE, BASIS_CUBIC_SPLINE}; + // Enumerate the data file column names to improve readability + enum{VOLUME, PRESSURE_CORRECTION}; + // Declare names for the number of columns in the splines data structure to improve readability + const int NUM_LINEAR_SPLINE_COLUMNS = 2; // linear spline columns passed to compute + const int NUM_CUBIC_SPLINE_COLUMNS = 5; // cubic spline columns passed to compute + + // ComputePressure -> ComputePressureBocs MRD NJD class ComputePressureBocs : public Compute { public: ComputePressureBocs(class LAMMPS *, int, char **); diff --git a/src/USER-BOCS/fix_bocs.cpp b/src/USER-BOCS/fix_bocs.cpp index 7c2f75a8ce..d9715362c1 100644 --- a/src/USER-BOCS/fix_bocs.cpp +++ b/src/USER-BOCS/fix_bocs.cpp @@ -15,27 +15,30 @@ ------------------------------------------------------------------------- */ #include "fix_bocs.h" + #include -#include + #include +#include + #include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "compute.h" +#include "compute_pressure_bocs.h" +#include "domain.h" +#include "error.h" +#include "fix_deform.h" + #include "force.h" #include "group.h" -#include "comm.h" -#include "neighbor.h" #include "irregular.h" -#include "modify.h" -#include "fix_deform.h" -#include "compute.h" #include "kspace.h" -#include "update.h" -#include "respa.h" -#include "domain.h" #include "memory.h" -#include "error.h" -#include "citeme.h" - -#include "compute_pressure_bocs.h" +#include "modify.h" +#include "neighbor.h" +#include "respa.h" +#include "update.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -59,8 +62,7 @@ enum{NOBIAS,BIAS}; enum{NONE,XYZ,XY,YZ,XZ}; enum{ISO,ANISO,TRICLINIC}; -// NB: Keep error and warning messages less than 255 chars long. -const int MAX_MESSAGE_LENGTH = 256; +const int NUM_INPUT_DATA_COLUMNS = 2; // columns in the pressure correction file /* ---------------------------------------------------------------------- NVT,NPH,NPT integrators for improved Nose-Hoover equations of motion @@ -68,10 +70,10 @@ const int MAX_MESSAGE_LENGTH = 256; FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_user_bocs_package); @@ -91,7 +93,7 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; drag = 0.0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; mtchain = mpchain = 3; nc_tchain = nc_pchain = 1; mtk_flag = 1; @@ -106,10 +108,13 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; - p_match_coeffs = NULL; + p_match_coeffs = nullptr; + + splines = nullptr; + spline_length = 0; // turn on tilt factor scaling, whenever applicable @@ -149,10 +154,10 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"temp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix bocs command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (t_start <= 0.0 || t_stop <= 0.0) error->all(FLERR, "Target temperature for fix bocs cannot be 0.0"); @@ -167,11 +172,11 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : p_match_flag = 1; pcouple = XYZ; p_start[0] = p_start[1] = p_start[2] = - force->numeric(FLERR,arg[iarg+1]); + utils::numeric(FLERR,arg[iarg+1],false,lmp); p_stop[0] = p_stop[1] = p_stop[2] = - force->numeric(FLERR,arg[iarg+2]); + utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_flag[3] = p_flag[4] = p_flag[5] = 0; // MRD @@ -183,48 +188,47 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : if ( strcmp(arg[iarg], "analytic") == 0 ) { if (iarg + 4 > narg) { - error->all(FLERR,"Illegal fix bocs command. basis type analytic" + error->all(FLERR,"Illegal fix bocs command. Basis type analytic" " must be followed by: avg_vol n_mol n_pmatch_coeff"); } - p_basis_type = 0; - vavg = force->numeric(FLERR,arg[iarg+1]); - N_mol = force->inumeric(FLERR,arg[iarg+2]); - N_p_match = force->inumeric(FLERR,arg[iarg+3]); + p_basis_type = BASIS_ANALYTIC; + vavg = utils::numeric(FLERR,arg[iarg+1],false,lmp); + N_mol = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + N_p_match = utils::inumeric(FLERR,arg[iarg+3],false,lmp); p_match_coeffs = (double *) (calloc(N_p_match, sizeof(double)) ); iarg += 4; if (iarg + N_p_match > narg) error->all(FLERR,"Illegal fix bocs command. Missing coeffs."); for (int pmatchi = 0; pmatchi < N_p_match; pmatchi++) - p_match_coeffs[pmatchi] = force->numeric(FLERR,arg[iarg+pmatchi]); + p_match_coeffs[pmatchi] = utils::numeric(FLERR,arg[iarg+pmatchi],false,lmp); iarg += (N_p_match); } else if (strcmp(arg[iarg], "linear_spline") == 0 ) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. " "Supply a file name after linear_spline."); - p_basis_type = 1; + p_basis_type = BASIS_LINEAR_SPLINE; spline_length = read_F_table( arg[iarg+1], p_basis_type ); iarg += 2; } else if (strcmp(arg[iarg], "cubic_spline") == 0 ) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command. " "Supply a file name after cubic_spline."); - p_basis_type = 2; + p_basis_type = BASIS_CUBIC_SPLINE; spline_length = read_F_table( arg[iarg+1], p_basis_type ); iarg += 2; } else { - char errmsg[256]; - snprintf(errmsg,256,"CG basis type %s is not recognized\nSupported " - "basis types: analytic linear_spline cubic_spline",arg[iarg]); + std::string errmsg = fmt::format("CG basis type {} is not recognized\nSupported " + "basis types: analytic linear_spline cubic_spline",arg[iarg]); error->all(FLERR,errmsg); } // END NJD MRD } else if (strcmp(arg[iarg],"tchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - mtchain = force->inumeric(FLERR,arg[iarg+1]); + mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; if (mtchain < 1) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - mpchain = force->inumeric(FLERR,arg[iarg+1]); + mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mpchain < 0) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { @@ -235,18 +239,17 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - nc_tchain = force->inumeric(FLERR,arg[iarg+1]); + nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_tchain < 0) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bocs command"); - nc_pchain = force->inumeric(FLERR,arg[iarg+1]); + nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_pchain < 0) error->all(FLERR,"Illegal fix bocs command"); iarg += 2; } else { - char errmsg[128]; - snprintf(errmsg,128,"Illegal fix bocs command: unrecognized keyword %s" - ,arg[iarg]); + std::string errmsg = fmt::format("Illegal fix bocs command: unrecognized keyword {}", + arg[iarg]); error->all(FLERR,errmsg); } } @@ -377,10 +380,10 @@ FixBocs::FixBocs(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -471,6 +474,12 @@ FixBocs::~FixBocs() } } if (p_match_coeffs) free(p_match_coeffs); + + // Free splines memory structure + if (splines != nullptr) { + memory->destroy(splines); + spline_length = 0; + } } /* ---------------------------------------------------------------------- */ @@ -537,12 +546,12 @@ void FixBocs::init() { if (pressure) { - if (p_basis_type == 0) + if (p_basis_type == BASIS_ANALYTIC) { ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, N_p_match, p_match_coeffs, N_mol, vavg); } - else if ( p_basis_type == 1 || p_basis_type == 2 ) + else if ( p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE ) { ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, splines, spline_length); @@ -615,7 +624,7 @@ void FixBocs::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -630,28 +639,42 @@ void FixBocs::init() // NJD MRD 2 functions int FixBocs::read_F_table( char *filename, int p_basis_type ) { - FILE *fpi; - int N_columns = 2, n_entries = 0, i; - float f1, f2; - int test_sscanf; - double **data = (double **) calloc(N_columns,sizeof(double *)); - char * line = (char *) calloc(200,sizeof(char)); - + std::string message; + double **data; bool badInput = false; - char badDataMsg[MAX_MESSAGE_LENGTH]; - fpi = fopen(filename,"r"); - if (fpi) - { - while (fgets(line,199,fpi)) { ++n_entries; } - - for (i = 0; i < N_columns; ++i) - { - data[i] = (double *) calloc(n_entries,sizeof(double)); + int numEntries = 0; + FILE *fpi = fopen(filename,"r"); + if (fpi) { + // Old code read the input file twice. Now we simply + // read all the lines from the input file into a string vector, + // then work with the data in-memory rather than do a second pass + // through the file. + // NB: LAMMPS coding guidelines prefer cstdio so we are intentionally + // foregoing reading with getline + if (comm->me == 0) { + error->message(FLERR, fmt::format("INFO: About to read data file: {}", filename)); } - // Don't need to re-open the file to make a second pass through it - // simply rewind to beginning - rewind(fpi); + // Data file lines hold two floating point numbers. + // Line length we allocate should be long enough without being too long. + // 128 seems safe for a line we expect to be < 30 chars. + const int MAX_F_TABLE_LINE_LENGTH = 128; + char line[MAX_F_TABLE_LINE_LENGTH]; + std::vector inputLines; + while (fgets(line, MAX_F_TABLE_LINE_LENGTH, fpi)) { + inputLines.push_back(std::string(line)); + } + fclose(fpi); + + numEntries = inputLines.size(); + if (comm->me == 0) { + error->message(FLERR, fmt::format("INFO: Read {} lines from file", numEntries)); + } + + + // Allocate memory for the two dimensional matrix + // that holds data from the input file. + memory->create(data, NUM_INPUT_DATA_COLUMNS, numEntries, "data"); double stdVolumeInterval = 0.0; double currVolumeInterval = 0.0; @@ -659,125 +682,157 @@ int FixBocs::read_F_table( char *filename, int p_basis_type ) // The literature indicates getting this value right in the // general case can be pretty complicated. I don't think it // needs to be complicated here, though. At least based on the - // sample data I've seen where the volume values are fairly - // large. + // sample data I've seen where the volume values are fairly large. const double volumeIntervalTolerance = 0.001; - n_entries = 0; - while( fgets(line,199,fpi)) { - ++n_entries; - test_sscanf = sscanf(line," %f , %f ",&f1, &f2); + int lineNum = 0; // this value is only for message + int numBadVolumeIntervals = 0; // count these for message + float f1, f2; + int test_sscanf; + for (int i = 0; i < inputLines.size(); ++i) { + lineNum++; // count each line processed now so lineNum messages can be 1-based + test_sscanf = sscanf(inputLines.at(i).c_str()," %f , %f ",&f1, &f2); if (test_sscanf == 2) { - data[0][n_entries-1] = (double) f1; - data[1][n_entries-1] = (double) f2; - if (n_entries == 2) { - stdVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2]; + //if (comm->me == 0) { + // error->message(FLERR, fmt::format("INFO: f1 = {}, f2 = {}", f1, f2)); + //} + data[VOLUME][i] = (double)f1; + data[PRESSURE_CORRECTION][i] = (double)f2; + if (i == 1) + { + // second entry is used to compute the validation interval used below + stdVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1]; + //if (comm->me == 0) { + // error->message(FLERR, fmt::format("INFO: standard volume interval computed: {}", stdVolumeInterval)); + //} } - else if (n_entries > 2) { - currVolumeInterval = data[0][n_entries-1] - data[0][n_entries-2]; + else if (i > 1) + { + // after second entry, all intervals are validated + currVolumeInterval = data[VOLUME][i] - data[VOLUME][i-1]; + //if (comm->me == 0) { + // error->message(FLERR, fmt::format("INFO: current volume interval: {}", currVolumeInterval)); + //} if (fabs(currVolumeInterval - stdVolumeInterval) > volumeIntervalTolerance) { - snprintf(badDataMsg,MAX_MESSAGE_LENGTH, - "BAD VOLUME INTERVAL: spline analysis requires uniform" - " volume distribution, found inconsistent volume" - " differential, line %d of file %s\n\tline: %s", - n_entries,filename,line); - error->message(FLERR,badDataMsg); + if (comm->me == 0) { + message = fmt::format("Bad volume interval. Spline analysis requires uniform" + " volume distribution, found inconsistent volume" + " differential, line {} of file {}\n\tline: {}", + lineNum, filename, inputLines.at(i)); + error->warning(FLERR, message); + } badInput = true; + numBadVolumeIntervals++; } + // no concluding else is intentional: i = 0, first line, no interval to validate } - // no else -- first entry is simply ignored } else { - snprintf(badDataMsg,MAX_MESSAGE_LENGTH, - "BAD INPUT FORMAT: did not find 2 comma separated numeric" - " values in line %d of file %s\n\tline: %s", - n_entries,filename,line); - error->message(FLERR,badDataMsg); + if (comm->me == 0) { + message = fmt::format("Bad input format: did not find 2 comma separated numeric" + " values in line {} of file {}\n\tline: {}", + lineNum, filename, inputLines.at(i)); + error->warning(FLERR, message); + } badInput = true; } - } - fclose(fpi); - } - else { - char errmsg[MAX_MESSAGE_LENGTH]; - snprintf(errmsg,MAX_MESSAGE_LENGTH,"Unable to open file: %s\n",filename); - error->all(FLERR,errmsg); - } - - if (badInput) { - char errmsg[MAX_MESSAGE_LENGTH]; - snprintf(errmsg,MAX_MESSAGE_LENGTH, - "Bad volume / pressure-correction data: %s\nSee details above",filename); - error->all(FLERR,errmsg); - } - - if (p_basis_type == 1) - { - splines = (double **) calloc(2,sizeof(double *)); - splines[0] = (double *) calloc(n_entries,sizeof(double)); - splines[1] = (double *) calloc(n_entries,sizeof(double)); - int idxa, idxb; - for (idxa = 0; idxa < 2; ++idxa) - { - for (idxb = 0; idxb < n_entries; ++idxb) + if (badInput) { - splines[idxa][idxb] = data[idxa][idxb]; + numBadVolumeIntervals++; } } + + if (numBadVolumeIntervals > 0 && comm->me == 0) { + error->message(FLERR, fmt::format("INFO: total number bad volume intervals = {}", numBadVolumeIntervals)); + } } - else if (p_basis_type == 2) + else { + error->all(FLERR,fmt::format("ERROR: Unable to open file: {}", filename)); + } + + if (badInput && comm->me == 0) { + error->warning(FLERR,fmt::format("Bad volume / pressure-correction data: {}\nSee details above", filename)); + } + + if (p_basis_type == BASIS_LINEAR_SPLINE) { - spline_length = n_entries; - build_cubic_splines(data); - n_entries -= 1; + spline_length = numEntries; + numEntries = build_linear_splines(data); + } + else if (p_basis_type == BASIS_CUBIC_SPLINE) + { + spline_length = numEntries; + numEntries = build_cubic_splines(data); } else { - char errmsg[MAX_MESSAGE_LENGTH]; - snprintf(errmsg, MAX_MESSAGE_LENGTH, - "ERROR: invalid p_basis_type value of %d in read_F_table", - p_basis_type); - error->all(FLERR,errmsg); + error->all(FLERR,fmt::format("ERROR: invalid p_basis_type value of {} in read_F_table", p_basis_type)); } - // cleanup - for (i = 0; i < N_columns; ++i) { - free(data[i]); - } - free(data); - return n_entries; + + memory->destroy(data); + return numEntries; } -void FixBocs::build_cubic_splines( double **data ) +int FixBocs::build_linear_splines(double **data) { + //if (comm->me == 0) { + //error->message(FLERR, fmt::format("INFO: entering build_linear_splines, spline_length = {}", spline_length)); + //} + splines = (double **) calloc(NUM_LINEAR_SPLINE_COLUMNS,sizeof(double *)); + splines[VOLUME] = (double *) calloc(spline_length,sizeof(double)); + splines[PRESSURE_CORRECTION] = (double *) calloc(spline_length,sizeof(double)); + + for (int i = 0; i < spline_length; ++i) + { + splines[VOLUME][i] = data[VOLUME][i]; + splines[PRESSURE_CORRECTION][i] = data[PRESSURE_CORRECTION][i]; + } + + if (comm->me == 0) { + error->message(FLERR, fmt::format("INFO: leaving build_linear_splines, spline_length = {}", spline_length)); + } + + return spline_length; +} + +int FixBocs::build_cubic_splines(double **data) { - double *a, *b, *d, *h, *alpha, *c, *l, *mu, *z; + //if (comm->me == 0) { + //error->message(FLERR, fmt::format("INFO: entering build_cubic_splines, spline_length = {}", spline_length)); + //} int n = spline_length; - double alpha_i; - a = (double *) calloc(n,sizeof(double)); - b = (double *) calloc(n+1,sizeof(double)); - d = (double *) calloc(n+1,sizeof(double)); - h = (double *) calloc(n,sizeof(double)); - alpha = (double *) calloc(n,sizeof(double)); - c = (double *) calloc(n+1,sizeof(double)); - l = (double *) calloc(n,sizeof(double)); - mu = (double *) calloc(n,sizeof(double)); - z = (double *) calloc(n,sizeof(double)); - int idx; + double *a, *b, *d, *h, *alpha, *c, *l, *mu, *z; + // 2020-07-17 ag: + // valgrind says that we read/write a[n] down in the + // for(int j=n-1; j>=0; j--) loop below + // and I agree. + // So the size of a must be n+1, not n as was found + // in the original code. + memory->create(a, n+1, "a"); + memory->create(b, n+1, "b"); + memory->create(c, n+1, "c"); + memory->create(d, n+1, "d"); + + memory->create(h, n, "h"); + memory->create(alpha, n, "alpha"); + memory->create(l, n, "l"); + memory->create(mu, n, "mu"); + memory->create(z, n, "z"); + for (int i=0; i1 && i<(n-1)) { alpha_i = (3.0 / h[i]) * ( data[1][i+1] - data[1][i]) - (3.0 / h[i-1] ) - * ( data[1][i] - data[1][i-1] ); + * ( data[1][i] - data[1][i-1] ); alpha[i-1] = alpha_i; } } @@ -795,8 +850,12 @@ void FixBocs::build_cubic_splines( double **data ) mu[n-1] = 0.0; z[n-1] = 0.0; - c[n] = 0.0; + // 2020-07-17 ag: We've been using an uninitialized value for a[n] + // That seems like a bad idea. This may not be the right value + // but its a value. + a[n] = 0.0; b[n] = 0.0; + c[n] = 0.0; d[n] = 0.0; for(int j=n-1; j>=0; j--) @@ -807,21 +866,35 @@ void FixBocs::build_cubic_splines( double **data ) d[j] = (c[j+1]-c[j])/(3.0 * h[j]); } - splines = (double **) calloc(5,sizeof(double *)); - for ( idx = 0; idx < 5; ++idx) - { - splines[idx] = (double *) calloc(n-1,sizeof(double)); - } - idx = 0; - for ( idx = 0; idx < n - 1; ++idx) + int numSplines = n - 1; + memory->create(splines, NUM_CUBIC_SPLINE_COLUMNS, numSplines, "splines"); + for (int idx = 0; idx < numSplines; ++idx) { + splines[0][idx] = data[0][idx]; splines[1][idx] = a[idx]; splines[2][idx] = b[idx]; splines[3][idx] = c[idx]; splines[4][idx] = d[idx]; - splines[0][idx] = data[0][idx]; } + + memory->destroy(a); + memory->destroy(b); + memory->destroy(c); + memory->destroy(d); + + memory->destroy(h); + memory->destroy(alpha); + memory->destroy(l); + memory->destroy(mu); + memory->destroy(z); + + if (comm->me == 0) { + error->message(FLERR, fmt::format("INFO: leaving build_cubic_splines, numSplines = {}", numSplines)); + } + + // Tell the caller how many splines we created + return numSplines; } // END NJD MRD 2 functions @@ -840,7 +913,7 @@ void FixBocs::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1519,20 +1592,21 @@ int FixBocs::modify_param(int narg, char **arg) if (p_match_flag) // NJD MRD { - if ( p_basis_type == 0 ) + if ( p_basis_type == BASIS_ANALYTIC ) { ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, N_p_match, p_match_coeffs, N_mol, vavg); } - else if ( p_basis_type == 1 || p_basis_type == 2 ) + else if ( p_basis_type == BASIS_LINEAR_SPLINE || p_basis_type == BASIS_CUBIC_SPLINE ) { - ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, splines, - spline_length ); + ((ComputePressureBocs *)pressure)->send_cg_info(p_basis_type, splines, spline_length ); } } if (pressure->pressflag == 0) - error->all(FLERR,"Fix_modify pressure ID does not compute pressure"); + { + error->all(FLERR, "Fix_modify pressure ID does not compute pressure"); + } return 2; } @@ -1845,7 +1919,7 @@ void *FixBocs::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-BOCS/fix_bocs.h b/src/USER-BOCS/fix_bocs.h index 34090e4f3a..a1a9f58d2b 100644 --- a/src/USER-BOCS/fix_bocs.h +++ b/src/USER-BOCS/fix_bocs.h @@ -26,7 +26,6 @@ FixStyle(bocs,FixBocs) #include "fix.h" - namespace LAMMPS_NS { class FixBocs : public Fix { @@ -151,7 +150,8 @@ class FixBocs : public Fix { void nhc_press_integrate(); int read_F_table(char *, int); - void build_cubic_splines(double **); + int build_linear_splines(double **); + int build_cubic_splines(double **); virtual void nve_x(); // may be overwritten by child classes virtual void nve_v(); @@ -180,6 +180,10 @@ Self-explanatory. Check the input script syntax and compare to the documentation for the command. You can use -echo screen as a command-line option when running LAMMPS to see the offending line. +E: CG basis type XXX is not recognized + +See second line of message for supported basis types. + E: Target temperature for fix bocs cannot be 0.0 Self-explanatory. diff --git a/src/USER-CGDNA/bond_oxdna_fene.cpp b/src/USER-CGDNA/bond_oxdna_fene.cpp index b2737fc4cd..f135c6b7ef 100644 --- a/src/USER-CGDNA/bond_oxdna_fene.cpp +++ b/src/USER-CGDNA/bond_oxdna_fene.cpp @@ -15,7 +15,7 @@ ------------------------------------------------------------------------- */ #include "bond_oxdna_fene.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -24,7 +24,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "atom_vec_ellipsoid.h" #include "math_extra.h" @@ -302,11 +302,11 @@ void BondOxdnaFene::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double Delta_one = force->numeric(FLERR,arg[2]); - double r0_one = force->numeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double Delta_one = utils::numeric(FLERR,arg[2],false,lmp); + double r0_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; @@ -359,9 +359,9 @@ void BondOxdnaFene::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&Delta[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&Delta[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&Delta[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-CGDNA/bond_oxrna2_fene.cpp b/src/USER-CGDNA/bond_oxrna2_fene.cpp index bdddccda87..2dee1224d3 100644 --- a/src/USER-CGDNA/bond_oxrna2_fene.cpp +++ b/src/USER-CGDNA/bond_oxrna2_fene.cpp @@ -14,8 +14,6 @@ Contributing author: Oliver Henrich (University of Strathclyde, Glasgow) ------------------------------------------------------------------------- */ -#include -#include #include "bond_oxrna2_fene.h" using namespace LAMMPS_NS; diff --git a/src/USER-CGDNA/fix_nve_dotc_langevin.cpp b/src/USER-CGDNA/fix_nve_dotc_langevin.cpp index 59def4c812..17b1fb7b42 100644 --- a/src/USER-CGDNA/fix_nve_dotc_langevin.cpp +++ b/src/USER-CGDNA/fix_nve_dotc_langevin.cpp @@ -16,16 +16,17 @@ ------------------------------------------------------------------------- */ #include "fix_nve_dotc_langevin.h" -#include -#include -#include "math_extra.h" + #include "atom.h" #include "atom_vec_ellipsoid.h" -#include "force.h" -#include "update.h" #include "comm.h" -#include "random_mars.h" #include "error.h" +#include "math_extra.h" +#include "random_mars.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -40,13 +41,13 @@ FixNVEDotcLangevin::FixNVEDotcLangevin(LAMMPS *lmp, int narg, char **arg) : { if (narg != 9) error->all(FLERR,"Illegal fix nve/dotc/langevin command"); - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix nve/dotc/langevin period must be > 0.0"); gamma = 1.0/t_period; - seed = force->inumeric(FLERR,arg[6]); + seed = utils::inumeric(FLERR,arg[6],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix nve/dotc/langevin command"); if (strcmp(arg[7],"angmom") == 0) { @@ -56,7 +57,7 @@ FixNVEDotcLangevin::FixNVEDotcLangevin(LAMMPS *lmp, int narg, char **arg) : Gamma = 0.0; } else { - ascale = force->numeric(FLERR,arg[8]); + ascale = utils::numeric(FLERR,arg[8],false,lmp); Gamma = gamma * ascale; } diff --git a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp index 51ff26cc6e..6ddf03518c 100644 --- a/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna2_coaxstk.cpp @@ -15,21 +15,20 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna2_coaxstk.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neigh_list.h" + #include #include -#include "mf_oxdna.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -555,8 +554,8 @@ void PairOxdna2Coaxstk::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // cross-stacking interaction count = 0; @@ -578,30 +577,30 @@ void PairOxdna2Coaxstk::coeff(int narg, char **arg) double AA_cxst1_one, BB_cxst1_one; - k_cxst_one = force->numeric(FLERR,arg[2]); - cut_cxst_0_one = force->numeric(FLERR,arg[3]); - cut_cxst_c_one = force->numeric(FLERR,arg[4]); - cut_cxst_lo_one = force->numeric(FLERR,arg[5]); - cut_cxst_hi_one = force->numeric(FLERR,arg[6]); + k_cxst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_cxst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_cxst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_cxst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_cxst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_cxst1_one = force->numeric(FLERR,arg[7]); - theta_cxst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_cxst1_ast_one = force->numeric(FLERR,arg[9]); + a_cxst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_cxst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_cxst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_cxst4_one = force->numeric(FLERR,arg[10]); - theta_cxst4_0_one = force->numeric(FLERR,arg[11]); - dtheta_cxst4_ast_one = force->numeric(FLERR,arg[12]); + a_cxst4_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_cxst4_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_cxst4_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_cxst5_one = force->numeric(FLERR,arg[13]); - theta_cxst5_0_one = force->numeric(FLERR,arg[14]); - dtheta_cxst5_ast_one = force->numeric(FLERR,arg[15]); + a_cxst5_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_cxst5_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_cxst5_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_cxst6_one = force->numeric(FLERR,arg[16]); - theta_cxst6_0_one = force->numeric(FLERR,arg[17]); - dtheta_cxst6_ast_one = force->numeric(FLERR,arg[18]); + a_cxst6_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_cxst6_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_cxst6_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - AA_cxst1_one = force->numeric(FLERR,arg[19]); - BB_cxst1_one = force->numeric(FLERR,arg[20]); + AA_cxst1_one = utils::numeric(FLERR,arg[19],false,lmp); + BB_cxst1_one = utils::numeric(FLERR,arg[20],false,lmp); b_cxst_lo_one = 0.25 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one)/ (0.5 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one) - @@ -816,47 +815,47 @@ void PairOxdna2Coaxstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&AA_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&BB_cxst1[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&AA_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&BB_cxst1[i][j],sizeof(double),1,fp,nullptr,error); } @@ -920,9 +919,9 @@ void PairOxdna2Coaxstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1024,5 +1023,5 @@ void *PairOxdna2Coaxstk::extract(const char *str, int &dim) if (strcmp(str,"AA_cxst1") == 0) return (void *) AA_cxst1; if (strcmp(str,"BB_cxst1") == 0) return (void *) BB_cxst1; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna2_dh.cpp b/src/USER-CGDNA/pair_oxdna2_dh.cpp index e698d8d906..1c4bd3bf09 100644 --- a/src/USER-CGDNA/pair_oxdna2_dh.cpp +++ b/src/USER-CGDNA/pair_oxdna2_dh.cpp @@ -15,19 +15,18 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna2_dh.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "neigh_list.h" + #include #include -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; @@ -277,16 +276,16 @@ void PairOxdna2Dh::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); count = 0; double T, rhos_dh_one, qeff_dh_one; - T = force->numeric(FLERR,arg[2]); - rhos_dh_one = force->numeric(FLERR,arg[3]); - qeff_dh_one = force->numeric(FLERR,arg[4]); + T = utils::numeric(FLERR,arg[2],false,lmp); + rhos_dh_one = utils::numeric(FLERR,arg[3],false,lmp); + qeff_dh_one = utils::numeric(FLERR,arg[4],false,lmp); double lambda_dh_one, kappa_dh_one, qeff_dh_pf_one; double b_dh_one, cut_dh_ast_one, cut_dh_c_one; @@ -438,16 +437,16 @@ void PairOxdna2Dh::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&kappa_dh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&qeff_dh_pf[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_dh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_dh_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_dh_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kappa_dh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&qeff_dh_pf[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_dh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_dh_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_dh_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -480,9 +479,9 @@ void PairOxdna2Dh::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -532,5 +531,5 @@ void *PairOxdna2Dh::extract(const char *str, int &dim) if (strcmp(str,"cut_dh_ast") == 0) return (void *) cut_dh_ast; if (strcmp(str,"cut_dh_c") == 0) return (void *) cut_dh_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp index 750c6c022d..3a1ee3d127 100644 --- a/src/USER-CGDNA/pair_oxdna_coaxstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_coaxstk.cpp @@ -15,21 +15,20 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna_coaxstk.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neigh_list.h" + #include #include -#include "mf_oxdna.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -685,8 +684,8 @@ void PairOxdnaCoaxstk::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // cross-stacking interaction count = 0; @@ -709,32 +708,32 @@ void PairOxdnaCoaxstk::coeff(int narg, char **arg) double a_cxst3p_one, cosphi_cxst3p_ast_one, b_cxst3p_one, cosphi_cxst3p_c_one; double a_cxst4p_one, cosphi_cxst4p_ast_one, b_cxst4p_one, cosphi_cxst4p_c_one; - k_cxst_one = force->numeric(FLERR,arg[2]); - cut_cxst_0_one = force->numeric(FLERR,arg[3]); - cut_cxst_c_one = force->numeric(FLERR,arg[4]); - cut_cxst_lo_one = force->numeric(FLERR,arg[5]); - cut_cxst_hi_one = force->numeric(FLERR,arg[6]); + k_cxst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_cxst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_cxst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_cxst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_cxst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_cxst1_one = force->numeric(FLERR,arg[7]); - theta_cxst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_cxst1_ast_one = force->numeric(FLERR,arg[9]); + a_cxst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_cxst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_cxst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_cxst4_one = force->numeric(FLERR,arg[10]); - theta_cxst4_0_one = force->numeric(FLERR,arg[11]); - dtheta_cxst4_ast_one = force->numeric(FLERR,arg[12]); + a_cxst4_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_cxst4_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_cxst4_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_cxst5_one = force->numeric(FLERR,arg[13]); - theta_cxst5_0_one = force->numeric(FLERR,arg[14]); - dtheta_cxst5_ast_one = force->numeric(FLERR,arg[15]); + a_cxst5_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_cxst5_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_cxst5_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_cxst6_one = force->numeric(FLERR,arg[16]); - theta_cxst6_0_one = force->numeric(FLERR,arg[17]); - dtheta_cxst6_ast_one = force->numeric(FLERR,arg[18]); + a_cxst6_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_cxst6_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_cxst6_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - a_cxst3p_one = force->numeric(FLERR,arg[19]); - cosphi_cxst3p_ast_one = force->numeric(FLERR,arg[20]); - a_cxst4p_one = force->numeric(FLERR,arg[21]); - cosphi_cxst4p_ast_one = force->numeric(FLERR,arg[22]); + a_cxst3p_one = utils::numeric(FLERR,arg[19],false,lmp); + cosphi_cxst3p_ast_one = utils::numeric(FLERR,arg[20],false,lmp); + a_cxst4p_one = utils::numeric(FLERR,arg[21],false,lmp); + cosphi_cxst4p_ast_one = utils::numeric(FLERR,arg[22],false,lmp); b_cxst_lo_one = 0.25 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one)/ (0.5 * (cut_cxst_lo_one - cut_cxst_0_one) * (cut_cxst_lo_one - cut_cxst_0_one) - @@ -975,53 +974,53 @@ void PairOxdnaCoaxstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_cxst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_cxst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst_hi[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst1_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst4_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst5_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_cxst6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_cxst6_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_cxst3p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst3p_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst3p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst3p_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_cxst4p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst4p_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_cxst4p[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_cxst4p_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_cxst3p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst3p_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst3p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst3p_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_cxst4p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst4p_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_cxst4p[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_cxst4p_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1091,9 +1090,9 @@ void PairOxdnaCoaxstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1206,5 +1205,5 @@ void *PairOxdnaCoaxstk::extract(const char *str, int &dim) if (strcmp(str,"b_cxst4p") == 0) return (void *) b_cxst4p; if (strcmp(str,"cosphi_cxst4p_c") == 0) return (void *) cosphi_cxst4p_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_excv.cpp b/src/USER-CGDNA/pair_oxdna_excv.cpp index e8e2fad020..64881cae22 100644 --- a/src/USER-CGDNA/pair_oxdna_excv.cpp +++ b/src/USER-CGDNA/pair_oxdna_excv.cpp @@ -15,20 +15,19 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna_excv.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neigh_list.h" + #include #include -#include "mf_oxdna.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; using namespace MFOxdna; @@ -455,8 +454,8 @@ void PairOxdnaExcv::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); count = 0; @@ -471,9 +470,9 @@ void PairOxdnaExcv::coeff(int narg, char **arg) // Excluded volume interaction // LJ parameters - epsilon_ss_one = force->numeric(FLERR,arg[2]); - sigma_ss_one = force->numeric(FLERR,arg[3]); - cut_ss_ast_one = force->numeric(FLERR,arg[4]); + epsilon_ss_one = utils::numeric(FLERR,arg[2],false,lmp); + sigma_ss_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_ss_ast_one = utils::numeric(FLERR,arg[4],false,lmp); // smoothing - determined through continuity and differentiability b_ss_one = 4.0/sigma_ss_one @@ -502,9 +501,9 @@ void PairOxdnaExcv::coeff(int narg, char **arg) count = 0; // LJ parameters - epsilon_sb_one = force->numeric(FLERR,arg[5]); - sigma_sb_one = force->numeric(FLERR,arg[6]); - cut_sb_ast_one = force->numeric(FLERR,arg[7]); + epsilon_sb_one = utils::numeric(FLERR,arg[5],false,lmp); + sigma_sb_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_sb_ast_one = utils::numeric(FLERR,arg[7],false,lmp); // smoothing - determined through continuity and differentiability b_sb_one = 4.0/sigma_sb_one @@ -533,9 +532,9 @@ void PairOxdnaExcv::coeff(int narg, char **arg) count = 0; // LJ parameters - epsilon_bb_one = force->numeric(FLERR,arg[8]); - sigma_bb_one = force->numeric(FLERR,arg[9]); - cut_bb_ast_one = force->numeric(FLERR,arg[10]); + epsilon_bb_one = utils::numeric(FLERR,arg[8],false,lmp); + sigma_bb_one = utils::numeric(FLERR,arg[9],false,lmp); + cut_bb_ast_one = utils::numeric(FLERR,arg[10],false,lmp); // smoothing - determined through continuity and differentiability b_bb_one = 4.0/sigma_bb_one @@ -697,26 +696,26 @@ void PairOxdnaExcv::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_ss_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_ss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_ss_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_sb_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_sb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_sb_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_bb_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_bb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_bb_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_ss_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_ss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_ss_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_sb_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_sb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_sb_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_bb_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_bb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_bb_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -759,9 +758,9 @@ void PairOxdnaExcv::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -825,5 +824,5 @@ void *PairOxdnaExcv::extract(const char *str, int &dim) if (strcmp(str,"b_bb") == 0) return (void *) b_bb; if (strcmp(str,"cut_bb_c") == 0) return (void *) cut_bb_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_hbond.cpp b/src/USER-CGDNA/pair_oxdna_hbond.cpp index 26042339ea..009b967173 100644 --- a/src/USER-CGDNA/pair_oxdna_hbond.cpp +++ b/src/USER-CGDNA/pair_oxdna_hbond.cpp @@ -15,20 +15,19 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna_hbond.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neigh_list.h" + #include #include -#include "mf_oxdna.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; using namespace MFOxdna; @@ -634,8 +633,8 @@ void PairOxdnaHbond::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi,imod4,jmod4; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // h-bonding interaction count = 0; @@ -667,36 +666,36 @@ void PairOxdnaHbond::coeff(int narg, char **arg) if (strcmp(arg[2],"seqav") == 0) seqdepflag = 0; if (strcmp(arg[2],"seqdep") == 0) seqdepflag = 1; - epsilon_hb_one = force->numeric(FLERR,arg[3]); - a_hb_one = force->numeric(FLERR,arg[4]); - cut_hb_0_one = force->numeric(FLERR,arg[5]); - cut_hb_c_one = force->numeric(FLERR,arg[6]); - cut_hb_lo_one = force->numeric(FLERR,arg[7]); - cut_hb_hi_one = force->numeric(FLERR,arg[8]); + epsilon_hb_one = utils::numeric(FLERR,arg[3],false,lmp); + a_hb_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_hb_0_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_hb_c_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_hb_lo_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_hb_hi_one = utils::numeric(FLERR,arg[8],false,lmp); - a_hb1_one = force->numeric(FLERR,arg[9]); - theta_hb1_0_one = force->numeric(FLERR,arg[10]); - dtheta_hb1_ast_one = force->numeric(FLERR,arg[11]); + a_hb1_one = utils::numeric(FLERR,arg[9],false,lmp); + theta_hb1_0_one = utils::numeric(FLERR,arg[10],false,lmp); + dtheta_hb1_ast_one = utils::numeric(FLERR,arg[11],false,lmp); - a_hb2_one = force->numeric(FLERR,arg[12]); - theta_hb2_0_one = force->numeric(FLERR,arg[13]); - dtheta_hb2_ast_one = force->numeric(FLERR,arg[14]); + a_hb2_one = utils::numeric(FLERR,arg[12],false,lmp); + theta_hb2_0_one = utils::numeric(FLERR,arg[13],false,lmp); + dtheta_hb2_ast_one = utils::numeric(FLERR,arg[14],false,lmp); - a_hb3_one = force->numeric(FLERR,arg[15]); - theta_hb3_0_one = force->numeric(FLERR,arg[16]); - dtheta_hb3_ast_one = force->numeric(FLERR,arg[17]); + a_hb3_one = utils::numeric(FLERR,arg[15],false,lmp); + theta_hb3_0_one = utils::numeric(FLERR,arg[16],false,lmp); + dtheta_hb3_ast_one = utils::numeric(FLERR,arg[17],false,lmp); - a_hb4_one = force->numeric(FLERR,arg[18]); - theta_hb4_0_one = force->numeric(FLERR,arg[19]); - dtheta_hb4_ast_one = force->numeric(FLERR,arg[20]); + a_hb4_one = utils::numeric(FLERR,arg[18],false,lmp); + theta_hb4_0_one = utils::numeric(FLERR,arg[19],false,lmp); + dtheta_hb4_ast_one = utils::numeric(FLERR,arg[20],false,lmp); - a_hb7_one = force->numeric(FLERR,arg[21]); - theta_hb7_0_one = force->numeric(FLERR,arg[22]); - dtheta_hb7_ast_one = force->numeric(FLERR,arg[23]); + a_hb7_one = utils::numeric(FLERR,arg[21],false,lmp); + theta_hb7_0_one = utils::numeric(FLERR,arg[22],false,lmp); + dtheta_hb7_ast_one = utils::numeric(FLERR,arg[23],false,lmp); - a_hb8_one = force->numeric(FLERR,arg[24]); - theta_hb8_0_one = force->numeric(FLERR,arg[25]); - dtheta_hb8_ast_one = force->numeric(FLERR,arg[26]); + a_hb8_one = utils::numeric(FLERR,arg[24],false,lmp); + theta_hb8_0_one = utils::numeric(FLERR,arg[25],false,lmp); + dtheta_hb8_ast_one = utils::numeric(FLERR,arg[26],false,lmp); b_hb_lo_one = 2*a_hb_one*exp(-a_hb_one*(cut_hb_lo_one-cut_hb_0_one))* 2*a_hb_one*exp(-a_hb_one*(cut_hb_lo_one-cut_hb_0_one))* @@ -987,58 +986,58 @@ void PairOxdnaHbond::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_hb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_hb[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_hb_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_hb[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_hb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_hb[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_hb_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_hb[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_hb1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb1_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_hb1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb1_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_hb2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_hb2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb2_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_hb3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb3_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_hb3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb3_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_hb4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb4_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_hb4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb4_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_hb7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb7_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_hb7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb7_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_hb8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_hb8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_hb8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_hb8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_hb8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_hb8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_hb8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_hb8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1113,9 +1112,9 @@ void PairOxdnaHbond::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1233,5 +1232,5 @@ void *PairOxdnaHbond::extract(const char *str, int &dim) if (strcmp(str,"b_hb8") == 0) return (void *) b_hb8; if (strcmp(str,"dtheta_hb8_c") == 0) return (void *) dtheta_hb8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_stk.cpp b/src/USER-CGDNA/pair_oxdna_stk.cpp index 4d1c4a7101..87b22f4468 100644 --- a/src/USER-CGDNA/pair_oxdna_stk.cpp +++ b/src/USER-CGDNA/pair_oxdna_stk.cpp @@ -15,7 +15,7 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna_stk.h" -#include + #include #include #include @@ -26,7 +26,7 @@ #include "neighbor.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "atom_vec_ellipsoid.h" #include "math_extra.h" @@ -779,8 +779,8 @@ void PairOxdnaStk::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi,imod4,jmod4; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // stacking interaction count = 0; @@ -807,30 +807,30 @@ void PairOxdnaStk::coeff(int narg, char **arg) if (strcmp(arg[2],"seqav") == 0) seqdepflag = 0; if (strcmp(arg[2],"seqdep") == 0) seqdepflag = 1; - T = force->numeric(FLERR,arg[3]); - xi_st_one = force->numeric(FLERR,arg[4]); - kappa_st_one = force->numeric(FLERR,arg[5]); + T = utils::numeric(FLERR,arg[3],false,lmp); + xi_st_one = utils::numeric(FLERR,arg[4],false,lmp); + kappa_st_one = utils::numeric(FLERR,arg[5],false,lmp); epsilon_st_one = stacking_strength(xi_st_one, kappa_st_one, T); - a_st_one = force->numeric(FLERR,arg[6]); - cut_st_0_one = force->numeric(FLERR,arg[7]); - cut_st_c_one = force->numeric(FLERR,arg[8]); - cut_st_lo_one = force->numeric(FLERR,arg[9]); - cut_st_hi_one = force->numeric(FLERR,arg[10]); + a_st_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_st_0_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_st_c_one = utils::numeric(FLERR,arg[8],false,lmp); + cut_st_lo_one = utils::numeric(FLERR,arg[9],false,lmp); + cut_st_hi_one = utils::numeric(FLERR,arg[10],false,lmp); - a_st4_one = force->numeric(FLERR,arg[11]); - theta_st4_0_one = force->numeric(FLERR,arg[12]); - dtheta_st4_ast_one = force->numeric(FLERR,arg[13]); - a_st5_one = force->numeric(FLERR,arg[14]); - theta_st5_0_one = force->numeric(FLERR,arg[15]); - dtheta_st5_ast_one = force->numeric(FLERR,arg[16]); - a_st6_one = force->numeric(FLERR,arg[17]); - theta_st6_0_one = force->numeric(FLERR,arg[18]); - dtheta_st6_ast_one = force->numeric(FLERR,arg[19]); - a_st1_one = force->numeric(FLERR,arg[20]); - cosphi_st1_ast_one = force->numeric(FLERR,arg[21]); - a_st2_one = force->numeric(FLERR,arg[22]); - cosphi_st2_ast_one = force->numeric(FLERR,arg[23]); + a_st4_one = utils::numeric(FLERR,arg[11],false,lmp); + theta_st4_0_one = utils::numeric(FLERR,arg[12],false,lmp); + dtheta_st4_ast_one = utils::numeric(FLERR,arg[13],false,lmp); + a_st5_one = utils::numeric(FLERR,arg[14],false,lmp); + theta_st5_0_one = utils::numeric(FLERR,arg[15],false,lmp); + dtheta_st5_ast_one = utils::numeric(FLERR,arg[16],false,lmp); + a_st6_one = utils::numeric(FLERR,arg[17],false,lmp); + theta_st6_0_one = utils::numeric(FLERR,arg[18],false,lmp); + dtheta_st6_ast_one = utils::numeric(FLERR,arg[19],false,lmp); + a_st1_one = utils::numeric(FLERR,arg[20],false,lmp); + cosphi_st1_ast_one = utils::numeric(FLERR,arg[21],false,lmp); + a_st2_one = utils::numeric(FLERR,arg[22],false,lmp); + cosphi_st2_ast_one = utils::numeric(FLERR,arg[23],false,lmp); b_st_lo_one = 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* @@ -1094,49 +1094,49 @@ void PairOxdnaStk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st4_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st4_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1202,9 +1202,9 @@ void PairOxdnaStk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1308,5 +1308,5 @@ void *PairOxdnaStk::extract(const char *str, int &dim) if (strcmp(str,"b_st2") == 0) return (void *) b_st2; if (strcmp(str,"cosphi_st2_c") == 0) return (void *) cosphi_st2_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxdna_xstk.cpp b/src/USER-CGDNA/pair_oxdna_xstk.cpp index a1fc86bd4d..29c78c103a 100644 --- a/src/USER-CGDNA/pair_oxdna_xstk.cpp +++ b/src/USER-CGDNA/pair_oxdna_xstk.cpp @@ -15,21 +15,20 @@ ------------------------------------------------------------------------- */ #include "pair_oxdna_xstk.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neigh_list.h" + #include #include -#include "mf_oxdna.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -630,8 +629,8 @@ void PairOxdnaXstk::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // cross-stacking interaction count = 0; @@ -657,35 +656,35 @@ void PairOxdnaXstk::coeff(int narg, char **arg) double a_xst8_one, theta_xst8_0_one, dtheta_xst8_ast_one; double b_xst8_one, dtheta_xst8_c_one; - k_xst_one = force->numeric(FLERR,arg[2]); - cut_xst_0_one = force->numeric(FLERR,arg[3]); - cut_xst_c_one = force->numeric(FLERR,arg[4]); - cut_xst_lo_one = force->numeric(FLERR,arg[5]); - cut_xst_hi_one = force->numeric(FLERR,arg[6]); + k_xst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_xst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_xst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_xst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_xst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_xst1_one = force->numeric(FLERR,arg[7]); - theta_xst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_xst1_ast_one = force->numeric(FLERR,arg[9]); + a_xst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_xst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_xst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_xst2_one = force->numeric(FLERR,arg[10]); - theta_xst2_0_one = force->numeric(FLERR,arg[11]); - dtheta_xst2_ast_one = force->numeric(FLERR,arg[12]); + a_xst2_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_xst2_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_xst2_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_xst3_one = force->numeric(FLERR,arg[13]); - theta_xst3_0_one = force->numeric(FLERR,arg[14]); - dtheta_xst3_ast_one = force->numeric(FLERR,arg[15]); + a_xst3_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_xst3_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_xst3_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_xst4_one = force->numeric(FLERR,arg[16]); - theta_xst4_0_one = force->numeric(FLERR,arg[17]); - dtheta_xst4_ast_one = force->numeric(FLERR,arg[18]); + a_xst4_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_xst4_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_xst4_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - a_xst7_one = force->numeric(FLERR,arg[19]); - theta_xst7_0_one = force->numeric(FLERR,arg[20]); - dtheta_xst7_ast_one = force->numeric(FLERR,arg[21]); + a_xst7_one = utils::numeric(FLERR,arg[19],false,lmp); + theta_xst7_0_one = utils::numeric(FLERR,arg[20],false,lmp); + dtheta_xst7_ast_one = utils::numeric(FLERR,arg[21],false,lmp); - a_xst8_one = force->numeric(FLERR,arg[22]); - theta_xst8_0_one = force->numeric(FLERR,arg[23]); - dtheta_xst8_ast_one = force->numeric(FLERR,arg[24]); + a_xst8_one = utils::numeric(FLERR,arg[22],false,lmp); + theta_xst8_0_one = utils::numeric(FLERR,arg[23],false,lmp); + dtheta_xst8_ast_one = utils::numeric(FLERR,arg[24],false,lmp); b_xst_lo_one = 0.25 * (cut_xst_lo_one - cut_xst_0_one) * (cut_xst_lo_one - cut_xst_0_one)/ @@ -934,56 +933,56 @@ void PairOxdnaXstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst4_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst4_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst4_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst4_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst4_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst4_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1056,9 +1055,9 @@ void PairOxdnaXstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1174,5 +1173,5 @@ void *PairOxdnaXstk::extract(const char *str, int &dim) if (strcmp(str,"b_xst8") == 0) return (void *) b_xst8; if (strcmp(str,"dtheta_xst8_c") == 0) return (void *) dtheta_xst8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxrna2_excv.cpp b/src/USER-CGDNA/pair_oxrna2_excv.cpp index 3c0194d636..af9fdaaaa1 100644 --- a/src/USER-CGDNA/pair_oxrna2_excv.cpp +++ b/src/USER-CGDNA/pair_oxrna2_excv.cpp @@ -14,12 +14,10 @@ Contributing author: Oliver Henrich (University of Strathclyde, Glasgow) ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_oxrna2_excv.h" +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGDNA/pair_oxrna2_stk.cpp b/src/USER-CGDNA/pair_oxrna2_stk.cpp index de2cd63799..fff552908e 100644 --- a/src/USER-CGDNA/pair_oxrna2_stk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_stk.cpp @@ -14,26 +14,22 @@ Contributing author: Oliver Henrich (University of Strathclyde, Glasgow) ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_oxrna2_stk.h" -#include "mf_oxdna.h" + #include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "update.h" -#include "integrate.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "utils.h" #include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" #include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neighbor.h" + +#include +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -863,8 +859,8 @@ void PairOxrna2Stk::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // stacking interaction count = 0; @@ -894,35 +890,35 @@ void PairOxrna2Stk::coeff(int narg, char **arg) if (strcmp(arg[2],"seqav") == 0) seqdepflag = 0; if (strcmp(arg[2],"seqdep") == 0) seqdepflag = 1; - T = force->numeric(FLERR,arg[3]); - xi_st_one = force->numeric(FLERR,arg[4]); - kappa_st_one = force->numeric(FLERR,arg[5]); + T = utils::numeric(FLERR,arg[3],false,lmp); + xi_st_one = utils::numeric(FLERR,arg[4],false,lmp); + kappa_st_one = utils::numeric(FLERR,arg[5],false,lmp); epsilon_st_one = stacking_strength(xi_st_one, kappa_st_one, T); - a_st_one = force->numeric(FLERR,arg[6]); - cut_st_0_one = force->numeric(FLERR,arg[7]); - cut_st_c_one = force->numeric(FLERR,arg[8]); - cut_st_lo_one = force->numeric(FLERR,arg[9]); - cut_st_hi_one = force->numeric(FLERR,arg[10]); + a_st_one = utils::numeric(FLERR,arg[6],false,lmp); + cut_st_0_one = utils::numeric(FLERR,arg[7],false,lmp); + cut_st_c_one = utils::numeric(FLERR,arg[8],false,lmp); + cut_st_lo_one = utils::numeric(FLERR,arg[9],false,lmp); + cut_st_hi_one = utils::numeric(FLERR,arg[10],false,lmp); - a_st5_one = force->numeric(FLERR,arg[11]); - theta_st5_0_one = force->numeric(FLERR,arg[12]); - dtheta_st5_ast_one = force->numeric(FLERR,arg[13]); - a_st6_one = force->numeric(FLERR,arg[14]); - theta_st6_0_one = force->numeric(FLERR,arg[15]); - dtheta_st6_ast_one = force->numeric(FLERR,arg[16]); + a_st5_one = utils::numeric(FLERR,arg[11],false,lmp); + theta_st5_0_one = utils::numeric(FLERR,arg[12],false,lmp); + dtheta_st5_ast_one = utils::numeric(FLERR,arg[13],false,lmp); + a_st6_one = utils::numeric(FLERR,arg[14],false,lmp); + theta_st6_0_one = utils::numeric(FLERR,arg[15],false,lmp); + dtheta_st6_ast_one = utils::numeric(FLERR,arg[16],false,lmp); - a_st9_one = force->numeric(FLERR,arg[17]); - theta_st9_0_one = force->numeric(FLERR,arg[18]); - dtheta_st9_ast_one = force->numeric(FLERR,arg[19]); - a_st10_one = force->numeric(FLERR,arg[20]); - theta_st10_0_one = force->numeric(FLERR,arg[21]); - dtheta_st10_ast_one = force->numeric(FLERR,arg[22]); + a_st9_one = utils::numeric(FLERR,arg[17],false,lmp); + theta_st9_0_one = utils::numeric(FLERR,arg[18],false,lmp); + dtheta_st9_ast_one = utils::numeric(FLERR,arg[19],false,lmp); + a_st10_one = utils::numeric(FLERR,arg[20],false,lmp); + theta_st10_0_one = utils::numeric(FLERR,arg[21],false,lmp); + dtheta_st10_ast_one = utils::numeric(FLERR,arg[22],false,lmp); - a_st1_one = force->numeric(FLERR,arg[23]); - cosphi_st1_ast_one = force->numeric(FLERR,arg[24]); - a_st2_one = force->numeric(FLERR,arg[25]); - cosphi_st2_ast_one = force->numeric(FLERR,arg[26]); + a_st1_one = utils::numeric(FLERR,arg[23],false,lmp); + cosphi_st1_ast_one = utils::numeric(FLERR,arg[24],false,lmp); + a_st2_one = utils::numeric(FLERR,arg[25],false,lmp); + cosphi_st2_ast_one = utils::numeric(FLERR,arg[26],false,lmp); b_st_lo_one = 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* 2*a_st_one*exp(-a_st_one*(cut_st_lo_one-cut_st_0_one))* @@ -1195,55 +1191,55 @@ void PairOxrna2Stk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_st_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_st[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st5_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st5[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st5_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st6_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st6[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st6_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st9[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st9_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st9_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st9[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st9_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st9[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st9_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st9_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st9[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st9_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st10[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_st10_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st10_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st10[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_st10_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st10[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_st10_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st10_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st10[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_st10_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st1_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&a_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_st2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cosphi_st2_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -1315,9 +1311,9 @@ void PairOxrna2Stk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1431,5 +1427,5 @@ void *PairOxrna2Stk::extract(const char *str, int &dim) if (strcmp(str,"b_st2") == 0) return (void *) b_st2; if (strcmp(str,"cosphi_st2_c") == 0) return (void *) cosphi_st2_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGDNA/pair_oxrna2_xstk.cpp b/src/USER-CGDNA/pair_oxrna2_xstk.cpp index 73a73c1ea0..9fe4bebab8 100644 --- a/src/USER-CGDNA/pair_oxrna2_xstk.cpp +++ b/src/USER-CGDNA/pair_oxrna2_xstk.cpp @@ -15,21 +15,20 @@ ------------------------------------------------------------------------- */ #include "pair_oxrna2_xstk.h" -#include + +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" +#include "mf_oxdna.h" +#include "neigh_list.h" + #include #include -#include "mf_oxdna.h" -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "math_const.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "atom_vec_ellipsoid.h" -#include "math_extra.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -580,8 +579,8 @@ void PairOxrna2Xstk::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // cross-stacking interaction count = 0; @@ -604,31 +603,31 @@ void PairOxrna2Xstk::coeff(int narg, char **arg) double a_xst8_one, theta_xst8_0_one, dtheta_xst8_ast_one; double b_xst8_one, dtheta_xst8_c_one; - k_xst_one = force->numeric(FLERR,arg[2]); - cut_xst_0_one = force->numeric(FLERR,arg[3]); - cut_xst_c_one = force->numeric(FLERR,arg[4]); - cut_xst_lo_one = force->numeric(FLERR,arg[5]); - cut_xst_hi_one = force->numeric(FLERR,arg[6]); + k_xst_one = utils::numeric(FLERR,arg[2],false,lmp); + cut_xst_0_one = utils::numeric(FLERR,arg[3],false,lmp); + cut_xst_c_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_xst_lo_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_xst_hi_one = utils::numeric(FLERR,arg[6],false,lmp); - a_xst1_one = force->numeric(FLERR,arg[7]); - theta_xst1_0_one = force->numeric(FLERR,arg[8]); - dtheta_xst1_ast_one = force->numeric(FLERR,arg[9]); + a_xst1_one = utils::numeric(FLERR,arg[7],false,lmp); + theta_xst1_0_one = utils::numeric(FLERR,arg[8],false,lmp); + dtheta_xst1_ast_one = utils::numeric(FLERR,arg[9],false,lmp); - a_xst2_one = force->numeric(FLERR,arg[10]); - theta_xst2_0_one = force->numeric(FLERR,arg[11]); - dtheta_xst2_ast_one = force->numeric(FLERR,arg[12]); + a_xst2_one = utils::numeric(FLERR,arg[10],false,lmp); + theta_xst2_0_one = utils::numeric(FLERR,arg[11],false,lmp); + dtheta_xst2_ast_one = utils::numeric(FLERR,arg[12],false,lmp); - a_xst3_one = force->numeric(FLERR,arg[13]); - theta_xst3_0_one = force->numeric(FLERR,arg[14]); - dtheta_xst3_ast_one = force->numeric(FLERR,arg[15]); + a_xst3_one = utils::numeric(FLERR,arg[13],false,lmp); + theta_xst3_0_one = utils::numeric(FLERR,arg[14],false,lmp); + dtheta_xst3_ast_one = utils::numeric(FLERR,arg[15],false,lmp); - a_xst7_one = force->numeric(FLERR,arg[16]); - theta_xst7_0_one = force->numeric(FLERR,arg[17]); - dtheta_xst7_ast_one = force->numeric(FLERR,arg[18]); + a_xst7_one = utils::numeric(FLERR,arg[16],false,lmp); + theta_xst7_0_one = utils::numeric(FLERR,arg[17],false,lmp); + dtheta_xst7_ast_one = utils::numeric(FLERR,arg[18],false,lmp); - a_xst8_one = force->numeric(FLERR,arg[19]); - theta_xst8_0_one = force->numeric(FLERR,arg[20]); - dtheta_xst8_ast_one = force->numeric(FLERR,arg[21]); + a_xst8_one = utils::numeric(FLERR,arg[19],false,lmp); + theta_xst8_0_one = utils::numeric(FLERR,arg[20],false,lmp); + dtheta_xst8_ast_one = utils::numeric(FLERR,arg[21],false,lmp); b_xst_lo_one = 0.25 * (cut_xst_lo_one - cut_xst_0_one) * (cut_xst_lo_one - cut_xst_0_one)/ @@ -856,50 +855,50 @@ void PairOxrna2Xstk::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&k_xst[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_lc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_xst_hc[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_lo[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst_hi[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst1_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst1_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst2_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst2_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst3_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst3_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst7_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst7[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst7_c[i][j],sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&theta_xst8_0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_ast[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b_xst8[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dtheta_xst8_c[i][j],sizeof(double),1,fp,nullptr,error); } @@ -966,9 +965,9 @@ void PairOxrna2Xstk::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&offset_flag,1,MPI_INT,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -1074,5 +1073,5 @@ void *PairOxrna2Xstk::extract(const char *str, int &dim) if (strcmp(str,"b_xst8") == 0) return (void *) b_xst8; if (strcmp(str,"dtheta_xst8_c") == 0) return (void *) dtheta_xst8_c; - return NULL; + return nullptr; } diff --git a/src/USER-CGSDK/angle_sdk.cpp b/src/USER-CGSDK/angle_sdk.cpp index 11b3a8308c..bdcb03c3c3 100644 --- a/src/USER-CGSDK/angle_sdk.cpp +++ b/src/USER-CGSDK/angle_sdk.cpp @@ -19,7 +19,7 @@ ------------------------------------------------------------------------- */ #include "angle_sdk.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -30,7 +30,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "lj_sdk_common.h" @@ -241,10 +241,10 @@ void AngleSDK::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); double repscale_one=1.0; // backward compatibility with old cg/cmm style input: @@ -253,9 +253,9 @@ void AngleSDK::coeff(int narg, char **arg) // otherwise assume repscale 1.0, since we were using // epsilon to turn repulsion on or off. if (narg == 6) { - repscale_one = force->numeric(FLERR,arg[4]); + repscale_one = utils::numeric(FLERR,arg[4],false,lmp); if (repscale_one > 0.0) repscale_one = 1.0; - } else if (narg == 4) repscale_one = force->numeric(FLERR,arg[3]); + } else if (narg == 4) repscale_one = utils::numeric(FLERR,arg[3],false,lmp); else if (narg == 3) repscale_one = 1.0; else error->all(FLERR,"Incorrect args for angle coefficients"); @@ -290,7 +290,7 @@ void AngleSDK::init_style() if (repflag) { int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Angle style SDK requires use of a compatible with Pair style"); lj1 = (double **) force->pair->extract("lj1",itmp); @@ -333,9 +333,9 @@ void AngleSDK::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&repscale[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&repscale[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-CGSDK/pair_lj_sdk.cpp b/src/USER-CGSDK/pair_lj_sdk.cpp index 3e4f8deee8..6c3e15089f 100644 --- a/src/USER-CGSDK/pair_lj_sdk.cpp +++ b/src/USER-CGSDK/pair_lj_sdk.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_sdk.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #define LMP_NEED_SDK_FIND_LJ_TYPE 1 #include "lj_sdk_common.h" @@ -234,7 +234,7 @@ void PairLJSDK::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -256,18 +256,18 @@ void PairLJSDK::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int lj_type_one = find_lj_type(arg[2],lj_type_list); if (lj_type_one == LJ_NOT_SET) error->all(FLERR,"Cannot parse LJ type flag."); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -374,14 +374,14 @@ void PairLJSDK::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world); MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); @@ -411,10 +411,10 @@ void PairLJSDK::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -484,7 +484,7 @@ void *PairLJSDK::extract(const char *str, int &dim) if (strcmp(str,"lj4") == 0) return (void *) lj4; if (strcmp(str,"rminsq") == 0) return (void *) rminsq; if (strcmp(str,"emin") == 0) return (void *) emin; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGSDK/pair_lj_sdk.h b/src/USER-CGSDK/pair_lj_sdk.h index ef0263c06b..11c123a72c 100644 --- a/src/USER-CGSDK/pair_lj_sdk.h +++ b/src/USER-CGSDK/pair_lj_sdk.h @@ -27,7 +27,6 @@ PairStyle(lj/sdk,PairLJSDK) #include "pair.h" namespace LAMMPS_NS { -class LAMMPS; class PairLJSDK : public Pair { public: diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp index 7e5852f367..2e21bdd102 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_long.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_sdk_coul_long.h" -#include + #include #include #include "atom.h" @@ -28,7 +28,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #define LMP_NEED_SDK_FIND_LJ_TYPE 1 #include "lj_sdk_common.h" @@ -51,7 +51,7 @@ PairLJSDKCoulLong::PairLJSDKCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 0; writedata = 1; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -293,9 +293,9 @@ void PairLJSDKCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -318,18 +318,18 @@ void PairLJSDKCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int lj_type_one = find_lj_type(arg[2],lj_type_list); if (lj_type_one == LJ_NOT_SET) error->all(FLERR,"Cannot parse LJ type flag."); - double epsilon_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -361,13 +361,13 @@ void PairLJSDKCoulLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables (no rRESPA support yet) - if (ncoultablebits) init_tables(cut_coul,NULL); + if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -466,14 +466,14 @@ void PairLJSDKCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lj_type[i][j],sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lj_type[i][j],1,MPI_INT,0,world); MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); @@ -505,13 +505,13 @@ void PairLJSDKCoulLong::write_restart_settings(FILE *fp) void PairLJSDKCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -643,7 +643,7 @@ void *PairLJSDKCoulLong::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp index 8aa16b4adb..9818b7c51c 100644 --- a/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp +++ b/src/USER-CGSDK/pair_lj_sdk_coul_msm.cpp @@ -37,7 +37,7 @@ PairLJSDKCoulMSM::PairLJSDKCoulMSM(LAMMPS *lmp) : PairLJSDKCoulLong(lmp) ewaldflag = pppmflag = 0; msmflag = 1; respa_enable = 0; - ftable = NULL; + ftable = nullptr; } /* ---------------------------------------------------------------------- */ @@ -308,6 +308,6 @@ void *PairLJSDKCoulMSM::extract(const char *str, int &dim) dim = 0; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"cut_msm") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/USER-COLVARS/colvarproxy_lammps.cpp b/src/USER-COLVARS/colvarproxy_lammps.cpp index dabb0bf923..44b0b8b5ed 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.cpp +++ b/src/USER-COLVARS/colvarproxy_lammps.cpp @@ -71,11 +71,9 @@ colvarproxy_lammps::colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, _random = new LAMMPS_NS::RanPark(lmp,seed); first_timestep=true; - total_force_requested=false; previous_step=-1; t_target=temp; do_exit=false; - restart_every=0; // User-scripted forces are not available in LAMMPS force_script_defined = false; @@ -94,15 +92,17 @@ colvarproxy_lammps::colvarproxy_lammps(LAMMPS_NS::LAMMPS *lmp, // check if it is possible to save output configuration if ((!output_prefix_str.size()) && (!restart_output_prefix_str.size())) { - fatal_error("Error: neither the final output state file or " - "the output restart file could be defined, exiting.\n"); + error("Error: neither the final output state file or " + "the output restart file could be defined, exiting.\n"); } // try to extract a restart prefix from a potential restart command. LAMMPS_NS::Output *outp = _lmp->output; if ((outp->restart_every_single > 0) && (outp->restart1 != 0)) { - restart_output_prefix_str = std::string(outp->restart1); + restart_frequency_engine = outp->restart_every_single; + restart_output_prefix_str = std::string(outp->restart1); } else if ((outp->restart_every_double > 0) && (outp->restart2a != 0)) { + restart_frequency_engine = outp->restart_every_double; restart_output_prefix_str = std::string(outp->restart2a); } // trim off unwanted stuff from the restart prefix @@ -179,9 +179,9 @@ int colvarproxy_lammps::read_state_file(char const *state_filename) colvarproxy_lammps::~colvarproxy_lammps() { delete _random; - if (colvars != NULL) { + if (colvars != nullptr) { delete colvars; - colvars = NULL; + colvars = nullptr; } } @@ -207,12 +207,18 @@ double colvarproxy_lammps::compute() first_timestep = false; } else { // Use the time step number from LAMMPS Update object - if ( _lmp->update->ntimestep - previous_step == 1 ) + if ( _lmp->update->ntimestep - previous_step == 1 ) { colvars->it++; - // Other cases could mean: - // - run 0 - // - beginning of a new run statement - // then the internal counter should not be incremented + b_simulation_continuing = false; + } else { + // Cases covered by this condition: + // - run 0 + // - beginning of a new run statement + // The internal counter is not incremented, and the objects are made + // aware of this via the following flag + b_simulation_continuing = true; + } + } previous_step = _lmp->update->ntimestep; @@ -275,13 +281,6 @@ void colvarproxy_lammps::serialize_status(std::string &rst) rst = os.str(); } -void colvarproxy_lammps::write_output_files() -{ - // TODO skip output if undefined - colvars->write_restart_file(cvm::output_prefix()+".colvars.state"); - colvars->write_output_files(); -} - // set status from string bool colvarproxy_lammps::deserialize_status(std::string &rst) { @@ -322,13 +321,6 @@ void colvarproxy_lammps::log(std::string const &message) void colvarproxy_lammps::error(std::string const &message) -{ - // In LAMMPS, all errors are fatal - fatal_error(message); -} - - -void colvarproxy_lammps::fatal_error(std::string const &message) { log(message); _lmp->error->one(FLERR, diff --git a/src/USER-COLVARS/colvarproxy_lammps.h b/src/USER-COLVARS/colvarproxy_lammps.h index 95e7d4fb32..aee268932e 100644 --- a/src/USER-COLVARS/colvarproxy_lammps.h +++ b/src/USER-COLVARS/colvarproxy_lammps.h @@ -41,11 +41,9 @@ class colvarproxy_lammps : public colvarproxy { // state of LAMMPS properties double t_target, my_timestep, my_boltzmann, my_angstrom; double bias_energy; - int restart_every; int previous_step; bool first_timestep; - bool total_force_requested; bool do_exit; std::vector atoms_types; @@ -59,7 +57,7 @@ class colvarproxy_lammps : public colvarproxy { const char *, const int, const double, MPI_Comm); virtual ~colvarproxy_lammps(); void init(const char*); - int setup(); + virtual int setup(); // disable default and copy constructor private: @@ -82,9 +80,6 @@ class colvarproxy_lammps : public colvarproxy { // set status from string bool deserialize_status(std::string &); - // Write files expected from Colvars (called by post_run()) - void write_output_files(); - // read additional config from file int add_config_file(char const *config_filename); @@ -103,14 +98,11 @@ class colvarproxy_lammps : public colvarproxy { inline cvm::real temperature() { return t_target; }; inline cvm::real dt() { return my_timestep; }; // return _lmp->update->dt * _lmp->force->femtosecond; }; - inline size_t restart_frequency() { return restart_every; }; - void add_energy(cvm::real energy) { bias_energy += energy; }; void request_total_force(bool yesno) { total_force_requested = yesno; }; void log(std::string const &message); void error(std::string const &message); - void fatal_error(std::string const &message); cvm::rvector position_distance(cvm::atom_pos const &pos1, cvm::atom_pos const &pos2) const; diff --git a/src/USER-COLVARS/colvarproxy_lammps_version.h b/src/USER-COLVARS/colvarproxy_lammps_version.h index 7f52fa5e01..d9f2955233 100644 --- a/src/USER-COLVARS/colvarproxy_lammps_version.h +++ b/src/USER-COLVARS/colvarproxy_lammps_version.h @@ -1,3 +1,3 @@ #ifndef COLVARPROXY_VERSION -#define COLVARPROXY_VERSION "2019-12-04" +#define COLVARPROXY_VERSION "2020-04-07" #endif diff --git a/src/USER-COLVARS/fix_colvars.cpp b/src/USER-COLVARS/fix_colvars.cpp index 7ce2a93680..6a86ae5959 100644 --- a/src/USER-COLVARS/fix_colvars.cpp +++ b/src/USER-COLVARS/fix_colvars.cpp @@ -25,29 +25,26 @@ ------------------------------------------------------------------------- */ #include "fix_colvars.h" -#include -#include -#include -#include -#include -#include -#include #include "atom.h" +#include "citeme.h" #include "comm.h" #include "domain.h" #include "error.h" -#include "force.h" #include "memory.h" #include "modify.h" #include "respa.h" #include "universe.h" #include "update.h" -#include "citeme.h" #include "colvarproxy_lammps.h" #include "colvarmodule.h" +#include +#include +#include +#include + static const char colvars_pub[] = "fix colvars command:\n\n" "@Article{fiorin13,\n" @@ -197,7 +194,7 @@ int inthash_lookup(void *ptr, int key) { /* find the entry in the hash table */ h=inthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -249,7 +246,7 @@ void inthash_destroy(inthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -257,7 +254,7 @@ void inthash_destroy(inthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(inthash_t)); } @@ -279,7 +276,7 @@ int FixColvars::instances=0; optional keyword value pairs: input (for restarting/continuing, defaults to - NULL, but set to at end) + nullptr, but set to at end) output (defaults to 'out') seed (seed for RNG, defaults to '1966') tstat (label of thermostatting fix) @@ -308,9 +305,9 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : rng_seed = 1966; unwrap_flag = 1; - inp_name = NULL; - out_name = NULL; - tmp_name = NULL; + inp_name = nullptr; + out_name = nullptr; + tmp_name = nullptr; /* parse optional arguments */ int argsdone = 4; @@ -324,7 +321,7 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : } else if (0 == strcmp(arg[argsdone], "output")) { out_name = strdup(arg[argsdone+1]); } else if (0 == strcmp(arg[argsdone], "seed")) { - rng_seed = force->inumeric(FLERR,arg[argsdone+1]); + rng_seed = utils::inumeric(FLERR,arg[argsdone+1],false,lmp); } else if (0 == strcmp(arg[argsdone], "unwrap")) { if (0 == strcmp(arg[argsdone+1], "yes")) { unwrap_flag = 1; @@ -349,10 +346,10 @@ FixColvars::FixColvars(LAMMPS *lmp, int narg, char **arg) : nlevels_respa = 0; init_flag = 0; num_coords = 0; - comm_buf = NULL; - force_buf = NULL; - proxy = NULL; - idmap = NULL; + comm_buf = nullptr; + force_buf = nullptr; + proxy = nullptr; + idmap = nullptr; /* storage required to communicate a single coordinate or force. */ size_one = sizeof(struct commdata); @@ -407,7 +404,7 @@ void FixColvars::init() if (atom->tag_enable == 0) error->all(FLERR,"Cannot use fix colvars without atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix colvars requires an atom map, see atom_modify"); if ((me == 0) && (update->whichflag == 2)) @@ -448,7 +445,7 @@ void FixColvars::one_time_init() if (inp_name) { if (strcmp(inp_name,"NULL") == 0) { memory->sfree(inp_name); - inp_name = NULL; + inp_name = nullptr; } } @@ -502,7 +499,7 @@ int FixColvars::modify_param(int narg, char **arg) if (me == 0) { if (! proxy) error->one(FLERR,"Cannot use fix_modify before initialization"); - return proxy->add_config_file(arg[1]) == COLVARS_OK ? 0 : 2; + return proxy->add_config_file(arg[1]) == COLVARS_OK ? 2 : 0; } return 2; } else if (strcmp(arg[0],"config") == 0) { @@ -511,7 +508,7 @@ int FixColvars::modify_param(int narg, char **arg) if (! proxy) error->one(FLERR,"Cannot use fix_modify before initialization"); std::string const conf(arg[1]); - return proxy->add_config_string(conf) == COLVARS_OK ? 0 : 2; + return proxy->add_config_string(conf) == COLVARS_OK ? 2 : 0; } return 2; } else if (strcmp(arg[0],"load") == 0) { @@ -519,7 +516,7 @@ int FixColvars::modify_param(int narg, char **arg) if (me == 0) { if (! proxy) error->one(FLERR,"Cannot use fix_modify before initialization"); - return proxy->read_state_file(arg[1]) == COLVARS_OK ? 0 : 2; + return proxy->read_state_file(arg[1]) == COLVARS_OK ? 2 : 0; } return 2; } @@ -964,7 +961,7 @@ void FixColvars::write_restart(FILE *fp) proxy->serialize_status(rest_text); // TODO call write_output_files() const char *cvm_state = rest_text.c_str(); - int len = strlen(cvm_state) + 1; // need to include terminating NULL byte. + int len = strlen(cvm_state) + 1; // need to include terminating null byte. fwrite(&len,sizeof(int),1,fp); fwrite(cvm_state,1,len,fp); } @@ -987,7 +984,7 @@ void FixColvars::restart(char *buf) void FixColvars::post_run() { if (me == 0) { - proxy->write_output_files(); + proxy->post_run(); } } diff --git a/src/USER-COLVARS/fix_colvars.h b/src/USER-COLVARS/fix_colvars.h index 2486446f35..fff61ce218 100644 --- a/src/USER-COLVARS/fix_colvars.h +++ b/src/USER-COLVARS/fix_colvars.h @@ -34,7 +34,6 @@ FixStyle(colvars,FixColvars) #define LMP_FIX_COLVARS_H #include "fix.h" -#include class colvarproxy_lammps; diff --git a/src/USER-COLVARS/group_ndx.cpp b/src/USER-COLVARS/group_ndx.cpp index 1e37e2de9c..37b853ba96 100644 --- a/src/USER-COLVARS/group_ndx.cpp +++ b/src/USER-COLVARS/group_ndx.cpp @@ -17,12 +17,11 @@ ------------------------------------------------------------------------- */ #include "group_ndx.h" -#include -#include + #include "atom.h" #include "comm.h" -#include "group.h" #include "error.h" +#include "group.h" using namespace LAMMPS_NS; @@ -144,7 +143,7 @@ void Group2Ndx::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open index file for writing"); if (screen) diff --git a/src/USER-COLVARS/ndx_group.cpp b/src/USER-COLVARS/ndx_group.cpp index feab2f22b2..e09084ebfd 100644 --- a/src/USER-COLVARS/ndx_group.cpp +++ b/src/USER-COLVARS/ndx_group.cpp @@ -17,13 +17,13 @@ ------------------------------------------------------------------------- */ #include "ndx_group.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "group.h" #include "error.h" +#include "group.h" + +#include using namespace LAMMPS_NS; #define BUFLEN 4096 @@ -36,13 +36,13 @@ static char *find_section(FILE *fp, const char *name) while ((p = fgets(linebuf,BUFLEN,fp))) { t = strtok(p," \t\n\r\f"); - if ((t != NULL) && *t == '[') { - t = strtok(NULL," \t\n\r\f"); - if (t != NULL) { + if ((t != nullptr) && *t == '[') { + t = strtok(nullptr," \t\n\r\f"); + if (t != nullptr) { n = t; - t = strtok(NULL," \t\n\r\f"); - if ((t != NULL) && *t == ']') { - if ((name == NULL) || strcmp(name,n) == 0) { + t = strtok(nullptr," \t\n\r\f"); + if ((t != nullptr) && *t == ']') { + if ((name == nullptr) || strcmp(name,n) == 0) { int l = strlen(n); r = new char[l+1]; strncpy(r,n,l+1); @@ -52,7 +52,7 @@ static char *find_section(FILE *fp, const char *name) } } } - return NULL; + return nullptr; } static tagint *read_section(FILE *fp, bigint &num) @@ -68,7 +68,7 @@ static tagint *read_section(FILE *fp, bigint &num) while ((p = fgets(linebuf,BUFLEN,fp))) { t = strtok(p," \t\n\r\f"); - while (t != NULL) { + while (t != nullptr) { // start of a new section. we are done here. if (*t == '[') return tagbuf; @@ -77,7 +77,7 @@ static tagint *read_section(FILE *fp, bigint &num) nmax += DELTA; tagbuf = (tagint *)realloc(tagbuf,sizeof(tagint)*nmax); } - t = strtok(NULL," \t\n\r\f"); + t = strtok(nullptr," \t\n\r\f"); } } return tagbuf; @@ -90,7 +90,7 @@ void Ndx2Group::command(int narg, char **arg) int len; bigint num; FILE *fp; - char *name = NULL; + char *name = nullptr; tagint *tags; if (narg < 1) error->all(FLERR,"Illegal ndx2group command"); @@ -100,7 +100,7 @@ void Ndx2Group::command(int narg, char **arg) if (comm->me == 0) { fp = fopen(arg[0], "r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open index file for reading"); if (screen) @@ -117,15 +117,15 @@ void Ndx2Group::command(int narg, char **arg) // find the next section. // if we had processed a section, before we need to step back - if (name != NULL) { + if (name != nullptr) { rewind(fp); char *tmp = find_section(fp,name); delete[] tmp; delete[] name; - name = NULL; + name = nullptr; } - name = find_section(fp,NULL); - if (name != NULL) { + name = find_section(fp,nullptr); + if (name != nullptr) { len=strlen(name)+1; // skip over group "all", which is called "System" in gromacs @@ -171,10 +171,10 @@ void Ndx2Group::command(int narg, char **arg) len = 0; // find named section, search from beginning of file - if (name != NULL) delete[] name; + if (name != nullptr) delete[] name; rewind(fp); name = find_section(fp,arg[idx]); - if (name != NULL) len=strlen(name)+1; + if (name != nullptr) len=strlen(name)+1; if (screen) fprintf(screen," %s group '%s'\n", diff --git a/src/USER-DIFFRACTION/compute_saed.cpp b/src/USER-DIFFRACTION/compute_saed.cpp index 5dd47b28bd..f35ea66796 100644 --- a/src/USER-DIFFRACTION/compute_saed.cpp +++ b/src/USER-DIFFRACTION/compute_saed.cpp @@ -15,23 +15,23 @@ Contributing authors: Shawn Coleman & Douglas Spearot (Arkansas) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "compute_saed.h" -#include -#include -#include -#include -#include "math_const.h" -#include "compute_saed_consts.h" -#include "atom.h" -#include "comm.h" -#include "update.h" -#include "domain.h" -#include "group.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" +#include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "compute_saed_consts.h" +#include "domain.h" +#include "error.h" +#include "group.h" +#include "math_const.h" +#include "memory.h" +#include "update.h" + +#include +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -49,7 +49,7 @@ static const char cite_compute_saed_c[] = /* ---------------------------------------------------------------------- */ ComputeSAED::ComputeSAED(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), ztype(NULL), store_tmp(NULL) + Compute(lmp, narg, arg), ztype(nullptr), store_tmp(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_saed_c); diff --git a/src/USER-DIFFRACTION/compute_xrd.cpp b/src/USER-DIFFRACTION/compute_xrd.cpp index e75546b548..633467fe36 100644 --- a/src/USER-DIFFRACTION/compute_xrd.cpp +++ b/src/USER-DIFFRACTION/compute_xrd.cpp @@ -16,23 +16,23 @@ Updated: 06/17/2015-2 ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "compute_xrd.h" -#include -#include -#include -#include -#include "math_const.h" #include "compute_xrd_consts.h" -#include "atom.h" -#include "comm.h" -#include "update.h" -#include "domain.h" -#include "group.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" +#include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "group.h" +#include "math_const.h" +#include "memory.h" +#include "update.h" + +#include +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -50,7 +50,7 @@ static const char cite_compute_xrd_c[] = /* ---------------------------------------------------------------------- */ ComputeXRD::ComputeXRD(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), ztype(NULL), store_tmp(NULL) + Compute(lmp, narg, arg), ztype(nullptr), store_tmp(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_xrd_c); diff --git a/src/USER-DIFFRACTION/fix_saed_vtk.cpp b/src/USER-DIFFRACTION/fix_saed_vtk.cpp index b6c00c2374..b39bc7ab99 100644 --- a/src/USER-DIFFRACTION/fix_saed_vtk.cpp +++ b/src/USER-DIFFRACTION/fix_saed_vtk.cpp @@ -17,18 +17,17 @@ ------------------------------------------------------------------------- */ #include "fix_saed_vtk.h" -#include -#include -#include -#include "update.h" -#include "modify.h" + #include "compute.h" #include "compute_saed.h" -#include "memory.h" -#include "error.h" -#include "force.h" #include "domain.h" +#include "error.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -41,16 +40,16 @@ enum{FIRST,MULTI}; /* ---------------------------------------------------------------------- */ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ids(NULL), fp(NULL), vector(NULL), - vector_total(NULL), vector_list(NULL), compute_saed(NULL), filename(NULL) + Fix(lmp, narg, arg), ids(nullptr), fp(nullptr), vector(nullptr), + vector_total(nullptr), vector_list(nullptr), compute_saed(nullptr), filename(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix saed/vtk command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; @@ -67,7 +66,7 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : options(narg,arg); which = 0; - ids = NULL; + ids = nullptr; nvalues = 0; @@ -137,8 +136,8 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : // allocate memory for averaging - vector = vector_total = NULL; - vector_list = NULL; + vector = vector_total = nullptr; + vector_list = nullptr; if (ave == WINDOW) memory->create(vector_list,nwindow,nvalues,"saed/vtk:vector_list"); @@ -146,8 +145,6 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : memory->create(vector,nrows,"saed/vtk:vector"); memory->create(vector_total,nrows,"saed/vtk:vector_total"); - extlist = NULL; - vector_flag = 1; size_vector = nrows; @@ -283,7 +280,6 @@ FixSAEDVTK::FixSAEDVTK(LAMMPS *lmp, int narg, char **arg) : FixSAEDVTK::~FixSAEDVTK() { - delete [] extlist; delete [] filename; delete [] ids; memory->destroy(vector); @@ -426,7 +422,7 @@ void FixSAEDVTK::invoke_vector(bigint ntimestep) snprintf(nName,128,"%s.%d.vtk",filename,nOutput); fp = fopen(nName,"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); error->one(FLERR,str); @@ -532,7 +528,7 @@ void FixSAEDVTK::options(int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; ave = ONE; startstep = 0; overwrite = 0; @@ -553,7 +549,7 @@ void FixSAEDVTK::options(int narg, char **arg) snprintf(nName,128,"%s.%d.vtk",filename,nOutput); fp = fopen(nName,"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix saed/vtk file %s",nName); error->one(FLERR,str); @@ -568,14 +564,14 @@ void FixSAEDVTK::options(int narg, char **arg) else error->all(FLERR,"Illegal fix saed/vtk command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix saed/vtk command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix saed/vtk command"); } iarg += 2; if (ave == WINDOW) iarg++; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix saed/vtk command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overwrite") == 0) { overwrite = 1; diff --git a/src/USER-DPD/atom_vec_dpd.cpp b/src/USER-DPD/atom_vec_dpd.cpp index 34efd9bc2b..aac08ced20 100644 --- a/src/USER-DPD/atom_vec_dpd.cpp +++ b/src/USER-DPD/atom_vec_dpd.cpp @@ -25,8 +25,8 @@ using namespace LAMMPS_NS; AtomVecDPD::AtomVecDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->rho_flag = 1; atom->dpd_flag = 1; diff --git a/src/USER-DPD/compute_dpd.cpp b/src/USER-DPD/compute_dpd.cpp index 0ef7868164..97e12d5cb4 100644 --- a/src/USER-DPD/compute_dpd.cpp +++ b/src/USER-DPD/compute_dpd.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_dpd.h" -#include + #include "atom.h" #include "update.h" #include "error.h" diff --git a/src/USER-DPD/compute_dpd_atom.cpp b/src/USER-DPD/compute_dpd_atom.cpp index 0fd732f669..95141e2de2 100644 --- a/src/USER-DPD/compute_dpd_atom.cpp +++ b/src/USER-DPD/compute_dpd_atom.cpp @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeDpdAtom::ComputeDpdAtom(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), dpdAtom(NULL) + Compute(lmp, narg, arg), dpdAtom(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute dpd/atom command"); diff --git a/src/USER-DPD/fix_dpd_energy.cpp b/src/USER-DPD/fix_dpd_energy.cpp index 6ee88ea88a..674bf0e13d 100644 --- a/src/USER-DPD/fix_dpd_energy.cpp +++ b/src/USER-DPD/fix_dpd_energy.cpp @@ -28,12 +28,12 @@ FixDPDenergy::FixDPDenergy(LAMMPS *lmp, int narg, char **arg) : { if (narg != 3 ) error->all(FLERR,"Illegal fix dpd/energy command"); - pairDPDE = NULL; + pairDPDE = nullptr; pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix dpd/energy"); if (!(atom->dpd_flag)) error->all(FLERR,"Must use atom_style dpd/fdt/energy with fix dpd/energy"); diff --git a/src/USER-DPD/fix_eos_cv.cpp b/src/USER-DPD/fix_eos_cv.cpp index 5b25519a40..db9b877b1c 100644 --- a/src/USER-DPD/fix_eos_cv.cpp +++ b/src/USER-DPD/fix_eos_cv.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "fix_eos_cv.h" + #include "atom.h" #include "error.h" -#include "force.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -29,7 +29,7 @@ FixEOScv::FixEOScv(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg != 4) error->all(FLERR,"Illegal fix eos/cv command"); - cvEOS = force->numeric(FLERR,arg[3]); + cvEOS = utils::numeric(FLERR,arg[3],false,lmp); if(cvEOS <= 0.0) error->all(FLERR,"EOS cv must be > 0.0"); nevery = 1; diff --git a/src/USER-DPD/fix_eos_table.cpp b/src/USER-DPD/fix_eos_table.cpp index dc6310ae42..00cbda1671 100644 --- a/src/USER-DPD/fix_eos_table.cpp +++ b/src/USER-DPD/fix_eos_table.cpp @@ -16,14 +16,12 @@ ------------------------------------------------------------------------- */ #include "fix_eos_table.h" -#include -#include -#include + #include "atom.h" #include "error.h" -#include "force.h" #include "memory.h" -#include "utils.h" + +#include #define MAXLINE 1024 @@ -33,7 +31,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ntables(0), tables(NULL) + Fix(lmp, narg, arg), ntables(0), tables(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix eos/table command"); nevery = 1; @@ -41,11 +39,11 @@ FixEOStable::FixEOStable(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in fix eos/table"); - tablength = force->inumeric(FLERR,arg[5]); + tablength = utils::inumeric(FLERR,arg[5],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of eos/table entries"); ntables = 0; - tables = NULL; + tables = nullptr; int me; MPI_Comm_rank(world,&me); tables = (Table *) @@ -169,10 +167,10 @@ void FixEOStable::end_of_step() void FixEOStable::null_table(Table *tb) { - tb->rfile = tb->efile = NULL; - tb->e2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->e2 = NULL; + tb->rfile = tb->efile = nullptr; + tb->e2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->e2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -199,8 +197,8 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword) // open file - FILE *fp = force->open_potential(file); - if (fp == NULL) { + FILE *fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -209,7 +207,7 @@ void FixEOStable::read_table(Table *tb, Table *tb2, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -307,13 +305,13 @@ void FixEOStable::param_extract(Table *tb, Table *tb2, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); tb2->ninput = atoi(word); } else { error->one(FLERR,"Invalid keyword in fix eos/table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"fix eos/table parameters did not set N"); diff --git a/src/USER-DPD/fix_eos_table_rx.cpp b/src/USER-DPD/fix_eos_table_rx.cpp index d9641f2aab..d01b2015d2 100644 --- a/src/USER-DPD/fix_eos_table_rx.cpp +++ b/src/USER-DPD/fix_eos_table_rx.cpp @@ -16,8 +16,8 @@ ------------------------------------------------------------------------- */ #include "fix_eos_table_rx.h" -#include -#include + + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "memory.h" #include "comm.h" #include "modify.h" -#include "utils.h" + #define MAXLINE 1024 @@ -42,8 +42,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), ntables(0), tables(NULL), - tables2(NULL), dHf(NULL), eosSpecies(NULL) + Fix(lmp, narg, arg), ntables(0), tables(nullptr), + tables2(nullptr), dHf(nullptr), eosSpecies(nullptr) { if (narg != 8 && narg != 10) error->all(FLERR,"Illegal fix eos/table/rx command"); nevery = 1; @@ -60,13 +60,13 @@ FixEOStableRX::FixEOStableRX(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in fix eos/table/rx"); - tablength = force->inumeric(FLERR,arg[5]); + tablength = utils::inumeric(FLERR,arg[5],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of eos/table/rx entries"); ntables = 0; - tables = NULL; - tables2 = NULL; - eosSpecies = NULL; + tables = nullptr; + tables2 = nullptr; + eosSpecies = nullptr; int me; MPI_Comm_rank(world,&me); @@ -306,10 +306,10 @@ void FixEOStableRX::read_file(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open eos table/rx potential file %s",file); error->one(FLERR,str); @@ -324,7 +324,7 @@ void FixEOStableRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -346,7 +346,7 @@ void FixEOStableRX::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -366,7 +366,7 @@ void FixEOStableRX::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -388,10 +388,10 @@ void FixEOStableRX::read_file(char *file) void FixEOStableRX::null_table(Table *tb) { - tb->rfile = tb->efile = NULL; - tb->e2file = NULL; - tb->r = tb->e = tb->de = NULL; - tb->e2 = NULL; + tb->rfile = tb->efile = nullptr; + tb->e2file = nullptr; + tb->r = tb->e = tb->de = nullptr; + tb->e2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -419,7 +419,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) // open file FILE *fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -428,7 +428,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -482,7 +482,7 @@ void FixEOStableRX::read_table(Table *tb, Table *tb2, char *file, char *keyword) } nwords = 0; word = strtok(line," \t\n\r\f"); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); rtmp = atof(word); for (int icolumn=0;icolumnrfile[i] = rtmp; @@ -574,11 +574,11 @@ void FixEOStableRX::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else error->one(FLERR,"Invalid keyword in fix eos/table/rx parameters"); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); if(rx_flag){ while (word) { @@ -592,7 +592,7 @@ void FixEOStableRX::param_extract(Table *tb, char *line) printf("name=%s not found in species list\n",word); error->one(FLERR,"Invalid keyword in fix eos/table/rx parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } for (int icolumn = 0; icolumn < ncolumn; icolumn++) diff --git a/src/USER-DPD/fix_rx.cpp b/src/USER-DPD/fix_rx.cpp index cfa309d053..07d39d0de7 100644 --- a/src/USER-DPD/fix_rx.cpp +++ b/src/USER-DPD/fix_rx.cpp @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ #include "fix_rx.h" -#include -#include + + #include #include #include // DBL_EPSILON @@ -31,7 +31,7 @@ #include "neigh_request.h" #include "math_special.h" #include "pair_dpd_fdt_energy.h" -#include "utils.h" + #include // std::vector<> #include // std::max @@ -67,23 +67,23 @@ double getElapsedTime( const TimerType &t0, const TimerType &t1) { return t1-t0; /* ---------------------------------------------------------------------- */ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), mol2param(NULL), nreactions(0), - params(NULL), Arr(NULL), nArr(NULL), Ea(NULL), tempExp(NULL), - stoich(NULL), stoichReactants(NULL), stoichProducts(NULL), kR(NULL), - pairDPDE(NULL), dpdThetaLocal(NULL), sumWeights(NULL), sparseKinetics_nu(NULL), - sparseKinetics_nuk(NULL), sparseKinetics_inu(NULL), sparseKinetics_isIntegralReaction(NULL), - kineticsFile(NULL), id_fix_species(NULL), - id_fix_species_old(NULL), fix_species(NULL), fix_species_old(NULL) + Fix(lmp, narg, arg), mol2param(nullptr), nreactions(0), + params(nullptr), Arr(nullptr), nArr(nullptr), Ea(nullptr), tempExp(nullptr), + stoich(nullptr), stoichReactants(nullptr), stoichProducts(nullptr), kR(nullptr), + pairDPDE(nullptr), dpdThetaLocal(nullptr), sumWeights(nullptr), sparseKinetics_nu(nullptr), + sparseKinetics_nuk(nullptr), sparseKinetics_inu(nullptr), sparseKinetics_isIntegralReaction(nullptr), + kineticsFile(nullptr), id_fix_species(nullptr), + id_fix_species_old(nullptr), fix_species(nullptr), fix_species_old(nullptr) { if (narg < 7 || narg > 12) error->all(FLERR,"Illegal fix rx command"); nevery = 1; nreactions = maxparam = 0; - params = NULL; - mol2param = NULL; - pairDPDE = NULL; - id_fix_species = NULL; - id_fix_species_old = NULL; + params = nullptr; + mol2param = nullptr; + pairDPDE = nullptr; + id_fix_species = nullptr; + id_fix_species_old = nullptr; const int Verbosity = 1; @@ -166,7 +166,7 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : diagnosticFrequency = 0; for (int i = 0; i < numDiagnosticCounters; ++i){ diagnosticCounter[i] = 0; - diagnosticCounterPerODE[i] = NULL; + diagnosticCounterPerODE[i] = nullptr; } if (odeIntegrationFlag == ODE_LAMMPS_RK4 && narg==8){ @@ -189,8 +189,8 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : minSteps = atoi( arg[iarg++] ); maxIters = atoi( arg[iarg++] ); - relTol = strtod( arg[iarg++], NULL); - absTol = strtod( arg[iarg++], NULL); + relTol = strtod( arg[iarg++], nullptr); + absTol = strtod( arg[iarg++], nullptr); if (iarg < narg) diagnosticFrequency = atoi( arg[iarg++] ); @@ -207,10 +207,10 @@ FixRX::FixRX(LAMMPS *lmp, int narg, char **arg) : } // Initialize/Create the sparse matrix database. - sparseKinetics_nu = NULL; - sparseKinetics_nuk = NULL; - sparseKinetics_inu = NULL; - sparseKinetics_isIntegralReaction = NULL; + sparseKinetics_nu = nullptr; + sparseKinetics_nuk = nullptr; + sparseKinetics_inu = nullptr; + sparseKinetics_isIntegralReaction = nullptr; sparseKinetics_maxReactants = 0; sparseKinetics_maxProducts = 0; sparseKinetics_maxSpecies = 0; @@ -259,15 +259,15 @@ void FixRX::post_constructor() char **tmpspecies = new char*[maxspecies]; int tmpmaxstrlen = 0; for(int jj=0; jj < maxspecies; jj++) - tmpspecies[jj] = NULL; + tmpspecies[jj] = nullptr; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { - fp = force->open_potential(kineticsFile); - if (fp == NULL) { + fp = utils::open_potential(kineticsFile,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open rx file %s",kineticsFile); error->one(FLERR,str); @@ -284,7 +284,7 @@ void FixRX::post_constructor() while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -304,8 +304,8 @@ void FixRX::post_constructor() nwords = 0; word = strtok(line," \t\n\r\f"); - while (word != NULL){ - word = strtok(NULL, " \t\n\r\f"); + while (word != nullptr){ + word = strtok(nullptr, " \t\n\r\f"); match=false; for(int jj=0;jjall(FLERR,"Exceeded the maximum number of species permitted in fix rx."); tmpspecies[nUniqueSpecies] = new char[strlen(word)+1]; strcpy(tmpspecies[nUniqueSpecies],word); - tmpmaxstrlen = MAX(tmpmaxstrlen,strlen(word)); + tmpmaxstrlen = MAX(tmpmaxstrlen,(int)strlen(word)); nUniqueSpecies++; } - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); if(strcmp(word,"+") != 0 && strcmp(word,"=") != 0) break; - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); } } atom->nspecies_dpd = nUniqueSpecies; @@ -332,8 +332,8 @@ void FixRX::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_species = NULL; - id_fix_species_old = NULL; + id_fix_species = nullptr; + id_fix_species_old = nullptr; n = strlen(id) + strlen("_SPECIES") + 1; id_fix_species = new char[n]; @@ -543,7 +543,7 @@ void FixRX::initSparse() if (SparseKinetics_enableIntegralReactions){ sparseKinetics_inu[i][idx] = (int)sparseKinetics_nu[i][idx]; if (isIntegral_i){ - if (sparseKinetics_inu[i][idx] >= nu_bin.size()) + if (sparseKinetics_inu[i][idx] >= (int)nu_bin.size()) nu_bin.resize( sparseKinetics_inu[i][idx] ); nu_bin[ sparseKinetics_inu[i][idx] ] ++; @@ -561,7 +561,7 @@ void FixRX::initSparse() if (SparseKinetics_enableIntegralReactions){ sparseKinetics_inu[i][idx] = (int) sparseKinetics_nu[i][idx]; if (isIntegral_i){ - if (sparseKinetics_inu[i][idx] >= nu_bin.size()) + if (sparseKinetics_inu[i][idx] >= (int)nu_bin.size()) nu_bin.resize( sparseKinetics_inu[i][idx] ); nu_bin[ sparseKinetics_inu[i][idx] ] ++; @@ -637,10 +637,10 @@ int FixRX::setmask() void FixRX::init() { pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt/energy with fix rx"); bool eos_flag = false; @@ -853,10 +853,10 @@ void FixRX::read_file(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open rx file %s",file); error->one(FLERR,str); @@ -872,7 +872,7 @@ void FixRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -892,7 +892,7 @@ void FixRX::read_file(char *file) } // open file on proc 0 - if (comm->me == 0) fp = force->open_potential(file); + if (comm->me == 0) fp = utils::open_potential(file,lmp,nullptr); // read each reaction from kinetics file eof=0; @@ -926,7 +926,7 @@ void FixRX::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -946,9 +946,9 @@ void FixRX::read_file(char *file) nwords = 0; word = strtok(line," \t\n\r\f"); - while (word != NULL){ + while (word != nullptr){ tmpStoich = atof(word); - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); for (ispecies = 0; ispecies < nspecies; ispecies++){ if (strcmp(word,&atom->dname[ispecies][0]) == 0){ stoich[nreactions][ispecies] += sign*tmpStoich; @@ -965,22 +965,22 @@ void FixRX::read_file(char *file) } error->all(FLERR,"Illegal fix rx command"); } - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); if(strcmp(word,"=") == 0) sign = 1.0; if(strcmp(word,"+") != 0 && strcmp(word,"=") != 0){ - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); Arr[nreactions] = atof(word); - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); nArr[nreactions] = atof(word); - word = strtok(NULL, " \t\n\r\f"); - if(word==NULL) error->all(FLERR,"Missing parameters in reaction kinetic equation"); + word = strtok(nullptr, " \t\n\r\f"); + if(word==nullptr) error->all(FLERR,"Missing parameters in reaction kinetic equation"); Ea[nreactions] = atof(word); sign = -1.0; break; } - word = strtok(NULL, " \t\n\r\f"); + word = strtok(nullptr, " \t\n\r\f"); } nreactions++; } @@ -1434,7 +1434,7 @@ void FixRX::odeDiagnostics(void) my_max[i] = 0; my_min[i] = DBL_MAX; - if (diagnosticCounterPerODE[i] != NULL){ + if (diagnosticCounterPerODE[i] != nullptr){ for (int j = 0; j < nlocal; ++j) if (mask[j] & groupbit){ double diff = double(diagnosticCounterPerODE[i][j]) - avg_per_atom[i]; @@ -1637,8 +1637,8 @@ void FixRX::rkf45(int id, double *rwork, void *v_param, int ode_counter[]) ode_counter[1] += nit; ode_counter[2] += nfe; - //if (diagnosticFrequency == 1 && diagnosticCounterPerODE[StepSum] != NULL) - if (diagnosticCounterPerODE[StepSum] != NULL){ + //if (diagnosticFrequency == 1 && diagnosticCounterPerODE[StepSum] != nullptr) + if (diagnosticCounterPerODE[StepSum] != nullptr){ diagnosticCounterPerODE[StepSum][id] = nst; diagnosticCounterPerODE[FuncSum][id] = nfe; } @@ -1708,7 +1708,7 @@ int FixRX::rhs_sparse(double /*t*/, const double *y, double *dydt, void *v_param const double VDPD = domain->xprd * domain->yprd * domain->zprd / atom->natoms; #define kFor (userData->kFor) - #define kRev (NULL) + #define kRev (nullptr) #define rxnRateLaw (userData->rxnRateLaw) #define conc (dydt) #define maxReactants (this->sparseKinetics_maxReactants) diff --git a/src/USER-DPD/fix_shardlow.cpp b/src/USER-DPD/fix_shardlow.cpp index 18c86976ac..6db13d3943 100644 --- a/src/USER-DPD/fix_shardlow.cpp +++ b/src/USER-DPD/fix_shardlow.cpp @@ -34,27 +34,26 @@ ------------------------------------------------------------------------- */ #include "fix_shardlow.h" -#include -#include -#include -#include + #include "atom.h" -#include "force.h" -#include "update.h" -#include "error.h" +#include "citeme.h" #include "comm.h" -#include "neighbor.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "modify.h" #include "neigh_list.h" #include "neigh_request.h" +#include "neighbor.h" #include "npair.h" -#include "memory.h" -#include "domain.h" -#include "modify.h" +#include "npair_half_bin_newton_ssa.h" #include "pair_dpd_fdt.h" #include "pair_dpd_fdt_energy.h" -#include "npair_half_bin_newton_ssa.h" -#include "citeme.h" -#include "utils.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -85,18 +84,18 @@ static const char cite_fix_shardlow[] = /* ---------------------------------------------------------------------- */ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), pairDPD(NULL), pairDPDE(NULL), v_t0(NULL) - ,rand_state(NULL) + Fix(lmp, narg, arg), pairDPD(nullptr), pairDPDE(nullptr), v_t0(nullptr) + ,rand_state(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_shardlow); if (narg != 3) error->all(FLERR,"Illegal fix shardlow command"); - pairDPD = NULL; - pairDPDE = NULL; + pairDPD = nullptr; + pairDPDE = nullptr; pairDPD = (PairDPDfdt *) force->pair_match("dpd/fdt",1); pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy",1); - if (pairDPDE == NULL) + if (pairDPDE == nullptr) pairDPDE = (PairDPDfdtEnergy *) force->pair_match("dpd/fdt/energy/kk",1); maxRNG = 0; @@ -108,7 +107,7 @@ FixShardlow::FixShardlow(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 3; } - if(pairDPD == NULL && pairDPDE == NULL) + if(pairDPD == nullptr && pairDPDE == nullptr) error->all(FLERR,"Must use pair_style dpd/fdt or dpd/fdt/energy with fix shardlow"); } @@ -534,7 +533,7 @@ void FixShardlow::initial_integrate(int /*vflag*/) const int nlocal = atom->nlocal; const int nghost = atom->nghost; - const bool useDPDE = (pairDPDE != NULL); + const bool useDPDE = (pairDPDE != nullptr); // NOTE: this logic is specific to orthogonal boxes, not triclinic @@ -641,7 +640,7 @@ fprintf(stdout, "\n%6d %6d,%6d %6d: " #endif memory->sfree(v_t0); - v_t0 = NULL; + v_t0 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DPD/nbin_ssa.cpp b/src/USER-DPD/nbin_ssa.cpp index e3fa71aedf..21d630e789 100644 --- a/src/USER-DPD/nbin_ssa.cpp +++ b/src/USER-DPD/nbin_ssa.cpp @@ -120,9 +120,9 @@ void NBinSSA::bin_atoms_setup(int nall) /* ---------------------------------------------------------------------- */ -bigint NBinSSA::memory_usage() +double NBinSSA::memory_usage() { - bigint bytes = NBinStandard::memory_usage(); // Count the parent's usage too + double bytes = NBinStandard::memory_usage(); // Count the parent's usage too return bytes; } diff --git a/src/USER-DPD/nbin_ssa.h b/src/USER-DPD/nbin_ssa.h index c738391d67..eb4b2db24c 100644 --- a/src/USER-DPD/nbin_ssa.h +++ b/src/USER-DPD/nbin_ssa.h @@ -47,7 +47,7 @@ class NBinSSA : public NBinStandard { void bin_atoms_setup(int); void bin_atoms(); - bigint memory_usage(); + double memory_usage(); inline int coord2bin(const double & x,const double & y,const double & z, int &ixo, int &iyo, int &izo) const diff --git a/src/USER-DPD/npair_half_bin_newton_ssa.cpp b/src/USER-DPD/npair_half_bin_newton_ssa.cpp index 4fb5714d11..e7adb891fd 100644 --- a/src/USER-DPD/npair_half_bin_newton_ssa.cpp +++ b/src/USER-DPD/npair_half_bin_newton_ssa.cpp @@ -37,9 +37,9 @@ NPairHalfBinNewtonSSA::NPairHalfBinNewtonSSA(LAMMPS *lmp) : NPair(lmp) ssa_maxPhaseCt = 0; ssa_maxPhaseLen = 0; ssa_phaseCt = 0; - ssa_phaseLen = NULL; - ssa_itemLoc = NULL; - ssa_itemLen = NULL; + ssa_phaseLen = nullptr; + ssa_itemLoc = nullptr; + ssa_itemLen = nullptr; ssa_gphaseCt = 7; memory->create(ssa_gphaseLen,ssa_gphaseCt,"NPairHalfBinNewtonSSA:ssa_gphaseLen"); memory->create(ssa_gitemLoc,ssa_gphaseCt,1,"NPairHalfBinNewtonSSA:ssa_gitemLoc"); @@ -88,7 +88,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; int molecular = atom->molecular; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -198,7 +198,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -279,7 +279,7 @@ void NPairHalfBinNewtonSSA::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[j],nspecial[j],tag[i]); else { diff --git a/src/USER-DPD/pair_dpd_fdt.cpp b/src/USER-DPD/pair_dpd_fdt.cpp index 14bbe0b784..822444f8c5 100644 --- a/src/USER-DPD/pair_dpd_fdt.cpp +++ b/src/USER-DPD/pair_dpd_fdt.cpp @@ -16,21 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_dpd_fdt.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "update.h" +#include "error.h" #include "fix.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "random_mars.h" #include "memory.h" #include "modify.h" -#include "error.h" -#include "utils.h" +#include "neigh_list.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -40,7 +39,7 @@ using namespace LAMMPS_NS; PairDPDfdt::PairDPDfdt(LAMMPS *lmp) : Pair(lmp) { - random = NULL; + random = nullptr; splitFDT_flag = false; a0_is_zero = false; } @@ -249,9 +248,9 @@ void PairDPDfdt::settings(int narg, char **arg) // process keywords if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -279,16 +278,16 @@ void PairDPDfdt::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; a0_is_zero = (a0_one == 0.0); // Typical use with SSA is to set a0 to zero - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -376,13 +375,13 @@ void PairDPDfdt::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -411,10 +410,10 @@ void PairDPDfdt::write_restart_settings(FILE *fp) void PairDPDfdt::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-DPD/pair_dpd_fdt_energy.cpp b/src/USER-DPD/pair_dpd_fdt_energy.cpp index 455af2f481..094e5732c7 100644 --- a/src/USER-DPD/pair_dpd_fdt_energy.cpp +++ b/src/USER-DPD/pair_dpd_fdt_energy.cpp @@ -16,21 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_dpd_fdt_energy.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "update.h" +#include "error.h" #include "fix.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "random_mars.h" #include "memory.h" #include "modify.h" -#include "error.h" -#include "utils.h" +#include "neigh_list.h" +#include "neighbor.h" +#include "random_mars.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -40,9 +39,9 @@ using namespace LAMMPS_NS; PairDPDfdtEnergy::PairDPDfdtEnergy(LAMMPS *lmp) : Pair(lmp) { - random = NULL; - duCond = NULL; - duMech = NULL; + random = nullptr; + duCond = nullptr; + duMech = nullptr; splitFDT_flag = false; a0_is_zero = false; @@ -336,8 +335,8 @@ void PairDPDfdtEnergy::settings(int narg, char **arg) // process keywords if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - seed = force->inumeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + seed = utils::inumeric(FLERR,arg[1],false,lmp); if (atom->dpd_flag != 1) error->all(FLERR,"pair_style dpd/fdt/energy requires atom_style with internal temperature and energies (e.g. dpd)"); @@ -367,19 +366,19 @@ void PairDPDfdtEnergy::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; double kappa_one, alpha_one; a0_is_zero = (a0_one == 0.0); // Typical use with SSA is to set a0 to zero - kappa_one = force->numeric(FLERR,arg[4]); + kappa_one = utils::numeric(FLERR,arg[4],false,lmp); alpha_one = sqrt(2.0*force->boltz*kappa_one); - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -477,14 +476,14 @@ void PairDPDfdtEnergy::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -514,9 +513,9 @@ void PairDPDfdtEnergy::write_restart_settings(FILE *fp) void PairDPDfdtEnergy::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&seed,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_exp6_rx.cpp b/src/USER-DPD/pair_exp6_rx.cpp index 4ac491afb1..9d7fcc1ab2 100644 --- a/src/USER-DPD/pair_exp6_rx.cpp +++ b/src/USER-DPD/pair_exp6_rx.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "pair_exp6_rx.h" -#include + #include -#include + #include #include #include "atom.h" @@ -24,7 +24,7 @@ #include "math_special.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "modify.h" #include "fix.h" @@ -59,10 +59,10 @@ struct PairExp6ParamDataType // Default constructor -- nullify everything. PairExp6ParamDataType(void) - : n(0), epsilon1(NULL), alpha1(NULL), rm1(NULL), mixWtSite1(NULL), - epsilon2(NULL), alpha2(NULL), rm2(NULL), mixWtSite2(NULL), - epsilonOld1(NULL), alphaOld1(NULL), rmOld1(NULL), mixWtSite1old(NULL), - epsilonOld2(NULL), alphaOld2(NULL), rmOld2(NULL), mixWtSite2old(NULL) + : n(0), epsilon1(nullptr), alpha1(nullptr), rm1(nullptr), mixWtSite1(nullptr), + epsilon2(nullptr), alpha2(nullptr), rm2(nullptr), mixWtSite2(nullptr), + epsilonOld1(nullptr), alphaOld1(nullptr), rmOld1(nullptr), mixWtSite1old(nullptr), + epsilonOld2(nullptr), alphaOld2(nullptr), rmOld2(nullptr), mixWtSite2old(nullptr) {} }; @@ -74,8 +74,8 @@ PairExp6rx::PairExp6rx(LAMMPS *lmp) : Pair(lmp) nspecies = 0; nparams = maxparam = 0; - params = NULL; - mol2param = NULL; + params = nullptr; + mol2param = nullptr; fractionalWeighting = true; } @@ -85,7 +85,7 @@ PairExp6rx::~PairExp6rx() { if (copymode) return; - if (params != NULL) { + if (params != nullptr) { for (int i=0; i < nparams; ++i) { delete[] params[i].name; delete[] params[i].potential; @@ -549,7 +549,7 @@ void PairExp6rx::settings(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // optional keywords @@ -589,8 +589,8 @@ void PairExp6rx::coeff(int narg, char **arg) int ilo,ihi,jlo,jhi; int n; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); nspecies = atom->nspecies_dpd; if(nspecies==0) error->all(FLERR,"There are no rx species specified."); @@ -659,17 +659,17 @@ void PairExp6rx::coeff(int narg, char **arg) } delete[] site1; delete[] site2; - site1 = site2 = NULL; + site1 = site2 = nullptr; setup(); double cut_one = cut_global; if (strcmp(arg[5],"exponent") == 0){ scalingFlag = EXPONENT; - exponentR = force->numeric(FLERR,arg[6]); - exponentEpsilon = force->numeric(FLERR,arg[7]); + exponentR = utils::numeric(FLERR,arg[6],false,lmp); + exponentEpsilon = utils::numeric(FLERR,arg[7],false,lmp); if (narg > 9) error->all(FLERR,"Incorrect args for pair coefficients"); - if (narg == 9) cut_one = force->numeric(FLERR,arg[8]); + if (narg == 9) cut_one = utils::numeric(FLERR,arg[8],false,lmp); } else if (strcmp(arg[5],"polynomial") == 0){ scalingFlag = POLYNOMIAL; memory->create(coeffAlpha,6,"pair:coeffAlpha"); @@ -677,11 +677,11 @@ void PairExp6rx::coeff(int narg, char **arg) memory->create(coeffRm,6,"pair:coeffRm"); read_file2(arg[6]); if (narg > 8) error->all(FLERR,"Incorrect args for pair coefficients"); - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); } else if (strcmp(arg[5],"none") == 0){ scalingFlag = NONE; if (narg > 7) error->all(FLERR,"Incorrect args for pair coefficients"); - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); } else { error->all(FLERR,"Incorrect args for pair coefficients"); } @@ -717,16 +717,16 @@ void PairExp6rx::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open exp6/rx potential file %s",file); error->one(FLERR,str); @@ -743,7 +743,7 @@ void PairExp6rx::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -765,7 +765,7 @@ void PairExp6rx::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -785,7 +785,7 @@ void PairExp6rx::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; for (ispecies = 0; ispecies < nspecies; ispecies++) if (strcmp(words[0],&atom->dname[ispecies][0]) == 0) break; @@ -839,10 +839,10 @@ void PairExp6rx::read_file2(char *file) // open file on proc 0 FILE *fp; - fp = NULL; + fp = nullptr; if (comm->me == 0) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open polynomial file %s",file); error->one(FLERR,str); @@ -857,7 +857,7 @@ void PairExp6rx::read_file2(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -879,7 +879,7 @@ void PairExp6rx::read_file2(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -899,7 +899,7 @@ void PairExp6rx::read_file2(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; if (strcmp(words[0],"alpha") == 0){ for (int ii=1; iime; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } @@ -1004,10 +1004,10 @@ void PairExp6rx::write_restart_settings(FILE *fp) void PairExp6rx::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_multi_lucy.cpp b/src/USER-DPD/pair_multi_lucy.cpp index 1cbb29a93c..a266e94ccb 100644 --- a/src/USER-DPD/pair_multi_lucy.cpp +++ b/src/USER-DPD/pair_multi_lucy.cpp @@ -21,10 +21,10 @@ The Journal of Chemical Physics, 2016, 144, 104501. ------------------------------------------------------------------------------------------- */ -#include + #include #include "math_const.h" -#include + #include #include "pair_multi_lucy.h" #include "atom.h" @@ -33,9 +33,9 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "citeme.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -57,14 +57,14 @@ static const char cite_pair_multi_lucy[] = /* ---------------------------------------------------------------------- */ PairMultiLucy::PairMultiLucy(LAMMPS *lmp) : Pair(lmp), - ntables(0), tables(NULL), tabindex(NULL) + ntables(0), tables(nullptr), tabindex(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_multi_lucy); if (atom->rho_flag != 1) error->all(FLERR,"Pair multi/lucy command requires atom_style with density (e.g. dpd, meso)"); ntables = 0; - tables = NULL; + tables = nullptr; comm_forward = 1; comm_reverse = 1; @@ -240,7 +240,7 @@ void PairMultiLucy::settings(int narg, char **arg) else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // delete old tables, since cannot just change settings @@ -256,7 +256,7 @@ void PairMultiLucy::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -269,8 +269,8 @@ void PairMultiLucy::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int me; MPI_Comm_rank(world,&me); @@ -282,7 +282,7 @@ void PairMultiLucy::coeff(int narg, char **arg) bcast_table(tb); // set table cutoff - if (narg == 5) tb->cut = force->numeric(FLERR,arg[4]); + if (narg == 5) tb->cut = utils::numeric(FLERR,arg[4],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; @@ -349,7 +349,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword) // open file FILE *fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -358,7 +358,7 @@ void PairMultiLucy::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -481,26 +481,26 @@ void PairMultiLucy::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0) { if (strcmp(word,"R") == 0) tb->rflag = RLINEAR; else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rlo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rhi = atof(word); } else if (strcmp(word,"FP") == 0) { tb->fpflag = 1; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fplo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fphi = atof(word); } else { printf("WORD: %s\n",word); error->one(FLERR,"Invalid keyword in pair table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N"); @@ -582,15 +582,15 @@ void PairMultiLucy::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucy::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -707,8 +707,8 @@ void PairMultiLucy::write_restart_settings(FILE *fp) void PairMultiLucy::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_multi_lucy_rx.cpp b/src/USER-DPD/pair_multi_lucy_rx.cpp index 79df11a038..d8356d20c4 100644 --- a/src/USER-DPD/pair_multi_lucy_rx.cpp +++ b/src/USER-DPD/pair_multi_lucy_rx.cpp @@ -21,10 +21,10 @@ The Journal of Chemical Physics, 2016, 144, 104501. ------------------------------------------------------------------------------------------- */ -#include + #include #include "math_const.h" -#include + #include #include "pair_multi_lucy_rx.h" #include "atom.h" @@ -33,11 +33,11 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "citeme.h" #include "modify.h" #include "fix.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -68,14 +68,14 @@ static const char cite_pair_multi_lucy_rx[] = /* ---------------------------------------------------------------------- */ PairMultiLucyRX::PairMultiLucyRX(LAMMPS *lmp) : Pair(lmp), - ntables(0), tables(NULL), tabindex(NULL), site1(NULL), site2(NULL) + ntables(0), tables(nullptr), tabindex(nullptr), site1(nullptr), site2(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_pair_multi_lucy_rx); if (atom->rho_flag != 1) error->all(FLERR,"Pair multi/lucy/rx command requires atom_style with density (e.g. dpd, meso)"); ntables = 0; - tables = NULL; + tables = nullptr; comm_forward = 1; comm_reverse = 1; @@ -134,10 +134,10 @@ void PairMultiLucyRX::compute(int eflag, int vflag) int jtable; double *rho = atom->rho; - double *mixWtSite1old = NULL; - double *mixWtSite2old = NULL; - double *mixWtSite1 = NULL; - double *mixWtSite2 = NULL; + double *mixWtSite1old = nullptr; + double *mixWtSite2old = nullptr; + double *mixWtSite1 = nullptr; + double *mixWtSite2 = nullptr; { const int ntotal = nlocal + nghost; @@ -329,7 +329,7 @@ void PairMultiLucyRX::settings(int narg, char **arg) else if (strcmp(arg[0],"linear") == 0) tabstyle = LINEAR; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -355,7 +355,7 @@ void PairMultiLucyRX::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -374,8 +374,8 @@ void PairMultiLucyRX::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int me; MPI_Comm_rank(world,&me); @@ -398,7 +398,7 @@ void PairMultiLucyRX::coeff(int narg, char **arg) // set table cutoff - if (narg == 7) tb->cut = force->numeric(FLERR,arg[6]); + if (narg == 7) tb->cut = utils::numeric(FLERR,arg[6],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; @@ -493,8 +493,8 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword) // open file - FILE *fp = force->open_potential(file); - if (fp == NULL) { + FILE *fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); @@ -503,7 +503,7 @@ void PairMultiLucyRX::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->one(FLERR,"Did not find keyword in table file"); if (strspn(line," \t\n\r") == strlen(line)) continue; // blank line if (line[0] == '#') continue; // comment @@ -626,26 +626,26 @@ void PairMultiLucyRX::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"R") == 0 || strcmp(word,"RSQ") == 0) { if (strcmp(word,"R") == 0) tb->rflag = RLINEAR; else if (strcmp(word,"RSQ") == 0) tb->rflag = RSQ; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rlo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->rhi = atof(word); } else if (strcmp(word,"FP") == 0) { tb->fpflag = 1; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fplo = atof(word); - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->fphi = atof(word); } else { printf("WORD: %s\n",word); error->one(FLERR,"Invalid keyword in pair table parameters"); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) error->one(FLERR,"Pair table parameters did not set N"); @@ -727,15 +727,15 @@ void PairMultiLucyRX::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairMultiLucyRX::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -852,8 +852,8 @@ void PairMultiLucyRX::write_restart_settings(FILE *fp) void PairMultiLucyRX::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); diff --git a/src/USER-DPD/pair_table_rx.cpp b/src/USER-DPD/pair_table_rx.cpp index cf64c17c5e..05467346c8 100644 --- a/src/USER-DPD/pair_table_rx.cpp +++ b/src/USER-DPD/pair_table_rx.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_table_rx.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "error.h" #include "modify.h" #include "fix.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -46,8 +46,8 @@ enum{NONE,RLINEAR,RSQ,BMP}; PairTableRX::PairTableRX(LAMMPS *lmp) : PairTable(lmp) { fractionalWeighting = true; - site1 = NULL; - site2 = NULL; + site1 = nullptr; + site2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -93,10 +93,10 @@ void PairTableRX::compute(int eflag, int vflag) double *uCG = atom->uCG; double *uCGnew = atom->uCGnew; - double *mixWtSite1old = NULL; - double *mixWtSite2old = NULL; - double *mixWtSite1 = NULL; - double *mixWtSite2 = NULL; + double *mixWtSite1old = nullptr; + double *mixWtSite2old = nullptr; + double *mixWtSite1 = nullptr; + double *mixWtSite2 = nullptr; { const int ntotal = atom->nlocal + atom->nghost; @@ -258,7 +258,7 @@ void PairTableRX::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -290,7 +290,7 @@ void PairTableRX::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -308,8 +308,8 @@ void PairTableRX::coeff(int narg, char **arg) if (!rx_flag) error->all(FLERR,"Pair style table/rx requires a fix rx command."); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int me; MPI_Comm_rank(world,&me); @@ -346,7 +346,7 @@ void PairTableRX::coeff(int narg, char **arg) // set table cutoff - if (narg == 7) tb->cut = force->numeric(FLERR,arg[6]); + if (narg == 7) tb->cut = utils::numeric(FLERR,arg[6],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; diff --git a/src/USER-DRUDE/compute_temp_drude.cpp b/src/USER-DRUDE/compute_temp_drude.cpp index a12c248680..1c60805db2 100644 --- a/src/USER-DRUDE/compute_temp_drude.cpp +++ b/src/USER-DRUDE/compute_temp_drude.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_drude.h" -#include + #include #include "atom.h" #include "update.h" @@ -43,9 +43,9 @@ ComputeTempDrude::ComputeTempDrude(LAMMPS *lmp, int narg, char **arg) : tempflag = 0; // because does not compute a single temperature (scalar and vector) vector = new double[size_vector]; - fix_drude = NULL; - id_temp = NULL; - temperature = NULL; + fix_drude = nullptr; + id_temp = nullptr; + temperature = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/fix_drude.cpp b/src/USER-DRUDE/fix_drude.cpp index 080408459c..509281700f 100644 --- a/src/USER-DRUDE/fix_drude.cpp +++ b/src/USER-DRUDE/fix_drude.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_drude.h" -#include + #include #include #include "atom.h" @@ -53,11 +53,11 @@ FixDrude::FixDrude(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "Illegal fix drude command"); } - drudeid = NULL; + drudeid = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); - atom->add_callback(2); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); + atom->add_callback(Atom::BORDER); // one-time assignment of Drude partners @@ -72,9 +72,9 @@ FixDrude::FixDrude(LAMMPS *lmp, int narg, char **arg) : FixDrude::~FixDrude() { - atom->delete_callback(id,2); - atom->delete_callback(id,1); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::BORDER); + atom->delete_callback(id,Atom::RESTART); + atom->delete_callback(id,Atom::GROW); memory->destroy(drudetype); memory->destroy(drudeid); } @@ -110,7 +110,7 @@ void FixDrude::build_drudeid(){ std::vector core_drude_vec; partner_set = new std::set[nlocal]; // Temporary sets of bond partner tags - if (atom->molecular == 1) + if (atom->molecular == Atom::MOLECULAR) { // Build list of my atoms' bond partners for (int i=0; iring(core_drude_vec.size(), sizeof(tagint), (char *) core_drude_vec.data(), - 4, ring_build_partner, NULL, (void *)this, 1); + 4, ring_build_partner, nullptr, (void *)this, 1); // Build the list of my Drudes' tags // The only bond partners of a Drude particle is its core, @@ -163,7 +163,7 @@ void FixDrude::build_drudeid(){ // so that each core finds its Drude. comm->ring(drude_vec.size(), sizeof(tagint), (char *) drude_vec.data(), - 3, ring_search_drudeid, NULL, (void *)this, 1); + 3, ring_search_drudeid, nullptr, (void *)this, 1); delete [] partner_set; } @@ -338,11 +338,11 @@ void FixDrude::rebuild_special(){ // Remove Drude particles from the special lists of each proc comm->ring(drude_vec.size(), sizeof(tagint), (char *) drude_vec.data(), - 9, ring_remove_drude, NULL, (void *)this, 1); + 9, ring_remove_drude, nullptr, (void *)this, 1); // Add back Drude particles in the lists just after their core comm->ring(core_drude_vec.size(), sizeof(tagint), (char *) core_drude_vec.data(), - 10, ring_add_drude, NULL, (void *)this, 1); + 10, ring_add_drude, nullptr, (void *)this, 1); // Check size of special list nspecmax_loc = 0; @@ -373,7 +373,7 @@ void FixDrude::rebuild_special(){ // Copy core's list into their drude list comm->ring(core_special_vec.size(), sizeof(tagint), (char *) core_special_vec.data(), - 11, ring_copy_drude, NULL, (void *)this, 1); + 11, ring_copy_drude, nullptr, (void *)this, 1); } /* ---------------------------------------------------------------------- diff --git a/src/USER-DRUDE/fix_drude_transform.cpp b/src/USER-DRUDE/fix_drude_transform.cpp index 4128c508d6..fc89367323 100644 --- a/src/USER-DRUDE/fix_drude_transform.cpp +++ b/src/USER-DRUDE/fix_drude_transform.cpp @@ -13,7 +13,7 @@ /** Fix Drude Transform ******************************************************/ #include "fix_drude_transform.h" -#include + #include #include #include "fix_drude.h" @@ -29,11 +29,11 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ template FixDrudeTransform::FixDrudeTransform(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), mcoeff(NULL) + Fix(lmp, narg, arg), mcoeff(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix drude/transform command"); comm_forward = 9; - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/fix_langevin_drude.cpp b/src/USER-DRUDE/fix_langevin_drude.cpp index d413c31bd7..3fd017444e 100644 --- a/src/USER-DRUDE/fix_langevin_drude.cpp +++ b/src/USER-DRUDE/fix_langevin_drude.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_langevin_drude.h" -#include + #include #include #include "fix_drude.h" @@ -48,34 +48,34 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : comm_reverse = 3; // core temperature - tstr_core = NULL; + tstr_core = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr_core = new char[n]; strcpy(tstr_core,&arg[3][2]); tstyle_core = EQUAL; } else { - t_start_core = force->numeric(FLERR,arg[3]); + t_start_core = utils::numeric(FLERR,arg[3],false,lmp); t_target_core = t_start_core; tstyle_core = CONSTANT; } - t_period_core = force->numeric(FLERR,arg[4]); - int seed_core = force->inumeric(FLERR,arg[5]); + t_period_core = utils::numeric(FLERR,arg[4],false,lmp); + int seed_core = utils::inumeric(FLERR,arg[5],false,lmp); // drude temperature - tstr_drude = NULL; + tstr_drude = nullptr; if (strstr(arg[7],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; tstr_drude = new char[n]; strcpy(tstr_drude,&arg[6][2]); tstyle_drude = EQUAL; } else { - t_start_drude = force->numeric(FLERR,arg[6]); + t_start_drude = utils::numeric(FLERR,arg[6],false,lmp); t_target_drude = t_start_drude; tstyle_drude = CONSTANT; } - t_period_drude = force->numeric(FLERR,arg[7]); - int seed_drude = force->inumeric(FLERR,arg[8]); + t_period_drude = utils::numeric(FLERR,arg[7],false,lmp); + int seed_drude = utils::inumeric(FLERR,arg[8],false,lmp); // error checks if (t_period_core <= 0.0) @@ -102,9 +102,9 @@ FixLangevinDrude::FixLangevinDrude(LAMMPS *lmp, int narg, char **arg) : tflag = 0; // no external compute/temp is specified yet (for bias) energy = 0.; - fix_drude = NULL; - temperature = NULL; - id_temp = NULL; + fix_drude = nullptr; + temperature = nullptr; + id_temp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -379,7 +379,7 @@ void *FixLangevinDrude::extract(const char *str, int &dim) } else if (strcmp(str,"t_target_drude") == 0) { return &t_target_drude; } else error->all(FLERR, "Illegal extract string in fix langevin/drude"); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp index fa4f761663..c6662c423d 100644 --- a/src/USER-DRUDE/pair_lj_cut_thole_long.cpp +++ b/src/USER-DRUDE/pair_lj_cut_thole_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_thole_long.h" -#include + #include #include #include "fix_drude.h" @@ -29,7 +29,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "modify.h" #include "domain.h" @@ -56,9 +56,9 @@ PairLJCutTholeLong::PairLJCutTholeLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; single_enable = 0; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ @@ -291,10 +291,10 @@ void PairLJCutTholeLong::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - thole_global = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + thole_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -320,17 +320,17 @@ void PairLJCutTholeLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double polar_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double polar_one = utils::numeric(FLERR,arg[4],false,lmp); double thole_one = thole_global; - if (narg >=6) thole_one = force->numeric(FLERR,arg[5]); + if (narg >=6) thole_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 7) cut_lj_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_lj_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -371,11 +371,11 @@ void PairLJCutTholeLong::init_style() // set rRESPA cutoffs - cut_respa = NULL; + cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -496,16 +496,16 @@ void PairLJCutTholeLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,nullptr,error); ascreen[i][j] = thole[i][j] / pow(polar[i][j], 1./3.); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -541,15 +541,15 @@ void PairLJCutTholeLong::write_restart_settings(FILE *fp) void PairLJCutTholeLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -602,5 +602,5 @@ void *PairLJCutTholeLong::extract(const char *str, int &dim) if (strcmp(str,"polar") == 0) return (void *) polar; if (strcmp(str,"thole") == 0) return (void *) thole; if (strcmp(str,"ascreen") == 0) return (void *) ascreen; - return NULL; + return nullptr; } diff --git a/src/USER-DRUDE/pair_thole.cpp b/src/USER-DRUDE/pair_thole.cpp index 4dd6cb12c0..e9c4f396d0 100644 --- a/src/USER-DRUDE/pair_thole.cpp +++ b/src/USER-DRUDE/pair_thole.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_thole.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "fix.h" #include "fix_drude.h" #include "domain.h" @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairThole::PairThole(LAMMPS *lmp) : Pair(lmp) { - fix_drude = NULL; + fix_drude = nullptr; } /* ---------------------------------------------------------------------- */ @@ -192,8 +192,8 @@ void PairThole::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - thole_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + thole_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -219,14 +219,14 @@ void PairThole::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double polar_one = force->numeric(FLERR,arg[2]); + double polar_one = utils::numeric(FLERR,arg[2],false,lmp); double thole_one = thole_global; double cut_one = cut_global; - if (narg >=4) thole_one = force->numeric(FLERR,arg[3]); - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg >=4) thole_one = utils::numeric(FLERR,arg[3],false,lmp); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -312,13 +312,13 @@ void PairThole::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&polar[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&thole[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); ascreen[i][j] = thole[i][j] / pow(polar[i][j], 1./3.); } MPI_Bcast(&polar[i][j],1,MPI_DOUBLE,0,world); @@ -348,10 +348,10 @@ void PairThole::write_restart_settings(FILE *fp) void PairThole::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&thole_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&thole_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); @@ -400,5 +400,5 @@ void *PairThole::extract(const char *str, int &dim) if (strcmp(str,"polar") == 0) return (void *) polar; if (strcmp(str,"thole") == 0) return (void *) thole; if (strcmp(str,"ascreen") == 0) return (void *) ascreen; - return NULL; + return nullptr; } diff --git a/src/USER-EFF/atom_vec_electron.cpp b/src/USER-EFF/atom_vec_electron.cpp index 0912fb0498..5ddc8a91b9 100644 --- a/src/USER-EFF/atom_vec_electron.cpp +++ b/src/USER-EFF/atom_vec_electron.cpp @@ -16,10 +16,11 @@ ------------------------------------------------------------------------- */ #include "atom_vec_electron.h" -#include + #include "atom.h" #include "citeme.h" -#include "error.h" + +#include using namespace LAMMPS_NS; @@ -40,8 +41,8 @@ AtomVecElectron::AtomVecElectron(LAMMPS *lmp) : AtomVec(lmp) { if (lmp->citeme) lmp->citeme->add(cite_user_eff_package); - mass_type = 1; - molecular = 0; + mass_type = PER_TYPE; + molecular = Atom::ATOMIC; forceclearflag = 1; atom->electron_flag = 1; diff --git a/src/USER-EFF/compute_ke_atom_eff.cpp b/src/USER-EFF/compute_ke_atom_eff.cpp index c943366f1b..e25f239adc 100644 --- a/src/USER-EFF/compute_ke_atom_eff.cpp +++ b/src/USER-EFF/compute_ke_atom_eff.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include "compute_ke_atom_eff.h" #include "atom.h" #include "update.h" @@ -40,7 +40,7 @@ ComputeKEAtomEff::ComputeKEAtomEff(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - ke = NULL; + ke = nullptr; // error check diff --git a/src/USER-EFF/compute_ke_eff.cpp b/src/USER-EFF/compute_ke_eff.cpp index 3e277fc66c..d1781b75f7 100644 --- a/src/USER-EFF/compute_ke_eff.cpp +++ b/src/USER-EFF/compute_ke_eff.cpp @@ -15,8 +15,8 @@ Contributing author: Andres Jaramillo-Botero ------------------------------------------------------------------------- */ -#include -#include + + #include "compute_ke_eff.h" #include "atom.h" #include "update.h" diff --git a/src/USER-EFF/compute_temp_deform_eff.cpp b/src/USER-EFF/compute_temp_deform_eff.cpp index dcf7e86234..979b47f50c 100644 --- a/src/USER-EFF/compute_temp_deform_eff.cpp +++ b/src/USER-EFF/compute_temp_deform_eff.cpp @@ -15,9 +15,9 @@ Contributing author: Andres Jaramillo-Botero (Caltech) ------------------------------------------------------------------------- */ -#include + #include -#include + #include "compute_temp_deform_eff.h" #include "domain.h" #include "atom.h" @@ -52,7 +52,7 @@ ComputeTempDeformEff::ComputeTempDeformEff(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-EFF/compute_temp_eff.cpp b/src/USER-EFF/compute_temp_eff.cpp index e9295ea680..174f032b83 100644 --- a/src/USER-EFF/compute_temp_eff.cpp +++ b/src/USER-EFF/compute_temp_eff.cpp @@ -16,8 +16,8 @@ ------------------------------------------------------------------------- */ #include "compute_temp_eff.h" -#include -#include + + #include "atom.h" #include "update.h" #include "force.h" diff --git a/src/USER-EFF/compute_temp_region_eff.cpp b/src/USER-EFF/compute_temp_region_eff.cpp index b27699cde9..f7c1bd5b68 100644 --- a/src/USER-EFF/compute_temp_region_eff.cpp +++ b/src/USER-EFF/compute_temp_region_eff.cpp @@ -15,9 +15,9 @@ Contributing author: Andres Jaramillo-Botero (Caltech) ------------------------------------------------------------------------- */ -#include + #include -#include + #include "compute_temp_region_eff.h" #include "atom.h" #include "update.h" @@ -55,7 +55,7 @@ ComputeTempRegionEff::ComputeTempRegionEff(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-EFF/fix_langevin_eff.cpp b/src/USER-EFF/fix_langevin_eff.cpp index 5158d7c681..a0aabb68a0 100644 --- a/src/USER-EFF/fix_langevin_eff.cpp +++ b/src/USER-EFF/fix_langevin_eff.cpp @@ -15,9 +15,9 @@ Contributing author: Andres Jaramillo-Botero ------------------------------------------------------------------------- */ -#include + #include -#include + #include "fix_langevin_eff.h" #include "atom.h" #include "update.h" @@ -45,7 +45,7 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevinEff::FixLangevinEff(LAMMPS *lmp, int narg, char **arg) : FixLangevin(lmp, narg, arg) { - erforcelangevin = NULL; + erforcelangevin = nullptr; } /* ---------------------------------------------------------------------- */ @@ -399,7 +399,7 @@ void FixLangevinEff::end_of_step() double FixLangevinEff::compute_scalar() { - if (!tallyflag || flangevin == NULL || erforcelangevin == NULL) return 0.0; + if (!tallyflag || flangevin == nullptr || erforcelangevin == nullptr) return 0.0; // capture the very first energy transfer to thermal reservoir diff --git a/src/USER-EFF/fix_nh_eff.cpp b/src/USER-EFF/fix_nh_eff.cpp index 034233732e..d5b574510c 100644 --- a/src/USER-EFF/fix_nh_eff.cpp +++ b/src/USER-EFF/fix_nh_eff.cpp @@ -15,10 +15,10 @@ Contributing author: Andres Jaramillo-Botero (Caltech) ------------------------------------------------------------------------- */ -#include + #include "fix_nh_eff.h" + #include "atom.h" -#include "atom_vec.h" #include "error.h" #include "domain.h" diff --git a/src/USER-EFF/fix_nve_eff.cpp b/src/USER-EFF/fix_nve_eff.cpp index ea719c91c0..f32a45fd46 100644 --- a/src/USER-EFF/fix_nve_eff.cpp +++ b/src/USER-EFF/fix_nve_eff.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include "fix_nve_eff.h" #include "atom.h" #include "force.h" diff --git a/src/USER-EFF/fix_nvt_sllod_eff.cpp b/src/USER-EFF/fix_nvt_sllod_eff.cpp index 0ebbf04d64..02a463b3ba 100644 --- a/src/USER-EFF/fix_nvt_sllod_eff.cpp +++ b/src/USER-EFF/fix_nvt_sllod_eff.cpp @@ -13,7 +13,7 @@ #include #include -#include + #include "fix_nvt_sllod_eff.h" #include "math_extra.h" #include "atom.h" diff --git a/src/USER-EFF/fix_temp_rescale_eff.cpp b/src/USER-EFF/fix_temp_rescale_eff.cpp index 4a8f4b0372..a013270049 100644 --- a/src/USER-EFF/fix_temp_rescale_eff.cpp +++ b/src/USER-EFF/fix_temp_rescale_eff.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include #include "fix_temp_rescale_eff.h" #include "atom.h" @@ -40,17 +40,17 @@ FixTempRescaleEff::FixTempRescaleEff(LAMMPS *lmp, int narg, char **arg) : { if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale/eff command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale/eff command"); scalar_flag = 1; global_freq = nevery; extscalar = 1; - t_start = force->numeric(FLERR,arg[4]); - t_stop = force->numeric(FLERR,arg[5]); - t_window = force->numeric(FLERR,arg[6]); - fraction = force->numeric(FLERR,arg[7]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); + t_window = utils::numeric(FLERR,arg[6],false,lmp); + fraction = utils::numeric(FLERR,arg[7],false,lmp); // create a new compute temp/eff // id = fix-ID + temp, compute group = fix group diff --git a/src/USER-EFF/pair_eff_cut.cpp b/src/USER-EFF/pair_eff_cut.cpp index f9333f4bec..57435b68de 100644 --- a/src/USER-EFF/pair_eff_cut.cpp +++ b/src/USER-EFF/pair_eff_cut.cpp @@ -15,9 +15,9 @@ Contributing author: Andres Jaramillo-Botero ------------------------------------------------------------------------- */ -#include + #include -#include + #include #include "pair_eff_cut.h" #include "pair_eff_inline.h" @@ -31,7 +31,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -42,8 +42,8 @@ PairEffCut::PairEffCut(LAMMPS *lmp) : Pair(lmp) single_enable = 0; nmax = 0; - min_eradius = NULL; - min_erforce = NULL; + min_eradius = nullptr; + min_erforce = nullptr; nextra = 4; pvector = new double[nextra]; } @@ -795,7 +795,7 @@ void PairEffCut::settings(int narg, char **arg) PAULI_CORE_D[14] = 0.0; PAULI_CORE_E[14] = 0.0; - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); limit_eradius_flag = 0; pressure_with_evirials_flag = 0; @@ -815,7 +815,7 @@ void PairEffCut::settings(int narg, char **arg) else if (strcmp(arg[iarg],"ecp") == 0) { iarg += 1; while (iarg < narg) { - atype = force->inumeric(FLERR,arg[iarg]); + atype = utils::inumeric(FLERR,arg[iarg],false,lmp); if (strcmp(arg[iarg+1],"C") == 0) ecp_type[atype] = 6; else if (strcmp(arg[iarg+1],"N") == 0) ecp_type[atype] = 7; else if (strcmp(arg[iarg+1],"O") == 0) ecp_type[atype] = 8; @@ -869,7 +869,7 @@ void PairEffCut::init_style() // make sure to use the appropriate timestep when using real units if (update->whichflag == 1) { - if (force->qqr2e == 332.06371 && update->dt == 1.0) + if (utils::strmatch(update->unit_style,"^real") && update->dt_default) error->all(FLERR,"Must lower the default real units timestep for pEFF "); } @@ -903,11 +903,11 @@ void PairEffCut::coeff(int narg, char **arg) if ((strcmp(arg[0],"*") == 0) || (strcmp(arg[1],"*") == 0)) { int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -920,19 +920,19 @@ void PairEffCut::coeff(int narg, char **arg) if (count == 0) error->all(FLERR,"Incorrect args for pair coefficients"); } else { int ecp; - ecp = force->inumeric(FLERR,arg[0]); + ecp = utils::inumeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"s") ==0) { - PAULI_CORE_A[ecp_type[ecp]] = force->numeric(FLERR,arg[2]); - PAULI_CORE_B[ecp_type[ecp]] = force->numeric(FLERR,arg[3]); - PAULI_CORE_C[ecp_type[ecp]] = force->numeric(FLERR,arg[4]); + PAULI_CORE_A[ecp_type[ecp]] = utils::numeric(FLERR,arg[2],false,lmp); + PAULI_CORE_B[ecp_type[ecp]] = utils::numeric(FLERR,arg[3],false,lmp); + PAULI_CORE_C[ecp_type[ecp]] = utils::numeric(FLERR,arg[4],false,lmp); PAULI_CORE_D[ecp_type[ecp]] = 0.0; PAULI_CORE_E[ecp_type[ecp]] = 0.0; } else if (strcmp(arg[1],"p") ==0) { - PAULI_CORE_A[ecp_type[ecp]] = force->numeric(FLERR,arg[2]); - PAULI_CORE_B[ecp_type[ecp]] = force->numeric(FLERR,arg[3]); - PAULI_CORE_C[ecp_type[ecp]] = force->numeric(FLERR,arg[4]); - PAULI_CORE_D[ecp_type[ecp]] = force->numeric(FLERR,arg[5]); - PAULI_CORE_E[ecp_type[ecp]] = force->numeric(FLERR,arg[6]); + PAULI_CORE_A[ecp_type[ecp]] = utils::numeric(FLERR,arg[2],false,lmp); + PAULI_CORE_B[ecp_type[ecp]] = utils::numeric(FLERR,arg[3],false,lmp); + PAULI_CORE_C[ecp_type[ecp]] = utils::numeric(FLERR,arg[4],false,lmp); + PAULI_CORE_D[ecp_type[ecp]] = utils::numeric(FLERR,arg[5],false,lmp); + PAULI_CORE_E[ecp_type[ecp]] = utils::numeric(FLERR,arg[6],false,lmp); } else error->all(FLERR,"Illegal pair_coeff command"); } } @@ -979,10 +979,10 @@ void PairEffCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -1006,9 +1006,9 @@ void PairEffCut::write_restart_settings(FILE *fp) void PairEffCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-FEP/compute_fep.cpp b/src/USER-FEP/compute_fep.cpp index 1853828db3..6ecf0795d7 100644 --- a/src/USER-FEP/compute_fep.cpp +++ b/src/USER-FEP/compute_fep.cpp @@ -18,7 +18,7 @@ #include "compute_fep.h" #include #include -#include + #include "comm.h" #include "update.h" #include "atom.h" @@ -35,6 +35,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; enum{PAIR,ATOM}; @@ -56,7 +57,7 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : fepinitflag = 0; // avoid init to run entirely when called by write_data - temp_fep = force->numeric(FLERR,arg[3]); + temp_fep = utils::numeric(FLERR,arg[3],false,lmp); // count # of perturbations @@ -94,10 +95,10 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : n = strlen(arg[iarg+2]) + 1; perturb[npert].pparam = new char[n]; strcpy(perturb[npert].pparam,arg[iarg+2]); - force->bounds(FLERR,arg[iarg+3],atom->ntypes, - perturb[npert].ilo,perturb[npert].ihi); - force->bounds(FLERR,arg[iarg+4],atom->ntypes, - perturb[npert].jlo,perturb[npert].jhi); + utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, + perturb[npert].ilo,perturb[npert].ihi,error); + utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, + perturb[npert].jlo,perturb[npert].jhi,error); if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) { n = strlen(&arg[iarg+5][2]) + 1; perturb[npert].var = new char[n]; @@ -111,8 +112,8 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : perturb[npert].aparam = CHARGE; chgflag = 1; } else error->all(FLERR,"Illegal atom argument in compute fep"); - force->bounds(FLERR,arg[iarg+2],atom->ntypes, - perturb[npert].ilo,perturb[npert].ihi); + utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, + perturb[npert].ilo,perturb[npert].ihi,error); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; perturb[npert].var = new char[n]; @@ -157,14 +158,14 @@ ComputeFEP::ComputeFEP(LAMMPS *lmp, int narg, char **arg) : // allocate space for charge, force, energy, virial arrays - f_orig = NULL; - q_orig = NULL; - peatom_orig = keatom_orig = NULL; - pvatom_orig = kvatom_orig = NULL; + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; allocate_storage(); - fixgpu = NULL; + fixgpu = nullptr; } /* ---------------------------------------------------------------------- */ @@ -209,17 +210,17 @@ void ComputeFEP::init() if (!input->variable->equalstyle(pert->ivar)) error->all(FLERR,"Variable for compute fep is of invalid style"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"compute fep pair requires pair interactions"); if (pert->which == PAIR) { pairflag = 1; Pair *pair = force->pair_match(pert->pstyle,1); - if (pair == NULL) error->all(FLERR,"compute fep pair style " + if (pair == nullptr) error->all(FLERR,"compute fep pair style " "does not exist"); void *ptr = pair->extract(pert->pparam,pert->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"compute fep pair style param not supported"); pert->array = (double **) ptr; @@ -496,10 +497,10 @@ void ComputeFEP::deallocate_storage() memory->destroy(keatom_orig); memory->destroy(kvatom_orig); - f_orig = NULL; - q_orig = NULL; - peatom_orig = keatom_orig = NULL; - pvatom_orig = kvatom_orig = NULL; + f_orig = nullptr; + q_orig = nullptr; + peatom_orig = keatom_orig = nullptr; + pvatom_orig = kvatom_orig = nullptr; } diff --git a/src/USER-FEP/fix_adapt_fep.cpp b/src/USER-FEP/fix_adapt_fep.cpp index 46cf32cf0b..ca9088836d 100644 --- a/src/USER-FEP/fix_adapt_fep.cpp +++ b/src/USER-FEP/fix_adapt_fep.cpp @@ -33,6 +33,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; @@ -46,7 +47,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 5) error->all(FLERR,"Illegal fix adapt/fep command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix adapt/fep command"); dynamic_group_allow = 1; @@ -93,10 +94,10 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : n = strlen(arg[iarg+2]) + 1; adapt[nadapt].pparam = new char[n]; strcpy(adapt[nadapt].pparam,arg[iarg+2]); - force->bounds(FLERR,arg[iarg+3],atom->ntypes, - adapt[nadapt].ilo,adapt[nadapt].ihi); - force->bounds(FLERR,arg[iarg+4],atom->ntypes, - adapt[nadapt].jlo,adapt[nadapt].jhi); + utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, + adapt[nadapt].ilo,adapt[nadapt].ihi,error); + utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, + adapt[nadapt].jlo,adapt[nadapt].jhi,error); if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) { n = strlen(&arg[iarg+5][2]) + 1; adapt[nadapt].var = new char[n]; @@ -124,8 +125,8 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : adapt[nadapt].aparam = CHARGE; chgflag = 1; } else error->all(FLERR,"Illegal fix adapt/fep command"); - force->bounds(FLERR,arg[iarg+2],atom->ntypes, - adapt[nadapt].ilo,adapt[nadapt].ihi); + utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes, + adapt[nadapt].ilo,adapt[nadapt].ihi,error); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; adapt[nadapt].var = new char[n]; @@ -171,7 +172,7 @@ FixAdaptFEP::FixAdaptFEP(LAMMPS *lmp, int narg, char **arg) : if (adapt[m].which == PAIR) memory->create(adapt[m].array_orig,n+1,n+1,"adapt:array_orig"); - id_fix_diam = id_fix_chg = NULL; + id_fix_diam = id_fix_chg = nullptr; } /* ---------------------------------------------------------------------- */ @@ -219,8 +220,8 @@ void FixAdaptFEP::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_diam = NULL; - id_fix_chg = NULL; + id_fix_diam = nullptr; + id_fix_chg = nullptr; char **newarg = new char*[6]; newarg[1] = group->names[igroup]; @@ -306,7 +307,7 @@ void FixAdaptFEP::init() if (ad->which == PAIR) { anypair = 1; - Pair *pair = NULL; + Pair *pair = nullptr; if (lmp->suffix_enable) { char psuffix[128]; @@ -315,11 +316,11 @@ void FixAdaptFEP::init() strcat(psuffix,lmp->suffix); pair = force->pair_match(psuffix,1); } - if (pair == NULL) pair = force->pair_match(ad->pstyle,1); - if (pair == NULL) + if (pair == nullptr) pair = force->pair_match(ad->pstyle,1); + if (pair == nullptr) error->all(FLERR, "Fix adapt/fep pair style does not exist"); void *ptr = pair->extract(ad->pparam,ad->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt/fep pair style param not supported"); ad->pdim = 2; @@ -339,7 +340,7 @@ void FixAdaptFEP::init() } } else if (ad->which == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Fix adapt/fep kspace style does not exist"); kspace_scale = (double *) force->kspace->extract("scale"); diff --git a/src/USER-FEP/pair_coul_cut_soft.cpp b/src/USER-FEP/pair_coul_cut_soft.cpp index eb872ab8b9..a68c136993 100644 --- a/src/USER-FEP/pair_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_coul_cut_soft.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_cut_soft.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -159,10 +159,10 @@ void PairCoulCutSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphac = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphac = utils::numeric(FLERR,arg[1],false,lmp); - cut_global = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -185,13 +185,13 @@ void PairCoulCutSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double lambda_one = force->numeric(FLERR,arg[2]); + double lambda_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -275,12 +275,12 @@ void PairCoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&lambda[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -309,12 +309,12 @@ void PairCoulCutSoft::write_restart_settings(FILE *fp) void PairCoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphac,1,MPI_DOUBLE,0,world); @@ -373,5 +373,5 @@ void *PairCoulCutSoft::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_coul_long_soft.cpp b/src/USER-FEP/pair_coul_long_soft.cpp index a631dca1b7..2749fe8c71 100644 --- a/src/USER-FEP/pair_coul_long_soft.cpp +++ b/src/USER-FEP/pair_coul_long_soft.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_long_soft.h" -#include + #include #include #include "atom.h" @@ -28,7 +28,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -186,10 +186,10 @@ void PairCoulLongSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphac = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphac = utils::numeric(FLERR,arg[1],false,lmp); - cut_coul = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[2],false,lmp); } /* ---------------------------------------------------------------------- @@ -203,10 +203,10 @@ void PairCoulLongSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double lambda_one = force->numeric(FLERR,arg[2]); + double lambda_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -236,7 +236,7 @@ void PairCoulLongSoft::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -295,11 +295,11 @@ void PairCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&lambda[i][j],1,MPI_DOUBLE,0,world); } } @@ -326,12 +326,12 @@ void PairCoulLongSoft::write_restart_settings(FILE *fp) void PairCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphac,1,MPI_DOUBLE,0,world); @@ -388,5 +388,5 @@ void *PairCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"scale") == 0) return (void *) scale; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp index 81c1599508..e6783b0228 100644 --- a/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_charmm_coul_long_soft.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_charmm_coul_long_soft.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -628,14 +628,14 @@ void PairLJCharmmCoulLongSoft::settings(int narg, char **arg) { if (narg != 5 && narg != 6) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_inner = force->numeric(FLERR,arg[3]); - cut_lj = force->numeric(FLERR,arg[4]); + cut_lj_inner = utils::numeric(FLERR,arg[3],false,lmp); + cut_lj = utils::numeric(FLERR,arg[4],false,lmp); if (narg == 5) cut_coul = cut_lj; - else cut_coul = force->numeric(FLERR,arg[5]); + else cut_coul = utils::numeric(FLERR,arg[5],false,lmp); } /* ---------------------------------------------------------------------- @@ -648,18 +648,18 @@ void PairLJCharmmCoulLongSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); double eps14_one = epsilon_one; double sigma14_one = sigma_one; if (narg == 7) { - eps14_one = force->numeric(FLERR,arg[5]); - sigma14_one = force->numeric(FLERR,arg[6]); + eps14_one = utils::numeric(FLERR,arg[5],false,lmp); + sigma14_one = utils::numeric(FLERR,arg[6],false,lmp); } int count = 0; @@ -728,11 +728,11 @@ void PairLJCharmmCoulLongSoft::init_style() error->all(FLERR,"Pair cutoff < Respa interior cutoff"); if (cut_lj_inner < cut_respa[1]) error->all(FLERR,"Pair inner cutoff < Respa interior cutoff"); - } else cut_respa = NULL; + } else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -819,15 +819,15 @@ void PairLJCharmmCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&eps14[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma14[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -862,15 +862,15 @@ void PairLJCharmmCoulLongSoft::write_restart_settings(FILE *fp) void PairLJCharmmCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -990,5 +990,5 @@ void *PairLJCharmmCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"implicit") == 0) return (void *) &implicit; if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp index 255bdf6a07..f8719b8900 100644 --- a/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_cut_soft.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2_coul_cut_soft.h" -#include + #include #include #include "atom.h" @@ -23,7 +23,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -198,13 +198,13 @@ void PairLJClass2CoulCutSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[4]); + else cut_coul_global = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -229,19 +229,19 @@ void PairLJClass2CoulCutSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[5]); - if (narg == 7) cut_coul_one = force->numeric(FLERR,arg[6]); + if (narg >= 6) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 7) cut_coul_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -382,15 +382,15 @@ void PairLJClass2CoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -425,15 +425,15 @@ void PairLJClass2CoulCutSoft::write_restart_settings(FILE *fp) void PairLJClass2CoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -515,5 +515,5 @@ void *PairLJClass2CoulCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp index dda10ed9e0..9741dd24ca 100644 --- a/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_coul_long_soft.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2_coul_long_soft.h" -#include + #include #include #include "atom.h" @@ -24,7 +24,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -213,13 +213,13 @@ void PairLJClass2CoulLongSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[4]); + else cut_coul = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -242,17 +242,17 @@ void PairLJClass2CoulLongSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -285,7 +285,7 @@ void PairLJClass2CoulLongSoft::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -397,14 +397,14 @@ void PairLJClass2CoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -438,15 +438,15 @@ void PairLJClass2CoulLongSoft::write_restart_settings(FILE *fp) void PairLJClass2CoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -537,5 +537,5 @@ void *PairLJClass2CoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_class2_soft.cpp b/src/USER-FEP/pair_lj_class2_soft.cpp index 957fc0f8ab..81319d715c 100644 --- a/src/USER-FEP/pair_lj_class2_soft.cpp +++ b/src/USER-FEP/pair_lj_class2_soft.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_class2_soft.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -169,10 +169,10 @@ void PairLJClass2Soft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); - cut_global = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -194,16 +194,16 @@ void PairLJClass2Soft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -321,14 +321,14 @@ void PairLJClass2Soft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -360,12 +360,12 @@ void PairLJClass2Soft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -432,5 +432,5 @@ void *PairLJClass2Soft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp index 3f85a2c8aa..53f39523e1 100644 --- a/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_cut_soft.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_cut_soft.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -198,13 +198,13 @@ void PairLJCutCoulCutSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[4]); + else cut_coul_global = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -230,19 +230,19 @@ void PairLJCutCoulCutSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[5]); - if (narg == 7) cut_coul_one = force->numeric(FLERR,arg[6]); + if (narg >= 6) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 7) cut_coul_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -378,15 +378,15 @@ void PairLJCutCoulCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -421,15 +421,15 @@ void PairLJCutCoulCutSoft::write_restart_settings(FILE *fp) void PairLJCutCoulCutSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -512,5 +512,5 @@ void *PairLJCutCoulCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp index c22b2ca673..61db28fe16 100644 --- a/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_coul_long_soft.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_long_soft.h" -#include + #include #include #include "atom.h" @@ -32,7 +32,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -566,13 +566,13 @@ void PairLJCutCoulLongSoft::settings(int narg, char **arg) { if (narg < 4 || narg > 5) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); - alphac = force->numeric(FLERR,arg[2]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); + alphac = utils::numeric(FLERR,arg[2],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[3]); + cut_lj_global = utils::numeric(FLERR,arg[3],false,lmp); if (narg == 4) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[4]); + else cut_coul = utils::numeric(FLERR,arg[4],false,lmp); // reset cutoffs that have been explicitly set @@ -595,17 +595,17 @@ void PairLJCutCoulLongSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -656,11 +656,11 @@ void PairLJCutCoulLongSoft::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -775,14 +775,14 @@ void PairLJCutCoulLongSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -816,15 +816,15 @@ void PairLJCutCoulLongSoft::write_restart_settings(FILE *fp) void PairLJCutCoulLongSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphac,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphac,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); @@ -923,5 +923,5 @@ void *PairLJCutCoulLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_soft.cpp b/src/USER-FEP/pair_lj_cut_soft.cpp index 92abdf540a..589e036420 100644 --- a/src/USER-FEP/pair_lj_cut_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_soft.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_soft.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -450,10 +450,10 @@ void PairLJCutSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->numeric(FLERR,arg[0]); - alphalj = force->numeric(FLERR,arg[1]); + nlambda = utils::numeric(FLERR,arg[0],false,lmp); + alphalj = utils::numeric(FLERR,arg[1],false,lmp); - cut_global = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -476,17 +476,17 @@ void PairLJCutSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double lambda_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigma_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -532,7 +532,7 @@ void PairLJCutSoft::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -636,14 +636,14 @@ void PairLJCutSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -676,13 +676,13 @@ void PairLJCutSoft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alphalj,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&alphalj,1,MPI_DOUBLE,0,world); @@ -748,5 +748,5 @@ void *PairLJCutSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp index 0601a641ac..748c616d64 100644 --- a/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_lj_cut_tip4p_long_soft.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_tip4p_long_soft.h" -#include + #include #include #include "angle.h" @@ -31,7 +31,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -53,8 +53,8 @@ PairLJCutTIP4PLongSoft::PairLJCutTIP4PLongSoft(LAMMPS *lmp) : respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -413,18 +413,18 @@ void PairLJCutTIP4PLongSoft::settings(int narg, char **arg) { if (narg < 9 || narg > 10) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); - nlambda = force->numeric(FLERR,arg[5]); - alphalj = force->numeric(FLERR,arg[6]); - alphac = force->numeric(FLERR,arg[7]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); + nlambda = utils::numeric(FLERR,arg[5],false,lmp); + alphalj = utils::numeric(FLERR,arg[6],false,lmp); + alphac = utils::numeric(FLERR,arg[7],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[8]); + cut_lj_global = utils::numeric(FLERR,arg[8],false,lmp); if (narg == 9) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[9]); + else cut_coul = utils::numeric(FLERR,arg[9],false,lmp); // reset cutoffs that have been explicitly set @@ -450,9 +450,9 @@ void PairLJCutTIP4PLongSoft::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style lj/cut/tip4p/long/soft requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairLJCutCoulLongSoft::init_style(); @@ -517,17 +517,17 @@ void PairLJCutTIP4PLongSoft::read_restart_settings(FILE *fp) PairLJCutCoulLongSoft::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); @@ -579,7 +579,7 @@ void *PairLJCutTIP4PLongSoft::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-FEP/pair_morse_soft.cpp b/src/USER-FEP/pair_morse_soft.cpp index c727ea0c2a..5154907ec3 100644 --- a/src/USER-FEP/pair_morse_soft.cpp +++ b/src/USER-FEP/pair_morse_soft.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_morse_soft.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "memory.h" #include "math_special.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathSpecial; @@ -177,16 +177,16 @@ void PairMorseSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); - double lambda_one = force->numeric(FLERR,arg[5]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double lambda_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -212,9 +212,9 @@ void PairMorseSoft::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - nlambda = force->inumeric(FLERR,arg[0]); - shift_range = force->numeric(FLERR,arg[1]); - cut_global = force->numeric(FLERR,arg[2]); + nlambda = utils::inumeric(FLERR,arg[0],false,lmp); + shift_range = utils::numeric(FLERR,arg[1],false,lmp); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -313,15 +313,15 @@ void PairMorseSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lambda[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -353,10 +353,10 @@ void PairMorseSoft::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&nlambda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift_range,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&nlambda,1,MPI_DOUBLE,0,world); MPI_Bcast(&shift_range,1,MPI_DOUBLE,0,world); @@ -450,5 +450,5 @@ void *PairMorseSoft::extract(const char *str, int &dim) if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } diff --git a/src/USER-FEP/pair_tip4p_long_soft.cpp b/src/USER-FEP/pair_tip4p_long_soft.cpp index d5e1ae116c..18e2667150 100644 --- a/src/USER-FEP/pair_tip4p_long_soft.cpp +++ b/src/USER-FEP/pair_tip4p_long_soft.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_tip4p_long_soft.h" -#include + #include #include #include "angle.h" @@ -31,7 +31,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -52,8 +52,8 @@ PairTIP4PLongSoft::PairTIP4PLongSoft(LAMMPS *lmp) : PairCoulLongSoft(lmp) respa_enable = 0; nmax = 0; - hneigh = NULL; - newsite = NULL; + hneigh = nullptr; + newsite = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -381,16 +381,16 @@ void PairTIP4PLongSoft::settings(int narg, char **arg) { if (narg != 8) error->all(FLERR,"Illegal pair_style command"); - typeO = force->inumeric(FLERR,arg[0]); - typeH = force->inumeric(FLERR,arg[1]); - typeB = force->inumeric(FLERR,arg[2]); - typeA = force->inumeric(FLERR,arg[3]); - qdist = force->numeric(FLERR,arg[4]); + typeO = utils::inumeric(FLERR,arg[0],false,lmp); + typeH = utils::inumeric(FLERR,arg[1],false,lmp); + typeB = utils::inumeric(FLERR,arg[2],false,lmp); + typeA = utils::inumeric(FLERR,arg[3],false,lmp); + qdist = utils::numeric(FLERR,arg[4],false,lmp); - nlambda = force->numeric(FLERR,arg[5]); - alphac = force->numeric(FLERR,arg[6]); + nlambda = utils::numeric(FLERR,arg[5],false,lmp); + alphac = utils::numeric(FLERR,arg[6],false,lmp); - cut_coul = force->numeric(FLERR,arg[7]); + cut_coul = utils::numeric(FLERR,arg[7],false,lmp); } /* ---------------------------------------------------------------------- @@ -407,9 +407,9 @@ void PairTIP4PLongSoft::init_style() if (!atom->q_flag) error->all(FLERR, "Pair style tip4p/long requires atom attribute q"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must use a bond style with TIP4P potential"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must use an angle style with TIP4P potential"); PairCoulLongSoft::init_style(); @@ -454,11 +454,11 @@ void PairTIP4PLongSoft::read_restart_settings(FILE *fp) PairCoulLongSoft::read_restart_settings(fp); if (comm->me == 0) { - utils::sfread(FLERR,&typeO,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeH,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeB,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&typeA,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&qdist,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&typeO,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeH,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeB,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&typeA,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&qdist,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&typeO,1,MPI_INT,0,world); MPI_Bcast(&typeH,1,MPI_INT,0,world); @@ -501,7 +501,7 @@ void *PairTIP4PLongSoft::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; dim = 2; if (strcmp(str,"lambda") == 0) return (void *) lambda; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-H5MD/dump_h5md.cpp b/src/USER-H5MD/dump_h5md.cpp index af77258780..11a4906263 100644 --- a/src/USER-H5MD/dump_h5md.cpp +++ b/src/USER-H5MD/dump_h5md.cpp @@ -17,7 +17,7 @@ #include #include -#include + #include #include #include "ch5md.h" @@ -68,13 +68,13 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) size_one = 6; sort_flag = 1; sortcol = 0; - format_default = NULL; + format_default = nullptr; flush_flag = 0; unwrap_flag = 0; datafile_from_dump = -1; - author_name=NULL; + author_name=nullptr; - every_dump = force->inumeric(FLERR,arg[3]); + every_dump = utils::inumeric(FLERR,arg[3],false,lmp); every_position = every_image = -1; every_velocity = every_force = every_species = -1; every_charge = -1; @@ -175,7 +175,7 @@ DumpH5MD::DumpH5MD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) if (iarg+1>=narg) { error->all(FLERR, "Invalid number of arguments in dump h5md"); } - if (author_name==NULL) { + if (author_name==nullptr) { author_name = new char[strlen(arg[iarg])+1]; strcpy(author_name, arg[iarg+1]); } else { @@ -271,10 +271,10 @@ void DumpH5MD::openfile() if (me == 0) { if (datafile_from_dump<0) { - if (author_name==NULL) { - datafile = h5md_create_file(filename, "N/A", NULL, "lammps", LAMMPS_VERSION); + if (author_name==nullptr) { + datafile = h5md_create_file(filename, "N/A", nullptr, "lammps", LAMMPS_VERSION); } else { - datafile = h5md_create_file(filename, author_name, NULL, "lammps", LAMMPS_VERSION); + datafile = h5md_create_file(filename, author_name, nullptr, "lammps", LAMMPS_VERSION); } group_name_length = strlen(group->names[igroup])+1; group_name = new char[group_name_length]; @@ -288,19 +288,19 @@ void DumpH5MD::openfile() dims[0] = natoms; dims[1] = domain->dimension; if (every_position>0) { - particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, NULL); - h5md_create_box(&particles_data, dims[1], boundary, true, NULL, &particles_data.position); + particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, nullptr); + h5md_create_box(&particles_data, dims[1], boundary, true, nullptr, &particles_data.position); } if (every_image>0) particles_data.image = h5md_create_time_data(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, &particles_data.position); if (every_velocity>0) - particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_force>0) - particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_species>0) - particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, NULL); + particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, nullptr); if (every_charge>0) { - particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, nullptr); h5md_write_string_attribute(particles_data.group, "charge", "type", "effective"); } } else { @@ -318,26 +318,26 @@ void DumpH5MD::openfile() dims[0] = natoms; dims[1] = domain->dimension; if (every_position>0) { - particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, NULL); - h5md_create_box(&particles_data, dims[1], boundary, true, NULL, &particles_data.position); + particles_data.position = h5md_create_time_data(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, nullptr); + h5md_create_box(&particles_data, dims[1], boundary, true, nullptr, &particles_data.position); } if (every_image>0) particles_data.image = h5md_create_time_data(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, &particles_data.position); if (every_velocity>0) - particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.velocity = h5md_create_time_data(particles_data.group, "velocity", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_force>0) - particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.force = h5md_create_time_data(particles_data.group, "force", 2, dims, H5T_NATIVE_DOUBLE, nullptr); if (every_species>0) - particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, NULL); + particles_data.species = h5md_create_time_data(particles_data.group, "species", 1, dims, H5T_NATIVE_INT, nullptr); if (every_charge>0) { - particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, NULL); + particles_data.charge = h5md_create_time_data(particles_data.group, "charge", 1, dims, H5T_NATIVE_DOUBLE, nullptr); h5md_write_string_attribute(particles_data.group, "charge", "type", "effective"); } } } - if (author_name!=NULL) delete [] author_name; + if (author_name!=nullptr) delete [] author_name; for (int i=0; i<3; i++) { delete [] boundary[i]; } @@ -536,7 +536,7 @@ void DumpH5MD::write_fixed_frame() edges[2] = boxzhi - boxzlo; if (every_position==0) { particles_data.position = h5md_create_fixed_data_simple(particles_data.group, "position", 2, dims, H5T_NATIVE_DOUBLE, dump_position); - h5md_create_box(&particles_data, dims[1], boundary, false, edges, NULL); + h5md_create_box(&particles_data, dims[1], boundary, false, edges, nullptr); if (every_image==0) particles_data.image = h5md_create_fixed_data_simple(particles_data.group, "image", 2, dims, H5T_NATIVE_INT, dump_image); } diff --git a/src/USER-INTEL/angle_charmm_intel.cpp b/src/USER-INTEL/angle_charmm_intel.cpp index 9275e82f1c..7aad7f754a 100644 --- a/src/USER-INTEL/angle_charmm_intel.cpp +++ b/src/USER-INTEL/angle_charmm_intel.cpp @@ -15,20 +15,21 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "angle_charmm_intel.h" + #include "atom.h" -#include "neighbor.h" -#include "domain.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "modify.h" #include "math_const.h" #include "memory.h" +#include "modify.h" +#include "neighbor.h" #include "suffix.h" -#include "error.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-INTEL/angle_charmm_intel.h b/src/USER-INTEL/angle_charmm_intel.h index 155ecfaff9..798e3d1523 100644 --- a/src/USER-INTEL/angle_charmm_intel.h +++ b/src/USER-INTEL/angle_charmm_intel.h @@ -61,7 +61,7 @@ class AngleCharmmIntel : public AngleCharmm { fc_packed1 *fc; ForceConst() : _nangletypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nangletypes, Memory *memory); diff --git a/src/USER-INTEL/angle_harmonic_intel.cpp b/src/USER-INTEL/angle_harmonic_intel.cpp index 49a71038da..290f7320b1 100644 --- a/src/USER-INTEL/angle_harmonic_intel.cpp +++ b/src/USER-INTEL/angle_harmonic_intel.cpp @@ -15,20 +15,21 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "angle_harmonic_intel.h" + #include "atom.h" -#include "neighbor.h" -#include "domain.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "modify.h" #include "math_const.h" #include "memory.h" +#include "modify.h" +#include "neighbor.h" #include "suffix.h" -#include "error.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-INTEL/angle_harmonic_intel.h b/src/USER-INTEL/angle_harmonic_intel.h index c00292f7ce..7df4a98877 100644 --- a/src/USER-INTEL/angle_harmonic_intel.h +++ b/src/USER-INTEL/angle_harmonic_intel.h @@ -61,7 +61,7 @@ class AngleHarmonicIntel : public AngleHarmonic { fc_packed1 *fc; ForceConst() : _nangletypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nangletypes, Memory *memory); diff --git a/src/USER-INTEL/bond_fene_intel.cpp b/src/USER-INTEL/bond_fene_intel.cpp index 5c58e7bf10..6b458aeefb 100644 --- a/src/USER-INTEL/bond_fene_intel.cpp +++ b/src/USER-INTEL/bond_fene_intel.cpp @@ -15,19 +15,21 @@ Contributing author: Stan Moore (Sandia) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include + #include "bond_fene_intel.h" + #include "atom.h" -#include "modify.h" -#include "neighbor.h" -#include "domain.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" +#include "modify.h" +#include "neighbor.h" #include "suffix.h" -#include "error.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/bond_fene_intel.h b/src/USER-INTEL/bond_fene_intel.h index 58fcdb8669..92ec4097c0 100644 --- a/src/USER-INTEL/bond_fene_intel.h +++ b/src/USER-INTEL/bond_fene_intel.h @@ -61,7 +61,7 @@ class BondFENEIntel : public BondFENE { fc_packed1 *fc; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/bond_harmonic_intel.cpp b/src/USER-INTEL/bond_harmonic_intel.cpp index 8bf0a82218..84d94b8f3d 100644 --- a/src/USER-INTEL/bond_harmonic_intel.cpp +++ b/src/USER-INTEL/bond_harmonic_intel.cpp @@ -15,19 +15,20 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "bond_harmonic_intel.h" + #include "atom.h" -#include "modify.h" -#include "neighbor.h" -#include "domain.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" +#include "modify.h" +#include "neighbor.h" #include "suffix.h" -#include "error.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/bond_harmonic_intel.h b/src/USER-INTEL/bond_harmonic_intel.h index 3c1d050a3b..449df3b7a8 100644 --- a/src/USER-INTEL/bond_harmonic_intel.h +++ b/src/USER-INTEL/bond_harmonic_intel.h @@ -61,7 +61,7 @@ class BondHarmonicIntel : public BondHarmonic { fc_packed1 *fc; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_charmm_intel.cpp b/src/USER-INTEL/dihedral_charmm_intel.cpp index 61fc1dfbd5..ddfa0c1228 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.cpp +++ b/src/USER-INTEL/dihedral_charmm_intel.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "omp_compat.h" -#include + #include #include "dihedral_charmm_intel.h" #include "atom.h" diff --git a/src/USER-INTEL/dihedral_charmm_intel.h b/src/USER-INTEL/dihedral_charmm_intel.h index d80b32c8ac..bb830b7292 100644 --- a/src/USER-INTEL/dihedral_charmm_intel.h +++ b/src/USER-INTEL/dihedral_charmm_intel.h @@ -66,7 +66,7 @@ class DihedralCharmmIntel : public DihedralCharmm { flt_t *weight; ForceConst() : _npairtypes(0), _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, 0, NULL); } + ~ForceConst() { set_ntypes(0, 0, nullptr); } void set_ntypes(const int npairtypes, const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_fourier_intel.cpp b/src/USER-INTEL/dihedral_fourier_intel.cpp index fb8051474e..67b82b62bf 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.cpp +++ b/src/USER-INTEL/dihedral_fourier_intel.cpp @@ -15,22 +15,22 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "dihedral_fourier_intel.h" + #include "atom.h" #include "comm.h" +#include "error.h" +#include "force.h" #include "memory.h" #include "modify.h" #include "neighbor.h" -#include "domain.h" -#include "force.h" -#include "pair.h" -#include "update.h" -#include "error.h" - #include "suffix.h" +#include "update.h" + +#include + +#include "omp_compat.h" + using namespace LAMMPS_NS; #define PTOLERANCE (flt_t)1.05 diff --git a/src/USER-INTEL/dihedral_fourier_intel.h b/src/USER-INTEL/dihedral_fourier_intel.h index 26007f4118..f91d89f6bc 100644 --- a/src/USER-INTEL/dihedral_fourier_intel.h +++ b/src/USER-INTEL/dihedral_fourier_intel.h @@ -63,7 +63,7 @@ class DihedralFourierIntel : public DihedralFourier { fc_packed1 **bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, NULL, NULL); } + ~ForceConst() { set_ntypes(0, nullptr, nullptr, nullptr); } void set_ntypes(const int nbondtypes, int *setflag, int *nterms, Memory *memory); diff --git a/src/USER-INTEL/dihedral_harmonic_intel.cpp b/src/USER-INTEL/dihedral_harmonic_intel.cpp index f6c4ea0fde..ea9bc33c57 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.cpp +++ b/src/USER-INTEL/dihedral_harmonic_intel.cpp @@ -15,22 +15,22 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "dihedral_harmonic_intel.h" + #include "atom.h" #include "comm.h" +#include "error.h" +#include "force.h" #include "memory.h" #include "modify.h" #include "neighbor.h" -#include "domain.h" -#include "force.h" -#include "pair.h" -#include "update.h" -#include "error.h" - #include "suffix.h" +#include "update.h" + +#include + +#include "omp_compat.h" + using namespace LAMMPS_NS; #define PTOLERANCE (flt_t)1.05 diff --git a/src/USER-INTEL/dihedral_harmonic_intel.h b/src/USER-INTEL/dihedral_harmonic_intel.h index 0a9cfaa042..cdbae365fd 100644 --- a/src/USER-INTEL/dihedral_harmonic_intel.h +++ b/src/USER-INTEL/dihedral_harmonic_intel.h @@ -63,7 +63,7 @@ class DihedralHarmonicIntel : public DihedralHarmonic { fc_packed1 *bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/dihedral_opls_intel.cpp b/src/USER-INTEL/dihedral_opls_intel.cpp index 79a8874a72..fa8fd53def 100644 --- a/src/USER-INTEL/dihedral_opls_intel.cpp +++ b/src/USER-INTEL/dihedral_opls_intel.cpp @@ -15,22 +15,22 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "dihedral_opls_intel.h" + #include "atom.h" #include "comm.h" +#include "error.h" +#include "force.h" #include "memory.h" #include "modify.h" #include "neighbor.h" -#include "domain.h" -#include "force.h" -#include "pair.h" -#include "update.h" -#include "error.h" - #include "suffix.h" +#include "update.h" + +#include + +#include "omp_compat.h" + using namespace LAMMPS_NS; #define PTOLERANCE (flt_t)1.05 diff --git a/src/USER-INTEL/dihedral_opls_intel.h b/src/USER-INTEL/dihedral_opls_intel.h index 1080bfa6c3..77fd8c4b95 100644 --- a/src/USER-INTEL/dihedral_opls_intel.h +++ b/src/USER-INTEL/dihedral_opls_intel.h @@ -62,7 +62,7 @@ class DihedralOPLSIntel : public DihedralOPLS { fc_packed1 *bp; ForceConst() : _nbondtypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nbondtypes, Memory *memory); diff --git a/src/USER-INTEL/fix_intel.cpp b/src/USER-INTEL/fix_intel.cpp index 1f8b5175b8..de1f947bc2 100644 --- a/src/USER-INTEL/fix_intel.cpp +++ b/src/USER-INTEL/fix_intel.cpp @@ -16,8 +16,8 @@ Anupama Kurpad (Intel) - Host Affinitization ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "fix_intel.h" + #include "comm.h" #include "error.h" #include "force.h" @@ -25,16 +25,9 @@ #include "neigh_request.h" #include "pair.h" #include "pair_hybrid.h" -#include "pair_hybrid_overlay.h" -#include "timer.h" -#include "universe.h" #include "update.h" -#include "utils.h" #include -#include -#include -#include #ifdef _LMP_INTEL_OFFLOAD #ifndef INTEL_OFFLOAD_NOAFFINITY @@ -59,7 +52,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal package intel command"); - int ncops = force->inumeric(FLERR,arg[3]); + int ncops = utils::inumeric(FLERR,arg[3],false,lmp); _nbor_pack_width = 1; _three_body_neighbor = 0; @@ -106,7 +99,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) while (iarg < narg) { if (strcmp(arg[iarg],"omp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); - nomp = force->inumeric(FLERR,arg[iarg+1]); + nomp = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mode") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); @@ -120,7 +113,7 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) iarg += 2; } else if (strcmp(arg[iarg],"balance") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); - _offload_balance = force->numeric(FLERR,arg[iarg+1]); + _offload_balance = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "ghost") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal package intel command"); @@ -167,9 +160,9 @@ FixIntel::FixIntel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // if using LRT mode, create the integrate style if (_lrt) { - char *str; - str = (char *) "verlet/lrt/intel"; - update->create_integrate(1,&str,0); + char *cmd[1]; + cmd[0] = (char *) "verlet/lrt/intel"; + update->create_integrate(1,cmd,0); } // error check @@ -310,7 +303,7 @@ void FixIntel::init() #endif const int nstyles = _pair_intel_count; - if (force->pair_match("^hybrid", 0) != NULL) { + if (force->pair_match("^hybrid", 0) != nullptr) { _pair_hybrid_flag = 1; if (force->newton_pair != 0 && force->pair->no_virial_fdotr_compute) error->all(FLERR, @@ -448,7 +441,7 @@ void FixIntel::pair_init_check(const bool cdmessage) } #ifndef LMP_INTEL_NBOR_COMPAT - if (force->pair->manybody_flag && atom->molecular) { + if (force->pair->manybody_flag && (atom->molecular != Atom::ATOMIC)) { int flag = 0; if (atom->nbonds > 0 && force->special_lj[1] == 0.0 && force->special_coul[1] == 0.0) flag = 1; @@ -463,7 +456,7 @@ void FixIntel::pair_init_check(const bool cdmessage) #endif int need_tag = 0; - if (atom->molecular) need_tag = 1; + if (atom->molecular != Atom::ATOMIC) need_tag = 1; // Clear buffers used for pair style char kmode[80]; @@ -514,15 +507,15 @@ void FixIntel::pair_init_check(const bool cdmessage) void FixIntel::bond_init_check() { - if (_offload_balance != 0.0 && atom->molecular && - force->newton_pair != force->newton_bond) + if ((_offload_balance != 0.0) && (atom->molecular != Atom::ATOMIC) + && (force->newton_pair != force->newton_bond)) error->all(FLERR, "USER-INTEL package requires same setting for newton bond and non-bond."); int intel_pair = 0; - if (force->pair_match("/intel$", 0) != NULL) + if (force->pair_match("/intel$", 0) != nullptr) intel_pair = 1; - else if (force->pair_match("^hybrid", 0) != NULL) { + else if (force->pair_match("^hybrid", 0) != nullptr) { _hybrid_nonpair = 1; if (pair_hybrid_check()) intel_pair = 1; } @@ -537,9 +530,9 @@ void FixIntel::bond_init_check() void FixIntel::kspace_init_check() { int intel_pair = 0; - if (force->pair_match("/intel$", 0) != NULL) + if (force->pair_match("/intel$", 0) != nullptr) intel_pair = 1; - else if (force->pair_match("^hybrid", 0) != NULL) { + else if (force->pair_match("^hybrid", 0) != nullptr) { _hybrid_nonpair = 1; if (pair_hybrid_check()) intel_pair = 1; } @@ -862,7 +855,7 @@ void FixIntel::add_oresults(const ft * _noalias const f_in, } } - if (ev_global != NULL) { + if (ev_global != nullptr) { force->pair->eng_vdwl += ev_global[0]; force->pair->eng_coul += ev_global[1]; force->pair->virial[0] += ev_global[2]; @@ -1175,7 +1168,7 @@ int FixIntel::set_host_affinity(const int nomp) sprintf(cmd, "lscpu -p | grep -v '#' |" "sort -t, -k 3,3n -k 2,2n | awk -F, '{print $1}'"); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; ncores = 0; while(fgets(readbuf, 512, p)) { proc_list[ncores] = atoi(readbuf); @@ -1197,7 +1190,7 @@ int FixIntel::set_host_affinity(const int nomp) int nthreads = nomp; if (nthreads == 0) { estring = getenv("OMP_NUM_THREADS"); - if (estring != NULL) { + if (estring != nullptr) { nthreads = atoi(estring); if (nthreads < 2) nthreads = 1; } else @@ -1229,7 +1222,7 @@ int FixIntel::set_host_affinity(const int nomp) if (coi_cores) { sprintf(cmd, "ps -Lp %d -o lwp | awk ' (NR > 2) {print}'", pid); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; while(fgets(readbuf, 512, p)) { lwp = atoi(readbuf); @@ -1265,7 +1258,7 @@ int FixIntel::set_host_affinity(const int nomp) free(buf1); p = popen(cmd, "r"); - if (p == NULL) return -1; + if (p == nullptr) return -1; while(fgets(readbuf, 512, p)) { lwp = atoi(readbuf); diff --git a/src/USER-INTEL/fix_intel.h b/src/USER-INTEL/fix_intel.h index 4c50164d31..df3aecbc81 100644 --- a/src/USER-INTEL/fix_intel.h +++ b/src/USER-INTEL/fix_intel.h @@ -167,8 +167,8 @@ class FixIntel : public Fix { inline void zero_timers() {} inline void start_watch(const int /*which*/) {} inline double stop_watch(const int /*which*/) { return 0.0; } - double * off_watch_pair() { return NULL; } - double * off_watch_neighbor() { return NULL; } + double * off_watch_pair() { return nullptr; } + double * off_watch_neighbor() { return nullptr; } inline void balance_stamp() {} inline void acc_timers() {} inline int separate_buffers() { return 0; } diff --git a/src/USER-INTEL/fix_nh_intel.cpp b/src/USER-INTEL/fix_nh_intel.cpp index a072e823a4..2122bfd370 100644 --- a/src/USER-INTEL/fix_nh_intel.cpp +++ b/src/USER-INTEL/fix_nh_intel.cpp @@ -16,12 +16,11 @@ ------------------------------------------------------------------------- */ #include "fix_nh_intel.h" + #include "atom.h" -#include "compute.h" #include "domain.h" #include "error.h" #include "force.h" -#include "kspace.h" #include "memory.h" #include "modify.h" #include "neighbor.h" @@ -29,7 +28,6 @@ #include #include -#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-INTEL/fix_nve_asphere_intel.cpp b/src/USER-INTEL/fix_nve_asphere_intel.cpp index 7eeb8a1635..55e51227f4 100644 --- a/src/USER-INTEL/fix_nve_asphere_intel.cpp +++ b/src/USER-INTEL/fix_nve_asphere_intel.cpp @@ -15,18 +15,16 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include -#include -#include #include "fix_nve_asphere_intel.h" -#include "math_extra_intel.h" + #include "atom.h" #include "atom_vec_ellipsoid.h" +#include "error.h" #include "force.h" +#include "math_extra_intel.h" +#include "memory.h" #include "neighbor.h" #include "update.h" -#include "memory.h" -#include "error.h" using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-INTEL/fix_nvt_sllod_intel.cpp b/src/USER-INTEL/fix_nvt_sllod_intel.cpp index f5a5dabfb1..4382542710 100644 --- a/src/USER-INTEL/fix_nvt_sllod_intel.cpp +++ b/src/USER-INTEL/fix_nvt_sllod_intel.cpp @@ -11,18 +11,19 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include -#include #include "fix_nvt_sllod_intel.h" -#include "math_extra.h" + #include "atom.h" +#include "compute.h" #include "domain.h" -#include "group.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "fix_deform.h" -#include "compute.h" -#include "error.h" +#include "group.h" +#include "math_extra.h" +#include "modify.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-INTEL/improper_cvff_intel.cpp b/src/USER-INTEL/improper_cvff_intel.cpp index 4562c63cdb..ba5ff79cd5 100644 --- a/src/USER-INTEL/improper_cvff_intel.cpp +++ b/src/USER-INTEL/improper_cvff_intel.cpp @@ -15,22 +15,22 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include -#include #include "improper_cvff_intel.h" + #include "atom.h" #include "comm.h" -#include "neighbor.h" -#include "domain.h" +#include "error.h" #include "force.h" -#include "update.h" #include "math_const.h" #include "memory.h" #include "modify.h" +#include "neighbor.h" #include "suffix.h" -#include "error.h" +#include "update.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-INTEL/improper_cvff_intel.h b/src/USER-INTEL/improper_cvff_intel.h index 812b49d50c..94aa29c55f 100644 --- a/src/USER-INTEL/improper_cvff_intel.h +++ b/src/USER-INTEL/improper_cvff_intel.h @@ -62,7 +62,7 @@ class ImproperCvffIntel : public ImproperCvff { fc_packed1 *fc; ForceConst() : _nimpropertypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nimpropertypes, Memory *memory); diff --git a/src/USER-INTEL/improper_harmonic_intel.cpp b/src/USER-INTEL/improper_harmonic_intel.cpp index fc5cf08c52..8da3c67022 100644 --- a/src/USER-INTEL/improper_harmonic_intel.cpp +++ b/src/USER-INTEL/improper_harmonic_intel.cpp @@ -15,22 +15,23 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include -#include + #include "improper_harmonic_intel.h" + #include "atom.h" #include "comm.h" -#include "neighbor.h" -#include "domain.h" +#include "error.h" #include "force.h" -#include "update.h" #include "math_const.h" #include "memory.h" #include "modify.h" +#include "neighbor.h" #include "suffix.h" -#include "error.h" +#include "update.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-INTEL/improper_harmonic_intel.h b/src/USER-INTEL/improper_harmonic_intel.h index 6d7c829961..ce1da11a33 100644 --- a/src/USER-INTEL/improper_harmonic_intel.h +++ b/src/USER-INTEL/improper_harmonic_intel.h @@ -62,7 +62,7 @@ class ImproperHarmonicIntel : public ImproperHarmonic { fc_packed1 *fc; ForceConst() : _nimpropertypes(0) {} - ~ForceConst() { set_ntypes(0, NULL); } + ~ForceConst() { set_ntypes(0, nullptr); } void set_ntypes(const int nimpropertypes, Memory *memory); diff --git a/src/USER-INTEL/intel_buffers.cpp b/src/USER-INTEL/intel_buffers.cpp index 04791dee78..168074eb3e 100644 --- a/src/USER-INTEL/intel_buffers.cpp +++ b/src/USER-INTEL/intel_buffers.cpp @@ -12,8 +12,8 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include #include "intel_buffers.h" + #include "force.h" #include "memory.h" @@ -123,9 +123,9 @@ void IntelBuffers::_grow(const int nall, const int nlocal, _buf_local_size = static_cast(nlocal) * 1.1 + 1; const int f_stride = get_stride(_buf_local_size); lmp->memory->create(_x, _buf_size,"intel_x"); - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) lmp->memory->create(_q, _buf_size, "intel_q"); - if (lmp->atom->ellipsoid != NULL) + if (lmp->atom->ellipsoid != nullptr) lmp->memory->create(_quat, _buf_size, "intel_quat"); #ifdef _LMP_INTEL_OFFLOAD if (lmp->force->newton_pair) @@ -139,9 +139,9 @@ void IntelBuffers::_grow(const int nall, const int nlocal, #ifdef _LMP_INTEL_OFFLOAD if (_separate_buffers) { lmp->memory->create(_host_x, _buf_size,"intel_host_x"); - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) lmp->memory->create(_host_q, _buf_size, "intel_host_q"); - if (lmp->atom->ellipsoid != NULL) + if (lmp->atom->ellipsoid != nullptr) lmp->memory->create(_host_quat, _buf_size, "intel_host_quat"); } @@ -154,24 +154,24 @@ void IntelBuffers::_grow(const int nall, const int nlocal, const flt_t * const q = get_q(); const vec3_acc_t * f_start = get_off_f(); acc_t * ev_global = get_ev_global(); - if (lmp->atom->q != NULL) { - if (x != NULL && q != NULL && f_start != NULL && ev_global != NULL) { + if (lmp->atom->q != nullptr) { + if (x != nullptr && q != nullptr && f_start != nullptr && ev_global != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(x,q:length(_buf_size) alloc_if(1) free_if(0)) \ nocopy(f_start:length(f_stride*fm) alloc_if(1) free_if(0))\ nocopy(ev_global:length(8) alloc_if(1) free_if(0)) } } else { - if (x != NULL && f_start != NULL && ev_global != NULL) { + if (x != nullptr && f_start != nullptr && ev_global != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(x:length(_buf_size) alloc_if(1) free_if(0)) \ nocopy(f_start:length(f_stride*fm) alloc_if(1) free_if(0))\ nocopy(ev_global:length(8) alloc_if(1) free_if(0)) } } - if (lmp->atom->ellipsoid != NULL) { + if (lmp->atom->ellipsoid != nullptr) { const quat_t * const quat = get_quat(); - if (quat != NULL) { + if (quat != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(quat:length(_buf_size) alloc_if(1) free_if(0)) } @@ -252,7 +252,7 @@ void IntelBuffers::free_list_local() int * cnumneigh = _neigh_list_ptrs[0].cnumneigh; _neigh_list_ptrs[0].cnumneigh = 0; #ifdef _LMP_INTEL_OFFLOAD - if (_off_map_ilist != NULL) { + if (_off_map_ilist != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cnumneigh:alloc_if(0) free_if(1)) } @@ -261,11 +261,11 @@ void IntelBuffers::free_list_local() } #ifdef _LMP_INTEL_OFFLOAD - if (_off_map_ilist != NULL) { + if (_off_map_ilist != nullptr) { const int * ilist = _off_map_ilist; const int * numneigh = _off_map_numneigh; const int ** firstneigh = (const int **)_off_map_firstneigh; - _off_map_ilist = NULL; + _off_map_ilist = nullptr; #pragma offload_transfer target(mic:_cop) \ nocopy(ilist,firstneigh,numneigh:alloc_if(0) free_if(1)) } @@ -402,7 +402,7 @@ void IntelBuffers::_grow_nbor_list(NeighList * /*list*/, if (offload_end > 0) { int * list_alloc =_list_alloc; - if (list_alloc != NULL) { + if (list_alloc != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(list_alloc:length(list_alloc_size) alloc_if(1) free_if(0)) _off_list_alloc = true; @@ -497,8 +497,8 @@ void IntelBuffers::grow_ccache(const int off_flag, int *ccachei = _ccachei; int *ccachej = _ccachej; - if (ccachex != NULL && ccachey !=NULL && ccachez != NULL && - ccachew != NULL && ccachei != NULL && ccachej !=NULL) { + if (ccachex != nullptr && ccachey !=nullptr && ccachez != nullptr && + ccachew != nullptr && ccachei != nullptr && ccachej !=nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ccachex,ccachey:length(vsize) alloc_if(1) free_if(0)) \ nocopy(ccachez,ccachew:length(vsize) alloc_if(1) free_if(0)) \ @@ -506,7 +506,7 @@ void IntelBuffers::grow_ccache(const int off_flag, in(ccachej:length(vsize) alloc_if(1) free_if(0)) } #ifdef LMP_USE_AVXCD - if (ccachef != NULL) { + if (ccachef != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ccachef:length(_ccache_stride3 * nt) alloc_if(1) free_if(0)) } @@ -595,8 +595,8 @@ void IntelBuffers::grow_ncache(const int off_flag, int *ncachej = _ncachej; int *ncachejtype = _ncachejtype; - if (ncachex != NULL && ncachey !=NULL && ncachez != NULL && - ncachej != NULL && ncachejtype != NULL) { + if (ncachex != nullptr && ncachey !=nullptr && ncachez != nullptr && + ncachej != nullptr && ncachejtype != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(ncachex,ncachey:length(vsize) alloc_if(1) free_if(0)) \ nocopy(ncachez,ncachej:length(vsize) alloc_if(1) free_if(0)) \ @@ -674,13 +674,13 @@ void IntelBuffers::set_ntypes(const int ntypes, #ifdef _LMP_INTEL_OFFLOAD flt_t * cutneighsqo = _cutneighsq[0]; const int ntypes2 = ntypes * ntypes; - if (_off_threads > 0 && cutneighsqo != NULL) { + if (_off_threads > 0 && cutneighsqo != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cutneighsqo:length(ntypes2) alloc_if(1) free_if(0)) } if (use_ghost_cut) { flt_t * cutneighghostsqo = _cutneighghostsq[0]; - if (_off_threads > 0 && cutneighghostsqo != NULL) { + if (_off_threads > 0 && cutneighghostsqo != nullptr) { #pragma offload_transfer target(mic:_cop) \ nocopy(cutneighghostsqo:length(ntypes2) alloc_if(1) free_if(0)) } diff --git a/src/USER-INTEL/intel_buffers.h b/src/USER-INTEL/intel_buffers.h index f3c07da7c2..86fc921c9e 100644 --- a/src/USER-INTEL/intel_buffers.h +++ b/src/USER-INTEL/intel_buffers.h @@ -211,7 +211,7 @@ class IntelBuffers { _x[i].z = lmp->atom->x[i][2]; _x[i].w = lmp->atom->type[i]; } - if (lmp->atom->q != NULL) + if (lmp->atom->q != nullptr) #if defined(LMP_SIMD_COMPILER) #pragma vector aligned #pragma ivdep @@ -296,7 +296,7 @@ class IntelBuffers { _host_x[nall].y = INTEL_BIGP; _host_x[nall].z = INTEL_BIGP; _host_x[nall].w = 1; - if (lmp->atom->q != NULL) { + if (lmp->atom->q != nullptr) { memcpy(_host_q + host_min_local, _q + host_min_local, used_local * sizeof(flt_t)); memcpy(_host_q + host_min_local + used_local, _q + host_min_ghost, diff --git a/src/USER-INTEL/intel_intrinsics.h b/src/USER-INTEL/intel_intrinsics.h index ee20cd1119..d1f019feea 100644 --- a/src/USER-INTEL/intel_intrinsics.h +++ b/src/USER-INTEL/intel_intrinsics.h @@ -35,114 +35,10 @@ #include #endif -// Vector classes for Cilk array notation -// This is experimental and doesn't yield good code yet -template -struct lmp_intel_an_fvec { - fscal data[VL]; - lmp_intel_an_fvec() {} - explicit lmp_intel_an_fvec(const fscal f) { data[:] = f; } - explicit lmp_intel_an_fvec(fscal f[VL]) { data[:] = f[:]; } - lmp_intel_an_fvec(const lmp_intel_an_fvec &a) { data[:] = a.data[:]; } - lmp_intel_an_fvec& operator =(const lmp_intel_an_fvec &a) { data[:] = a.data[:]; return *this; } - const lmp_intel_an_fvec operator +(const lmp_intel_an_fvec &b) const { - lmp_intel_an_fvec ret = *this; - ret.data[:] += b.data[:]; - return ret; - } - const lmp_intel_an_fvec operator -(const lmp_intel_an_fvec &b) const { - lmp_intel_an_fvec ret = *this; - ret.data[:] -= b.data[:]; - return ret; - } - const lmp_intel_an_fvec operator *(const lmp_intel_an_fvec &b) const { - lmp_intel_an_fvec ret = *this; - ret.data[:] *= b.data[:]; - return ret; - } - const lmp_intel_an_fvec operator /(const lmp_intel_an_fvec &b) const { - lmp_intel_an_fvec ret = *this; - ret.data[:] /= b.data[:]; - return ret; - } - lmp_intel_an_fvec& operator +=(const lmp_intel_an_fvec &b) { - data[:] += b.data[:]; return *this; - } - lmp_intel_an_fvec& operator -=(const lmp_intel_an_fvec &b) { - data[:] -= b.data[:]; return *this; - } - lmp_intel_an_fvec& operator *=(const lmp_intel_an_fvec &b) { - data[:] *= b.data[:]; return *this; - } - lmp_intel_an_fvec& operator /=(const lmp_intel_an_fvec &b) { - data[:] /= b.data[:]; return *this; - } - friend lmp_intel_an_fvec sqrt(const lmp_intel_an_fvec &a) __attribute__((always_inline)) { - lmp_intel_an_fvec ret; ret.data[:] = sqrt(a.data[:]); return ret; - } - friend lmp_intel_an_fvec exp(const lmp_intel_an_fvec &a) __attribute__((always_inline)) { - lmp_intel_an_fvec ret; ret.data[:] = exp(a.data[:]); return ret; - } - friend lmp_intel_an_fvec sin(const lmp_intel_an_fvec &a) __attribute__((always_inline)) { - lmp_intel_an_fvec ret; ret.data[:] = sin(a.data[:]); return ret; - } - friend lmp_intel_an_fvec invsqrt(const lmp_intel_an_fvec &a) __attribute__((always_inline)) { - lmp_intel_an_fvec ret; ret.data[:] = ((fscal)1.) / sqrt(a.data[:]); return ret; - } - friend lmp_intel_an_fvec pow(const lmp_intel_an_fvec &a, const lmp_intel_an_fvec &b) __attribute__((always_inline)) { - lmp_intel_an_fvec ret; ret.data[:] = pow(a.data[:], b.data[:]); return ret; - } - lmp_intel_an_fvec operator - () const { - lmp_intel_an_fvec ret; ret.data[:] = - data[:]; return ret; - } -}; -template -struct lmp_intel_an_ivec { - int data[VL]; - lmp_intel_an_ivec() {} - explicit lmp_intel_an_ivec(int i) { data[:] = i; } - explicit lmp_intel_an_ivec(const int * a) { data[:] = a[0:VL]; } - const lmp_intel_an_ivec operator &(const lmp_intel_an_ivec &b) { - lmp_intel_an_ivec ret = *this; - ret.data[:] &= b.data[:]; - return ret; - } - const lmp_intel_an_ivec operator |(const lmp_intel_an_ivec &b) { - lmp_intel_an_ivec ret = *this; - ret.data[:] |= b.data[:]; - return ret; - } - const lmp_intel_an_ivec operator +(const lmp_intel_an_ivec &b) { - lmp_intel_an_ivec ret = *this; - ret.data[:] += b.data[:]; - return ret; - } -}; -template -struct lmp_intel_an_bvec { - bool data[VL]; - lmp_intel_an_bvec() {} - lmp_intel_an_bvec(const lmp_intel_an_bvec &a) { data[:] = a.data[:]; } - lmp_intel_an_bvec& operator =(const lmp_intel_an_bvec &a) { data[:] = a.data[:]; return *this; } - explicit lmp_intel_an_bvec(int i) { data[:] = i; } - friend lmp_intel_an_bvec operator &(const lmp_intel_an_bvec &a, const lmp_intel_an_bvec &b) __attribute__((always_inline)) { - lmp_intel_an_bvec ret; ret.data[:] = a.data[:] & b.data[:]; return ret; - } - friend lmp_intel_an_bvec operator |(const lmp_intel_an_bvec &a, const lmp_intel_an_bvec &b) __attribute__((always_inline)) { - lmp_intel_an_bvec ret; ret.data[:] = a.data[:] | b.data[:]; return ret; - } - friend lmp_intel_an_bvec operator ~(const lmp_intel_an_bvec &a) __attribute__((always_inline)) { - lmp_intel_an_bvec ret; ret.data[:] = ! a.data[:]; return ret; - } - lmp_intel_an_bvec& operator &=(const lmp_intel_an_bvec &a) __attribute__((always_inline)) { - data[:] &= a.data[:]; return *this; - } -}; - namespace lmp_intel { -// Self explanatory mostly, KNC=IMCI and AVX-512, NONE=Scalar, AN=Array Not. -enum CalculationMode { KNC, AVX, AVX2, SSE, NONE, AN }; +// Self explanatory mostly, KNC=IMCI and AVX-512, NONE=Scalar. +enum CalculationMode {KNC, AVX, AVX2, SSE, NONE}; #ifdef __MIC__ #ifdef LMP_INTEL_VECTOR_MIC static const CalculationMode mode = LMP_INTEL_VECTOR_MIC; @@ -1916,148 +1812,6 @@ struct vector_ops { } }; -// Array notation implementation -template -struct vector_ops { - static const int VL = 4; - typedef flt_t fscal; - typedef lmp_intel_an_fvec fvec; - typedef lmp_intel_an_ivec ivec; - typedef lmp_intel_an_bvec bvec; - typedef flt_t farr[VL]; - typedef int iarr[VL]; - static fvec recip(const fvec &a) { - fvec ret; ret.data[:] = ((fscal)1.) / a.data[:]; return ret; - } - template - static void gather_prefetch_t0(const ivec &idx, const bvec &mask, const void *base) { - // nop - } - template - static fvec gather(const fvec &from, const bvec &mask, const ivec &idx, const void *base) { - fvec ret = from; - if (mask.data[:]) ret.data[:] = *reinterpret_cast(reinterpret_cast(base) + scale * idx.data[:]); - return ret; - } - template - static void gather_x(const ivec &idxs, const bvec &mask, const T *base, fvec *x, fvec *y, fvec *z, ivec *w) { - *x = gather<1>(*x, mask, idxs, &base->x); - *y = gather<1>(*y, mask, idxs, &base->y); - *z = gather<1>(*z, mask, idxs, &base->z); - *w = int_gather<1>(*w, mask, idxs, &base->w); - } - static void gather_8(const ivec &idxs, const bvec &mask, const void *base, - fvec *r0, fvec *r1, fvec *r2, fvec *r3, fvec *r4, fvec *r5, fvec *r6, fvec *r7) { - fvec a = zero(), b = zero(), c = zero(), d = zero(); - gather_4(idxs, mask, base, r0, r1, r2, r3); - gather_4(idxs, mask, reinterpret_cast(base) + 4 * sizeof(fscal), r4, r5, r6, r7); - } - static void gather_4(const ivec &idxs, const bvec &mask, const void *base, - fvec *r0, fvec *r1, fvec *r2, fvec *r3) { - *r0 = gather<4>(*r0, mask, idxs, reinterpret_cast(base) + 0 * sizeof(fscal)); - *r1 = gather<4>(*r1, mask, idxs, reinterpret_cast(base) + 1 * sizeof(fscal)); - *r2 = gather<4>(*r2, mask, idxs, reinterpret_cast(base) + 2 * sizeof(fscal)); - *r3 = gather<4>(*r3, mask, idxs, reinterpret_cast(base) + 3 * sizeof(fscal)); - } - static fvec blend(const bvec &mask, const fvec &a, const fvec &b) { - fvec ret = a; - if (mask.data[:]) ret.data[:] = b.data[:]; - return ret; - } - static ivec int_blend(const bvec &mask, const ivec &a, const ivec &b) { - fvec ret = a; - if (mask.data[:]) ret.data[:] = b.data[:]; - return ret; - } - static fvec fmadd(const fvec &a, const fvec &b, const fvec &c) { - fvec ret; ret.data[:] = a.data[:] * b.data[:] + c.data[:]; return ret; - } - static fvec zero() { - return fvec(0.); - } - static bvec cmpeq(const fvec &a, const fvec &b) { - bvec ret; ret.data[:] = a.data[:] == b.data[:]; return ret; - } - static bvec cmpnle(const fvec &a, const fvec &b) { - bvec ret; ret.data[:] = !(a.data[:] <= b.data[:]); return ret; - } - static bvec cmple(const fvec &a, const fvec &b) { - bvec ret; ret.data[:] = a.data[:] <= b.data[:]; return ret; - } - static bvec cmplt(const fvec &a, const fvec &b) { - bvec ret; ret.data[:] = a.data[:] < b.data[:]; return ret; - } - static bvec int_cmpneq(const ivec &a, const ivec &b) { - bvec ret; ret.data[:] = a.data[:] != b.data[:]; return ret; - } - static bvec int_cmplt(const ivec &a, const ivec &b) { - bvec ret; ret.data[:] = a.data[:] < b.data[:]; return ret; - } - static fvec invsqrt(const fvec &a) { - fvec ret; ret.data[:] = ((fscal)1.) / sqrt(a.data[:]); return ret; - } - static fvec sincos(fvec *c, const fvec &a) { - c->data[:] = cos(a.data[:]); - fvec ret; ret.data[:] = sin(a.data[:]); return ret; - } - static fscal reduce_add(const fvec &a) { - return __sec_reduce_add(a.data[:]); - } - static ivec int_mullo(const ivec &a, const ivec &b) { - ivec ret; ret.data[:] = a.data[:] * b.data[:]; return ret; - } - static ivec int_mask_add(const ivec &src, const bvec &mask, const ivec &a, const ivec &b) { - ivec ret = src; - if (mask.data[:]) ret.data[:] = a.data[:] + b.data[:]; - return ret; - } - template - static ivec int_gather(const ivec &from, bvec mask, const ivec &idx, const void *base) { - ivec ret = from; - if (mask.data[:]) ret.data[:] = reinterpret_cast(base)[scale * idx.data[:] / sizeof(int)]; - return ret; - } - static fvec mask_add(const fvec &src, const bvec &mask, const fvec &a, const fvec &b) { - fvec ret = src; - if (mask.data[:]) ret.data[:] = a.data[:] + b.data[:]; - return ret; - } - static void store(void *at, const fvec &a) { - reinterpret_cast(at)[0:VL] = a.data[:]; - } - static void int_store(int *at, const ivec &a) { - reinterpret_cast(at)[0:VL] = a.data[:]; - } - static void mask_store(int *at, const bvec &a) { - at[0:VL] = a.data[:]; - } - static fvec min(const fvec &a, const fvec &b) { - fvec ret = b; - if (a.data[:] < b.data[:]) ret.data[:] = a.data[:]; - return ret; - } - static bool mask_test_at(const bvec &mask, int at) { - return mask.data[at]; - } - static bool mask_testz(const bvec &mask) { - return ! __sec_reduce_or(mask.data[:]); - } - static bvec mask_enable_lower(int n) { - bvec ret; ret.data[:] = __sec_implicit_index(0) < n; return ret; - } - static ivec int_load_vl(const int *a) { - return ivec(a); - } - static void int_clear_arr(int *a) { - a[0:VL] = 0; - } - static bvec full_mask() { - return bvec(1); - } - static void int_print(const ivec &a) { - } -}; - // Mixins to implement mixed precision and single/single and double/double // This one is for single/single and double/double template @@ -2138,7 +1892,7 @@ struct AccumulatorTwiceMixin { }; // For cases where vector_ops::VL == vector_ops::VL -// i.e. scalar & AN + template struct AccumulatorTwiceMixinNone { typedef vector_ops BASE; @@ -2177,11 +1931,8 @@ struct vector_routines : public vector_ops, public template struct vector_routines : public vector_ops, public AccumulatorTwiceMixin {}; -// Specialize for AN and scalar +// Specialize for scalar template<> struct vector_routines : public vector_ops, public AccumulatorTwiceMixinNone {}; -template<> -struct vector_routines : public vector_ops, public AccumulatorTwiceMixinNone {}; - } // namespace lmp_intel diff --git a/src/USER-INTEL/intel_preprocess.h b/src/USER-INTEL/intel_preprocess.h index 2515e47c52..3e547b58a0 100644 --- a/src/USER-INTEL/intel_preprocess.h +++ b/src/USER-INTEL/intel_preprocess.h @@ -528,7 +528,7 @@ inline double MIC_Wtime() { double time; struct timeval tv; - gettimeofday(&tv, NULL); + gettimeofday(&tv, nullptr); time = 1.0 * tv.tv_sec + 1.0e-6 * tv.tv_usec; return time; } diff --git a/src/USER-INTEL/nbin_intel.cpp b/src/USER-INTEL/nbin_intel.cpp index 78c6246389..bf5377b946 100644 --- a/src/USER-INTEL/nbin_intel.cpp +++ b/src/USER-INTEL/nbin_intel.cpp @@ -16,13 +16,13 @@ ------------------------------------------------------------------------- */ #include "nbin_intel.h" + #include "atom.h" -#include "group.h" #include "comm.h" -#include "domain.h" +#include "error.h" +#include "group.h" #include "modify.h" #include "update.h" -#include "error.h" using namespace LAMMPS_NS; @@ -35,8 +35,8 @@ NBinIntel::NBinIntel(LAMMPS *lmp) : NBinStandard(lmp) { "The 'package intel' command is required for /intel styles"); _fix = static_cast(modify->fix[ifix]); _precision_mode = _fix->precision(); - _atombin = NULL; - _binpacked = NULL; + _atombin = nullptr; + _binpacked = nullptr; #ifdef _LMP_INTEL_OFFLOAD _cop = _fix->coprocessor_number(); _offload_alloc = 0; @@ -241,7 +241,7 @@ void NBinIntel::bin_atoms(IntelBuffers * buffers) { /* ---------------------------------------------------------------------- */ -bigint NBinIntel::memory_usage() +double NBinIntel::memory_usage() { return NBinStandard::memory_usage() + maxatom*2*sizeof(int); } diff --git a/src/USER-INTEL/nbin_intel.h b/src/USER-INTEL/nbin_intel.h index d96f31885e..a7a28010ba 100644 --- a/src/USER-INTEL/nbin_intel.h +++ b/src/USER-INTEL/nbin_intel.h @@ -40,7 +40,7 @@ class NBinIntel : public NBinStandard { FixIntel *_fix; int *_atombin, *_binpacked; int _precision_mode; - bigint memory_usage(); + double memory_usage(); template void bin_atoms(IntelBuffers *); diff --git a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp index 00b032d495..50a3586d31 100644 --- a/src/USER-INTEL/npair_full_bin_ghost_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_ghost_intel.cpp @@ -16,15 +16,13 @@ ------------------------------------------------------------------------- */ #include "npair_full_bin_ghost_intel.h" -#include "neighbor.h" -#include "nstencil.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" #include "comm.h" -#include "domain.h" -#include "molecule.h" #include "error.h" +#include "molecule.h" +#include "neigh_list.h" +#include "neighbor.h" using namespace LAMMPS_NS; @@ -90,7 +88,7 @@ void NPairFullBinGhostIntel::fbi(NeighList * list, _fix->nbor_pack_width()); int need_ic = 0; - if (atom->molecular) + if (atom->molecular != Atom::ATOMIC) dminimum_image_check(need_ic, neighbor->cutneighmax, neighbor->cutneighmax, neighbor->cutneighmax); @@ -121,11 +119,11 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, const int e_nall = nall_t; const int molecular = atom->molecular; - int *ns = NULL; - tagint *s = NULL; + int *ns = nullptr; + tagint *s = nullptr; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; - if (molecular) { + if (molecular != Atom::ATOMIC) { s = atom->special[0]; ns = atom->nspecial[0]; special_size = aend; @@ -155,7 +153,7 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, #endif int moltemplate; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; if (moltemplate) error->all(FLERR, @@ -422,7 +420,7 @@ void NPairFullBinGhostIntel::fbi(const int offload, NeighList * list, } } // for u - if (molecular && i < nlocal) { + if ((molecular != Atom::ATOMIC) && (i < nlocal)) { int alln = n; n = 0; #if defined(LMP_SIMD_COMPILER) diff --git a/src/USER-INTEL/npair_full_bin_intel.cpp b/src/USER-INTEL/npair_full_bin_intel.cpp index 4ef84be75f..c4433ba16c 100644 --- a/src/USER-INTEL/npair_full_bin_intel.cpp +++ b/src/USER-INTEL/npair_full_bin_intel.cpp @@ -16,12 +16,11 @@ ------------------------------------------------------------------------- */ #include "npair_full_bin_intel.h" -#include "neighbor.h" -#include "neigh_list.h" + #include "atom.h" #include "comm.h" -#include "domain.h" -#include "group.h" +#include "neigh_list.h" +#include "neighbor.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_half_bin_newton_intel.cpp b/src/USER-INTEL/npair_half_bin_newton_intel.cpp index 799ba2b57b..55bac4cdb7 100644 --- a/src/USER-INTEL/npair_half_bin_newton_intel.cpp +++ b/src/USER-INTEL/npair_half_bin_newton_intel.cpp @@ -16,12 +16,11 @@ ------------------------------------------------------------------------- */ #include "npair_half_bin_newton_intel.h" -#include "neighbor.h" -#include "neigh_list.h" + #include "atom.h" #include "comm.h" -#include "domain.h" -#include "group.h" +#include "neigh_list.h" +#include "neighbor.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp b/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp index 1f859cb5f1..d5384904e5 100644 --- a/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp +++ b/src/USER-INTEL/npair_half_bin_newton_tri_intel.cpp @@ -16,12 +16,11 @@ ------------------------------------------------------------------------- */ #include "npair_half_bin_newton_tri_intel.h" -#include "neighbor.h" -#include "neigh_list.h" + #include "atom.h" #include "comm.h" -#include "domain.h" -#include "group.h" +#include "neigh_list.h" +#include "neighbor.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_halffull_newton_intel.cpp b/src/USER-INTEL/npair_halffull_newton_intel.cpp index 8248f2257a..dd11802797 100644 --- a/src/USER-INTEL/npair_halffull_newton_intel.cpp +++ b/src/USER-INTEL/npair_halffull_newton_intel.cpp @@ -16,16 +16,14 @@ ------------------------------------------------------------------------- */ #include "npair_halffull_newton_intel.h" -#include "neighbor.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" #include "comm.h" -#include "modify.h" -#include "molecule.h" -#include "domain.h" -#include "my_page.h" #include "error.h" +#include "modify.h" +#include "my_page.h" +#include "neigh_list.h" +#include "neighbor.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/npair_intel.cpp b/src/USER-INTEL/npair_intel.cpp index f7a233efc9..29c4f3bd67 100644 --- a/src/USER-INTEL/npair_intel.cpp +++ b/src/USER-INTEL/npair_intel.cpp @@ -15,13 +15,13 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" +#include "npair_intel.h" + #include "comm.h" #include "domain.h" -#include "timer.h" #include "modify.h" -#include "npair_intel.h" -#include "nstencil.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; @@ -125,11 +125,11 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, const int e_nall = nall_t; const int molecular = atom->molecular; - int *ns = NULL; - tagint *s = NULL; + int *ns = nullptr; + tagint *s = nullptr; int tag_size = 0, special_size; if (buffers->need_tag()) tag_size = e_nall; - if (molecular) { + if (molecular != Atom::ATOMIC) { s = atom->special[0]; ns = atom->nspecial[0]; special_size = aend; @@ -526,7 +526,7 @@ void NPairIntel::bin_newton(const int offload, NeighList *list, } } // for u - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!THREE) neighptr2 = neighptr; int alln = n; diff --git a/src/USER-INTEL/npair_intel.h b/src/USER-INTEL/npair_intel.h index 6d4e01462f..e040a1d8f3 100644 --- a/src/USER-INTEL/npair_intel.h +++ b/src/USER-INTEL/npair_intel.h @@ -15,6 +15,7 @@ #define LMP_NPAIR_INTEL_H #include "npair.h" +#include "domain.h" #include "fix_intel.h" #if defined(_OPENMP) diff --git a/src/USER-INTEL/npair_skip_intel.cpp b/src/USER-INTEL/npair_skip_intel.cpp index fa202d5da1..df09829c86 100644 --- a/src/USER-INTEL/npair_skip_intel.cpp +++ b/src/USER-INTEL/npair_skip_intel.cpp @@ -16,17 +16,15 @@ ------------------------------------------------------------------------- */ #include "npair_skip_intel.h" -#include "neighbor.h" -#include "neigh_list.h" + #include "atom.h" -#include "atom_vec.h" #include "comm.h" -#include "modify.h" -#include "molecule.h" -#include "neigh_request.h" -#include "domain.h" -#include "my_page.h" #include "error.h" +#include "modify.h" +#include "my_page.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/pair_airebo_intel.cpp b/src/USER-INTEL/pair_airebo_intel.cpp index c1e4a5374a..d5192f2008 100644 --- a/src/USER-INTEL/pair_airebo_intel.cpp +++ b/src/USER-INTEL/pair_airebo_intel.cpp @@ -15,41 +15,37 @@ Contributing author: Markus Hohnerbach (RWTH) ------------------------------------------------------------------------- */ -#ifdef __INTEL_OFFLOAD -#pragma offload_attribute(push, target(mic)) -#endif -#include -#include -#include -#include -#include -#include // requires C++-11 +#include "pair_airebo_intel.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "suffix.h" + #include -#include -#include "lmptype.h" +#include +#include + #include "intel_preprocess.h" #include "intel_intrinsics_airebo.h" + #ifdef __INTEL_OFFLOAD #pragma offload_attribute(pop) #endif +#ifdef __INTEL_OFFLOAD +#pragma offload_attribute(push, target(mic)) +#endif + #if defined(_OPENMP) #include #endif -#include "pair_airebo_intel.h" -#include "atom.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "group.h" -#include "kspace.h" -#include "modify.h" -#include "suffix.h" -#include "math_const.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -163,10 +159,10 @@ void aut_frebo(KernelArgsAIREBOT * ka, int torsion_flag); PairAIREBOIntel::PairAIREBOIntel(LAMMPS *lmp) : PairAIREBO(lmp) { suffix_flag |= Suffix::INTEL; - REBO_cnumneigh = NULL; - REBO_num_skin = NULL; - REBO_list_data = NULL; - fix = NULL; + REBO_cnumneigh = nullptr; + REBO_num_skin = nullptr; + REBO_list_data = nullptr; + fix = nullptr; } /* ---------------------------------------------------------------------- */ @@ -701,7 +697,7 @@ inline flt_t gSpline(KernelArgsAIREBOT * ka, int itype, flt_t cos, flt_t NCmin = ka->params.NCmin; flt_t NCmax = ka->params.NCmax; int index = 0; - flt_t * gDom = NULL; + flt_t * gDom = nullptr; int nDom = 0; int offs = 0; if (itype == 0) { @@ -925,7 +921,7 @@ inline flt_t frebo_pij(KernelArgsAIREBOT * ka, int i, int j, if (pass == 0) { sum_pij += wik * g * ex_lam; sum_dpij_dN += wik * dgdN * ex_lam; - flt_t cutN = Sp(Nki, Nmin, Nmax, NULL); + flt_t cutN = Sp(Nki, Nmin, Nmax, nullptr); *sum_N += (1 - ktype) * wik * cutN; } else { flt_t tmp = -0.5 * pij * pij * pij; @@ -1587,9 +1583,9 @@ void ref_rebo_neigh(KernelArgsAIREBOT * ka) { flt_t rcmin = ka->params.rcmin[itype][jtype]; flt_t rcmax = ka->params.rcmax[itype][jtype]; if (jtype == CARBON) - ka->nC[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, NULL); + ka->nC[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, nullptr); else - ka->nH[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, NULL); + ka->nH[i] += Sp(overloaded::sqrt(rsq), rcmin, rcmax, nullptr); } } ka->neigh_rebo.num[i] = n; @@ -2412,7 +2408,7 @@ static fvec aut_mask_gSpline_pd_2(KernelArgsAIREBOT * ka, bvec /*active_mask*/, int itype, fvec cosjik, fvec Nij, fvec *dgdc, fvec *dgdN) { int i; - flt_t * gDom = NULL; + flt_t * gDom = nullptr; int nDom = 0; ivec offs = ivec::setzero(); fvec NCmin = fvec::set1(ka->params.NCmin); diff --git a/src/USER-INTEL/pair_airebo_morse_intel.cpp b/src/USER-INTEL/pair_airebo_morse_intel.cpp index f68e299fa0..a99ab913ba 100644 --- a/src/USER-INTEL/pair_airebo_morse_intel.cpp +++ b/src/USER-INTEL/pair_airebo_morse_intel.cpp @@ -16,7 +16,6 @@ ------------------------------------------------------------------------- */ #include "pair_airebo_morse_intel.h" -#include "error.h" using namespace LAMMPS_NS; diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp index 4ad4398fbe..41af529cab 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.cpp @@ -17,7 +17,7 @@ #include #include -#include + #include #include "pair_buck_coul_cut_intel.h" #include "atom.h" @@ -502,8 +502,8 @@ void PairBuckCoulCutIntel::ForceConst::set_ntypes(const int ntypes, c_energy_t * oc_energy = c_energy[0]; c_cut_t * oc_cut = c_cut[0]; - if (ospecial_lj != NULL && oc_force != NULL && oc_cut != NULL && - oc_energy != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && oc_cut != nullptr && + oc_energy != nullptr && ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ @@ -531,8 +531,8 @@ void PairBuckCoulCutIntel::ForceConst::set_ntypes(const int ntypes, c_energy_t * oc_energy = c_energy[0]; c_cut_t * oc_cut = c_cut[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && oc_cut != NULL && - oc_energy != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && oc_cut != nullptr && + oc_energy != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_coul_cut_intel.h b/src/USER-INTEL/pair_buck_coul_cut_intel.h index 7204323903..4bc19ac157 100644 --- a/src/USER-INTEL/pair_buck_coul_cut_intel.h +++ b/src/USER-INTEL/pair_buck_coul_cut_intel.h @@ -72,7 +72,7 @@ class PairBuckCoulCutIntel : public PairBuckCoulCut { c_cut_t **c_cut; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.cpp b/src/USER-INTEL/pair_buck_coul_long_intel.cpp index 150cfd3ee0..11ee79e5f2 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_buck_coul_long_intel.cpp @@ -17,7 +17,7 @@ #include #include -#include + #include #include "pair_buck_coul_long_intel.h" #include "atom.h" @@ -617,10 +617,10 @@ void PairBuckCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && oc_force != NULL && orho_inv != NULL && - oc_energy != NULL && otable != NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && _cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && orho_inv != nullptr && + oc_energy != nullptr && otable != nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(oc_force, oc_energy: alloc_if(0) free_if(1)) \ @@ -662,10 +662,10 @@ void PairBuckCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && orho_inv != NULL && - oc_energy != NULL && otable !=NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && orho_inv != nullptr && + oc_energy != nullptr && otable !=nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_coul_long_intel.h b/src/USER-INTEL/pair_buck_coul_long_intel.h index ec37c699c8..95492cd4e6 100644 --- a/src/USER-INTEL/pair_buck_coul_long_intel.h +++ b/src/USER-INTEL/pair_buck_coul_long_intel.h @@ -73,7 +73,7 @@ class PairBuckCoulLongIntel : public PairBuckCoulLong { flt_t *etable, *detable, *ctable, *dctable; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_buck_intel.cpp b/src/USER-INTEL/pair_buck_intel.cpp index b21ce13a34..b4f57d2fae 100644 --- a/src/USER-INTEL/pair_buck_intel.cpp +++ b/src/USER-INTEL/pair_buck_intel.cpp @@ -15,20 +15,20 @@ Contributing author: Rodrigo Canales (RWTH Aachen University) ------------------------------------------------------------------------- */ -#include #include "pair_buck_intel.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "group.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" +#include "error.h" #include "math_const.h" #include "memory.h" -#include "suffix.h" -#include "force.h" #include "modify.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "suffix.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -449,8 +449,8 @@ void PairBuckIntel::ForceConst::set_ntypes(const int ntypes, c_force_t * oc_force = c_force[0]; c_energy_t * oc_energy = c_energy[0]; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: alloc_if(0) free_if(1)) \ @@ -473,8 +473,8 @@ void PairBuckIntel::ForceConst::set_ntypes(const int ntypes, c_force_t * oc_force = c_force[0]; c_energy_t * oc_energy = c_energy[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_buck_intel.h b/src/USER-INTEL/pair_buck_intel.h index ab5e135262..0e473c7c3f 100644 --- a/src/USER-INTEL/pair_buck_intel.h +++ b/src/USER-INTEL/pair_buck_intel.h @@ -69,7 +69,7 @@ private: c_energy_t **c_energy; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_dpd_intel.cpp b/src/USER-INTEL/pair_dpd_intel.cpp index 690496d546..40b6c891d0 100644 --- a/src/USER-INTEL/pair_dpd_intel.cpp +++ b/src/USER-INTEL/pair_dpd_intel.cpp @@ -37,7 +37,7 @@ PairDPDIntel::PairDPDIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - random_thread = NULL; + random_thread = nullptr; _nrandom_thread = 0; } diff --git a/src/USER-INTEL/pair_dpd_intel.h b/src/USER-INTEL/pair_dpd_intel.h index bce90a36b6..409e123f29 100644 --- a/src/USER-INTEL/pair_dpd_intel.h +++ b/src/USER-INTEL/pair_dpd_intel.h @@ -83,7 +83,7 @@ class PairDPDIntel : public PairDPD { int *rngi; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int nthreads, const int max_nbors, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_eam_alloy_intel.cpp b/src/USER-INTEL/pair_eam_alloy_intel.cpp index 31430e4bf7..e208212d79 100644 --- a/src/USER-INTEL/pair_eam_alloy_intel.cpp +++ b/src/USER-INTEL/pair_eam_alloy_intel.cpp @@ -15,18 +15,16 @@ Contributing authors: Stephen Foiles (SNL), Murray Daw (SNL) ------------------------------------------------------------------------- */ -#include -#include -#include #include "pair_eam_alloy_intel.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include using namespace LAMMPS_NS; @@ -71,7 +69,7 @@ void PairEAMAlloyIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -185,7 +183,7 @@ void PairEAMAlloyIntel::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/USER-INTEL/pair_eam_fs_intel.cpp b/src/USER-INTEL/pair_eam_fs_intel.cpp index c5804922f6..6e17d3d552 100644 --- a/src/USER-INTEL/pair_eam_fs_intel.cpp +++ b/src/USER-INTEL/pair_eam_fs_intel.cpp @@ -15,18 +15,16 @@ Contributing authors: Tim Lau (MIT) ------------------------------------------------------------------------- */ -#include -#include -#include #include "pair_eam_fs_intel.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include using namespace LAMMPS_NS; @@ -71,7 +69,7 @@ void PairEAMFSIntel::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -188,7 +186,7 @@ void PairEAMFSIntel::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/USER-INTEL/pair_eam_intel.cpp b/src/USER-INTEL/pair_eam_intel.cpp index 994f0d3910..561621a388 100644 --- a/src/USER-INTEL/pair_eam_intel.cpp +++ b/src/USER-INTEL/pair_eam_intel.cpp @@ -15,22 +15,22 @@ Contributing authors: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_eam_intel.h" + #include "atom.h" -#include "force.h" #include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" +#include "neighbor.h" #include "suffix.h" +#include +#include + using namespace LAMMPS_NS; #define MAXLINE 1024 diff --git a/src/USER-INTEL/pair_eam_intel.h b/src/USER-INTEL/pair_eam_intel.h index a9590f6b3d..b9ad11597a 100644 --- a/src/USER-INTEL/pair_eam_intel.h +++ b/src/USER-INTEL/pair_eam_intel.h @@ -76,7 +76,7 @@ class PairEAMIntel : public PairEAM { fc_packed2 *z2r_spline_t; ForceConst() : _ntypes(0), _nr(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int nr, const int nrho, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_gayberne_intel.cpp b/src/USER-INTEL/pair_gayberne_intel.cpp index 30e61f67b9..423631ae87 100644 --- a/src/USER-INTEL/pair_gayberne_intel.cpp +++ b/src/USER-INTEL/pair_gayberne_intel.cpp @@ -958,7 +958,7 @@ void PairGayBerneIntel::pack_force_const(ForceConst &fc, FC_PACKED2_T *olj34 = fc.lj34[0]; FC_PACKED3_T *oic = fc.ic; int tp1sq = tp1 * tp1; - if (oijc != NULL && oic != NULL) { + if (oijc != nullptr && oic != nullptr) { #pragma offload_transfer target(mic:_cop) \ in(special_lj: length(4) alloc_if(0) free_if(0)) \ in(oijc,olj34: length(tp1sq) alloc_if(0) free_if(0)) \ @@ -990,9 +990,9 @@ void PairGayBerneIntel::ForceConst::set_ntypes(const int ntypes, int * ojtype_form = jtype_form[0]; int * ojlist_form = jlist_form[0]; - if (ospecial_lj != NULL && oijc != NULL && olj34 != NULL && - orsq_form != NULL && odelx_form != NULL && odely_form != NULL && - odelz_form != NULL && ojtype_form != NULL && ojlist_form != NULL && + if (ospecial_lj != nullptr && oijc != nullptr && olj34 != nullptr && + orsq_form != nullptr && odelx_form != nullptr && odely_form != nullptr && + odelz_form != nullptr && ojtype_form != nullptr && ojlist_form != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:_cop) \ nocopy(ospecial_lj, oijc, olj34, oic: alloc_if(0) free_if(1)) \ @@ -1048,10 +1048,10 @@ void PairGayBerneIntel::ForceConst::set_ntypes(const int ntypes, int off_onel = one_length * nthreads; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oijc != NULL && olj34 != NULL && - oic != NULL && orsq_form != NULL && odelx_form != NULL && - odely_form != NULL && odelz_form != NULL && ojtype_form !=NULL && - ojlist_form !=NULL && cop >= 0) { + if (ospecial_lj != nullptr && oijc != nullptr && olj34 != nullptr && + oic != nullptr && orsq_form != nullptr && odelx_form != nullptr && + odely_form != nullptr && odelz_form != nullptr && ojtype_form !=nullptr && + ojlist_form !=nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(oijc,olj34: length(tp1sq) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_gayberne_intel.h b/src/USER-INTEL/pair_gayberne_intel.h index 07dfba14d1..ecdd93d353 100644 --- a/src/USER-INTEL/pair_gayberne_intel.h +++ b/src/USER-INTEL/pair_gayberne_intel.h @@ -74,7 +74,7 @@ class PairGayBerneIntel : public PairGayBerne { int **jtype_form, **jlist_form; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, 0, 0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, 0, 0, nullptr, _cop); } void set_ntypes(const int ntypes, const int one_length, const int nthreads, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp index ff8a9869b7..71f2e24557 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.cpp @@ -12,19 +12,22 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include #include "pair_lj_charmm_coul_charmm_intel.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "group.h" #include "memory.h" #include "modify.h" #include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" #include "suffix.h" + +#include +#include + using namespace LAMMPS_NS; #define LJ_T typename IntelBuffers::vec4_t @@ -552,8 +555,8 @@ void PairLJCharmmCoulCharmmIntel::ForceConst::set_ntypes( flt_t * ospecial_coul = special_coul; flt_t * ocutsq = cutsq[0]; typename IntelBuffers::vec4_t * olj = lj[0]; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(ocutsq, olj: alloc_if(0) free_if(1)) @@ -574,8 +577,8 @@ void PairLJCharmmCoulCharmmIntel::ForceConst::set_ntypes( flt_t * ocutsq = cutsq[0]; typename IntelBuffers::vec4_t * olj = lj[0]; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h index a48a84b5ce..006dbaade2 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_charmm_intel.h @@ -69,7 +69,7 @@ class PairLJCharmmCoulCharmmIntel : public PairLJCharmmCoulCharmm { typename IntelBuffers::vec4_t **lj; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp index 5a4069e199..8f106d8607 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.cpp @@ -38,7 +38,7 @@ PairLJCharmmCoulLongIntel::PairLJCharmmCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -652,9 +652,9 @@ void PairLJCharmmCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - otable != NULL && oetable != NULL && odetable != NULL && - octable != NULL && odctable != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + otable != nullptr && oetable != nullptr && odetable != nullptr && + octable != nullptr && odctable != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ @@ -693,9 +693,9 @@ void PairLJCharmmCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && ocutsq != NULL && olj != NULL && - otable !=NULL && oetable != NULL && odetable != NULL && - octable != NULL && odctable != NULL && ospecial_coul != NULL && + if (ospecial_lj != nullptr && ocutsq != nullptr && olj != nullptr && + otable !=nullptr && oetable != nullptr && odetable != nullptr && + octable != nullptr && odctable != nullptr && ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h index 31b2182cb5..f5b46eaf76 100644 --- a/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_charmm_coul_long_intel.h @@ -72,7 +72,7 @@ class PairLJCharmmCoulLongIntel : public PairLJCharmmCoulLong { typename IntelBuffers::vec2_t **lj; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp index 243c7f577d..ead3d5b5b4 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.cpp @@ -12,20 +12,21 @@ Contributing author: W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include #include "pair_lj_cut_coul_long_intel.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "group.h" #include "kspace.h" #include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" +#include "neighbor.h" #include "suffix.h" + +#include + using namespace LAMMPS_NS; #define C_FORCE_T typename ForceConst::c_force_t @@ -39,7 +40,7 @@ PairLJCutCoulLongIntel::PairLJCutCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -610,10 +611,10 @@ void PairLJCutCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * odetable = detable; flt_t * octable = ctable; flt_t * odctable = dctable; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && otable != NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && _cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && otable != nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj, ospecial_coul: alloc_if(0) free_if(1)) \ nocopy(oc_force, oc_energy: alloc_if(0) free_if(1)) \ @@ -651,10 +652,10 @@ void PairLJCutCoulLongIntel::ForceConst::set_ntypes(const int ntypes, flt_t * octable = ctable; flt_t * odctable = dctable; int tp1sq = ntypes*ntypes; - if (ospecial_lj != NULL && oc_force != NULL && - oc_energy != NULL && otable !=NULL && oetable != NULL && - odetable != NULL && octable != NULL && odctable != NULL && - ospecial_coul != NULL && cop >= 0) { + if (ospecial_lj != nullptr && oc_force != nullptr && + oc_energy != nullptr && otable !=nullptr && oetable != nullptr && + odetable != nullptr && octable != nullptr && odctable != nullptr && + ospecial_coul != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(ospecial_lj: length(4) alloc_if(1) free_if(0)) \ nocopy(ospecial_coul: length(4) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h index 288a6a7bc4..6172313639 100644 --- a/src/USER-INTEL/pair_lj_cut_coul_long_intel.h +++ b/src/USER-INTEL/pair_lj_cut_coul_long_intel.h @@ -73,7 +73,7 @@ class PairLJCutCoulLongIntel : public PairLJCutCoulLong { flt_t *etable, *detable, *ctable, *dctable; ForceConst() : _ntypes(0), _ntable(0) {} - ~ForceConst() { set_ntypes(0,0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,0,nullptr,_cop); } void set_ntypes(const int ntypes, const int ntable, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_cut_intel.cpp b/src/USER-INTEL/pair_lj_cut_intel.cpp index b484cb68d9..281eef52db 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.cpp +++ b/src/USER-INTEL/pair_lj_cut_intel.cpp @@ -36,7 +36,7 @@ PairLJCutIntel::PairLJCutIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-INTEL/pair_lj_cut_intel.h b/src/USER-INTEL/pair_lj_cut_intel.h index b577a04658..b88d213211 100644 --- a/src/USER-INTEL/pair_lj_cut_intel.h +++ b/src/USER-INTEL/pair_lj_cut_intel.h @@ -67,7 +67,7 @@ class PairLJCutIntel : public PairLJCut { fc_packed2 **lj34; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, nullptr, _cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp index 8b9670f419..ccde2d3a57 100644 --- a/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp +++ b/src/USER-INTEL/pair_lj_long_coul_long_intel.cpp @@ -15,21 +15,16 @@ Contributing authors: William McDoniel (RWTH Aachen University) ------------------------------------------------------------------------- */ -#include #include "pair_lj_long_coul_long_intel.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "group.h" -#include "kspace.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" +#include "neighbor.h" #include "suffix.h" - using namespace LAMMPS_NS; #define C_FORCE_T typename ForceConst::c_force_t @@ -41,7 +36,7 @@ PairLJLongCoulLongIntel::PairLJLongCoulLongIntel(LAMMPS *lmp) : { suffix_flag |= Suffix::INTEL; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } diff --git a/src/USER-INTEL/pair_sw_intel.cpp b/src/USER-INTEL/pair_sw_intel.cpp index 32afcbf8a9..d2a481a76e 100644 --- a/src/USER-INTEL/pair_sw_intel.cpp +++ b/src/USER-INTEL/pair_sw_intel.cpp @@ -17,6 +17,19 @@ #include "pair_sw_intel.h" +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "neighbor.h" +#include "suffix.h" + +#include + #ifdef _LMP_INTEL_OFFLOAD #pragma offload_attribute(push,target(mic)) #endif @@ -25,21 +38,6 @@ #pragma offload_attribute(pop) #endif -#include -#include -#include -#include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" -#include "modify.h" -#include "suffix.h" #ifdef LMP_USE_AVXCD #include "intel_simd.h" @@ -1279,8 +1277,8 @@ void PairSWIntel::ForceConst::set_ntypes(const int ntypes, fc_packed3 *op3 = p3[0][0]; #ifdef _LMP_INTEL_OFFLOAD - if (op2 != NULL && op2f != NULL && op2f2 != NULL && op2e != NULL && - op3 != NULL && _cop >= 0) { + if (op2 != nullptr && op2f != nullptr && op2f2 != nullptr && op2e != nullptr && + op3 != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:_cop) \ nocopy(op2, op2f, op2f2, op2e, op3: alloc_if(0) free_if(1)) } @@ -1308,8 +1306,8 @@ void PairSWIntel::ForceConst::set_ntypes(const int ntypes, fc_packed3 *op3 = p3[0][0]; int tp1sq = ntypes * ntypes; int tp1cu = tp1sq * ntypes; - if (op2 != NULL && op2f != NULL && op2f2 != NULL && op2e != NULL && - op3 != NULL && cop >= 0) { + if (op2 != nullptr && op2f != nullptr && op2f2 != nullptr && op2e != nullptr && + op3 != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(op2,op2f,op2f2,op2e: length(tp1sq) alloc_if(1) free_if(0)) \ nocopy(op3: length(tp1cu) alloc_if(1) free_if(0)) diff --git a/src/USER-INTEL/pair_sw_intel.h b/src/USER-INTEL/pair_sw_intel.h index 5f7a511c9f..f345b3d4ff 100644 --- a/src/USER-INTEL/pair_sw_intel.h +++ b/src/USER-INTEL/pair_sw_intel.h @@ -88,7 +88,7 @@ class PairSWIntel : public PairSW { fc_packed3 ***p3; ForceConst() : p2(0), p2f(0), p2f2(0), p2e(0), p3(0), _ntypes(0) {} - ~ForceConst() { set_ntypes(0, NULL, _cop); } + ~ForceConst() { set_ntypes(0, nullptr, _cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pair_tersoff_intel.cpp b/src/USER-INTEL/pair_tersoff_intel.cpp index 8784029320..db24692b6d 100644 --- a/src/USER-INTEL/pair_tersoff_intel.cpp +++ b/src/USER-INTEL/pair_tersoff_intel.cpp @@ -17,7 +17,7 @@ #include #include -#include + #include #include "pair_tersoff_intel.h" #include "atom.h" @@ -576,8 +576,8 @@ void PairTersoffIntel::ForceConst::set_ntypes(const int ntypes, c_cutoff_t * oc_cutoff_outer = c_cutoff_outer[0]; c_inner_t * oc_inner = c_inner[0][0]; c_outer_t * oc_outer = c_outer[0]; - if (c_first_loop != NULL && c_second_loop != NULL && - c_inner_loop != NULL && _cop >= 0) { + if (c_first_loop != nullptr && c_second_loop != nullptr && + c_inner_loop != nullptr && _cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(oc_first_loop, oc_second_loop, oc_inner_loop: alloc_if(0) free_if(1)) \ @@ -615,8 +615,8 @@ void PairTersoffIntel::ForceConst::set_ntypes(const int ntypes, int tp1sq = ntypes * ntypes; int tp1cb = ntypes * ntypes * ntypes; int tp1cb_pad = ntypes * ntypes * ntypes_pad; - if (oc_first_loop != NULL && oc_second_loop != NULL && - oc_inner_loop != NULL && cop >= 0) { + if (oc_first_loop != nullptr && oc_second_loop != nullptr && + oc_inner_loop != nullptr && cop >= 0) { #pragma offload_transfer target(mic:cop) \ nocopy(oc_first_loop: length(tp1sq) alloc_if(1) free_if(0)) \ nocopy(oc_second_loop: length(tp1sq) alloc_if(1) free_if(0)) \ diff --git a/src/USER-INTEL/pair_tersoff_intel.h b/src/USER-INTEL/pair_tersoff_intel.h index 6da478c10f..195efa74de 100644 --- a/src/USER-INTEL/pair_tersoff_intel.h +++ b/src/USER-INTEL/pair_tersoff_intel.h @@ -65,7 +65,7 @@ class PairTersoffIntel : public PairTersoff { c_outer_t * * c_outer; c_inner_t * * * c_inner; ForceConst() : _ntypes(0) {} - ~ForceConst() { set_ntypes(0,NULL,_cop); } + ~ForceConst() { set_ntypes(0,nullptr,_cop); } void set_ntypes(const int ntypes, Memory *memory, const int cop); diff --git a/src/USER-INTEL/pppm_disp_intel.cpp b/src/USER-INTEL/pppm_disp_intel.cpp index 75fdc3b1df..8e958bf23b 100644 --- a/src/USER-INTEL/pppm_disp_intel.cpp +++ b/src/USER-INTEL/pppm_disp_intel.cpp @@ -15,23 +15,23 @@ Contributing authors: William McDoniel (RWTH Aachen University) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include -#include #include "pppm_disp_intel.h" + #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" -#include "modify.h" -#include "fft3d_wrap.h" #include "gridcomm.h" #include "math_const.h" #include "math_special.h" #include "memory.h" +#include "modify.h" #include "suffix.h" +#include + +#include "omp_compat.h" + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -68,18 +68,18 @@ PPPMDispIntel::PPPMDispIntel(LAMMPS *lmp) : PPPMDisp(lmp) order = 7; order_6 = 7; //sets default stencil sizes to 7 - perthread_density = NULL; - particle_ekx = particle_eky = particle_ekz = NULL; - particle_ekx0 = particle_eky0 = particle_ekz0 = NULL; - particle_ekx1 = particle_eky1 = particle_ekz1 = NULL; - particle_ekx2 = particle_eky2 = particle_ekz2 = NULL; - particle_ekx3 = particle_eky3 = particle_ekz3 = NULL; - particle_ekx4 = particle_eky4 = particle_ekz4 = NULL; - particle_ekx5 = particle_eky5 = particle_ekz5 = NULL; - particle_ekx6 = particle_eky6 = particle_ekz6 = NULL; + perthread_density = nullptr; + particle_ekx = particle_eky = particle_ekz = nullptr; + particle_ekx0 = particle_eky0 = particle_ekz0 = nullptr; + particle_ekx1 = particle_eky1 = particle_ekz1 = nullptr; + particle_ekx2 = particle_eky2 = particle_ekz2 = nullptr; + particle_ekx3 = particle_eky3 = particle_ekz3 = nullptr; + particle_ekx4 = particle_eky4 = particle_ekz4 = nullptr; + particle_ekx5 = particle_eky5 = particle_ekz5 = nullptr; + particle_ekx6 = particle_eky6 = particle_ekz6 = nullptr; - rho_lookup = drho_lookup = NULL; - rho6_lookup = drho6_lookup = NULL; + rho_lookup = drho_lookup = nullptr; + rho6_lookup = drho6_lookup = nullptr; rho_points = 0; _use_table = _use_packing = _use_lrt = 0; @@ -131,9 +131,10 @@ void PPPMDispIntel::init() // For vectorization, we need some padding in the end // The first thread computes on the global density if ((comm->nthreads > 1) && !_use_lrt) { + int mygrid = MAX(ngrid,ngrid_6); memory->destroy(perthread_density); memory->create(perthread_density, comm->nthreads-1, - ngrid + INTEL_P3M_ALIGNED_MAXORDER, + mygrid + INTEL_P3M_ALIGNED_MAXORDER, "pppmdispintel:perthread_density"); } @@ -173,23 +174,15 @@ void PPPMDispIntel::compute(int eflag, int vflag) return; } #endif + int i; + // convert atoms from box to lamda coords ev_init(eflag,vflag); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - if (function[0]) { - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } - if (function[1] + function[2] + function[3]) { - cg_peratom_6->ghost_notify(); - cg_peratom_6->setup(); - } - peratom_allocate_flag = 1; - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); + if (triclinic == 0) boxlo = domain->boxlo; else { boxlo = domain->boxlo_lamda; @@ -299,7 +292,8 @@ void PPPMDispIntel::compute(int eflag, int vflag) make_rho_c(fix->get_single_buffers()); } - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(nxlo_in, nylo_in, nzlo_in, nxhi_in, nyhi_in, nzhi_in, density_brick, density_fft, work1,remap); @@ -312,7 +306,8 @@ void PPPMDispIntel::compute(int eflag, int vflag) energy_1, greensfn, virial_1, vg,vg2, u_brick, v0_brick, v1_brick, v2_brick, v3_brick, v4_brick, v5_brick); - cg->forward_comm(this,FORWARD_AD); + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); if (fix->precision() == FixIntel::PREC_MODE_MIXED) { fieldforce_c_ad(fix->get_mixed_buffers()); @@ -322,7 +317,9 @@ void PPPMDispIntel::compute(int eflag, int vflag) fieldforce_c_ad(fix->get_single_buffers()); } - if (vflag_atom) cg_peratom->forward_comm(this, FORWARD_AD_PERATOM); + if (vflag_atom) + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } else { poisson_ik(work1, work2, density_fft, fft1, fft2, @@ -334,7 +331,8 @@ void PPPMDispIntel::compute(int eflag, int vflag) u_brick, v0_brick, v1_brick, v2_brick, v3_brick, v4_brick, v5_brick); - cg->forward_comm(this, FORWARD_IK); + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); if (fix->precision() == FixIntel::PREC_MODE_MIXED) { fieldforce_c_ik(fix->get_mixed_buffers()); @@ -344,12 +342,15 @@ void PPPMDispIntel::compute(int eflag, int vflag) fieldforce_c_ik(fix->get_single_buffers()); } - if (evflag_atom) cg_peratom->forward_comm(this, FORWARD_IK_PERATOM); + if (evflag_atom) + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } if (evflag_atom) fieldforce_c_peratom(); } if (function[1]) { + //perform calculations for geometric mixing if (fix->precision() == FixIntel::PREC_MODE_MIXED) { @@ -375,14 +376,13 @@ void PPPMDispIntel::compute(int eflag, int vflag) make_rho_g(fix->get_single_buffers()); } - - cg_6->reverse_comm(this, REVERSE_RHO_G); + gc6->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); brick2fft(nxlo_in_6, nylo_in_6, nzlo_in_6, nxhi_in_6, nyhi_in_6, nzhi_in_6, density_brick_g, density_fft_g, work1_6,remap_6); if (differentiation_flag == 1) { - poisson_ad(work1_6, work2_6, density_fft_g, fft1_6, fft2_6, nx_pppm_6, ny_pppm_6, nz_pppm_6, nfft_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, @@ -391,17 +391,20 @@ void PPPMDispIntel::compute(int eflag, int vflag) virial_6, vg_6, vg2_6, u_brick_g, v0_brick_g, v1_brick_g, v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g); - cg_6->forward_comm(this,FORWARD_AD_G); + gc6->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); - if (fix->precision() == FixIntel::PREC_MODE_MIXED) { - fieldforce_g_ad(fix->get_mixed_buffers()); - } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { - fieldforce_g_ad(fix->get_double_buffers()); - } else { - fieldforce_g_ad(fix->get_single_buffers()); - } + if (fix->precision() == FixIntel::PREC_MODE_MIXED) { + fieldforce_g_ad(fix->get_mixed_buffers()); + } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { + fieldforce_g_ad(fix->get_double_buffers()); + } else { + fieldforce_g_ad(fix->get_single_buffers()); + } - if (vflag_atom) cg_peratom_6->forward_comm(this,FORWARD_AD_PERATOM_G); + if (vflag_atom) + gc6->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { poisson_ik(work1_6, work2_6, density_fft_g, fft1_6, fft2_6, @@ -413,19 +416,22 @@ void PPPMDispIntel::compute(int eflag, int vflag) vdz_brick_g, virial_6, vg_6, vg2_6, u_brick_g, v0_brick_g, v1_brick_g, v2_brick_g, v3_brick_g, v4_brick_g, v5_brick_g); - cg_6->forward_comm(this,FORWARD_IK_G); + gc6->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); - if (fix->precision() == FixIntel::PREC_MODE_MIXED) { - fieldforce_g_ik(fix->get_mixed_buffers()); - } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { - fieldforce_g_ik(fix->get_double_buffers()); - } else { - fieldforce_g_ik(fix->get_single_buffers()); + if (fix->precision() == FixIntel::PREC_MODE_MIXED) { + fieldforce_g_ik(fix->get_mixed_buffers()); + } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { + fieldforce_g_ik(fix->get_double_buffers()); + } else { + fieldforce_g_ik(fix->get_single_buffers()); + } + + if (evflag_atom) + gc6->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM_G, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } - - if (evflag_atom) cg_peratom_6->forward_comm(this, FORWARD_IK_PERATOM_G); - } if (evflag_atom) fieldforce_g_peratom(); } @@ -455,12 +461,12 @@ void PPPMDispIntel::compute(int eflag, int vflag) make_rho_a(fix->get_single_buffers()); } - cg_6->reverse_comm(this, REVERSE_RHO_A); + gc->reverse_comm_kspace(this,7,sizeof(FFT_SCALAR),REVERSE_RHO_A, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_a(); - if ( differentiation_flag == 1) { - + if (differentiation_flag == 1) { poisson_ad(work1_6, work2_6, density_fft_a3, fft1_6, fft2_6, nx_pppm_6, ny_pppm_6, nz_pppm_6, nfft_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6, @@ -481,20 +487,22 @@ void PPPMDispIntel::compute(int eflag, int vflag) v5_brick_a2, u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, v3_brick_a4, v4_brick_a4, v5_brick_a4); - cg_6->forward_comm(this, FORWARD_AD_A); + gc6->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_AD_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); - if (fix->precision() == FixIntel::PREC_MODE_MIXED) { - fieldforce_a_ad(fix->get_mixed_buffers()); - } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { - fieldforce_a_ad(fix->get_double_buffers()); - } else { - fieldforce_a_ad(fix->get_single_buffers()); - } + if (fix->precision() == FixIntel::PREC_MODE_MIXED) { + fieldforce_a_ad(fix->get_mixed_buffers()); + } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { + fieldforce_a_ad(fix->get_double_buffers()); + } else { + fieldforce_a_ad(fix->get_single_buffers()); + } - if (evflag_atom) cg_peratom_6->forward_comm(this, FORWARD_AD_PERATOM_A); + if (evflag_atom) + gc6->forward_comm_kspace(this,42,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { - poisson_ik(work1_6, work2_6, density_fft_a3, fft1_6, fft2_6, nx_pppm_6, ny_pppm_6, nz_pppm_6, nfft_6, nxlo_fft_6, nylo_fft_6, nzlo_fft_6, nxhi_fft_6, nyhi_fft_6, nzhi_fft_6, @@ -522,7 +530,8 @@ void PPPMDispIntel::compute(int eflag, int vflag) u_brick_a4, v0_brick_a4, v1_brick_a4, v2_brick_a4, v3_brick_a4, v4_brick_a4, v5_brick_a4); - cg_6->forward_comm(this, FORWARD_IK_A); + gc6->forward_comm_kspace(this,18,sizeof(FFT_SCALAR),FORWARD_IK_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); if (fix->precision() == FixIntel::PREC_MODE_MIXED) { fieldforce_a_ik(fix->get_mixed_buffers()); @@ -532,13 +541,17 @@ void PPPMDispIntel::compute(int eflag, int vflag) fieldforce_a_ik(fix->get_single_buffers()); } - if (evflag_atom) cg_peratom_6->forward_comm(this, FORWARD_IK_PERATOM_A); + if (evflag_atom) + gc6->forward_comm_kspace(this,49,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM_A, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } + if (evflag_atom) fieldforce_a_peratom(); } if (function[3]) { - //perform calculations if no mixing rule applies + + // perform calculations if no mixing rule applies if (fix->precision() == FixIntel::PREC_MODE_MIXED) { particle_map(delxinv_6, delyinv_6, delzinv_6, shift_6, @@ -563,7 +576,8 @@ void PPPMDispIntel::compute(int eflag, int vflag) make_rho_none(fix->get_single_buffers()); } - cg_6->reverse_comm(this, REVERSE_RHO_NONE); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO_NONE, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft_none(); @@ -578,17 +592,20 @@ void PPPMDispIntel::compute(int eflag, int vflag) n += 2; } - cg_6->forward_comm(this,FORWARD_AD_NONE); + gc6->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); - if (fix->precision() == FixIntel::PREC_MODE_MIXED) { - fieldforce_none_ad(fix->get_mixed_buffers()); - } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { - fieldforce_none_ad(fix->get_double_buffers()); - } else { - fieldforce_none_ad(fix->get_single_buffers()); - } + if (fix->precision() == FixIntel::PREC_MODE_MIXED) { + fieldforce_none_ad(fix->get_mixed_buffers()); + } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { + fieldforce_none_ad(fix->get_double_buffers()); + } else { + fieldforce_none_ad(fix->get_single_buffers()); + } - if (vflag_atom) cg_peratom_6->forward_comm(this,FORWARD_AD_PERATOM_NONE); + if (vflag_atom) + gc6->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } else { int n = 0; @@ -604,19 +621,22 @@ void PPPMDispIntel::compute(int eflag, int vflag) n += 2; } - cg_6->forward_comm(this,FORWARD_IK_NONE); + gc6->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); - if (fix->precision() == FixIntel::PREC_MODE_MIXED) { - fieldforce_none_ik(fix->get_mixed_buffers()); - } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { - fieldforce_none_ik(fix->get_double_buffers()); - } else { - fieldforce_none_ik(fix->get_single_buffers()); - } + if (fix->precision() == FixIntel::PREC_MODE_MIXED) { + fieldforce_none_ik(fix->get_mixed_buffers()); + } else if (fix->precision() == FixIntel::PREC_MODE_DOUBLE) { + fieldforce_none_ik(fix->get_double_buffers()); + } else { + fieldforce_none_ik(fix->get_single_buffers()); + } if (evflag_atom) - cg_peratom_6->forward_comm(this, FORWARD_IK_PERATOM_NONE); + gc6->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM_NONE, + gc6_buf1,gc6_buf2,MPI_FFT_SCALAR); } + if (evflag_atom) fieldforce_none_peratom(); } @@ -655,7 +675,7 @@ void PPPMDispIntel::compute(int eflag, int vflag) for (i = 0; i < 6; i++) virial[i] = 0.5*qscale*volume*virial_all[i]; MPI_Allreduce(virial_6,virial_all,6,MPI_DOUBLE,MPI_SUM,world); for (i = 0; i < 6; i++) virial[i] += 0.5*volume*virial_all[i]; - if (function[1]+function[2]+function[3]){ + if (function[1]+function[2]+function[3]) { double a = MY_PI*MY_PIS/(6*volume)*pow(g_ewald_6,3)*csumij; virial[0] -= a; virial[1] -= a; @@ -2964,69 +2984,73 @@ void PPPMDispIntel::fieldforce_none_ad(IntelBuffers * /*buffers*/) void PPPMDispIntel::precompute_rho() { - half_rho_scale = (rho_points - 1.)/2.; half_rho_scale_plus = half_rho_scale + 0.5; - for (int i = 0; i < rho_points; i++) { - FFT_SCALAR dx = -1. + 1./half_rho_scale * (FFT_SCALAR)i; - #if defined(LMP_SIMD_COMPILER) - #pragma simd - #endif - for (int k=nlower; k<=nupper;k++){ - FFT_SCALAR r1 = ZEROF; - for(int l=order-1; l>=0; l--){ - r1 = rho_coeff[l][k] + r1*dx; - } - rho_lookup[i][k-nlower] = r1; - } - for (int k = nupper-nlower+1; k < INTEL_P3M_ALIGNED_MAXORDER; k++) { - rho_lookup[i][k] = 0; - } - if (differentiation_flag == 1) { + if (function[0]) { + for (int i = 0; i < rho_points; i++) { + FFT_SCALAR dx = -1. + 1./half_rho_scale * (FFT_SCALAR)i; #if defined(LMP_SIMD_COMPILER) #pragma simd #endif - for(int k=nlower; k<=nupper;k++){ + for (int k=nlower; k<=nupper;k++){ FFT_SCALAR r1 = ZEROF; - for(int l=order-2; l>=0; l--){ - r1 = drho_coeff[l][k] + r1*dx; + for(int l=order-1; l>=0; l--){ + r1 = rho_coeff[l][k] + r1*dx; } - drho_lookup[i][k-nlower] = r1; + rho_lookup[i][k-nlower] = r1; } for (int k = nupper-nlower+1; k < INTEL_P3M_ALIGNED_MAXORDER; k++) { - drho_lookup[i][k] = 0; + rho_lookup[i][k] = 0; + } + if (differentiation_flag == 1) { + #if defined(LMP_SIMD_COMPILER) + #pragma simd + #endif + for(int k=nlower; k<=nupper;k++){ + FFT_SCALAR r1 = ZEROF; + for(int l=order-2; l>=0; l--){ + r1 = drho_coeff[l][k] + r1*dx; + } + drho_lookup[i][k-nlower] = r1; + } + for (int k = nupper-nlower+1; k < INTEL_P3M_ALIGNED_MAXORDER; k++) { + drho_lookup[i][k] = 0; + } } } } - for (int i = 0; i < rho_points; i++) { - FFT_SCALAR dx = -1. + 1./half_rho_scale * (FFT_SCALAR)i; - #if defined(LMP_SIMD_COMPILER) - #pragma simd - #endif - for (int k=nlower_6; k<=nupper_6;k++){ - FFT_SCALAR r1 = ZEROF; - for(int l=order_6-1; l>=0; l--){ - r1 = rho_coeff_6[l][k] + r1*dx; - } - rho6_lookup[i][k-nlower_6] = r1; - } - for (int k = nupper_6-nlower_6+1; k < INTEL_P3M_ALIGNED_MAXORDER; k++) { - rho6_lookup[i][k] = 0; - } - if (differentiation_flag == 1) { + + if (function[1]+function[2]+function[3]) { + for (int i = 0; i < rho_points; i++) { + FFT_SCALAR dx = -1. + 1./half_rho_scale * (FFT_SCALAR)i; #if defined(LMP_SIMD_COMPILER) #pragma simd #endif - for(int k=nlower_6; k<=nupper_6;k++){ + for (int k=nlower_6; k<=nupper_6;k++){ FFT_SCALAR r1 = ZEROF; - for(int l=order_6-2; l>=0; l--){ - r1 = drho_coeff_6[l][k] + r1*dx; + for(int l=order_6-1; l>=0; l--){ + r1 = rho_coeff_6[l][k] + r1*dx; } - drho6_lookup[i][k-nlower_6] = r1; + rho6_lookup[i][k-nlower_6] = r1; } for (int k = nupper_6-nlower_6+1; k < INTEL_P3M_ALIGNED_MAXORDER; k++) { - drho6_lookup[i][k] = 0; + rho6_lookup[i][k] = 0; + } + if (differentiation_flag == 1) { + #if defined(LMP_SIMD_COMPILER) + #pragma simd + #endif + for(int k=nlower_6; k<=nupper_6;k++){ + FFT_SCALAR r1 = ZEROF; + for(int l=order_6-2; l>=0; l--){ + r1 = drho_coeff_6[l][k] + r1*dx; + } + drho6_lookup[i][k-nlower_6] = r1; + } + for (int k = nupper_6-nlower_6+1; k < INTEL_P3M_ALIGNED_MAXORDER; k++) { + drho6_lookup[i][k] = 0; + } } } } diff --git a/src/USER-INTEL/pppm_disp_intel.h b/src/USER-INTEL/pppm_disp_intel.h index 7c88c458f8..89f580aa08 100644 --- a/src/USER-INTEL/pppm_disp_intel.h +++ b/src/USER-INTEL/pppm_disp_intel.h @@ -70,8 +70,6 @@ namespace LAMMPS_NS { FFT_SCALAR *particle_eky6; FFT_SCALAR *particle_ekz6; - - int _use_table; int rho_points; FFT_SCALAR **rho_lookup; @@ -82,7 +80,6 @@ namespace LAMMPS_NS { int _use_packing; - #ifdef _LMP_INTEL_OFFLOAD int _use_base; #endif diff --git a/src/USER-INTEL/pppm_intel.cpp b/src/USER-INTEL/pppm_intel.cpp index d643da96b2..1a09522a2a 100644 --- a/src/USER-INTEL/pppm_intel.cpp +++ b/src/USER-INTEL/pppm_intel.cpp @@ -18,23 +18,24 @@ W. Michael Brown (Intel) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include -#include #include "pppm_intel.h" + #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" -#include "modify.h" -#include "fft3d_wrap.h" #include "gridcomm.h" #include "math_const.h" #include "math_special.h" #include "memory.h" +#include "modify.h" #include "suffix.h" +#include +#include + +#include "omp_compat.h" + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -64,10 +65,10 @@ PPPMIntel::PPPMIntel(LAMMPS *lmp) : PPPM(lmp) order = 7; //sets default stencil size to 7 - perthread_density = NULL; - particle_ekx = particle_eky = particle_ekz = NULL; + perthread_density = nullptr; + particle_ekx = particle_eky = particle_ekz = nullptr; - rho_lookup = drho_lookup = NULL; + rho_lookup = drho_lookup = nullptr; rho_points = 0; _use_table = _use_lrt = 0; @@ -164,11 +165,7 @@ void PPPMIntel::compute_first(int eflag, int vflag) ev_init(eflag,vflag); - if (evflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom->ghost_notify(); - cg_peratom->setup(); - } + if (evflag_atom && !peratom_allocate_flag) allocate_peratom(); // if atom count has changed, update qsum and qsqsum @@ -232,7 +229,8 @@ void PPPMIntel::compute_first(int eflag, int vflag) // to fully sum contribution in their 3d bricks // remap from 3d decomposition to FFT decomposition - cg->reverse_comm(this,REVERSE_RHO); + gc->reverse_comm_kspace(this,1,sizeof(FFT_SCALAR),REVERSE_RHO, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); brick2fft(); // compute potential gradient on my FFT grid and @@ -246,16 +244,22 @@ void PPPMIntel::compute_first(int eflag, int vflag) // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks - if (differentiation_flag == 1) cg->forward_comm(this,FORWARD_AD); - else cg->forward_comm(this,FORWARD_IK); + if (differentiation_flag == 1) + gc->forward_comm_kspace(this,1,sizeof(FFT_SCALAR),FORWARD_AD, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); + else + gc->forward_comm_kspace(this,3,sizeof(FFT_SCALAR),FORWARD_IK, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); // extra per-atom energy/virial communication if (evflag_atom) { if (differentiation_flag == 1 && vflag_atom) - cg_peratom->forward_comm(this,FORWARD_AD_PERATOM); + gc->forward_comm_kspace(this,6,sizeof(FFT_SCALAR),FORWARD_AD_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); else if (differentiation_flag == 0) - cg_peratom->forward_comm(this,FORWARD_IK_PERATOM); + gc->forward_comm_kspace(this,7,sizeof(FFT_SCALAR),FORWARD_IK_PERATOM, + gc_buf1,gc_buf2,MPI_FFT_SCALAR); } } diff --git a/src/USER-INTEL/verlet_lrt_intel.cpp b/src/USER-INTEL/verlet_lrt_intel.cpp index 4efed0d337..6b55b92fef 100644 --- a/src/USER-INTEL/verlet_lrt_intel.cpp +++ b/src/USER-INTEL/verlet_lrt_intel.cpp @@ -45,7 +45,7 @@ using namespace LAMMPS_NS; VerletLRTIntel::VerletLRTIntel(LAMMPS *lmp, int narg, char **arg) : Verlet(lmp, narg, arg) { #if defined(_LMP_INTEL_LRT_PTHREAD) - pthread_mutex_init(&_kmutex,NULL); + pthread_mutex_init(&_kmutex,nullptr); #endif } @@ -119,7 +119,7 @@ void VerletLRTIntel::setup(int flag) _kspace_ready = 0; _kspace_done = 0; - pthread_cond_init(&_kcond, NULL); + pthread_cond_init(&_kcond, nullptr); pthread_attr_init(&_kspace_attr); pthread_attr_setdetachstate(&_kspace_attr, PTHREAD_CREATE_JOINABLE); #endif @@ -171,7 +171,7 @@ void VerletLRTIntel::setup(int flag) if (pair_compute_flag) force->pair->compute(eflag,vflag); else if (force->pair) force->pair->compute_dummy(eflag,vflag); - if (atom->molecular) { + if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); @@ -377,7 +377,7 @@ void VerletLRTIntel::run(int n) _kspace_done = 0; pthread_cond_signal(&_kcond); pthread_mutex_unlock(&_kmutex); - pthread_join(_kspace_thread, NULL); + pthread_join(_kspace_thread, nullptr); pthread_attr_destroy(&_kspace_attr); } #endif @@ -428,8 +428,8 @@ void * VerletLRTIntel::k_launch_loop(void *context) pthread_mutex_unlock(&(c->_kmutex)); } - pthread_exit(NULL); - return NULL; + pthread_exit(nullptr); + return nullptr; } #endif diff --git a/src/USER-LB/fix_lb_fluid.cpp b/src/USER-LB/fix_lb_fluid.cpp index 8ad3dbe33e..ce51757c68 100644 --- a/src/USER-LB/fix_lb_fluid.cpp +++ b/src/USER-LB/fix_lb_fluid.cpp @@ -18,8 +18,8 @@ #include "fix_lb_fluid.h" #include -#include -#include + + #include #include #include @@ -116,8 +116,8 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : setArea = 0; numvel = 15; - Gamma = NULL; - NodeArea = NULL; + Gamma = nullptr; + NodeArea = nullptr; int iarg = 7; while (iarg < narg){ @@ -129,7 +129,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : double areafactor = atof(arg[iarg+2]); if(itype <= 0 || itype > atom->ntypes || areafactor < 0.0) error->all(FLERR,"Illegal fix lb/fluid command: setArea"); - if(NodeArea == NULL){ + if(NodeArea == nullptr){ NodeArea = new double[atom->ntypes+1]; for(int i=0; i<=atom->ntypes; i++) NodeArea[i] = -1.0; } @@ -142,7 +142,7 @@ FixLbFluid::FixLbFluid(LAMMPS *lmp, int narg, char **arg) : setGamma = 1; double Gammaone; Gammaone = atof(arg[iarg+1]); - if(Gamma == NULL) + if(Gamma == nullptr) Gamma = new double[atom->ntypes+1]; for(int i=0; i<=atom->ntypes; i++) Gamma[i] = Gammaone; iarg += 2; @@ -240,32 +240,32 @@ a z wall velocity without implementing fixed BCs in z"); // perform initial allocation of atom-based array register // with Atom class //-------------------------------------------------------------------------- - hydroF = NULL; + hydroF = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); for(int i=0; inmax; i++) for(int j=0; j<3; j++) hydroF[i][j] = 0.0; - Ng_lb = NULL; - w_lb = NULL; - mg_lb = NULL; - e = NULL; - feq = NULL; - feqold = NULL; - feqn = NULL; - feqoldn = NULL; - f_lb = NULL; - fnew = NULL; - density_lb = NULL; - u_lb = NULL; - altogether = NULL; - buf = NULL; - Ff = NULL; - Fftempx = NULL; - Fftempy = NULL; - Fftempz = NULL; + Ng_lb = nullptr; + w_lb = nullptr; + mg_lb = nullptr; + e = nullptr; + feq = nullptr; + feqold = nullptr; + feqn = nullptr; + feqoldn = nullptr; + f_lb = nullptr; + fnew = nullptr; + density_lb = nullptr; + u_lb = nullptr; + altogether = nullptr; + buf = nullptr; + Ff = nullptr; + Fftempx = nullptr; + Fftempy = nullptr; + Fftempz = nullptr; //-------------------------------------------------------------------------- // Set the lattice Boltzmann dt. @@ -510,7 +510,7 @@ a z wall velocity without implementing fixed BCs in z"); FixLbFluid::~FixLbFluid() { - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(hydroF); memory->destroy(Ng_lb); diff --git a/src/USER-LB/fix_lb_momentum.cpp b/src/USER-LB/fix_lb_momentum.cpp index 10fffed018..0a307790d5 100644 --- a/src/USER-LB/fix_lb_momentum.cpp +++ b/src/USER-LB/fix_lb_momentum.cpp @@ -19,8 +19,8 @@ ------------------------------------------------------------------------- */ #include "fix_lb_momentum.h" -#include -#include + + #include #include "atom.h" #include "group.h" diff --git a/src/USER-LB/fix_lb_pc.cpp b/src/USER-LB/fix_lb_pc.cpp index d61692419a..0b45770ceb 100644 --- a/src/USER-LB/fix_lb_pc.cpp +++ b/src/USER-LB/fix_lb_pc.cpp @@ -26,7 +26,7 @@ #include "domain.h" #include "fix_lb_fluid.h" #include "modify.h" -#include + #include "group.h" using namespace LAMMPS_NS; @@ -45,11 +45,11 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - force_old = NULL; - up = NULL; - up_old = NULL; + force_old = nullptr; + up = nullptr; + up_old = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); Gamma_MD = new double[atom->ntypes+1]; @@ -76,7 +76,7 @@ FixLbPC::FixLbPC(LAMMPS *lmp, int narg, char **arg) : FixLbPC::~FixLbPC() { - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(force_old); memory->destroy(up); diff --git a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp index af1b01043d..b0edbc63f3 100644 --- a/src/USER-LB/fix_lb_rigid_pc_sphere.cpp +++ b/src/USER-LB/fix_lb_rigid_pc_sphere.cpp @@ -17,9 +17,9 @@ ------------------------------------------------------------------------- */ #include "fix_lb_rigid_pc_sphere.h" -#include + #include -#include + #include #include "atom.h" #include "domain.h" @@ -32,6 +32,7 @@ #include "error.h" #include "fix_lb_fluid.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -53,10 +54,10 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - body = NULL; - up = NULL; + body = nullptr; + up = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // by default assume all of the particles interact with the fluid. inner_nodes = 0; @@ -92,7 +93,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"molecule") == 0) { iarg = 4; - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Must use a molecular atom style with " "fix lb/rigid/pc/sphere molecule"); @@ -233,7 +234,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : if (iarg+5 > narg) error->all(FLERR,"Illegal fix lb/rigid/pc/sphere command"); int mlo,mhi; - force->bounds(FLERR,arg[iarg+1],nbody,mlo,mhi); + utils::bounds(FLERR,arg[iarg+1],1,nbody,mlo,mhi,error); double xflag,yflag,zflag; if (strcmp(arg[iarg+2],"off") == 0) xflag = 0.0; @@ -260,7 +261,7 @@ FixLbRigidPCSphere::FixLbRigidPCSphere(LAMMPS *lmp, int narg, char **arg) : if (iarg+5 > narg) error->all(FLERR,"Illegal fix lb/rigid/pc/sphere command"); int mlo,mhi; - force->bounds(FLERR,arg[iarg+1],nbody,mlo,mhi); + utils::bounds(FLERR,arg[iarg+1],1,nbody,mlo,mhi,error); double xflag,yflag,zflag; if (strcmp(arg[iarg+2],"off") == 0) xflag = 0.0; @@ -399,7 +400,7 @@ FixLbRigidPCSphere::~FixLbRigidPCSphere() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/USER-LB/fix_lb_viscous.cpp b/src/USER-LB/fix_lb_viscous.cpp index 59fddebd67..602ec29f00 100644 --- a/src/USER-LB/fix_lb_viscous.cpp +++ b/src/USER-LB/fix_lb_viscous.cpp @@ -88,7 +88,7 @@ void FixLbViscous::init() void FixLbViscous::setup(int vflag) { - if (strstr(update->integrate_style,"verlet") != NULL) + if (strstr(update->integrate_style,"verlet") != nullptr) post_force(vflag); else { ((Respa *) update->integrate)->copy_flevel_f(nlevels_respa-1); diff --git a/src/USER-MANIFOLD/fix_manifoldforce.cpp b/src/USER-MANIFOLD/fix_manifoldforce.cpp index 74a9a1833f..3193b23d6e 100644 --- a/src/USER-MANIFOLD/fix_manifoldforce.cpp +++ b/src/USER-MANIFOLD/fix_manifoldforce.cpp @@ -12,17 +12,16 @@ ------------------------------------------------------------------------- */ #include "fix_manifoldforce.h" // For stuff -#include -#include -#include "atom.h" -#include "update.h" -#include "respa.h" -#include "error.h" -#include "force.h" #include "manifold.h" #include "manifold_factory.h" // For constructing manifold +#include "atom.h" +#include "error.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -77,7 +76,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : } ptr_m->params = new double[nvars]; - if (ptr_m->params == NULL) { + if (ptr_m->params == nullptr) { error->all(FLERR,"Parameter pointer was NULL!"); } @@ -92,7 +91,7 @@ FixManifoldForce::FixManifoldForce(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Equal-style variables not allowed with fix manifoldforce"); // Use force->numeric to trigger an error if arg is not a number. - params[i] = force->numeric(FLERR,arg[i+4]); + params[i] = utils::numeric(FLERR,arg[i+4],false,lmp); } diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp index 312db1c411..abe903125b 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.cpp @@ -33,7 +33,7 @@ #include "fix_nve_manifold_rattle.h" -#include + #include #include "atom.h" #include "force.h" @@ -91,8 +91,8 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, next_output = 0; dtv = dtf = 0; - tolerance = force->numeric( FLERR, arg[3] ); - max_iter = force->numeric( FLERR, arg[4] ); + tolerance = utils::numeric( FLERR, arg[3] ,false,lmp); + max_iter = utils::numeric( FLERR, arg[4] ,false,lmp); ptr_m = create_manifold(arg[5], lmp, narg, arg); if (!ptr_m) { @@ -124,12 +124,12 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, is_var[i] = 1; offset = 2; } else { - force->numeric(FLERR,arg[i+6]); // Check if legal number. + utils::numeric(FLERR,arg[i+6],false,lmp); // Check if legal number. len = strlen( arg[i+6] ) + 1; // +1 for \0. is_var[i] = 0; } tstrs[i] = new char[len]; - if (tstrs[i] == NULL ) error->all(FLERR,"Error allocating space for args."); + if (tstrs[i] == nullptr ) error->all(FLERR,"Error allocating space for args."); strcpy( tstrs[i], arg[i+6] + offset ); } @@ -137,7 +137,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, if (!ptr_m->params ) error->all(FLERR,"Failed to allocate params!"); for( int i = 0; i < nvars; ++i ){ // If param i was variable type, it will be set later... - ptr_m->params[i] = is_var[i] ? 0.0 : force->numeric( FLERR, arg[i+6] ); + ptr_m->params[i] = is_var[i] ? 0.0 : utils::numeric( FLERR, arg[i+6] ,false,lmp); } ptr_m->post_param_init(); @@ -146,7 +146,7 @@ FixNVEManifoldRattle::FixNVEManifoldRattle( LAMMPS *lmp, int &narg, char **arg, int argi = 6 + nvars; while( argi < narg ){ if (strcmp(arg[argi], "every") == 0) { - nevery = force->inumeric(FLERR,arg[argi+1]); + nevery = utils::inumeric(FLERR,arg[argi+1],false,lmp); next_output = update->ntimestep + nevery; if (comm->me == 0) { fprintf(screen,"Outputting every %d steps, next is %d\n", diff --git a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h index 42da240abc..7ed1f75fa8 100644 --- a/src/USER-MANIFOLD/fix_nve_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nve_manifold_rattle.h @@ -125,7 +125,7 @@ E: There is no manifold named ... Self-explanatory. You requested a manifold whose name was not registered at the factory. -E: Manifold pointer was NULL for some reason! +E: Manifold pointer was nullptr for some reason! This indicates a bug. The factory was unable to properly create the requested manifold even though it was registered. Send the @@ -136,7 +136,7 @@ E: Manifold ... needs at least ... argument(s)! Self-explanatory. Provide enough arguments for the proper creating of the requested manifold. -E: Parameter pointer was NULL! +E: Parameter pointer was nullptr! This indicates a bug. The array that contains the parameters could not be allocated. Send the maintainer an e-mail. diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp index db3267db28..f07e414ac9 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.cpp @@ -101,9 +101,9 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, if (argi+3 >= narg) error->all(FLERR,"Keyword 'temp' needs 3 arguments"); - t_start = force->numeric(FLERR, arg[argi+1]); - t_stop = force->numeric(FLERR, arg[argi+2]); - t_period = force->numeric(FLERR, arg[argi+3]); + t_start = utils::numeric(FLERR, arg[argi+1],false,lmp); + t_stop = utils::numeric(FLERR, arg[argi+2],false,lmp); + t_period = utils::numeric(FLERR, arg[argi+3],false,lmp); t_target = t_start; got_temp = 1; @@ -112,7 +112,7 @@ FixNVTManifoldRattle::FixNVTManifoldRattle(LAMMPS *lmp, int narg, char **arg, if (argi+1 >= narg) error->all(FLERR,"Keyword 'tchain' needs 1 argument"); - mtchain = force->inumeric(FLERR, arg[argi+1]); + mtchain = utils::inumeric(FLERR, arg[argi+1],false,lmp); argi += 2; } else if (error_on_unknown_keyword) { char msg[2048]; diff --git a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h index f42902f721..69e4eb13e1 100644 --- a/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h +++ b/src/USER-MANIFOLD/fix_nvt_manifold_rattle.h @@ -112,7 +112,7 @@ E: There is no manifold named ... Self-explanatory. You requested a manifold whose name was not registered at the factory. -E: Manifold pointer was NULL for some reason! +E: Manifold pointer was nullptr for some reason! This indicates a bug. The factory was unable to properly create the requested manifold even though it was registered. Send the @@ -123,7 +123,7 @@ E: Manifold ... needs at least ... argument(s)! Self-explanatory. Provide enough arguments for the proper creating of the requested manifold. -E: Parameter pointer was NULL! +E: Parameter pointer was nullptr! This indicates a bug. The array that contains the parameters could not be allocated. Send the maintainer an e-mail. diff --git a/src/USER-MANIFOLD/manifold.h b/src/USER-MANIFOLD/manifold.h index b0727c346d..9adf7055c7 100644 --- a/src/USER-MANIFOLD/manifold.h +++ b/src/USER-MANIFOLD/manifold.h @@ -46,7 +46,7 @@ namespace user_manifold { // Abstract base class. class manifold : protected Pointers { public: - manifold(class LAMMPS* lmp) : Pointers(lmp), params(NULL){ } + manifold(class LAMMPS* lmp) : Pointers(lmp), params(nullptr){ } virtual ~manifold(){ delete[] params; } virtual double g( const double * ) = 0; virtual void n( const double *, double * ) = 0; diff --git a/src/USER-MANIFOLD/manifold_factory.cpp b/src/USER-MANIFOLD/manifold_factory.cpp index 7df3e52ed7..fe9b7615b3 100644 --- a/src/USER-MANIFOLD/manifold_factory.cpp +++ b/src/USER-MANIFOLD/manifold_factory.cpp @@ -54,7 +54,7 @@ manifold* LAMMPS_NS::user_manifold::create_manifold(const char *mname, LAMMPS *lmp, int narg, char **arg ) { - manifold *man = NULL; + manifold *man = nullptr; make_manifold_if ( &man, mname, lmp, narg, arg ); make_manifold_if ( &man, mname, lmp, narg, arg ); make_manifold_if ( &man, mname, lmp, narg, arg ); diff --git a/src/USER-MANIFOLD/manifold_factory.h b/src/USER-MANIFOLD/manifold_factory.h index 85ee4011be..1eac8bf644 100644 --- a/src/USER-MANIFOLD/manifold_factory.h +++ b/src/USER-MANIFOLD/manifold_factory.h @@ -94,7 +94,7 @@ class manifold; LAMMPS *lmp, int narg, char **arg ) { if( strcmp( m_type::type(), name ) == 0 ){ - if( *man_ptr == NULL ){ + if( *man_ptr == nullptr ){ *man_ptr = new m_type(lmp, narg, arg); } } diff --git a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp index b9b7ae7279..7b0d7d4d3a 100644 --- a/src/USER-MANIFOLD/manifold_gaussian_bump.cpp +++ b/src/USER-MANIFOLD/manifold_gaussian_bump.cpp @@ -3,6 +3,8 @@ #include "comm.h" #include "error.h" +#include + using namespace LAMMPS_NS; using namespace user_manifold; @@ -134,7 +136,7 @@ public: // Manifold itself: manifold_gaussian_bump::manifold_gaussian_bump(class LAMMPS* lmp, int /*narg*/, char **/*arg*/) - : manifold(lmp), lut_z(NULL), lut_zp(NULL) {} + : manifold(lmp), lut_z(nullptr), lut_zp(nullptr) {} manifold_gaussian_bump::~manifold_gaussian_bump() diff --git a/src/USER-MANIFOLD/manifold_thylakoid.cpp b/src/USER-MANIFOLD/manifold_thylakoid.cpp index e473f00a03..a1d2c7a62f 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.cpp +++ b/src/USER-MANIFOLD/manifold_thylakoid.cpp @@ -25,7 +25,7 @@ manifold_thylakoid::manifold_thylakoid( LAMMPS *lmp, int /*narg*/, char ** /*arg manifold_thylakoid::~manifold_thylakoid() { - for( std::size_t i = 0; i < parts.size(); ++i ){ + for(std::size_t i = 0; i < parts.size(); ++i) { delete parts[i]; } } @@ -60,7 +60,7 @@ void manifold_thylakoid::checkup() if (comm->me == 0 ) { fprintf(screen,"This is checkup of thylakoid %p\n", this); fprintf(screen,"I have %ld parts. They are:\n", parts.size()); - for( int i = 0; i < parts.size(); ++i ){ + for( int i = 0; i < (int)parts.size(); ++i ){ fprintf(screen, "[%f, %f] x [%f, %f] x [%f, %f]\n", parts[i]->xlo, parts[i]->xhi, parts[i]->ylo, parts[i]->yhi, @@ -123,14 +123,14 @@ thyla_part *manifold_thylakoid::get_thyla_part( const double *x, int * /*err_fla for( std::size_t i = 0; i < parts.size(); ++i ){ thyla_part *p = parts[i]; if (is_in_domain(p,x)) { - if (idx != NULL) *idx = i; + if (idx != nullptr) *idx = i; return p; } } char msg[2048]; sprintf(msg,"Could not find thyla_part for x = (%f,%f,%f)", x[0],x[1],x[2]); error->one(FLERR,msg); - return NULL; + return nullptr; } diff --git a/src/USER-MANIFOLD/manifold_thylakoid.h b/src/USER-MANIFOLD/manifold_thylakoid.h index 35ad4dfd9c..d3ffa67765 100644 --- a/src/USER-MANIFOLD/manifold_thylakoid.h +++ b/src/USER-MANIFOLD/manifold_thylakoid.h @@ -29,7 +29,7 @@ namespace user_manifold { private: void init_domains(); - thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = NULL ); + thyla_part *get_thyla_part( const double *x, int *err_flag, std::size_t *idx = nullptr ); int is_in_domain( thyla_part *p, const double *x ); void check_overlap(); std::vector parts; diff --git a/src/USER-MEAMC/meam.h b/src/USER-MEAMC/meam.h index b4f8fd341b..b974ce5bc8 100644 --- a/src/USER-MEAMC/meam.h +++ b/src/USER-MEAMC/meam.h @@ -1,9 +1,23 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + #ifndef LMP_MEAM_H #define LMP_MEAM_H +#include "math_const.h" // IWYU pragma: export + #include #include -#include "math_const.h" #define maxelt 5 diff --git a/src/USER-MEAMC/meam_dens_final.cpp b/src/USER-MEAMC/meam_dens_final.cpp index fe9e74ca7c..02c461e6b7 100644 --- a/src/USER-MEAMC/meam_dens_final.cpp +++ b/src/USER-MEAMC/meam_dens_final.cpp @@ -1,3 +1,15 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ #include "meam.h" using namespace LAMMPS_NS; diff --git a/src/USER-MEAMC/meam_dens_init.cpp b/src/USER-MEAMC/meam_dens_init.cpp index 39e3ff9467..7a5ee7a651 100644 --- a/src/USER-MEAMC/meam_dens_init.cpp +++ b/src/USER-MEAMC/meam_dens_init.cpp @@ -1,7 +1,21 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ #include "meam.h" -#include -#include "memory.h" + #include "math_special.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; diff --git a/src/USER-MEAMC/meam_force.cpp b/src/USER-MEAMC/meam_force.cpp index 2b6832e155..eba4f79ea9 100644 --- a/src/USER-MEAMC/meam_force.cpp +++ b/src/USER-MEAMC/meam_force.cpp @@ -1,10 +1,23 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ #include "meam.h" -#include -#include + #include "math_special.h" -using namespace LAMMPS_NS; +#include +#include +using namespace LAMMPS_NS; void MEAM::meam_force(int i, int eflag_either, int eflag_global, int eflag_atom, int vflag_atom, double* eng_vdwl, diff --git a/src/USER-MEAMC/meam_funcs.cpp b/src/USER-MEAMC/meam_funcs.cpp index 706075ffd0..0a632bc40a 100644 --- a/src/USER-MEAMC/meam_funcs.cpp +++ b/src/USER-MEAMC/meam_funcs.cpp @@ -16,7 +16,9 @@ ------------------------------------------------------------------------- */ #include "meam.h" + #include "math_special.h" + #include using namespace LAMMPS_NS; diff --git a/src/USER-MEAMC/meam_impl.cpp b/src/USER-MEAMC/meam_impl.cpp index 0a0b95e14a..147be92463 100644 --- a/src/USER-MEAMC/meam_impl.cpp +++ b/src/USER-MEAMC/meam_impl.cpp @@ -16,9 +16,11 @@ ------------------------------------------------------------------------- */ #include "meam.h" -#include + #include "memory.h" +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -26,15 +28,15 @@ using namespace LAMMPS_NS; MEAM::MEAM(Memory* mem) : memory(mem) { - phir = phirar = phirar1 = phirar2 = phirar3 = phirar4 = phirar5 = phirar6 = NULL; + phir = phirar = phirar1 = phirar2 = phirar3 = phirar4 = phirar5 = phirar6 = nullptr; nmax = 0; - rho = rho0 = rho1 = rho2 = rho3 = frhop = NULL; - gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = NULL; - arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = NULL; + rho = rho0 = rho1 = rho2 = rho3 = frhop = nullptr; + gamma = dgamma1 = dgamma2 = dgamma3 = arho2b = nullptr; + arho1 = arho2 = arho3 = arho3b = t_ave = tsq_ave = nullptr; maxneigh = 0; - scrfcn = dscrfcn = fcpair = NULL; + scrfcn = dscrfcn = fcpair = nullptr; neltypes = 0; for (int i = 0; i < maxelt; i++) { diff --git a/src/USER-MEAMC/meam_setup_done.cpp b/src/USER-MEAMC/meam_setup_done.cpp index 25f1bb9e81..f8703f10e5 100644 --- a/src/USER-MEAMC/meam_setup_done.cpp +++ b/src/USER-MEAMC/meam_setup_done.cpp @@ -1,9 +1,23 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ #include "meam.h" + +#include "math_special.h" +#include "memory.h" + #include #include #include -#include "math_special.h" -#include "memory.h" using namespace LAMMPS_NS; @@ -172,21 +186,21 @@ MEAM::compute_pair_meam(void) double C, s111, s112, s221, S11, S22; // check for previously allocated arrays and free them - if (this->phir != NULL) + if (this->phir != nullptr) memory->destroy(this->phir); - if (this->phirar != NULL) + if (this->phirar != nullptr) memory->destroy(this->phirar); - if (this->phirar1 != NULL) + if (this->phirar1 != nullptr) memory->destroy(this->phirar1); - if (this->phirar2 != NULL) + if (this->phirar2 != nullptr) memory->destroy(this->phirar2); - if (this->phirar3 != NULL) + if (this->phirar3 != nullptr) memory->destroy(this->phirar3); - if (this->phirar4 != NULL) + if (this->phirar4 != nullptr) memory->destroy(this->phirar4); - if (this->phirar5 != NULL) + if (this->phirar5 != nullptr) memory->destroy(this->phirar5); - if (this->phirar6 != NULL) + if (this->phirar6 != nullptr) memory->destroy(this->phirar6); // allocate memory for array that defines the potential diff --git a/src/USER-MEAMC/meam_setup_global.cpp b/src/USER-MEAMC/meam_setup_global.cpp index 60264b87cb..93b866a14f 100644 --- a/src/USER-MEAMC/meam_setup_global.cpp +++ b/src/USER-MEAMC/meam_setup_global.cpp @@ -1,5 +1,19 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ #include "meam.h" + #include + using namespace LAMMPS_NS; template diff --git a/src/USER-MEAMC/meam_setup_param.cpp b/src/USER-MEAMC/meam_setup_param.cpp index f0e04ff1c0..f2c44504de 100644 --- a/src/USER-MEAMC/meam_setup_param.cpp +++ b/src/USER-MEAMC/meam_setup_param.cpp @@ -1,5 +1,22 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + #include "meam.h" + +#include "math_const.h" #include +#include + using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-MEAMC/pair_meamc.cpp b/src/USER-MEAMC/pair_meamc.cpp index b344dee10a..4c4a3dcf62 100644 --- a/src/USER-MEAMC/pair_meamc.cpp +++ b/src/USER-MEAMC/pair_meamc.cpp @@ -16,10 +16,10 @@ ------------------------------------------------------------------------- */ #include "pair_meamc.h" -#include -#include + + #include -#include + #include "meam.h" #include "atom.h" #include "force.h" @@ -29,8 +29,8 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; @@ -56,10 +56,10 @@ PairMEAMC::PairMEAMC(LAMMPS *lmp) : Pair(lmp) allocated = 0; nelements = 0; - elements = NULL; - mass = NULL; + elements = nullptr; + mass = nullptr; meam_inst = new MEAM(memory); - scale = NULL; + scale = nullptr; // set comm size needed by this Pair @@ -161,7 +161,7 @@ void PairMEAMC::compute(int eflag, int vflag) double **vptr; if (vflag_atom) vptr = vatom; - else vptr = NULL; + else vptr = nullptr; for (ii = 0; ii < inum_half; ii++) { i = ilist_half[ii]; @@ -364,8 +364,8 @@ void PairMEAMC::read_files(const std::string &globalfile, FILE *fp; if (comm->me == 0) { - fp = force->open_potential(globalfile.c_str()); - if (fp == NULL) + fp = utils::open_potential(globalfile,lmp,nullptr); + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open MEAM potential file {}", globalfile)); } @@ -408,7 +408,7 @@ void PairMEAMC::read_files(const std::string &globalfile, while (1) { char *ptr; ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); break; } @@ -424,7 +424,7 @@ void PairMEAMC::read_files(const std::string &globalfile, while (nwords < params_per_line) { int n = strlen(line); ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); break; } @@ -440,7 +440,7 @@ void PairMEAMC::read_files(const std::string &globalfile, nwords = 0; words[nwords++] = strtok(line,"' \t\n\r\f"); - while ((words[nwords++] = strtok(NULL,"' \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr,"' \t\n\r\f"))) continue; // skip if element name isn't in element list @@ -556,15 +556,15 @@ void PairMEAMC::read_files(const std::string &globalfile, delete [] rozero; delete [] found; - // done if user param file is NULL + // done if user param file is "NULL" if (userfile == "NULL") return; // open user param file on proc 0 if (comm->me == 0) { - fp = force->open_potential(userfile.c_str()); - if (fp == NULL) + fp = utils::open_potential(userfile,lmp,nullptr); + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open MEAM potential file {}", userfile)); } @@ -584,7 +584,7 @@ void PairMEAMC::read_files(const std::string &globalfile, char *ptr; if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { fclose(fp); nline = -1; } else nline = strlen(line) + 1; @@ -603,7 +603,7 @@ void PairMEAMC::read_files(const std::string &globalfile, int nparams = 0; params[nparams++] = strtok(line,"=(), '\t\n\r\f"); while (nparams < maxparams && - (params[nparams++] = strtok(NULL,"=(), '\t\n\r\f"))) + (params[nparams++] = strtok(nullptr,"=(), '\t\n\r\f"))) continue; nparams--; @@ -837,5 +837,5 @@ void *PairMEAMC::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/USER-MEAMC/pair_meamc.h b/src/USER-MEAMC/pair_meamc.h index 21e44e7ff2..9cbda8f6ad 100644 --- a/src/USER-MEAMC/pair_meamc.h +++ b/src/USER-MEAMC/pair_meamc.h @@ -22,7 +22,7 @@ PairStyle(meam,PairMEAMC) #define LMP_PAIR_MEAMC_H #include "pair.h" -#include + namespace LAMMPS_NS { diff --git a/src/USER-MESODPD/atom_vec_edpd.cpp b/src/USER-MESODPD/atom_vec_edpd.cpp index d08a626fad..84e7d0f1be 100644 --- a/src/USER-MESODPD/atom_vec_edpd.cpp +++ b/src/USER-MESODPD/atom_vec_edpd.cpp @@ -12,16 +12,13 @@ ------------------------------------------------------------------------- */ #include "atom_vec_edpd.h" -#include + #include "atom.h" -#include "comm.h" -#include "domain.h" -#include "modify.h" -#include "fix.h" -#include "update.h" -#include "memory.h" #include "error.h" -#include "utils.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -29,8 +26,8 @@ using namespace LAMMPS_NS; AtomVecEDPD::AtomVecEDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->edpd_flag = 1; diff --git a/src/USER-MESODPD/atom_vec_mdpd.cpp b/src/USER-MESODPD/atom_vec_mdpd.cpp index 0acaaf6253..a77ce72ec1 100644 --- a/src/USER-MESODPD/atom_vec_mdpd.cpp +++ b/src/USER-MESODPD/atom_vec_mdpd.cpp @@ -23,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecMDPD::AtomVecMDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->rho_flag = 1; diff --git a/src/USER-MESODPD/atom_vec_tdpd.cpp b/src/USER-MESODPD/atom_vec_tdpd.cpp index f50fe168d6..c95d0f1ed2 100644 --- a/src/USER-MESODPD/atom_vec_tdpd.cpp +++ b/src/USER-MESODPD/atom_vec_tdpd.cpp @@ -16,7 +16,7 @@ #include "atom.h" #include "update.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -24,8 +24,8 @@ using namespace LAMMPS_NS; AtomVecTDPD::AtomVecTDPD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->tdpd_flag = 1; diff --git a/src/USER-MESODPD/compute_edpd_temp_atom.cpp b/src/USER-MESODPD/compute_edpd_temp_atom.cpp index 9eb6e9752b..02aa3e7311 100644 --- a/src/USER-MESODPD/compute_edpd_temp_atom.cpp +++ b/src/USER-MESODPD/compute_edpd_temp_atom.cpp @@ -34,7 +34,7 @@ ComputeEDPDTempAtom::ComputeEDPDTempAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - temp_vector = NULL; + temp_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp index 6378ed5ef6..d87d645b6e 100644 --- a/src/USER-MESODPD/compute_tdpd_cc_atom.cpp +++ b/src/USER-MESODPD/compute_tdpd_cc_atom.cpp @@ -11,15 +11,16 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include #include "compute_tdpd_cc_atom.h" + #include "atom.h" -#include "update.h" -#include "modify.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -31,13 +32,13 @@ ComputeTDPDCCAtom::ComputeTDPDCCAtom(LAMMPS *lmp, int narg, char **arg) : if (narg != 4) error->all(FLERR,"Number of arguments for compute tdpd/cc/atom command != 4"); if (atom->tdpd_flag != 1) error->all(FLERR,"compute tdpd/cc/atom command requires atom_style with concentration (e.g. tdpd)"); - index = force->inumeric(FLERR,arg[3]); + index = utils::inumeric(FLERR,arg[3],false,lmp); peratom_flag = 1; size_peratom_cols = 0; nmax = 0; - cc_vector = NULL; + cc_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MESODPD/fix_edpd_source.cpp b/src/USER-MESODPD/fix_edpd_source.cpp index e62d9a8a79..c84f2f29a2 100644 --- a/src/USER-MESODPD/fix_edpd_source.cpp +++ b/src/USER-MESODPD/fix_edpd_source.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_edpd_source.h" -#include -#include + #include "atom.h" #include "error.h" -#include "force.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -38,21 +39,21 @@ FixEDPDSource::FixEDPDSource(LAMMPS *lmp, int narg, char **arg) : if(option == 0){ if (narg != 9 ) error->all(FLERR,"Illegal fix edpd/source command (5 args for sphere)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - radius = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + radius = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else if(option == 1){ if (narg != 11 ) error->all(FLERR,"Illegal fix edpd/edpd command (7 args for cuboid)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - dLx = force->numeric(FLERR,arg[iarg++]); - dLy = force->numeric(FLERR,arg[iarg++]); - dLz = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLx = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLy = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLz = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else error->all(FLERR,"Illegal fix edpd/source command"); } diff --git a/src/USER-MESODPD/fix_mvv_dpd.cpp b/src/USER-MESODPD/fix_mvv_dpd.cpp index 116bbf506a..4e82085baa 100644 --- a/src/USER-MESODPD/fix_mvv_dpd.cpp +++ b/src/USER-MESODPD/fix_mvv_dpd.cpp @@ -39,7 +39,7 @@ FixMvvDPD::FixMvvDPD(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix mvv/dpd command"); verlet = 0.5; - if(narg > 3) verlet = force->numeric(FLERR,arg[3]); + if(narg > 3) verlet = utils::numeric(FLERR,arg[3],false,lmp); dynamic_group_allow = 1; time_integrate = 1; diff --git a/src/USER-MESODPD/fix_mvv_edpd.cpp b/src/USER-MESODPD/fix_mvv_edpd.cpp index 3294d8d682..a0a4bac0b7 100644 --- a/src/USER-MESODPD/fix_mvv_edpd.cpp +++ b/src/USER-MESODPD/fix_mvv_edpd.cpp @@ -48,7 +48,7 @@ FixMvvEDPD::FixMvvEDPD(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix mvv/edpd command"); verlet = 0.5; - if(narg > 3) verlet = force->numeric(FLERR,arg[3]); + if(narg > 3) verlet = utils::numeric(FLERR,arg[3],false,lmp); dynamic_group_allow = 1; time_integrate = 1; diff --git a/src/USER-MESODPD/fix_mvv_tdpd.cpp b/src/USER-MESODPD/fix_mvv_tdpd.cpp index b7fe37d7ee..87978eebe3 100644 --- a/src/USER-MESODPD/fix_mvv_tdpd.cpp +++ b/src/USER-MESODPD/fix_mvv_tdpd.cpp @@ -44,7 +44,7 @@ FixMvvTDPD::FixMvvTDPD(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix mvv/tdpd command"); verlet = 0.5; - if(narg > 3) verlet = force->numeric(FLERR,arg[3]); + if(narg > 3) verlet = utils::numeric(FLERR,arg[3],false,lmp); cc_species = atom->cc_species; diff --git a/src/USER-MESODPD/fix_tdpd_source.cpp b/src/USER-MESODPD/fix_tdpd_source.cpp index 990f6a5b78..440c5055fb 100644 --- a/src/USER-MESODPD/fix_tdpd_source.cpp +++ b/src/USER-MESODPD/fix_tdpd_source.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_tdpd_source.h" -#include -#include + #include "atom.h" #include "error.h" -#include "force.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -30,7 +31,7 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Illegal fix tdpd/source command"); int iarg = 3; - cc_index = force->inumeric(FLERR,arg[iarg++]); + cc_index = utils::inumeric(FLERR,arg[iarg++],false,lmp); if (strcmp(arg[iarg],"sphere") == 0) option = 0; else if (strcmp(arg[iarg],"cuboid") == 0) option = 1; @@ -39,21 +40,21 @@ FixTDPDSource::FixTDPDSource(LAMMPS *lmp, int narg, char **arg) : if(option == 0){ if (narg != 10 ) error->all(FLERR,"Illegal fix tdpd/source command (5 args for sphere)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - radius = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + radius = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else if(option == 1){ if (narg != 12 ) error->all(FLERR,"Illegal fix tdpd/edpd command (7 args for cuboid)"); - center[0] = force->numeric(FLERR,arg[iarg++]); - center[1] = force->numeric(FLERR,arg[iarg++]); - center[2] = force->numeric(FLERR,arg[iarg++]); - dLx = force->numeric(FLERR,arg[iarg++]); - dLy = force->numeric(FLERR,arg[iarg++]); - dLz = force->numeric(FLERR,arg[iarg++]); - value = force->numeric(FLERR,arg[iarg++]); + center[0] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[1] = utils::numeric(FLERR,arg[iarg++],false,lmp); + center[2] = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLx = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLy = utils::numeric(FLERR,arg[iarg++],false,lmp); + dLz = utils::numeric(FLERR,arg[iarg++],false,lmp); + value = utils::numeric(FLERR,arg[iarg++],false,lmp); } else error->all(FLERR,"Illegal fix tdpd/source command"); } diff --git a/src/USER-MESODPD/pair_edpd.cpp b/src/USER-MESODPD/pair_edpd.cpp index c32477513d..36ad434f42 100644 --- a/src/USER-MESODPD/pair_edpd.cpp +++ b/src/USER-MESODPD/pair_edpd.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_edpd.h" -#include + #include #include #include @@ -31,7 +31,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -65,8 +65,8 @@ PairEDPD::PairEDPD(LAMMPS *lmp) : Pair(lmp) { if (lmp->citeme) lmp->citeme->add(cite_pair_edpd); writedata = 1; - random = NULL; - randomT = NULL; + random = nullptr; + randomT = nullptr; } /* ---------------------------------------------------------------------- */ @@ -270,8 +270,8 @@ void PairEDPD::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - seed = force->inumeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + seed = utils::inumeric(FLERR,arg[1],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -306,16 +306,16 @@ void PairEDPD::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double gamma_one = force->numeric(FLERR,arg[3]); - double power_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); - double kappa_one = force->numeric(FLERR,arg[6]); - double powerT_one= force->numeric(FLERR,arg[7]); - double cutT_one = force->numeric(FLERR,arg[8]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); + double power_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); + double kappa_one = utils::numeric(FLERR,arg[6],false,lmp); + double powerT_one= utils::numeric(FLERR,arg[7],false,lmp); + double cutT_one = utils::numeric(FLERR,arg[8],false,lmp); int iarg = 9; power_flag = kappa_flag = 0; @@ -325,14 +325,14 @@ void PairEDPD::coeff(int narg, char **arg) if (strcmp(arg[iarg],"power") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal pair edpd coefficients"); for (int i = 0; i < 4; i++) - sc_one[i] = force->numeric(FLERR,arg[iarg+i+1]); + sc_one[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); iarg += 5; power_flag = 1; memory->create(sc,n+1,n+1,4,"pair:sc"); } else if (strcmp(arg[iarg],"kappa") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal pair edpd coefficients"); for (int i = 0; i < 4; i++) - kc_one[i] = force->numeric(FLERR,arg[iarg+i+1]); + kc_one[i] = utils::numeric(FLERR,arg[iarg+i+1],false,lmp); iarg += 5; kappa_flag = 1; memory->create(kc,n+1,n+1,4,"pair:kc"); @@ -453,24 +453,24 @@ void PairEDPD::read_restart(FILE *fp) int me = comm->me; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&powerT[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cutT[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&powerT[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cutT[i][j],sizeof(double),1,fp,nullptr,error); if(power_flag) for (int k = 0; k < 4; k++) - utils::sfread(FLERR,&sc[i][j][k],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sc[i][j][k],sizeof(double),1,fp,nullptr,error); if(kappa_flag) for (int k = 0; k < 4; k++) - utils::sfread(FLERR,&kc[i][j][k],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&kc[i][j][k],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); @@ -508,9 +508,9 @@ void PairEDPD::write_restart_settings(FILE *fp) void PairEDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&seed,1,MPI_INT,0,world); diff --git a/src/USER-MESODPD/pair_mdpd.cpp b/src/USER-MESODPD/pair_mdpd.cpp index 7f98e6da79..62a2ca8d1c 100644 --- a/src/USER-MESODPD/pair_mdpd.cpp +++ b/src/USER-MESODPD/pair_mdpd.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_mdpd.h" -#include + #include #include #include "atom.h" @@ -30,7 +30,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -54,7 +54,7 @@ PairMDPD::PairMDPD(LAMMPS *lmp) : Pair(lmp) if (lmp->citeme) lmp->citeme->add(cite_pair_mdpd); writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -211,9 +211,9 @@ void PairMDPD::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -245,14 +245,14 @@ void PairMDPD::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double A_one = force->numeric(FLERR,arg[2]); - double B_one = force->numeric(FLERR,arg[3]); - double gamma_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); - double cut_two = force->numeric(FLERR,arg[6]); + double A_one = utils::numeric(FLERR,arg[2],false,lmp); + double B_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); + double cut_two = utils::numeric(FLERR,arg[6],false,lmp); if(cut_one < cut_two) error->all(FLERR,"Incorrect args for pair coefficients\n cutA should be larger than cutB."); @@ -348,15 +348,15 @@ void PairMDPD::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&A_att[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&B_rep[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_r[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&A_att[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&B_rep[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_r[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&A_att[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&B_rep[i][j],1,MPI_DOUBLE,0,world); @@ -386,10 +386,10 @@ void PairMDPD::write_restart_settings(FILE *fp) void PairMDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MESODPD/pair_mdpd_rhosum.cpp b/src/USER-MESODPD/pair_mdpd_rhosum.cpp index 05cb123f61..2f25177b0a 100644 --- a/src/USER-MESODPD/pair_mdpd_rhosum.cpp +++ b/src/USER-MESODPD/pair_mdpd_rhosum.cpp @@ -20,16 +20,17 @@ ------------------------------------------------------------------------- */ #include "pair_mdpd_rhosum.h" -#include + #include "atom.h" -#include "force.h" #include "comm.h" +#include "error.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" #include "neighbor.h" +#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -196,10 +197,10 @@ void PairMDPDRhoSum::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double cut_one = force->numeric(FLERR,arg[2]); + double cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-MESODPD/pair_tdpd.cpp b/src/USER-MESODPD/pair_tdpd.cpp index f5350de53d..b1ffb5ce8d 100644 --- a/src/USER-MESODPD/pair_tdpd.cpp +++ b/src/USER-MESODPD/pair_tdpd.cpp @@ -29,7 +29,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -57,7 +57,7 @@ PairTDPD::PairTDPD(LAMMPS *lmp) : Pair(lmp) cc_species = atom->cc_species; writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -233,9 +233,9 @@ void PairTDPD::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -269,21 +269,21 @@ void PairTDPD::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double gamma_one = force->numeric(FLERR,arg[3]); - double power_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); - double cutcc_one = force->numeric(FLERR,arg[6]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); + double power_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); + double cutcc_one = utils::numeric(FLERR,arg[6],false,lmp); double *kappa_one = new double[cc_species]; double *epsilon_one = new double[cc_species]; double *powercc_one = new double[cc_species]; for(int k=0; knumeric(FLERR,arg[7+3*k]); - epsilon_one[k] = force->numeric(FLERR,arg[8+3*k]); - powercc_one[k] = force->numeric(FLERR,arg[9+3*k]); + kappa_one[k] = utils::numeric(FLERR,arg[7+3*k],false,lmp); + epsilon_one[k] = utils::numeric(FLERR,arg[8+3*k],false,lmp); + powercc_one[k] = utils::numeric(FLERR,arg[9+3*k],false,lmp); } int count = 0; @@ -395,19 +395,19 @@ void PairTDPD::read_restart(FILE *fp) int me = comm->me; for (int i = 1; i <= atom->ntypes; i++) for (int j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cutcc[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&power[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cutcc[i][j],sizeof(double),1,fp,nullptr,error); for(int k=0; kme == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MESONT/atom_vec_mesont.cpp b/src/USER-MESONT/atom_vec_mesont.cpp index a113433eed..038c88ac3e 100644 --- a/src/USER-MESONT/atom_vec_mesont.cpp +++ b/src/USER-MESONT/atom_vec_mesont.cpp @@ -22,8 +22,8 @@ using namespace LAMMPS_NS; AtomVecMesoNT::AtomVecMesoNT(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->mesont_flag = 1; diff --git a/src/USER-MESONT/compute_mesont.cpp b/src/USER-MESONT/compute_mesont.cpp index 397b071a1b..0321be7c56 100644 --- a/src/USER-MESONT/compute_mesont.cpp +++ b/src/USER-MESONT/compute_mesont.cpp @@ -23,14 +23,14 @@ #include "memory.h" #include "error.h" #include "pair.h" -#include + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeMesoNT::ComputeMesoNT(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), energy(NULL) { + Compute(lmp, narg, arg), energy(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute mesont command"); std::string ctype = arg[3]; if (ctype == "estretch") compute_type = ES; @@ -62,7 +62,7 @@ double ComputeMesoNT::compute_scalar() { error->all(FLERR,"Energy was not tallied on needed timestep"); int i; - double* ptr = NULL; + double* ptr = nullptr; if (compute_type == ES) ptr = static_cast(force->pair->extract("mesonttpm_Es_tot",i)); else if (compute_type == EB) @@ -104,7 +104,7 @@ void ComputeMesoNT::compute_peratom() { int i; // clear local energy array for (int i = 0; i < ntotal; i++) energy[i] = 0.0; - double* ptr = NULL; + double* ptr = nullptr; if (compute_type == ES) ptr = static_cast(force->pair->extract("mesonttpm_Es",i)); else if (compute_type == EB) diff --git a/src/USER-MESONT/pair_mesocnt.cpp b/src/USER-MESONT/pair_mesocnt.cpp index f486814feb..a7b4bf0575 100644 --- a/src/USER-MESONT/pair_mesocnt.cpp +++ b/src/USER-MESONT/pair_mesocnt.cpp @@ -20,9 +20,9 @@ #include #include -#include + #include -#include + #include "atom.h" #include "comm.h" @@ -33,8 +33,8 @@ #include "memory.h" #include "error.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + + #include "math_const.h" #include "math_extra.h" @@ -244,7 +244,7 @@ void PairMesoCNT::compute(int eflag, int vflag) // infinite CNT case if (endflag == 0) { - geometry(r1,r2,p1,p2,NULL,p,m,param,basis); + geometry(r1,r2,p1,p2,nullptr,p,m,param,basis); if (param[0] > cutoff) continue; finf(param,evdwl,flocal); @@ -759,8 +759,8 @@ void PairMesoCNT::read_file() // open file - fp = force->open_potential(file); - if (fp == NULL) + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open mesocnt file: {}",file)); utils::sfgets(FLERR,line,MAXLINE,fp,file,error); @@ -846,7 +846,7 @@ void PairMesoCNT::read_data(FILE *fp, double *data, double x,xtemp,dxtemp; for (int i = 0; i < ninput; i++) { - if (NULL == fgets(line,MAXLINE,fp)) + if (nullptr == fgets(line,MAXLINE,fp)) error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); if (i > 0) xtemp = x; @@ -899,7 +899,7 @@ void PairMesoCNT::read_data(FILE *fp, double **data, for (int i = 0; i < ninput; i++) { if (i > 0) xtemp = x; for (int j = 0; j < ninput; j++) { - if (NULL == fgets(line,MAXLINE,fp)) + if (nullptr == fgets(line,MAXLINE,fp)) error->one(FLERR,fmt::format("Premature end of file in pair table: {}",file)); if (j > 0) ytemp = y; diff --git a/src/USER-MESONT/pair_mesont_tpm.cpp b/src/USER-MESONT/pair_mesont_tpm.cpp index d46fcad813..4e5f31c661 100644 --- a/src/USER-MESONT/pair_mesont_tpm.cpp +++ b/src/USER-MESONT/pair_mesont_tpm.cpp @@ -16,7 +16,7 @@ #include "pair_mesont_tpm.h" #include "export_mesont.h" -#include + #include "atom.h" #include "comm.h" #include "force.h" @@ -29,7 +29,7 @@ #include #include #include -#include + #include #include #include @@ -166,7 +166,7 @@ void vector_union(std::vector& v1, std::vector& v2, } MESONTList::MESONTList(const Atom* atom, const NeighList* nblist, double /* rc2 */){ - if (atom == NULL || nblist == NULL) return; + if (atom == nullptr || nblist == nullptr) return; //number of local atoms at the node int nlocal = atom->nlocal; //total number of atoms in the node and ghost shell @@ -305,12 +305,12 @@ PairMESONTTPM::PairMESONTTPM(LAMMPS *lmp) : Pair(lmp) { writedata=1; BendingMode = 0; // Harmonic bending model TPMType = 0; // Inter-tube segment-segment interaction - tab_path = NULL; + tab_path = nullptr; tab_path_length = 0; - eatom_s = NULL; - eatom_b = NULL; - eatom_t = NULL; + eatom_s = nullptr; + eatom_b = nullptr; + eatom_t = nullptr; instance_count++; if(instance_count > 1) error->all(FLERR, "only a single instance of mesont/tpm pair style can be created"); @@ -330,7 +330,7 @@ PairMESONTTPM::~PairMESONTTPM() memory->destroy(eatom_t); } instance_count--; - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); } /* ---------------------------------------------------------------------- */ @@ -586,7 +586,7 @@ void PairMESONTTPM::allocate(){ void PairMESONTTPM::settings(int narg, char **arg){ if ((narg == 0) || (narg > 4)) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set if (allocated) { @@ -597,19 +597,19 @@ void PairMESONTTPM::settings(int narg, char **arg){ } std::string TPMAFile = (narg > 1) ? arg[1] : "MESONT-TABTP.xrs"; tab_path_length = TPMAFile.length(); - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); //c_str returns '\0' terminated string memory->create(tab_path,tab_path_length+1,"pair:path"); std::memcpy(tab_path, TPMAFile.c_str(), tab_path_length+1); mesont_lib_SetTablePath(tab_path, tab_path_length); if (narg > 2) { - BendingMode = force->numeric(FLERR,arg[2]); + BendingMode = utils::numeric(FLERR,arg[2],false,lmp); if ((BendingMode < 0) || (BendingMode > 1)) error->all(FLERR,"Incorrect BendingMode"); } if (narg > 3) { - TPMType = force->numeric(FLERR,arg[3]); + TPMType = utils::numeric(FLERR,arg[3],false,lmp); if ((TPMType < 0) || (TPMType > 1)) error->all(FLERR,"Incorrect TPMType"); } @@ -639,11 +639,11 @@ void PairMESONTTPM::coeff(int narg, char **arg){ if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -738,7 +738,7 @@ void PairMESONTTPM::read_restart_settings(FILE *fp){ MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&tab_path_length,1,MPI_INT,0,world); - if (tab_path != NULL) memory->destroy(tab_path); + if (tab_path != nullptr) memory->destroy(tab_path); memory->create(tab_path,tab_path_length+1,"pair:path"); if (me == 0) fread(tab_path,tab_path_length+1,1,fp); MPI_Bcast(tab_path,tab_path_length+1,MPI_CHAR,0,world); @@ -793,5 +793,5 @@ void* PairMESONTTPM::extract(const char *str, int &){ else if (strcmp(str,"mesonttpm_Es") == 0) return eatom_s; else if (strcmp(str,"mesonttpm_Eb") == 0) return eatom_b; else if (strcmp(str,"mesonttpm_Et") == 0) return eatom_t; - else return NULL; + else return nullptr; }; diff --git a/src/USER-MGPT/mgpt_readpot.cpp b/src/USER-MGPT/mgpt_readpot.cpp index 144c661b05..c5f7c75d73 100644 --- a/src/USER-MGPT/mgpt_readpot.cpp +++ b/src/USER-MGPT/mgpt_readpot.cpp @@ -66,7 +66,7 @@ static void getparmindata(const char *potin_file,int nvol[1],double vol0[1],doub FILE *in = fopen(potin_file,"r"); char line[1024]; - if(in == NULL) { + if(in == nullptr) { fprintf(stderr,"@%s:%d: Error reading potin file. Can not open file \'%s\'.\n", __FILE__,__LINE__,potin_file); exit(1); @@ -75,7 +75,7 @@ static void getparmindata(const char *potin_file,int nvol[1],double vol0[1],doub vsize = 10; volarr = (double *) malloc(sizeof(double) * vsize); n = 0; - while(fgets(line,sizeof(line),in) != NULL) { + while(fgets(line,sizeof(line),in) != nullptr) { double zval,ivol,rws,mass; double r0x,r1x,drx; int nrx,i; @@ -408,7 +408,7 @@ void potdata::readpot(const char *parmin_file,const char *potin_file,const doubl vpairtab[i*nr+j] = vpairtab[i*nr+j]*fscr + v2a - v2b; if(0) if(fabs(vol-ivol) < 0.01) { - static FILE *xfile = NULL; + static FILE *xfile = nullptr; if(j == 0) { xfile = fopen("mgpt5-pot.dat","w"); fprintf(xfile,"%%%% vol = %15.5e ivol = %15.5e i = %d ii = %d\n", diff --git a/src/USER-MGPT/mgpt_readpot.h b/src/USER-MGPT/mgpt_readpot.h index 8f46592e8a..c2a6feabe0 100644 --- a/src/USER-MGPT/mgpt_readpot.h +++ b/src/USER-MGPT/mgpt_readpot.h @@ -172,7 +172,7 @@ struct potdata2 { strcpy(s,nametemplate); p = strchr(s,'{'); - if(p != NULL) { + if(p != nullptr) { if(sscanf(p+1,"%d:%d:%d",i0,stride,i1) != 3) { fprintf(stderr,"Error in template (\'%s\'), can not parse range.\n",nametemplate); exit(1); @@ -217,12 +217,12 @@ struct potdata2 { const char *parmin_suffix = strchr(parmin_template,'}')+1; const char * potin_suffix = strchr( potin_template,'}')+1; - if(parmin_suffix-1 == NULL) { + if(parmin_suffix-1 == nullptr) { fprintf(stderr,"No closing }. parmin_template=\'%s\'\n", parmin_template); exit(1); } - if(potin_suffix-1 == NULL) { + if(potin_suffix-1 == nullptr) { fprintf(stderr,"No closing }. potin_template=\'%s\'\n", potin_template); exit(1); diff --git a/src/USER-MGPT/pair_mgpt.cpp b/src/USER-MGPT/pair_mgpt.cpp index 213f73f05a..dd48295357 100644 --- a/src/USER-MGPT/pair_mgpt.cpp +++ b/src/USER-MGPT/pair_mgpt.cpp @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #include "pair_mgpt.h" -#include + #include -#include + #include #include @@ -54,7 +54,7 @@ static double gettime(int x = 0) { if(1) { /* struct timeval tv; - gettimeofday(&tv,NULL); + gettimeofday(&tv,nullptr); return tv.tv_sec + 1e-6 * tv.tv_usec; */ /* @@ -1859,7 +1859,7 @@ void PairMGPT::coeff(int narg, char **arg) if(strspn(arg[iarg+1],"1234") == strlen(arg[iarg+1])) { nbody_flag = 0; for(int i = 0; i<4; i++) - if(strchr(arg[iarg+1],'1'+i) != NULL) { + if(strchr(arg[iarg+1],'1'+i) != nullptr) { nbody_flag = nbody_flag + (1<me == 0) printf("Explicitly adding %d-tuple forces.\n",i+1); } @@ -1904,9 +1904,9 @@ void PairMGPT::coeff(int narg, char **arg) printf("Volumetric pressure is %s.\n",volpres_flag ? "on" : "off"); if(comm->me == 0) { - FILE *parmin_fp = force->open_potential(arg[2]); - FILE *potin_fp = force->open_potential(arg[3]); - if (parmin_fp == NULL || potin_fp == NULL) { + FILE *parmin_fp = utils::open_potential(arg[2],lmp,nullptr); + FILE *potin_fp = utils::open_potential(arg[3],lmp,nullptr); + if (parmin_fp == nullptr || potin_fp == nullptr) { char str[128]; sprintf(str,"Cannot open MGPT potential files %s %s",arg[2],arg[3]); error->one(FLERR,str); diff --git a/src/USER-MISC/README b/src/USER-MISC/README index e085676711..ffb1210efa 100644 --- a/src/USER-MISC/README +++ b/src/USER-MISC/README @@ -59,9 +59,11 @@ fix gle, Michele Ceriotti (EPFL Lausanne), michele.ceriotti at gmail.com, 24 Nov fix grem, David Stelter, dstelter@bu.edu, 22 Nov 16 fix imd, Axel Kohlmeyer, akohlmey at gmail.com, 9 Nov 2009 fix ipi, Michele Ceriotti (EPFL Lausanne), michele.ceriotti at gmail.com, 24 Nov 2014 +fix momentum/chunk, Jiang Xiao (Hong Kong Polytechnic University), polyu-xiao.jiang at connect.polyu.hk, 19 Aug 2020 fix npt/cauchy, R. E. Miller (Carleton University), F. Pavia and S. Pattamatta, 12 Jan 2020 fix nvk, Efrem Braun (UC Berkeley), efrem.braun at gmail.com, https://github.com/lammps/lammps/pull/310 fix orient/eco Adrian A. Schratt and Volker Mohles (Ruhr-Uni Bochum), volker.mohles at rub.de, 6 Jun 2020 +fix pafi, Thomas Swinburne (CNRS), swinburne at cinam.univ-mrs.fr, 1st Sep 2020 fix pimd, Yuxing Peng (U Chicago), yuxing at uchicago.edu, 24 Nov 2014 fix propel/self, Stefan Paquay (Brandeis U), stefanpaquay at gmail.com, 20 Jan 2020 fix rhok, Ulf Pedersen (Roskilde U), ulf at urp.dk, 25 Sep 2017 diff --git a/src/USER-MISC/angle_cosine_shift.cpp b/src/USER-MISC/angle_cosine_shift.cpp index 59f7555709..f6427171a7 100644 --- a/src/USER-MISC/angle_cosine_shift.cpp +++ b/src/USER-MISC/angle_cosine_shift.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_cosine_shift.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -37,7 +37,7 @@ using namespace MathConst; AngleCosineShift::AngleCosineShift(LAMMPS *lmp) : Angle(lmp) { - kcost = NULL; + kcost = nullptr; } /* ---------------------------------------------------------------------- */ @@ -175,10 +175,10 @@ void AngleCosineShift::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double umin = force->numeric(FLERR,arg[1]); - double theta0 = force->numeric(FLERR,arg[2]); + double umin = utils::numeric(FLERR,arg[1],false,lmp); + double theta0 = utils::numeric(FLERR,arg[2],false,lmp); // k=Umin/2 @@ -225,10 +225,10 @@ void AngleCosineShift::read_restart(FILE *fp) if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kcost[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ksint[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kcost[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ksint[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&kcost[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_cosine_shift_exp.cpp b/src/USER-MISC/angle_cosine_shift_exp.cpp index ef5a2824b9..9e98c319f4 100644 --- a/src/USER-MISC/angle_cosine_shift_exp.cpp +++ b/src/USER-MISC/angle_cosine_shift_exp.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_cosine_shift_exp.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -37,13 +37,13 @@ using namespace MathConst; AngleCosineShiftExp::AngleCosineShiftExp(LAMMPS *lmp) : Angle(lmp) { - doExpansion = NULL; - umin = NULL; - a = NULL; - opt1 = NULL; - theta0 = NULL; - sint = NULL; - cost = NULL; + doExpansion = nullptr; + umin = nullptr; + a = nullptr; + opt1 = nullptr; + theta0 = nullptr; + sint = nullptr; + cost = nullptr; } /* ---------------------------------------------------------------------- */ @@ -203,11 +203,11 @@ void AngleCosineShiftExp::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double umin_ = force->numeric(FLERR,arg[1]); - double theta0_ = force->numeric(FLERR,arg[2]); - double a_ = force->numeric(FLERR,arg[3]); + double umin_ = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_ = utils::numeric(FLERR,arg[2],false,lmp); + double a_ = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -257,11 +257,11 @@ void AngleCosineShiftExp::read_restart(FILE *fp) if (comm->me == 0) { - utils::sfread(FLERR,&umin[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&a[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&cost[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&sint[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&umin[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&a[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&cost[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&sint[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&umin[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&a[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_dipole.cpp b/src/USER-MISC/angle_dipole.cpp index e2fd7e618f..6715bd1186 100644 --- a/src/USER-MISC/angle_dipole.cpp +++ b/src/USER-MISC/angle_dipole.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_dipole.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -35,8 +35,8 @@ using namespace MathConst; AngleDipole::AngleDipole(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - gamma0 = NULL; + k = nullptr; + gamma0 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -160,10 +160,10 @@ void AngleDipole::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double gamma0_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double gamma0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert gamma0 from degrees to radians @@ -206,8 +206,8 @@ void AngleDipole::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&gamma0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&gamma0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&gamma0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_fourier.cpp b/src/USER-MISC/angle_fourier.cpp index f83c9c4f88..fc14736a07 100644 --- a/src/USER-MISC/angle_fourier.cpp +++ b/src/USER-MISC/angle_fourier.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "angle_fourier.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -38,10 +38,10 @@ using namespace MathConst; AngleFourier::AngleFourier(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - C0 = NULL; - C1 = NULL; - C2 = NULL; + k = nullptr; + C0 = nullptr; + C1 = nullptr; + C2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -179,12 +179,12 @@ void AngleFourier::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double C0_one = force->numeric(FLERR,arg[2]); - double C1_one = force->numeric(FLERR,arg[3]); - double C2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double C0_one = utils::numeric(FLERR,arg[2],false,lmp); + double C1_one = utils::numeric(FLERR,arg[3],false,lmp); + double C2_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -232,10 +232,10 @@ void AngleFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&C0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_fourier_simple.cpp b/src/USER-MISC/angle_fourier_simple.cpp index baf4953760..abd02535cf 100644 --- a/src/USER-MISC/angle_fourier_simple.cpp +++ b/src/USER-MISC/angle_fourier_simple.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "angle_fourier_simple.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -38,9 +38,9 @@ using namespace MathConst; AngleFourierSimple::AngleFourierSimple(LAMMPS *lmp) : Angle(lmp) { - k = NULL; - C = NULL; - N = NULL; + k = nullptr; + C = nullptr; + N = nullptr; } /* ---------------------------------------------------------------------- */ @@ -193,11 +193,11 @@ void AngleFourierSimple::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double C_one = force->numeric(FLERR,arg[2]); - double N_one = force->numeric(FLERR,arg[3]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double C_one = utils::numeric(FLERR,arg[2],false,lmp); + double N_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -238,9 +238,9 @@ void AngleFourierSimple::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&C[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&N[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&C[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&N[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&C[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/angle_quartic.cpp b/src/USER-MISC/angle_quartic.cpp index 097e774f17..50a73af7b5 100644 --- a/src/USER-MISC/angle_quartic.cpp +++ b/src/USER-MISC/angle_quartic.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "angle_quartic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -183,12 +183,12 @@ void AngleQuartic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double theta0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0 from degrees to radians @@ -233,10 +233,10 @@ void AngleQuartic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); MPI_Bcast(&k3[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_harmonic_shift.cpp b/src/USER-MISC/bond_harmonic_shift.cpp index cbcc33a824..28badce911 100644 --- a/src/USER-MISC/bond_harmonic_shift.cpp +++ b/src/USER-MISC/bond_harmonic_shift.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "bond_harmonic_shift.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -24,7 +24,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -128,11 +128,11 @@ void BondHarmonicShift::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double Umin = force->numeric(FLERR,arg[1]); // energy at minimum - double r0_one = force->numeric(FLERR,arg[2]); // position of minimum - double r1_one = force->numeric(FLERR,arg[3]); // position where energy = 0 + double Umin = utils::numeric(FLERR,arg[1],false,lmp); // energy at minimum + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); // position of minimum + double r1_one = utils::numeric(FLERR,arg[3],false,lmp); // position where energy = 0 if (r0_one == r1_one) error->all(FLERR,"Bond harmonic/shift r0 and r1 must be different"); @@ -177,9 +177,9 @@ void BondHarmonicShift::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_harmonic_shift_cut.cpp b/src/USER-MISC/bond_harmonic_shift_cut.cpp index aa051f4bec..b875fb71b2 100644 --- a/src/USER-MISC/bond_harmonic_shift_cut.cpp +++ b/src/USER-MISC/bond_harmonic_shift_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "bond_harmonic_shift_cut.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -24,7 +24,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -130,11 +130,11 @@ void BondHarmonicShiftCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double Umin = force->numeric(FLERR,arg[1]); // energy at minimum - double r0_one = force->numeric(FLERR,arg[2]); // position of minimum - double r1_one = force->numeric(FLERR,arg[3]); // position where energy = 0 = cutoff + double Umin = utils::numeric(FLERR,arg[1],false,lmp); // energy at minimum + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); // position of minimum + double r1_one = utils::numeric(FLERR,arg[3],false,lmp); // position where energy = 0 = cutoff if (r0_one == r1_one) error->all(FLERR,"Bond harmonic/shift/cut r0 and r1 must be different"); @@ -179,9 +179,9 @@ void BondHarmonicShiftCut::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r1[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_special.cpp b/src/USER-MISC/bond_special.cpp index 6c734d482e..b21396202e 100644 --- a/src/USER-MISC/bond_special.cpp +++ b/src/USER-MISC/bond_special.cpp @@ -13,18 +13,15 @@ Contributing Author: David Nicholson (MIT) ------------------------------------------------------------------------- */ -#include -#include -#include #include "bond_special.h" + #include "atom.h" -#include "neighbor.h" -#include "domain.h" #include "comm.h" -#include "force.h" -#include "pair.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "memory.h" +#include "neighbor.h" +#include "pair.h" using namespace LAMMPS_NS; @@ -47,7 +44,7 @@ BondSpecial::~BondSpecial() void BondSpecial::init_style() { - if (force->pair == NULL) error->all(FLERR,"No pair style defined"); + if (force->pair == nullptr) error->all(FLERR,"No pair style defined"); else if ((force->pair->single_enable == 0) || force->pair->manybody_flag) error->all(FLERR,"Pair style does not support bond style special"); @@ -62,7 +59,7 @@ void BondSpecial::init_style() force->special_coul[3] != 1.0)) error->all(FLERR,"Invalid 1-4 setting for bond style special."); - if (force->kspace != NULL) + if (force->kspace != nullptr) error->all(FLERR,"Bond style special is not compatible with long range " "Coulombic interactions"); } @@ -143,10 +140,10 @@ void BondSpecial::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double factor_lj_one = force->numeric(FLERR,arg[1]); - double factor_coul_one = force->numeric(FLERR,arg[2]); + double factor_lj_one = utils::numeric(FLERR,arg[1],false,lmp); + double factor_coul_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -163,7 +160,7 @@ void BondSpecial::coeff(int narg, char **arg) return an equilbrium bond length ------------------------------------------------------------------------- */ -double BondSpecial::equilibrium_distance(int i) +double BondSpecial::equilibrium_distance(int /*i*/) { return 0.; } @@ -187,8 +184,8 @@ void BondSpecial::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - fread(&factor_lj[1],sizeof(double),atom->nbondtypes,fp); - fread(&factor_coul[1],sizeof(double),atom->nbondtypes,fp); + utils::sfread(FLERR,&factor_lj[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&factor_coul[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&factor_lj[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&factor_coul[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/bond_special.h b/src/USER-MISC/bond_special.h index 389990b1d7..d5e360ca53 100644 --- a/src/USER-MISC/bond_special.h +++ b/src/USER-MISC/bond_special.h @@ -22,7 +22,6 @@ BondStyle(special,BondSpecial) #ifndef LMP_BOND_SPECIAL_H #define LMP_BOND_SPECIAL_H -#include #include "bond.h" namespace LAMMPS_NS { diff --git a/src/USER-MISC/compute_ackland_atom.cpp b/src/USER-MISC/compute_ackland_atom.cpp index bcf41591eb..df0636d7b9 100644 --- a/src/USER-MISC/compute_ackland_atom.cpp +++ b/src/USER-MISC/compute_ackland_atom.cpp @@ -48,13 +48,13 @@ ComputeAcklandAtom::ComputeAcklandAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - structure = NULL; + structure = nullptr; maxneigh = 0; legacy = 0; - distsq = NULL; - nearest = NULL; - nearest_n0 = NULL; - nearest_n1 = NULL; + distsq = nullptr; + nearest = nullptr; + nearest_n0 = nullptr; + nearest_n1 = nullptr; int iarg = 3; while (narg > iarg) { diff --git a/src/USER-MISC/compute_basal_atom.cpp b/src/USER-MISC/compute_basal_atom.cpp index 3b9b38343d..fa59a02575 100644 --- a/src/USER-MISC/compute_basal_atom.cpp +++ b/src/USER-MISC/compute_basal_atom.cpp @@ -44,12 +44,12 @@ ComputeBasalAtom::ComputeBasalAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 3; nmax = 0; - BPV = NULL; + BPV = nullptr; maxneigh = 0; - distsq = NULL; - nearest = NULL; - nearest_n0 = NULL; - nearest_n1 = NULL; + distsq = nullptr; + nearest = nullptr; + nearest_n0 = nullptr; + nearest_n1 = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/compute_cnp_atom.cpp b/src/USER-MISC/compute_cnp_atom.cpp index 34882b0272..5efab292b5 100644 --- a/src/USER-MISC/compute_cnp_atom.cpp +++ b/src/USER-MISC/compute_cnp_atom.cpp @@ -22,7 +22,7 @@ ------------------------------------------------------------------------- */ #include "compute_cnp_atom.h" -#include + #include #include #include "atom.h" @@ -49,14 +49,14 @@ enum{NCOMMON}; ComputeCNPAtom::ComputeCNPAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - list(NULL), nearest(NULL), nnearest(NULL), cnpv(NULL) + list(nullptr), nearest(nullptr), nnearest(nullptr), cnpv(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cnp/atom command"); peratom_flag = 1; size_peratom_cols = 0; - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal compute cnp/atom command"); cutsq = cutoff*cutoff; @@ -92,7 +92,7 @@ ComputeCNPAtom::~ComputeCNPAtom() void ComputeCNPAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cnp/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) diff --git a/src/USER-MISC/compute_entropy_atom.cpp b/src/USER-MISC/compute_entropy_atom.cpp index 2641ec9313..2a308c427f 100644 --- a/src/USER-MISC/compute_entropy_atom.cpp +++ b/src/USER-MISC/compute_entropy_atom.cpp @@ -40,7 +40,7 @@ using namespace MathConst; ComputeEntropyAtom:: ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pair_entropy(NULL), pair_entropy_avg(NULL) + pair_entropy(nullptr), pair_entropy_avg(nullptr) { if (narg < 5 || narg > 10) error->all(FLERR,"Illegal compute entropy/atom command; wrong number" @@ -55,10 +55,10 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : // local is optional and allows using the local density to normalize // the g(r) - sigma = force->numeric(FLERR,arg[3]); + sigma = utils::numeric(FLERR,arg[3],false,lmp); if (sigma <= 0.0) error->all(FLERR,"Illegal compute entropy/atom" " command; sigma must be positive"); - cutoff = force->numeric(FLERR,arg[4]); + cutoff = utils::numeric(FLERR,arg[4],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Illegal compute entropy/atom" " command; cutoff must be positive"); @@ -77,7 +77,7 @@ ComputeEntropyAtom(LAMMPS *lmp, int narg, char **arg) : else if (strcmp(arg[iarg+1],"no") == 0) avg_flag = 0; else error->all(FLERR,"Illegal compute entropy/atom;" " argument after avg should be yes or no"); - cutoff2 = force->numeric(FLERR,arg[iarg+2]); + cutoff2 = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (cutoff2 < 0.0) error->all(FLERR,"Illegal compute entropy/atom" " command; negative cutoff2"); cutsq2 = cutoff2*cutoff2; @@ -118,7 +118,7 @@ ComputeEntropyAtom::~ComputeEntropyAtom() void ComputeEntropyAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute entropy/atom requires a pair style be" " defined"); diff --git a/src/USER-MISC/compute_gyration_shape.cpp b/src/USER-MISC/compute_gyration_shape.cpp index aef5ef91a3..50cd6d3ce2 100644 --- a/src/USER-MISC/compute_gyration_shape.cpp +++ b/src/USER-MISC/compute_gyration_shape.cpp @@ -21,6 +21,7 @@ #include #include "error.h" #include "math_extra.h" +#include "math_eigen.h" #include "math_special.h" #include "modify.h" #include "update.h" @@ -30,7 +31,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationShape::ComputeGyrationShape(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_gyration(NULL) + Compute(lmp, narg, arg), id_gyration(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute gyration/shape command"); @@ -95,7 +96,7 @@ void ComputeGyrationShape::compute_vector() ione[1][2] = ione[2][1] = gyration_tensor[4]; ione[0][2] = ione[2][0] = gyration_tensor[5]; - int ierror = MathExtra::jacobi(ione,evalues,evectors); + int ierror = MathEigen::jacobi3(ione,evalues,evectors); if (ierror) error->all(FLERR, "Insufficient Jacobi rotations " "for gyration/shape"); diff --git a/src/USER-MISC/compute_gyration_shape_chunk.cpp b/src/USER-MISC/compute_gyration_shape_chunk.cpp index 116d851024..af9fcc6159 100644 --- a/src/USER-MISC/compute_gyration_shape_chunk.cpp +++ b/src/USER-MISC/compute_gyration_shape_chunk.cpp @@ -21,6 +21,7 @@ #include #include "error.h" #include "math_extra.h" +#include "math_eigen.h" #include "math_special.h" #include "modify.h" #include "memory.h" @@ -31,7 +32,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeGyrationShapeChunk::ComputeGyrationShapeChunk(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_gyration_chunk(NULL), shape_parameters(NULL) + Compute(lmp, narg, arg), id_gyration_chunk(nullptr), shape_parameters(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute gyration/shape/chunk command"); @@ -125,7 +126,7 @@ void ComputeGyrationShapeChunk::compute_array() ione[0][2] = ione[2][0] = gyration_tensor[ichunk][4]; ione[1][2] = ione[2][1] = gyration_tensor[ichunk][5]; - int ierror = MathExtra::jacobi(ione,evalues,evectors); + int ierror = MathEigen::jacobi3(ione,evalues,evectors); if (ierror) error->all(FLERR, "Insufficient Jacobi rotations " "for gyration/shape"); diff --git a/src/USER-MISC/compute_hma.cpp b/src/USER-MISC/compute_hma.cpp index d1f3e6b6f8..f7a9f9fcfa 100644 --- a/src/USER-MISC/compute_hma.cpp +++ b/src/USER-MISC/compute_hma.cpp @@ -43,40 +43,37 @@ properties of crystals by molecular simulation”, Phys. Rev. E 92, 043303 (2015 https://doi.org/10.1103/PhysRevE.92.043303 ------------------------------------------------------------------------- */ -#include -#include -#include #include "compute_hma.h" -#include "atom.h" -#include "update.h" -#include "force.h" -#include "pair.h" -#include "bond.h" + #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" #include "dihedral.h" -#include "improper.h" -#include "kspace.h" -#include "group.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "fix_store.h" +#include "force.h" +#include "group.h" +#include "improper.h" +#include "kspace.h" #include "memory.h" -#include "error.h" -#include "comm.h" -#include "neighbor.h" -#include "neigh_request.h" +#include "modify.h" #include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair.h" +#include "update.h" -#include - +#include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), id_temp(NULL), deltaR(NULL) + Compute(lmp, narg, arg), id_temp(nullptr), deltaR(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute hma command"); if (igroup) error->all(FLERR,"Compute hma must use group all"); @@ -145,7 +142,7 @@ ComputeHMA::ComputeHMA(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal compute hma command"); if (computeP>-1) continue; computeP = size_vector; - deltaPcap = force->numeric(FLERR, arg[iarg+1]); + deltaPcap = utils::numeric(FLERR, arg[iarg+1],false,lmp); extlist[size_vector] = 0; size_vector++; iarg++; @@ -202,7 +199,7 @@ ComputeHMA::~ComputeHMA() void ComputeHMA::init() { if (computeCv>-1) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute hma cv"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute hma cv"); @@ -225,7 +222,7 @@ void ComputeHMA::setup() int ifix = modify->find_fix(id_temp); if (ifix < 0) error->all(FLERR,"Could not find compute hma temperature ID"); double * temperat = (double *) modify->fix[ifix]->extract("t_target",dummy); - if (temperat==NULL) error->all(FLERR,"Could not find compute hma temperature ID"); + if (temperat==nullptr) error->all(FLERR,"Could not find compute hma temperature ID"); finaltemp = * temperat; // set fix which stores original atom coords diff --git a/src/USER-MISC/compute_momentum.cpp b/src/USER-MISC/compute_momentum.cpp index 541b52d9c0..f1c35993e3 100644 --- a/src/USER-MISC/compute_momentum.cpp +++ b/src/USER-MISC/compute_momentum.cpp @@ -1,6 +1,6 @@ #include "compute_momentum.h" -#include + #include "atom.h" #include "error.h" #include "update.h" diff --git a/src/USER-MISC/compute_pressure_cylinder.cpp b/src/USER-MISC/compute_pressure_cylinder.cpp index 6d2509d685..e050275f76 100644 --- a/src/USER-MISC/compute_pressure_cylinder.cpp +++ b/src/USER-MISC/compute_pressure_cylinder.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_pressure_cylinder.h" -#include + #include #include "atom.h" #include "update.h" @@ -48,18 +48,18 @@ static const char cite_compute_pressure_cylinder[] = ComputePressureCyl::ComputePressureCyl(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - Pr_temp(NULL), Pr_all(NULL), Pz_temp(NULL), Pz_all(NULL), Pphi_temp(NULL), - Pphi_all(NULL), R(NULL), Rinv(NULL), R2(NULL), PrAinv(NULL), PzAinv(NULL), - R2kin(NULL), density_temp(NULL), invVbin(NULL), density_all(NULL), - tangent(NULL), ephi_x(NULL), ephi_y(NULL), binz(NULL) + Pr_temp(nullptr), Pr_all(nullptr), Pz_temp(nullptr), Pz_all(nullptr), Pphi_temp(nullptr), + Pphi_all(nullptr), R(nullptr), Rinv(nullptr), R2(nullptr), PrAinv(nullptr), PzAinv(nullptr), + R2kin(nullptr), density_temp(nullptr), invVbin(nullptr), density_all(nullptr), + tangent(nullptr), ephi_x(nullptr), ephi_y(nullptr), binz(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_compute_pressure_cylinder); if (narg != 7) error->all(FLERR,"Illegal compute pressure/cylinder command"); - zlo=force->numeric(FLERR,arg[3]); - zhi=force->numeric(FLERR,arg[4]); - Rmax=force->numeric(FLERR,arg[5]); - bin_width=force->numeric(FLERR,arg[6]); + zlo=utils::numeric(FLERR,arg[3],false,lmp); + zhi=utils::numeric(FLERR,arg[4],false,lmp); + Rmax=utils::numeric(FLERR,arg[5],false,lmp); + bin_width=utils::numeric(FLERR,arg[6],false,lmp); if ((bin_width <= 0.0) || (bin_width > Rmax)) error->all(FLERR,"Illegal compute pressure/cylinder command"); @@ -143,7 +143,7 @@ ComputePressureCyl::~ComputePressureCyl() void ComputePressureCyl::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute pressure/cylinder"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute pressure/cylinder"); diff --git a/src/USER-MISC/compute_pressure_grem.cpp b/src/USER-MISC/compute_pressure_grem.cpp index ba949727b0..6a5c36a06f 100644 --- a/src/USER-MISC/compute_pressure_grem.cpp +++ b/src/USER-MISC/compute_pressure_grem.cpp @@ -55,7 +55,7 @@ void ComputePressureGrem::init() int dim; scale_grem = (double *)modify->fix[ifix]->extract("scale_grem",dim); - if (scale_grem == NULL || dim != 0) + if (scale_grem == nullptr || dim != 0) error->all(FLERR,"Cannot extract gREM scale factor from fix grem"); } diff --git a/src/USER-MISC/compute_stress_mop.cpp b/src/USER-MISC/compute_stress_mop.cpp index c403ed3247..2abe812f19 100644 --- a/src/USER-MISC/compute_stress_mop.cpp +++ b/src/USER-MISC/compute_stress_mop.cpp @@ -16,7 +16,7 @@ --------------------------------------------------------------------------*/ #include "compute_stress_mop.h" -#include + #include #include @@ -65,7 +65,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : pos = domain->boxhi[dir]; } else if (strcmp(arg[4],"center")==0) { pos = 0.5*(domain->boxlo[dir]+domain->boxhi[dir]); - } else pos = force->numeric(FLERR,arg[4]); + } else pos = utils::numeric(FLERR,arg[4],false,lmp); if ( pos < (domain->boxlo[dir]+domain->prd_half[dir]) ) { pos1 = pos + domain->prd[dir]; @@ -117,7 +117,7 @@ ComputeStressMop::ComputeStressMop(LAMMPS *lmp, int narg, char **arg) : // Initialize some variables - values_local = values_global = vector = NULL; + values_local = values_global = vector = nullptr; // this fix produces a global vector @@ -173,7 +173,7 @@ void ComputeStressMop::init() // This compute requires a pair style with pair_single method implemented - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute stress/mop"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop"); @@ -185,15 +185,15 @@ void ComputeStressMop::init() //Compute stress/mop only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=NULL) + if (force->bond!=nullptr) error->warning(FLERR,"compute stress/mop does not account for bond potentials"); - if (force->angle!=NULL) + if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop does not account for angle potentials"); - if (force->dihedral!=NULL) + if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop does not account for dihedral potentials"); - if (force->improper!=NULL) + if (force->improper!=nullptr) error->warning(FLERR,"compute stress/mop does not account for improper potentials"); - if (force->kspace!=NULL) + if (force->kspace!=nullptr) error->warning(FLERR,"compute stress/mop does not account for kspace contributions"); } diff --git a/src/USER-MISC/compute_stress_mop_profile.cpp b/src/USER-MISC/compute_stress_mop_profile.cpp index 9649a61090..6beb3ffd83 100644 --- a/src/USER-MISC/compute_stress_mop_profile.cpp +++ b/src/USER-MISC/compute_stress_mop_profile.cpp @@ -16,7 +16,7 @@ --------------------------------------------------------------------------*/ #include "compute_stress_mop_profile.h" -#include + #include #include @@ -65,8 +65,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a else if (strcmp(arg[4],"upper") == 0) originflag = UPPER; else originflag = COORD; if (originflag == COORD) - origin = force->numeric(FLERR,arg[4]); - delta = force->numeric(FLERR,arg[5]); + origin = utils::numeric(FLERR,arg[4],false,lmp); + delta = utils::numeric(FLERR,arg[5],false,lmp); invdelta = 1.0/delta; // parse values until one isn't recognized @@ -112,8 +112,8 @@ ComputeStressMopProfile::ComputeStressMopProfile(LAMMPS *lmp, int narg, char **a // initialize some variables nbins = 0; - coord = coordp = NULL; - values_local = values_global = array = NULL; + coord = coordp = nullptr; + values_local = values_global = array = nullptr; // bin setup @@ -173,7 +173,7 @@ void ComputeStressMopProfile::init() //This compute requires a pair style with pair_single method implemented - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute stress/mop/profile"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute stress/mop/profile"); @@ -185,15 +185,15 @@ void ComputeStressMopProfile::init() //Compute stress/mop/profile only accounts for pair interactions. // issue a warning if any intramolecular potential or Kspace is defined. - if (force->bond!=NULL) + if (force->bond!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for bond potentials"); - if (force->angle!=NULL) + if (force->angle!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for angle potentials"); - if (force->dihedral!=NULL) + if (force->dihedral!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for dihedral potentials"); - if (force->improper!=NULL) + if (force->improper!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for improper potentials"); - if (force->kspace!=NULL) + if (force->kspace!=nullptr) error->warning(FLERR,"compute stress/mop/profile does not account for kspace contributions"); } diff --git a/src/USER-MISC/compute_temp_rotate.cpp b/src/USER-MISC/compute_temp_rotate.cpp index 94c6115186..5aafe19033 100644 --- a/src/USER-MISC/compute_temp_rotate.cpp +++ b/src/USER-MISC/compute_temp_rotate.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_rotate.h" -#include + #include "atom.h" #include "update.h" #include "force.h" @@ -42,7 +42,7 @@ ComputeTempRotate::ComputeTempRotate(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/USER-MISC/compute_viscosity_cos.cpp b/src/USER-MISC/compute_viscosity_cos.cpp index 7311f991cc..383fa17be2 100644 --- a/src/USER-MISC/compute_viscosity_cos.cpp +++ b/src/USER-MISC/compute_viscosity_cos.cpp @@ -15,17 +15,18 @@ Contributing author: Zheng GONG (ENS de Lyon, z.gong@outlook.com) ------------------------------------------------------------------------- */ -#include #include "compute_viscosity_cos.h" + #include "atom.h" #include "update.h" #include "force.h" #include "domain.h" -#include "comm.h" #include "group.h" #include "error.h" #include "math_const.h" +#include + using namespace LAMMPS_NS; using namespace MathConst; @@ -44,7 +45,7 @@ ComputeViscosityCos::ComputeViscosityCos(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[7]; } @@ -52,8 +53,10 @@ ComputeViscosityCos::ComputeViscosityCos(LAMMPS *lmp, int narg, char **arg) : /* ---------------------------------------------------------------------- */ ComputeViscosityCos::~ComputeViscosityCos() { - if (!copymode) + if (!copymode) { delete[] vector; + delete[] extlist; + } } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-MISC/dihedral_cosine_shift_exp.cpp b/src/USER-MISC/dihedral_cosine_shift_exp.cpp index 0537e555a2..d5cd27189d 100644 --- a/src/USER-MISC/dihedral_cosine_shift_exp.cpp +++ b/src/USER-MISC/dihedral_cosine_shift_exp.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_cosine_shift_exp.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "memory.h" #include "math_const.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -276,11 +276,11 @@ void DihedralCosineShiftExp::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double umin_ = force->numeric(FLERR,arg[1]); - double theta0_ = force->numeric(FLERR,arg[2]); - double a_ = force->numeric(FLERR,arg[3]); + double umin_ = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_ = utils::numeric(FLERR,arg[2],false,lmp); + double a_ = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -322,11 +322,11 @@ void DihedralCosineShiftExp::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&umin[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&a[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&cost[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&sint[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&theta[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&umin[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&a[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&cost[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&sint[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&theta[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&umin[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&a[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/dihedral_fourier.cpp b/src/USER-MISC/dihedral_fourier.cpp index f30a5e1eab..cb620ae7d4 100644 --- a/src/USER-MISC/dihedral_fourier.cpp +++ b/src/USER-MISC/dihedral_fourier.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_fourier.h" -#include + #include #include "atom.h" #include "comm.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -297,7 +297,7 @@ void DihedralFourier::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); // require integer values of shift for backwards compatibility // arbitrary phase angle shift could be allowed, but would break @@ -306,7 +306,7 @@ void DihedralFourier::coeff(int narg, char **arg) double k_one; int multiplicity_one; double shift_one; - int nterms_one = force->inumeric(FLERR,arg[1]); + int nterms_one = utils::inumeric(FLERR,arg[1],false,lmp); if (nterms_one < 1) error->all(FLERR,"Incorrect number of terms arg for dihedral coefficients"); @@ -324,9 +324,9 @@ void DihedralFourier::coeff(int narg, char **arg) sin_shift[i] = new double [nterms_one]; for (int j = 0; jnumeric(FLERR,arg[offset+1]); - multiplicity_one = force->inumeric(FLERR,arg[offset+2]); - shift_one = force->numeric(FLERR,arg[offset+3]); + k_one = utils::numeric(FLERR,arg[offset+1],false,lmp); + multiplicity_one = utils::inumeric(FLERR,arg[offset+2],false,lmp); + shift_one = utils::numeric(FLERR,arg[offset+3],false,lmp); k[i][j] = k_one; multiplicity[i][j] = multiplicity_one; shift[i][j] = shift_one; @@ -365,7 +365,7 @@ void DihedralFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -380,9 +380,9 @@ void DihedralFourier::read_restart(FILE *fp) if (comm->me == 0) { for (int i=1; i<=atom->ndihedraltypes; i++) { - utils::sfread(FLERR,k[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,multiplicity[i],sizeof(int),nterms[i],fp,NULL,error); - utils::sfread(FLERR,shift[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,k[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,multiplicity[i],sizeof(int),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,shift[i],sizeof(double),nterms[i],fp,nullptr,error); } } diff --git a/src/USER-MISC/dihedral_nharmonic.cpp b/src/USER-MISC/dihedral_nharmonic.cpp index 81010a040e..bf1b2fa75d 100644 --- a/src/USER-MISC/dihedral_nharmonic.cpp +++ b/src/USER-MISC/dihedral_nharmonic.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_nharmonic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -277,21 +277,21 @@ void DihedralNHarmonic::coeff(int narg, char **arg) { if (narg < 4 ) error->all(FLERR,"Incorrect args for dihedral coefficients"); - int n = force->inumeric(FLERR,arg[1]); + int n = utils::inumeric(FLERR,arg[1],false,lmp); if (narg != n + 2) error->all(FLERR,"Incorrect args for dihedral coefficients"); if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { a[i] = new double [n]; nterms[i] = n; for (int j = 0; j < n; j++ ) { - a[i][j] = force->numeric(FLERR,arg[2+j]); + a[i][j] = utils::numeric(FLERR,arg[2+j],false,lmp); setflag[i] = 1; } count++; @@ -320,7 +320,7 @@ void DihedralNHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -330,7 +330,7 @@ void DihedralNHarmonic::read_restart(FILE *fp) if (comm->me == 0) { for(int i = 1; i <= atom->ndihedraltypes; i++) - utils::sfread(FLERR,a[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,a[i],sizeof(double),nterms[i],fp,nullptr,error); } for (int i = 1; i <= atom->ndihedraltypes; i++ ) diff --git a/src/USER-MISC/dihedral_quadratic.cpp b/src/USER-MISC/dihedral_quadratic.cpp index 28efad65b7..68be198332 100644 --- a/src/USER-MISC/dihedral_quadratic.cpp +++ b/src/USER-MISC/dihedral_quadratic.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_quadratic.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -27,7 +27,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -287,10 +287,10 @@ void DihedralQuadratic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double phi0_one= force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double phi0_one= utils::numeric(FLERR,arg[2],false,lmp); // require k >= 0 if (k_one < 0.0) @@ -326,8 +326,8 @@ void DihedralQuadratic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); - utils::sfread(FLERR,&phi0[1],sizeof(double),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); + utils::sfread(FLERR,&phi0[1],sizeof(double),atom->ndihedraltypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); MPI_Bcast(&phi0[1],atom->ndihedraltypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/dihedral_spherical.cpp b/src/USER-MISC/dihedral_spherical.cpp index c72570c494..d200482999 100644 --- a/src/USER-MISC/dihedral_spherical.cpp +++ b/src/USER-MISC/dihedral_spherical.cpp @@ -18,21 +18,20 @@ ------------------------------------------------------------------------- */ #include "dihedral_spherical.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "neighbor.h" #include "domain.h" +#include "error.h" #include "force.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "neighbor.h" + +#include +#include -using namespace std; using namespace LAMMPS_NS; using namespace MathConst; using namespace MathExtra; @@ -655,16 +654,16 @@ void DihedralSpherical::allocate() theta2_shift = new double * [n+1]; theta2_offset = new double * [n+1]; for (int i = 1; i <= n; i++) { - Ccoeff[i] = NULL; - phi_mult[i] = NULL; - phi_shift[i] = NULL; - phi_offset[i] = NULL; - theta1_mult[i] = NULL; - theta1_shift[i] = NULL; - theta1_offset[i] = NULL; - theta2_mult[i] = NULL; - theta2_shift[i] = NULL; - theta2_offset[i] = NULL; + Ccoeff[i] = nullptr; + phi_mult[i] = nullptr; + phi_shift[i] = nullptr; + phi_offset[i] = nullptr; + theta1_mult[i] = nullptr; + theta1_shift[i] = nullptr; + theta1_offset[i] = nullptr; + theta2_mult[i] = nullptr; + theta2_shift[i] = nullptr; + theta2_offset[i] = nullptr; } memory->create(setflag,n+1,"dihedral:setflag"); @@ -681,9 +680,9 @@ void DihedralSpherical::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - int nterms_one = force->inumeric(FLERR,arg[1]); + int nterms_one = utils::inumeric(FLERR,arg[1],false,lmp); if (nterms_one < 1) error->all(FLERR,"Incorrect number of terms arg for dihedral coefficients"); @@ -706,16 +705,16 @@ void DihedralSpherical::coeff(int narg, char **arg) theta2_offset[i] = new double [nterms_one]; for (int j = 0; j < nterms_one; j++) { int offset = 1+10*j; - Ccoeff[i][j] = force->numeric(FLERR,arg[offset+1]); - phi_mult[i][j] = force->numeric(FLERR,arg[offset+2]); - phi_shift[i][j] = force->numeric(FLERR,arg[offset+3]) * MY_PI/180.0; - phi_offset[i][j] = force->numeric(FLERR,arg[offset+4]); - theta1_mult[i][j] = force->numeric(FLERR,arg[offset+5]); - theta1_shift[i][j] = force->numeric(FLERR,arg[offset+6]) * MY_PI/180.0; - theta1_offset[i][j] = force->numeric(FLERR,arg[offset+7]); - theta2_mult[i][j] = force->numeric(FLERR,arg[offset+8]); - theta2_shift[i][j] = force->numeric(FLERR,arg[offset+9]) * MY_PI/180.0; - theta2_offset[i][j] = force->numeric(FLERR,arg[offset+10]); + Ccoeff[i][j] = utils::numeric(FLERR,arg[offset+1],false,lmp); + phi_mult[i][j] = utils::numeric(FLERR,arg[offset+2],false,lmp); + phi_shift[i][j] = utils::numeric(FLERR,arg[offset+3],false,lmp) * MY_PI/180.0; + phi_offset[i][j] = utils::numeric(FLERR,arg[offset+4],false,lmp); + theta1_mult[i][j] = utils::numeric(FLERR,arg[offset+5],false,lmp); + theta1_shift[i][j] = utils::numeric(FLERR,arg[offset+6],false,lmp) * MY_PI/180.0; + theta1_offset[i][j] = utils::numeric(FLERR,arg[offset+7],false,lmp); + theta2_mult[i][j] = utils::numeric(FLERR,arg[offset+8],false,lmp); + theta2_shift[i][j] = utils::numeric(FLERR,arg[offset+9],false,lmp) * MY_PI/180.0; + theta2_offset[i][j] = utils::numeric(FLERR,arg[offset+10],false,lmp); } setflag[i] = 1; count++; @@ -756,7 +755,7 @@ void DihedralSpherical::read_restart(FILE *fp) allocate(); if (comm->me == 0) - utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,NULL,error); + utils::sfread(FLERR,&nterms[1],sizeof(int),atom->ndihedraltypes,fp,nullptr,error); MPI_Bcast(&nterms[1],atom->ndihedraltypes,MPI_INT,0,world); @@ -776,16 +775,16 @@ void DihedralSpherical::read_restart(FILE *fp) if (comm->me == 0) { for (int i=1; i<=atom->ndihedraltypes; i++) { - utils::sfread(FLERR,Ccoeff[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,phi_offset[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta1_offset[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_mult[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_shift[i],sizeof(double),nterms[i],fp,NULL,error); - utils::sfread(FLERR,theta2_offset[i],sizeof(double),nterms[i],fp,NULL,error); + utils::sfread(FLERR,Ccoeff[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,phi_offset[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta1_offset[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_mult[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_shift[i],sizeof(double),nterms[i],fp,nullptr,error); + utils::sfread(FLERR,theta2_offset[i],sizeof(double),nterms[i],fp,nullptr,error); } } diff --git a/src/USER-MISC/dihedral_table.cpp b/src/USER-MISC/dihedral_table.cpp index 9fd3679106..2b9e829a83 100644 --- a/src/USER-MISC/dihedral_table.cpp +++ b/src/USER-MISC/dihedral_table.cpp @@ -17,33 +17,24 @@ the "tridiag.c" written by Gerard Jungman for GSL ------------------------------------------------------------------------- */ -#include -#include -#include -#include -#include -#include -#include // IWYU pragma: keep -#include // IWYU pragma: keep +#include "dihedral_table.h" #include "atom.h" #include "comm.h" -#include "neighbor.h" #include "domain.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "dihedral_table.h" -#include "utils.h" -#include "tokenizer.h" -#include "table_file_reader.h" -#include "fmt/format.h" - +#include "force.h" #include "math_const.h" #include "math_extra.h" +#include "memory.h" +#include "neighbor.h" +#include "table_file_reader.h" +#include "tokenizer.h" + +#include +#include +#include // IWYU pragma: keep -using namespace std; using namespace LAMMPS_NS; using namespace MathConst; using namespace MathExtra; @@ -782,7 +773,7 @@ void DihedralTable::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in dihedral style table"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 3) error->all(FLERR,"Illegal number of dihedral table entries"); // delete old tables, since cannot just change settings @@ -797,7 +788,7 @@ void DihedralTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } @@ -813,7 +804,7 @@ void DihedralTable::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); int me; MPI_Comm_rank(world,&me); @@ -829,28 +820,20 @@ void DihedralTable::coeff(int narg, char **arg) // --- and resolve issues with periodicity --- if (tb->ninput < 2) { - string err_msg; - err_msg = string("Invalid dihedral table length (") - + string(arg[2]) + string(")."); - error->one(FLERR,err_msg); - } - else if ((tb->ninput == 2) && (tabstyle == SPLINE)) { - string err_msg; - err_msg = string("Invalid dihedral spline table length. (Try linear)\n (") - + string(arg[2]) + string(")."); - error->one(FLERR,err_msg); + error->one(FLERR,fmt::format("Invalid dihedral table length ({}).", + arg[2])); + } else if ((tb->ninput == 2) && (tabstyle == SPLINE)) { + error->one(FLERR,fmt::format("Invalid dihedral spline table length. " + "(Try linear)\n ({}).",arg[2])); } // check for monotonicity for (int i=0; i < tb->ninput-1; i++) { if (tb->phifile[i] >= tb->phifile[i+1]) { - stringstream i_str; - i_str << i+1; - string err_msg = - string("Dihedral table values are not increasing (") + - string(arg[2]) + string(", ")+i_str.str()+string("th entry)"); + auto err_msg = fmt::format("Dihedral table values are not increasing " + "({}, {}th entry)",arg[2],i+1); if (i==0) - err_msg += string("\n(This is probably a mistake with your table format.)\n"); + err_msg += std::string("\n(This is probably a mistake with your table format.)\n"); error->all(FLERR,err_msg); } } @@ -859,20 +842,13 @@ void DihedralTable::coeff(int narg, char **arg) double philo = tb->phifile[0]; double phihi = tb->phifile[tb->ninput-1]; if (tb->use_degrees) { - if ((phihi - philo) >= 360) { - string err_msg; - err_msg = string("Dihedral table angle range must be < 360 degrees (") - +string(arg[2]) + string(")."); - error->all(FLERR,err_msg); - } - } - else { - if ((phihi - philo) >= MY_2PI) { - string err_msg; - err_msg = string("Dihedral table angle range must be < 2*PI radians (") - + string(arg[2]) + string(")."); - error->all(FLERR,err_msg); - } + if ((phihi - philo) >= 360) + error->all(FLERR,fmt::format("Dihedral table angle range must be < 360 " + "degrees ({}).",arg[2])); + } else { + if ((phihi - philo) >= MY_2PI) + error->all(FLERR,fmt::format("Dihedral table angle range must be < 2*PI " + "radians ({}).",arg[2])); } // convert phi from degrees to radians @@ -940,10 +916,9 @@ void DihedralTable::coeff(int narg, char **arg) // Optional: allow the user to print out the interpolated spline tables if (me == 0) { - if (!checkU_fname.empty()) - { - ofstream checkU_file; - checkU_file.open(checkU_fname, ios::out); + if (!checkU_fname.empty()) { + std::ofstream checkU_file; + checkU_file.open(checkU_fname, std::ios::out); for (int i=0; i < tablength; i++) { double phi = i*MY_2PI/tablength; double u = tb->e[i]; @@ -953,12 +928,10 @@ void DihedralTable::coeff(int narg, char **arg) } checkU_file.close(); } - if (!checkF_fname.empty()) - { - ofstream checkF_file; - checkF_file.open(checkF_fname, ios::out); - for (int i=0; i < tablength; i++) - { + if (!checkF_fname.empty()) { + std::ofstream checkF_file; + checkF_file.open(checkF_fname, std::ios::out); + for (int i=0; i < tablength; i++) { double phi = i*MY_2PI/tablength; double f; if ((tabstyle == SPLINE) && (tb->f_unspecified)) { @@ -973,8 +946,7 @@ void DihedralTable::coeff(int narg, char **arg) // To be nice and report something, I do the same thing here.) cyc_splintD(tb->phi, tb->e, tb->e2, tablength, MY_2PI,phi); f = -dU_dphi; - } - else + } else // Otherwise we calculated the tb->f[] array. Report its contents. f = tb->f[i]; if (tb->use_degrees) { @@ -991,8 +963,7 @@ void DihedralTable::coeff(int narg, char **arg) // store ptr to table in tabindex int count = 0; - for (int i = ilo; i <= ihi; i++) - { + for (int i = ilo; i <= ihi; i++) { tabindex[i] = ntables; //phi0[i] = tb->phi0; <- equilibrium dihedral angles not supported setflag[i] = 1; @@ -1043,8 +1014,8 @@ void DihedralTable::write_restart_settings(FILE *fp) void DihedralTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); @@ -1056,10 +1027,10 @@ void DihedralTable::read_restart_settings(FILE *fp) void DihedralTable::null_table(Table *tb) { - tb->phifile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->phi = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->phifile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->phi = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1120,7 +1091,7 @@ void DihedralTable::read_table(Table *tb, char *file, char *keyword) tb->efile[i] = values.next_double(); tb->ffile[i] = values.next_double(); } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } //for (int i = 0; (i < tb->ninput) && fp; i++) { @@ -1213,7 +1184,7 @@ void DihedralTable::spline_table(Table *tb) } // for (int i=0; ininput; i++) if ((num_disagreements > tb->ninput/2) && (num_disagreements > 2)) { - string msg("Dihedral table has inconsistent forces and energies. (Try \"NOF\".)\n"); + std::string msg("Dihedral table has inconsistent forces and energies. (Try \"NOF\".)\n"); error->all(FLERR, msg); } @@ -1319,7 +1290,7 @@ void DihedralTable::param_extract(Table *tb, char *line) ValueTokenizer values(line); while (values.has_next()) { - std::string word = values.next_string(); + auto word = values.next_string(); if (word == "N") { tb->ninput = values.next_int(); } @@ -1342,12 +1313,10 @@ void DihedralTable::param_extract(Table *tb, char *line) //else if (word == "EQ") { // tb->theta0 = values.next_double(); //} - else { - string err_msg = fmt::format("Invalid keyword in dihedral angle table parameters ({})", word); - error->one(FLERR,err_msg); - } + else error->one(FLERR,fmt::format("Invalid keyword in dihedral angle " + "table parameters ({})", word)); } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/USER-MISC/dihedral_table.h b/src/USER-MISC/dihedral_table.h index 8a397b20f2..a8d1f8f8bb 100644 --- a/src/USER-MISC/dihedral_table.h +++ b/src/USER-MISC/dihedral_table.h @@ -24,7 +24,7 @@ DihedralStyle(table,DihedralTable) #ifndef LMP_DIHEDRAL_TABLE_H #define LMP_DIHEDRAL_TABLE_H #include "dihedral.h" -#include + namespace LAMMPS_NS { diff --git a/src/USER-MISC/dihedral_table_cut.cpp b/src/USER-MISC/dihedral_table_cut.cpp index e2283633bc..3933e39342 100644 --- a/src/USER-MISC/dihedral_table_cut.cpp +++ b/src/USER-MISC/dihedral_table_cut.cpp @@ -17,12 +17,12 @@ ------------------------------------------------------------------------- */ #include "dihedral_table_cut.h" -#include + #include #include -#include + #include -#include + #include // IWYU pragma: keep #include // IWYU pragma: keep @@ -35,7 +35,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -412,8 +412,8 @@ DihedralTableCut::DihedralTableCut(LAMMPS *lmp) : Dihedral(lmp) { if (lmp->citeme) lmp->citeme->add(cite_dihedral_tablecut); ntables = 0; - tables = NULL; - checkU_fname = checkF_fname = NULL; + tables = nullptr; + checkU_fname = checkF_fname = nullptr; } /* ---------------------------------------------------------------------- */ @@ -764,7 +764,7 @@ void DihedralTableCut::settings(int narg, char **arg) else if (strcmp(arg[0],"spline") == 0) tabstyle = SPLINE; else error->all(FLERR,"Unknown table style in dihedral style table_cut"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 3) error->all(FLERR,"Illegal number of dihedral table entries"); // delete old tables, since cannot just change settings @@ -779,7 +779,7 @@ void DihedralTableCut::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -794,11 +794,11 @@ void DihedralTableCut::coeff(int narg, char **arg) if (narg != 7) error->all(FLERR,"Incorrect args for dihedral coefficients"); if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[2]); - double theta0_1_one = force->numeric(FLERR,arg[3]); - double theta0_2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[2],false,lmp); + double theta0_1_one = utils::numeric(FLERR,arg[3],false,lmp); + double theta0_2_one = utils::numeric(FLERR,arg[4],false,lmp); // convert theta0's from degrees to radians @@ -1029,8 +1029,8 @@ void DihedralTableCut::write_restart_settings(FILE *fp) void DihedralTableCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); @@ -1041,10 +1041,10 @@ void DihedralTableCut::read_restart_settings(FILE *fp) void DihedralTableCut::null_table(Table *tb) { - tb->phifile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->phi = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->phifile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->phi = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1078,8 +1078,8 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // open file - FILE *fp = force->open_potential(file); - if (fp == NULL) { + FILE *fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { string err_msg = string("Cannot open file ") + string(file); error->one(FLERR,err_msg); } @@ -1087,7 +1087,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // loop until section found with matching keyword while (1) { - if (fgets(line,MAXLINE,fp) == NULL) { + if (fgets(line,MAXLINE,fp) == nullptr) { string err_msg=string("Did not find keyword \"") +string(keyword)+string("\" in dihedral table file."); error->one(FLERR, err_msg); @@ -1121,7 +1121,7 @@ void DihedralTableCut::read_table(Table *tb, char *file, char *keyword) // Skip blank lines and delete text following a '#' character char *pe = strchr(line, '#'); - if (pe != NULL) *pe = '\0'; //terminate string at '#' character + if (pe != nullptr) *pe = '\0'; //terminate string at '#' character char *pc = line; while ((*pc != '\0') && isspace(*pc)) pc++; @@ -1344,7 +1344,7 @@ void DihedralTableCut::param_extract(Table *tb, char *line) char *word = strtok(line," \t\n\r\f"); while (word) { if (strcmp(word,"N") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); tb->ninput = atoi(word); } else if (strcmp(word,"NOF") == 0) { @@ -1357,20 +1357,20 @@ void DihedralTableCut::param_extract(Table *tb, char *line) tb->use_degrees = false; } else if (strcmp(word,"CHECKU") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); memory->sfree(checkU_fname); memory->create(checkU_fname,strlen(word)+1,"dihedral_table:checkU"); strcpy(checkU_fname, word); } else if (strcmp(word,"CHECKF") == 0) { - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); memory->sfree(checkF_fname); memory->create(checkF_fname,strlen(word)+1,"dihedral_table:checkF"); strcpy(checkF_fname, word); } // COMMENTING OUT: equilibrium angles are not supported //else if (strcmp(word,"EQ") == 0) { - // word = strtok(NULL," \t\n\r\f"); + // word = strtok(nullptr," \t\n\r\f"); // tb->theta0 = atof(word); //} else { @@ -1378,7 +1378,7 @@ void DihedralTableCut::param_extract(Table *tb, char *line) err_msg += string(" (") + string(word) + string(")"); error->one(FLERR, err_msg); } - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } if (tb->ninput == 0) diff --git a/src/USER-MISC/fix_accelerate_cos.cpp b/src/USER-MISC/fix_accelerate_cos.cpp index 88e33023fd..4c15685556 100644 --- a/src/USER-MISC/fix_accelerate_cos.cpp +++ b/src/USER-MISC/fix_accelerate_cos.cpp @@ -16,19 +16,15 @@ ------------------------------------------------------------------------- */ #include "fix_accelerate_cos.h" + #include "atom.h" -#include "update.h" -#include "modify.h" #include "domain.h" -#include "region.h" -#include "respa.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" #include "force.h" #include "math_const.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; @@ -37,7 +33,7 @@ using namespace FixConst; FixAccelerateCos::FixAccelerateCos(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR, "Illegal fix accelerate/cos command"); - acceleration = force->numeric(FLERR, arg[3]); + acceleration = utils::numeric(FLERR, arg[3],false,lmp); if (domain->dimension == 2) error->all(FLERR,"Fix accelerate/cos cannot be used with 2d systems"); } diff --git a/src/USER-MISC/fix_addtorque.cpp b/src/USER-MISC/fix_addtorque.cpp index 665f1d4a60..f1b64817b1 100644 --- a/src/USER-MISC/fix_addtorque.cpp +++ b/src/USER-MISC/fix_addtorque.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_addtorque.h" -#include + #include #include "atom.h" #include "update.h" @@ -51,14 +51,14 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -66,7 +66,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : ystr = new char[n]; strcpy(ystr,&arg[4][2]); } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -74,7 +74,7 @@ FixAddTorque::FixAddTorque(LAMMPS *lmp, int narg, char **arg) : zstr = new char[n]; strcpy(zstr,&arg[5][2]); } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } diff --git a/src/USER-MISC/fix_ave_correlate_long.cpp b/src/USER-MISC/fix_ave_correlate_long.cpp index 4d548d585a..57eb9705b7 100644 --- a/src/USER-MISC/fix_ave_correlate_long.cpp +++ b/src/USER-MISC/fix_ave_correlate_long.cpp @@ -22,20 +22,19 @@ ------------------------------------------------------------------------- */ #include "fix_ave_correlate_long.h" -#include + +#include "citeme.h" +#include "compute.h" +#include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + #include -#include #include #include -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "input.h" -#include "variable.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -70,8 +69,8 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nfreq = force->inumeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nfreq = utils::inumeric(FLERR,arg[4],false,lmp); restart_global = 1; global_freq = nfreq; @@ -119,13 +118,13 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): type = AUTO; startstep = 0; - fp = NULL; + fp = nullptr; overwrite = 0; numcorrelators=20; p = 16; m = 2; - char *title1 = NULL; - char *title2 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"type") == 0) { @@ -142,29 +141,29 @@ FixAveCorrelateLong::FixAveCorrelateLong(LAMMPS * lmp, int narg, char **arg): } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"ncorr") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - numcorrelators = force->inumeric(FLERR,arg[iarg+1]); + numcorrelators = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"nlen") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - p = force->inumeric(FLERR,arg[iarg+1]); + p = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"ncount") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); - m = force->inumeric(FLERR,arg[iarg+1]); + m = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate/long command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix ave/correlate/long file %s",arg[iarg+1]); error->one(FLERR,str); diff --git a/src/USER-MISC/fix_electron_stopping.cpp b/src/USER-MISC/fix_electron_stopping.cpp index 2130f07420..52ab44b0c8 100644 --- a/src/USER-MISC/fix_electron_stopping.cpp +++ b/src/USER-MISC/fix_electron_stopping.cpp @@ -17,21 +17,22 @@ ------------------------------------------------------------------------- */ #include "fix_electron_stopping.h" -#include -#include -#include "mpi.h" + #include "atom.h" -#include "update.h" -#include "domain.h" -#include "region.h" -#include "force.h" -#include "fix.h" -#include "memory.h" #include "comm.h" +#include "domain.h" #include "error.h" -#include "neighbor.h" +#include "fix.h" +#include "force.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" +#include "neighbor.h" +#include "region.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -57,7 +58,7 @@ FixElectronStopping::FixElectronStopping(LAMMPS *lmp, int narg, char **arg) : if (narg < 5) error->all(FLERR, "Illegal fix electron/stopping command: too few arguments"); - Ecut = force->numeric(FLERR, arg[3]); + Ecut = utils::numeric(FLERR, arg[3],false,lmp); if (Ecut <= 0.0) error->all(FLERR, "Illegal fix electron/stopping command: Ecut <= 0"); @@ -83,7 +84,7 @@ FixElectronStopping::FixElectronStopping(LAMMPS *lmp, int narg, char **arg) : minneighflag = true; if (iarg+2 > narg) error->all(FLERR, "Illegal fix electron/stopping command: minneigh number missing"); - minneigh = force->inumeric(FLERR, arg[iarg+1]); + minneigh = utils::inumeric(FLERR, arg[iarg+1],false,lmp); if (minneigh < 0) error->all(FLERR, "Illegal fix electron/stopping command: minneigh < 0"); iarg += 2; @@ -240,8 +241,8 @@ void FixElectronStopping::read_table(const char *file) { char line[MAXLINE]; - FILE *fp = force->open_potential(file); - if (fp == NULL) { + FILE *fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str, 128, "Cannot open stopping range table %s", file); error->one(FLERR, str); @@ -251,21 +252,21 @@ void FixElectronStopping::read_table(const char *file) int l = 0; while (true) { - if (fgets(line, MAXLINE, fp) == NULL) break; // end of file + if (fgets(line, MAXLINE, fp) == nullptr) break; // end of file if (line[0] == '#') continue; // comment char *pch = strtok(line, " \t\n\r"); - if (pch == NULL) continue; // blank line + if (pch == nullptr) continue; // blank line if (l >= maxlines) grow_table(); int i = 0; - for ( ; i < ncol && pch != NULL; i++) { - elstop_ranges[i][l] = force->numeric(FLERR, pch); - pch = strtok(NULL, " \t\n\r"); + for ( ; i < ncol && pch != nullptr; i++) { + elstop_ranges[i][l] = utils::numeric(FLERR, pch,false,lmp); + pch = strtok(nullptr, " \t\n\r"); } - if (i != ncol || pch != NULL) // too short or too long + if (i != ncol || pch != nullptr) // too short or too long error->one(FLERR, "fix electron/stopping: Invalid table line"); if (l >= 1 && elstop_ranges[0][l] <= elstop_ranges[0][l-1]) diff --git a/src/USER-MISC/fix_ffl.cpp b/src/USER-MISC/fix_ffl.cpp index a245b6b4e5..6a74cf85f8 100644 --- a/src/USER-MISC/fix_ffl.cpp +++ b/src/USER-MISC/fix_ffl.cpp @@ -22,7 +22,7 @@ ------------------------------------------------------------------------- */ #include "fix_ffl.h" -#include + #include #include #include "atom.h" @@ -64,21 +64,22 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; scalar_flag = 1; - //gamma = 1/ time constant(tau) - if (force->numeric(FLERR,arg[3]) <= 0) + //gamma = 1 / time constant(tau) + gamma = utils::numeric(FLERR,arg[3],false,lmp); + if (gamma <= 0.0) error->all(FLERR,"Illegal fix ffl tau value, should be greater than 0"); - gamma = 1.0/force->numeric(FLERR,arg[3]); + gamma = 1.0/gamma; ffl_every=1; ffl_step=0; // start temperature (t ramp) - t_start = force->numeric(FLERR,arg[4]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); // final temperature (t ramp) - t_stop = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); // PRNG seed - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // Flip type used, uses rescale if no flip is given if (narg == 8) { @@ -105,17 +106,17 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : random = new RanMars(lmp,seed + comm->me); // allocate per-type arrays for mass-scaling - sqrt_m=NULL; + sqrt_m=nullptr; memory->grow(sqrt_m, atom->ntypes+1,"ffl:sqrt_m"); // allocates space for temporaries - ffl_tmp1=ffl_tmp2=NULL; + ffl_tmp1=ffl_tmp2=nullptr; grow_arrays(atom->nmax); // add callbacks to enable restarts - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); energy = 0.0; } @@ -126,8 +127,8 @@ FixFFL::FixFFL(LAMMPS *lmp, int narg, char **arg) : FixFFL::~FixFFL() { delete random; - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); memory->destroy(sqrt_m); memory->destroy(ffl_tmp1); @@ -425,7 +426,7 @@ void *FixFFL::extract(const char *str, int &dim) { if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_filter_corotate.cpp b/src/USER-MISC/fix_filter_corotate.cpp index 52e979d32c..bd0b29979b 100644 --- a/src/USER-MISC/fix_filter_corotate.cpp +++ b/src/USER-MISC/fix_filter_corotate.cpp @@ -17,11 +17,11 @@ ------------------------------------------------------------------------- */ #include "fix_filter_corotate.h" -#include + #include #include #include -#include + #include "atom.h" #include "atom_vec.h" #include "comm.h" @@ -71,10 +71,10 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_size(world,&nprocs); molecular = atom->molecular; - if (molecular == 0) + if (molecular == Atom::ATOMIC) error->all(FLERR,"Cannot use fix filter/corotate " "with non-molecular system"); - if (molecular == 2) + if (molecular == Atom::TEMPLATE) error->all(FLERR,"Cannot use fix filter/corotate " "with molecular template system"); @@ -110,25 +110,25 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : // read numeric args of b,a,t,m else if (mode == 'b') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nbondtypes) error->all(FLERR,"Invalid bond type index for fix filter/corotate"); bond_flag[i] = 1; } else if (mode == 'a') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->nangletypes) error->all(FLERR,"Invalid angle type index for fix filter/corotate"); angle_flag[i] = 1; } else if (mode == 't') { - int i = force->inumeric(FLERR,arg[next]); + int i = utils::inumeric(FLERR,arg[next],false,lmp); if (i < 1 || i > atom->ntypes) error->all(FLERR,"Invalid atom type index for fix filter/corotate"); type_flag[i] = 1; } else if (mode == 'm') { - double massone = force->numeric(FLERR,arg[next]); + double massone = utils::numeric(FLERR,arg[next],false,lmp); if (massone == 0.0) error->all(FLERR,"Invalid atom mass for fix filter/corotate"); if (nmass == atom->ntypes) @@ -149,22 +149,22 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : angle_distance = new double[atom->nangletypes+1]; //grow_arrays - array_atom = NULL; - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; + array_atom = nullptr; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); //calls grow_arrays + atom->add_callback(Atom::GROW); //calls grow_arrays - x_store = NULL; + x_store = nullptr; //STUFF - g = NULL; - help2 = NULL; + g = nullptr; + help2 = nullptr; - dn1dx = dn2dx = dn3dx = NULL; - n1 = n2 = n3 = del1 = del2 = del3 = NULL; + dn1dx = dn2dx = dn3dx = nullptr; + n1 = n2 = n3 = del1 = del2 = del3 = nullptr; memory->grow(help2,15,15,"FilterCorotate:help2"); memory->grow(n1,3,"FilterCorotate:n1"); @@ -188,11 +188,11 @@ FixFilterCorotate::FixFilterCorotate(LAMMPS *lmp, int narg, char **arg) : // initialize list of clusters to constrain maxlist = 0; - list = NULL; - clist_derv = NULL; - clist_q0 = NULL; //list for derivative and ref. config - clist_nselect1 = clist_nselect2 = NULL; - clist_select1 = clist_select2 = NULL; + list = nullptr; + clist_derv = nullptr; + clist_q0 = nullptr; //list for derivative and ref. config + clist_nselect1 = clist_nselect2 = nullptr; + clist_select1 = clist_select2 = nullptr; } @@ -212,7 +212,7 @@ FixFilterCorotate::~FixFilterCorotate() memory->destroy(dn2dx); memory->destroy(dn3dx); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays @@ -284,7 +284,7 @@ void FixFilterCorotate::init() // set equilibrium bond distances - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond potential must be defined for fix filter/corotate"); for (i = 1; i <= atom->nbondtypes; i++) bond_distance[i] = force->bond->equilibrium_distance(i); @@ -1225,7 +1225,7 @@ void FixFilterCorotate::find_clusters() // cycle buffer around ring of procs back to self - comm->ring(size,sizeof(tagint),buf,3,ring_shake,NULL,(void *)this); + comm->ring(size,sizeof(tagint),buf,3,ring_shake,nullptr,(void *)this); memory->destroy(buf); diff --git a/src/USER-MISC/fix_flow_gauss.cpp b/src/USER-MISC/fix_flow_gauss.cpp index c7b7f86d37..d603e37671 100644 --- a/src/USER-MISC/fix_flow_gauss.cpp +++ b/src/USER-MISC/fix_flow_gauss.cpp @@ -17,16 +17,16 @@ ------------------------------------------------------------------------- */ #include "fix_flow_gauss.h" -#include -#include + #include "atom.h" -#include "force.h" -#include "group.h" -#include "update.h" +#include "citeme.h" #include "domain.h" #include "error.h" -#include "citeme.h" +#include "group.h" #include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -71,7 +71,7 @@ FixFlowGauss::FixFlowGauss(LAMMPS *lmp, int narg, char **arg) : int tmpFlag; for (int ii=0; ii<3; ii++) { - tmpFlag=force->inumeric(FLERR,arg[3+ii]); + tmpFlag=utils::inumeric(FLERR,arg[3+ii],false,lmp); if (tmpFlag==1 || tmpFlag==0) flow[ii]=tmpFlag; else diff --git a/src/USER-MISC/fix_gle.cpp b/src/USER-MISC/fix_gle.cpp index 8459ddf29b..22cf37eeda 100644 --- a/src/USER-MISC/fix_gle.cpp +++ b/src/USER-MISC/fix_gle.cpp @@ -17,10 +17,10 @@ ------------------------------------------------------------------------- */ #include "fix_gle.h" -#include + #include #include -#include + #include "atom.h" #include "force.h" #include "update.h" @@ -29,7 +29,7 @@ #include "random_mars.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -197,7 +197,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : time_integrate = 1; // number of additional momenta - ns = force->inumeric(FLERR,arg[3]); + ns = utils::inumeric(FLERR,arg[3],false,lmp); ns1sq = (ns+1)*(ns+1); // allocate GLE matrices @@ -209,20 +209,20 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ST = new double[ns1sq]; // start temperature (t ramp) - t_start = force->numeric(FLERR,arg[4]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); // final temperature (t ramp) - t_stop = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); // PRNG seed - int seed = force->inumeric(FLERR,arg[6]); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // LOADING A matrix - FILE *fgle = NULL; + FILE *fgle = nullptr; char *fname = arg[7]; if (comm->me == 0) { - fgle = force->open_potential(fname); - if (fgle == NULL) { + fgle = utils::open_potential(fname,lmp,nullptr); + if (fgle == nullptr) { char str[128]; snprintf(str,128,"Cannot open A-matrix file %s",fname); error->one(FLERR,str); @@ -238,7 +238,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fgle); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fgle); } else n = strlen(line) + 1; @@ -258,9 +258,9 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ptr = strtok(line," \t\n\r\f"); do { A[ndone] = atof(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ndone++; - } while ((ptr != NULL) && (ndone < ns1sq)); + } while ((ptr != nullptr) && (ndone < ns1sq)); } fnoneq=0; gle_every=1; gle_step=0; @@ -276,7 +276,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : if (iarg+2>narg) error->all(FLERR, "Did not specify interval for applying the GLE"); - gle_every=force->inumeric(FLERR,arg[iarg+1]); + gle_every=utils::inumeric(FLERR,arg[iarg+1],false,lmp); } } @@ -291,8 +291,8 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : } else { if (comm->me == 0) { - fgle = force->open_potential(fname); - if (fgle == NULL) { + fgle = utils::open_potential(fname,lmp,nullptr); + if (fgle == nullptr) { char str[128]; snprintf(str,128,"Cannot open C-matrix file %s",fname); error->one(FLERR,str); @@ -310,7 +310,7 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fgle); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fgle); } else n = strlen(line) + 1; @@ -330,9 +330,9 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : ptr = strtok(line," \t\n\r\f"); do { C[ndone] = cfac*atof(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ndone++; - } while ((ptr != NULL) && (ndone < ns1sq)); + } while ((ptr != nullptr) && (ndone < ns1sq)); } } @@ -349,20 +349,20 @@ FixGLE::FixGLE(LAMMPS *lmp, int narg, char **arg) : random = new RanMars(lmp,seed + comm->me); // allocate per-type arrays for mass-scaling - sqrt_m=NULL; + sqrt_m=nullptr; memory->grow(sqrt_m, atom->ntypes+1,"gle:sqrt_m"); // allocates space for additional degrees of freedom - gle_s=NULL; + gle_s=nullptr; // allocates space for temporaries - gle_tmp1=gle_tmp2=NULL; + gle_tmp1=gle_tmp2=nullptr; grow_arrays(atom->nmax); init_gles(); // add callbacks to enable restarts - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); energy = 0.0; } @@ -720,7 +720,7 @@ void *FixGLE::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } @@ -843,7 +843,7 @@ void FixGLE::unpack_restart(int nlocal, int nth) // skip to the nth set of extended variables // unpack the Nth first values this way because other fixes pack them - + int m = 0; for (int i = 0; i< nth; i++) m += static_cast (extra[nlocal][m]); m++; diff --git a/src/USER-MISC/fix_grem.cpp b/src/USER-MISC/fix_grem.cpp index 9600cce90e..0a283522ea 100644 --- a/src/USER-MISC/fix_grem.cpp +++ b/src/USER-MISC/fix_grem.cpp @@ -52,9 +52,9 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) : // tbath - temp of bath, the same as defined in thermostat - lambda = force->numeric(FLERR,arg[3]); - eta = force->numeric(FLERR,arg[4]); - h0 = force->numeric(FLERR,arg[5]); + lambda = utils::numeric(FLERR,arg[3],false,lmp); + eta = utils::numeric(FLERR,arg[4],false,lmp); + h0 = utils::numeric(FLERR,arg[5],false,lmp); int n = strlen(arg[6])+1; id_nh = new char[n]; @@ -132,7 +132,7 @@ FixGrem::FixGrem(LAMMPS *lmp, int narg, char **arg) : pressflag = 0; int *p_flag = (int *)nh->extract("p_flag",ifix); - if ((p_flag == NULL) || (ifix != 1) || (p_flag[0] == 0) + if ((p_flag == nullptr) || (ifix != 1) || (p_flag[0] == 0) || (p_flag[1] == 0) || (p_flag[2] == 0)) { pressflag = 0; } else if ((p_flag[0] == 1) && (p_flag[1] == 1) @@ -203,7 +203,7 @@ void FixGrem::init() double *t_start = (double *)nh->extract("t_start",ifix); double *t_stop = (double *)nh->extract("t_stop",ifix); - if ((t_start != NULL) && (t_stop != NULL) && (ifix == 0)) { + if ((t_start != nullptr) && (t_stop != nullptr) && (ifix == 0)) { tbath = *t_start; if (*t_start != *t_stop) error->all(FLERR,"Thermostat temperature ramp not allowed"); @@ -215,7 +215,7 @@ void FixGrem::init() int *p_flag = (int *)nh->extract("p_flag",ifix); double *p_start = (double *) nh->extract("p_start",ifix); double *p_stop = (double *) nh->extract("p_stop",ifix); - if ((p_flag != NULL) && (p_start != NULL) && (p_stop != NULL) + if ((p_flag != nullptr) && (p_start != nullptr) && (p_stop != nullptr) && (ifix == 1)) { ifix = 0; pressref = p_start[0]; @@ -291,5 +291,5 @@ void *FixGrem::extract(const char *str, int &dim) if (strcmp(str,"scale_grem") == 0) { return &scale_grem; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/fix_imd.cpp b/src/USER-MISC/fix_imd.cpp index 266142b529..d772998b16 100644 --- a/src/USER-MISC/fix_imd.cpp +++ b/src/USER-MISC/fix_imd.cpp @@ -48,17 +48,16 @@ negotiate an appropriate license for such distribution." ------------------------------------------------------------------------- */ #include "fix_imd.h" + #include "atom.h" #include "comm.h" -#include "update.h" -#include "respa.h" #include "domain.h" -#include "force.h" #include "error.h" #include "group.h" #include "memory.h" +#include "respa.h" +#include "update.h" -#include #include #if defined(_MSC_VER) || defined(__MINGW32__) @@ -208,7 +207,7 @@ tagint taginthash_lookup(const taginthash_t *tptr, tagint key) { /* find the entry in the hash table */ h=taginthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -230,7 +229,7 @@ tagint *taginthash_keys(taginthash_t *tptr) { keys = (tagint *)calloc(tptr->entries, sizeof(tagint)); for (tagint i=0; i < tptr->size; ++i) { - for (node=tptr->bucket[i]; node != NULL; node=node->next) { + for (node=tptr->bucket[i]; node != nullptr; node=node->next) { keys[node->data] = node->key; } } @@ -281,7 +280,7 @@ void taginthash_destroy(taginthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -289,7 +288,7 @@ void taginthash_destroy(taginthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(taginthash_t)); } @@ -446,7 +445,7 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : if (narg < 4) error->all(FLERR,"Illegal fix imd command"); - imd_port = force->inumeric(FLERR,arg[3]); + imd_port = utils::inumeric(FLERR,arg[3],false,lmp); if (imd_port < 1024) error->all(FLERR,"Illegal fix imd parameter: port < 1024"); @@ -473,9 +472,9 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : nowait_flag = 0; } } else if (0 == strcmp(arg[argsdone], "fscale")) { - imd_fscale = force->numeric(FLERR,arg[argsdone+1]); + imd_fscale = utils::numeric(FLERR,arg[argsdone+1],false,lmp); } else if (0 == strcmp(arg[argsdone], "trate")) { - imd_trate = force->inumeric(FLERR,arg[argsdone+1]); + imd_trate = utils::inumeric(FLERR,arg[argsdone+1],false,lmp); } else { error->all(FLERR,"Unknown fix imd parameter"); } @@ -493,25 +492,25 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : MPI_Comm_rank(world,&me); /* initialize various imd state variables. */ - clientsock = NULL; - localsock = NULL; + clientsock = nullptr; + localsock = nullptr; nlevels_respa = 0; imd_inactive = 0; imd_terminate = 0; imd_forces = 0; - force_buf = NULL; + force_buf = nullptr; maxbuf = 0; - msgdata = NULL; + msgdata = nullptr; msglen = 0; - comm_buf = NULL; - idmap = NULL; - rev_idmap = NULL; + comm_buf = nullptr; + idmap = nullptr; + rev_idmap = nullptr; if (me == 0) { /* set up incoming socket on MPI rank 0. */ imdsock_init(); localsock = imdsock_create(); - clientsock = NULL; + clientsock = nullptr; if (imdsock_bind(localsock,imd_port)) { perror("bind to socket failed"); imdsock_destroy(localsock); @@ -537,9 +536,9 @@ FixIMD::FixIMD(LAMMPS *lmp, int narg, char **arg) : /* set up mutex and condition variable for i/o thread */ /* hold mutex before creating i/o thread to keep it waiting. */ - pthread_mutex_init(&read_mutex, NULL); - pthread_mutex_init(&write_mutex, NULL); - pthread_cond_init(&write_cond, NULL); + pthread_mutex_init(&read_mutex, nullptr); + pthread_mutex_init(&write_mutex, nullptr); + pthread_cond_init(&write_cond, nullptr); pthread_mutex_lock(&write_mutex); buf_has_data=0; @@ -565,7 +564,7 @@ FixIMD::~FixIMD() buf_has_data=-1; pthread_cond_signal(&write_cond); pthread_mutex_unlock(&write_mutex); - pthread_join(iothread, NULL); + pthread_join(iothread, nullptr); /* cleanup */ pthread_attr_destroy(&iot_attr); @@ -585,8 +584,8 @@ FixIMD::~FixIMD() imdsock_destroy(clientsock); imdsock_shutdown(localsock); imdsock_destroy(localsock); - clientsock=NULL; - localsock=NULL; + clientsock=nullptr; + localsock=nullptr; return; } @@ -628,7 +627,7 @@ int FixIMD::reconnect() } } connect_msg = 0; - clientsock = NULL; + clientsock = nullptr; if (nowait_flag) { int retval = imdsock_selread(localsock,0); if (retval > 0) { @@ -775,7 +774,7 @@ void *fix_imd_ioworker(void *t) { FixIMD *imd=(FixIMD *)t; imd->ioworker(); - return NULL; + return nullptr; } /* the real i/o worker thread */ @@ -788,7 +787,7 @@ void FixIMD::ioworker() fprintf(screen,"Asynchronous I/O thread is exiting.\n"); buf_has_data=0; pthread_mutex_unlock(&write_mutex); - pthread_exit(NULL); + pthread_exit(nullptr); } else if (buf_has_data > 0) { /* send coordinate data, if client is able to accept */ if (clientsock && imdsock_selwrite(clientsock,0)) { @@ -856,9 +855,9 @@ void FixIMD::post_force(int /*vflag*/) imd_paused = 0; imd_forces = 0; memory->destroy(force_buf); - force_buf = NULL; + force_buf = nullptr; imdsock_destroy(clientsock); - clientsock = NULL; + clientsock = nullptr; if (screen) fprintf(screen, "IMD client detached. LAMMPS run continues.\n"); @@ -876,7 +875,7 @@ void FixIMD::post_force(int /*vflag*/) imd_terminate = 1; imd_paused = 0; imdsock_destroy(clientsock); - clientsock = NULL; + clientsock = nullptr; break; case IMD_PAUSE: @@ -959,7 +958,7 @@ void FixIMD::post_force(int /*vflag*/) /* check if we need to readjust the forces comm buffer on the receiving nodes. */ if (me != 0) { if (old_imd_forces < imd_forces) { /* grow holding space for forces, if needed. */ - if (force_buf != NULL) + if (force_buf != nullptr) memory->sfree(force_buf); force_buf = memory->smalloc(imd_forces*size_one, "imd:force_buf"); } @@ -1201,14 +1200,14 @@ void * imdsock_create(void) { imdsocket * s; s = (imdsocket *) malloc(sizeof(imdsocket)); - if (s != NULL) + if (s != nullptr) memset(s, 0, sizeof(imdsocket)); - else return NULL; + else return nullptr; if ((s->sd = socket(PF_INET, SOCK_STREAM, 0)) == -1) { printf("Failed to open socket."); free(s); - return NULL; + return nullptr; } return (void *) s; @@ -1230,7 +1229,7 @@ int imdsock_listen(void * v) { void *imdsock_accept(void * v) { int rc; - imdsocket *new_s = NULL, *s = (imdsocket *) v; + imdsocket *new_s = nullptr, *s = (imdsocket *) v; #if defined(ARCH_AIX5) || defined(ARCH_AIX5_64) || defined(ARCH_AIX6_64) unsigned int len; #define _SOCKLEN_TYPE unsigned int @@ -1249,7 +1248,7 @@ void *imdsock_accept(void * v) { rc = accept(s->sd, (struct sockaddr *) &s->addr, ( _SOCKLEN_TYPE * ) &len); if (rc >= 0) { new_s = (imdsocket *) malloc(sizeof(imdsocket)); - if (new_s != NULL) { + if (new_s != nullptr) { *new_s = *s; new_s->sd = rc; } @@ -1278,7 +1277,7 @@ int imdsock_read(void * v, void *buf, int len) { void imdsock_shutdown(void *v) { imdsocket * s = (imdsocket *) v; - if (s == NULL) + if (s == nullptr) return; #if defined(_MSC_VER) || defined(__MINGW32__) @@ -1290,7 +1289,7 @@ void imdsock_shutdown(void *v) { void imdsock_destroy(void * v) { imdsocket * s = (imdsocket *) v; - if (s == NULL) + if (s == nullptr) return; #if defined(_MSC_VER) || defined(__MINGW32__) @@ -1307,14 +1306,14 @@ int imdsock_selread(void *v, int sec) { struct timeval tv; int rc; - if (v == NULL) return 0; + if (v == nullptr) return 0; FD_ZERO(&rfd); FD_SET(s->sd, &rfd); memset((void *)&tv, 0, sizeof(struct timeval)); tv.tv_sec = sec; do { - rc = select(s->sd+1, &rfd, NULL, NULL, &tv); + rc = select(s->sd+1, &rfd, nullptr, nullptr, &tv); } while (rc < 0 && errno == EINTR); return rc; @@ -1326,14 +1325,14 @@ int imdsock_selwrite(void *v, int sec) { struct timeval tv; int rc; - if (v == NULL) return 0; + if (v == nullptr) return 0; FD_ZERO(&wfd); FD_SET(s->sd, &wfd); memset((void *)&tv, 0, sizeof(struct timeval)); tv.tv_sec = sec; do { - rc = select(s->sd + 1, NULL, &wfd, NULL, &tv); + rc = select(s->sd + 1, nullptr, &wfd, nullptr, &tv); } while (rc < 0 && errno == EINTR); return rc; } diff --git a/src/USER-MISC/fix_ipi.cpp b/src/USER-MISC/fix_ipi.cpp index 74e757c2e9..2ddc965bb5 100644 --- a/src/USER-MISC/fix_ipi.cpp +++ b/src/USER-MISC/fix_ipi.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_ipi.h" -#include + #include #include "atom.h" #include "force.h" @@ -45,7 +45,7 @@ using namespace FixConst; // socket interface #ifndef _WIN32 -#include + #include #include #include @@ -167,7 +167,7 @@ static void readbuffer(int sockfd, char *data, int len, Error* error) /* ---------------------------------------------------------------------- */ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), irregular(NULL) + Fix(lmp, narg, arg), irregular(nullptr) { /* format for fix: * fix num group_id ipi host port [unix] @@ -185,7 +185,7 @@ FixIPI::FixIPI(LAMMPS *lmp, int narg, char **arg) : error->warning(FLERR,"Fix ipi always uses group all"); host = strdup(arg[3]); - port = force->inumeric(FLERR,arg[4]); + port = utils::inumeric(FLERR,arg[4],false,lmp); inet = ((narg > 5) && (strcmp(arg[5],"unix") == 0) ) ? 0 : 1; master = (comm->me==0) ? 1 : 0; diff --git a/src/USER-MISC/fix_momentum_chunk.cpp b/src/USER-MISC/fix_momentum_chunk.cpp new file mode 100644 index 0000000000..fcd6d47922 --- /dev/null +++ b/src/USER-MISC/fix_momentum_chunk.cpp @@ -0,0 +1,292 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "fix_momentum_chunk.h" + +#include "atom.h" +#include "compute.h" +#include "compute_chunk_atom.h" +#include "compute_com_chunk.h" +#include "domain.h" +#include "error.h" +#include "group.h" +#include "modify.h" + +#include +#include + +using namespace LAMMPS_NS; +using namespace FixConst; + +/* ---------------------------------------------------------------------- + Contributing author: Jiang Xiao (Hong Kong Polytechnic University) +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- */ + +FixMomentumChunk::FixMomentumChunk(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), + cchunk(nullptr), ccom(nullptr), cvcm(nullptr), comega(nullptr) +{ + if (narg < 5) error->all(FLERR,"Illegal fix momentum/chunk command"); + + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + if (nevery <= 0) error->all(FLERR,"Illegal fix momentum/chunk command"); + + id_chunk = arg[4]; + int icompute = modify->find_compute(id_chunk); + if (icompute < 0) + error->all(FLERR,"Chunk/atom compute does not exist for fix momentum/chunk"); + + id_com.clear(); + id_vcm.clear(); + id_omega.clear(); + + linear = angular = rescale = 0; + + int iarg = 5; + while (iarg < narg) { + if (strcmp(arg[iarg],"linear") == 0) { + if (iarg+4 > narg) error->all(FLERR,"Illegal fix momentum command"); + linear = 1; + xflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + yflag = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + zflag = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + iarg += 4; + } else if (strcmp(arg[iarg],"angular") == 0) { + angular = 1; + iarg += 1; + } else if (strcmp(arg[iarg],"rescale") == 0) { + rescale = 1; + iarg += 1; + } else error->all(FLERR,"Illegal fix momentum/chunk command"); + } + + if (linear == 0 && angular == 0) + error->all(FLERR,"Illegal fix momentum/chunk command"); + + if (linear) + if (xflag < 0 || xflag > 1 || yflag < 0 || yflag > 1 || + zflag < 0 || zflag > 1) + error->all(FLERR,"Illegal fix momentum/chunk command"); + + dynamic_group_allow = 0; +} + +FixMomentumChunk::~FixMomentumChunk() +{ + if (!id_com.empty()) modify->delete_compute(id_com); + if (!id_vcm.empty()) modify->delete_compute(id_vcm); + if (!id_omega.empty()) modify->delete_compute(id_omega); +} + +/* ---------------------------------------------------------------------- */ + +int FixMomentumChunk::setmask() +{ + int mask = 0; + mask |= END_OF_STEP; + mask |= POST_RUN; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixMomentumChunk::init() +{ + // current indices for idchunk and idcom + + int icompute = modify->find_compute(id_chunk); + if (icompute < 0) + error->all(FLERR,"Chunk/atom compute does not exist for fix momentum/chunk"); + cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + if (strcmp(cchunk->style,"chunk/atom") != 0) + error->all(FLERR,"Fix momentum/chunk does not use chunk/atom compute"); + + // create computes dependent on chunks + + id_com = id + id_chunk + "_com"; + icompute = modify->find_compute(id_com); + if (icompute >= 0) modify->delete_compute(id_com); + auto cmd = fmt::format("{} {} com/chunk {}",id_com,group->names[igroup],id_chunk); + modify->add_compute(cmd); + icompute = modify->find_compute(id_com); + ccom = (ComputeCOMChunk *) modify->compute[icompute]; + + id_vcm = id + id_chunk + "_vcm"; + icompute = modify->find_compute(id_vcm); + if (icompute >= 0) modify->delete_compute(id_vcm); + cmd = fmt::format("{} {} vcm/chunk {}",id_vcm,group->names[igroup],id_chunk); + modify->add_compute(cmd); + icompute = modify->find_compute(id_vcm); + cvcm = modify->compute[icompute]; + + id_omega = id + id_chunk + "_omega"; + icompute = modify->find_compute(id_omega); + if (icompute >= 0) modify->delete_compute(id_omega); + cmd = fmt::format("{} {} omega/chunk {}",id_omega,group->names[igroup],id_chunk); + modify->add_compute(cmd); + icompute = modify->find_compute(id_omega); + comega = modify->compute[icompute]; +} + +/* ---------------------------------------------------------------------- */ + +void FixMomentumChunk::end_of_step() +{ + // calculate per-chunk properties. + // this will also trigger a compute/update of the chunks if needed. + + ccom->compute_array(); + cvcm->compute_array(); + comega->compute_array(); + + nchunk = cchunk->nchunk; + int *ichunk = cchunk->ichunk; + double **com = ccom->array; + double **vcm = cvcm->array; + double **omega = comega->array; + + + // apply removing translational and rotational velocity from atoms in each chunk + + double **v = atom->v; + int *mask = atom->mask; + const int nlocal = atom->nlocal; + + // compute per-chunk kinetic energy before momentum removal, if needed + + double *ke_chunk_old,*ke_chunk_new,*ke_chunk_local,*factor; + if (rescale) { + double *rmass = atom->rmass; + double *mass = atom->mass; + int *type = atom->type; + ke_chunk_old = new double[nchunk]; + ke_chunk_local = new double[nchunk]; + memset(ke_chunk_local,0,nchunk*sizeof(double)); + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + int m = ichunk[i]-1; + if (m < 0) continue; + + if (rmass) + ke_chunk_local[m] += rmass[i] * + (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]); + else + ke_chunk_local[m] += mass[type[i]] * + (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]); + } + } + MPI_Allreduce(ke_chunk_local,ke_chunk_old,nchunk,MPI_DOUBLE,MPI_SUM,world); + } + + if (linear) { + + // adjust velocities by vcm to zero linear momentum + // only adjust a component if flag is set + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + int m = ichunk[i]-1; + if (m < 0) continue; + if (xflag) v[i][0] -= vcm[m][0]; + if (yflag) v[i][1] -= vcm[m][1]; + if (zflag) v[i][2] -= vcm[m][2]; + } + } + } + + if (angular) { + + // adjust velocities to zero omega + // vnew_i = v_i - w x r_i + // must use unwrapped coords to compute r_i correctly + + double **x = atom->x; + imageint *image = atom->image; + double dx,dy,dz; + double unwrap[3]; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + int m = ichunk[i]-1; + if (m < 0) continue; + domain->unmap(x[i],image[i],unwrap); + dx = unwrap[0] - com[m][0]; + dy = unwrap[1] - com[m][1]; + dz = unwrap[2] - com[m][2]; + v[i][0] -= omega[m][1]*dz - omega[m][2]*dy; + v[i][1] -= omega[m][2]*dx - omega[m][0]*dz; + v[i][2] -= omega[m][0]*dy - omega[m][1]*dx; + } + } + } + + // compute kinetic energy after momentum removal, if needed + + if (rescale) { + double *rmass = atom->rmass; + double *mass = atom->mass; + int *type = atom->type; + ke_chunk_new = new double[nchunk]; + factor = new double[nchunk]; + memset(ke_chunk_local,0,nchunk*sizeof(double)); + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + int m = ichunk[i]-1; + if (m < 0) continue; + + if (rmass) + ke_chunk_local[m] += rmass[i] * + (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]); + else + ke_chunk_local[m] += mass[type[i]] * + (v[i][0]*v[i][0] + v[i][1]*v[i][1] + v[i][2]*v[i][2]); + } + } + MPI_Allreduce(ke_chunk_local,ke_chunk_new,nchunk,MPI_DOUBLE,MPI_SUM,world); + + // get scaling factors + + for (int m = 0; m < nchunk; ++m) + factor[m] = (ke_chunk_new[0] > 0.0) ? sqrt(ke_chunk_old[m]/ke_chunk_new[m]) : 1.0; + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + int m = ichunk[i]-1; + if (m < 0) continue; + v[i][0] *= factor[m]; + v[i][1] *= factor[m]; + v[i][2] *= factor[m]; + } + } + delete[] factor; + delete[] ke_chunk_local; + delete[] ke_chunk_old; + delete[] ke_chunk_new; + } +} + +/* ---------------------------------------------------------------------- */ + +void FixMomentumChunk::post_run() +{ + modify->delete_compute(id_com); + modify->delete_compute(id_vcm); + modify->delete_compute(id_omega); + id_com.clear(); + id_vcm.clear(); + id_omega.clear(); +} diff --git a/src/USER-MISC/fix_momentum_chunk.h b/src/USER-MISC/fix_momentum_chunk.h new file mode 100644 index 0000000000..5007e38c69 --- /dev/null +++ b/src/USER-MISC/fix_momentum_chunk.h @@ -0,0 +1,63 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(momentum/chunk,FixMomentumChunk) + +#else + +#ifndef LMP_FIX_MOMENTUM_CHUNK_H +#define LMP_FIX_MOMENTUM_CHUNK_H + +#include "fix.h" + + +namespace LAMMPS_NS { + +class FixMomentumChunk : public Fix { + public: + FixMomentumChunk(class LAMMPS *, int, char **); + virtual ~FixMomentumChunk(); + int setmask(); + void init(); + void end_of_step(); + void post_run(); + + protected: + std::string id_chunk,id_com,id_vcm,id_omega; + int nchunk,linear,angular,rescale; + int xflag,yflag,zflag; + + class ComputeChunkAtom *cchunk; + class Compute *ccom,*cvcm,*comega; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Fix momentum group has no atoms + +Self-explanatory. + +*/ diff --git a/src/USER-MISC/fix_npt_cauchy.cpp b/src/USER-MISC/fix_npt_cauchy.cpp index 067bad47ef..a613ceb9be 100644 --- a/src/USER-MISC/fix_npt_cauchy.cpp +++ b/src/USER-MISC/fix_npt_cauchy.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include #include "fix_npt_cauchy.h" #include "math_extra.h" @@ -53,10 +53,10 @@ enum{ISO,ANISO,TRICLINIC}; FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL), id_store(NULL),init_store(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr), id_store(nullptr),init_store(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix npt/cauchy command"); @@ -134,10 +134,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"temp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (t_start <= 0.0 || t_stop <= 0.0) error->all(FLERR, "Target temperature for fix npt/cauchy cannot be 0.0"); @@ -146,10 +146,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"iso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -159,10 +159,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"aniso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); pcouple = NONE; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -173,15 +173,15 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); pcouple = NONE; scalexy = scalexz = scaleyz = 0; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_start[3] = p_start[4] = p_start[5] = 0.0; p_stop[3] = p_stop[4] = p_stop[5] = 0.0; p_period[3] = p_period[4] = p_period[5] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = p_flag[4] = p_flag[5] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -194,25 +194,25 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : iarg += 4; } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; deviatoric_flag = 1; iarg += 4; @@ -221,9 +221,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[3] = force->numeric(FLERR,arg[iarg+1]); - p_stop[3] = force->numeric(FLERR,arg[iarg+2]); - p_period[3] = force->numeric(FLERR,arg[iarg+3]); + p_start[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[3] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = 1; deviatoric_flag = 1; scaleyz = 0; @@ -232,9 +232,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix npt/cauchy command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[4] = force->numeric(FLERR,arg[iarg+1]); - p_stop[4] = force->numeric(FLERR,arg[iarg+2]); - p_period[4] = force->numeric(FLERR,arg[iarg+3]); + p_start[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[4] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[4] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[4] = 1; deviatoric_flag = 1; scalexz = 0; @@ -243,9 +243,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix npt/cauchy command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - p_start[5] = force->numeric(FLERR,arg[iarg+1]); - p_stop[5] = force->numeric(FLERR,arg[iarg+2]); - p_period[5] = force->numeric(FLERR,arg[iarg+3]); + p_start[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[5] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[5] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[5] = 1; deviatoric_flag = 1; scalexy = 0; @@ -263,7 +263,7 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"drag") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - drag = force->numeric(FLERR,arg[iarg+1]); + drag = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (drag < 0.0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"dilate") == 0) { @@ -283,14 +283,14 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"tchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - mtchain = force->inumeric(FLERR,arg[iarg+1]); + mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; if (mtchain < 1) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - mpchain = force->inumeric(FLERR,arg[iarg+1]); + mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mpchain < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { @@ -301,17 +301,17 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - nc_tchain = force->inumeric(FLERR,arg[iarg+1]); + nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_tchain < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - nc_pchain = force->inumeric(FLERR,arg[iarg+1]); + nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_pchain < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - nreset_h0 = force->inumeric(FLERR,arg[iarg+1]); + nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nreset_h0 < 0) error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { @@ -347,7 +347,7 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix npt/cauchy command"); iarg += 2; } else if (strcmp(arg[iarg],"alpha") == 0) { - alpha = force->numeric(FLERR,arg[iarg+1]); + alpha = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"continue") == 0) { if (strcmp(arg[iarg+1],"yes") != 0 && strcmp(arg[iarg+1],"no") != 0) @@ -357,9 +357,9 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix npt/cauchy command"); - fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]); - fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]); - fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]); + fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; // disc keyword is also parsed in fix/nh/sphere @@ -583,10 +583,10 @@ FixNPTCauchy::FixNPTCauchy(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -794,7 +794,7 @@ void FixNPTCauchy::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -821,7 +821,7 @@ void FixNPTCauchy::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1812,7 +1812,7 @@ void *FixNPTCauchy::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-MISC/fix_nvk.cpp b/src/USER-MISC/fix_nvk.cpp index 410a269f8c..f0fbddf18d 100644 --- a/src/USER-MISC/fix_nvk.cpp +++ b/src/USER-MISC/fix_nvk.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_nvk.h" -#include + #include #include #include "atom.h" diff --git a/src/USER-MISC/fix_orient_eco.cpp b/src/USER-MISC/fix_orient_eco.cpp index add32e7215..2d8d16e405 100644 --- a/src/USER-MISC/fix_orient_eco.cpp +++ b/src/USER-MISC/fix_orient_eco.cpp @@ -16,13 +16,10 @@ ------------------------------------------------------------------------- */ #include "fix_orient_eco.h" -#include -#include -#include + #include "atom.h" #include "citeme.h" #include "comm.h" -#include "domain.h" #include "error.h" #include "force.h" #include "math_const.h" @@ -33,8 +30,9 @@ #include "pair.h" #include "respa.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -63,7 +61,7 @@ struct FixOrientECO::Nbr { FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - dir_filename(NULL), order(NULL), nbr(NULL), list(NULL) + dir_filename(nullptr), order(nullptr), nbr(nullptr), list(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_orient_eco); @@ -82,10 +80,10 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : peratom_freq = 1; // // parse input parameters - u_0 = force->numeric(FLERR, arg[3]); + u_0 = utils::numeric(FLERR, arg[3],false,lmp); sign = (u_0 >= 0.0 ? 1 : -1); - eta = force->numeric(FLERR, arg[4]); - r_cut = force->numeric(FLERR, arg[5]); + eta = utils::numeric(FLERR, arg[4],false,lmp); + r_cut = utils::numeric(FLERR, arg[5],false,lmp); // read reference orientations from file // work on rank 0 only @@ -97,8 +95,8 @@ FixOrientECO::FixOrientECO(LAMMPS *lmp, int narg, char **arg) : char *result; int count; - FILE *infile = force->open_potential(dir_filename); - if (infile == NULL) + FILE *infile = utils::open_potential(dir_filename,lmp,nullptr); + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open fix orient/eco file {}: {}", dir_filename, utils::getsyserror())); for (int i = 0; i < 6; ++i) { diff --git a/src/USER-MISC/fix_pafi.cpp b/src/USER-MISC/fix_pafi.cpp new file mode 100644 index 0000000000..4b107c6486 --- /dev/null +++ b/src/USER-MISC/fix_pafi.cpp @@ -0,0 +1,736 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------ + Contributing authors: Thomas Swinburne (CNRS & CINaM, Marseille, France) + + Please cite the related publication: + T.D. Swinburne and M.-C. Marinica, Unsupervised calculation of free energy barriers in large crystalline systems, Physical Review Letters 2018 +------------------------------------------------------------------------- */ + + +#include "fix_pafi.h" + +#include "atom.h" +#include "citeme.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "modify.h" +#include "random_mars.h" +#include "respa.h" +#include "update.h" + +#include +#include + +using namespace LAMMPS_NS; + +static const char cite_fix_pafi_package[] = + "citation for fix pafi:\n\n" + "@article{SwinburneMarinica2018,\n" + "author={T. D. Swinburne and M. C. Marinica},\n" + "title={Unsupervised calculation of free energy barriers in large " + "crystalline systems},\n" + "journal={Physical Review Letters},\n" + "volume={120},\n" + "number={13},\n" + "pages={135503},\n" + "year={2018},\n" + "publisher={APS}\n}\n" + "Recommended to be coupled with PAFI++ code:\n" + "https://github.com/tomswinburne/pafi\n"; + +using namespace FixConst; + +/* ---------------------------------------------------------------------- */ + +FixPAFI::FixPAFI(LAMMPS *lmp, int narg, char **arg) : + Fix(lmp, narg, arg), computename(nullptr), random(nullptr), + h(nullptr), step_respa(nullptr) +{ + if (lmp->citeme) lmp->citeme->add(cite_fix_pafi_package); + + if (narg < 11) error->all(FLERR,"Illegal fix pafi command"); + + dynamic_group_allow = 0; + vector_flag = 1; + size_vector = 5; + global_freq = 1; + extvector = 0; + od_flag = 0; + com_flag = 1; + time_integrate = 1; + + int n = strlen(arg[3])+1; + computename = new char[n]; + strcpy(computename,&arg[3][0]); + + icompute = modify->find_compute(computename); + if (icompute == -1) + error->all(FLERR,"Compute ID for fix pafi does not exist"); + PathCompute = modify->compute[icompute]; + if (PathCompute->peratom_flag==0) + error->all(FLERR,"Compute for fix pafi does not calculate a local array"); + if (PathCompute->size_peratom_cols < 9) + error->all(FLERR,"Compute for fix pafi must have 9 fields per atom"); + + if (comm->me==0) + utils::logmesg(lmp,fmt::format("fix pafi compute name,style: {},{}\n",computename,PathCompute->style)); + + respa_level_support = 1; + ilevel_respa = nlevels_respa = 0; + + temperature = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); + // TODO UNITS + gamma = 1. / t_period / force->ftm2v; + sqrtD = sqrt(1.) * sqrt(24.0*force->boltz/t_period/update->dt/force->mvv2e*temperature) / force->ftm2v; + + // optional args + int iarg = 7; + while (iarg < narg) { + if (strcmp(arg[iarg],"overdamped") == 0) { + if (strcmp(arg[iarg+1],"no") == 0) od_flag = 0; + else if (strcmp(arg[iarg+1],"0") == 0) od_flag = 0; + else if (strcmp(arg[iarg+1],"yes") == 0) od_flag = 1; + else if (strcmp(arg[iarg+1],"1") == 0) od_flag = 1; + iarg += 2; + } else if (strcmp(arg[iarg],"com") == 0) { + if (strcmp(arg[iarg+1],"no") == 0) com_flag = 0; + else if (strcmp(arg[iarg+1],"0") == 0) com_flag = 0; + else if (strcmp(arg[iarg+1],"yes") == 0) com_flag = 1; + else if (strcmp(arg[iarg+1],"1") == 0) com_flag = 1; + iarg += 2; + } else error->all(FLERR,"Illegal fix pafi command"); + } + force_flag = 0; + + for (int i = 0; i < 10; i++) { + c_v[i] = 0.; + c_v_all[i] = 0.; + } + for (int i=0; i<6; i++) { + proj[i] = 0.0; + proj_all[i] = 0.0; + } + for (int i=0; i<5; i++) { + results[i] = 0.0; + results_all[i] = 0.0; + } + maxatom = 1; + memory->create(h,maxatom,3,"FixPAFI:h"); + + // initialize Marsaglia RNG with processor-unique seed + random = new RanMars(lmp,seed + comm->me); + +} + +/* ---------------------------------------------------------------------- */ + +FixPAFI::~FixPAFI() +{ + if (copymode) return; + delete random; + delete [] computename; + memory->destroy(h); +} + +/* ---------------------------------------------------------------------- */ + +int FixPAFI::setmask() +{ + int mask = 0; + mask |= POST_FORCE; + mask |= POST_FORCE_RESPA; + mask |= MIN_POST_FORCE; + mask |= INITIAL_INTEGRATE; + // nve + mask |= FINAL_INTEGRATE; + mask |= INITIAL_INTEGRATE_RESPA; + mask |= FINAL_INTEGRATE_RESPA; + return mask; +} + +/* ---------------------------------------------------------------------- */ + +void FixPAFI::init() +{ + dtv = update->dt; + dtf = 0.5 * update->dt * force->ftm2v; + + icompute = modify->find_compute(computename); + if (icompute == -1) + error->all(FLERR,"Compute ID for fix pafi does not exist"); + PathCompute = modify->compute[icompute]; + if (PathCompute->peratom_flag==0) + error->all(FLERR,"Compute for fix pafi does not calculate a local array"); + if (PathCompute->size_peratom_cols < 9) + error->all(FLERR,"Compute for fix pafi must have 9 fields per atom"); + + + if (strstr(update->integrate_style,"respa")) { + step_respa = ((Respa *) update->integrate)->step; // nve + nlevels_respa = ((Respa *) update->integrate)->nlevels; + if (respa_level >= 0) ilevel_respa = MIN(respa_level,nlevels_respa-1); + else ilevel_respa = nlevels_respa-1; + } + +} + +void FixPAFI::setup(int vflag) +{ + if (strstr(update->integrate_style,"verlet")) + post_force(vflag); + else + for (int ilevel = 0; ilevel < nlevels_respa; ilevel++) { + ((Respa *) update->integrate)->copy_flevel_f(ilevel); + post_force_respa(vflag,ilevel,0); + ((Respa *) update->integrate)->copy_f_flevel(ilevel); + } +} + +void FixPAFI::min_setup(int vflag) +{ + if (utils::strmatch(update->minimize_style,"^fire")==0 && + utils::strmatch(update->minimize_style,"^quickmin")==0 ) + error->all(FLERR,"fix pafi requires a damped dynamics minimizer"); + min_post_force(vflag); +} + + +void FixPAFI::post_force(int /*vflag*/) +{ + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + double *rmass = atom->rmass; + double *mass = atom->mass; + int *type = atom->type; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + // reallocate norm array if necessary + if (atom->nmax > maxatom) { + maxatom = atom->nmax; + memory->destroy(h); + memory->create(h,maxatom,3,"FixPAFI:h"); + } + + PathCompute->compute_peratom(); + double **path = PathCompute->array_atom; + + // proj 0,1,2 = f.n, v.n, h.n + // proj 3,4,5 = psi, f.n**2, f*(1-psi) + // c_v 0,1,2 = fxcom, fycom, fzcom etc + for (int i = 0; i < 10; i++) { + c_v[i] = 0.; + c_v_all[i] = 0.; + } + for (int i = 0; i < 6; i++) { + proj[i] = 0.; + proj_all[i] = 0.; + } + + double deviation[3] = {0.,0.,0.}; + + force_flag=0; + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + h[i][0] = random->uniform() - 0.5; + h[i][1] = random->uniform() - 0.5; + h[i][2] = random->uniform() - 0.5; + + proj[0] += f[i][0] * path[i][3]; // f.n + proj[0] += f[i][1] * path[i][4]; // f.n + proj[0] += f[i][2] * path[i][5]; // f.n + + proj[1] += v[i][0] * path[i][3]; // v.n + proj[1] += v[i][1] * path[i][4]; // v.n + proj[1] += v[i][2] * path[i][5]; // v.n + + proj[2] += h[i][0] * path[i][3]; // h.n + proj[2] += h[i][1] * path[i][4]; // h.n + proj[2] += h[i][2] * path[i][5]; // h.n + + deviation[0] = x[i][0]-path[i][0]; // x-path + deviation[1] = x[i][1]-path[i][1]; // x-path + deviation[2] = x[i][2]-path[i][2]; // x-path + domain->minimum_image(deviation); + + proj[3] += path[i][6]*deviation[0]; // (x-path).dn/nn = psi + proj[3] += path[i][7]*deviation[1]; // (x-path).dn/nn = psi + proj[3] += path[i][8]*deviation[2]; // (x-path).dn/nn = psi + + proj[4] += path[i][3]*deviation[0]; // (x-path).n + proj[4] += path[i][4]*deviation[1]; // (x-path).n + proj[4] += path[i][5]*deviation[2]; // (x-path).n + + proj[5] += f[i][3]*deviation[0]; // (x-path).f + proj[5] += f[i][4]*deviation[1]; // (x-path).f + proj[5] += f[i][5]*deviation[2]; // (x-path).f + + } + } + + if (com_flag == 0){ + c_v[9] += 1.0; + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + c_v[0] += f[i][0]; + c_v[1] += f[i][1]; + c_v[2] += f[i][2]; + + c_v[3] += v[i][0]; + c_v[4] += v[i][1]; + c_v[5] += v[i][2]; + + c_v[6] += h[i][0]; + c_v[7] += h[i][1]; + c_v[8] += h[i][2]; + + c_v[9] += 1.0; + } + } + MPI_Allreduce(proj,proj_all,6,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(c_v,c_v_all,10,MPI_DOUBLE,MPI_SUM,world); + + // results - f.n*(1-psi), (f.n)^2*(1-psi)^2, 1-psi, dX.n + results_all[0] = proj_all[0] * (1.-proj_all[3]); + results_all[1] = results_all[0] * results_all[0]; + results_all[2] = 1.-proj_all[3]; + results_all[3] = fabs(proj_all[4]); + results_all[4] = proj_all[5]; // dX.f + force_flag = 1; + + for (int i = 0; i < nlocal; i++){ + if (mask[i] & groupbit) { + + f[i][0] -= proj_all[0] * path[i][3] + c_v_all[0]/c_v_all[9]; + f[i][1] -= proj_all[0] * path[i][4] + c_v_all[1]/c_v_all[9]; + f[i][2] -= proj_all[0] * path[i][5] + c_v_all[2]/c_v_all[9]; + + v[i][0] -= proj_all[1] * path[i][3] + c_v_all[3]/c_v_all[9]; + v[i][1] -= proj_all[1] * path[i][4] + c_v_all[4]/c_v_all[9]; + v[i][2] -= proj_all[1] * path[i][5] + c_v_all[5]/c_v_all[9]; + + h[i][0] -= proj_all[2] * path[i][3] + c_v_all[6]/c_v_all[9]; + h[i][1] -= proj_all[2] * path[i][4] + c_v_all[7]/c_v_all[9]; + h[i][2] -= proj_all[2] * path[i][5] + c_v_all[8]/c_v_all[9]; + } + } + + if (od_flag == 0) { + for (int i = 0; i < nlocal; i++){ + if (mask[i] & groupbit) { + if (rmass) mass_f = sqrt(rmass[i]); + else mass_f = sqrt(mass[type[i]]); + + f[i][0] += -gamma * mass_f * mass_f * v[i][0]; + f[i][1] += -gamma * mass_f * mass_f * v[i][1]; + f[i][2] += -gamma * mass_f * mass_f * v[i][2]; + + f[i][0] += sqrtD * mass_f * h[i][0]; + f[i][1] += sqrtD * mass_f * h[i][1]; + f[i][2] += sqrtD * mass_f * h[i][2]; + } + } + } else { + for (int i = 0; i < nlocal; i++){ + if (mask[i] & groupbit) { + + if (rmass) mass_f = sqrt(rmass[i]); + else mass_f = sqrt(mass[type[i]]); + + f[i][0] += sqrtD * h[i][0] * mass_f; + f[i][1] += sqrtD * h[i][1] * mass_f; + f[i][2] += sqrtD * h[i][2] * mass_f; + + f[i][0] /= gamma * mass_f * mass_f; + f[i][1] /= gamma * mass_f * mass_f; + f[i][2] /= gamma * mass_f * mass_f; + + } + } + } + +}; + +void FixPAFI::post_force_respa(int vflag, int ilevel, int /*iloop*/) +{ + // set force to desired value on requested level, 0.0 on other levels + + if (ilevel == ilevel_respa) post_force(vflag); + else { + double **f = atom->f; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + for (int k = 0; k < 3; k++) f[i][k] = 0.0; + } + } +}; + +void FixPAFI::min_post_force(int /*vflag*/) +{ + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + int *mask = atom->mask; + int nlocal = atom->nlocal; + + PathCompute->compute_peratom(); + double **path = PathCompute->array_atom; + + // proj 0,1,2 = f.n, v.n, h.n + // proj 3,4,5 = psi, f.n**2, f*(1-psi) + // c_v 0,1,2 = fxcom, fycom, fzcom etc + for (int i = 0; i < 10; i++) { + c_v[i] = 0.; + c_v_all[i] = 0.; + } + for (int i = 0; i < 6; i++) { + proj[i] = 0.; + proj_all[i] = 0.; + } + + double deviation[3] = {0.,0.,0.}; + + force_flag=0; + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + + proj[0] += f[i][0] * path[i][3]; // f.n + proj[0] += f[i][1] * path[i][4]; // f.n + proj[0] += f[i][2] * path[i][5]; // f.n + + proj[1] += v[i][0] * path[i][3]; // v.n + proj[1] += v[i][1] * path[i][4]; // v.n + proj[1] += v[i][2] * path[i][5]; // v.n + + proj[2] += h[i][0] * path[i][3]; // h.n + proj[2] += h[i][1] * path[i][4]; // h.n + proj[2] += h[i][2] * path[i][5]; // h.n + + deviation[0] = x[i][0]-path[i][0]; // x-path + deviation[1] = x[i][1]-path[i][1]; // x-path + deviation[2] = x[i][2]-path[i][2]; // x-path + domain->minimum_image(deviation); + + proj[3] += path[i][6]*deviation[0]; // (x-path).dn/nn = psi + proj[3] += path[i][7]*deviation[1]; // (x-path).dn/nn = psi + proj[3] += path[i][8]*deviation[2]; // (x-path).dn/nn = psi + + proj[4] += path[i][3]*deviation[0]; // (x-path).n + proj[4] += path[i][4]*deviation[1]; // (x-path).n + proj[4] += path[i][5]*deviation[2]; // (x-path).n + + proj[5] += f[i][3]*deviation[0]; // (x-path).f + proj[5] += f[i][4]*deviation[1]; // (x-path).f + proj[5] += f[i][5]*deviation[2]; // (x-path).f + + } + } + + if (com_flag == 0){ + c_v[9] += 1.0; + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + c_v[0] += f[i][0]; + c_v[1] += f[i][1]; + c_v[2] += f[i][2]; + + c_v[3] += v[i][0]; + c_v[4] += v[i][1]; + c_v[5] += v[i][2]; + + c_v[6] += h[i][0]; + c_v[7] += h[i][1]; + c_v[8] += h[i][2]; + + c_v[9] += 1.0; + } + } + MPI_Allreduce(proj,proj_all,6,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(c_v,c_v_all,10,MPI_DOUBLE,MPI_SUM,world); + + results_all[0] = proj_all[0] * (1.-proj_all[3]); // f.n * psi + results_all[1] = results_all[0] * results_all[0]; // (f.n * psi)^2 + results_all[2] = 1.-proj_all[3]; // psi + results_all[3] = fabs(proj_all[4]); // dX.n + results_all[4] = proj_all[5]; // dX.f + + MPI_Bcast(results_all,5,MPI_DOUBLE,0,world); + force_flag = 1; + + for (int i = 0; i < nlocal; i++){ + if (mask[i] & groupbit) { + + f[i][0] -= proj_all[0] * path[i][3] + c_v_all[0]/c_v_all[9]; + f[i][1] -= proj_all[0] * path[i][4] + c_v_all[1]/c_v_all[9]; + f[i][2] -= proj_all[0] * path[i][5] + c_v_all[2]/c_v_all[9]; + + v[i][0] -= proj_all[1] * path[i][3] + c_v_all[3]/c_v_all[9]; + v[i][1] -= proj_all[1] * path[i][4] + c_v_all[4]/c_v_all[9]; + v[i][2] -= proj_all[1] * path[i][5] + c_v_all[5]/c_v_all[9]; + + } + } +}; + +double FixPAFI::compute_vector(int n) +{ + return results_all[n]; +}; + + + +void FixPAFI::initial_integrate(int /*vflag*/) +{ + double dtfm; + + // update v and x of atoms in group + + double **x = atom->x; + double **v = atom->v; + double **f = atom->f; + + double *rmass = atom->rmass; + double *mass = atom->mass; + int *type = atom->type; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + PathCompute->compute_peratom(); + double **path = PathCompute->array_atom; + + for (int i = 0; i < 10; i++) { + c_v[i] = 0.; + c_v_all[i] = 0.; + } + for (int i = 0; i < 6; i++) { + proj[i] = 0.; + proj_all[i] = 0.; + } + + for (int i = 0; i < nlocal; i++) { + if (mask[i] & groupbit) { + proj[0] += f[i][0] * path[i][3]; // f.n + proj[0] += f[i][1] * path[i][4]; // f.n + proj[0] += f[i][2] * path[i][5]; // f.n + + proj[1] += v[i][0] * path[i][3]; // v.n + proj[1] += v[i][1] * path[i][4]; // v.n + proj[1] += v[i][2] * path[i][5]; // v.n + } + } + if (com_flag == 0){ + c_v[9] += 1.0; + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + + c_v[0] += v[i][0]; + c_v[1] += v[i][1]; + c_v[2] += v[i][2]; + + c_v[3] += f[i][0]; + c_v[4] += f[i][1]; + c_v[5] += f[i][2]; + + c_v[9] += 1.0; + } + } + + + MPI_Allreduce(proj,proj_all,5,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(c_v,c_v_all,10,MPI_DOUBLE,MPI_SUM,world); + + if (od_flag == 0){ + if (rmass) { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / rmass[i]; + v[i][0] += dtfm * (f[i][0]-path[i][3]*proj_all[0] - c_v_all[3]/c_v_all[9]); + v[i][1] += dtfm * (f[i][1]-path[i][4]*proj_all[0] - c_v_all[4]/c_v_all[9]); + v[i][2] += dtfm * (f[i][2]-path[i][5]*proj_all[0] - c_v_all[5]/c_v_all[9]); + x[i][0] += dtv * (v[i][0]-path[i][3]*proj_all[1] - c_v_all[0]/c_v_all[9]); + x[i][1] += dtv * (v[i][1]-path[i][4]*proj_all[1] - c_v_all[1]/c_v_all[9]); + x[i][2] += dtv * (v[i][2]-path[i][5]*proj_all[1] - c_v_all[2]/c_v_all[9]); + } + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / mass[type[i]]; + v[i][0] += dtfm * (f[i][0]-path[i][3]*proj_all[0] - c_v_all[3]/c_v_all[9]); + v[i][1] += dtfm * (f[i][1]-path[i][4]*proj_all[0] - c_v_all[4]/c_v_all[9]); + v[i][2] += dtfm * (f[i][2]-path[i][5]*proj_all[0] - c_v_all[5]/c_v_all[9]); + x[i][0] += dtv * (v[i][0]-path[i][3]*proj_all[1] - c_v_all[0]/c_v_all[9]); + x[i][1] += dtv * (v[i][1]-path[i][4]*proj_all[1] - c_v_all[1]/c_v_all[9]); + x[i][2] += dtv * (v[i][2]-path[i][5]*proj_all[1] - c_v_all[2]/c_v_all[9]); + } + } + } else { + if (rmass) { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / rmass[i]; + v[i][0] = 0.; + v[i][1] = 0.; + v[i][2] = 0.; + x[i][0] += dtv * (f[i][0]-path[i][3]*proj_all[0] - c_v_all[3]/c_v_all[9]); + x[i][1] += dtv * (f[i][1]-path[i][4]*proj_all[0] - c_v_all[4]/c_v_all[9]); + x[i][2] += dtv * (f[i][2]-path[i][5]*proj_all[0] - c_v_all[5]/c_v_all[9]); + } + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / mass[type[i]]; + v[i][0] = 0.; + v[i][1] = 0.; + v[i][2] = 0.; + x[i][0] += dtv * (f[i][0]-path[i][3]*proj_all[0] - c_v_all[3]/c_v_all[9]); + x[i][1] += dtv * (f[i][1]-path[i][4]*proj_all[0] - c_v_all[4]/c_v_all[9]); + x[i][2] += dtv * (f[i][2]-path[i][5]*proj_all[0] - c_v_all[5]/c_v_all[9]); + } + } + } +}; + +/* ---------------------------------------------------------------------- */ + +void FixPAFI::final_integrate() +{ + double dtfm; + + // update v of atoms in group + double **v = atom->v; + double **f = atom->f; + double *rmass = atom->rmass; + double *mass = atom->mass; + int *type = atom->type; + int *mask = atom->mask; + int nlocal = atom->nlocal; + if (igroup == atom->firstgroup) nlocal = atom->nfirst; + + PathCompute->compute_peratom(); + double **path = PathCompute->array_atom; + + for (int i = 0; i < 10; i++) { + c_v[i] = 0.; + c_v_all[i] = 0.; + } + for (int i = 0; i < 6; i++) { + proj[i] = 0.; + proj_all[i] = 0.; + } + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + proj[0] += f[i][0] * path[i][3]; // f.n + proj[0] += f[i][1] * path[i][4]; // f.n + proj[0] += f[i][2] * path[i][5]; // f.n + } + if (com_flag == 0){ + c_v[9] += 1.0; + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + c_v[3] += f[i][0]; + c_v[4] += f[i][1]; + c_v[5] += f[i][2]; + c_v[9] += 1.0; + } + } + + MPI_Allreduce(proj,proj_all,5,MPI_DOUBLE,MPI_SUM,world); + MPI_Allreduce(c_v,c_v_all,10,MPI_DOUBLE,MPI_SUM,world); + + if (od_flag == 0){ + if (rmass) { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / rmass[i]; + v[i][0] += dtfm * (f[i][0]-path[i][3]*proj_all[0] - c_v_all[3]/c_v_all[9]); + v[i][1] += dtfm * (f[i][1]-path[i][4]*proj_all[0] - c_v_all[4]/c_v_all[9]); + v[i][2] += dtfm * (f[i][2]-path[i][5]*proj_all[0] - c_v_all[5]/c_v_all[9]); + } + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + dtfm = dtf / mass[type[i]]; + v[i][0] += dtfm * (f[i][0]-path[i][3]*proj_all[0] - c_v_all[3]/c_v_all[9]); + v[i][1] += dtfm * (f[i][1]-path[i][4]*proj_all[0] - c_v_all[4]/c_v_all[9]); + v[i][2] += dtfm * (f[i][2]-path[i][5]*proj_all[0] - c_v_all[5]/c_v_all[9]); + } + } + } else { + for (int i = 0; i < nlocal; i++) + if (mask[i] & groupbit) { + v[i][0] = 0.; + v[i][1] = 0.; + v[i][2] = 0.; + } + } +}; + +/* ---------------------------------------------------------------------- */ + +void FixPAFI::initial_integrate_respa(int vflag, int ilevel, int /*iloop*/) +{ + dtv = step_respa[ilevel]; + dtf = 0.5 * step_respa[ilevel] * force->ftm2v; + + // innermost level - NVE update of v and x + // all other levels - NVE update of v + + if (ilevel == 0) initial_integrate(vflag); + else final_integrate(); +}; + +/* ---------------------------------------------------------------------- */ + +void FixPAFI::final_integrate_respa(int ilevel, int /*iloop*/) +{ + dtf = 0.5 * step_respa[ilevel] * force->ftm2v; + final_integrate(); +}; + +/* ---------------------------------------------------------------------- */ + +void FixPAFI::reset_dt() +{ + dtv = update->dt; + dtf = 0.5 * update->dt * force->ftm2v; +}; + + +/* ---------------------------------------------------------------------- + memory usage of local atom-based array +------------------------------------------------------------------------- */ + +double FixPAFI::memory_usage() +{ + double bytes = 0.0; + bytes = maxatom*3 * sizeof(double); + return bytes; +}; diff --git a/src/USER-MISC/fix_pafi.h b/src/USER-MISC/fix_pafi.h new file mode 100644 index 0000000000..dd272601e6 --- /dev/null +++ b/src/USER-MISC/fix_pafi.h @@ -0,0 +1,99 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#ifdef FIX_CLASS + +FixStyle(pafi,FixPAFI) + +#else + +#ifndef LMP_FIX_PAFI_H +#define LMP_FIX_PAFI_H + +#include "fix.h" + +namespace LAMMPS_NS { + +class FixPAFI : public Fix { + public: + FixPAFI(class LAMMPS *, int, char **); + virtual ~FixPAFI(); + int setmask(); + virtual void init(); + + void setup(int); + void min_setup(int); + virtual void post_force(int); + + void post_force_respa(int, int, int); + void min_post_force(int); + double compute_vector(int); + // nve + virtual void initial_integrate(int); + virtual void final_integrate(); + virtual void initial_integrate_respa(int, int, int); + virtual void final_integrate_respa(int, int); + virtual void reset_dt(); + + double memory_usage(); + + protected: + int varflag,icompute; + char *computename; + class Compute *PathCompute; + double proj[6], proj_all[6]; // f,v,h, psi + double results[5], results_all[5]; // f.n, (f.n)**2, psi, dx.n + double c_v[10],c_v_all[10]; + double temperature,gamma,sqrtD,t_period,local_norm,mass_f; + int force_flag,od_flag,com_flag; + int nlevels_respa,ilevel_respa; + int maxatom; + class RanMars *random; + int seed; + double **h; + // nve + double dtv,dtf; + double *step_respa; + int mass_require; +}; + +} + +#endif +#endif + +/* ERROR/WARNING messages: + +E: Illegal ... command + +Self-explanatory. Check the input script syntax and compare to the +documentation for the command. You can use -echo screen as a +command-line option when running LAMMPS to see the offending line. + +E: Compute ID for fix pafi does not exist + +Self-explanatory. + +E: Compute for fix pafi does not calculate a local array + +Self-explanatory. + +E: Compute for fix pafi has < 3*DIM fields per atom + +Self-explanatory. + +E: Fix pafi requires a damped dynamics minimizer + +Use a different minimization style. + +*/ diff --git a/src/USER-MISC/fix_pimd.cpp b/src/USER-MISC/fix_pimd.cpp index 8de31f19b3..9d1eb7a39f 100644 --- a/src/USER-MISC/fix_pimd.cpp +++ b/src/USER-MISC/fix_pimd.cpp @@ -22,10 +22,10 @@ ------------------------------------------------------------------------- */ #include "fix_pimd.h" -#include + #include #include -#include + #include "universe.h" #include "comm.h" #include "force.h" @@ -87,27 +87,27 @@ FixPIMD::FixPIMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) /* Initiation */ max_nsend = 0; - tag_send = NULL; - buf_send = NULL; + tag_send = nullptr; + buf_send = nullptr; max_nlocal = 0; - buf_recv = NULL; - buf_beads = NULL; + buf_recv = nullptr; + buf_beads = nullptr; size_plan = 0; - plan_send = plan_recv = NULL; + plan_send = plan_recv = nullptr; - M_x2xp = M_xp2x = M_f2fp = M_fp2f = NULL; - lam = NULL; - mode_index = NULL; + M_x2xp = M_xp2x = M_f2fp = M_fp2f = nullptr; + lam = nullptr; + mode_index = nullptr; - mass = NULL; + mass = nullptr; - array_atom = NULL; - nhc_eta = NULL; - nhc_eta_dot = NULL; - nhc_eta_dotdot = NULL; - nhc_eta_mass = NULL; + array_atom = nullptr; + nhc_eta = nullptr; + nhc_eta_dot = nullptr; + nhc_eta_dotdot = nullptr; + nhc_eta_mass = nullptr; size_peratom_cols = 12 * nhc_nchain + 3; @@ -127,8 +127,8 @@ FixPIMD::FixPIMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) extvector = 1; comm_forward = 3; - atom->add_callback(0); // Call LAMMPS to allocate memory for per-atom array - atom->add_callback(1); // Call LAMMPS to re-assign restart-data for per-atom array + atom->add_callback(Atom::GROW); // Call LAMMPS to allocate memory for per-atom array + atom->add_callback(Atom::RESTART); // Call LAMMPS to re-assign restart-data for per-atom array grow_arrays(atom->nmax); @@ -152,7 +152,7 @@ int FixPIMD::setmask() void FixPIMD::init() { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix pimd requires an atom map, see atom_modify"); if(universe->me==0 && screen) fprintf(screen,"Fix pimd initializing Path-Integral ...\n"); @@ -601,7 +601,7 @@ void FixPIMD::comm_init() } buf_beads = new double* [np]; - for(int i=0; i -#include -#include - #include "atom.h" #include "atom_vec_ellipsoid.h" -#include "citeme.h" -#include "comm.h" #include "error.h" -#include "force.h" -#include "group.h" -#include "math.h" #include "math_const.h" #include "math_extra.h" -#include "math_vector.h" -#include "modify.h" -#include "random_mars.h" -#include "respa.h" -#include "update.h" + +#include +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -49,7 +39,7 @@ using namespace MathConst; FixPropelSelf::FixPropelSelf( LAMMPS *lmp, int narg, char **argv ) : Fix(lmp, narg, argv), magnitude(0.0), - mode(VELOCITY), n_types_filter(0), apply_to_type(NULL) + mode(VELOCITY), n_types_filter(0), apply_to_type(nullptr) { if (narg < 5) error->all(FLERR, "Illegal fix propel/self command"); @@ -82,7 +72,7 @@ FixPropelSelf::FixPropelSelf( LAMMPS *lmp, int narg, char **argv ) error->all(FLERR, msg); } - magnitude = force->numeric( FLERR, argv[4] ); + magnitude = utils::numeric( FLERR, argv[4] ,false,lmp); // Handle rest of args: @@ -100,7 +90,7 @@ FixPropelSelf::FixPropelSelf( LAMMPS *lmp, int narg, char **argv ) int flag=0; while (iarg < narg) { if (isdigit(argv[iarg][0])) { - int thistype = force->inumeric(FLERR,argv[iarg]); + int thistype = utils::inumeric(FLERR,argv[iarg],false,lmp); if ((thistype < 1) || (thistype > atom->ntypes)) error->all(FLERR,"Illegal atom type to types keyword"); apply_to_type[thistype] = 1; @@ -170,13 +160,13 @@ template void FixPropelSelf::post_force_quaternion(int /* vflag */ ) { double **f = atom->f; - AtomVecEllipsoid *av = static_cast(atom->avec); int *mask = atom->mask; int nlocal = atom->nlocal; int *type = atom->type; int* ellipsoid = atom->ellipsoid; + AtomVecEllipsoid *av = static_cast(atom->style_match("ellipsoid")); AtomVecEllipsoid::Bonus *bonus = av->bonus; // Add the active force to the atom force: diff --git a/src/USER-MISC/fix_rhok.cpp b/src/USER-MISC/fix_rhok.cpp index fb041b05cd..b088a86661 100644 --- a/src/USER-MISC/fix_rhok.cpp +++ b/src/USER-MISC/fix_rhok.cpp @@ -14,18 +14,17 @@ ------------------------------------------------------------------------- */ #include "fix_rhok.h" -#include -#include -#include #include "atom.h" +#include "citeme.h" #include "domain.h" #include "error.h" -#include "force.h" +#include "math_const.h" #include "respa.h" #include "update.h" -#include "citeme.h" -#include "math_const.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -68,16 +67,16 @@ FixRhok::FixRhok( LAMMPS* inLMP, int inArgc, char** inArgv ) // Parse fix options int n[3]; - n[0] = force->inumeric(FLERR,inArgv[3]); - n[1] = force->inumeric(FLERR,inArgv[4]); - n[2] = force->inumeric(FLERR,inArgv[5]); + n[0] = utils::inumeric(FLERR,inArgv[3],false,lmp); + n[1] = utils::inumeric(FLERR,inArgv[4],false,lmp); + n[2] = utils::inumeric(FLERR,inArgv[5],false,lmp); mK[0] = n[0]*(2*MY_PI / (domain->boxhi[0] - domain->boxlo[0])); mK[1] = n[1]*(2*MY_PI / (domain->boxhi[1] - domain->boxlo[1])); mK[2] = n[2]*(2*MY_PI / (domain->boxhi[2] - domain->boxlo[2])); - mKappa = force->numeric(FLERR,inArgv[6]); - mRhoK0 = force->numeric(FLERR,inArgv[7]); + mKappa = utils::numeric(FLERR,inArgv[6],false,lmp); + mRhoK0 = utils::numeric(FLERR,inArgv[7],false,lmp); } // Methods that this fix implements diff --git a/src/USER-MISC/fix_smd.cpp b/src/USER-MISC/fix_smd.cpp index 32c040c2b4..0dace284a9 100644 --- a/src/USER-MISC/fix_smd.cpp +++ b/src/USER-MISC/fix_smd.cpp @@ -17,17 +17,17 @@ ------------------------------------------------------------------------- */ #include "fix_smd.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "update.h" -#include "respa.h" #include "domain.h" #include "error.h" -#include "force.h" #include "group.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -64,13 +64,13 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[argoffs],"cvel") == 0) { if (narg < argoffs+3) error->all(FLERR,"Illegal fix smd command"); styleflag |= SMD_CVEL; - k_smd = force->numeric(FLERR,arg[argoffs+1]); - v_smd = force->numeric(FLERR,arg[argoffs+2]); // to be multiplied by update->dt when used. + k_smd = utils::numeric(FLERR,arg[argoffs+1],false,lmp); + v_smd = utils::numeric(FLERR,arg[argoffs+2],false,lmp); // to be multiplied by update->dt when used. argoffs += 3; } else if (strcmp(arg[argoffs],"cfor") == 0) { if (narg < argoffs+2) error->all(FLERR,"Illegal fix smd command"); styleflag |= SMD_CFOR; - f_smd = force->numeric(FLERR,arg[argoffs+1]); + f_smd = utils::numeric(FLERR,arg[argoffs+1],false,lmp); argoffs += 2; } else error->all(FLERR,"Illegal fix smd command"); @@ -78,12 +78,12 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : if (narg < argoffs+5) error->all(FLERR,"Illegal fix smd command"); styleflag |= SMD_TETHER; if (strcmp(arg[argoffs+1],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[argoffs+1]); + else xc = utils::numeric(FLERR,arg[argoffs+1],false,lmp); if (strcmp(arg[argoffs+2],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[argoffs+2]); + else yc = utils::numeric(FLERR,arg[argoffs+2],false,lmp); if (strcmp(arg[argoffs+3],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[argoffs+3]); - r0 = force->numeric(FLERR,arg[argoffs+4]); + else zc = utils::numeric(FLERR,arg[argoffs+3],false,lmp); + r0 = utils::numeric(FLERR,arg[argoffs+4],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command"); argoffs += 5; } else if (strcmp(arg[argoffs],"couple") == 0) { @@ -98,15 +98,15 @@ FixSMD::FixSMD(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[argoffs+2],"NULL") == 0) xflag = 0; else if (strcmp(arg[argoffs+2],"auto") == 0) styleflag |= SMD_AUTOX; - else xc = force->numeric(FLERR,arg[argoffs+2]); + else xc = utils::numeric(FLERR,arg[argoffs+2],false,lmp); if (strcmp(arg[argoffs+3],"NULL") == 0) yflag = 0; else if (strcmp(arg[argoffs+3],"auto") == 0) styleflag |= SMD_AUTOY; - else yc = force->numeric(FLERR,arg[argoffs+3]); + else yc = utils::numeric(FLERR,arg[argoffs+3],false,lmp); if (strcmp(arg[argoffs+4],"NULL") == 0) zflag = 0; else if (strcmp(arg[argoffs+4],"auto") == 0) styleflag |= SMD_AUTOZ; - else zc = force->numeric(FLERR,arg[argoffs+4]); + else zc = utils::numeric(FLERR,arg[argoffs+4],false,lmp); - r0 = force->numeric(FLERR,arg[argoffs+5]); + r0 = utils::numeric(FLERR,arg[argoffs+5],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix smd command"); argoffs +=6; } else error->all(FLERR,"Illegal fix smd command"); diff --git a/src/USER-MISC/fix_srp.cpp b/src/USER-MISC/fix_srp.cpp index 131fd7d27a..f0212affb2 100644 --- a/src/USER-MISC/fix_srp.cpp +++ b/src/USER-MISC/fix_srp.cpp @@ -16,19 +16,19 @@ ------------------------------------------------------------------------- */ #include "fix_srp.h" -#include + +#include "atom.h" +#include "atom_vec.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" + #include #include -#include "atom.h" -#include "force.h" -#include "domain.h" -#include "modify.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "neighbor.h" -#include "atom_vec.h" -#include "modify.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -55,13 +55,13 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // initial allocation of atom-based array // register with Atom class - array = NULL; + array = nullptr; grow_arrays(atom->nmax); // extends pack_exchange() - atom->add_callback(0); - atom->add_callback(1); // restart - atom->add_callback(2); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // restart + atom->add_callback(Atom::BORDER); // initialize to illegal values so we capture btype = -1; @@ -78,9 +78,9 @@ FixSRP::FixSRP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) FixSRP::~FixSRP() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); - atom->delete_callback(id,2); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); + atom->delete_callback(id,Atom::BORDER); memory->destroy(array); } @@ -100,7 +100,7 @@ int FixSRP::setmask() void FixSRP::init() { - if (force->pair_match("hybrid",1) == NULL && force->pair_match("hybrid/overlay",1) == NULL) + if (force->pair_match("hybrid",1) == nullptr && force->pair_match("hybrid/overlay",1) == nullptr) error->all(FLERR,"Cannot use pair srp without pair_style hybrid"); int has_rigid = 0; @@ -293,7 +293,7 @@ void FixSRP::setup_pre_force(int /*zz*/) // assign tags for new atoms, update map atom->tag_extend(); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); @@ -514,7 +514,7 @@ void FixSRP::post_run() bigint nblocal = atom->nlocal; MPI_Allreduce(&nblocal,&atom->natoms,1,MPI_LMP_BIGINT,MPI_SUM,world); - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); @@ -572,7 +572,7 @@ void FixSRP::unpack_restart(int nlocal, int nth) // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them - + int m = 0; for (int i = 0; i < nth; i++){ m += static_cast (extra[nlocal][m]); @@ -642,11 +642,11 @@ void FixSRP::restart(char *buf) int FixSRP::modify_param(int /*narg*/, char **arg) { if (strcmp(arg[0],"btype") == 0) { - btype = force->inumeric(FLERR,arg[1]); + btype = utils::inumeric(FLERR,arg[1],false,lmp); return 2; } if (strcmp(arg[0],"bptype") == 0) { - bptype = force->inumeric(FLERR,arg[1]); + bptype = utils::inumeric(FLERR,arg[1],false,lmp); return 2; } return 0; diff --git a/src/USER-MISC/fix_ti_spring.cpp b/src/USER-MISC/fix_ti_spring.cpp index 1f7c84b746..ceed99273e 100644 --- a/src/USER-MISC/fix_ti_spring.cpp +++ b/src/USER-MISC/fix_ti_spring.cpp @@ -19,16 +19,16 @@ ------------------------------------------------------------------------- */ #include "fix_ti_spring.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "domain.h" -#include "respa.h" -#include "memory.h" -#include "error.h" #include "citeme.h" -#include "force.h" +#include "domain.h" +#include "error.h" +#include "memory.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -69,15 +69,15 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : time_depend = 1; // Spring constant. - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); if (k <= 0.0) error->all(FLERR,"Illegal fix ti/spring command"); // Perform initial allocation of atom-based array // Register with Atom class - xoriginal = NULL; + xoriginal = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // xoriginal = initial unwrapped positions of atoms @@ -93,15 +93,15 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : // Time variables. t0 = update->ntimestep; // timestep of original/starting coordinates - t_switch = force->bnumeric(FLERR,arg[4]); // Number of steps for switching - t_equil = force->bnumeric(FLERR,arg[5]); // Number of steps for equilibration + t_switch = utils::bnumeric(FLERR,arg[4],false,lmp); // Number of steps for switching + t_equil = utils::bnumeric(FLERR,arg[5],false,lmp); // Number of steps for equilibration if ((t_switch <= 0) || (t_equil < 0)) error->all(FLERR,"Illegal fix ti/spring command"); // Coupling parameter initialization sf = 1; if (narg > 6) { - if (strcmp(arg[6], "function") == 0) sf = force->inumeric(FLERR,arg[7]); + if (strcmp(arg[6], "function") == 0) sf = utils::inumeric(FLERR,arg[7],false,lmp); else error->all(FLERR,"Illegal fix ti/spring switching function"); if ((sf!=1) && (sf!=2)) error->all(FLERR,"Illegal fix ti/spring switching function"); @@ -117,8 +117,8 @@ FixTISpring::FixTISpring(LAMMPS *lmp, int narg, char **arg) : FixTISpring::~FixTISpring() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored array memory->destroy(xoriginal); diff --git a/src/USER-MISC/fix_ttm_mod.cpp b/src/USER-MISC/fix_ttm_mod.cpp index aaeab5989a..9d8d8f5ea7 100644 --- a/src/USER-MISC/fix_ttm_mod.cpp +++ b/src/USER-MISC/fix_ttm_mod.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "fix_ttm_mod.h" -#include + #include #include #include "atom.h" @@ -32,8 +32,8 @@ #include "error.h" #include "citeme.h" #include "math_const.h" -#include "utils.h" -#include "fmt/format.h" + + #include "tokenizer.h" using namespace LAMMPS_NS; @@ -67,11 +67,11 @@ static const char cite_fix_ttm_mod[] = FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - random(NULL), fp(NULL), nsum(NULL), nsum_all(NULL), - gfactor1(NULL), gfactor2(NULL), ratio(NULL), flangevin(NULL), - T_electron(NULL), T_electron_old(NULL), sum_vsq(NULL), sum_mass_vsq(NULL), - sum_vsq_all(NULL), sum_mass_vsq_all(NULL), net_energy_transfer(NULL), - net_energy_transfer_all(NULL) + random(nullptr), fp(nullptr), nsum(nullptr), nsum_all(nullptr), + gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), flangevin(nullptr), + T_electron(nullptr), T_electron_old(nullptr), sum_vsq(nullptr), sum_mass_vsq(nullptr), + sum_vsq_all(nullptr), sum_mass_vsq_all(nullptr), net_energy_transfer(nullptr), + net_energy_transfer_all(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_fix_ttm_mod); @@ -84,13 +84,13 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 1; restart_global = 1; - seed = force->inumeric(FLERR,arg[3]); + seed = utils::inumeric(FLERR,arg[3],false,lmp); if (seed <= 0) error->all(FLERR,"Invalid random number seed in fix ttm/mod command"); - nxnodes = force->inumeric(FLERR,arg[5]); - nynodes = force->inumeric(FLERR,arg[6]); - nznodes = force->inumeric(FLERR,arg[7]); + nxnodes = utils::inumeric(FLERR,arg[5],false,lmp); + nynodes = utils::inumeric(FLERR,arg[6],false,lmp); + nznodes = utils::inumeric(FLERR,arg[7],false,lmp); if (nxnodes <= 0 || nynodes <= 0 || nznodes <= 0) error->all(FLERR,"Fix ttm/mod number of nodes must be > 0"); @@ -98,12 +98,12 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : if (total_nnodes > MAXSMALLINT) error->all(FLERR,"Too many nodes in fix ttm/mod"); - nfileevery = force->inumeric(FLERR,arg[9]); + nfileevery = utils::inumeric(FLERR,arg[9],false,lmp); if (nfileevery > 0) { if (narg != 11) error->all(FLERR,"Illegal fix ttm/mod command"); if (comm->me == 0) { fp = fopen(arg[10],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix ttm/mod file %s",arg[10]); error->one(FLERR,str); @@ -151,7 +151,7 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : "ttm/mod:net_energy_transfer"); memory->create(net_energy_transfer_all,nxnodes,nynodes,nznodes, "ttm/mod:net_energy_transfer_all"); - flangevin = NULL; + flangevin = nullptr; grow_arrays(atom->nmax); // zero out the flangevin array @@ -162,8 +162,8 @@ FixTTMMod::FixTTMMod(LAMMPS *lmp, int narg, char **arg) : flangevin[i][2] = 0; } - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // set initial electron temperatures from user input file @@ -560,7 +560,7 @@ void FixTTMMod::read_initial_electron_temperatures(const char *filename) int ixnode,iynode,iznode; double T_tmp; while (1) { - if (fgets(line,MAXLINE,fpr) == NULL) break; + if (fgets(line,MAXLINE,fpr) == nullptr) break; ValueTokenizer values(line); if (values.has_next()) ixnode = values.next_int(); if (values.has_next()) iynode = values.next_int(); diff --git a/src/USER-MISC/fix_wall_ees.cpp b/src/USER-MISC/fix_wall_ees.cpp index bd7e230472..c4be8b9f1b 100644 --- a/src/USER-MISC/fix_wall_ees.cpp +++ b/src/USER-MISC/fix_wall_ees.cpp @@ -16,13 +16,14 @@ ------------------------------------------------------------------------- */ #include "fix_wall_ees.h" -#include + #include "math_extra.h" #include "atom.h" -#include "atom_vec.h" #include "atom_vec_ellipsoid.h" #include "error.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.cpp b/src/USER-MISC/fix_wall_reflect_stochastic.cpp index 18bb7ec011..6c3a58bc38 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.cpp +++ b/src/USER-MISC/fix_wall_reflect_stochastic.cpp @@ -17,19 +17,17 @@ ------------------------------------------------------------------------- */ #include "fix_wall_reflect_stochastic.h" -#include -#include + #include "atom.h" #include "comm.h" -#include "update.h" -#include "modify.h" #include "domain.h" +#include "error.h" #include "force.h" #include "lattice.h" -#include "input.h" -#include "variable.h" #include "random_mars.h" -#include "error.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -40,7 +38,7 @@ enum{NONE,DIFFUSIVE,MAXWELL,CCL}; FixWallReflectStochastic:: FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : - FixWallReflect(lmp, narg, arg), random(NULL) + FixWallReflect(lmp, narg, arg), random(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix wall/reflect/stochastic command"); @@ -70,7 +68,7 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix wall/reflect/stochastic command"); - seedfix = force->inumeric(FLERR,arg[4]); + seedfix = utils::inumeric(FLERR,arg[4],false,lmp); if (seedfix <= 0) error->all(FLERR,"Random seed must be a positive number"); int iarg = 5; @@ -103,13 +101,13 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : else coord0[nwall] = domain->boxhi[dim]; } else { wallstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } - walltemp[nwall]= force->numeric(FLERR,arg[iarg+2]); + walltemp[nwall]= utils::numeric(FLERR,arg[iarg+2],false,lmp); for (int dir = 0; dir < 3; dir++) { - wallvel[nwall][dir]= force->numeric(FLERR,arg[iarg+dir+3]); + wallvel[nwall][dir]= utils::numeric(FLERR,arg[iarg+dir+3],false,lmp); int dim = wallwhich[nwall] / 2; if ((wallvel[nwall][dir] !=0) & (dir == dim)) error->all(FLERR,"The wall velocity must be tangential"); @@ -119,9 +117,9 @@ FixWallReflectStochastic(LAMMPS *lmp, int narg, char **arg) : // CCL = one for each dimension if (rstyle == CCL) - wallaccom[nwall][dir]= force->numeric(FLERR,arg[iarg+dir+6]); + wallaccom[nwall][dir]= utils::numeric(FLERR,arg[iarg+dir+6],false,lmp); else if (rstyle == MAXWELL) - wallaccom[nwall][dir]= force->numeric(FLERR,arg[iarg+6]); + wallaccom[nwall][dir]= utils::numeric(FLERR,arg[iarg+6],false,lmp); } nwall++; diff --git a/src/USER-MISC/fix_wall_reflect_stochastic.h b/src/USER-MISC/fix_wall_reflect_stochastic.h index 0568dc8ae5..558ad7d084 100644 --- a/src/USER-MISC/fix_wall_reflect_stochastic.h +++ b/src/USER-MISC/fix_wall_reflect_stochastic.h @@ -20,7 +20,6 @@ FixStyle(wall/reflect/stochastic,FixWallReflectStochastic) #ifndef LMP_FIX_WALL_REFLECT_STOCHASTIC_H #define LMP_FIX_WALL_REFLECT_STOCHASTIC_H -#include "random_mars.h" #include "fix_wall_reflect.h" namespace LAMMPS_NS { diff --git a/src/USER-MISC/fix_wall_region_ees.cpp b/src/USER-MISC/fix_wall_region_ees.cpp index 5c6bb1874b..dfb11d6467 100644 --- a/src/USER-MISC/fix_wall_region_ees.cpp +++ b/src/USER-MISC/fix_wall_region_ees.cpp @@ -16,18 +16,18 @@ ------------------------------------------------------------------------- */ #include "fix_wall_region_ees.h" -#include -#include -#include + #include "atom.h" #include "atom_vec_ellipsoid.h" #include "domain.h" -#include "region.h" -#include "force.h" -#include "update.h" -#include "respa.h" #include "error.h" #include "math_extra.h" +#include "region.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -54,9 +54,9 @@ FixWallRegionEES::FixWallRegionEES(LAMMPS *lmp, int narg, char **arg) : idregion = new char[n]; strcpy(idregion,arg[3]); - epsilon = force->numeric(FLERR,arg[4]); - sigma = force->numeric(FLERR,arg[5]); - cutoff = force->numeric(FLERR,arg[6]); + epsilon = utils::numeric(FLERR,arg[4],false,lmp); + sigma = utils::numeric(FLERR,arg[5],false,lmp); + cutoff = utils::numeric(FLERR,arg[6],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Fix wall/region/ees cutoff <= 0.0"); diff --git a/src/USER-MISC/improper_cossq.cpp b/src/USER-MISC/improper_cossq.cpp index c5556b746d..9f6e7f114b 100644 --- a/src/USER-MISC/improper_cossq.cpp +++ b/src/USER-MISC/improper_cossq.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "improper_cossq.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "math_const.h" using namespace LAMMPS_NS; @@ -269,10 +269,10 @@ void ImproperCossq::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -302,8 +302,8 @@ void ImproperCossq::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_distance.cpp b/src/USER-MISC/improper_distance.cpp index 146bd344f1..cbdb5130e9 100644 --- a/src/USER-MISC/improper_distance.cpp +++ b/src/USER-MISC/improper_distance.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "improper_distance.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -211,10 +211,10 @@ void ImproperDistance::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians @@ -248,8 +248,8 @@ void ImproperDistance::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_fourier.cpp b/src/USER-MISC/improper_fourier.cpp index beb473d78c..8f54c8b7aa 100644 --- a/src/USER-MISC/improper_fourier.cpp +++ b/src/USER-MISC/improper_fourier.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "improper_fourier.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "update.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -279,14 +279,14 @@ void ImproperFourier::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double C0_one = force->numeric(FLERR,arg[2]); - double C1_one = force->numeric(FLERR,arg[3]); - double C2_one = force->numeric(FLERR,arg[4]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double C0_one = utils::numeric(FLERR,arg[2],false,lmp); + double C1_one = utils::numeric(FLERR,arg[3],false,lmp); + double C2_one = utils::numeric(FLERR,arg[4],false,lmp); int all_one = 1; - if ( narg == 6 ) all_one = force->inumeric(FLERR,arg[5]); + if ( narg == 6 ) all_one = utils::inumeric(FLERR,arg[5],false,lmp); // convert w0 from degrees to radians @@ -326,11 +326,11 @@ void ImproperFourier::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C1[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&C2[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&all[1],sizeof(int),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C1[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&C2[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&all[1],sizeof(int),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&C0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/improper_ring.cpp b/src/USER-MISC/improper_ring.cpp index 7f818595a2..b2a71b10a2 100644 --- a/src/USER-MISC/improper_ring.cpp +++ b/src/USER-MISC/improper_ring.cpp @@ -37,7 +37,7 @@ ------------------------------------------------------------------------- */ #include "improper_ring.h" -#include + #include #include "atom.h" #include "comm.h" @@ -47,7 +47,7 @@ #include "math_special.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -288,10 +288,10 @@ void ImproperRing ::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -326,8 +326,8 @@ void ImproperRing::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_agni.cpp b/src/USER-MISC/pair_agni.cpp index 4941f2c7b3..0361942af1 100644 --- a/src/USER-MISC/pair_agni.cpp +++ b/src/USER-MISC/pair_agni.cpp @@ -16,22 +16,20 @@ ------------------------------------------------------------------------- */ #include "pair_agni.h" -#include -#include -#include -#include + #include "atom.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "force.h" -#include "comm.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" #include "citeme.h" -#include "math_special.h" +#include "comm.h" +#include "error.h" #include "math_const.h" -#include "utils.h" +#include "math_special.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathSpecial; @@ -87,11 +85,11 @@ PairAGNI::PairAGNI(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; nelements = 0; - elements = NULL; - elem2param = NULL; + elements = nullptr; + elem2param = nullptr; nparams = 0; - params = NULL; - map = NULL; + params = nullptr; + map = nullptr; cutmax = 0.0; } @@ -116,7 +114,7 @@ PairAGNI::~PairAGNI() delete [] params[i].yU; } memory->destroy(params); - params = NULL; + params = nullptr; } if (allocated) { @@ -268,7 +266,7 @@ void PairAGNI::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -277,7 +275,7 @@ void PairAGNI::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -350,7 +348,7 @@ double PairAGNI::init_one(int i, int j) void PairAGNI::read_file(char *file) { memory->sfree(params); - params = NULL; + params = nullptr; nparams = 0; // open file on proc 0 only @@ -358,8 +356,8 @@ void PairAGNI::read_file(char *file) FILE *fp; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open AGNI potential file %s",file); error->one(FLERR,str); @@ -375,7 +373,7 @@ void PairAGNI::read_file(char *file) n = 0; if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -398,7 +396,7 @@ void PairAGNI::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; --nwords; if ((nwords == 2) && (strcmp(words[0],"generation") == 0)) { diff --git a/src/USER-MISC/pair_buck_mdf.cpp b/src/USER-MISC/pair_buck_mdf.cpp index 1937aeedf7..8c1114c4dd 100644 --- a/src/USER-MISC/pair_buck_mdf.cpp +++ b/src/USER-MISC/pair_buck_mdf.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_buck_mdf.h" -#include + #include #include #include "atom.h" @@ -25,7 +25,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -184,8 +184,8 @@ void PairBuckMDF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -208,19 +208,19 @@ void PairBuckMDF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 7) { - cut_inner_one = force->numeric(FLERR,arg[5]); - cut_one = force->numeric(FLERR,arg[6]); + cut_inner_one = utils::numeric(FLERR,arg[5],false,lmp); + cut_one = utils::numeric(FLERR,arg[6],false,lmp); } if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -304,15 +304,15 @@ void PairBuckMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -343,11 +343,11 @@ void PairBuckMDF::write_restart_settings(FILE *fp) void PairBuckMDF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); @@ -396,5 +396,5 @@ void *PairBuckMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_cosine_squared.cpp b/src/USER-MISC/pair_cosine_squared.cpp index ff0d763b2d..84383c102f 100644 --- a/src/USER-MISC/pair_cosine_squared.cpp +++ b/src/USER-MISC/pair_cosine_squared.cpp @@ -15,22 +15,17 @@ ------------------------------------------------------------------------- */ #include "pair_cosine_squared.h" -#include -#include -#include + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "update.h" -#include "integrate.h" -#include "respa.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "neigh_list.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -103,7 +98,7 @@ void PairCosineSquared::settings(int narg, char **arg) error->all(FLERR, "Illegal pair_style command (wrong number of params)"); } - cut_global = force->numeric(FLERR, arg[0]); + cut_global = utils::numeric(FLERR, arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -130,16 +125,16 @@ void PairCosineSquared::coeff(int narg, char **arg) allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR, arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR, arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error); - double epsilon_one = force->numeric(FLERR, arg[2]); - double sigma_one = force->numeric(FLERR, arg[3]); + double epsilon_one = utils::numeric(FLERR, arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR, arg[3],false,lmp); double cut_one = cut_global; double wca_one = 0; if (narg == 6) { - cut_one = force->numeric(FLERR, arg[4]); + cut_one = utils::numeric(FLERR, arg[4],false,lmp); if (strcmp(arg[5], "wca") == 0) { wca_one = 1; } else { @@ -149,7 +144,7 @@ void PairCosineSquared::coeff(int narg, char **arg) if (strcmp(arg[4], "wca") == 0) { wca_one = 1; } else { - cut_one = force->numeric(FLERR, arg[4]); + cut_one = utils::numeric(FLERR, arg[4],false,lmp); } } @@ -276,14 +271,14 @@ void PairCosineSquared::read_restart(FILE *fp) for (i = 1; i <= atom->ntypes; i++) { for (j = i; j <= atom->ntypes; j++) { if (me == 0) - utils::sfread(FLERR,&setflag[i][j], sizeof(int), 1, fp,NULL,error); + utils::sfread(FLERR,&setflag[i][j], sizeof(int), 1, fp,nullptr,error); MPI_Bcast(&setflag[i][j], 1, MPI_INT, 0, world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&cut[i][j], sizeof(double), 1, fp,NULL,error); - utils::sfread(FLERR,&wcaflag[i][j], sizeof(int), 1, fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j], sizeof(double), 1, fp,nullptr,error); + utils::sfread(FLERR,&wcaflag[i][j], sizeof(int), 1, fp,nullptr,error); } MPI_Bcast(&epsilon[i][j], 1, MPI_DOUBLE, 0, world); MPI_Bcast(&sigma[i][j], 1, MPI_DOUBLE, 0, world); @@ -311,7 +306,7 @@ void PairCosineSquared::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global, sizeof(double), 1, fp,NULL,error); + utils::sfread(FLERR,&cut_global, sizeof(double), 1, fp,nullptr,error); } MPI_Bcast(&cut_global, 1, MPI_DOUBLE, 0, world); } diff --git a/src/USER-MISC/pair_coul_diel.cpp b/src/USER-MISC/pair_coul_diel.cpp index e0c675086f..35995717bd 100644 --- a/src/USER-MISC/pair_coul_diel.cpp +++ b/src/USER-MISC/pair_coul_diel.cpp @@ -15,7 +15,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_diel.h" -#include + #include #include "atom.h" #include "comm.h" @@ -24,7 +24,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -159,7 +159,7 @@ void PairCoulDiel::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -181,15 +181,15 @@ void PairCoulDiel::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - eps_s = force->numeric(FLERR,arg[2]); - double rme_one =force->numeric(FLERR,arg[3]); - double sigmae_one = force->numeric(FLERR,arg[4]); + eps_s = utils::numeric(FLERR,arg[2],false,lmp); + double rme_one =utils::numeric(FLERR,arg[3],false,lmp); + double sigmae_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -281,13 +281,13 @@ void PairCoulDiel::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&rme[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&rme[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&rme[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world); @@ -314,9 +314,9 @@ void PairCoulDiel::write_restart_settings(FILE *fp) void PairCoulDiel::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_coul_shield.cpp b/src/USER-MISC/pair_coul_shield.cpp index 7ff479b2f7..54e3dbddb8 100644 --- a/src/USER-MISC/pair_coul_shield.cpp +++ b/src/USER-MISC/pair_coul_shield.cpp @@ -28,7 +28,7 @@ #include "memory.h" #include "math_special.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -175,8 +175,8 @@ void PairCoulShield::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - if (narg == 2) tap_flag = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -198,13 +198,13 @@ void PairCoulShield::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double sigmae_one = force->numeric(FLERR,arg[2]); + double sigmae_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -297,12 +297,12 @@ void PairCoulShield::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&sigmae[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&sigmae[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -328,9 +328,9 @@ void PairCoulShield::write_restart_settings(FILE *fp) void PairCoulShield::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_coul_slater_cut.cpp b/src/USER-MISC/pair_coul_slater_cut.cpp index 33363b869a..f7096292ba 100644 --- a/src/USER-MISC/pair_coul_slater_cut.cpp +++ b/src/USER-MISC/pair_coul_slater_cut.cpp @@ -15,18 +15,15 @@ * Contributing author: Evangelos Voyiatzis (Royal DSM) * ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_coul_slater_cut.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "memory.h" #include "error.h" +#include "force.h" +#include "neigh_list.h" + +#include using namespace LAMMPS_NS; @@ -123,8 +120,8 @@ void PairCoulSlaterCut::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - lamda = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + lamda = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -155,10 +152,10 @@ void PairCoulSlaterCut::write_restart_settings(FILE *fp) void PairCoulSlaterCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - fread(&cut_global,sizeof(double),1,fp); - fread(&lamda,sizeof(double),1,fp); - fread(&offset_flag,sizeof(int),1,fp); - fread(&mix_flag,sizeof(int),1,fp); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&lamda,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&lamda,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_coul_slater_long.cpp b/src/USER-MISC/pair_coul_slater_long.cpp index f5b7461db7..0f5ee9bd11 100644 --- a/src/USER-MISC/pair_coul_slater_long.cpp +++ b/src/USER-MISC/pair_coul_slater_long.cpp @@ -15,22 +15,19 @@ * Contributing author: Evangelos Voyiatzis (Royal DSM) * ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_coul_slater_long.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "update.h" -#include "integrate.h" -#include "respa.h" #include "memory.h" -#include "error.h" +#include "neigh_list.h" +#include "neighbor.h" + +#include +#include using namespace LAMMPS_NS; @@ -47,7 +44,7 @@ using namespace LAMMPS_NS; PairCoulSlaterLong::PairCoulSlaterLong(LAMMPS *lmp) : Pair(lmp) { ewaldflag = pppmflag = 1; - //ftable = NULL; + //ftable = nullptr; qdist = 0.0; } @@ -209,8 +206,8 @@ void PairCoulSlaterLong::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - lamda = force->numeric(FLERR,arg[0]); - cut_coul = force->numeric(FLERR,arg[1]); + lamda = utils::numeric(FLERR,arg[0],false,lmp); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- @@ -223,8 +220,8 @@ void PairCoulSlaterLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -253,13 +250,13 @@ void PairCoulSlaterLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; // setup force tables - // if (ncoultablebits) init_tables(cut_coul,NULL); + // if (ncoultablebits) init_tables(cut_coul,nullptr); } /* ---------------------------------------------------------------------- @@ -418,5 +415,5 @@ void *PairCoulSlaterLong::extract(const char *str, int &dim) dim = 2; return (void *) scale; } - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_drip.cpp b/src/USER-MISC/pair_drip.cpp index 2e9221537a..b5b39a65a7 100644 --- a/src/USER-MISC/pair_drip.cpp +++ b/src/USER-MISC/pair_drip.cpp @@ -21,9 +21,9 @@ ------------------------------------------------------------------------- */ #include "pair_drip.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -33,7 +33,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -49,11 +49,11 @@ PairDRIP::PairDRIP(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; manybody_flag = 1; - params = NULL; - nearest3neigh = NULL; - elements = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + nearest3neigh = nullptr; + elements = nullptr; + elem2param = nullptr; + map = nullptr; nelements = 0; cutmax = 0.0; } @@ -68,10 +68,10 @@ PairDRIP::~PairDRIP() delete [] map; } - if (elements != NULL) { + if (elements != nullptr) { for (int i = 0; i < nelements; i++) delete [] elements[i]; delete [] elements; - elements = NULL; + elements = nullptr; } memory->destroy(params); memory->destroy(elem2param); @@ -139,7 +139,7 @@ void PairDRIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -148,7 +148,7 @@ void PairDRIP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -223,8 +223,8 @@ void PairDRIP::read_file(char *filename) FILE *fp; if (comm->me == 0) { - fp = force->open_potential(filename); - if (fp == NULL) { + fp = utils::open_potential(filename,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open DRIP potential file %s",filename); error->one(FLERR,str); @@ -241,7 +241,7 @@ void PairDRIP::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -263,7 +263,7 @@ void PairDRIP::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -283,7 +283,7 @@ void PairDRIP::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_e3b.cpp b/src/USER-MISC/pair_e3b.cpp index 420e2135bd..96aeea66f6 100644 --- a/src/USER-MISC/pair_e3b.cpp +++ b/src/USER-MISC/pair_e3b.cpp @@ -15,7 +15,7 @@ ------------------------------------------------------------------------- */ #include "pair_e3b.h" -#include + #include #include #include @@ -50,12 +50,12 @@ PairE3B::PairE3B(LAMMPS *lmp) : Pair(lmp),pairPerAtom(10) pvector = new double[nextra]; allocatedE3B = false; - pairO = NULL; - pairH = NULL; - exps = NULL; - del3 = NULL; - fpair3 = NULL; - sumExp = NULL; + pairO = nullptr; + pairH = nullptr; + exps = nullptr; + del3 = nullptr; + fpair3 = nullptr; + sumExp = nullptr; } /* ---------------------------------------------------------------------- @@ -381,7 +381,7 @@ void PairE3B::allocateE3B() void PairE3B::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - typeO=force->inumeric(FLERR,arg[0]); + typeO=utils::inumeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- @@ -421,29 +421,29 @@ void PairE3B::coeff(int narg, char **arg) while(iarg < narg) { char *keyword = arg[iarg++]; if (checkKeyword(keyword,"Ea",1,narg-iarg)) - ea=force->numeric(FLERR,arg[iarg++]); + ea=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Eb",1,narg-iarg)) - eb=force->numeric(FLERR,arg[iarg++]); + eb=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Ec",1,narg-iarg)) - ec=force->numeric(FLERR,arg[iarg++]); + ec=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"K3",1,narg-iarg)) - k3=force->numeric(FLERR,arg[iarg++]); + k3=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Rs",1,narg-iarg)) - rs=force->numeric(FLERR,arg[iarg++]); + rs=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Rc3",1,narg-iarg)) - rc3=force->numeric(FLERR,arg[iarg++]); + rc3=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"Rc2",1,narg-iarg)) - rc2=force->numeric(FLERR,arg[iarg++]); + rc2=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"bondL",1,narg-iarg)) - bondL=force->numeric(FLERR,arg[iarg++]); + bondL=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"E2",1,narg-iarg)) - e2=force->numeric(FLERR,arg[iarg++]); + e2=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"K2",1,narg-iarg)) - k2=force->numeric(FLERR,arg[iarg++]); + k2=utils::numeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"neigh",1,narg-iarg)) - pairPerAtom=force->inumeric(FLERR,arg[iarg++]); + pairPerAtom=utils::inumeric(FLERR,arg[iarg++],false,lmp); else if (checkKeyword(keyword,"preset",1,narg-iarg)) { - presetFlag=force->inumeric(FLERR,arg[iarg++]); + presetFlag=utils::inumeric(FLERR,arg[iarg++],false,lmp); presetParam(presetFlag,repeatFlag,bondL); } else { char str[256]; diff --git a/src/USER-MISC/pair_edip.cpp b/src/USER-MISC/pair_edip.cpp index 288160459a..62d09e0c46 100644 --- a/src/USER-MISC/pair_edip.cpp +++ b/src/USER-MISC/pair_edip.cpp @@ -22,10 +22,10 @@ ------------------------------------------------------------------------- */ #include "pair_edip.h" -#include + #include #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -35,7 +35,7 @@ #include "comm.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -52,12 +52,12 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairEDIP::PairEDIP(LAMMPS *lmp) : - Pair(lmp), preInvR_ij(NULL), preExp3B_ij(NULL), preExp3BDerived_ij(NULL), - preExp2B_ij(NULL), preExp2BDerived_ij(NULL), prePow2B_ij(NULL), - preForceCoord(NULL), cutoffFunction(NULL), cutoffFunctionDerived(NULL), - pow2B(NULL), exp2B(NULL), exp3B(NULL), qFunctionGrid(NULL), - expMinusBetaZeta_iZeta_iGrid(NULL), tauFunctionGrid(NULL), - tauFunctionDerivedGrid(NULL) + Pair(lmp), preInvR_ij(nullptr), preExp3B_ij(nullptr), preExp3BDerived_ij(nullptr), + preExp2B_ij(nullptr), preExp2BDerived_ij(nullptr), prePow2B_ij(nullptr), + preForceCoord(nullptr), cutoffFunction(nullptr), cutoffFunctionDerived(nullptr), + pow2B(nullptr), exp2B(nullptr), exp3B(nullptr), qFunctionGrid(nullptr), + expMinusBetaZeta_iZeta_iGrid(nullptr), tauFunctionGrid(nullptr), + tauFunctionDerivedGrid(nullptr) { single_enable = 0; restartinfo = 0; @@ -65,10 +65,10 @@ PairEDIP::PairEDIP(LAMMPS *lmp) : manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -779,7 +779,7 @@ void PairEDIP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -788,7 +788,7 @@ void PairEDIP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -876,15 +876,15 @@ void PairEDIP::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open EDIP potential file %s",file); error->one(FLERR,str); @@ -902,7 +902,7 @@ void PairEDIP::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -924,7 +924,7 @@ void PairEDIP::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -944,7 +944,7 @@ void PairEDIP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_edip_multi.cpp b/src/USER-MISC/pair_edip_multi.cpp index 7fe620223b..07245b1728 100644 --- a/src/USER-MISC/pair_edip_multi.cpp +++ b/src/USER-MISC/pair_edip_multi.cpp @@ -18,9 +18,9 @@ ------------------------------------------------------------------------- */ #include "pair_edip_multi.h" -#include + #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -31,7 +31,7 @@ #include "memory.h" #include "error.h" #include "citeme.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -70,10 +70,10 @@ PairEDIPMulti::PairEDIPMulti(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -539,7 +539,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -548,7 +548,7 @@ void PairEDIPMulti::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -633,15 +633,15 @@ void PairEDIPMulti::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open EDIP potential file %s",file); error->one(FLERR,str); @@ -659,7 +659,7 @@ void PairEDIPMulti::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -681,7 +681,7 @@ void PairEDIPMulti::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -701,7 +701,7 @@ void PairEDIPMulti::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_extep.cpp b/src/USER-MISC/pair_extep.cpp index 65f792b493..d8fa565ae1 100644 --- a/src/USER-MISC/pair_extep.cpp +++ b/src/USER-MISC/pair_extep.cpp @@ -16,9 +16,9 @@ ------------------------------------------------------------------------- */ #include "pair_extep.h" -#include + #include -#include + #include #include #include "atom.h" @@ -30,7 +30,7 @@ #include "comm.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "math_const.h" @@ -52,20 +52,20 @@ PairExTeP::PairExTeP(LAMMPS *lmp) : Pair(lmp) ghostneigh = 1; nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; maxlocal = 0; - SR_numneigh = NULL; - SR_firstneigh = NULL; - ipage = NULL; + SR_numneigh = nullptr; + SR_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - map = NULL; + map = nullptr; - Nt = NULL; - Nd = NULL; + Nt = nullptr; + Nd = nullptr; } /* ---------------------------------------------------------------------- @@ -467,7 +467,7 @@ void PairExTeP::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -476,7 +476,7 @@ void PairExTeP::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -544,7 +544,7 @@ void PairExTeP::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -582,15 +582,15 @@ void PairExTeP::read_file(char *file) char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) { + fp = utils::open_potential(file,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open ExTeP potential file %s",file); error->one(FLERR,str); @@ -607,7 +607,7 @@ void PairExTeP::read_file(char *file) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -629,7 +629,7 @@ void PairExTeP::read_file(char *file) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -649,7 +649,7 @@ void PairExTeP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement,kelement = 1st args // if all 3 args are in element list, then parse this line @@ -737,7 +737,7 @@ void PairExTeP::read_file(char *file) if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); //fputs(line,stdout); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -758,7 +758,7 @@ void PairExTeP::read_file(char *file) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); while ((nwords < params_per_line) - && (words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + && (words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // skip line if it is a leftover from the previous section, // which can be identified by having 3 elements (instead of 2) diff --git a/src/USER-MISC/pair_gauss_cut.cpp b/src/USER-MISC/pair_gauss_cut.cpp index 2a4f61cce3..d7d7f68645 100644 --- a/src/USER-MISC/pair_gauss_cut.cpp +++ b/src/USER-MISC/pair_gauss_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_gauss_cut.h" -#include + #include #include "atom.h" #include "comm.h" @@ -24,7 +24,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "math_const.h" using namespace LAMMPS_NS; @@ -163,7 +163,7 @@ void PairGaussCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -185,18 +185,18 @@ void PairGaussCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double hgauss_one = force->numeric(FLERR,arg[2]); - double rmh_one = force->numeric(FLERR,arg[3]); - double sigmah_one = force->numeric(FLERR,arg[4]); + double hgauss_one = utils::numeric(FLERR,arg[2],false,lmp); + double rmh_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigmah_one = utils::numeric(FLERR,arg[4],false,lmp); if (sigmah_one <= 0.0) error->all(FLERR,"Incorrect args for pair coefficients"); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -301,14 +301,14 @@ void PairGaussCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&hgauss[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rmh[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigmah[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&hgauss[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rmh[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigmah[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&hgauss[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rmh[i][j],1,MPI_DOUBLE,0,world); @@ -337,9 +337,9 @@ void PairGaussCut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/USER-MISC/pair_ilp_graphene_hbn.cpp b/src/USER-MISC/pair_ilp_graphene_hbn.cpp index 106d02dd48..63ba47448a 100644 --- a/src/USER-MISC/pair_ilp_graphene_hbn.cpp +++ b/src/USER-MISC/pair_ilp_graphene_hbn.cpp @@ -21,9 +21,9 @@ ------------------------------------------------------------------------- */ #include "pair_ilp_graphene_hbn.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -34,7 +34,7 @@ #include "my_page.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -54,23 +54,23 @@ PairILPGrapheneHBN::PairILPGrapheneHBN(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - cutILPsq = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + cutILPsq = nullptr; + map = nullptr; nmax = 0; maxlocal = 0; - ILP_numneigh = NULL; - ILP_firstneigh = NULL; - ipage = NULL; + ILP_numneigh = nullptr; + ILP_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - normal = NULL; - dnormal = NULL; - dnormdri = NULL; + normal = nullptr; + dnormal = nullptr; + dnormdri = nullptr; // always compute energy offset offset_flag = 1; @@ -136,8 +136,8 @@ void PairILPGrapheneHBN::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); - if (narg == 2) tap_flag = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -167,7 +167,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -176,7 +176,7 @@ void PairILPGrapheneHBN::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -249,15 +249,15 @@ void PairILPGrapheneHBN::read_file(char *filename) int params_per_line = 13; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(filename); - if (fp == NULL) { + fp = utils::open_potential(filename,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open ILP potential file %s",filename); error->one(FLERR,str); @@ -274,7 +274,7 @@ void PairILPGrapheneHBN::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -296,7 +296,7 @@ void PairILPGrapheneHBN::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -316,7 +316,7 @@ void PairILPGrapheneHBN::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line @@ -414,7 +414,7 @@ void PairILPGrapheneHBN::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp index 9627cbc08a..0804f42b86 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_full.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_full.cpp @@ -22,9 +22,9 @@ #include "pair_kolmogorov_crespi_full.h" #include -#include + #include -#include + #include "atom.h" #include "comm.h" #include "force.h" @@ -34,7 +34,7 @@ #include "my_page.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -54,23 +54,23 @@ PairKolmogorovCrespiFull::PairKolmogorovCrespiFull(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - cutKCsq = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + cutKCsq = nullptr; + map = nullptr; nmax = 0; maxlocal = 0; - KC_numneigh = NULL; - KC_firstneigh = NULL; - ipage = NULL; + KC_numneigh = nullptr; + KC_firstneigh = nullptr; + ipage = nullptr; pgsize = oneatom = 0; - normal = NULL; - dnormal = NULL; - dnormdri = NULL; + normal = nullptr; + dnormal = nullptr; + dnormdri = nullptr; // always compute energy offset offset_flag = 1; @@ -137,8 +137,8 @@ void PairKolmogorovCrespiFull::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); - if (narg == 2) tap_flag = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + if (narg == 2) tap_flag = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -168,7 +168,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -177,7 +177,7 @@ void PairKolmogorovCrespiFull::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -250,15 +250,15 @@ void PairKolmogorovCrespiFull::read_file(char *filename) int params_per_line = 12; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(filename); - if (fp == NULL) { + fp = utils::open_potential(filename,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open KC potential file %s",filename); error->one(FLERR,str); @@ -275,7 +275,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -297,7 +297,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -317,7 +317,7 @@ void PairKolmogorovCrespiFull::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line @@ -415,7 +415,7 @@ void PairKolmogorovCrespiFull::init_style() // create pages if first time or if neighbor pgsize/oneatom has changed int create = 0; - if (ipage == NULL) create = 1; + if (ipage == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; diff --git a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp index 4315439624..617a48c0fe 100644 --- a/src/USER-MISC/pair_kolmogorov_crespi_z.cpp +++ b/src/USER-MISC/pair_kolmogorov_crespi_z.cpp @@ -22,9 +22,9 @@ ------------------------------------------------------------------------- */ #include "pair_kolmogorov_crespi_z.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -32,7 +32,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -48,11 +48,11 @@ PairKolmogorovCrespiZ::PairKolmogorovCrespiZ(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; // always compute energy offset offset_flag = 1; @@ -203,7 +203,7 @@ void PairKolmogorovCrespiZ::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -228,11 +228,11 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -241,7 +241,7 @@ void PairKolmogorovCrespiZ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -308,15 +308,15 @@ void PairKolmogorovCrespiZ::read_file(char *filename) int params_per_line = 11; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(filename); - if (fp == NULL) { + fp = utils::open_potential(filename,lmp,nullptr); + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open KC potential file %s",filename); error->one(FLERR,str); @@ -333,7 +333,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -355,7 +355,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -375,7 +375,7 @@ void PairKolmogorovCrespiZ::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_lebedeva_z.cpp b/src/USER-MISC/pair_lebedeva_z.cpp index 53ee82274e..3168a35ab7 100644 --- a/src/USER-MISC/pair_lebedeva_z.cpp +++ b/src/USER-MISC/pair_lebedeva_z.cpp @@ -23,9 +23,9 @@ ------------------------------------------------------------------------- */ #include "pair_lebedeva_z.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -33,7 +33,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -49,11 +49,11 @@ PairLebedevaZ::PairLebedevaZ(LAMMPS *lmp) : Pair(lmp) // initialize element to parameter maps nelements = 0; - elements = NULL; + elements = nullptr; nparams = maxparam = 0; - params = NULL; - elem2param = NULL; - map = NULL; + params = nullptr; + elem2param = nullptr; + map = nullptr; // always compute energy offset offset_flag = 1; @@ -199,7 +199,7 @@ void PairLebedevaZ::settings(int narg, char **arg) if (strcmp(force->pair_style,"hybrid/overlay")!=0) error->all(FLERR,"ERROR: requires hybrid/overlay pair_style"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -224,11 +224,11 @@ void PairLebedevaZ::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -237,7 +237,7 @@ void PairLebedevaZ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -304,15 +304,15 @@ void PairLebedevaZ::read_file(char *filename) int params_per_line = 12; char **words = new char*[params_per_line+1]; memory->sfree(params); - params = NULL; + params = nullptr; nparams = maxparam = 0; // open file on proc 0 FILE *fp; if (comm->me == 0) { - fp = force->open_potential(filename); - if (fp == NULL) { + fp = utils::open_potential(filename,lmp,nullptr); + if (fp == nullptr) { char str[128]; sprintf(str,"Cannot open Lebedeva potential file %s",filename); error->one(FLERR,str); @@ -329,7 +329,7 @@ void PairLebedevaZ::read_file(char *filename) while (1) { if (comm->me == 0) { ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -351,7 +351,7 @@ void PairLebedevaZ::read_file(char *filename) n = strlen(line); if (comm->me == 0) { ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { + if (ptr == nullptr) { eof = 1; fclose(fp); } else n = strlen(line) + 1; @@ -371,7 +371,7 @@ void PairLebedevaZ::read_file(char *filename) nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; + while ((words[nwords++] = strtok(nullptr," \t\n\r\f"))) continue; // ielement,jelement = 1st args // if these 2 args are in element list, then parse this line diff --git a/src/USER-MISC/pair_lennard_mdf.cpp b/src/USER-MISC/pair_lennard_mdf.cpp index 4728527a30..23c12ea9dd 100644 --- a/src/USER-MISC/pair_lennard_mdf.cpp +++ b/src/USER-MISC/pair_lennard_mdf.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lennard_mdf.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -184,8 +184,8 @@ void PairLennardMDF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -214,17 +214,17 @@ void PairLennardMDF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double aparm_one = force->numeric(FLERR,arg[2]); - double bparm_one = force->numeric(FLERR,arg[3]); + double aparm_one = utils::numeric(FLERR,arg[2],false,lmp); + double bparm_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) error->all(FLERR,"Illegal pair_coeff command"); @@ -304,14 +304,14 @@ void PairLennardMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&aparm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&bparm[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&aparm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&bparm[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&aparm[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&bparm[i][j],1,MPI_DOUBLE,0,world); @@ -340,9 +340,9 @@ void PairLennardMDF::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); @@ -413,5 +413,5 @@ void *PairLennardMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) aparm; if (strcmp(str,"b") == 0) return (void *) bparm; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_list.cpp b/src/USER-MISC/pair_list.cpp index 2f4e886a61..2b9e14ea54 100644 --- a/src/USER-MISC/pair_list.cpp +++ b/src/USER-MISC/pair_list.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_list.h" -#include + #include #include #include "atom.h" @@ -25,10 +25,11 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; static const char * const stylename[] = { - "none", "harmonic", "morse", "lj126", NULL + "none", "harmonic", "morse", "lj126", nullptr }; // fast power function for integer exponent > 0 @@ -53,8 +54,8 @@ PairList::PairList(LAMMPS *lmp) : Pair(lmp) restartinfo = 0; respa_enable = 0; cut_global = 0.0; - style = NULL; - params = NULL; + style = nullptr; + params = nullptr; check_flag = 1; } @@ -202,15 +203,15 @@ void PairList::settings(int narg, char **arg) if (narg < 2) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[1]); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg > 2) { if (strcmp(arg[2],"nocheck") == 0) check_flag = 0; if (strcmp(arg[2],"check") == 0) check_flag = 1; } - FILE *fp = force->open_potential(arg[0]); + FILE *fp = utils::open_potential(arg[0],lmp,nullptr); char line[1024]; - if (fp == NULL) + if (fp == nullptr) error->all(FLERR,"Cannot open pair list file"); // count lines in file for upper limit of storage needed @@ -237,13 +238,13 @@ void PairList::settings(int narg, char **arg) // get atom ids of pair id1 = ATOTAGINT(ptr); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted pair list file"); id2 = ATOTAGINT(ptr); // get potential type - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted pair list file"); @@ -256,15 +257,15 @@ void PairList::settings(int narg, char **arg) if (strcmp(ptr,stylename[HARM]) == 0) { style[npairs] = HARM; - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr == NULL) || (*ptr == '#')) + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr == nullptr) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); - par.parm.harm.k = force->numeric(FLERR,ptr); + par.parm.harm.k = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr == NULL) || (*ptr == '#')) + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr == nullptr) || (*ptr == '#')) error->all(FLERR,"Incorrectly formatted harmonic pair parameters"); - par.parm.harm.r0 = force->numeric(FLERR,ptr); + par.parm.harm.r0 = utils::numeric(FLERR,ptr,false,lmp); ++nharm; @@ -272,20 +273,20 @@ void PairList::settings(int narg, char **arg) } else if (strcmp(ptr,stylename[MORSE]) == 0) { style[npairs] = MORSE; - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); - par.parm.morse.d0 = force->numeric(FLERR,ptr); + par.parm.morse.d0 = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); - par.parm.morse.alpha = force->numeric(FLERR,ptr); + par.parm.morse.alpha = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted morse pair parameters"); - par.parm.morse.r0 = force->numeric(FLERR,ptr); + par.parm.morse.r0 = utils::numeric(FLERR,ptr,false,lmp); ++nmorse; @@ -293,15 +294,15 @@ void PairList::settings(int narg, char **arg) // 12-6 lj potential style[npairs] = LJ126; - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); - par.parm.lj126.epsilon = force->numeric(FLERR,ptr); + par.parm.lj126.epsilon = utils::numeric(FLERR,ptr,false,lmp); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); if (!ptr) error->all(FLERR,"Incorrectly formatted 12-6 LJ pair parameters"); - par.parm.lj126.sigma = force->numeric(FLERR,ptr); + par.parm.lj126.sigma = utils::numeric(FLERR,ptr,false,lmp); ++nlj126; @@ -310,9 +311,9 @@ void PairList::settings(int narg, char **arg) } // optional cutoff parameter. if not specified use global value - ptr = strtok(NULL," \t\n\r\f"); - if ((ptr != NULL) && (*ptr != '#')) { - double cut = force->numeric(FLERR,ptr); + ptr = strtok(nullptr," \t\n\r\f"); + if ((ptr != nullptr) && (*ptr != '#')) { + double cut = utils::numeric(FLERR,ptr,false,lmp); par.cutsq = cut*cut; } else { par.cutsq = cut_global*cut_global; @@ -344,8 +345,8 @@ void PairList::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -367,7 +368,7 @@ void PairList::init_style() if (atom->tag_enable == 0) error->all(FLERR,"Pair style list requires atom IDs"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Pair style list requires an atom map"); if (offset_flag) { diff --git a/src/USER-MISC/pair_lj_expand_coul_long.cpp b/src/USER-MISC/pair_lj_expand_coul_long.cpp index 3d96a3343c..8951af77cd 100644 --- a/src/USER-MISC/pair_lj_expand_coul_long.cpp +++ b/src/USER-MISC/pair_lj_expand_coul_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_expand_coul_long.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -51,9 +51,9 @@ PairLJExpandCoulLong::PairLJExpandCoulLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -626,9 +626,9 @@ void PairLJExpandCoulLong::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[1]); + else cut_coul = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -651,15 +651,15 @@ void PairLJExpandCoulLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double shift_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double shift_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -710,11 +710,11 @@ void PairLJExpandCoulLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -838,14 +838,14 @@ void PairLJExpandCoulLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -877,13 +877,13 @@ void PairLJExpandCoulLong::write_restart_settings(FILE *fp) void PairLJExpandCoulLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -997,5 +997,5 @@ void *PairLJExpandCoulLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"delta") == 0) return (void *) shift; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_lj_mdf.cpp b/src/USER-MISC/pair_lj_mdf.cpp index 51e24639b9..07f58aced1 100644 --- a/src/USER-MISC/pair_lj_mdf.cpp +++ b/src/USER-MISC/pair_lj_mdf.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_mdf.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -186,8 +186,8 @@ void PairLJMDF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -216,17 +216,17 @@ void PairLJMDF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -311,14 +311,14 @@ void PairLJMDF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -345,7 +345,7 @@ void PairLJMDF::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } @@ -414,5 +414,5 @@ void *PairLJMDF::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp index 19bc66bdcb..42a2d4bb7c 100644 --- a/src/USER-MISC/pair_lj_sf_dipole_sf.cpp +++ b/src/USER-MISC/pair_lj_sf_dipole_sf.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_sf_dipole_sf.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "update.h" using namespace LAMMPS_NS; @@ -333,9 +333,9 @@ void PairLJSFDipoleSF::settings(int narg, char **arg) if (strcmp(update->unit_style,"electron") == 0) error->all(FLERR,"Cannot (yet) use 'electron' units with dipoles"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -361,11 +361,11 @@ void PairLJSFDipoleSF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; @@ -373,16 +373,16 @@ void PairLJSFDipoleSF::coeff(int narg, char **arg) int iarg = 4; if ((narg > iarg) && (strcmp(arg[iarg],"scale") != 0)) { - cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[iarg]); + cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[iarg],false,lmp); ++iarg; } if ((narg > iarg) && (strcmp(arg[iarg],"scale") != 0)) { - cut_coul_one = force->numeric(FLERR,arg[iarg]); + cut_coul_one = utils::numeric(FLERR,arg[iarg],false,lmp); ++iarg; } if (narg > iarg) { if (strcmp(arg[iarg],"scale") == 0) { - scale_one = force->numeric(FLERR,arg[iarg+1]); + scale_one = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Incorrect args for pair coefficients"); } @@ -487,15 +487,15 @@ void PairLJSFDipoleSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -524,9 +524,9 @@ void PairLJSFDipoleSF::write_restart_settings(FILE *fp) void PairLJSFDipoleSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -638,5 +638,5 @@ void *PairLJSFDipoleSF::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_local_density.cpp b/src/USER-MISC/pair_local_density.cpp index 8ad9793f98..61346a7fdc 100644 --- a/src/USER-MISC/pair_local_density.cpp +++ b/src/USER-MISC/pair_local_density.cpp @@ -18,22 +18,17 @@ ------------------------------------------------------------------------- */ #include "pair_local_density.h" -#include -#include -#include -#include -#include + #include "atom.h" -#include "force.h" -#include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "memory.h" -#include "error.h" -#include "domain.h" #include "citeme.h" -#include "utils.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" + +#include using namespace LAMMPS_NS; @@ -67,28 +62,28 @@ PairLocalDensity::PairLocalDensity(LAMMPS *lmp) : Pair(lmp) // stuff read from tabulated file nLD = 0; nrho = 0; - rho_min = NULL; - rho_max = NULL; - a = NULL; - b = NULL; - c0 = NULL; - c2 = NULL; - c4 = NULL; - c6 = NULL; - uppercut = NULL; - lowercut = NULL; - uppercutsq = NULL; - lowercutsq = NULL; - frho = NULL; - rho = NULL; + rho_min = nullptr; + rho_max = nullptr; + a = nullptr; + b = nullptr; + c0 = nullptr; + c2 = nullptr; + c4 = nullptr; + c6 = nullptr; + uppercut = nullptr; + lowercut = nullptr; + uppercutsq = nullptr; + lowercutsq = nullptr; + frho = nullptr; + rho = nullptr; // splined arrays - frho_spline = NULL; + frho_spline = nullptr; // per-atom arrays nmax = 0; - fp = NULL; - localrho = NULL; + fp = nullptr; + localrho = nullptr; // set comm size needed by this pair comm_forward = 1; @@ -672,7 +667,7 @@ void PairLocalDensity::parse_file(char *filename) { if (me == 0) { fptr = fopen(filename, "r"); - if (fptr == NULL) { + if (fptr == nullptr) { char str[128]; sprintf(str,"Cannot open Local Density potential file %s",filename); error->one(FLERR,str); @@ -729,23 +724,23 @@ void PairLocalDensity::parse_file(char *filename) { for (k = 0; k < nLD; k++) { // parse upper and lower cut values - if (fgets(line,MAXLINE,fptr)==NULL) break; + if (fgets(line,MAXLINE,fptr)==nullptr) break; sscanf(line, "%lf %lf", &lowercut[k], &uppercut[k]); // parse and broadcast central atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); char *tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != nullptr) { a[k][atoi(tmp)] = 1; - tmp = strtok(NULL, " /t/n/r/f"); + tmp = strtok(nullptr, " /t/n/r/f"); } // parse neighbor atom filter utils::sfgets(FLERR,line, MAXLINE, fptr,filename,error); tmp = strtok(line, " /t/n/r/f"); - while (tmp != NULL) { + while (tmp != nullptr) { b[k][atoi(tmp)] = 1; - tmp = strtok(NULL, " /t/n/r/f"); + tmp = strtok(nullptr, " /t/n/r/f"); } // parse min, max and delta rho values diff --git a/src/USER-MISC/pair_meam_spline.cpp b/src/USER-MISC/pair_meam_spline.cpp index 5f35070130..3be2a3858b 100644 --- a/src/USER-MISC/pair_meam_spline.cpp +++ b/src/USER-MISC/pair_meam_spline.cpp @@ -33,7 +33,7 @@ #include "pair_meam_spline.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -43,7 +43,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -56,24 +56,24 @@ PairMEAMSpline::PairMEAMSpline(LAMMPS *lmp) : Pair(lmp) one_coeff = 1; nelements = 0; - elements = NULL; - map = NULL; + elements = nullptr; + map = nullptr; - Uprime_values = NULL; + Uprime_values = nullptr; nmax = 0; maxNeighbors = 0; - twoBodyInfo = NULL; + twoBodyInfo = nullptr; comm_forward = 1; comm_reverse = 0; - phis = NULL; - Us = NULL; - rhos = NULL; - fs = NULL; - gs = NULL; + phis = nullptr; + Us = nullptr; + rhos = nullptr; + fs = nullptr; + gs = nullptr; - zero_atom_energies = NULL; + zero_atom_energies = nullptr; } /* ---------------------------------------------------------------------- */ @@ -398,7 +398,7 @@ void PairMEAMSpline::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -448,7 +448,7 @@ void PairMEAMSpline::coeff(int narg, char **arg) if (map[j] == i) count++; if (count != 1) error->all(FLERR,"Pair style meam/spline requires one atom type per element"); - } + } } #define MAXLINE 1024 @@ -458,8 +458,8 @@ void PairMEAMSpline::read_file(const char* filename) int nmultichoose2; // = (n+1)*n/2; if(comm->me == 0) { - FILE *fp = force->open_potential(filename); - if(fp == NULL) { + FILE *fp = utils::open_potential(filename,lmp,nullptr); + if(fp == nullptr) { char str[1024]; snprintf(str,128,"Cannot open spline MEAM potential file %s", filename); error->one(FLERR,str); @@ -480,8 +480,8 @@ void PairMEAMSpline::read_file(const char* filename) if (strcmp(ptr, "meam/spline") == 0) { isNewFormat = true; // parse the rest of the line! - ptr = strtok(NULL," \t\n\r\f"); - if (ptr == NULL) + ptr = strtok(nullptr," \t\n\r\f"); + if (ptr == nullptr) error->one(FLERR,"Need to include number of atomic species on" " meam/spline line in multi-element potential file"); nelements = atoi(ptr); @@ -493,8 +493,8 @@ void PairMEAMSpline::read_file(const char* filename) delete [] elements; elements = new char*[nelements]; for (int i=0; ione(FLERR, "Not enough atomic species in meam/spline" " line of multi-element potential file"); elements[i] = new char[strlen(ptr)+1]; @@ -674,27 +674,27 @@ void PairMEAMSpline::SplineFunction::parse(FILE* fp, Error* error, // If new format, read the spline format. Should always be "spline3eq" for now. if (isNewFormat) - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse number of spline knots. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); int n = atoi(line); if(n < 2) error->one(FLERR,"Invalid number of spline knots in MEAM potential file"); // Parse first derivatives at beginning and end of spline. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); double d0 = atof(strtok(line, " \t\n\r\f")); - double dN = atof(strtok(NULL, " \t\n\r\f")); + double dN = atof(strtok(nullptr, " \t\n\r\f")); init(n, d0, dN); // Skip line in old format if (!isNewFormat) - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse knot coordinates. for(int i=0; ione(FLERR,"Invalid knot line in MEAM potential file"); diff --git a/src/USER-MISC/pair_meam_spline.h b/src/USER-MISC/pair_meam_spline.h index 2e6e7e00f3..31be826d0d 100644 --- a/src/USER-MISC/pair_meam_spline.h +++ b/src/USER-MISC/pair_meam_spline.h @@ -74,7 +74,7 @@ protected: class SplineFunction { public: /// Default constructor. - SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {} + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. ~SplineFunction() { @@ -205,7 +205,7 @@ protected: double cutoff() const { return X[N-1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = NULL) const; + void writeGnuplot(const char* filename, const char* title = nullptr) const; /// Broadcasts the spline function parameters to all processors. void communicate(MPI_Comm& world, int me); diff --git a/src/USER-MISC/pair_meam_sw_spline.cpp b/src/USER-MISC/pair_meam_sw_spline.cpp index 8d33a6f04f..a8977a09d4 100644 --- a/src/USER-MISC/pair_meam_sw_spline.cpp +++ b/src/USER-MISC/pair_meam_sw_spline.cpp @@ -25,7 +25,7 @@ #include "pair_meam_sw_spline.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -35,7 +35,7 @@ #include "neigh_request.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -49,13 +49,13 @@ PairMEAMSWSpline::PairMEAMSWSpline(LAMMPS *lmp) : Pair(lmp) manybody_flag = 1; nelements = 0; - elements = NULL; + elements = nullptr; - Uprime_values = NULL; - //ESWprime_values = NULL; + Uprime_values = nullptr; + //ESWprime_values = nullptr; nmax = 0; maxNeighbors = 0; - twoBodyInfo = NULL; + twoBodyInfo = nullptr; comm_forward = 1; comm_reverse = 0; @@ -393,7 +393,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -402,7 +402,7 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -460,8 +460,8 @@ void PairMEAMSWSpline::coeff(int narg, char **arg) void PairMEAMSWSpline::read_file(const char* filename) { if(comm->me == 0) { - FILE *fp = force->open_potential(filename); - if(fp == NULL) { + FILE *fp = utils::open_potential(filename,lmp,nullptr); + if(fp == nullptr) { char str[1024]; snprintf(str,1024,"Cannot open spline MEAM potential file %s", filename); error->one(FLERR,str); @@ -601,23 +601,23 @@ void PairMEAMSWSpline::SplineFunction::parse(FILE* fp, Error* error) char line[MAXLINE]; // Parse number of spline knots. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); int n = atoi(line); if(n < 2) error->one(FLERR,"Invalid number of spline knots in MEAM potential file"); // Parse first derivatives at beginning and end of spline. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); double d0 = atof(strtok(line, " \t\n\r\f")); - double dN = atof(strtok(NULL, " \t\n\r\f")); + double dN = atof(strtok(nullptr, " \t\n\r\f")); init(n, d0, dN); // Skip line. - utils::sfgets(FLERR,line,MAXLINE,fp,NULL,error); + utils::sfgets(FLERR,line,MAXLINE,fp,nullptr,error); // Parse knot coordinates. for(int i=0; ione(FLERR,"Invalid knot line in MEAM potential file"); diff --git a/src/USER-MISC/pair_meam_sw_spline.h b/src/USER-MISC/pair_meam_sw_spline.h index b4480050db..1fd59b34a5 100644 --- a/src/USER-MISC/pair_meam_sw_spline.h +++ b/src/USER-MISC/pair_meam_sw_spline.h @@ -62,7 +62,7 @@ protected: public: /// Default constructor. - SplineFunction() : X(NULL), Xs(NULL), Y(NULL), Y2(NULL), Ydelta(NULL), N(0) {} + SplineFunction() : X(nullptr), Xs(nullptr), Y(nullptr), Y2(nullptr), Ydelta(nullptr), N(0) {} /// Destructor. ~SplineFunction() { @@ -188,7 +188,7 @@ protected: double cutoff() const { return X[N-1]; } /// Writes a Gnuplot script that plots the spline function. - void writeGnuplot(const char* filename, const char* title = NULL) const; + void writeGnuplot(const char* filename, const char* title = nullptr) const; /// Broadcasts the spline function parameters to all processors. void communicate(MPI_Comm& world, int me); diff --git a/src/USER-MISC/pair_momb.cpp b/src/USER-MISC/pair_momb.cpp index 010aa1e5fd..997e334537 100644 --- a/src/USER-MISC/pair_momb.cpp +++ b/src/USER-MISC/pair_momb.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_momb.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "citeme.h" using namespace LAMMPS_NS; @@ -189,9 +189,9 @@ void PairMomb::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); - sscale = force->numeric(FLERR,arg[1]); - dscale = force->numeric(FLERR,arg[2]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); + sscale = utils::numeric(FLERR,arg[1],false,lmp); + dscale = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -215,17 +215,17 @@ void PairMomb::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); - double c_one = force->numeric(FLERR,arg[5]); - double rr_one = force->numeric(FLERR,arg[6]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double rr_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -308,16 +308,16 @@ void PairMomb::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rr[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rr[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -349,11 +349,11 @@ void PairMomb::write_restart_settings(FILE *fp) void PairMomb::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sscale,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&dscale,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sscale,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&dscale,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&sscale,1,MPI_DOUBLE,0,world); diff --git a/src/USER-MISC/pair_morse_smooth_linear.cpp b/src/USER-MISC/pair_morse_smooth_linear.cpp index 7513eebd98..73e0bb3c69 100644 --- a/src/USER-MISC/pair_morse_smooth_linear.cpp +++ b/src/USER-MISC/pair_morse_smooth_linear.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_morse_smooth_linear.h" -#include + #include #include #include "atom.h" @@ -21,7 +21,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -162,7 +162,7 @@ void PairMorseSmoothLinear::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -184,15 +184,15 @@ void PairMorseSmoothLinear::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -269,14 +269,14 @@ void PairMorseSmoothLinear::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -303,8 +303,8 @@ void PairMorseSmoothLinear::write_restart_settings(FILE *fp) void PairMorseSmoothLinear::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -361,5 +361,5 @@ void *PairMorseSmoothLinear::extract(const char *str, int &dim) if (strcmp(str,"d0") == 0) return (void *) d0; if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; - return NULL; + return nullptr; } diff --git a/src/USER-MISC/pair_srp.cpp b/src/USER-MISC/pair_srp.cpp index d0e73b265d..d26a0b28df 100644 --- a/src/USER-MISC/pair_srp.cpp +++ b/src/USER-MISC/pair_srp.cpp @@ -26,9 +26,9 @@ Please contact Timothy Sirk for questions (tim.sirk@us.army.mil). ------------------------------------------------------------------------- */ #include "pair_srp.h" -#include + #include -#include + #include #include "atom.h" #include "comm.h" @@ -44,7 +44,7 @@ Please contact Timothy Sirk for questions (tim.sirk@us.army.mil). #include "thermo.h" #include "output.h" #include "citeme.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -76,7 +76,7 @@ PairSRP::PairSRP(LAMMPS *lmp) : Pair(lmp) if (lmp->citeme) lmp->citeme->add(cite_srp); nextra = 1; - segment = NULL; + segment = nullptr; // generate unique fix-id for this pair style instance @@ -362,12 +362,12 @@ void PairSRP::settings(int narg, char **arg) if (atom->tag_enable == 0) error->all(FLERR,"Pair_style srp requires atom IDs"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // wildcard if (strcmp(arg[1],"*") == 0) { btype = 0; } else { - btype = force->inumeric(FLERR,arg[1]); + btype = utils::inumeric(FLERR,arg[1],false,lmp); if ((btype > atom->nbondtypes) || (btype <= 0)) error->all(FLERR,"Illegal pair_style command"); } @@ -401,7 +401,7 @@ void PairSRP::settings(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"bptype") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair srp command"); - bptype = force->inumeric(FLERR,arg[iarg+1]); + bptype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if ((bptype < 1) || (bptype > atom->ntypes)) error->all(FLERR,"Illegal bond particle type for srp"); iarg += 2; @@ -429,12 +429,12 @@ void PairSRP::coeff(int narg, char **arg) // set ij bond-bond cutoffs int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], bptype, ilo, ihi); - force->bounds(FLERR,arg[1], bptype, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, bptype, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, bptype, jlo, jhi, error); - double a0_one = force->numeric(FLERR,arg[2]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) @@ -704,12 +704,12 @@ void PairSRP::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -737,12 +737,12 @@ void PairSRP::write_restart_settings(FILE *fp) void PairSRP::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&bptype,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&btype,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&min,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&midpoint,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&exclude,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&bptype,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&btype,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&min,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&midpoint,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&exclude,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); } diff --git a/src/USER-MISC/pair_tersoff_table.cpp b/src/USER-MISC/pair_tersoff_table.cpp index 4df172a001..b823a17ca0 100644 --- a/src/USER-MISC/pair_tersoff_table.cpp +++ b/src/USER-MISC/pair_tersoff_table.cpp @@ -21,9 +21,9 @@ ------------------------------------------------------------------------- */ #include "pair_tersoff_table.h" -#include + #include -#include + #include #include "atom.h" #include "neighbor.h" @@ -32,7 +32,7 @@ #include "force.h" #include "comm.h" #include "memory.h" -#include "utils.h" + #include "tokenizer.h" #include "potential_file_reader.h" @@ -755,7 +755,7 @@ void PairTersoffTable::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -764,7 +764,7 @@ void PairTersoffTable::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -923,7 +923,7 @@ void PairTersoffTable::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/USER-MISC/temper_grem.cpp b/src/USER-MISC/temper_grem.cpp index 866f923fb9..c3c6d89fb6 100644 --- a/src/USER-MISC/temper_grem.cpp +++ b/src/USER-MISC/temper_grem.cpp @@ -67,9 +67,9 @@ void TemperGrem::command(int narg, char **arg) if (narg != 7 && narg != 8) error->universe_all(FLERR,"Illegal temper command"); - int nsteps = force->inumeric(FLERR,arg[0]); - nevery = force->inumeric(FLERR,arg[1]); - double lambda = force->numeric(FLERR,arg[2]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + nevery = utils::inumeric(FLERR,arg[1],false,lmp); + double lambda = utils::numeric(FLERR,arg[2],false,lmp); // ignore temper command, if walltime limit was already reached if (timer->is_timeout()) return; @@ -106,11 +106,11 @@ void TemperGrem::command(int narg, char **arg) pressref = p_start[0]; } - seed_swap = force->inumeric(FLERR,arg[5]); - seed_boltz = force->inumeric(FLERR,arg[6]); + seed_swap = utils::inumeric(FLERR,arg[5],false,lmp); + seed_boltz = utils::inumeric(FLERR,arg[6],false,lmp); my_set_lambda = universe->iworld; - if (narg == 8) my_set_lambda = force->inumeric(FLERR,arg[7]); + if (narg == 8) my_set_lambda = utils::inumeric(FLERR,arg[7],false,lmp); if ((my_set_lambda < 0) || (my_set_lambda >= universe->nworlds)) error->universe_one(FLERR,"Illegal temperature index"); @@ -167,7 +167,7 @@ void TemperGrem::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/USER-MISC/temper_npt.cpp b/src/USER-MISC/temper_npt.cpp index d0a14d8e4d..288be333f7 100644 --- a/src/USER-MISC/temper_npt.cpp +++ b/src/USER-MISC/temper_npt.cpp @@ -18,22 +18,23 @@ ------------------------------------------------------------------------- */ #include "temper_npt.h" -#include -#include -#include "universe.h" -#include "domain.h" + #include "atom.h" -#include "update.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "fix.h" +#include "force.h" #include "integrate.h" #include "modify.h" -#include "compute.h" -#include "force.h" -#include "fix.h" #include "random_park.h" -#include "finish.h" #include "timer.h" -#include "error.h" -#include "utils.h" +#include "universe.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -69,10 +70,10 @@ void TemperNPT::command(int narg, char **arg) if (narg != 7 && narg != 8) error->universe_all(FLERR,"Illegal temper/npt command"); - int nsteps = force->inumeric(FLERR,arg[0]); - nevery = force->inumeric(FLERR,arg[1]); - double temp = force->numeric(FLERR,arg[2]); - double press_set = force->numeric(FLERR,arg[6]); + int nsteps = utils::inumeric(FLERR,arg[0],false,lmp); + nevery = utils::inumeric(FLERR,arg[1],false,lmp); + double temp = utils::numeric(FLERR,arg[2],false,lmp); + double press_set = utils::numeric(FLERR,arg[6],false,lmp); // ignore temper command, if walltime limit was already reached @@ -83,11 +84,11 @@ void TemperNPT::command(int narg, char **arg) if (whichfix == modify->nfix) error->universe_all(FLERR,"Tempering fix ID is not defined"); - seed_swap = force->inumeric(FLERR,arg[4]); - seed_boltz = force->inumeric(FLERR,arg[5]); + seed_swap = utils::inumeric(FLERR,arg[4],false,lmp); + seed_boltz = utils::inumeric(FLERR,arg[5],false,lmp); my_set_temp = universe->iworld; - if (narg == 8) my_set_temp = force->inumeric(FLERR,arg[6]); + if (narg == 8) my_set_temp = utils::inumeric(FLERR,arg[6],false,lmp); // swap frequency must evenly divide total # of timesteps @@ -147,7 +148,7 @@ void TemperNPT::command(int narg, char **arg) // warm up Boltzmann RNG if (seed_swap) ranswap = new RanPark(lmp,seed_swap); - else ranswap = NULL; + else ranswap = nullptr; ranboltz = new RanPark(lmp,seed_boltz + me_universe); for (int i = 0; i < 100; i++) ranboltz->uniform(); diff --git a/src/USER-MOFFF/angle_class2_p6.cpp b/src/USER-MOFFF/angle_class2_p6.cpp index 839148bc13..4909746571 100644 --- a/src/USER-MOFFF/angle_class2_p6.cpp +++ b/src/USER-MOFFF/angle_class2_p6.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "angle_class2_p6.h" -#include + #include #include #include "atom.h" @@ -28,7 +28,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -280,16 +280,16 @@ void AngleClass2P6::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); int count = 0; if (strcmp(arg[1],"bb") == 0) { if (narg != 5) error->all(FLERR,"Incorrect args for angle coefficients"); - double bb_k_one = force->numeric(FLERR,arg[2]); - double bb_r1_one = force->numeric(FLERR,arg[3]); - double bb_r2_one = force->numeric(FLERR,arg[4]); + double bb_k_one = utils::numeric(FLERR,arg[2],false,lmp); + double bb_r1_one = utils::numeric(FLERR,arg[3],false,lmp); + double bb_r2_one = utils::numeric(FLERR,arg[4],false,lmp); for (int i = ilo; i <= ihi; i++) { bb_k[i] = bb_k_one; @@ -302,10 +302,10 @@ void AngleClass2P6::coeff(int narg, char **arg) } else if (strcmp(arg[1],"ba") == 0) { if (narg != 6) error->all(FLERR,"Incorrect args for angle coefficients"); - double ba_k1_one = force->numeric(FLERR,arg[2]); - double ba_k2_one = force->numeric(FLERR,arg[3]); - double ba_r1_one = force->numeric(FLERR,arg[4]); - double ba_r2_one = force->numeric(FLERR,arg[5]); + double ba_k1_one = utils::numeric(FLERR,arg[2],false,lmp); + double ba_k2_one = utils::numeric(FLERR,arg[3],false,lmp); + double ba_r1_one = utils::numeric(FLERR,arg[4],false,lmp); + double ba_r2_one = utils::numeric(FLERR,arg[5],false,lmp); for (int i = ilo; i <= ihi; i++) { ba_k1[i] = ba_k1_one; @@ -319,12 +319,12 @@ void AngleClass2P6::coeff(int narg, char **arg) } else { if (narg != 7) error->all(FLERR,"Incorrect args for angle coefficients"); - double theta0_one = force->numeric(FLERR,arg[1]); - double k2_one = force->numeric(FLERR,arg[2]); - double k3_one = force->numeric(FLERR,arg[3]); - double k4_one = force->numeric(FLERR,arg[4]); - double k5_one = force->numeric(FLERR,arg[5]); - double k6_one = force->numeric(FLERR,arg[6]); + double theta0_one = utils::numeric(FLERR,arg[1],false,lmp); + double k2_one = utils::numeric(FLERR,arg[2],false,lmp); + double k3_one = utils::numeric(FLERR,arg[3],false,lmp); + double k4_one = utils::numeric(FLERR,arg[4],false,lmp); + double k5_one = utils::numeric(FLERR,arg[5],false,lmp); + double k6_one = utils::numeric(FLERR,arg[6],false,lmp); // convert theta0 from degrees to radians @@ -386,21 +386,21 @@ void AngleClass2P6::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k5[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&k6[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k3[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k4[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k5[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&k6[1],sizeof(double),atom->nangletypes,fp,nullptr,error); - utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&bb_k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&bb_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); - utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&ba_k1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&ba_r2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/angle_cosine_buck6d.cpp b/src/USER-MOFFF/angle_cosine_buck6d.cpp index a6643601c1..7d08467be4 100644 --- a/src/USER-MOFFF/angle_cosine_buck6d.cpp +++ b/src/USER-MOFFF/angle_cosine_buck6d.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "angle_cosine_buck6d.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -28,7 +28,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -251,11 +251,11 @@ void AngleCosineBuck6d::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); - double c_one = force->numeric(FLERR,arg[1]); - int n_one = force->inumeric(FLERR,arg[2]); - int th0_one = force->numeric(FLERR,arg[3]); + double c_one = utils::numeric(FLERR,arg[1],false,lmp); + int n_one = utils::inumeric(FLERR,arg[2],false,lmp); + int th0_one = utils::numeric(FLERR,arg[3],false,lmp); if (n_one <= 0) error->all(FLERR,"Incorrect args for angle coefficients"); @@ -281,7 +281,7 @@ void AngleCosineBuck6d::init_style() { // set local ptrs to buck6d 13 arrays setup by Pair int itmp; - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Angle cosine/buck6d is incompatible with Pair style"); cut_ljsq = (double **) force->pair->extract("cut_ljsq",itmp); buck6d1 = (double **) force->pair->extract("buck6d1",itmp); @@ -332,9 +332,9 @@ void AngleCosineBuck6d::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&th0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&multiplicity[1],sizeof(int),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&th0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/improper_inversion_harmonic.cpp b/src/USER-MOFFF/improper_inversion_harmonic.cpp index e38b82067d..96faebc85c 100644 --- a/src/USER-MOFFF/improper_inversion_harmonic.cpp +++ b/src/USER-MOFFF/improper_inversion_harmonic.cpp @@ -20,7 +20,7 @@ ------------------------------------------------------------------------- */ #include "improper_inversion_harmonic.h" -#include + #include #include "atom.h" #include "comm.h" @@ -29,7 +29,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -276,10 +276,10 @@ void ImproperInversionHarmonic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double w_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double w_one = utils::numeric(FLERR,arg[2],false,lmp); // convert w0 from degrees to radians @@ -313,8 +313,8 @@ void ImproperInversionHarmonic::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&kw[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&w0[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&kw[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&w0[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp index 57a935a0b3..1e6a0417e9 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_dsf.cpp @@ -29,7 +29,7 @@ #include "memory.h" #include "math_const.h" #include "error.h" -#include "utils.h" + #include "math_special.h" using namespace LAMMPS_NS; @@ -247,11 +247,11 @@ void PairBuck6dCoulGaussDSF::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - vdwl_smooth = force->numeric(FLERR,arg[0]); + vdwl_smooth = utils::numeric(FLERR,arg[0],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[1]); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -275,17 +275,17 @@ void PairBuck6dCoulGaussDSF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double buck6d1_one = force->numeric(FLERR,arg[2]); - double buck6d2_one = force->numeric(FLERR,arg[3]); - double buck6d3_one = force->numeric(FLERR,arg[4]); - double buck6d4_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); + double buck6d1_one = utils::numeric(FLERR,arg[2],false,lmp); + double buck6d2_one = utils::numeric(FLERR,arg[3],false,lmp); + double buck6d3_one = utils::numeric(FLERR,arg[4],false,lmp); + double buck6d4_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -415,16 +415,16 @@ void PairBuck6dCoulGaussDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck6d1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck6d2[i][j],1,MPI_DOUBLE,0,world); @@ -457,12 +457,12 @@ void PairBuck6dCoulGaussDSF::write_restart_settings(FILE *fp) void PairBuck6dCoulGaussDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&vdwl_smooth,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); @@ -584,5 +584,5 @@ void *PairBuck6dCoulGaussDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp index d3ccec3a55..3286abe773 100644 --- a/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp +++ b/src/USER-MOFFF/pair_buck6d_coul_gauss_long.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_buck6d_coul_gauss_long.h" -#include + #include #include #include "atom.h" @@ -29,7 +29,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "math_special.h" using namespace LAMMPS_NS; @@ -262,12 +262,12 @@ void PairBuck6dCoulGaussLong::settings(int narg, char **arg) { if (narg < 3 || narg > 4) error->all(FLERR,"Illegal pair_style command"); - vdwl_smooth = force->numeric(FLERR,arg[0]); - coul_smooth = force->numeric(FLERR,arg[1]); + vdwl_smooth = utils::numeric(FLERR,arg[0],false,lmp); + coul_smooth = utils::numeric(FLERR,arg[1],false,lmp); - cut_lj_global = force->numeric(FLERR,arg[2]); + cut_lj_global = utils::numeric(FLERR,arg[2],false,lmp); if (narg == 3) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[3]); + else cut_coul = utils::numeric(FLERR,arg[3],false,lmp); // reset cutoffs that have been explicitly set @@ -291,17 +291,17 @@ void PairBuck6dCoulGaussLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double buck6d1_one = force->numeric(FLERR,arg[2]); - double buck6d2_one = force->numeric(FLERR,arg[3]); - double buck6d3_one = force->numeric(FLERR,arg[4]); - double buck6d4_one = force->numeric(FLERR,arg[5]); - double alpha_one = force->numeric(FLERR,arg[6]); + double buck6d1_one = utils::numeric(FLERR,arg[2],false,lmp); + double buck6d2_one = utils::numeric(FLERR,arg[3],false,lmp); + double buck6d3_one = utils::numeric(FLERR,arg[4],false,lmp); + double buck6d4_one = utils::numeric(FLERR,arg[5],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -331,7 +331,7 @@ void PairBuck6dCoulGaussLong::init_style() // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -447,16 +447,16 @@ void PairBuck6dCoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&buck6d1[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d2[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d3[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&buck6d4[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha_ij[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&buck6d1[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&buck6d2[i][j],1,MPI_DOUBLE,0,world); @@ -490,13 +490,13 @@ void PairBuck6dCoulGaussLong::write_restart_settings(FILE *fp) void PairBuck6dCoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&coul_smooth,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&vdwl_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&coul_smooth,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&vdwl_smooth,1,MPI_DOUBLE,0,world); MPI_Bcast(&coul_smooth,1,MPI_DOUBLE,0,world); @@ -639,5 +639,5 @@ void *PairBuck6dCoulGaussLong::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/USER-MOLFILE/dump_molfile.cpp b/src/USER-MOLFILE/dump_molfile.cpp index d9d8ec3c97..6b25d62f33 100644 --- a/src/USER-MOLFILE/dump_molfile.cpp +++ b/src/USER-MOLFILE/dump_molfile.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "dump_molfile.h" -#include + #include #include #include "domain.h" @@ -72,10 +72,10 @@ DumpMolfile::DumpMolfile(LAMMPS *lmp, int narg, char **arg) ntotal = 0; me = comm->me; - coords = vels = masses = charges = radiuses = NULL; - types = molids = NULL; + coords = vels = masses = charges = radiuses = nullptr; + types = molids = nullptr; ntypes = atom->ntypes; - typenames = NULL; + typenames = nullptr; // allocate global array for atom coords @@ -132,7 +132,7 @@ DumpMolfile::~DumpMolfile() delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } } @@ -146,7 +146,7 @@ void DumpMolfile::init_style() if (me == 0) { /* initialize typenames array to numeric types by default */ - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { /* a 32-bit int can be maximally 10 digits plus sign */ @@ -408,7 +408,7 @@ void DumpMolfile::write_data(int n, double *mybuf) need_structure = 0; } double simtime = update->ntimestep * update->dt; - mf->timestep(coords,NULL,cell,&simtime); + mf->timestep(coords,nullptr,cell,&simtime); } } } @@ -433,7 +433,7 @@ int DumpMolfile::modify_param(int narg, char **arg) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; @@ -452,9 +452,9 @@ int DumpMolfile::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf and global coords array ------------------------------------------------------------------------- */ -bigint DumpMolfile::memory_usage() +double DumpMolfile::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); bytes += sizeof(MFI); return bytes; diff --git a/src/USER-MOLFILE/dump_molfile.h b/src/USER-MOLFILE/dump_molfile.h index c99d1cc5ea..f07416cffa 100644 --- a/src/USER-MOLFILE/dump_molfile.h +++ b/src/USER-MOLFILE/dump_molfile.h @@ -51,7 +51,7 @@ class DumpMolfile : public Dump { virtual void write_header(bigint) {}; virtual void pack(tagint *); virtual void write_data(int, double *); - virtual bigint memory_usage(); + virtual double memory_usage(); virtual void openfile(); }; diff --git a/src/USER-MOLFILE/molfile_interface.cpp b/src/USER-MOLFILE/molfile_interface.cpp index 798beaee09..485be5172d 100644 --- a/src/USER-MOLFILE/molfile_interface.cpp +++ b/src/USER-MOLFILE/molfile_interface.cpp @@ -16,10 +16,10 @@ ------------------------------------------------------------------------- */ #include "molfile_interface.h" +#include "molfile_plugin.h" #include #include -#include #include #include #include @@ -31,8 +31,6 @@ #include #endif -#include "molfile_plugin.h" - #if vmdplugin_ABIVERSION < 16 #error "unsupported VMD molfile plugin ABI version" #endif @@ -177,7 +175,7 @@ extern "C" { int i, ind; char atom[3]; - if (label != NULL) { + if (label != nullptr) { /* zap string */ atom[0] = atom[1] = atom[2] = '\0'; @@ -219,8 +217,8 @@ extern "C" { dirhandle_t *d; int len; - if (dirname == NULL) - return NULL; + if (dirname == nullptr) + return nullptr; d = new dirhandle_t; len = 2 + strlen(dirname); @@ -239,7 +237,7 @@ extern "C" { delete[] d->searchname; delete[] d->name; delete d; - return NULL; + return nullptr; } return d; } @@ -250,13 +248,13 @@ extern "C" { if (FindNextFile(d->h, &(d->fd))) { return d->fd.cFileName; } - return NULL; + return nullptr; } // close directory handle static void my_closedir(dirhandle_t *d) { - if (d->h != NULL) { + if (d->h != nullptr) { FindClose(d->h); } delete[] d->searchname; @@ -295,7 +293,7 @@ extern "C" { dirhandle_t *d; int len; - if (dirname == NULL) return NULL; + if (dirname == nullptr) return nullptr; d = new dirhandle_t; len = 2 + strlen(dirname); @@ -305,10 +303,10 @@ extern "C" { d->dlen = len; d->d = opendir(d->name); - if (d->d == NULL) { + if (d->d == nullptr) { delete[] d->name; delete d; - return NULL; + return nullptr; } return d; } @@ -318,17 +316,17 @@ extern "C" { { struct dirent *p; - if ((p = readdir(d->d)) != NULL) { + if ((p = readdir(d->d)) != nullptr) { return p->d_name; } - return NULL; + return nullptr; } // close directory handle static void my_closedir(dirhandle_t *d) { - if (d->d != NULL) { + if (d->d != nullptr) { closedir(d->d); } delete[] d->name; @@ -376,7 +374,7 @@ MolfileInterface::~MolfileInterface() if (_info) { molfile_atom_t *a = static_cast(_info); delete[] a; - _info = NULL; + _info = nullptr; } delete[] _name; delete[] _type; @@ -394,7 +392,7 @@ int MolfileInterface::find_plugin(const char *pluginpath) #else #define MY_PATHSEP ':' #endif - if (pluginpath == NULL) return E_DIR; + if (pluginpath == nullptr) return E_DIR; plugindir = path = strdup(pluginpath); while (plugindir) { @@ -415,11 +413,11 @@ int MolfileInterface::find_plugin(const char *pluginpath) int len; filename = my_readdir(dir); - if (filename == NULL) break; + if (filename == nullptr) break; // only look at .so files ext = strrchr(filename, '.'); - if (ext == NULL) continue; + if (ext == nullptr) continue; if (strcasecmp(ext,".so") != 0) continue; // construct full pathname of potential DSO @@ -452,14 +450,14 @@ int MolfileInterface::load_plugin(const char *filename) // access shared object dso = my_dlopen(filename); - if (dso == NULL) + if (dso == nullptr) return E_FILE; // check for required plugin symbols void *ifunc = my_dlsym(dso,"vmdplugin_init"); void *rfunc = my_dlsym(dso,"vmdplugin_register"); void *ffunc = my_dlsym(dso,"vmdplugin_fini"); - if (ifunc == NULL || rfunc == NULL || ffunc == NULL) { + if (ifunc == nullptr || rfunc == nullptr || ffunc == nullptr) { my_dlclose(dso); return E_SYMBOL; } @@ -474,7 +472,7 @@ int MolfileInterface::load_plugin(const char *filename) // the callback will be called for each plugin in the DSO and // check the file type. plugin->name will change if successful. plugin_reginfo_t reginfo; - reginfo.p = NULL; + reginfo.p = nullptr; reginfo.name=_type; ((regfunc)rfunc)(®info, plugin_register_cb); @@ -483,7 +481,7 @@ int MolfileInterface::load_plugin(const char *filename) // if the callback found a matching plugin and copied the struct, // its name element will point to a different location now. - if (plugin == NULL) { + if (plugin == nullptr) { retval = E_TYPE; // check if the ABI matches the one used to compile this code @@ -492,16 +490,16 @@ int MolfileInterface::load_plugin(const char *filename) // check if (basic) reading is supported } else if ((_mode & M_READ) && - ( (plugin->open_file_read == NULL) || - (plugin->read_next_timestep == NULL) || - (plugin->close_file_read == NULL) )) { + ( (plugin->open_file_read == nullptr) || + (plugin->read_next_timestep == nullptr) || + (plugin->close_file_read == nullptr) )) { retval = E_MODE; // check if (basic) writing is supported } else if ( (_mode & M_WRITE) && - ( (plugin->open_file_write == NULL) || - (plugin->write_timestep == NULL) || - (plugin->close_file_write == NULL) )) { + ( (plugin->open_file_write == nullptr) || + (plugin->write_timestep == nullptr) || + (plugin->close_file_write == nullptr) )) { retval = E_MODE; // make some additional check, if we @@ -581,7 +579,7 @@ void MolfileInterface::forget_plugin() close(); if (_plugin) - _plugin = NULL; + _plugin = nullptr; if (_dso) { void *ffunc = my_dlsym(_dso,"vmdplugin_fini"); @@ -589,7 +587,7 @@ void MolfileInterface::forget_plugin() ((finifunc)ffunc)(); my_dlclose(_dso); } - _dso = NULL; + _dso = nullptr; delete[] _name; _name = new char[5]; @@ -610,7 +608,7 @@ int MolfileInterface::open(const char *name, int *natoms) else if (_mode & M_READ) _ptr = p->open_file_read(name,_type,natoms); - if (_ptr == NULL) + if (_ptr == nullptr) return E_FILE; _natoms = *natoms; @@ -683,9 +681,9 @@ int MolfileInterface::close() if (_info) { molfile_atom_t *a = static_cast(_info); delete[] a; - _info = NULL; + _info = nullptr; } - _ptr = NULL; + _ptr = nullptr; _natoms = 0; return E_NONE; @@ -706,7 +704,7 @@ int MolfileInterface::timestep(float *coords, float *vels, if (_mode & M_WRITE) { t->coords = coords; t->velocities = vels; - if (cell != NULL) { + if (cell != nullptr) { t->A = cell[0]; t->B = cell[1]; t->C = cell[2]; @@ -731,8 +729,8 @@ int MolfileInterface::timestep(float *coords, float *vels, } else { // no coordinate storage => skip step - if (coords == NULL) { - rv = p->read_next_timestep(_ptr, _natoms, NULL); + if (coords == nullptr) { + rv = p->read_next_timestep(_ptr, _natoms, nullptr); } else { t->coords = coords; t->velocities = vels; @@ -744,7 +742,7 @@ int MolfileInterface::timestep(float *coords, float *vels, t->gamma = 90.0f; t->physical_time = 0.0; rv = p->read_next_timestep(_ptr, _natoms, t); - if (cell != NULL) { + if (cell != nullptr) { cell[0] = t->A; cell[1] = t->B; cell[2] = t->C; @@ -825,7 +823,7 @@ static int read_int_property(molfile_atom_t &a, const int propid) static const char *read_string_property(molfile_atom_t &a, const int propid) { - const char *prop = NULL; + const char *prop = nullptr; int iprop = 0; PROPUPDATE(MolfileInterface::P_NAME,name,prop); PROPUPDATE(MolfileInterface::P_TYPE,type,prop); @@ -912,7 +910,7 @@ static int write_atom_property(molfile_atom_t &a, // set/get atom floating point property int MolfileInterface::property(int propid, int idx, float *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -929,7 +927,7 @@ int MolfileInterface::property(int propid, int idx, float *prop) // set/get per type floating point property int MolfileInterface::property(int propid, int *types, float *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -949,7 +947,7 @@ int MolfileInterface::property(int propid, int *types, float *prop) // set/get per atom floating point property int MolfileInterface::property(int propid, float *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -970,7 +968,7 @@ int MolfileInterface::property(int propid, float *prop) // set/get atom floating point property int MolfileInterface::property(int propid, int idx, double *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -987,7 +985,7 @@ int MolfileInterface::property(int propid, int idx, double *prop) // set/get per type floating point property int MolfileInterface::property(int propid, int *types, double *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1007,7 +1005,7 @@ int MolfileInterface::property(int propid, int *types, double *prop) // set/get per atom floating point property int MolfileInterface::property(int propid, double *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1042,7 +1040,7 @@ int MolfileInterface::property(int propid, double *prop) // set/get atom integer property int MolfileInterface::property(int propid, int idx, int *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1067,7 +1065,7 @@ int MolfileInterface::property(int propid, int idx, int *prop) // set/get per type integer property int MolfileInterface::property(int propid, int *types, int *prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1096,7 +1094,7 @@ int MolfileInterface::property(int propid, int *types, int *prop) // set/get per atom integer property int MolfileInterface::property(int propid, int *prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1127,7 +1125,7 @@ int MolfileInterface::property(int propid, int *prop) // set/get atom string property int MolfileInterface::property(int propid, int idx, char *prop) { - if ((_info == NULL) || (prop == NULL) || (idx < 0) || (idx >= _natoms)) + if ((_info == nullptr) || (prop == nullptr) || (idx < 0) || (idx >= _natoms)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1145,7 +1143,7 @@ int MolfileInterface::property(int propid, int idx, char *prop) // set/get per type string property int MolfileInterface::property(int propid, int *types, char **prop) { - if ((_info == NULL) || (types == NULL) || (prop == NULL)) + if ((_info == nullptr) || (types == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); @@ -1166,7 +1164,7 @@ int MolfileInterface::property(int propid, int *types, char **prop) // set/get per atom string property int MolfileInterface::property(int propid, char **prop) { - if ((_info == NULL) || (prop == NULL)) + if ((_info == nullptr) || (prop == nullptr)) return P_NONE; molfile_atom_t *a = static_cast(_info); diff --git a/src/USER-MOLFILE/reader_molfile.cpp b/src/USER-MOLFILE/reader_molfile.cpp index 292a451a87..c991318118 100644 --- a/src/USER-MOLFILE/reader_molfile.cpp +++ b/src/USER-MOLFILE/reader_molfile.cpp @@ -16,15 +16,14 @@ ------------------------------------------------------------------------- */ #include "reader_molfile.h" -#include -#include -#include "comm.h" -#include "memory.h" -#include "error.h" - #include "molfile_interface.h" -#include "math_const.h" +#include "comm.h" +#include "error.h" +#include "math_const.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; typedef MolfileInterface MFI; using namespace MathConst; @@ -43,11 +42,11 @@ static bool is_smalldiff(const float &val1, const float &val2) ReaderMolfile::ReaderMolfile(LAMMPS *lmp) : Reader(lmp) { - mf = NULL; - coords = NULL; - vels = NULL; - types = NULL; - fieldindex = NULL; + mf = nullptr; + coords = nullptr; + vels = nullptr; + types = nullptr; + fieldindex = nullptr; nstep = 0; needvels = 0; me = comm->me; @@ -157,7 +156,7 @@ int ReaderMolfile::read_time(bigint &ntimestep) int rv; // try to read in the time step (coordinates, velocities and cell only) - rv = mf->timestep(coords, vels, cell, NULL); + rv = mf->timestep(coords, vels, cell, nullptr); if (rv != 0) return 1; // we fake time step numbers. @@ -188,7 +187,7 @@ void ReaderMolfile::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ diff --git a/src/USER-NETCDF/dump_netcdf.cpp b/src/USER-NETCDF/dump_netcdf.cpp index f297ef45eb..6d2ab29615 100644 --- a/src/USER-NETCDF/dump_netcdf.cpp +++ b/src/USER-NETCDF/dump_netcdf.cpp @@ -18,7 +18,7 @@ #if defined(LMP_HAS_NETCDF) #include -#include + #include #include #include "dump_netcdf.h" @@ -69,7 +69,7 @@ const int THIS_IS_A_BIGINT = -4; /* ---------------------------------------------------------------------- */ -#define NCERR(x) ncerr(x, NULL, __LINE__) +#define NCERR(x) ncerr(x, nullptr, __LINE__) #define NCERRX(x, descr) ncerr(x, descr, __LINE__) #if !defined(NC_64BIT_DATA) #define NC_64BIT_DATA NC_64BIT_OFFSET @@ -193,13 +193,13 @@ DumpNetCDF::DumpNetCDF(LAMMPS *lmp, int narg, char **arg) : } n_buffer = 0; - int_buffer = NULL; - double_buffer = NULL; + int_buffer = nullptr; + double_buffer = nullptr; double_precision = false; thermo = false; - thermovar = NULL; + thermovar = nullptr; framei = 0; } @@ -512,7 +512,7 @@ void DumpNetCDF::openfile() NCERR( nc_put_att_text(ncid, NC_GLOBAL, "program", 6, "LAMMPS") ); NCERR( nc_put_att_text(ncid, NC_GLOBAL, "programVersion", - strlen(universe->version), universe->version) ); + strlen(lmp->version), lmp->version) ); // units if (!strcmp(update->unit_style, "lj")) { @@ -990,7 +990,7 @@ int DumpNetCDF::modify_param(int narg, char **arg) iarg++; if (iarg >= narg) error->all(FLERR,"expected additional arg after 'at' keyword."); - framei = force->inumeric(FLERR,arg[iarg]); + framei = utils::inumeric(FLERR,arg[iarg],false,lmp); if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword."); else if (framei < 0) framei--; iarg++; diff --git a/src/USER-NETCDF/dump_netcdf_mpiio.cpp b/src/USER-NETCDF/dump_netcdf_mpiio.cpp index 026a6eaa3a..e0b193fc30 100644 --- a/src/USER-NETCDF/dump_netcdf_mpiio.cpp +++ b/src/USER-NETCDF/dump_netcdf_mpiio.cpp @@ -18,7 +18,7 @@ #if defined(LMP_HAS_PNETCDF) #include -#include + #include #include #include "dump_netcdf_mpiio.h" @@ -69,7 +69,7 @@ const int THIS_IS_A_BIGINT = -4; /* ---------------------------------------------------------------------- */ -#define NCERR(x) ncerr(x, NULL, __LINE__) +#define NCERR(x) ncerr(x, nullptr, __LINE__) #define NCERRX(x, descr) ncerr(x, descr, __LINE__) #if !defined(NC_64BIT_DATA) #define NC_64BIT_DATA NC_64BIT_OFFSET @@ -190,13 +190,13 @@ DumpNetCDFMPIIO::DumpNetCDFMPIIO(LAMMPS *lmp, int narg, char **arg) : } n_buffer = 0; - int_buffer = NULL; - double_buffer = NULL; + int_buffer = nullptr; + double_buffer = nullptr; double_precision = false; thermo = false; - thermovar = NULL; + thermovar = nullptr; framei = 0; } @@ -497,7 +497,7 @@ void DumpNetCDFMPIIO::openfile() NCERR( ncmpi_put_att_text(ncid, NC_GLOBAL, "program", 6, "LAMMPS") ); NCERR( ncmpi_put_att_text(ncid, NC_GLOBAL, "programVersion", - strlen(universe->version), universe->version) ); + strlen(lmp->version), lmp->version) ); // units if (!strcmp(update->unit_style, "lj")) { @@ -767,7 +767,7 @@ void DumpNetCDFMPIIO::write() // pack my data into buf - pack(NULL); + pack(nullptr); // each process writes its data @@ -1003,7 +1003,7 @@ int DumpNetCDFMPIIO::modify_param(int narg, char **arg) iarg++; if (iarg >= narg) error->all(FLERR,"expected additional arg after 'at' keyword."); - framei = force->inumeric(FLERR,arg[iarg]); + framei = utils::inumeric(FLERR,arg[iarg],false,lmp); if (framei == 0) error->all(FLERR,"frame 0 not allowed for 'at' keyword."); else if (framei < 0) framei--; iarg++; diff --git a/src/USER-OMP/angle_charmm_omp.cpp b/src/USER-OMP/angle_charmm_omp.cpp index 6933afdcd9..abc23367b1 100644 --- a/src/USER-OMP/angle_charmm_omp.cpp +++ b/src/USER-OMP/angle_charmm_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_class2_omp.cpp b/src/USER-OMP/angle_class2_omp.cpp index 09ee59d5af..b33b1c2e2f 100644 --- a/src/USER-OMP/angle_class2_omp.cpp +++ b/src/USER-OMP/angle_class2_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_cosine_delta_omp.cpp b/src/USER-OMP/angle_cosine_delta_omp.cpp index ca5afe1449..0c209d3fe5 100644 --- a/src/USER-OMP/angle_cosine_delta_omp.cpp +++ b/src/USER-OMP/angle_cosine_delta_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_cosine_omp.cpp b/src/USER-OMP/angle_cosine_omp.cpp index 48fdd9ba60..cbeb10e08c 100644 --- a/src/USER-OMP/angle_cosine_omp.cpp +++ b/src/USER-OMP/angle_cosine_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_cosine_periodic_omp.cpp b/src/USER-OMP/angle_cosine_periodic_omp.cpp index a0e45fe131..b59046031a 100644 --- a/src/USER-OMP/angle_cosine_periodic_omp.cpp +++ b/src/USER-OMP/angle_cosine_periodic_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "math_special.h" #include "suffix.h" diff --git a/src/USER-OMP/angle_cosine_shift_exp_omp.cpp b/src/USER-OMP/angle_cosine_shift_exp_omp.cpp index 21019336b3..4870e6a3bb 100644 --- a/src/USER-OMP/angle_cosine_shift_exp_omp.cpp +++ b/src/USER-OMP/angle_cosine_shift_exp_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_cosine_shift_omp.cpp b/src/USER-OMP/angle_cosine_shift_omp.cpp index 1e6d712b62..bec65caf6d 100644 --- a/src/USER-OMP/angle_cosine_shift_omp.cpp +++ b/src/USER-OMP/angle_cosine_shift_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_cosine_squared_omp.cpp b/src/USER-OMP/angle_cosine_squared_omp.cpp index 6df1e028a0..dced90a967 100644 --- a/src/USER-OMP/angle_cosine_squared_omp.cpp +++ b/src/USER-OMP/angle_cosine_squared_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_dipole_omp.cpp b/src/USER-OMP/angle_dipole_omp.cpp index 26d8a7817e..cea707161f 100644 --- a/src/USER-OMP/angle_dipole_omp.cpp +++ b/src/USER-OMP/angle_dipole_omp.cpp @@ -23,7 +23,7 @@ #include "error.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_fourier_omp.cpp b/src/USER-OMP/angle_fourier_omp.cpp index b6ddea3ff9..ec9236902c 100644 --- a/src/USER-OMP/angle_fourier_omp.cpp +++ b/src/USER-OMP/angle_fourier_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_fourier_simple_omp.cpp b/src/USER-OMP/angle_fourier_simple_omp.cpp index 992acf7c99..774f06f809 100644 --- a/src/USER-OMP/angle_fourier_simple_omp.cpp +++ b/src/USER-OMP/angle_fourier_simple_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_harmonic_omp.cpp b/src/USER-OMP/angle_harmonic_omp.cpp index 0cfc6f95af..5c81e3cba4 100644 --- a/src/USER-OMP/angle_harmonic_omp.cpp +++ b/src/USER-OMP/angle_harmonic_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_quartic_omp.cpp b/src/USER-OMP/angle_quartic_omp.cpp index a774edb8c4..d6e9285f11 100644 --- a/src/USER-OMP/angle_quartic_omp.cpp +++ b/src/USER-OMP/angle_quartic_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/angle_sdk_omp.cpp b/src/USER-OMP/angle_sdk_omp.cpp index e0bc021f1b..45d6c83aa1 100644 --- a/src/USER-OMP/angle_sdk_omp.cpp +++ b/src/USER-OMP/angle_sdk_omp.cpp @@ -20,7 +20,7 @@ #include #include "atom.h" #include "neighbor.h" -#include "timer.h" + #include "comm.h" #include "force.h" #include "lj_sdk_common.h" diff --git a/src/USER-OMP/angle_table_omp.cpp b/src/USER-OMP/angle_table_omp.cpp index 1af60f85f6..f67d340176 100644 --- a/src/USER-OMP/angle_table_omp.cpp +++ b/src/USER-OMP/angle_table_omp.cpp @@ -22,7 +22,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/bond_class2_omp.cpp b/src/USER-OMP/bond_class2_omp.cpp index 06edf46024..866538dacb 100644 --- a/src/USER-OMP/bond_class2_omp.cpp +++ b/src/USER-OMP/bond_class2_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -56,7 +56,7 @@ void BondClass2OMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_fene_expand_omp.cpp b/src/USER-OMP/bond_fene_expand_omp.cpp index 5f3dd48841..b881ae3b10 100644 --- a/src/USER-OMP/bond_fene_expand_omp.cpp +++ b/src/USER-OMP/bond_fene_expand_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "error.h" #include "update.h" @@ -57,7 +57,7 @@ void BondFENEExpandOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_fene_omp.cpp b/src/USER-OMP/bond_fene_omp.cpp index ebf5afdc57..54a6cd5b3c 100644 --- a/src/USER-OMP/bond_fene_omp.cpp +++ b/src/USER-OMP/bond_fene_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "error.h" #include "update.h" @@ -57,7 +57,7 @@ void BondFENEOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_gromos_omp.cpp b/src/USER-OMP/bond_gromos_omp.cpp index d4d2d25601..2469329a52 100644 --- a/src/USER-OMP/bond_gromos_omp.cpp +++ b/src/USER-OMP/bond_gromos_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -53,7 +53,7 @@ void BondGromosOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_omp.cpp b/src/USER-OMP/bond_harmonic_omp.cpp index 9160ee7023..e9b2d5b103 100644 --- a/src/USER-OMP/bond_harmonic_omp.cpp +++ b/src/USER-OMP/bond_harmonic_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -55,7 +55,7 @@ void BondHarmonicOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp index 7a6c616e4a..3d81098d4b 100644 --- a/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_cut_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -55,7 +55,7 @@ void BondHarmonicShiftCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_harmonic_shift_omp.cpp b/src/USER-OMP/bond_harmonic_shift_omp.cpp index 19f0a08510..ff85a9f009 100644 --- a/src/USER-OMP/bond_harmonic_shift_omp.cpp +++ b/src/USER-OMP/bond_harmonic_shift_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -55,7 +55,7 @@ void BondHarmonicShiftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_morse_omp.cpp b/src/USER-OMP/bond_morse_omp.cpp index 90318c8faf..352a7e1e41 100644 --- a/src/USER-OMP/bond_morse_omp.cpp +++ b/src/USER-OMP/bond_morse_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -55,7 +55,7 @@ void BondMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_nonlinear_omp.cpp b/src/USER-OMP/bond_nonlinear_omp.cpp index 809950f2b7..f7330d1f3e 100644 --- a/src/USER-OMP/bond_nonlinear_omp.cpp +++ b/src/USER-OMP/bond_nonlinear_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -55,7 +55,7 @@ void BondNonlinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_quartic_omp.cpp b/src/USER-OMP/bond_quartic_omp.cpp index 0efaa10e37..c48c8ae65f 100644 --- a/src/USER-OMP/bond_quartic_omp.cpp +++ b/src/USER-OMP/bond_quartic_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include "pair.h" #include @@ -61,7 +61,7 @@ void BondQuarticOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/bond_table_omp.cpp b/src/USER-OMP/bond_table_omp.cpp index f503bcab26..34f678a224 100644 --- a/src/USER-OMP/bond_table_omp.cpp +++ b/src/USER-OMP/bond_table_omp.cpp @@ -21,7 +21,7 @@ #include "comm.h" #include "force.h" #include "neighbor.h" -#include "timer.h" + #include @@ -55,7 +55,7 @@ void BondTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (inum > 0) { if (evflag) { diff --git a/src/USER-OMP/dihedral_charmm_omp.cpp b/src/USER-OMP/dihedral_charmm_omp.cpp index afd3071434..8454dc1004 100644 --- a/src/USER-OMP/dihedral_charmm_omp.cpp +++ b/src/USER-OMP/dihedral_charmm_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "pair.h" #include "update.h" diff --git a/src/USER-OMP/dihedral_class2_omp.cpp b/src/USER-OMP/dihedral_class2_omp.cpp index 49b8659e2f..cf65d735a6 100644 --- a/src/USER-OMP/dihedral_class2_omp.cpp +++ b/src/USER-OMP/dihedral_class2_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp b/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp index cea22adf1b..5d9164d3b3 100644 --- a/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp +++ b/src/USER-OMP/dihedral_cosine_shift_exp_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/dihedral_fourier_omp.cpp b/src/USER-OMP/dihedral_fourier_omp.cpp index 756931774a..be19a6d958 100644 --- a/src/USER-OMP/dihedral_fourier_omp.cpp +++ b/src/USER-OMP/dihedral_fourier_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/dihedral_harmonic_omp.cpp b/src/USER-OMP/dihedral_harmonic_omp.cpp index d1f511954e..3d51a4db43 100644 --- a/src/USER-OMP/dihedral_harmonic_omp.cpp +++ b/src/USER-OMP/dihedral_harmonic_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/dihedral_helix_omp.cpp b/src/USER-OMP/dihedral_helix_omp.cpp index 5289fc2c62..5209fac23a 100644 --- a/src/USER-OMP/dihedral_helix_omp.cpp +++ b/src/USER-OMP/dihedral_helix_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "math_const.h" diff --git a/src/USER-OMP/dihedral_multi_harmonic_omp.cpp b/src/USER-OMP/dihedral_multi_harmonic_omp.cpp index edf8a20899..a6e0ab66d6 100644 --- a/src/USER-OMP/dihedral_multi_harmonic_omp.cpp +++ b/src/USER-OMP/dihedral_multi_harmonic_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/dihedral_nharmonic_omp.cpp b/src/USER-OMP/dihedral_nharmonic_omp.cpp index bf51a01713..4604771912 100644 --- a/src/USER-OMP/dihedral_nharmonic_omp.cpp +++ b/src/USER-OMP/dihedral_nharmonic_omp.cpp @@ -24,7 +24,7 @@ #include "force.h" #include "update.h" #include "error.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/dihedral_opls_omp.cpp b/src/USER-OMP/dihedral_opls_omp.cpp index 8814d3f3f0..ff0f6bb12b 100644 --- a/src/USER-OMP/dihedral_opls_omp.cpp +++ b/src/USER-OMP/dihedral_opls_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/dihedral_quadratic_omp.cpp b/src/USER-OMP/dihedral_quadratic_omp.cpp index e61c5f0d85..5ffb8d64f2 100644 --- a/src/USER-OMP/dihedral_quadratic_omp.cpp +++ b/src/USER-OMP/dihedral_quadratic_omp.cpp @@ -24,7 +24,7 @@ #include "force.h" #include "update.h" #include "error.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/dihedral_table_omp.cpp b/src/USER-OMP/dihedral_table_omp.cpp index bf5332a1c1..c18d5fb4c0 100644 --- a/src/USER-OMP/dihedral_table_omp.cpp +++ b/src/USER-OMP/dihedral_table_omp.cpp @@ -23,7 +23,7 @@ #include "domain.h" #include "neighbor.h" #include "force.h" -#include "timer.h" + #include "math_const.h" #include "math_extra.h" diff --git a/src/USER-OMP/ewald_omp.cpp b/src/USER-OMP/ewald_omp.cpp index e023daf2db..5f27c04e63 100644 --- a/src/USER-OMP/ewald_omp.cpp +++ b/src/USER-OMP/ewald_omp.cpp @@ -15,18 +15,18 @@ Contributing authors: Roy Pollock (LLNL), Paul Crozier (SNL) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "ewald_omp.h" -#include -#include + #include "atom.h" #include "comm.h" #include "force.h" -#include "memory.h" -#include "timer.h" #include "math_const.h" - +#include "memory.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -120,7 +120,7 @@ void EwaldOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, nlocal, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, 0, NULL, NULL, NULL, thr); + ev_setup_thr(eflag, vflag, 0, nullptr, nullptr, nullptr, thr); for (i = ifrom; i < ito; i++) { ek[i][0] = 0.0; @@ -438,14 +438,14 @@ void EwaldOMP::eik_dot_r_triclinic() #pragma omp parallel LMP_DEFAULT_NONE #endif { - + int i,ifrom,ito,k,l,m,n,ic,tid; double cstr1,sstr1; double sqk,clpm,slpm; double unitk_lamda[3]; loop_setup_thr(ifrom,ito,tid,nlocal,nthreads); - + double max_kvecs[3]; max_kvecs[0] = kxmax; max_kvecs[1] = kymax; diff --git a/src/USER-OMP/fix_neigh_history_omp.cpp b/src/USER-OMP/fix_neigh_history_omp.cpp index 7acded0ab2..02da93ab7d 100644 --- a/src/USER-OMP/fix_neigh_history_omp.cpp +++ b/src/USER-OMP/fix_neigh_history_omp.cpp @@ -138,7 +138,7 @@ void FixNeighHistoryOMP::pre_exchange_onesided() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -276,7 +276,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -289,7 +289,7 @@ void FixNeighHistoryOMP::pre_exchange_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -444,7 +444,7 @@ void FixNeighHistoryOMP::pre_exchange_no_newton() n = npartner[i]; partner[i] = ipg.get(n); valuepartner[i] = dpg.get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } diff --git a/src/USER-OMP/fix_nh_asphere_omp.cpp b/src/USER-OMP/fix_nh_asphere_omp.cpp index 9c7317bebd..26cad769ec 100644 --- a/src/USER-OMP/fix_nh_asphere_omp.cpp +++ b/src/USER-OMP/fix_nh_asphere_omp.cpp @@ -15,19 +15,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include -#include -#include "math_extra.h" #include "fix_nh_asphere_omp.h" + #include "atom.h" #include "atom_vec_ellipsoid.h" #include "compute.h" -#include "group.h" -#include "memory.h" #include "error.h" +#include "math_extra.h" +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/USER-OMP/fix_omp.cpp b/src/USER-OMP/fix_omp.cpp index 51e65d24ed..75eadca25e 100644 --- a/src/USER-OMP/fix_omp.cpp +++ b/src/USER-OMP/fix_omp.cpp @@ -16,7 +16,9 @@ OpenMP based threading support for LAMMPS ------------------------------------------------------------------------- */ -#include "omp_compat.h" +#include "fix_omp.h" +#include "thr_data.h" + #include "atom.h" #include "comm.h" #include "error.h" @@ -25,10 +27,6 @@ #include "neigh_request.h" #include "universe.h" #include "update.h" -#include "timer.h" - -#include "fix_omp.h" -#include "thr_data.h" #include "pair_hybrid.h" #include "bond_hybrid.h" @@ -39,6 +37,7 @@ #include +#include "omp_compat.h" #if defined(_OPENMP) #include #endif @@ -62,7 +61,7 @@ static int get_tid() FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - thr(NULL), last_omp_style(NULL), last_pair_hybrid(NULL), + thr(nullptr), last_omp_style(nullptr), last_pair_hybrid(nullptr), _nthr(-1), _neighbor(true), _mixed(false), _reduced(true), _pair_compute_flag(false), _kspace_compute_flag(false) { @@ -75,14 +74,14 @@ FixOMP::FixOMP(LAMMPS *lmp, int narg, char **arg) #pragma omp parallel LMP_DEFAULT_NONE LMP_SHARED(nthreads) nthreads = omp_get_num_threads(); else - nthreads = force->inumeric(FLERR,arg[3]); + nthreads = utils::inumeric(FLERR,arg[3],false,lmp); #endif } +#if defined(_OPENMP) if (nthreads < 1) error->all(FLERR,"Illegal number of OpenMP threads requested"); -#if defined(_OPENMP) int reset_thr = 0; #endif if (nthreads != comm->nthreads) { @@ -171,7 +170,7 @@ int FixOMP::setmask() void FixOMP::init() { // USER-OMP package cannot be used with atom_style template - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"USER-OMP package does not (yet) work with " "atom_style template"); @@ -204,8 +203,8 @@ void FixOMP::init() thr[i]->_timer_active=-1; } - if ((strstr(update->integrate_style,"respa") != NULL) - && (strstr(update->integrate_style,"respa/omp") == NULL)) + if ((strstr(update->integrate_style,"respa") != nullptr) + && (strstr(update->integrate_style,"respa/omp") == nullptr)) error->all(FLERR,"Need to use respa/omp for r-RESPA with /omp styles"); if (force->pair && force->pair->compute_flag) _pair_compute_flag = true; @@ -214,18 +213,18 @@ void FixOMP::init() else _kspace_compute_flag = false; int check_hybrid, kspace_split; - last_pair_hybrid = NULL; - last_omp_style = NULL; - const char *last_omp_name = NULL; - const char *last_hybrid_name = NULL; - const char *last_force_name = NULL; + last_pair_hybrid = nullptr; + last_omp_style = nullptr; + const char *last_omp_name = nullptr; + const char *last_hybrid_name = nullptr; + const char *last_force_name = nullptr; // support for verlet/split operation. // kspace_split == 0 : regular processing // kspace_split < 0 : master partition, does not do kspace // kspace_split > 0 : slave partition, only does kspace - if (strstr(update->integrate_style,"verlet/split") != NULL) { + if (strstr(update->integrate_style,"verlet/split") != nullptr) { if (universe->iworld == 0) kspace_split = -1; else kspace_split = 1; } else { diff --git a/src/USER-OMP/fix_qeq_comb_omp.cpp b/src/USER-OMP/fix_qeq_comb_omp.cpp index b0573dfa97..f88dada706 100644 --- a/src/USER-OMP/fix_qeq_comb_omp.cpp +++ b/src/USER-OMP/fix_qeq_comb_omp.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_comb_omp.h" -#include + #include #include #include "pair_comb.h" @@ -48,13 +48,13 @@ void FixQEQCombOMP::init() if (!atom->q_flag) error->all(FLERR,"Fix qeq/comb/omp requires atom attribute q"); - if (NULL != force->pair_match("comb3",0)) + if (nullptr != force->pair_match("comb3",0)) error->all(FLERR,"No support for comb3 currently available in USER-OMP"); comb = (PairComb *) force->pair_match("comb/omp",1); - if (comb == NULL) + if (comb == nullptr) comb = (PairComb *) force->pair_match("comb",1); - if (comb == NULL) + if (comb == nullptr) error->all(FLERR,"Must use pair_style comb or " "comb/omp with fix qeq/comb/omp"); diff --git a/src/USER-OMP/fix_qeq_reax_omp.cpp b/src/USER-OMP/fix_qeq_reax_omp.cpp index a10d3127a9..9a4e900840 100644 --- a/src/USER-OMP/fix_qeq_reax_omp.cpp +++ b/src/USER-OMP/fix_qeq_reax_omp.cpp @@ -32,7 +32,7 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_reax_omp.h" -#include + #include #include "pair_reaxc.h" #include "atom.h" @@ -63,9 +63,7 @@ using namespace FixConst; FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : FixQEqReax(lmp, narg, arg) { - if (narg<8 || narg>9) error->all(FLERR,"Illegal fix qeq/reax/omp command"); - - b_temp = NULL; + b_temp = nullptr; // ASPC: Kolafa, J. Comp. Chem., 25(3), 335 (2003) do_aspc = 0; @@ -73,7 +71,7 @@ FixQEqReaxOMP::FixQEqReaxOMP(LAMMPS *lmp, int narg, char **arg) : // Must be consistent with nprev to store history: nprev = aspc_order + 2 aspc_order_max = nprev - 2; aspc_omega = 0.0; - aspc_b = NULL; + aspc_b = nullptr; } FixQEqReaxOMP::~FixQEqReaxOMP() @@ -85,6 +83,11 @@ FixQEqReaxOMP::~FixQEqReaxOMP() void FixQEqReaxOMP::post_constructor() { + grow_arrays(atom->nmax); + for (int i = 0; i < atom->nmax; i++) + for (int j = 0; j < nprev; ++j) + s_hist[i][j] = t_hist[i][j] = 0; + pertype_parameters(pertype_option); } @@ -148,7 +151,6 @@ void FixQEqReaxOMP::init() void FixQEqReaxOMP::compute_H() { - int inum, *ilist, *numneigh, **firstneigh; double SMALL = 0.0001; int *type = atom->type; @@ -156,17 +158,6 @@ void FixQEqReaxOMP::compute_H() double **x = atom->x; int *mask = atom->mask; - if (reaxc) { - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; - } else { - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - } int ai, num_nbrs; // sumscan of the number of neighbors per atom to determine the offsets @@ -175,7 +166,7 @@ void FixQEqReaxOMP::compute_H() num_nbrs = 0; - for (int itr_i = 0; itr_i < inum; ++itr_i) { + for (int itr_i = 0; itr_i < nn; ++itr_i) { ai = ilist[itr_i]; H.firstnbr[ai] = num_nbrs; num_nbrs += numneigh[ai]; @@ -197,7 +188,7 @@ void FixQEqReaxOMP::compute_H() #if defined(_OPENMP) #pragma omp for schedule(guided) #endif - for (int ii = 0; ii < inum; ii++) { + for (int ii = 0; ii < nn; ii++) { int i = ilist[ii]; if (mask[i] & groupbit) { jlist = firstneigh[i]; @@ -214,7 +205,7 @@ void FixQEqReaxOMP::compute_H() flag = 0; if (r_sqr <= SQR(swb)) { - if (j < n) flag = 1; + if (j < atom->nlocal) flag = 1; else if (tag[i] < tag[j]) flag = 1; else if (tag[i] == tag[j]) { if (dz > SMALL) flag = 1; @@ -251,11 +242,6 @@ void FixQEqReaxOMP::compute_H() void FixQEqReaxOMP::init_storage() { - int NN; - - if (reaxc) NN = reaxc->list->inum + reaxc->list->gnum; - else NN = list->inum + list->gnum; - #if defined(_OPENMP) #pragma omp parallel for schedule(static) #endif @@ -284,8 +270,21 @@ void FixQEqReaxOMP::pre_force(int /* vflag */) if (update->ntimestep % nevery) return; if (comm->me == 0) t_start = MPI_Wtime(); - n = atom->nlocal; - N = atom->nlocal + atom->nghost; + int n = atom->nlocal; + + if (reaxc) { + nn = reaxc->list->inum; + NN = reaxc->list->inum + reaxc->list->gnum; + ilist = reaxc->list->ilist; + numneigh = reaxc->list->numneigh; + firstneigh = reaxc->list->firstneigh; + } else { + nn = list->inum; + NN = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + } // grow arrays if necessary // need to be atom->nmax in length @@ -365,16 +364,7 @@ void FixQEqReaxOMP::init_matvec() /* fill-in H matrix */ compute_H(); - int nn,i; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } + int i; // Should really be more careful with initialization and first (aspc_order+2) MD steps if (do_aspc) { @@ -450,24 +440,12 @@ void FixQEqReaxOMP::init_matvec() int FixQEqReaxOMP::CG( double *b, double *x) { - int i, imax; + int i; double alpha, beta, b_norm; double sig_old, sig_new; double my_buf[2], buf[2]; - int nn; - int *ilist; - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - - imax = 200; - pack_flag = 1; sparse_matvec( &H, x, q ); comm->reverse_comm_fix( this); //Coll_Vector( q ); @@ -579,8 +557,7 @@ void FixQEqReaxOMP::sparse_matvec( sparse_matrix *A, double *x, double *b) #endif { int i, j, itr_j; - int nn, NN, ii; - int *ilist; + int ii; int nthreads = comm->nthreads; #if defined(_OPENMP) int tid = omp_get_thread_num(); @@ -588,16 +565,6 @@ void FixQEqReaxOMP::sparse_matvec( sparse_matrix *A, double *x, double *b) int tid = 0; #endif - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } - #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif @@ -655,17 +622,6 @@ void FixQEqReaxOMP::calculate_Q() int i; double *q = atom->q; - int nn; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - double tmp1, tmp2; tmp1 = tmp2 = 0.0; #if defined(_OPENMP) @@ -718,10 +674,6 @@ void FixQEqReaxOMP::vector_sum( double* dest, double c, double* v, double d, double* y, int k) { int i; - int *ilist; - - if (reaxc) ilist = reaxc->list->ilist; - else ilist = list->ilist; #if defined(_OPENMP) #pragma omp parallel for schedule(static) private(i) @@ -737,10 +689,6 @@ void FixQEqReaxOMP::vector_sum( double* dest, double c, double* v, void FixQEqReaxOMP::vector_add( double* dest, double c, double* v, int k) { int i; - int *ilist; - - if (reaxc) ilist = reaxc->list->ilist; - else ilist = list->ilist; #if defined(_OPENMP) #pragma omp parallel for schedule(static) private(i) @@ -765,24 +713,12 @@ int FixQEqReaxOMP::dual_CG( double *b1, double *b2, double *x1, double *x2) startTimeBase = MPI_Wtime(); #endif - int i, imax; + int i; double alpha_s, alpha_t, beta_s, beta_t, b_norm_s, b_norm_t; double sig_old_s, sig_old_t, sig_new_s, sig_new_t; double my_buf[4], buf[4]; - int nn; - int *ilist; - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - - imax = 200; - pack_flag = 5; // forward 2x d and reverse 2x q dual_sparse_matvec( &H, x1, x2, q ); comm->reverse_comm_fix(this); //Coll_Vector( q ); @@ -975,8 +911,7 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x1, double *x2 #endif { int i, j, itr_j; - int nn, NN, ii; - int *ilist; + int ii; int indxI, indxJ; int nthreads = comm->nthreads; @@ -986,16 +921,6 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x1, double *x2 int tid = 0; #endif - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } - #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif @@ -1077,8 +1002,7 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x, double *b ) #endif { int i, j, itr_j; - int nn, NN, ii; - int *ilist; + int ii; int indxI, indxJ; int nthreads = comm->nthreads; @@ -1088,16 +1012,6 @@ void FixQEqReaxOMP::dual_sparse_matvec( sparse_matrix *A, double *x, double *b ) int tid = 0; #endif - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } - #if defined(_OPENMP) #pragma omp for schedule(dynamic,50) #endif diff --git a/src/USER-OMP/fix_rigid_nh_omp.cpp b/src/USER-OMP/fix_rigid_nh_omp.cpp index 63084fcc9e..d56b633bd0 100644 --- a/src/USER-OMP/fix_rigid_nh_omp.cpp +++ b/src/USER-OMP/fix_rigid_nh_omp.cpp @@ -15,10 +15,8 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "fix_rigid_nh_omp.h" -#include -#include + #include "atom.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" @@ -29,18 +27,20 @@ #include "error.h" #include "force.h" #include "kspace.h" +#include "math_const.h" +#include "math_extra.h" #include "modify.h" +#include "rigid_const.h" #include "update.h" -#include "timer.h" +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif -#include "math_extra.h" -#include "math_const.h" -#include "rigid_const.h" - using namespace LAMMPS_NS; using namespace FixConst; using namespace MathConst; diff --git a/src/USER-OMP/fix_rigid_omp.cpp b/src/USER-OMP/fix_rigid_omp.cpp index 9f78f6dc26..62f853d23b 100644 --- a/src/USER-OMP/fix_rigid_omp.cpp +++ b/src/USER-OMP/fix_rigid_omp.cpp @@ -17,7 +17,7 @@ #include "omp_compat.h" #include "fix_rigid_omp.h" -#include + #include #include #include "atom.h" diff --git a/src/USER-OMP/fix_rigid_small_omp.cpp b/src/USER-OMP/fix_rigid_small_omp.cpp index 227b0e1f8a..f720dd617e 100644 --- a/src/USER-OMP/fix_rigid_small_omp.cpp +++ b/src/USER-OMP/fix_rigid_small_omp.cpp @@ -24,7 +24,7 @@ #include "atom_vec_tri.h" #include "comm.h" #include "domain.h" -#include "timer.h" + #if defined(_OPENMP) #include diff --git a/src/USER-OMP/improper_class2_omp.cpp b/src/USER-OMP/improper_class2_omp.cpp index 8927980951..05fc8e4475 100644 --- a/src/USER-OMP/improper_class2_omp.cpp +++ b/src/USER-OMP/improper_class2_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/improper_cossq_omp.cpp b/src/USER-OMP/improper_cossq_omp.cpp index 72d76e8c42..e2a43c58c4 100644 --- a/src/USER-OMP/improper_cossq_omp.cpp +++ b/src/USER-OMP/improper_cossq_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/improper_cvff_omp.cpp b/src/USER-OMP/improper_cvff_omp.cpp index e9ff4bfc73..715819cfb9 100644 --- a/src/USER-OMP/improper_cvff_omp.cpp +++ b/src/USER-OMP/improper_cvff_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/improper_fourier_omp.cpp b/src/USER-OMP/improper_fourier_omp.cpp index 0671bdc375..93dfb9bc99 100644 --- a/src/USER-OMP/improper_fourier_omp.cpp +++ b/src/USER-OMP/improper_fourier_omp.cpp @@ -15,18 +15,20 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "improper_fourier_omp.h" + #include "atom.h" #include "comm.h" -#include "neighbor.h" -#include "timer.h" -#include "force.h" -#include "update.h" #include "error.h" - +#include "force.h" +#include "neighbor.h" #include "suffix.h" + +#include "update.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define TOLERANCE 0.05 diff --git a/src/USER-OMP/improper_harmonic_omp.cpp b/src/USER-OMP/improper_harmonic_omp.cpp index 8bef42bf23..6bb76871b2 100644 --- a/src/USER-OMP/improper_harmonic_omp.cpp +++ b/src/USER-OMP/improper_harmonic_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/improper_ring_omp.cpp b/src/USER-OMP/improper_ring_omp.cpp index 4ba67aab70..51ea5e5198 100644 --- a/src/USER-OMP/improper_ring_omp.cpp +++ b/src/USER-OMP/improper_ring_omp.cpp @@ -15,17 +15,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "improper_ring_omp.h" -#include + #include "atom.h" #include "comm.h" -#include "neighbor.h" -#include "timer.h" #include "force.h" #include "math_special.h" - +#include "neighbor.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathSpecial; diff --git a/src/USER-OMP/improper_umbrella_omp.cpp b/src/USER-OMP/improper_umbrella_omp.cpp index bf466afb19..0c9befade6 100644 --- a/src/USER-OMP/improper_umbrella_omp.cpp +++ b/src/USER-OMP/improper_umbrella_omp.cpp @@ -21,7 +21,7 @@ #include "atom.h" #include "comm.h" #include "neighbor.h" -#include "timer.h" + #include "force.h" #include "update.h" #include "error.h" diff --git a/src/USER-OMP/msm_cg_omp.cpp b/src/USER-OMP/msm_cg_omp.cpp index 8ff954e83f..1c5acd819f 100644 --- a/src/USER-OMP/msm_cg_omp.cpp +++ b/src/USER-OMP/msm_cg_omp.cpp @@ -16,24 +16,24 @@ Original MSM class by: Paul Crozier, Stan Moore, Stephen Bond, (all SNL) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "msm_cg_omp.h" -#include -#include -#include -#include #include "atom.h" -#include "gridcomm.h" #include "domain.h" #include "error.h" #include "force.h" -#include "neighbor.h" +#include "gridcomm.h" #include "memory.h" +#include "neighbor.h" #include "thr_omp.h" -#include "timer.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include + +#include "omp_compat.h" +#if defined(_OPENMP) +#include +#endif using namespace LAMMPS_NS; @@ -46,7 +46,7 @@ enum{FORWARD_RHO,FORWARD_AD,FORWARD_AD_PERATOM}; /* ---------------------------------------------------------------------- */ MSMCGOMP::MSMCGOMP(LAMMPS *lmp) : MSMOMP(lmp), - is_charged(NULL) + is_charged(nullptr) { triclinic_support = 0; @@ -62,7 +62,7 @@ void MSMCGOMP::settings(int narg, char **arg) MSMOMP::settings(narg,arg); - if (narg == 2) smallq = fabs(force->numeric(FLERR,arg[1])); + if (narg == 2) smallq = fabs(utils::numeric(FLERR,arg[1],false,Pointers::lmp)); else smallq = SMALLQ; } @@ -95,17 +95,7 @@ void MSMCGOMP::compute(int eflag, int vflag) // invoke allocate_peratom() if needed for first time - if (vflag_atom && !peratom_allocate_flag) { - allocate_peratom(); - cg_peratom_all->ghost_notify(); - cg_peratom_all->setup(); - for (int n=0; nghost_notify(); - cg_peratom[n]->setup(); - } - peratom_allocate_flag = 1; - } + if (vflag_atom && !peratom_allocate_flag) allocate_peratom(); // extend size of per-atom arrays if necessary @@ -147,7 +137,7 @@ void MSMCGOMP::compute(int eflag, int vflag) / static_cast(atom->natoms); if (me == 0) - utils::logmesg(MSM::lmp,fmt::format(" MSM/cg optimization cutoff: {:.8g}\n" + utils::logmesg(MSM::lmp,fmt::format(" MSM/cg optimization cutoff: {:.8}\n" " Total charged atoms: {:.1f}%\n" " Min/max charged atoms/proc: {:.1f}%" " {:.1f}%\n",smallq, @@ -175,7 +165,8 @@ void MSMCGOMP::compute(int eflag, int vflag) // to fully sum contribution in their 3d grid current_level = 0; - cg_all->reverse_comm(this,REVERSE_RHO); + gcall->reverse_comm_kspace(this,1,sizeof(double),REVERSE_RHO, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // forward communicate charge density values to fill ghost grid points // compute direct sum interaction and then restrict to coarser grid @@ -183,24 +174,30 @@ void MSMCGOMP::compute(int eflag, int vflag) for (int n=0; n<=levels-2; n++) { if (!active_flag[n]) continue; current_level = n; - cg[n]->forward_comm(this,FORWARD_RHO); - + gc[n]->forward_comm_kspace(this,1,sizeof(double),FORWARD_RHO, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); direct(n); restriction(n); } - // compute direct interaction for top grid level for non-periodic // and for second from top grid level for periodic if (active_flag[levels-1]) { if (domain->nonperiodic) { current_level = levels-1; - cg[levels-1]->forward_comm(this,FORWARD_RHO); + gc[levels-1]-> + forward_comm_kspace(this,1,sizeof(double),FORWARD_RHO, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); direct_top(levels-1); - cg[levels-1]->reverse_comm(this,REVERSE_AD); + gc[levels-1]-> + reverse_comm_kspace(this,1,sizeof(double),REVERSE_AD, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); if (vflag_atom) - cg_peratom[levels-1]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[levels-1]-> + reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); + } else { // Here using MPI_Allreduce is cheaper than using commgrid grid_swap_forward(levels-1,qgrid[levels-1]); @@ -208,7 +205,9 @@ void MSMCGOMP::compute(int eflag, int vflag) grid_swap_reverse(levels-1,egrid[levels-1]); current_level = levels-1; if (vflag_atom) - cg_peratom[levels-1]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[levels-1]-> + reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[levels-1],gc_buf2[levels-1],MPI_DOUBLE); } } @@ -220,24 +219,28 @@ void MSMCGOMP::compute(int eflag, int vflag) prolongation(n); current_level = n; - cg[n]->reverse_comm(this,REVERSE_AD); + gc[n]->reverse_comm_kspace(this,1,sizeof(double),REVERSE_AD, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); // extra per-atom virial communication if (vflag_atom) - cg_peratom[n]->reverse_comm(this,REVERSE_AD_PERATOM); + gc[n]->reverse_comm_kspace(this,6,sizeof(double),REVERSE_AD_PERATOM, + gc_buf1[n],gc_buf2[n],MPI_DOUBLE); } // all procs communicate E-field values // to fill ghost cells surrounding their 3d bricks current_level = 0; - cg_all->forward_comm(this,FORWARD_AD); + gcall->forward_comm_kspace(this,1,sizeof(double),FORWARD_AD, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // extra per-atom energy/virial communication if (vflag_atom) - cg_peratom_all->forward_comm(this,FORWARD_AD_PERATOM); + gcall->forward_comm_kspace(this,6,sizeof(double),FORWARD_AD_PERATOM, + gcall_buf1,gcall_buf2,MPI_DOUBLE); // calculate the force on my particles (interpolation) @@ -556,6 +559,7 @@ void MSMCGOMP::fieldforce_peratom() } } +/* ---------------------------------------------------------------------- */ double MSMCGOMP::memory_usage() { diff --git a/src/USER-OMP/msm_omp.cpp b/src/USER-OMP/msm_omp.cpp index 2689226725..783ebb40f1 100644 --- a/src/USER-OMP/msm_omp.cpp +++ b/src/USER-OMP/msm_omp.cpp @@ -15,14 +15,15 @@ Contributing authors: Axel Kohlmeyer (Temple U), Stan Moore (SNL) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "msm_omp.h" -#include + #include "comm.h" #include "domain.h" #include "error.h" -#include "timer.h" +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/npair_full_bin_ghost_omp.cpp b/src/USER-OMP/npair_full_bin_ghost_omp.cpp index e9297538d9..19d9ea4b67 100644 --- a/src/USER-OMP/npair_full_bin_ghost_omp.cpp +++ b/src/USER-OMP/npair_full_bin_ghost_omp.cpp @@ -39,7 +39,7 @@ void NPairFullBinGhostOmp::build(NeighList *list) const int nlocal = atom->nlocal; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -110,7 +110,7 @@ void NPairFullBinGhostOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_bin_omp.cpp b/src/USER-OMP/npair_full_bin_omp.cpp index 35835cae1d..9ee573ee16 100644 --- a/src/USER-OMP/npair_full_bin_omp.cpp +++ b/src/USER-OMP/npair_full_bin_omp.cpp @@ -37,7 +37,7 @@ void NPairFullBinOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -104,7 +104,7 @@ void NPairFullBinOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_multi_omp.cpp b/src/USER-OMP/npair_full_multi_omp.cpp index b4b0ea3033..6356d3031b 100644 --- a/src/USER-OMP/npair_full_multi_omp.cpp +++ b/src/USER-OMP/npair_full_multi_omp.cpp @@ -38,7 +38,7 @@ void NPairFullMultiOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -112,7 +112,7 @@ void NPairFullMultiOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_nsq_ghost_omp.cpp b/src/USER-OMP/npair_full_nsq_ghost_omp.cpp index 8b940f3724..3daabec87b 100644 --- a/src/USER-OMP/npair_full_nsq_ghost_omp.cpp +++ b/src/USER-OMP/npair_full_nsq_ghost_omp.cpp @@ -39,7 +39,7 @@ void NPairFullNsqGhostOmp::build(NeighList *list) const int nlocal = atom->nlocal; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -104,7 +104,7 @@ void NPairFullNsqGhostOmp::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_full_nsq_omp.cpp b/src/USER-OMP/npair_full_nsq_omp.cpp index 95c5caa148..cb0860d45c 100644 --- a/src/USER-OMP/npair_full_nsq_omp.cpp +++ b/src/USER-OMP/npair_full_nsq_omp.cpp @@ -39,7 +39,7 @@ void NPairFullNsqOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -104,7 +104,7 @@ void NPairFullNsqOmp::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp index 33fa4ed685..1075cd4d3d 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newtoff_ghost_omp.cpp @@ -43,7 +43,7 @@ void NPairHalfBinNewtoffGhostOmp::build(NeighList *list) const int nlocal = atom->nlocal; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -118,7 +118,7 @@ void NPairHalfBinNewtoffGhostOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_bin_newtoff_omp.cpp index 8e756d5072..df23bb3142 100644 --- a/src/USER-OMP/npair_half_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newtoff_omp.cpp @@ -39,7 +39,7 @@ void NPairHalfBinNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -109,7 +109,7 @@ void NPairHalfBinNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newton_omp.cpp b/src/USER-OMP/npair_half_bin_newton_omp.cpp index e27a58de46..23e7c78bf6 100644 --- a/src/USER-OMP/npair_half_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newton_omp.cpp @@ -38,7 +38,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -110,7 +110,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) @@ -141,7 +141,7 @@ void NPairHalfBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp index f88df4aed4..fd4b81e23b 100644 --- a/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_bin_newton_tri_omp.cpp @@ -38,7 +38,7 @@ void NPairHalfBinNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -115,7 +115,7 @@ void NPairHalfBinNewtonTriOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_multi_newtoff_omp.cpp b/src/USER-OMP/npair_half_multi_newtoff_omp.cpp index 586809c174..70668a917c 100644 --- a/src/USER-OMP/npair_half_multi_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newtoff_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfMultiNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -116,7 +116,7 @@ void NPairHalfMultiNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_multi_newton_omp.cpp b/src/USER-OMP/npair_half_multi_newton_omp.cpp index 9b8fc78f09..8101d5cfef 100644 --- a/src/USER-OMP/npair_half_multi_newton_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newton_omp.cpp @@ -39,7 +39,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -112,7 +112,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) @@ -149,7 +149,7 @@ void NPairHalfMultiNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp b/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp index fec687d075..b0ac840aa7 100644 --- a/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_multi_newton_tri_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -125,7 +125,7 @@ void NPairHalfMultiNewtonTriOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp index 316c63d541..a7ff39ab16 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newtoff_ghost_omp.cpp @@ -44,7 +44,7 @@ void NPairHalfNsqNewtoffGhostOmp::build(NeighList *list) const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int nall = nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -113,7 +113,7 @@ void NPairHalfNsqNewtoffGhostOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp index c937b5bc68..a1ab2c1eed 100644 --- a/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newtoff_omp.cpp @@ -41,7 +41,7 @@ void NPairHalfNsqNewtoffOmp::build(NeighList *list) const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int nall = atom->nlocal + atom->nghost; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -105,7 +105,7 @@ void NPairHalfNsqNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_nsq_newton_omp.cpp index 6baab97aa0..254d69fabe 100644 --- a/src/USER-OMP/npair_half_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_nsq_newton_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfNsqNewtonOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; #if defined(_OPENMP) @@ -123,7 +123,7 @@ void NPairHalfNsqNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp index c8dc37f978..ccf9f519b1 100644 --- a/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newtoff_omp.cpp @@ -41,7 +41,7 @@ void NPairHalfRespaBinNewtoffOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -140,7 +140,7 @@ void NPairHalfRespaBinNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp index 98732a62ea..b25c6aeb18 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newton_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -142,7 +142,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) @@ -186,7 +186,7 @@ void NPairHalfRespaBinNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp index 65315a2905..34981536f9 100644 --- a/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp +++ b/src/USER-OMP/npair_half_respa_bin_newton_tri_omp.cpp @@ -40,7 +40,7 @@ void NPairHalfRespaBinNewtonTriOmp::build(NeighList *list) { const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -147,7 +147,7 @@ void NPairHalfRespaBinNewtonTriOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp index 45d81069fc..321d479988 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp +++ b/src/USER-OMP/npair_half_respa_nsq_newtoff_omp.cpp @@ -42,7 +42,7 @@ void NPairHalfRespaNsqNewtoffOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -137,7 +137,7 @@ void NPairHalfRespaNsqNewtoffOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp b/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp index 1237ce7858..95b1cc69de 100644 --- a/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp +++ b/src/USER-OMP/npair_half_respa_nsq_newton_omp.cpp @@ -43,7 +43,7 @@ void NPairHalfRespaNsqNewtonOmp::build(NeighList *list) const int nlocal = (includegroup) ? atom->nfirst : atom->nlocal; const int bitmask = (includegroup) ? group->bitmask[includegroup] : 0; const int molecular = atom->molecular; - const int moltemplate = (molecular == 2) ? 1 : 0; + const int moltemplate = (molecular == Atom::TEMPLATE) ? 1 : 0; NPAIR_OMP_INIT; @@ -155,7 +155,7 @@ void NPairHalfRespaNsqNewtonOmp::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >=0) diff --git a/src/USER-OMP/pair_adp_omp.cpp b/src/USER-OMP/pair_adp_omp.cpp index 63a539c93c..1197e9ebbe 100644 --- a/src/USER-OMP/pair_adp_omp.cpp +++ b/src/USER-OMP/pair_adp_omp.cpp @@ -12,19 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "pair_adp_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -71,7 +71,7 @@ void PairADPOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_adp(nall, rho, mu, lambda); diff --git a/src/USER-OMP/pair_agni_omp.cpp b/src/USER-OMP/pair_agni_omp.cpp index b61bf52e4e..401f4a668b 100644 --- a/src/USER-OMP/pair_agni_omp.cpp +++ b/src/USER-OMP/pair_agni_omp.cpp @@ -12,21 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include -#include // requires C++-11 #include "pair_agni_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "math_special.h" #include "math_const.h" - +#include "math_special.h" +#include "neigh_list.h" #include "suffix.h" + +#include +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathSpecial; @@ -58,7 +56,7 @@ void PairAGNIOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) eval<1>(ifrom, ito, thr); else eval<0>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_airebo_morse_omp.cpp b/src/USER-OMP/pair_airebo_morse_omp.cpp index 5d5ac0b885..6977842af2 100644 --- a/src/USER-OMP/pair_airebo_morse_omp.cpp +++ b/src/USER-OMP/pair_airebo_morse_omp.cpp @@ -12,8 +12,6 @@ ------------------------------------------------------------------------- */ #include "pair_airebo_morse_omp.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; diff --git a/src/USER-OMP/pair_airebo_omp.cpp b/src/USER-OMP/pair_airebo_omp.cpp index 25d6c35174..d2c3ef6a09 100644 --- a/src/USER-OMP/pair_airebo_omp.cpp +++ b/src/USER-OMP/pair_airebo_omp.cpp @@ -12,24 +12,24 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_airebo_omp.h" + #include "atom.h" #include "comm.h" #include "error.h" -#include "force.h" +#include "math_special.h" #include "memory.h" #include "my_page.h" -#include "math_special.h" -#include "neighbor.h" #include "neigh_list.h" +#include "suffix.h" +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif -#include "suffix.h" using namespace LAMMPS_NS; using namespace MathSpecial; @@ -67,7 +67,7 @@ void PairAIREBOOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); FREBO_thr(ifrom,ito,evflag,eflag,vflag_atom,&pv0,thr); if (ljflag) FLJ_thr(ifrom,ito,evflag,eflag,vflag_atom,&pv1,thr); diff --git a/src/USER-OMP/pair_beck_omp.cpp b/src/USER-OMP/pair_beck_omp.cpp index 48e6f9b0fe..617c237dd9 100644 --- a/src/USER-OMP/pair_beck_omp.cpp +++ b/src/USER-OMP/pair_beck_omp.cpp @@ -20,7 +20,7 @@ #include "force.h" #include "neigh_list.h" #include "math_special.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -54,7 +54,7 @@ void PairBeckOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { @@ -153,6 +153,7 @@ void PairBeckOMP::eval(int iifrom, int iito, ThrData * const thr) term1inv = 1.0/term1; evdwl = AA[itype][jtype]*exp(-1.0*r*term4); evdwl -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv); + evdwl *= factor_lj; } if (EVFLAG) ev_tally_thr(this, i,j,nlocal,NEWTON_PAIR, diff --git a/src/USER-OMP/pair_born_coul_long_omp.cpp b/src/USER-OMP/pair_born_coul_long_omp.cpp index 7f92ab6734..be88df3e7a 100644 --- a/src/USER-OMP/pair_born_coul_long_omp.cpp +++ b/src/USER-OMP/pair_born_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_born_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -60,7 +61,7 @@ void PairBornCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_msm_omp.cpp b/src/USER-OMP/pair_born_coul_msm_omp.cpp index eec1765859..b161250df8 100644 --- a/src/USER-OMP/pair_born_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_born_coul_msm_omp.cpp @@ -12,17 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_born_coul_msm_omp.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -57,7 +59,7 @@ void PairBornCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_coul_wolf_omp.cpp b/src/USER-OMP/pair_born_coul_wolf_omp.cpp index ffa069ec4e..a426bc93d1 100644 --- a/src/USER-OMP/pair_born_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_born_coul_wolf_omp.cpp @@ -20,7 +20,7 @@ #include "force.h" #include "neigh_list.h" #include "math_const.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -54,7 +54,7 @@ void PairBornCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_born_omp.cpp b/src/USER-OMP/pair_born_omp.cpp index aaac28d07c..237685b9d2 100644 --- a/src/USER-OMP/pair_born_omp.cpp +++ b/src/USER-OMP/pair_born_omp.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "force.h" #include "neigh_list.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -52,7 +52,7 @@ void PairBornOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_brownian_omp.cpp b/src/USER-OMP/pair_brownian_omp.cpp index ca28fa14bb..afd41668ad 100644 --- a/src/USER-OMP/pair_brownian_omp.cpp +++ b/src/USER-OMP/pair_brownian_omp.cpp @@ -12,26 +12,25 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pair_brownian_omp.h" -#include + #include "atom.h" #include "comm.h" #include "domain.h" +#include "fix_wall.h" #include "force.h" #include "input.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "update.h" -#include "variable.h" -#include "random_mars.h" #include "math_const.h" #include "math_special.h" -#include "timer.h" - -#include "fix_wall.h" - +#include "neigh_list.h" +#include "random_mars.h" #include "suffix.h" +#include "update.h" +#include "variable.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -49,7 +48,7 @@ PairBrownianOMP::PairBrownianOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -62,7 +61,7 @@ PairBrownianOMP::~PairBrownianOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -128,7 +127,7 @@ void PairBrownianOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial Brownian style // we use is random number generator instance for thread 0 @@ -144,11 +143,11 @@ void PairBrownianOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_brownian_poly_omp.cpp b/src/USER-OMP/pair_brownian_poly_omp.cpp index 939bc223eb..6abd276bff 100644 --- a/src/USER-OMP/pair_brownian_poly_omp.cpp +++ b/src/USER-OMP/pair_brownian_poly_omp.cpp @@ -12,25 +12,25 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pair_brownian_poly_omp.h" -#include + #include "atom.h" #include "comm.h" #include "domain.h" +#include "fix_wall.h" #include "force.h" #include "input.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "update.h" -#include "variable.h" -#include "random_mars.h" -#include "fix_wall.h" - #include "math_const.h" #include "math_special.h" - +#include "neigh_list.h" +#include "random_mars.h" #include "suffix.h" +#include "update.h" +#include "variable.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -48,7 +48,7 @@ PairBrownianPolyOMP::PairBrownianPolyOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -61,7 +61,7 @@ PairBrownianPolyOMP::~PairBrownianPolyOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -128,7 +128,7 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial BrownianPoly style // we use is random number generator instance for thread 0 @@ -144,11 +144,11 @@ void PairBrownianPolyOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_buck_coul_cut_omp.cpp b/src/USER-OMP/pair_buck_coul_cut_omp.cpp index 4154c1281c..20a4953ef8 100644 --- a/src/USER-OMP/pair_buck_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_buck_coul_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairBuckCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_coul_long_omp.cpp b/src/USER-OMP/pair_buck_coul_long_omp.cpp index 1be2b7272f..f0e7edf710 100644 --- a/src/USER-OMP/pair_buck_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_buck_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -60,7 +61,7 @@ void PairBuckCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_coul_msm_omp.cpp b/src/USER-OMP/pair_buck_coul_msm_omp.cpp index b26243b19a..dd112ba99c 100644 --- a/src/USER-OMP/pair_buck_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_buck_coul_msm_omp.cpp @@ -12,17 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_buck_coul_msm_omp.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -57,7 +59,7 @@ void PairBuckCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp index a2e34b9a1b..2b55700972 100644 --- a/src/USER-OMP/pair_buck_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_buck_long_coul_long_omp.cpp @@ -11,18 +11,19 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ - -#include "omp_compat.h" -#include -#include "math_vector.h" #include "pair_buck_long_coul_long_omp.h" + #include "atom.h" #include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" #include "force.h" - +#include "math_vector.h" +#include "neigh_list.h" #include "suffix.h" + +#include +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -40,7 +41,7 @@ PairBuckLongCoulLongOMP::PairBuckLongCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -65,7 +66,7 @@ void PairBuckLongCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -329,7 +330,7 @@ void PairBuckLongCoulLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -354,7 +355,7 @@ void PairBuckLongCoulLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -384,7 +385,7 @@ void PairBuckLongCoulLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_buck_omp.cpp b/src/USER-OMP/pair_buck_omp.cpp index fc85d79c81..ab037a204f 100644 --- a/src/USER-OMP/pair_buck_omp.cpp +++ b/src/USER-OMP/pair_buck_omp.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "force.h" #include "neigh_list.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -52,7 +52,7 @@ void PairBuckOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_colloid_omp.cpp b/src/USER-OMP/pair_colloid_omp.cpp index cce588f516..4509579549 100644 --- a/src/USER-OMP/pair_colloid_omp.cpp +++ b/src/USER-OMP/pair_colloid_omp.cpp @@ -12,18 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_colloid_omp.h" + #include "atom.h" #include "comm.h" #include "error.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" #include "math_special.h" - +#include "neigh_list.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathSpecial; @@ -55,7 +56,7 @@ void PairColloidOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_comb_omp.cpp b/src/USER-OMP/pair_comb_omp.cpp index 8912cbc243..c07a6948ae 100644 --- a/src/USER-OMP/pair_comb_omp.cpp +++ b/src/USER-OMP/pair_comb_omp.cpp @@ -12,19 +12,21 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_comb_omp.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "group.h" -#include "force.h" #include "memory.h" #include "my_page.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" +#if defined(_OPENMP) +#include +#endif using namespace LAMMPS_NS; #define MAXNEIGH 24 @@ -61,7 +63,7 @@ void PairCombOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_cut_omp.cpp b/src/USER-OMP/pair_coul_cut_omp.cpp index 69eb9ac0f3..5f4a792c9d 100644 --- a/src/USER-OMP/pair_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_omp.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "force.h" #include "neigh_list.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -52,7 +52,7 @@ void PairCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_coul_cut_soft_omp.cpp index 89222903ec..36453b1b32 100644 --- a/src/USER-OMP/pair_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_cut_soft_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_coul_cut_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairCoulCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_debye_omp.cpp b/src/USER-OMP/pair_coul_debye_omp.cpp index c22f7340c4..8a3549b730 100644 --- a/src/USER-OMP/pair_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_coul_debye_omp.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "force.h" #include "neigh_list.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -52,7 +52,7 @@ void PairCoulDebyeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_diel_omp.cpp b/src/USER-OMP/pair_coul_diel_omp.cpp index 656cdc9421..f6bdcf8cf8 100644 --- a/src/USER-OMP/pair_coul_diel_omp.cpp +++ b/src/USER-OMP/pair_coul_diel_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_coul_diel_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairCoulDielOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_dsf_omp.cpp b/src/USER-OMP/pair_coul_dsf_omp.cpp index ddcc8dbeb0..f7bb7adace 100644 --- a/src/USER-OMP/pair_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_coul_dsf_omp.cpp @@ -19,7 +19,7 @@ #include "comm.h" #include "force.h" #include "neigh_list.h" -#include "timer.h" + #include "suffix.h" #include "math_const.h" using namespace LAMMPS_NS; @@ -61,7 +61,7 @@ void PairCoulDSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_long_omp.cpp b/src/USER-OMP/pair_coul_long_omp.cpp index 6c9b9d034d..12b8fdb2f6 100644 --- a/src/USER-OMP/pair_coul_long_omp.cpp +++ b/src/USER-OMP/pair_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -39,7 +40,7 @@ PairCoulLongOMP::PairCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,7 +62,7 @@ void PairCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_long_soft_omp.cpp b/src/USER-OMP/pair_coul_long_soft_omp.cpp index ff3267fb38..0d4dd729db 100644 --- a/src/USER-OMP/pair_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_coul_long_soft_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_coul_long_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -60,7 +61,7 @@ void PairCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_msm_omp.cpp b/src/USER-OMP/pair_coul_msm_omp.cpp index 32a657e286..4c77b85ae4 100644 --- a/src/USER-OMP/pair_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_coul_msm_omp.cpp @@ -12,17 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_coul_msm_omp.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -32,7 +34,7 @@ PairCoulMSMOMP::PairCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,7 +60,7 @@ void PairCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_coul_wolf_omp.cpp b/src/USER-OMP/pair_coul_wolf_omp.cpp index d0f6fdb125..20d45102bd 100644 --- a/src/USER-OMP/pair_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_coul_wolf_omp.cpp @@ -20,7 +20,7 @@ #include "force.h" #include "neigh_list.h" #include "math_const.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -54,7 +54,7 @@ void PairCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_dpd_omp.cpp b/src/USER-OMP/pair_dpd_omp.cpp index f3a1c29a70..615908f06c 100644 --- a/src/USER-OMP/pair_dpd_omp.cpp +++ b/src/USER-OMP/pair_dpd_omp.cpp @@ -21,7 +21,7 @@ #include "neigh_list.h" #include "update.h" #include "random_mars.h" -#include "timer.h" + #include "suffix.h" using namespace LAMMPS_NS; @@ -35,7 +35,7 @@ PairDPDOMP::PairDPDOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -48,7 +48,7 @@ PairDPDOMP::~PairDPDOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -73,7 +73,7 @@ void PairDPDOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial DPD style // we use the serial random number generator instance for thread 0 @@ -89,11 +89,11 @@ void PairDPDOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_dpd_tstat_omp.cpp b/src/USER-OMP/pair_dpd_tstat_omp.cpp index 06e80274bd..844c79771f 100644 --- a/src/USER-OMP/pair_dpd_tstat_omp.cpp +++ b/src/USER-OMP/pair_dpd_tstat_omp.cpp @@ -12,18 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_dpd_tstat_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" -#include "update.h" #include "random_mars.h" - #include "suffix.h" +#include "update.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EPSILON 1.0e-10 @@ -35,7 +36,7 @@ PairDPDTstatOMP::PairDPDTstatOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - random_thr = NULL; + random_thr = nullptr; nthreads = 0; } @@ -48,7 +49,7 @@ PairDPDTstatOMP::~PairDPDTstatOMP() delete random_thr[i]; delete[] random_thr; - random_thr = NULL; + random_thr = nullptr; } } @@ -73,7 +74,7 @@ void PairDPDTstatOMP::compute(int eflag, int vflag) nthreads = comm->nthreads; random_thr = new RanMars*[nthreads]; for (int i=1; i < nthreads; ++i) - random_thr[i] = NULL; + random_thr[i] = nullptr; // to ensure full compatibility with the serial DPD style // we use the serial random number generator instance for thread 0 @@ -88,11 +89,11 @@ void PairDPDTstatOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); // generate a random number generator instance for // all threads != 0. make sure we use unique seeds. - if ((tid > 0) && (random_thr[tid] == NULL)) + if ((tid > 0) && (random_thr[tid] == nullptr)) random_thr[tid] = new RanMars(Pair::lmp, seed + comm->me + comm->nprocs*tid); diff --git a/src/USER-OMP/pair_eam_alloy_omp.cpp b/src/USER-OMP/pair_eam_alloy_omp.cpp index 3e0e423f3d..b761fc8b8e 100644 --- a/src/USER-OMP/pair_eam_alloy_omp.cpp +++ b/src/USER-OMP/pair_eam_alloy_omp.cpp @@ -15,18 +15,16 @@ Contributing authors: Stephen Foiles (SNL), Murray Daw (SNL) ------------------------------------------------------------------------- */ -#include -#include -#include #include "pair_eam_alloy_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include using namespace LAMMPS_NS; @@ -71,7 +69,7 @@ void PairEAMAlloyOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -186,7 +184,7 @@ void PairEAMAlloyOMP::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/USER-OMP/pair_eam_fs_omp.cpp b/src/USER-OMP/pair_eam_fs_omp.cpp index 76e9840a5c..2aba40ba73 100644 --- a/src/USER-OMP/pair_eam_fs_omp.cpp +++ b/src/USER-OMP/pair_eam_fs_omp.cpp @@ -15,18 +15,16 @@ Contributing authors: Tim Lau (MIT) ------------------------------------------------------------------------- */ -#include -#include -#include #include "pair_eam_fs_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "tokenizer.h" +#include "memory.h" #include "potential_file_reader.h" +#include "tokenizer.h" + +#include using namespace LAMMPS_NS; @@ -71,7 +69,7 @@ void PairEAMFSOMP::coeff(int narg, char **arg) read_file(arg[2]); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" for (i = 3; i < narg; i++) { if (strcmp(arg[i],"NULL") == 0) { @@ -189,7 +187,7 @@ void PairEAMFSOMP::read_file(char *filename) } } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } } diff --git a/src/USER-OMP/pair_eam_omp.cpp b/src/USER-OMP/pair_eam_omp.cpp index 60ae65def5..cbdf03a411 100644 --- a/src/USER-OMP/pair_eam_omp.cpp +++ b/src/USER-OMP/pair_eam_omp.cpp @@ -12,19 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include - #include "pair_eam_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -68,7 +67,7 @@ void PairEAMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_eam(nall, rho); diff --git a/src/USER-OMP/pair_edip_omp.cpp b/src/USER-OMP/pair_edip_omp.cpp index 0e59674b0e..d0e84be4cf 100644 --- a/src/USER-OMP/pair_edip_omp.cpp +++ b/src/USER-OMP/pair_edip_omp.cpp @@ -12,18 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_edip_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" using namespace LAMMPS_NS; +#include + +#include "omp_compat.h" #define GRIDDENSITY 8000 #define GRIDSTART 0.1 @@ -59,7 +58,7 @@ void PairEDIPOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_eim_omp.cpp b/src/USER-OMP/pair_eim_omp.cpp index 02b765a956..7e25a14a02 100644 --- a/src/USER-OMP/pair_eim_omp.cpp +++ b/src/USER-OMP/pair_eim_omp.cpp @@ -12,19 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include - #include "pair_eim_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -66,7 +65,7 @@ void PairEIMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (force->newton_pair) thr->init_eim(nall, rho, fp); diff --git a/src/USER-OMP/pair_gauss_cut_omp.cpp b/src/USER-OMP/pair_gauss_cut_omp.cpp index 6d5344701d..d2a197291a 100644 --- a/src/USER-OMP/pair_gauss_cut_omp.cpp +++ b/src/USER-OMP/pair_gauss_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_gauss_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairGaussCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gauss_omp.cpp b/src/USER-OMP/pair_gauss_omp.cpp index 103a766614..919ffbe796 100644 --- a/src/USER-OMP/pair_gauss_omp.cpp +++ b/src/USER-OMP/pair_gauss_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_gauss_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EPSILON 1.0e-10 @@ -54,7 +55,7 @@ void PairGaussOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gayberne_omp.cpp b/src/USER-OMP/pair_gayberne_omp.cpp index f0fd60a309..d4ee5b2684 100644 --- a/src/USER-OMP/pair_gayberne_omp.cpp +++ b/src/USER-OMP/pair_gayberne_omp.cpp @@ -12,18 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_gayberne_omp.h" -#include "math_extra.h" -#include "atom.h" -#include "comm.h" -#include "atom_vec_ellipsoid.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_list.h" +#include "atom.h" +#include "atom_vec_ellipsoid.h" +#include "comm.h" +#include "force.h" +#include "math_extra.h" +#include "neigh_list.h" #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -54,7 +53,7 @@ void PairGayBerneOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_gran_hertz_history_omp.cpp b/src/USER-OMP/pair_gran_hertz_history_omp.cpp index 9ad84afb92..2506c4e5b3 100644 --- a/src/USER-OMP/pair_gran_hertz_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hertz_history_omp.cpp @@ -78,7 +78,7 @@ void PairGranHertzHistoryOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (shearupdate) { diff --git a/src/USER-OMP/pair_gran_hooke_history_omp.cpp b/src/USER-OMP/pair_gran_hooke_history_omp.cpp index 3e519fc0d0..ec87108716 100644 --- a/src/USER-OMP/pair_gran_hooke_history_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_history_omp.cpp @@ -79,7 +79,7 @@ void PairGranHookeHistoryOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (shearupdate) { diff --git a/src/USER-OMP/pair_gran_hooke_omp.cpp b/src/USER-OMP/pair_gran_hooke_omp.cpp index 8de959a91d..1965c1676b 100644 --- a/src/USER-OMP/pair_gran_hooke_omp.cpp +++ b/src/USER-OMP/pair_gran_hooke_omp.cpp @@ -74,7 +74,7 @@ void PairGranHookeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) if (force->newton_pair) eval<1,1>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp index bb8bbcc984..68b24a38f0 100644 --- a/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_lj_omp.cpp @@ -12,22 +12,22 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_hbond_dreiding_lj_omp.h" + #include "atom.h" #include "atom_vec.h" -#include "molecule.h" #include "comm.h" #include "domain.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" - #include "math_const.h" #include "math_special.h" - +#include "molecule.h" +#include "neigh_list.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -41,7 +41,7 @@ PairHbondDreidingLJOMP::PairHbondDreidingLJOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - hbcount_thr = hbeng_thr = NULL; + hbcount_thr = hbeng_thr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ void PairHbondDreidingLJOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { @@ -157,7 +157,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -190,7 +190,7 @@ void PairHbondDreidingLJOMP::eval(int iifrom, int iito, ThrData * const thr) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; diff --git a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp index 4ad3a8f057..aec6798033 100644 --- a/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp +++ b/src/USER-OMP/pair_hbond_dreiding_morse_omp.cpp @@ -12,22 +12,22 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_hbond_dreiding_morse_omp.h" + #include "atom.h" #include "atom_vec.h" -#include "molecule.h" #include "comm.h" #include "domain.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" - #include "math_const.h" #include "math_special.h" - +#include "molecule.h" +#include "neigh_list.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -41,7 +41,7 @@ PairHbondDreidingMorseOMP::PairHbondDreidingMorseOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - hbcount_thr = hbeng_thr = NULL; + hbcount_thr = hbeng_thr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -83,7 +83,7 @@ void PairHbondDreidingMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { @@ -157,7 +157,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) i = ilist[ii]; itype = type[i]; if (!donor[itype]) continue; - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { klist = special[i]; knum = nspecial[i][0]; } else { @@ -190,7 +190,7 @@ void PairHbondDreidingMorseOMP::eval(int iifrom, int iito, ThrData * const thr) rsq = delx*delx + dely*dely + delz*delz; for (kk = 0; kk < knum; kk++) { - if (molecular == 1) k = atom->map(klist[kk]); + if (molecular == Atom::MOLECULAR) k = atom->map(klist[kk]); else k = atom->map(klist[kk]+tagprev); if (k < 0) continue; ktype = type[k]; diff --git a/src/USER-OMP/pair_lj96_cut_omp.cpp b/src/USER-OMP/pair_lj96_cut_omp.cpp index adf0aac9b2..ddbb7ae8e9 100644 --- a/src/USER-OMP/pair_lj96_cut_omp.cpp +++ b/src/USER-OMP/pair_lj96_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj96_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -31,7 +32,7 @@ PairLJ96CutOMP::PairLJ96CutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +54,7 @@ void PairLJ96CutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp index f357fd9068..a7cd7aa76f 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_implicit_omp.cpp @@ -12,16 +12,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_charmm_coul_charmm_implicit_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +51,7 @@ void PairLJCharmmCoulCharmmImplicitOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp index 55227e2e10..03d33a6a8a 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_charmm_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_charmm_coul_charmm_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJCharmmCoulCharmmOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp index 437bd183ed..ed199dbfd7 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_charmm_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -31,7 +32,7 @@ PairLJCharmmCoulLongOMP::PairLJCharmmCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +54,7 @@ void PairLJCharmmCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp index b32f108098..932460a6b9 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_long_soft_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_charmm_coul_long_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -31,7 +32,7 @@ PairLJCharmmCoulLongSoftOMP::PairLJCharmmCoulLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +54,7 @@ void PairLJCharmmCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp index 0000e63cda..1d9391206c 100644 --- a/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_charmm_coul_msm_omp.cpp @@ -12,17 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_charmm_coul_msm_omp.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -32,7 +34,7 @@ PairLJCharmmCoulMSMOMP::PairLJCharmmCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,7 +60,7 @@ void PairLJCharmmCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp index 59a6841c9e..50baa7eb86 100644 --- a/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_class2_coul_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJClass2CoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp index 480e2adae0..85712f22cb 100644 --- a/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_class2_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -39,7 +40,7 @@ PairLJClass2CoulLongOMP::PairLJClass2CoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,7 +62,7 @@ void PairLJClass2CoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_class2_omp.cpp b/src/USER-OMP/pair_lj_class2_omp.cpp index 2b91e10cfa..ae2243daa1 100644 --- a/src/USER-OMP/pair_lj_class2_omp.cpp +++ b/src/USER-OMP/pair_lj_class2_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_class2_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJClass2OMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cubic_omp.cpp b/src/USER-OMP/pair_lj_cubic_omp.cpp index 778c25393d..1ccade4e62 100644 --- a/src/USER-OMP/pair_lj_cubic_omp.cpp +++ b/src/USER-OMP/pair_lj_cubic_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cubic_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace PairLJCubicConstants; @@ -53,7 +54,7 @@ void PairLJCubicOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp index d560b803f1..2ab0a4e8c0 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJCutCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp index 1c88600e7a..d8080656b0 100644 --- a/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_cut_soft_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_cut_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJCutCoulCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp index 79754e704b..d154563344 100644 --- a/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_debye_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_debye_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJCutCoulDebyeOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp index ec69a1a1ca..fe47e947e5 100644 --- a/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_dsf_omp.cpp @@ -12,17 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_dsf_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" - -#include "suffix.h" #include "math_const.h" +#include "neigh_list.h" +#include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -62,7 +63,7 @@ void PairLJCutCoulDSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp index 618986389c..1edeb94b17 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -39,7 +40,7 @@ PairLJCutCoulLongOMP::PairLJCutCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,7 +62,7 @@ void PairLJCutCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp index ce84ba01c3..a024db5fc0 100644 --- a/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_long_soft_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_long_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -39,7 +40,7 @@ PairLJCutCoulLongSoftOMP::PairLJCutCoulLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -61,7 +62,7 @@ void PairLJCutCoulLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp index 58e5cee0c2..04afd428a0 100644 --- a/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_msm_omp.cpp @@ -12,17 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_msm_omp.h" + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -32,7 +34,7 @@ PairLJCutCoulMSMOMP::PairLJCutCoulMSMOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -58,7 +60,7 @@ void PairLJCutCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp index 4111c5b22c..9f0577daca 100644 --- a/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_coul_wolf_omp.cpp @@ -12,17 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_coul_wolf_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" - -#include "suffix.h" #include "math_const.h" +#include "neigh_list.h" +#include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -54,7 +55,7 @@ void PairLJCutCoulWolfOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp index 7d5d25c39b..b486ba33dd 100644 --- a/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_dipole_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_dipole_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJCutDipoleCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_omp.cpp index 3e7e92de21..4f8c95a972 100644 --- a/src/USER-OMP/pair_lj_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_omp.cpp @@ -12,16 +12,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -31,7 +30,7 @@ PairLJCutOMP::PairLJCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +52,7 @@ void PairLJCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_soft_omp.cpp index 5064c4705e..dc2441fed2 100644 --- a/src/USER-OMP/pair_lj_cut_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_soft_omp.cpp @@ -12,16 +12,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_cut_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -31,7 +30,7 @@ PairLJCutSoftOMP::PairLJCutSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -53,7 +52,7 @@ void PairLJCutSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp index 72a7d5f16a..d79980493a 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.cpp @@ -15,25 +15,21 @@ Contributing author: Paul Crozier (SNL) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pair_lj_cut_thole_long_omp.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" +#include "error.h" #include "fix_drude.h" #include "force.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" #include "math_const.h" -#include "error.h" +#include "neigh_list.h" #include "suffix.h" -#include "timer.h" +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -57,7 +53,7 @@ PairLJCutTholeLongOMP::PairLJCutTholeLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -79,7 +75,7 @@ void PairLJCutTholeLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_thole_long_omp.h b/src/USER-OMP/pair_lj_cut_thole_long_omp.h index dc64c5c3a2..212f3c4e2e 100644 --- a/src/USER-OMP/pair_lj_cut_thole_long_omp.h +++ b/src/USER-OMP/pair_lj_cut_thole_long_omp.h @@ -20,7 +20,6 @@ PairStyle(lj/cut/thole/long/omp,PairLJCutTholeLongOMP) #ifndef LMP_PAIR_LJ_CUT_THOLE_LONG_OMP_H #define LMP_PAIR_LJ_CUT_THOLE_LONG_OMP_H -#include "pair.h" #include "pair_lj_cut_thole_long.h" #include "thr_omp.h" diff --git a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp index 2d1b828822..d11a018a82 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_cut_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PCutOMP::PairLJCutTIP4PCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp index a60f9d6a57..b712ef8435 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PLongOMP::PairLJCutTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (ncoultablebits) { if (evflag) { diff --git a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp index f4a75b9af8..d498da3e86 100644 --- a/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_lj_cut_tip4p_long_soft_omp.cpp @@ -42,8 +42,8 @@ PairLJCutTIP4PLongSoftOMP::PairLJCutTIP4PLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairLJCutTIP4PLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_expand_omp.cpp b/src/USER-OMP/pair_lj_expand_omp.cpp index 70b5e436fa..ba624ae7d0 100644 --- a/src/USER-OMP/pair_lj_expand_omp.cpp +++ b/src/USER-OMP/pair_lj_expand_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_expand_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJExpandOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp index 0f0a8de2ff..7e8a38935d 100644 --- a/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_coul_gromacs_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_gromacs_coul_gromacs_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJGromacsCoulGromacsOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_gromacs_omp.cpp b/src/USER-OMP/pair_lj_gromacs_omp.cpp index ea2c9e8f55..d179831e30 100644 --- a/src/USER-OMP/pair_lj_gromacs_omp.cpp +++ b/src/USER-OMP/pair_lj_gromacs_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_gromacs_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJGromacsOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp index e74f487129..76768276c6 100644 --- a/src/USER-OMP/pair_lj_long_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_coul_long_omp.cpp @@ -12,17 +12,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_long_coul_long_omp.h" + #include "atom.h" #include "comm.h" -#include "math_vector.h" #include "force.h" -#include "neighbor.h" +#include "math_vector.h" #include "neigh_list.h" - #include "suffix.h" + +#include +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -40,7 +42,7 @@ PairLJLongCoulLongOMP::PairLJLongCoulLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -65,7 +67,7 @@ void PairLJLongCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -327,7 +329,7 @@ void PairLJLongCoulLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -352,7 +354,7 @@ void PairLJLongCoulLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -382,7 +384,7 @@ void PairLJLongCoulLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp index 9c8de110d7..4ba412c66e 100644 --- a/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_lj_long_tip4p_long_omp.cpp @@ -12,20 +12,21 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_long_tip4p_long_omp.h" + #include "atom.h" -#include "domain.h" #include "comm.h" -#include "math_vector.h" -#include "force.h" -#include "neighbor.h" +#include "domain.h" #include "error.h" +#include "force.h" #include "memory.h" #include "neigh_list.h" - +#include "neighbor.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -43,9 +44,9 @@ PairLJLongTIP4PLongOMP::PairLJLongTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 1; - cut_respa = NULL; - newsite_thr = NULL; - hneigh_thr = NULL; + cut_respa = nullptr; + newsite_thr = nullptr; + hneigh_thr = nullptr; tip4pflag = dispersionflag = 1; no_virial_fdotr_compute = 1; single_enable = 0; @@ -105,7 +106,7 @@ void PairLJLongTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { @@ -388,7 +389,7 @@ void PairLJLongTIP4PLongOMP::compute_inner() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_inner(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -413,7 +414,7 @@ void PairLJLongTIP4PLongOMP::compute_middle() loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(0, 0, nall, 0, 0, NULL, thr); + ev_setup_thr(0, 0, nall, 0, 0, nullptr, thr); eval_middle(ifrom, ito, thr); thr->timer(Timer::PAIR); @@ -467,7 +468,7 @@ void PairLJLongTIP4PLongOMP::compute_outer(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (order6) { if (order1) { diff --git a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp index 4ad082cde1..f3af43cd50 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_long_omp.cpp @@ -12,18 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_sdk_coul_long_omp.h" +#include "lj_sdk_common.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - -#include "lj_sdk_common.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace LJSDKParms; /* ---------------------------------------------------------------------- */ @@ -54,7 +54,7 @@ void PairLJSDKCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp index 4871356b18..f05f5e1200 100644 --- a/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_coul_msm_omp.cpp @@ -13,19 +13,19 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_sdk_coul_msm_omp.h" +#include "lj_sdk_common.h" + #include "atom.h" #include "comm.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" #include "neigh_list.h" - -#include "lj_sdk_common.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace LJSDKParms; /* ---------------------------------------------------------------------- */ @@ -60,7 +60,7 @@ void PairLJSDKCoulMSMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sdk_omp.cpp b/src/USER-OMP/pair_lj_sdk_omp.cpp index 9f0671c61c..a88a1ded03 100644 --- a/src/USER-OMP/pair_lj_sdk_omp.cpp +++ b/src/USER-OMP/pair_lj_sdk_omp.cpp @@ -13,18 +13,18 @@ This style is a simplified re-implementation of the CG/CMM pair style ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_sdk_omp.h" +#include "lj_sdk_common.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - -#include "lj_sdk_common.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace LJSDKParms; @@ -56,7 +56,7 @@ void PairLJSDKOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp index 1adaf93953..130ac6e5e7 100644 --- a/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp +++ b/src/USER-OMP/pair_lj_sf_dipole_sf_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_sf_dipole_sf_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJSFDipoleSFOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp index 497c2c3a43..d69cfea0a0 100644 --- a/src/USER-OMP/pair_lj_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_linear_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_smooth_linear_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJSmoothLinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lj_smooth_omp.cpp b/src/USER-OMP/pair_lj_smooth_omp.cpp index bdb9b3141e..1adccbf3cb 100644 --- a/src/USER-OMP/pair_lj_smooth_omp.cpp +++ b/src/USER-OMP/pair_lj_smooth_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lj_smooth_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairLJSmoothOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_lubricate_omp.cpp b/src/USER-OMP/pair_lubricate_omp.cpp index 9db4239587..17496830f1 100644 --- a/src/USER-OMP/pair_lubricate_omp.cpp +++ b/src/USER-OMP/pair_lubricate_omp.cpp @@ -12,24 +12,22 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_lubricate_omp.h" + #include "atom.h" #include "comm.h" #include "domain.h" +#include "fix_wall.h" #include "force.h" #include "input.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "update.h" -#include "variable.h" -#include "random_mars.h" -#include "fix_wall.h" -#include "fix_deform.h" #include "math_const.h" - +#include "neigh_list.h" #include "suffix.h" +#include "variable.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -118,7 +116,7 @@ void PairLubricateOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (flaglog) { if (evflag) { diff --git a/src/USER-OMP/pair_lubricate_poly_omp.cpp b/src/USER-OMP/pair_lubricate_poly_omp.cpp index dc143a3160..227c943007 100644 --- a/src/USER-OMP/pair_lubricate_poly_omp.cpp +++ b/src/USER-OMP/pair_lubricate_poly_omp.cpp @@ -12,24 +12,22 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pair_lubricate_poly_omp.h" -#include + #include "atom.h" #include "comm.h" #include "domain.h" +#include "fix_wall.h" #include "force.h" #include "input.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "update.h" -#include "variable.h" -#include "random_mars.h" -#include "fix_wall.h" -#include "fix_deform.h" #include "math_const.h" - +#include "neigh_list.h" #include "suffix.h" +#include "variable.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -115,7 +113,7 @@ void PairLubricatePolyOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (flaglog) { if (shearing) { diff --git a/src/USER-OMP/pair_meam_spline_omp.cpp b/src/USER-OMP/pair_meam_spline_omp.cpp index 19fb09dd7b..e093e925f1 100644 --- a/src/USER-OMP/pair_meam_spline_omp.cpp +++ b/src/USER-OMP/pair_meam_spline_omp.cpp @@ -12,19 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include - #include "pair_meam_spline_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" +#include "error.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -66,7 +65,7 @@ void PairMEAMSplineOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); thr->init_eam(nall,Uprime_values); diff --git a/src/USER-OMP/pair_morse_omp.cpp b/src/USER-OMP/pair_morse_omp.cpp index 1f566dbd42..aa79a0f05a 100644 --- a/src/USER-OMP/pair_morse_omp.cpp +++ b/src/USER-OMP/pair_morse_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_morse_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairMorseOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp index f2ab417028..1896fdcbad 100644 --- a/src/USER-OMP/pair_morse_smooth_linear_omp.cpp +++ b/src/USER-OMP/pair_morse_smooth_linear_omp.cpp @@ -13,16 +13,17 @@ Most code borrowed from pair_morse_omp.cpp ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_morse_smooth_linear_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; @@ -54,7 +55,7 @@ void PairMorseSmoothLinearOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp index 4326434450..ecdba46e05 100644 --- a/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_nm_cut_coul_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairNMCutCoulCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp index 970b383f7e..09ec46d1c4 100644 --- a/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_coul_long_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_nm_cut_coul_long_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define EWALD_F 1.12837917 @@ -60,7 +61,7 @@ void PairNMCutCoulLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_nm_cut_omp.cpp b/src/USER-OMP/pair_nm_cut_omp.cpp index a937668fdd..faa3acefb7 100644 --- a/src/USER-OMP/pair_nm_cut_omp.cpp +++ b/src/USER-OMP/pair_nm_cut_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_nm_cut_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairNMCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_peri_lps_omp.cpp b/src/USER-OMP/pair_peri_lps_omp.cpp index cf29b5cab8..b2be373918 100644 --- a/src/USER-OMP/pair_peri_lps_omp.cpp +++ b/src/USER-OMP/pair_peri_lps_omp.cpp @@ -12,24 +12,24 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "pair_peri_lps_omp.h" -#include "fix.h" -#include "fix_peri_neigh.h" + #include "atom.h" #include "comm.h" #include "domain.h" +#include "fix_peri_neigh.h" #include "force.h" -#include "memory.h" #include "lattice.h" -#include "modify.h" -#include "neighbor.h" -#include "neigh_list.h" #include "math_const.h" - +#include "memory.h" +#include "modify.h" +#include "neigh_list.h" +#include "neighbor.h" #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -71,7 +71,7 @@ void PairPeriLPSOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_peri_pmb_omp.cpp b/src/USER-OMP/pair_peri_pmb_omp.cpp index 1990b46fe5..b58cadc20c 100644 --- a/src/USER-OMP/pair_peri_pmb_omp.cpp +++ b/src/USER-OMP/pair_peri_pmb_omp.cpp @@ -12,23 +12,23 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include -#include #include "pair_peri_pmb_omp.h" -#include "fix.h" -#include "fix_peri_neigh.h" + #include "atom.h" #include "comm.h" #include "domain.h" +#include "fix_peri_neigh.h" #include "force.h" -#include "memory.h" #include "lattice.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -67,7 +67,7 @@ void PairPeriPMBOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_reaxc_omp.cpp b/src/USER-OMP/pair_reaxc_omp.cpp index 73b1373fad..54417f9536 100644 --- a/src/USER-OMP/pair_reaxc_omp.cpp +++ b/src/USER-OMP/pair_reaxc_omp.cpp @@ -34,7 +34,7 @@ ------------------------------------------------------------------------- */ #include "pair_reaxc_omp.h" -#include + #include #include "atom.h" #include "update.h" @@ -48,7 +48,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "timer.h" + #include "reaxc_defs.h" #include "reaxc_types.h" @@ -92,7 +92,7 @@ PairReaxCOMP::PairReaxCOMP(LAMMPS *lmp) : PairReaxC(lmp), ThrOMP(lmp, THR_PAIR) system->pair_ptr = this; system->omp_active = 1; - num_nbrs_offset = NULL; + num_nbrs_offset = nullptr; #ifdef OMP_TIMING for (int i=0;i #include "pair_resquared_omp.h" -#include "math_extra.h" + #include "atom.h" #include "comm.h" -#include "atom_vec_ellipsoid.h" #include "force.h" -#include "neighbor.h" +#include "math_extra.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -54,7 +52,7 @@ void PairRESquaredOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_soft_omp.cpp b/src/USER-OMP/pair_soft_omp.cpp index 85425974cc..382a995e2a 100644 --- a/src/USER-OMP/pair_soft_omp.cpp +++ b/src/USER-OMP/pair_soft_omp.cpp @@ -12,17 +12,18 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_soft_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" #include "math_const.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -56,7 +57,7 @@ void PairSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_sw_omp.cpp b/src/USER-OMP/pair_sw_omp.cpp index ebe501ff8e..dac2527053 100644 --- a/src/USER-OMP/pair_sw_omp.cpp +++ b/src/USER-OMP/pair_sw_omp.cpp @@ -12,17 +12,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_sw_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -53,7 +51,7 @@ void PairSWOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_table_omp.cpp b/src/USER-OMP/pair_table_omp.cpp index 2546bfdc9a..79128bea8f 100644 --- a/src/USER-OMP/pair_table_omp.cpp +++ b/src/USER-OMP/pair_table_omp.cpp @@ -12,17 +12,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_table_omp.h" + #include "atom.h" #include "comm.h" -#include "error.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -53,7 +51,7 @@ void PairTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp index 5e1e6b1b0e..6d2cbf71ac 100644 --- a/src/USER-OMP/pair_tersoff_mod_c_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_c_omp.cpp @@ -12,16 +12,14 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_tersoff_mod_c_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +50,7 @@ void PairTersoffMODCOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_mod_omp.cpp b/src/USER-OMP/pair_tersoff_mod_omp.cpp index aa90b88375..45669dc601 100644 --- a/src/USER-OMP/pair_tersoff_mod_omp.cpp +++ b/src/USER-OMP/pair_tersoff_mod_omp.cpp @@ -12,16 +12,16 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_tersoff_mod_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - +#include "neighbor.h" #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +52,7 @@ void PairTersoffMODOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_omp.cpp b/src/USER-OMP/pair_tersoff_omp.cpp index 34dbfb73b6..efafa7949b 100644 --- a/src/USER-OMP/pair_tersoff_omp.cpp +++ b/src/USER-OMP/pair_tersoff_omp.cpp @@ -12,17 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_tersoff_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - +#include "neighbor.h" #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ void PairTersoffOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tersoff_table_omp.cpp b/src/USER-OMP/pair_tersoff_table_omp.cpp index a0a7f4c810..277b79b9e7 100644 --- a/src/USER-OMP/pair_tersoff_table_omp.cpp +++ b/src/USER-OMP/pair_tersoff_table_omp.cpp @@ -12,18 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_tersoff_table_omp.h" + #include "atom.h" #include "comm.h" -#include "error.h" -#include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; #define GRIDSTART 0.1 @@ -44,8 +43,8 @@ PairTersoffTableOMP::PairTersoffTableOMP(LAMMPS *lmp) : suffix_flag |= Suffix::OMP; respa_enable = 0; - thrGtetaFunction = thrGtetaFunctionDerived = NULL; - thrCutoffFunction = thrCutoffFunctionDerived = NULL; + thrGtetaFunction = thrGtetaFunctionDerived = nullptr; + thrCutoffFunction = thrCutoffFunctionDerived = nullptr; } /* ---------------------------------------------------------------------- */ @@ -77,7 +76,7 @@ void PairTersoffTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) if (vflag_atom) eval<1,1>(ifrom, ito, thr); diff --git a/src/USER-OMP/pair_tersoff_zbl_omp.cpp b/src/USER-OMP/pair_tersoff_zbl_omp.cpp index 005cd427a9..2fb8360197 100644 --- a/src/USER-OMP/pair_tersoff_zbl_omp.cpp +++ b/src/USER-OMP/pair_tersoff_zbl_omp.cpp @@ -16,26 +16,19 @@ David Farrell (NWU) - ZBL addition ------------------------------------------------------------------------- */ -#include -#include -#include -#include #include "pair_tersoff_zbl_omp.h" -#include "atom.h" #include "update.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" #include "comm.h" #include "memory.h" #include "error.h" -#include "utils.h" #include "tokenizer.h" #include "potential_file_reader.h" - #include "math_const.h" #include "math_special.h" + +#include +#include + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; @@ -164,7 +157,7 @@ void PairTersoffZBLOMP::read_file(char *file) params[nparams].biga *= conversion_factor; params[nparams].bigb *= conversion_factor; } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } diff --git a/src/USER-OMP/pair_tip4p_cut_omp.cpp b/src/USER-OMP/pair_tip4p_cut_omp.cpp index 5b983d3db5..a7e087e208 100644 --- a/src/USER-OMP/pair_tip4p_cut_omp.cpp +++ b/src/USER-OMP/pair_tip4p_cut_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PCutOMP::PairTIP4PCutOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -101,7 +101,7 @@ void PairTIP4PCutOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_tip4p_long_omp.cpp b/src/USER-OMP/pair_tip4p_long_omp.cpp index 86bebdbeff..75f6850ac3 100644 --- a/src/USER-OMP/pair_tip4p_long_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PLongOMP::PairTIP4PLongOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairTIP4PLongOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (!ncoultablebits) { if (evflag) { diff --git a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp index 26e0420955..e408cb7ccb 100644 --- a/src/USER-OMP/pair_tip4p_long_soft_omp.cpp +++ b/src/USER-OMP/pair_tip4p_long_soft_omp.cpp @@ -42,8 +42,8 @@ PairTIP4PLongSoftOMP::PairTIP4PLongSoftOMP(LAMMPS *lmp) : { suffix_flag |= Suffix::OMP; respa_enable = 0; - newsite_thr = NULL; - hneigh_thr = NULL; + newsite_thr = nullptr; + hneigh_thr = nullptr; // TIP4P cannot compute virial as F dot r // due to finding bonded H atoms which are not near O atom @@ -102,7 +102,7 @@ void PairTIP4PLongSoftOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_ufm_omp.cpp b/src/USER-OMP/pair_ufm_omp.cpp index 605d6dd2c6..202cce567d 100644 --- a/src/USER-OMP/pair_ufm_omp.cpp +++ b/src/USER-OMP/pair_ufm_omp.cpp @@ -14,16 +14,17 @@ Maurice de Koning (Unicamp/Brazil) - dekoning@ifi.unicamp.br ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_ufm_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -54,7 +55,7 @@ void PairUFMOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_vashishta_omp.cpp b/src/USER-OMP/pair_vashishta_omp.cpp index 425a06c296..c1dd45d8b6 100644 --- a/src/USER-OMP/pair_vashishta_omp.cpp +++ b/src/USER-OMP/pair_vashishta_omp.cpp @@ -12,17 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_vashishta_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - +#include "neighbor.h" #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -53,7 +53,7 @@ void PairVashishtaOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_vashishta_table_omp.cpp b/src/USER-OMP/pair_vashishta_table_omp.cpp index 36c86a8995..caf4bb4930 100644 --- a/src/USER-OMP/pair_vashishta_table_omp.cpp +++ b/src/USER-OMP/pair_vashishta_table_omp.cpp @@ -12,17 +12,15 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_vashishta_table_omp.h" + #include "atom.h" #include "comm.h" -#include "force.h" #include "memory.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -53,7 +51,7 @@ void PairVashishtaTableOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_yukawa_colloid_omp.cpp b/src/USER-OMP/pair_yukawa_colloid_omp.cpp index e6ac3fa9fb..4b595365fd 100644 --- a/src/USER-OMP/pair_yukawa_colloid_omp.cpp +++ b/src/USER-OMP/pair_yukawa_colloid_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_yukawa_colloid_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairYukawaColloidOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_yukawa_omp.cpp b/src/USER-OMP/pair_yukawa_omp.cpp index f222876cb5..78f2a12131 100644 --- a/src/USER-OMP/pair_yukawa_omp.cpp +++ b/src/USER-OMP/pair_yukawa_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_yukawa_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ void PairYukawaOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pair_zbl_omp.cpp b/src/USER-OMP/pair_zbl_omp.cpp index 284ebbf09c..2faf6d1bb0 100644 --- a/src/USER-OMP/pair_zbl_omp.cpp +++ b/src/USER-OMP/pair_zbl_omp.cpp @@ -12,16 +12,17 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" -#include #include "pair_zbl_omp.h" + #include "atom.h" #include "comm.h" #include "force.h" -#include "neighbor.h" #include "neigh_list.h" - #include "suffix.h" + +#include + +#include "omp_compat.h" using namespace LAMMPS_NS; using namespace PairZBLConstants; @@ -53,7 +54,7 @@ void PairZBLOMP::compute(int eflag, int vflag) loop_setup_thr(ifrom, ito, tid, inum, nthreads); ThrData *thr = fix->get_thr(tid); thr->timer(Timer::START); - ev_setup_thr(eflag, vflag, nall, eatom, vatom, NULL, thr); + ev_setup_thr(eflag, vflag, nall, eatom, vatom, nullptr, thr); if (evflag) { if (eflag) { diff --git a/src/USER-OMP/pppm_cg_omp.cpp b/src/USER-OMP/pppm_cg_omp.cpp index 31098d2675..86997713ef 100644 --- a/src/USER-OMP/pppm_cg_omp.cpp +++ b/src/USER-OMP/pppm_cg_omp.cpp @@ -15,22 +15,24 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pppm_cg_omp.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" #include "force.h" #include "math_const.h" #include "math_special.h" -#include "timer.h" +#include "suffix.h" + +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif -#include "suffix.h" + using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; diff --git a/src/USER-OMP/pppm_disp_omp.cpp b/src/USER-OMP/pppm_disp_omp.cpp index aad77cffc7..96a2cc282e 100644 --- a/src/USER-OMP/pppm_disp_omp.cpp +++ b/src/USER-OMP/pppm_disp_omp.cpp @@ -16,23 +16,24 @@ Rolf Isele-Holder (RWTH Aachen University) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pppm_disp_omp.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" #include "force.h" #include "math_const.h" -#include "timer.h" +#include "suffix.h" + +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif -#include "suffix.h" using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-OMP/pppm_disp_tip4p_omp.cpp b/src/USER-OMP/pppm_disp_tip4p_omp.cpp index 7da4257e07..93b7a87a61 100644 --- a/src/USER-OMP/pppm_disp_tip4p_omp.cpp +++ b/src/USER-OMP/pppm_disp_tip4p_omp.cpp @@ -15,21 +15,24 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pppm_disp_tip4p_omp.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" #include "error.h" #include "force.h" #include "math_const.h" +#include "suffix.h" + +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif -#include "suffix.h" + using namespace LAMMPS_NS; using namespace MathConst; diff --git a/src/USER-OMP/pppm_omp.cpp b/src/USER-OMP/pppm_omp.cpp index e3e46f4de0..7065588526 100644 --- a/src/USER-OMP/pppm_omp.cpp +++ b/src/USER-OMP/pppm_omp.cpp @@ -15,19 +15,19 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pppm_omp.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" #include "force.h" #include "math_const.h" #include "math_special.h" -#include "timer.h" +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/pppm_tip4p_omp.cpp b/src/USER-OMP/pppm_tip4p_omp.cpp index 8bd9805f01..936f3cf31c 100644 --- a/src/USER-OMP/pppm_tip4p_omp.cpp +++ b/src/USER-OMP/pppm_tip4p_omp.cpp @@ -15,11 +15,8 @@ Contributing author: Axel Kohlmeyer (Temple U) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "pppm_tip4p_omp.h" -#include -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" @@ -27,12 +24,16 @@ #include "force.h" #include "math_const.h" #include "math_special.h" -#include "timer.h" +#include "suffix.h" + +#include +#include + +#include "omp_compat.h" #if defined(_OPENMP) #include #endif -#include "suffix.h" using namespace LAMMPS_NS; using namespace MathConst; using namespace MathSpecial; diff --git a/src/USER-OMP/reaxc_bond_orders_omp.cpp b/src/USER-OMP/reaxc_bond_orders_omp.cpp index d581819e00..85a77370fa 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.cpp +++ b/src/USER-OMP/reaxc_bond_orders_omp.cpp @@ -27,8 +27,8 @@ ----------------------------------------------------------------------*/ #include "reaxc_bond_orders_omp.h" -#include -#include +#include "reaxc_bond_orders.h" + #include "fix_omp.h" #include "reaxc_defs.h" #include "pair_reaxc_omp.h" @@ -36,6 +36,9 @@ #include "reaxc_list.h" #include "reaxc_vector.h" +#include +#include + #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/reaxc_bond_orders_omp.h b/src/USER-OMP/reaxc_bond_orders_omp.h index 36be3337ad..2027a8628e 100644 --- a/src/USER-OMP/reaxc_bond_orders_omp.h +++ b/src/USER-OMP/reaxc_bond_orders_omp.h @@ -30,7 +30,6 @@ #define __BOND_ORDERS_OMP_H_ #include "reaxc_types.h" -#include "reaxc_bond_orders.h" void Add_dBond_to_ForcesOMP( reax_system*, int, int, storage*, reax_list** ); void Add_dBond_to_Forces_NPTOMP( reax_system *system, int, int, diff --git a/src/USER-OMP/reaxc_bonds_omp.cpp b/src/USER-OMP/reaxc_bonds_omp.cpp index 80e9b90ecc..bcef3a3c87 100644 --- a/src/USER-OMP/reaxc_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_bonds_omp.cpp @@ -88,7 +88,7 @@ void BondsOMP( reax_system *system, control_params * /* control */, pair_reax_ptr->ev_setup_thr_proxy(system->pair_ptr->eflag_either, system->pair_ptr->vflag_either, system->N, system->pair_ptr->eatom, - system->pair_ptr->vatom, NULL, thr); + system->pair_ptr->vatom, nullptr, thr); #if defined(_OPENMP) #pragma omp for schedule(guided) diff --git a/src/USER-OMP/reaxc_forces_omp.cpp b/src/USER-OMP/reaxc_forces_omp.cpp index ee4670fe59..ad474a1cc8 100644 --- a/src/USER-OMP/reaxc_forces_omp.cpp +++ b/src/USER-OMP/reaxc_forces_omp.cpp @@ -26,13 +26,12 @@ . ----------------------------------------------------------------------*/ -#include "omp_compat.h" #include "reaxc_forces_omp.h" -#include -#include + +#include "error.h" #include "fix_omp.h" -#include "reaxc_defs.h" #include "pair_reaxc_omp.h" +#include "reaxc_defs.h" #include "reaxc_bond_orders_omp.h" #include "reaxc_bonds_omp.h" @@ -44,6 +43,9 @@ #include "reaxc_valence_angles_omp.h" #include "reaxc_vector.h" +#include +#include + #if defined(_OPENMP) #include #endif @@ -163,7 +165,7 @@ void Compute_Total_ForceOMP( reax_system *system, control_params *control, class ThrData *thr = pair_reax_ptr->getFixOMP()->get_thr(tid); pair_reax_ptr->ev_setup_thr_proxy(0, 1, natoms, system->pair_ptr->eatom, - system->pair_ptr->vatom, NULL, thr); + system->pair_ptr->vatom, nullptr, thr); #if defined(_OPENMP) #pragma omp for schedule(guided) diff --git a/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp b/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp index 22d9df7702..029062470d 100644 --- a/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp +++ b/src/USER-OMP/reaxc_hydrogen_bonds_omp.cpp @@ -26,10 +26,8 @@ . ----------------------------------------------------------------------*/ -#include "omp_compat.h" #include "reaxc_hydrogen_bonds_omp.h" -#include -#include + #include "fix_omp.h" #include "pair_reaxc_omp.h" #include "reaxc_defs.h" @@ -38,6 +36,9 @@ #include "reaxc_valence_angles_omp.h" // To access Calculate_dCos_ThetaOMP() #include "reaxc_vector.h" +#include +#include + #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/reaxc_init_md_omp.cpp b/src/USER-OMP/reaxc_init_md_omp.cpp index b0cf4a5fb8..fd216844eb 100644 --- a/src/USER-OMP/reaxc_init_md_omp.cpp +++ b/src/USER-OMP/reaxc_init_md_omp.cpp @@ -27,7 +27,7 @@ ----------------------------------------------------------------------*/ #include "reaxc_init_md_omp.h" -#include + #include "reaxc_defs.h" #include "reaxc_forces.h" #include "reaxc_forces_omp.h" @@ -38,6 +38,8 @@ #include "error.h" #include "fmt/format.h" +#include + // Functions defined in reaxc_init_md.cpp extern int Init_MPI_Datatypes(reax_system*, storage*, mpi_datatypes*, MPI_Comm, char*); extern int Init_System(reax_system*, control_params*, char*); diff --git a/src/USER-OMP/reaxc_init_md_omp.h b/src/USER-OMP/reaxc_init_md_omp.h index 8416a768cf..45478ec632 100644 --- a/src/USER-OMP/reaxc_init_md_omp.h +++ b/src/USER-OMP/reaxc_init_md_omp.h @@ -31,6 +31,8 @@ #include "reaxc_types.h" +#include + void InitializeOMP( reax_system*, control_params*, simulation_data*, storage*, reax_list**, output_controls*, mpi_datatypes*, MPI_Comm ); #endif diff --git a/src/USER-OMP/reaxc_multi_body_omp.cpp b/src/USER-OMP/reaxc_multi_body_omp.cpp index 5f4b6d4eb0..57c056fff7 100644 --- a/src/USER-OMP/reaxc_multi_body_omp.cpp +++ b/src/USER-OMP/reaxc_multi_body_omp.cpp @@ -27,14 +27,16 @@ ----------------------------------------------------------------------*/ #include "reaxc_multi_body_omp.h" -#include -#include + #include "fix_omp.h" -#include #include "pair_reaxc_omp.h" + #include "reaxc_defs.h" #include "reaxc_list.h" +#include +#include + #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/reaxc_nonbonded_omp.cpp b/src/USER-OMP/reaxc_nonbonded_omp.cpp index 564088880a..3c3ca12575 100644 --- a/src/USER-OMP/reaxc_nonbonded_omp.cpp +++ b/src/USER-OMP/reaxc_nonbonded_omp.cpp @@ -27,17 +27,17 @@ ----------------------------------------------------------------------*/ #include "pair_reaxc_omp.h" -#include "thr_data.h" #include "reaxc_defs.h" #include "reaxc_types.h" #include "reaxc_nonbonded.h" #include "reaxc_nonbonded_omp.h" -#include "reaxc_bond_orders_omp.h" #include "reaxc_list.h" #include "reaxc_vector.h" +#include + #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/reaxc_torsion_angles_omp.cpp b/src/USER-OMP/reaxc_torsion_angles_omp.cpp index 68bacb7202..7d567b259c 100644 --- a/src/USER-OMP/reaxc_torsion_angles_omp.cpp +++ b/src/USER-OMP/reaxc_torsion_angles_omp.cpp @@ -27,7 +27,7 @@ ----------------------------------------------------------------------*/ #include "reaxc_torsion_angles_omp.h" -#include + #include "fix_omp.h" #include "pair_reaxc_omp.h" @@ -36,6 +36,8 @@ #include "reaxc_list.h" #include "reaxc_vector.h" +#include + #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/reaxc_valence_angles_omp.cpp b/src/USER-OMP/reaxc_valence_angles_omp.cpp index 104fadbbae..f9117d3a53 100644 --- a/src/USER-OMP/reaxc_valence_angles_omp.cpp +++ b/src/USER-OMP/reaxc_valence_angles_omp.cpp @@ -27,11 +27,10 @@ ----------------------------------------------------------------------*/ #include "reaxc_valence_angles_omp.h" -#include -#include -#include "pair_reaxc_omp.h" -#include "fix_omp.h" + #include "error.h" +#include "fix_omp.h" +#include "pair_reaxc_omp.h" #include "reaxc_defs.h" #include "reaxc_types.h" @@ -39,6 +38,8 @@ #include "reaxc_list.h" #include "reaxc_vector.h" +#include + #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/respa_omp.cpp b/src/USER-OMP/respa_omp.cpp index b5e5293aa4..b8d0af5c86 100644 --- a/src/USER-OMP/respa_omp.cpp +++ b/src/USER-OMP/respa_omp.cpp @@ -15,25 +15,25 @@ Contributing authors: Mark Stevens (SNL), Paul Crozier (SNL) ------------------------------------------------------------------------- */ -#include "omp_compat.h" #include "respa_omp.h" -#include "neighbor.h" -#include "comm.h" -#include "atom.h" -#include "domain.h" -#include "force.h" -#include "pair.h" -#include "bond.h" + #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "improper.h" #include "kspace.h" -#include "output.h" -#include "update.h" #include "modify.h" -#include "error.h" -#include "timer.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" +#include "update.h" +#include "omp_compat.h" #if defined(_OPENMP) #include #endif diff --git a/src/USER-OMP/thr_data.cpp b/src/USER-OMP/thr_data.cpp index 612c36053c..0ce2c3718a 100644 --- a/src/USER-OMP/thr_data.cpp +++ b/src/USER-OMP/thr_data.cpp @@ -82,33 +82,33 @@ void ThrData::init_force(int nall, double **f, double **torque, memset(virial_imprp,0,6*sizeof(double)); memset(virial_kspce,0,6*sizeof(double)); - eatom_pair=eatom_bond=eatom_angle=eatom_dihed=eatom_imprp=eatom_kspce=NULL; - vatom_pair=vatom_bond=vatom_angle=vatom_dihed=vatom_imprp=vatom_kspce=NULL; + eatom_pair=eatom_bond=eatom_angle=eatom_dihed=eatom_imprp=eatom_kspce=nullptr; + vatom_pair=vatom_bond=vatom_angle=vatom_dihed=vatom_imprp=vatom_kspce=nullptr; if (nall >= 0 && f) { _f = f + _tid*nall; memset(&(_f[0][0]),0,nall*3*sizeof(double)); - } else _f = NULL; + } else _f = nullptr; if (nall >= 0 && torque) { _torque = torque + _tid*nall; memset(&(_torque[0][0]),0,nall*3*sizeof(double)); - } else _torque = NULL; + } else _torque = nullptr; if (nall >= 0 && erforce) { _erforce = erforce + _tid*nall; memset(&(_erforce[0]),0,nall*sizeof(double)); - } else _erforce = NULL; + } else _erforce = nullptr; if (nall >= 0 && de) { _de = de + _tid*nall; memset(&(_de[0]),0,nall*sizeof(double)); - } else _de = NULL; + } else _de = nullptr; if (nall >= 0 && drho) { _drho = drho + _tid*nall; memset(&(_drho[0]),0,nall*sizeof(double)); - } else _drho = NULL; + } else _drho = nullptr; } /* ---------------------------------------------------------------------- @@ -191,8 +191,8 @@ void ThrData::init_pppm(int order, Memory *memory) drho1d = static_cast(_drho1d); if (rho1d) memory->destroy2d_offset(rho1d,-order/2); if (drho1d) memory->destroy2d_offset(drho1d,-order/2); - _rho1d = NULL; - _drho1d = NULL; + _rho1d = nullptr; + _drho1d = nullptr; } } diff --git a/src/USER-OMP/thr_data.h b/src/USER-OMP/thr_data.h index 4853d6dbbf..c942083ef5 100644 --- a/src/USER-OMP/thr_data.h +++ b/src/USER-OMP/thr_data.h @@ -18,7 +18,7 @@ #ifndef LMP_THR_DATA_H #define LMP_THR_DATA_H -#include "timer.h" +#include "timer.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -31,7 +31,7 @@ class ThrData { public: ThrData(int tid, class Timer *t); - ~ThrData() { delete _timer; _timer = NULL; }; + ~ThrData() { delete _timer; _timer = nullptr; }; void check_tid(int); // thread id consistency check int get_tid() const { return _tid; }; // our thread id. @@ -140,7 +140,7 @@ class ThrData { // disabled default methods private: - ThrData() : _tid(-1), _timer(NULL) {}; + ThrData() : _tid(-1), _timer(nullptr) {}; }; //////////////////////////////////////////////////////////////////////// diff --git a/src/USER-OMP/thr_omp.cpp b/src/USER-OMP/thr_omp.cpp index c086f6d6b5..2e75e7c1e4 100644 --- a/src/USER-OMP/thr_omp.cpp +++ b/src/USER-OMP/thr_omp.cpp @@ -24,7 +24,7 @@ #include "force.h" #include "modify.h" #include "neighbor.h" -#include "timer.h" + #include "thr_omp.h" @@ -43,7 +43,7 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ ThrOMP::ThrOMP(LAMMPS *ptr, int style) - : lmp(ptr), fix(NULL), thr_style(style), thr_error(0) + : lmp(ptr), fix(nullptr), thr_style(style), thr_error(0) { // register fix omp with this class int ifix = lmp->modify->find_fix("package_omp"); @@ -88,7 +88,7 @@ void ThrOMP::ev_setup_thr(int eflag, int vflag, int nall, double *eatom, if (nall > 0) memset(&(thr->cvatom_pair[0][0]),0,nall*9*sizeof(double)); } else { - thr->cvatom_pair = NULL; + thr->cvatom_pair = nullptr; } } @@ -199,7 +199,7 @@ void ThrOMP::reduce_thr(void *style, const int eflag, const int vflag, if (lmp->force->pair->vflag_fdotr) { // this is a non-hybrid pair style. compute per thread fdotr - if (fix->last_pair_hybrid == NULL) { + if (fix->last_pair_hybrid == nullptr) { if (lmp->neighbor->includegroup == 0) thr->virial_fdotr_compute(x, nlocal, nghost, -1); else @@ -485,7 +485,7 @@ void ThrOMP::e_tally_thr(Pair * const pair, const int i, const int j, } } } - if (pair->eflag_atom) { + if (pair->eflag_atom && thr->eatom_pair) { const double epairhalf = 0.5 * (evdwl + ecoul); if (newton_pair || i < nlocal) thr->eatom_pair[i] += epairhalf; if (newton_pair || j < nlocal) thr->eatom_pair[j] += epairhalf; diff --git a/src/USER-PHONON/dynamical_matrix.cpp b/src/USER-PHONON/dynamical_matrix.cpp index d03a8d3ab0..80ab531e70 100644 --- a/src/USER-PHONON/dynamical_matrix.cpp +++ b/src/USER-PHONON/dynamical_matrix.cpp @@ -2,28 +2,29 @@ // Created by charlie sievers on 6/21/18. // -#include -#include -#include #include "dynamical_matrix.h" -#include "atom.h" -#include "domain.h" -#include "comm.h" -#include "error.h" -#include "group.h" -#include "force.h" -#include "memory.h" -#include "bond.h" + #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "force.h" +#include "group.h" #include "improper.h" #include "kspace.h" -#include "update.h" +#include "memory.h" #include "modify.h" #include "neighbor.h" #include "pair.h" #include "timer.h" -#include "finish.h" +#include "update.h" + +#include +#include #include using namespace LAMMPS_NS; @@ -31,7 +32,7 @@ enum{REGULAR,ESKM}; /* ---------------------------------------------------------------------- */ -DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +DynamicalMatrix::DynamicalMatrix(LAMMPS *lmp) : Pointers(lmp), fp(nullptr) { external_force_clear = 1; } @@ -42,7 +43,7 @@ DynamicalMatrix::~DynamicalMatrix() { if (fp && me == 0) fclose(fp); memory->destroy(groupmap); - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -117,7 +118,7 @@ void DynamicalMatrix::command(int narg, char **arg) if (strcmp(arg[1],"regular") == 0) style = REGULAR; else if (strcmp(arg[1],"eskm") == 0) style = ESKM; else error->all(FLERR,"Illegal Dynamical Matrix command"); - del = force->numeric(FLERR, arg[2]); + del = utils::numeric(FLERR, arg[2],false,lmp); // set option defaults @@ -133,7 +134,7 @@ void DynamicalMatrix::command(int narg, char **arg) else if (style == ESKM) options(narg-3,&arg[3]); //COME BACK else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Dynamical_matrix command requires an atom map, see atom_modify"); // move atoms by 3-vector or specified variable(s) @@ -222,7 +223,7 @@ void DynamicalMatrix::openfile(const char* filename) fp = fopen(filename,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } @@ -392,7 +393,7 @@ void DynamicalMatrix::update_force() force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } - if (atom->molecular) { + if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); diff --git a/src/USER-PHONON/fix_phonon.cpp b/src/USER-PHONON/fix_phonon.cpp index 9b663ce383..d8900d2348 100644 --- a/src/USER-PHONON/fix_phonon.cpp +++ b/src/USER-PHONON/fix_phonon.cpp @@ -23,7 +23,7 @@ konglt@sjtu.edu.cn; konglt@gmail.com ------------------------------------------------------------------------- */ -#include + #include #include #include "fix_phonon.h" @@ -68,13 +68,13 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) if (narg < 8) error->all(FLERR,"Illegal fix phonon command: number of arguments < 8"); - nevery = force->inumeric(FLERR, arg[3]); // Calculate this fix every n steps! + nevery = utils::inumeric(FLERR, arg[3],false,lmp); // Calculate this fix every n steps! if (nevery < 1) error->all(FLERR,"Illegal fix phonon command"); - nfreq = force->inumeric(FLERR, arg[4]); // frequency to output result + nfreq = utils::inumeric(FLERR, arg[4],false,lmp); // frequency to output result if (nfreq < 1) error->all(FLERR,"Illegal fix phonon command"); - waitsteps = force->bnumeric(FLERR,arg[5]); // Wait this many timesteps before actually measuring + waitsteps = utils::bnumeric(FLERR,arg[5],false,lmp); // Wait this many timesteps before actually measuring if (waitsteps < 0) error->all(FLERR,"Illegal fix phonon command: waitsteps < 0 !"); int n = strlen(arg[6]) + 1; // map file @@ -95,12 +95,12 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) while (iarg < narg){ if (strcmp(arg[iarg],"sysdim") == 0){ if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command line options."); - sdim = force->inumeric(FLERR, arg[iarg]); + sdim = utils::inumeric(FLERR, arg[iarg],false,lmp); if (sdim < 1) error->all(FLERR,"Illegal fix phonon command: sysdim should not be less than 1."); } else if (strcmp(arg[iarg],"nasr") == 0){ if (++iarg >= narg) error->all(FLERR,"Illegal fix phonon command: incomplete command line options."); - nasr = force->inumeric(FLERR, arg[iarg]); + nasr = utils::inumeric(FLERR, arg[iarg],false,lmp); } else { error->all(FLERR,"Illegal fix phonon command: unknown option read!"); @@ -162,7 +162,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) fft = new FFT3d(lmp,world,nz,ny,nx,0,nz-1,0,ny-1,nxlo,nxhi,0,nz-1,0,ny-1,nxlo,nxhi,0,0,&mysize,0); memory->create(fft_data, MAX(1,mynq)*2, "fix_phonon:fft_data"); - // allocate variables; MAX(1,... is used because NULL buffer will result in error for MPI + // allocate variables; MAX(1,... is used because a null buffer will result in error for MPI memory->create(RIloc,ngroup,(sysdim+1),"fix_phonon:RIloc"); memory->create(RIall,ngroup,(sysdim+1),"fix_phonon:RIall"); memory->create(Rsort,ngroup, sysdim, "fix_phonon:Rsort"); @@ -184,7 +184,7 @@ FixPhonon::FixPhonon(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) // output some information on the system to log file if (me == 0){ flog = fopen(logfile, "w"); - if (flog == NULL) { + if (flog == nullptr) { char str[MAXLINE]; sprintf(str,"Can not open output file %s",logfile); error->one(FLERR,str); @@ -563,34 +563,34 @@ void FixPhonon::readmap() // read from map file for others char line[MAXLINE]; FILE *fp = fopen(mapfile, "r"); - if (fp == NULL){ + if (fp == nullptr){ sprintf(line,"Cannot open input map file %s", mapfile); error->all(FLERR,line); } - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading header of mapping file!"); - nx = force->inumeric(FLERR, strtok(line, " \n\t\r\f")); - ny = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - nz = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - nucell = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); + nx = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); + ny = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + nz = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + nucell = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); ntotal = nx*ny*nz; if (ntotal*nucell != ngroup) error->all(FLERR,"FFT mesh and number of atoms in group mismatch!"); // second line of mapfile is comment - if (fgets(line,MAXLINE,fp) == NULL) + if (fgets(line,MAXLINE,fp) == nullptr) error->all(FLERR,"Error while reading comment of mapping file!"); int ix, iy, iz, iu; // the remaining lines carry the mapping info for (int i = 0; i < ngroup; ++i){ - if (fgets(line,MAXLINE,fp) == NULL) {info = 1; break;} - ix = force->inumeric(FLERR, strtok(line, " \n\t\r\f")); - iy = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - iz = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - iu = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); - itag = force->inumeric(FLERR, strtok(NULL, " \n\t\r\f")); + if (fgets(line,MAXLINE,fp) == nullptr) {info = 1; break;} + ix = utils::inumeric(FLERR, strtok(line, " \n\t\r\f"),false,lmp); + iy = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + iz = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + iu = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); + itag = utils::inumeric(FLERR, strtok(nullptr, " \n\t\r\f"),false,lmp); // check if index is in correct range if (ix < 0 || ix >= nx || iy < 0 || iy >= ny || diff --git a/src/USER-PHONON/third_order.cpp b/src/USER-PHONON/third_order.cpp index 7764287337..955e5d940e 100644 --- a/src/USER-PHONON/third_order.cpp +++ b/src/USER-PHONON/third_order.cpp @@ -3,29 +3,28 @@ // #include "third_order.h" -#include -#include -#include -#include "atom.h" -#include "domain.h" -#include "comm.h" -#include "error.h" -#include "group.h" -#include "force.h" -#include "memory.h" -#include "bond.h" + #include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "finish.h" +#include "force.h" +#include "group.h" #include "improper.h" #include "kspace.h" -#include "update.h" +#include "math_special.h" +#include "memory.h" #include "neighbor.h" #include "pair.h" #include "timer.h" -#include "finish.h" -#include "math_special.h" +#include "update.h" + +#include #include -#include using namespace LAMMPS_NS; using namespace MathSpecial; @@ -33,7 +32,7 @@ enum{REGULAR,BALLISTICO}; /* ---------------------------------------------------------------------- */ -ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(NULL) +ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(nullptr) { external_force_clear = 1; } @@ -43,7 +42,7 @@ ThirdOrder::ThirdOrder(LAMMPS *lmp) : Pointers(lmp), fp(NULL) ThirdOrder::~ThirdOrder() { if (fp && me == 0) fclose(fp); - fp = NULL; + fp = nullptr; memory->destroy(groupmap); } @@ -132,9 +131,9 @@ void ThirdOrder::command(int narg, char **arg) if (style == REGULAR) options(narg-3,&arg[3]); //COME BACK else if (style == BALLISTICO) options(narg-3,&arg[3]); //COME BACK else if (comm->me == 0 && screen) fprintf(screen,"Illegal Dynamical Matrix command\n"); - del = force->numeric(FLERR, arg[2]); + del = utils::numeric(FLERR, arg[2],false,lmp); - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"third_order command requires an atom map, see atom_modify"); // move atoms by 3-vector or specified variable(s) @@ -170,13 +169,11 @@ void ThirdOrder::options(int narg, char **arg) if (narg < 0) error->all(FLERR,"Illegal third_order command"); int iarg = 0; const char *filename = "third_order.dat"; - std::stringstream fss; while (iarg < narg) { if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR, "Illegal third_order command"); - fss << arg[iarg + 1]; - filename = fss.str().c_str(); + filename = arg[iarg + 1]; file_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"binary") == 0) { @@ -223,7 +220,7 @@ void ThirdOrder::openfile(const char* filename) fp = fopen(filename,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); file_opened = 1; } @@ -411,7 +408,7 @@ void ThirdOrder::update_force() force->pair->compute(eflag,vflag); timer->stamp(Timer::PAIR); } - if (atom->molecular) { + if (atom->molecular != Atom::ATOMIC) { if (force->bond) force->bond->compute(eflag,vflag); if (force->angle) force->angle->compute(eflag,vflag); if (force->dihedral) force->dihedral->compute(eflag,vflag); diff --git a/src/USER-PLUMED/fix_plumed.cpp b/src/USER-PLUMED/fix_plumed.cpp index 3a52bbaaa1..3d2acacc1e 100644 --- a/src/USER-PLUMED/fix_plumed.cpp +++ b/src/USER-PLUMED/fix_plumed.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include #include "atom.h" @@ -33,7 +33,7 @@ #include "compute.h" #include "modify.h" #include "pair.h" -#include "utils.h" + #include "timer.h" #include "plumed/wrapper/Plumed.h" @@ -53,8 +53,8 @@ using namespace FixConst; FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - p(NULL), nlocal(0), gatindex(NULL), masses(NULL), charges(NULL), - id_pe(NULL), id_press(NULL) + p(nullptr), nlocal(0), gatindex(nullptr), masses(nullptr), charges(nullptr), + id_pe(nullptr), id_press(nullptr) { if (!atom->tag_enable) @@ -68,7 +68,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : "Group will be ignored."); #if defined(__PLUMED_DEFAULT_KERNEL) - if (getenv("PLUMED_KERNEL") == NULL) + if (getenv("PLUMED_KERNEL") == nullptr) putenv(plumed_default_kernel); #endif @@ -101,7 +101,7 @@ FixPlumed::FixPlumed(LAMMPS *lmp, int narg, char **arg) : // it is defined inside plumed. p->cmd("GREX setMPIIntercomm",&inter_comm); } - p->cmd("GREX init",NULL); + p->cmd("GREX init",nullptr); } // The general communicator is independent of the existence of partitions, diff --git a/src/USER-PTM/compute_ptm_atom.cpp b/src/USER-PTM/compute_ptm_atom.cpp index df6a01e6c6..497fb7f972 100644 --- a/src/USER-PTM/compute_ptm_atom.cpp +++ b/src/USER-PTM/compute_ptm_atom.cpp @@ -61,7 +61,7 @@ static const char cite_user_ptm_package[] = /* ---------------------------------------------------------------------- */ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg) - : Compute(lmp, narg, arg), list(NULL), output(NULL) { + : Compute(lmp, narg, arg), list(nullptr), output(nullptr) { if (narg < 5 || narg > 6) error->all(FLERR, "Illegal compute ptm/atom command"); @@ -115,7 +115,7 @@ ComputePTMAtom::ComputePTMAtom(LAMMPS *lmp, int narg, char **arg) ptr++; } - double threshold = force->numeric(FLERR, arg[4]); + double threshold = utils::numeric(FLERR, arg[4],false,lmp); if (threshold < 0.0) error->all(FLERR, "Illegal compute ptm/atom command (threshold is negative)"); @@ -144,7 +144,7 @@ ComputePTMAtom::~ComputePTMAtom() { memory->destroy(output); } /* ---------------------------------------------------------------------- */ void ComputePTMAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR, "Compute ptm/atom requires a pair style be defined"); int count = 0; @@ -201,7 +201,7 @@ static int get_neighbours(void* vdata, size_t central_index, size_t atom_index, double **x = data->x; double *pos = x[atom_index]; - int *jlist = NULL; + int *jlist = nullptr; int jnum = 0; if (atom_index < data->nlocal) { jlist = data->firstneigh[atom_index]; @@ -285,7 +285,7 @@ void ComputePTMAtom::compute_peratom() { // zero output - memset(output,0,nmax*NUM_COLUMNS*sizeof(double)); + memset(&output[0][0],0,nmax*NUM_COLUMNS*sizeof(double)); for (int ii = 0; ii < inum; ii++) { @@ -304,21 +304,17 @@ void ComputePTMAtom::compute_peratom() { double scale, rmsd, interatomic_distance; double q[4]; bool standard_orientations = false; + + rmsd = INFINITY; + interatomic_distance = q[0] = q[1] = q[2] = q[3] = 0.0; + ptm_index(local_handle, i, get_neighbours, (void*)&nbrlist, input_flags, standard_orientations, &type, &alloy_type, &scale, &rmsd, q, - NULL, NULL, NULL, NULL, &interatomic_distance, NULL, NULL); + nullptr, nullptr, nullptr, nullptr, &interatomic_distance, nullptr, nullptr); - if (rmsd > rmsd_threshold) { - type = PTM_MATCH_NONE; - } - - // printf("%d type=%d rmsd=%f\n", i, type, rmsd); - - if (type == PTM_MATCH_NONE) { - type = PTM_LAMMPS_OTHER; - rmsd = INFINITY; - } + if (rmsd > rmsd_threshold) type = PTM_MATCH_NONE; + if (type == PTM_MATCH_NONE) type = PTM_LAMMPS_OTHER; output[i][0] = type; output[i][1] = rmsd; @@ -329,7 +325,6 @@ void ComputePTMAtom::compute_peratom() { output[i][6] = q[3]; } - // printf("finished ptm analysis\n"); ptm_uninitialize_local(local_handle); } diff --git a/src/USER-PTM/ptm_deformation_gradient.h b/src/USER-PTM/ptm_deformation_gradient.h index 546efab437..6c686431f6 100644 --- a/src/USER-PTM/ptm_deformation_gradient.h +++ b/src/USER-PTM/ptm_deformation_gradient.h @@ -10,9 +10,11 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI #ifndef PTM_DEFORMATION_GRADIENT_H #define PTM_DEFORMATION_GRADIENT_H -#include #include "ptm_constants.h" +#include +#include + namespace ptm { void calculate_deformation_gradient(int num_points, const double (*ideal_points)[3], int8_t* mapping, double (*normalized)[3], const double (*penrose)[3], double* F, double* res); diff --git a/src/USER-PTM/ptm_index.cpp b/src/USER-PTM/ptm_index.cpp index cedd35126d..7c912ed5b9 100644 --- a/src/USER-PTM/ptm_index.cpp +++ b/src/USER-PTM/ptm_index.cpp @@ -95,11 +95,11 @@ static void output_data(ptm::result_t *res, double (*points)[3], double *P, double *p_interatomic_distance, double *p_lattice_constant, size_t *output_indices) { const ptm::refdata_t *ref = res->ref_struct; - if (ref == NULL) + if (ref == nullptr) return; *p_type = ref->type; - if (p_alloy_type != NULL) + if (p_alloy_type != nullptr) *p_alloy_type = ptm::find_alloy_type(ref, res->mapping, numbers); int8_t temp[PTM_MAX_POINTS]; @@ -123,7 +123,7 @@ static void output_data(ptm::result_t *res, double (*points)[3], memcpy(res->mapping, temp, (ref->num_nbrs + 1) * sizeof(int8_t)); - if (F != NULL && F_res != NULL) { + if (F != nullptr && F_res != nullptr) { double scaled_points[PTM_MAX_INPUT_POINTS][3]; ptm::subtract_barycentre(ref->num_nbrs + 1, points, scaled_points); @@ -160,11 +160,11 @@ static void output_data(ptm::result_t *res, double (*points)[3], if (ref->type == PTM_MATCH_GRAPHENE) // hack for pseudo-2d structures F[8] = 1; - if (P != NULL && U != NULL) + if (P != nullptr && U != nullptr) ptm::polar_decomposition_3x3(F, false, U, P); } - if (output_indices != NULL) + if (output_indices != nullptr) for (int i = 0; i < ref->num_nbrs + 1; i++) output_indices[i] = ordering[res->mapping[i]]; @@ -173,10 +173,10 @@ static void output_data(ptm::result_t *res, double (*points)[3], double lattice_constant = calculate_lattice_constant(ref->type, interatomic_distance); - if (p_interatomic_distance != NULL) + if (p_interatomic_distance != nullptr) *p_interatomic_distance = interatomic_distance; - if (p_lattice_constant != NULL) + if (p_lattice_constant != nullptr) *p_lattice_constant = lattice_constant; *p_rmsd = res->rmsd; @@ -200,7 +200,7 @@ int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, int ret = 0; ptm::result_t res; - res.ref_struct = NULL; + res.ref_struct = nullptr; res.rmsd = INFINITY; size_t ordering[PTM_MAX_INPUT_POINTS]; @@ -269,13 +269,13 @@ int ptm_index(ptm_local_handle_t local_handle, size_t atom_index, } *p_type = PTM_MATCH_NONE; - if (p_alloy_type != NULL) + if (p_alloy_type != nullptr) *p_alloy_type = PTM_ALLOY_NONE; - if (output_indices != NULL) + if (output_indices != nullptr) memset(output_indices, -1, PTM_MAX_INPUT_POINTS * sizeof(size_t)); - if (res.ref_struct == NULL) + if (res.ref_struct == nullptr) return PTM_NO_ERROR; if (res.ref_struct->type == PTM_MATCH_DCUB || diff --git a/src/USER-PTM/ptm_initialize_data.h b/src/USER-PTM/ptm_initialize_data.h index 87111b1282..dd1cddd9f2 100644 --- a/src/USER-PTM/ptm_initialize_data.h +++ b/src/USER-PTM/ptm_initialize_data.h @@ -50,17 +50,17 @@ const refdata_t structure_sc = { PTM_MATCH_SC, //. NUM_SC_GRAPHS, //.num_graphs graphs_sc, //.graphs ptm_template_sc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_sc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_sc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_fcc = { PTM_MATCH_FCC, //.type @@ -70,17 +70,17 @@ const refdata_t structure_fcc = { PTM_MATCH_FCC, / NUM_FCC_GRAPHS, //.num_graphs graphs_fcc, //.graphs ptm_template_fcc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_fcc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_fcc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_hcp = { PTM_MATCH_HCP, //.type @@ -91,12 +91,12 @@ const refdata_t structure_hcp = { PTM_MATCH_HCP, / graphs_hcp, //.graphs ptm_template_hcp, //.points ptm_template_hcp_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_hcp, //.penrose penrose_hcp_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_HEX_MAPPINGS, //.num_mappings mapping_hcp, //.mapping mapping_hcp_conventional, //.mapping_conventional @@ -110,17 +110,17 @@ const refdata_t structure_ico = { PTM_MATCH_ICO, / NUM_ICO_GRAPHS, //.num_graphs graphs_ico, //.graphs ptm_template_ico, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_ico, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_ICO_MAPPINGS, //.num_mappings mapping_ico, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_bcc = { PTM_MATCH_BCC, //.type @@ -130,17 +130,17 @@ const refdata_t structure_bcc = { PTM_MATCH_BCC, / NUM_BCC_GRAPHS, //.num_graphs graphs_bcc, //.graphs ptm_template_bcc, //.points - NULL, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt1 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_bcc, //.penrose - NULL, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt1 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_CUBIC_MAPPINGS, //.num_mappings mapping_bcc, //.mapping - NULL, //.mapping_conventional - NULL, //.template_indices + nullptr, //.mapping_conventional + nullptr, //.template_indices }; const refdata_t structure_dcub = { PTM_MATCH_DCUB, //.type @@ -151,12 +151,12 @@ const refdata_t structure_dcub = { PTM_MATCH_DCUB, graphs_dcub, //.graphs ptm_template_dcub, //.points ptm_template_dcub_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_dcub, //.penrose penrose_dcub_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 NUM_DCUB_MAPPINGS, //.num_mappings mapping_dcub, //.mapping mapping_dcub_conventional, //.mapping_conventional @@ -188,15 +188,15 @@ const refdata_t structure_graphene = { PTM_MATCH_GRAPHENE, -1, //.num_facets -1, //.max_degree -1, //.num_graphs - NULL, //.graphs + nullptr, //.graphs ptm_template_graphene, //.points ptm_template_graphene_alt1, //.points_alt1 - NULL, //.points_alt2 - NULL, //.points_alt3 + nullptr, //.points_alt2 + nullptr, //.points_alt3 penrose_graphene, //.penrose penrose_graphene_alt1, //.penrose_alt1 - NULL, //.penrose_alt2 - NULL, //.penrose_alt3 + nullptr, //.penrose_alt2 + nullptr, //.penrose_alt3 -1, //.num_mappings mapping_graphene, //.mapping mapping_graphene_conventional, //.mapping_conventional diff --git a/src/USER-QMMM/fix_qmmm.cpp b/src/USER-QMMM/fix_qmmm.cpp index f1a34d9538..f6d0f9300a 100644 --- a/src/USER-QMMM/fix_qmmm.cpp +++ b/src/USER-QMMM/fix_qmmm.cpp @@ -15,7 +15,7 @@ Contributing author: Axel Kohlmeyer (ICTP) ------------------------------------------------------------------------- */ -#include + #include #include "fix_qmmm.h" #include "atom.h" @@ -169,7 +169,7 @@ tagint taginthash_lookup(const taginthash_t *tptr, tagint key) { /* find the entry in the hash table */ h=taginthash(tptr, key); - for (node=tptr->bucket[h]; node!=NULL; node=node->next) { + for (node=tptr->bucket[h]; node!=nullptr; node=node->next) { if (node->key == key) break; } @@ -191,7 +191,7 @@ tagint *taginthash_keys(taginthash_t *tptr) { keys = (tagint *)calloc(tptr->entries, sizeof(tagint)); for (tagint i=0; i < tptr->size; ++i) { - for (node=tptr->bucket[i]; node != NULL; node=node->next) { + for (node=tptr->bucket[i]; node != nullptr; node=node->next) { keys[node->data] = node->key; } } @@ -242,7 +242,7 @@ void taginthash_destroy(taginthash_t *tptr) { for (i=0; isize; i++) { node = tptr->bucket[i]; - while (node != NULL) { + while (node != nullptr) { last = node; node = node->next; free(last); @@ -250,7 +250,7 @@ void taginthash_destroy(taginthash_t *tptr) { } /* free the entire array of buckets */ - if (tptr->bucket != NULL) { + if (tptr->bucket != nullptr) { free(tptr->bucket); memset(tptr, 0, sizeof(taginthash_t)); } @@ -353,11 +353,11 @@ FixQMMM::FixQMMM(LAMMPS *lmp, int narg, char **arg) : mm_comm = MPI_Comm_f2c(qmmmcfg.mm_comm); /* initialize storage */ - qm_idmap = mm_idmap = NULL; - qm_remap = mm_remap = NULL; - qm_coord = mm_coord = qm_force = mm_force = NULL; - qm_charge =NULL; - mm_type = NULL; + qm_idmap = mm_idmap = nullptr; + qm_remap = mm_remap = nullptr; + qm_coord = mm_coord = qm_force = mm_force = nullptr; + qm_charge =nullptr; + mm_type = nullptr; do_init = 1; diff --git a/src/USER-QTB/fix_qbmsst.cpp b/src/USER-QTB/fix_qbmsst.cpp index d58c917308..94de771f74 100644 --- a/src/USER-QTB/fix_qbmsst.cpp +++ b/src/USER-QTB/fix_qbmsst.cpp @@ -17,11 +17,11 @@ ------------------------------------------------------------------------- */ #include "fix_qbmsst.h" -#include + #include #include -#include -#include + + #include "atom.h" #include "force.h" #include "update.h" @@ -34,8 +34,8 @@ #include "error.h" #include "kspace.h" #include "math_const.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -100,70 +100,70 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"q") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - qmass = force->numeric(FLERR,arg[iarg+1]); + qmass = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (qmass < 0.0) error->all(FLERR,"Fix qbmsst qmass must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"mu") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - mu = force->numeric(FLERR,arg[iarg+1]); + mu = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (mu < 0.0) error->all(FLERR,"Fix qbmsst mu must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"p0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - p0 = force->numeric(FLERR,arg[iarg+1]); + p0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (p0 < 0.0) error->all(FLERR,"Fix qbmsst p0 must be >= 0.0"); p0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"v0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - v0 = force->numeric(FLERR,arg[iarg+1]); + v0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (v0 < 0.0) error->all(FLERR,"Fix qbmsst v0 must be >= 0.0"); v0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"e0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - e0 = force->numeric(FLERR,arg[iarg+1]); + e0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); e0_set = 1; iarg += 2; } else if (strcmp(arg[iarg],"tscale") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - tscale = force->numeric(FLERR,arg[iarg+1]); + tscale = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (tscale < 0.0 || tscale > 1.0) error->all(FLERR,"Fix qbmsst tscale must satisfy 0 <= tscale < 1"); iarg += 2; } else if (strcmp(arg[iarg],"damp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - t_period = force->numeric(FLERR,arg[iarg+1]); + t_period = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix qbmsst damp must be > 0.0"); fric_coef = 1/t_period; iarg += 2; } else if (strcmp(arg[iarg],"seed") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - seed = force->inumeric(FLERR,arg[iarg+1]); + seed = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (seed <= 0) error->all(FLERR,"Fix qbmsst seed must be a positive integer"); iarg += 2; } else if (strcmp(arg[iarg],"f_max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - f_max = force->numeric(FLERR,arg[iarg+1]); + f_max = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (f_max <= 0) error->all(FLERR,"Fix qbmsst f_max must be > 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"N_f") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - N_f = force->inumeric(FLERR,arg[iarg+1]); + N_f = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (N_f <= 0) error->all(FLERR,"Fix qbmsst N_f must be a positive integer"); iarg += 2; } else if (strcmp(arg[iarg],"eta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - eta = force->numeric(FLERR,arg[iarg+1]); + eta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (eta <= 0) error->all(FLERR,"Fix qbmsst eta must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"beta") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - beta = force->inumeric(FLERR,arg[iarg+1]); + beta = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (beta <= 0) error->all(FLERR,"Fix qbmsst beta must be a positive integer"); iarg += 2; } else if (strcmp(arg[iarg],"T_init") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qbmsst command"); - t_init = force->numeric(FLERR,arg[iarg+1]); + t_init = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_init <= 0) error->all(FLERR,"Fix qbmsst T_init must be >= 0.0"); iarg += 2; } else error->all(FLERR,"Illegal fix qbmsst command"); @@ -246,19 +246,19 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : peflag = 1; // allocate qbmsst - temperature = NULL; - pressure = NULL; - pe = NULL; - old_velocity = NULL; - rfix = NULL; - gfactor = NULL; - random = NULL; - omega_H = NULL; - time_H = NULL; - random_array_0 = NULL; - random_array_1 = NULL; - random_array_2 = NULL; - fran = NULL; + temperature = nullptr; + pressure = nullptr; + pe = nullptr; + old_velocity = nullptr; + rfix = nullptr; + gfactor = nullptr; + random = nullptr; + omega_H = nullptr; + time_H = nullptr; + random_array_0 = nullptr; + random_array_1 = nullptr; + random_array_2 = nullptr; + fran = nullptr; // initialize Marsagxlia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -268,7 +268,7 @@ FixQBMSST::FixQBMSST(LAMMPS *lmp, int narg, char **arg) : // allocate random-arrays and fran grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // allocate omega_H and time_H memory->create(omega_H,2*N_f,"qbmsst:omega_H"); @@ -303,7 +303,7 @@ FixQBMSST::~FixQBMSST() memory->destroy(random_array_2); memory->destroy(omega_H); memory->destroy(time_H); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); } /* ---------------------------------------------------------------------- @@ -331,7 +331,7 @@ void FixQBMSST::init() boltz = force->boltz; nktv2p = force->nktv2p; mvv2e = force->mvv2e; - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix qbmsst without per-type mass defined"); // set compute ptrs diff --git a/src/USER-QTB/fix_qtb.cpp b/src/USER-QTB/fix_qtb.cpp index a29dbc70a1..a53baf4083 100644 --- a/src/USER-QTB/fix_qtb.cpp +++ b/src/USER-QTB/fix_qtb.cpp @@ -17,10 +17,10 @@ ------------------------------------------------------------------------- */ #include "fix_qtb.h" -#include + #include #include -#include + #include "atom.h" #include "force.h" #include "update.h" @@ -32,8 +32,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -64,28 +64,28 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"temp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - t_target = force->numeric(FLERR,arg[iarg+1]); + t_target = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_target < 0.0) error->all(FLERR,"Fix qtb temp must be >= 0.0"); iarg += 2; } else if (strcmp(arg[iarg],"damp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - t_period = force->numeric(FLERR,arg[iarg+1]); + t_period = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix qtb damp must be > 0.0"); fric_coef = 1/t_period; iarg += 2; } else if (strcmp(arg[iarg],"seed") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - seed = force->inumeric(FLERR,arg[iarg+1]); + seed = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal fix qtb command"); iarg += 2; } else if (strcmp(arg[iarg],"f_max") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - f_max = force->numeric(FLERR,arg[iarg+1]); + f_max = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (f_max <= 0) error->all(FLERR,"Illegal fix qtb command"); iarg += 2; } else if (strcmp(arg[iarg],"N_f") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix qtb command"); - N_f = force->inumeric(FLERR,arg[iarg+1]); + N_f = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (N_f <= 0) error->all(FLERR,"Illegal fix qtb command"); iarg += 2; } else error->all(FLERR,"Illegal fix qtb command"); @@ -94,16 +94,16 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : maxexchange = 6*N_f+3; // allocate qtb - gfactor1 = NULL; - gfactor3 = NULL; - omega_H = NULL; - time_H = NULL; - random_array_0 = NULL; - random_array_1 = NULL; - random_array_2 = NULL; - fran = NULL; - id_temp = NULL; - temperature = NULL; + gfactor1 = nullptr; + gfactor3 = nullptr; + omega_H = nullptr; + time_H = nullptr; + random_array_0 = nullptr; + random_array_1 = nullptr; + random_array_2 = nullptr; + fran = nullptr; + id_temp = nullptr; + temperature = nullptr; // initialize Marsaglia RNG with processor-unique seed random = new RanMars(lmp,seed + comm->me); @@ -114,7 +114,7 @@ FixQTB::FixQTB(LAMMPS *lmp, int narg, char **arg) : // allocate random-arrays and fran grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // allocate omega_H and time_H memory->create(omega_H,2*N_f,"qtb:omega_H"); @@ -136,7 +136,7 @@ FixQTB::~FixQTB() memory->destroy(random_array_2); memory->destroy(omega_H); memory->destroy(time_H); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); } /* ---------------------------------------------------------------------- @@ -158,7 +158,7 @@ void FixQTB::init() { // copy parameters from other classes double dtv = update->dt; - if (atom->mass == NULL) + if (atom->mass == nullptr) error->all(FLERR,"Cannot use fix msst without per-type mass defined"); //initiate the counter \mu diff --git a/src/USER-QUIP/pair_quip.cpp b/src/USER-QUIP/pair_quip.cpp index 7c762208b7..d2093941a0 100644 --- a/src/USER-QUIP/pair_quip.cpp +++ b/src/USER-QUIP/pair_quip.cpp @@ -16,10 +16,10 @@ Aidan Thompson (Sandia, athomps@sandia.gov) ------------------------------------------------------------------------- */ -#include + #include #include -#include + #include #include "pair_quip.h" #include "atom.h" @@ -45,10 +45,10 @@ PairQUIP::PairQUIP(LAMMPS *lmp) : Pair(lmp) no_virial_fdotr_compute = 1; manybody_flag = 1; - map = NULL; - quip_potential = NULL; - quip_file = NULL; - quip_string = NULL; + map = nullptr; + quip_potential = nullptr; + quip_file = nullptr; + quip_string = nullptr; } PairQUIP::~PairQUIP() @@ -275,7 +275,7 @@ void PairQUIP::coeff(int narg, char **arg) if (strcmp(arg[i],"NULL") == 0) map[i-3] = -1; else - map[i-3] = force->inumeric(FLERR,arg[i]); + map[i-3] = utils::inumeric(FLERR,arg[i],false,lmp); } // clear setflag since coeff() called once with I,J = * * diff --git a/src/USER-REACTION/fix_bond_react.cpp b/src/USER-REACTION/fix_bond_react.cpp index 2c6c20c844..28a7ca92e7 100644 --- a/src/USER-REACTION/fix_bond_react.cpp +++ b/src/USER-REACTION/fix_bond_react.cpp @@ -16,33 +16,36 @@ Contributing Author: Jacob Gissinger (jacob.gissinger@colorado.edu) ------------------------------------------------------------------------- */ #include "fix_bond_react.h" -#include -#include -#include -#include -#include "update.h" -#include "modify.h" -#include "respa.h" + #include "atom.h" #include "atom_vec.h" -#include "force.h" -#include "pair.h" +#include "citeme.h" #include "comm.h" #include "domain.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "random_mars.h" -#include "molecule.h" +#include "error.h" +#include "force.h" #include "group.h" -#include "citeme.h" +#include "input.h" #include "math_const.h" #include "math_extra.h" #include "memory.h" -#include "error.h" -#include "input.h" +#include "modify.h" +#include "molecule.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair.h" +#include "random_mars.h" +#include "reset_mol_ids.h" +#include "respa.h" +#include "update.h" #include "variable.h" -#include "fmt/format.h" + +#include "superpose3d.h" + +#include +#include +#include #include @@ -77,7 +80,7 @@ static const char cite_fix_bond_react[] = enum{ACCEPT,REJECT,PROCEED,CONTINUE,GUESSFAIL,RESTORE}; // types of available reaction constraints -enum{DISTANCE,ANGLE,DIHEDRAL,ARRHENIUS}; +enum{DISTANCE,ANGLE,DIHEDRAL,ARRHENIUS,RMSD}; // keyword values that accept variables as input enum{NEVERY,RMIN,RMAX,PROB}; @@ -89,9 +92,10 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : { if (lmp->citeme) lmp->citeme->add(cite_fix_bond_react); - fix1 = NULL; - fix2 = NULL; - fix3 = NULL; + fix1 = nullptr; + fix2 = nullptr; + fix3 = nullptr; + reset_mol_ids = nullptr; if (narg < 8) error->all(FLERR,"Illegal fix bond/react command: " "too few arguments"); @@ -112,12 +116,12 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : narrhenius = 0; status = PROCEED; - nxspecial = NULL; - onemol_nxspecial = NULL; - twomol_nxspecial = NULL; - xspecial = NULL; - onemol_xspecial = NULL; - twomol_xspecial = NULL; + nxspecial = nullptr; + onemol_nxspecial = nullptr; + twomol_nxspecial = nullptr; + xspecial = nullptr; + onemol_xspecial = nullptr; + twomol_xspecial = nullptr; // these group names are reserved for use exclusively by bond/react master_group = (char *) "bond_react_MASTER_group"; @@ -144,7 +148,8 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : int iarg = 3; stabilization_flag = 0; - int num_common_keywords = 1; + reset_mol_ids_flag = 1; + int num_common_keywords = 2; for (int m = 0; m < num_common_keywords; m++) { if (strcmp(arg[iarg],"stabilization") == 0) { if (strcmp(arg[iarg+1],"no") == 0) { @@ -162,11 +167,23 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : nve_limit_xmax = arg[iarg+3]; iarg += 4; } + } else if (strcmp(arg[iarg],"reset_mol_ids") == 0) { + if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " + "'reset_mol_ids' keyword has too few arguments"); + if (strcmp(arg[iarg+1],"yes") == 0) reset_mol_ids_flag = 1; // default + if (strcmp(arg[iarg+1],"no") == 0) reset_mol_ids_flag = 0; + iarg += 2; } else if (strcmp(arg[iarg],"react") == 0) { break; } else error->all(FLERR,"Illegal fix bond/react command: unknown keyword"); } + if (reset_mol_ids_flag) { + delete reset_mol_ids; + reset_mol_ids = new ResetMolIDs(lmp); + reset_mol_ids->create_computes(id,group->names[igroup]); + } + // set up common variables as vectors of length 'nreacts' // nevery, cutoff, onemol, twomol, superimpose file @@ -184,7 +201,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(seed,nreacts,"bond/react:seed"); memory->create(limit_duration,nreacts,"bond/react:limit_duration"); memory->create(stabilize_steps_flag,nreacts,"bond/react:stabilize_steps_flag"); - memory->create(update_edges_flag,nreacts,"bond/react:update_edges_flag"); + memory->create(custom_charges_fragid,nreacts,"bond/react:custom_charges_fragid"); memory->create(constraints,1,MAXCONARGS,"bond/react:constraints"); memory->create(var_flag,NUMVARVALS,nreacts,"bond/react:var_flag"); memory->create(var_id,NUMVARVALS,nreacts,"bond/react:var_id"); @@ -204,7 +221,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : seed[i] = 12345; max_rxn[i] = INT_MAX; stabilize_steps_flag[i] = 0; - update_edges_flag[i] = 0; + custom_charges_fragid[i] = -1; // set default limit duration to 60 timesteps limit_duration[i] = 60; reaction_count[i] = 0; @@ -229,11 +246,11 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : int n = strlen(arg[iarg]) + 1; if (n > MAXLINE) error->all(FLERR,"Reaction name (react-ID) is too long (limit: 256 characters)"); - strncpy(rxn_name[rxn],arg[iarg++],n); + strcpy(rxn_name[rxn],arg[iarg++]); - int igroup = group->find(arg[iarg++]); - if (igroup == -1) error->all(FLERR,"Could not find fix group ID"); - groupbits[rxn] = group->bitmask[igroup]; + int groupid = group->find(arg[iarg++]); + if (groupid == -1) error->all(FLERR,"Could not find fix group ID"); + groupbits[rxn] = group->bitmask[groupid]; if (strncmp(arg[iarg],"v_",2) == 0) { n = strlen(&arg[iarg][2]) + 1; @@ -247,7 +264,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : var_flag[NEVERY][rxn] = 1; delete [] str; } else { - nevery[rxn] = force->inumeric(FLERR,arg[iarg]); + nevery[rxn] = utils::inumeric(FLERR,arg[iarg],false,lmp); if (nevery[rxn] <= 0) error->all(FLERR,"Illegal fix bond/react command: " "'Nevery' must be a positive integer"); } @@ -267,7 +284,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : var_flag[RMIN][rxn] = 1; delete [] str; } else { - double cutoff = force->numeric(FLERR,arg[iarg]); + double cutoff = utils::numeric(FLERR,arg[iarg],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command: " "'Rmin' cannot be negative"); cutsq[rxn][0] = cutoff*cutoff; @@ -288,7 +305,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : var_flag[RMAX][rxn] = 1; delete [] str; } else { - double cutoff = force->numeric(FLERR,arg[iarg]); + double cutoff = utils::numeric(FLERR,arg[iarg],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal fix bond/react command:" "'Rmax' cannot be negative"); cutsq[rxn][1] = cutoff*cutoff; @@ -326,9 +343,9 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : delete [] str; } else { // otherwise probability should be a number - fraction[rxn] = force->numeric(FLERR,arg[iarg+1]); + fraction[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } - seed[rxn] = force->inumeric(FLERR,arg[iarg+2]); + seed[rxn] = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (fraction[rxn] < 0.0 || fraction[rxn] > 1.0) error->all(FLERR,"Illegal fix bond/react command: " "probability fraction must between 0 and 1, inclusive"); @@ -338,7 +355,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"max_rxn") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'max_rxn' has too few arguments"); - max_rxn[rxn] = force->inumeric(FLERR,arg[iarg+1]); + max_rxn[rxn] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (max_rxn[rxn] < 0) error->all(FLERR,"Illegal fix bond/react command: " "'max_rxn' cannot be negative"); iarg += 2; @@ -347,16 +364,18 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : "used without stabilization keyword"); if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " "'stabilize_steps' has too few arguments"); - limit_duration[rxn] = force->numeric(FLERR,arg[iarg+1]); + limit_duration[rxn] = utils::numeric(FLERR,arg[iarg+1],false,lmp); stabilize_steps_flag[rxn] = 1; iarg += 2; - } else if (strcmp(arg[iarg],"update_edges") == 0) { + } else if (strcmp(arg[iarg],"custom_charges") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix bond/react command: " - "'update_edges' has too few arguments"); - if (strcmp(arg[iarg+1],"none") == 0) update_edges_flag[rxn] = 0; - else if (strcmp(arg[iarg+1],"charges") == 0) update_edges_flag[rxn] = 1; - else if (strcmp(arg[iarg+1],"custom") == 0) update_edges_flag[rxn] = 2; - else error->all(FLERR,"Illegal value for 'update_edges' keyword'"); + "'custom_charges' has too few arguments"); + if (strcmp(arg[iarg+1],"no") == 0) custom_charges_fragid[rxn] = -1; //default + else { + custom_charges_fragid[rxn] = atom->molecules[unreacted_mol[rxn]]->findfragment(arg[iarg+1]); + if (custom_charges_fragid[rxn] < 0) error->one(FLERR,"Bond/react: Molecule fragment for " + "'custom_charges' keyword does not exist"); + } iarg += 2; } else error->all(FLERR,"Illegal fix bond/react command: unknown keyword"); } @@ -372,15 +391,14 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : memory->create(reverse_equiv,max_natoms,2,nreacts,"bond/react:reverse_equiv"); memory->create(edge,max_natoms,nreacts,"bond/react:edge"); memory->create(landlocked_atoms,max_natoms,nreacts,"bond/react:landlocked_atoms"); - memory->create(custom_edges,max_natoms,nreacts,"bond/react:custom_edges"); + memory->create(custom_charges,max_natoms,nreacts,"bond/react:custom_charges"); memory->create(delete_atoms,max_natoms,nreacts,"bond/react:delete_atoms"); memory->create(chiral_atoms,max_natoms,6,nreacts,"bond/react:chiral_atoms"); for (int j = 0; j < nreacts; j++) for (int i = 0; i < max_natoms; i++) { edge[i][j] = 0; - if (update_edges_flag[j] == 1) custom_edges[i][j] = 1; - else custom_edges[i][j] = 0; + custom_charges[i][j] = 1; // update all partial charges by default delete_atoms[i][j] = 0; for (int k = 0; k < 6; k++) { chiral_atoms[i][k][j] = 0; @@ -402,6 +420,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : iatomtype[i] = onemol->type[ibonding[i]-1]; jatomtype[i] = onemol->type[jbonding[i]-1]; find_landlocked_atoms(i); + if (custom_charges_fragid[i] >= 0) CustomCharges(custom_charges_fragid[i],i); } // initialize Marsaglia RNG with processor-unique seed (Arrhenius prob) @@ -419,7 +438,7 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : } delete [] files; - if (atom->molecular != 1) + if (atom->molecular != Atom::MOLECULAR) error->all(FLERR,"Bond/react: Cannot use fix bond/react with non-molecular systems"); // check if bonding atoms are 1-2, 1-3, or 1-4 bonded neighbors @@ -455,16 +474,16 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : // allocate arrays local to this fix nmax = 0; - partner = finalpartner = NULL; - distsq = NULL; - probability = NULL; + partner = finalpartner = nullptr; + distsq = nullptr; + probability = nullptr; maxcreate = 0; - created = NULL; - ncreate = NULL; + created = nullptr; + ncreate = nullptr; allncreate = 0; local_num_mega = 0; ghostly_num_mega = 0; - restore = NULL; + restore = nullptr; // zero out stats global_megasize = 0; @@ -472,17 +491,17 @@ FixBondReact::FixBondReact(LAMMPS *lmp, int narg, char **arg) : glove_counter = 0; guess_branch = new int[MAXGUESS](); pioneer_count = new int[max_natoms]; - local_mega_glove = NULL; - ghostly_mega_glove = NULL; - global_mega_glove = NULL; + local_mega_glove = nullptr; + ghostly_mega_glove = nullptr; + global_mega_glove = nullptr; // these are merely loop indices that became important pion = neigh = trace = 0; - id_fix1 = NULL; - id_fix2 = NULL; - id_fix3 = NULL; - statted_id = NULL; + id_fix1 = nullptr; + id_fix2 = nullptr; + id_fix3 = nullptr; + statted_id = nullptr; custom_exclude_flag = 0; // used to store restart info @@ -499,6 +518,8 @@ FixBondReact::~FixBondReact() } delete [] random; + delete reset_mol_ids; + memory->destroy(partner); memory->destroy(finalpartner); memory->destroy(ncreate); @@ -509,7 +530,7 @@ FixBondReact::~FixBondReact() memory->destroy(equivalences); memory->destroy(reverse_equiv); memory->destroy(landlocked_atoms); - memory->destroy(custom_edges); + memory->destroy(custom_charges); memory->destroy(delete_atoms); memory->destroy(chiral_atoms); @@ -526,7 +547,7 @@ FixBondReact::~FixBondReact() memory->destroy(var_flag); memory->destroy(var_id); memory->destroy(stabilize_steps_flag); - memory->destroy(update_edges_flag); + memory->destroy(custom_charges_fragid); memory->destroy(iatomtype); memory->destroy(jatomtype); @@ -623,9 +644,9 @@ void FixBondReact::post_constructor() group->assign(cmd); if (stabilization_flag == 1) { - int igroup = group->find(exclude_group); + int groupid = group->find(exclude_group); // create exclude_group if not already existing, or use as parent group if static - if (igroup == -1 || group->dynamic[igroup] == 0) { + if (groupid == -1 || group->dynamic[groupid] == 0) { // create stabilization per-atom property cmd = std::string("bond_react_stabilization_internal"); id_fix3 = new char[cmd.size()+1]; @@ -655,7 +676,7 @@ void FixBondReact::post_constructor() strcat(exclude_group,"_REACT"); group->find_or_create(exclude_group); - if (igroup == -1) + if (groupid == -1) cmd = fmt::format("{} dynamic all property statted_tags",exclude_group); else cmd = fmt::format("{} dynamic {} property statted_tags",exclude_group,exclude_PARENT_group); @@ -689,7 +710,7 @@ void FixBondReact::post_constructor() int unused; char * idprop; idprop = (char *) fix->extract("property",unused); - if (idprop == NULL) + if (idprop == nullptr) error->all(FLERR,"Exclude group must be a per-atom property group"); len = strlen(idprop) + 1; @@ -731,7 +752,7 @@ void FixBondReact::init() // check cutoff for iatomtype,jatomtype for (int i = 0; i < nreacts; i++) { - if (force->pair == NULL || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) + if (force->pair == nullptr || cutsq[i][1] > force->pair->cutsq[iatomtype[i]][jatomtype[i]]) error->all(FLERR,"Bond/react: Fix bond/react cutoff is longer than pairwise cutoff"); } @@ -1840,6 +1861,53 @@ int FixBondReact::check_constraints() prrhob = constraints[i][3]*pow(t,constraints[i][4])* exp(-constraints[i][5]/(force->boltz*t)); if (prrhob < rrhandom[(int) constraints[i][2]]->uniform()) return 0; + } else if (constraints[i][1] == RMSD) { + // call superpose + int iatom; + int iref = -1; // choose first atom as reference + int n2superpose = 0; + double **xfrozen; // coordinates for the "frozen" target molecule + double **xmobile; // coordinates for the "mobile" molecule + int ifragment = constraints[i][3]; + if (ifragment >= 0) { + for (int j = 0; j < onemol->natoms; j++) + if (onemol->fragmentmask[ifragment][j]) n2superpose++; + memory->create(xfrozen,n2superpose,3,"bond/react:xfrozen"); + memory->create(xmobile,n2superpose,3,"bond/react:xmobile"); + int myincr = 0; + for (int j = 0; j < onemol->natoms; j++) { + if (onemol->fragmentmask[ifragment][j]) { + iatom = atom->map(glove[j][1]); + if (iref == -1) iref = iatom; + iatom = domain->closest_image(iref,iatom); + for (int k = 0; k < 3; k++) { + xfrozen[myincr][k] = x[iatom][k]; + xmobile[myincr][k] = onemol->x[j][k]; + } + myincr++; + } + } + } else { + int iatom; + int iref = -1; // choose first atom as reference + n2superpose = onemol->natoms; + memory->create(xfrozen,n2superpose,3,"bond/react:xfrozen"); + memory->create(xmobile,n2superpose,3,"bond/react:xmobile"); + for (int j = 0; j < n2superpose; j++) { + iatom = atom->map(glove[j][1]); + if (iref == -1) iref = iatom; + iatom = domain->closest_image(iref,iatom); + for (int k = 0; k < 3; k++) { + xfrozen[j][k] = x[iatom][k]; + xmobile[j][k] = onemol->x[j][k]; + } + } + } + Superpose3D superposer(n2superpose); + double rmsd = superposer.Superpose(xfrozen, xmobile); + if (rmsd > constraints[i][2]) return 0; + memory->destroy(xfrozen); + memory->destroy(xmobile); } } } @@ -2061,7 +2129,7 @@ void FixBondReact::find_landlocked_atoms(int myrxn) for (int i = 0; i < twomol->natoms; i++) { if (twomol->type[i] != onemol->type[equivalences[i][1][myrxn]-1] && landlocked_atoms[i][myrxn] == 0) { char str[128]; - snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]); + snprintf(str,128,"Bond/react: Atom type affected by reaction %s too close to template edge",rxn_name[myrxn]); error->all(FLERR,str); } } @@ -2080,7 +2148,7 @@ void FixBondReact::find_landlocked_atoms(int myrxn) if (onemol_batom == equivalences[twomol_atomj-1][1][myrxn]) { if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomi-1][m]) { char str[128]; - snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]); + snprintf(str,128,"Bond/react: Bond type affected by reaction %s too close to template edge",rxn_name[myrxn]); error->all(FLERR,str); } } @@ -2092,7 +2160,7 @@ void FixBondReact::find_landlocked_atoms(int myrxn) if (onemol_batom == equivalences[i][1][myrxn]) { if (twomol->bond_type[i][j] != onemol->bond_type[onemol_atomj-1][m]) { char str[128]; - snprintf(str,128,"Bond/react: Atom affected by reaction %s too close to template edge",rxn_name[myrxn]); + snprintf(str,128,"Bond/react: Bond type affected by reaction %s too close to template edge",rxn_name[myrxn]); error->all(FLERR,str); } } @@ -2503,7 +2571,7 @@ void FixBondReact::ghost_glovecast() } /* ---------------------------------------------------------------------- -update charges, types, special lists and all topology +update molecule IDs, charges, types, special lists and all topology ------------------------------------------------------------------------- */ void FixBondReact::update_everything() @@ -2585,11 +2653,11 @@ void FixBondReact::update_everything() twomol = atom->molecules[reacted_mol[rxnID]]; for (int j = 0; j < twomol->natoms; j++) { int jj = equivalences[j][1][rxnID]-1; - if ((landlocked_atoms[j][rxnID] == 1 || custom_edges[jj][rxnID] == 1) && - atom->map(update_mega_glove[jj+1][i]) >= 0 && + if (atom->map(update_mega_glove[jj+1][i]) >= 0 && atom->map(update_mega_glove[jj+1][i]) < nlocal) { - type[atom->map(update_mega_glove[jj+1][i])] = twomol->type[j]; - if (twomol->qflag && atom->q_flag) { + if (landlocked_atoms[j][rxnID] == 1) + type[atom->map(update_mega_glove[jj+1][i])] = twomol->type[j]; + if (twomol->qflag && atom->q_flag && custom_charges[jj][rxnID] == 1) { double *q = atom->q; q[atom->map(update_mega_glove[jj+1][i])] = twomol->q[j]; } @@ -3042,6 +3110,9 @@ void FixBondReact::update_everything() atom->natoms -= ndel; // done deleting atoms + // reset mol ids + if (reset_mol_ids_flag) reset_mol_ids->reset(); + // something to think about: this could done much more concisely if // all atom-level info (bond,angles, etc...) were kinda inherited from a common data struct --JG @@ -3073,7 +3144,7 @@ void FixBondReact::read(int myrxn) // skip 1st line of file eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); + if (eof == nullptr) error->one(FLERR,"Bond/react: Unexpected end of superimpose file"); // read header lines // skip blank lines or lines that start with "#" @@ -3096,7 +3167,6 @@ void FixBondReact::read(int myrxn) error->one(FLERR,"Bond/react: Number of equivalences in map file must " "equal number of atoms in reaction templates"); } - else if (strstr(line,"customIDs")) sscanf(line,"%d",&ncustom); else if (strstr(line,"deleteIDs")) sscanf(line,"%d",&ndelete); else if (strstr(line,"chiralIDs")) sscanf(line,"%d",&nchiral); else if (strstr(line,"constraints")) { @@ -3112,7 +3182,7 @@ void FixBondReact::read(int myrxn) // loop over sections of superimpose file - int equivflag = 0, bondflag = 0, customedgesflag = 0; + int equivflag = 0, bondflag = 0; while (strlen(keyword)) { if (strcmp(keyword,"BondingIDs") == 0) { bondflag = 1; @@ -3129,9 +3199,6 @@ void FixBondReact::read(int myrxn) } else if (strcmp(keyword,"Equivalences") == 0) { equivflag = 1; Equivalences(line, myrxn); - } else if (strcmp(keyword,"Custom Edges") == 0) { - customedgesflag = 1; - CustomEdges(line, myrxn); } else if (strcmp(keyword,"DeleteIDs") == 0) { DeleteAtoms(line, myrxn); } else if (strcmp(keyword,"ChiralIDs") == 0) { @@ -3147,12 +3214,6 @@ void FixBondReact::read(int myrxn) // error check if (bondflag == 0 || equivflag == 0) error->all(FLERR,"Bond/react: Map file missing BondingIDs or Equivalences section\n"); - - if (update_edges_flag[myrxn] == 2 && customedgesflag == 0) - error->all(FLERR,"Bond/react: Map file must have a Custom Edges section when using 'update_edges custom'\n"); - - if (update_edges_flag[myrxn] != 2 && customedgesflag == 1) - error->all(FLERR,"Bond/react: Specify 'update_edges custom' to include Custom Edges section in map file\n"); } void FixBondReact::EdgeIDs(char *line, int myrxn) @@ -3187,28 +3248,6 @@ void FixBondReact::Equivalences(char *line, int myrxn) } } -void FixBondReact::CustomEdges(char *line, int myrxn) -{ - // 0 for 'none', 1 for 'charges' - - int tmp; - int n = MAX(strlen("none"),strlen("charges")) + 1; - char *edgemode = new char[n]; - for (int i = 0; i < ncustom; i++) { - readline(line); - sscanf(line,"%d %s",&tmp,edgemode); - if (tmp > onemol->natoms) - error->one(FLERR,"Bond/react: Invalid template atom ID in map file"); - if (strcmp(edgemode,"none") == 0) - custom_edges[tmp-1][myrxn] = 0; - else if (strcmp(edgemode,"charges") == 0) - custom_edges[tmp-1][myrxn] = 1; - else - error->one(FLERR,"Bond/react: Illegal value in 'Custom Edges' section of map file"); - } - delete [] edgemode; -} - void FixBondReact::DeleteAtoms(char *line, int myrxn) { int tmp; @@ -3221,6 +3260,15 @@ void FixBondReact::DeleteAtoms(char *line, int myrxn) } } +void FixBondReact::CustomCharges(int ifragment, int myrxn) +{ + for (int i = 0; i < onemol->natoms; i++) + if (onemol->fragmentmask[ifragment][i]) + custom_charges[i][myrxn] = 1; + else + custom_charges[i][myrxn] = 0; +} + void FixBondReact::ChiralCenters(char *line, int myrxn) { int tmp; @@ -3302,6 +3350,17 @@ void FixBondReact::Constraints(char *line, int myrxn) constraints[nconstraints][4] = tmp[1]; constraints[nconstraints][5] = tmp[2]; constraints[nconstraints][6] = tmp[3]; + } else if (strcmp(constraint_type,"rmsd") == 0) { + constraints[nconstraints][1] = RMSD; + strcpy(strargs[0],"0"); + sscanf(line,"%*s %lg %s",&tmp[0],strargs[0]); + constraints[nconstraints][2] = tmp[0]; // RMSDmax + constraints[nconstraints][3] = -1; // optional molecule fragment + if (isalpha(strargs[0][0])) { + int ifragment = onemol->findfragment(strargs[0]); + if (ifragment < 0) error->one(FLERR,"Bond/react: Molecule fragment does not exist"); + else constraints[nconstraints][3] = ifragment; + } } else error->one(FLERR,"Bond/react: Illegal constraint type in 'Constraints' section of map file"); nconstraints++; @@ -3333,7 +3392,7 @@ void FixBondReact::readID(char *strarg, int iconstr, int mode, int myID) void FixBondReact::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Bond/react: Cannot open map file %s",file); error->one(FLERR,str); @@ -3344,7 +3403,7 @@ void FixBondReact::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -3361,11 +3420,11 @@ void FixBondReact::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return @@ -3407,7 +3466,7 @@ int FixBondReact::parse(char *line, char **words, int max) int nwords = 0; words[nwords++] = strtok(line," \t\n\r\f"); - while ((ptr = strtok(NULL," \t\n\r\f"))) { + while ((ptr = strtok(nullptr," \t\n\r\f"))) { if (nwords < max) words[nwords] = ptr; nwords++; } diff --git a/src/USER-REACTION/fix_bond_react.h b/src/USER-REACTION/fix_bond_react.h index e8a4253ce7..895a63b7ae 100644 --- a/src/USER-REACTION/fix_bond_react.h +++ b/src/USER-REACTION/fix_bond_react.h @@ -61,9 +61,10 @@ class FixBondReact : public Fix { int *max_rxn,*nlocalskips,*nghostlyskips; tagint lastcheck; int stabilization_flag; + int reset_mol_ids_flag; int custom_exclude_flag; int *stabilize_steps_flag; - int *update_edges_flag; + int *custom_charges_fragid; int nconstraints; int narrhenius; double **constraints; @@ -93,6 +94,7 @@ class FixBondReact : public Fix { class RanMars **random; // random number for 'prob' keyword class RanMars **rrhandom; // random number for Arrhenius constraint class NeighList *list; + class ResetMolIDs *reset_mol_ids; // class for resetting mol IDs int *reacted_mol,*unreacted_mol; int *limit_duration; // indicates how long to relax @@ -111,7 +113,7 @@ class FixBondReact : public Fix { int *ibonding,*jbonding; int *closeneigh; // indicates if bonding atoms of a rxn are 1-2, 1-3, or 1-4 neighbors - int nedge,nequivalent,ncustom,ndelete,nchiral,nconstr; // # edge, equivalent, custom atoms in mapping file + int nedge,nequivalent,ndelete,nchiral,nconstr; // # edge, equivalent atoms in mapping file int attempted_rxn; // there was an attempt! int *local_rxn_count; int *ghostly_rxn_count; @@ -125,7 +127,7 @@ class FixBondReact : public Fix { int ***equivalences; // relation between pre- and post-reacted templates int ***reverse_equiv; // re-ordered equivalences int **landlocked_atoms; // all atoms at least three bonds away from edge atoms - int **custom_edges; // atoms in molecule templates with incorrect valences + int **custom_charges; // atoms whose charge should be updated int **delete_atoms; // atoms in pre-reacted templates to delete int ***chiral_atoms; // pre-react chiral atoms. 1) flag 2) orientation 3-4) ordered atom types @@ -149,8 +151,8 @@ class FixBondReact : public Fix { void read(int); void EdgeIDs(char *, int); void Equivalences(char *, int); - void CustomEdges(char *, int); void DeleteAtoms(char *, int); + void CustomCharges(int, int); void ChiralCenters(char *, int); void Constraints(char *, int); void readID(char *, int, int, int); @@ -240,8 +242,10 @@ E: Bond/react: Invalid template atom ID in map file Atom IDs in molecule templates range from 1 to the number of atoms in the template. E or W: Bond/react: Atom affected by reaction %s too close to template edge + Bond/react: Atom type affected by reaction %s too close to template edge + Bond/react: Bond type affected by reaction %s too close to template edge -This means an atom which changes type or connectivity during the +This means an atom (or bond) that changes type or connectivity during the reaction is too close to an 'edge' atom defined in the map file. This could cause incorrect assignment of bonds, angle, etc. Generally, this means you must include more atoms in your templates, such that there diff --git a/src/USER-REACTION/superpose3d.h b/src/USER-REACTION/superpose3d.h new file mode 100644 index 0000000000..b0b290ddad --- /dev/null +++ b/src/USER-REACTION/superpose3d.h @@ -0,0 +1,465 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. (Some of the code in this file is also + available using a more premissive license. See below for details.) + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing author: Andrew Jewett (Scripps Research) + Availability: https://github.com/jewettaij/superpose3d_cpp (MIT license) +------------------------------------------------------------------------- */ + +/// @file superpose3d.hpp +/// @brief Calculate the optimal rotation, translation and scale needed to +/// optimally fit two different point clouds containing n points. +/// @author Andrew Jewett +/// @license MIT + +#ifndef LMP_SUPERPOSE3D_H +#define LMP_SUPERPOSE3D_H + +#include "math_eigen_impl.h" //functions to calculate eigenvalues and eigenvectors + +// ----------------------------------------------------------- +// ------------------------ INTERFACE ------------------------ +// ----------------------------------------------------------- + +/// @brief Superpose3d is a class with only one important member function +/// Superpose(). It is useful for calculating the optimal +/// superposition (rotations, translations, and scale transformations) +/// between two point clouds of the same size. +template +class Superpose3D { +private: + size_t N; //number of points in the point clouds + Scalar *aWeights; //weights applied to points when computing RMSD + MathEigen::Jacobi eigen_calc; // calc eigenvectors + Scalar **aaXf_shifted; //preallocated space for fixed point cloud (Nx3 array) + Scalar **aaXm_shifted; //preallocated space for mobile point cloud (Nx3 array) + +public: + // The following data members store the rotation, translation and scale + // after optimal superposition + Scalar **R; //!< store optimal rotation here (this is a 3x3 array). + Scalar T[3]; //!< store optimal translation here + Scalar c; //!< store optimal scale (typically 1 unless requested by the user) + Scalar q[4]; //!< quaternion corresponding to the rotation stored in R. + // The first entry of q is cos(θ/2). The remaining 3 entries + // of q are the axis of rotation (with length sin(θ/2)). + // (Note: This is not the same as "p" from Diamond's 1988 paper.) + + Superpose3D(size_t N = 0); //!< N=number of points in both point clouds + + Superpose3D(size_t N, //!< N = number of points in both point clouds + ConstArray aWeights); //!< weight per point for computing RMSD + + ~Superpose3D(); + + /// @brief specify he number of points in both point clouds + void SetNumPoints(size_t N); + /// @brief return the number of points in both point clouds + size_t GetNumPoints() { return N; } + /// @brief specify the weight applied to each point when computing RMSD + void SetWeights(ConstArray aWeights); + + /// @brief Use rigid-body transformations (rotations, translations, and + /// optionally scale transformations) to superimpose two point clouds. + /// + /// @details + /// This function takes two lists of xyz coordinates (of the same length) and + /// attempts to superimpose them using rotations, translations, and + /// (optionally) scale transformations. These transformations are applied to + /// to the coordinates in the "aaXm_orig" array (the "mobile" point cloud) + /// in order to minimize the root-mean-squared-distance (RMSD) between the + /// corresponding points in each cloud, where RMSD is defined as: + /// + /// @verbatim + /// sqrt((Σ_n w[n]*Σ_i |X[n][i] - (Σ_j c*R[i][j]*x[n][j]+T[i])|^2)/(Σ_n w[n])) + /// @endverbatim + /// + /// In this formula, the "X_i" and "x_i" are coordinates of the ith fixed and + /// mobile point clouds (represented by "aaXf" and "aaXm" in the code below) + /// and "w_i" are optional weights (represented by "aWeights" in the code). + /// This function implements a more general variant of the method from: + /// @verbatim + /// R. Diamond, (1988) "A Note on the Rotational Superposition Problem", + /// Acta Cryst. A44, pp. 211-216 + /// @endverbatim + /// + /// @note: + /// This code has been augmented with a new feature. The version in the + /// original paper only considers rotation and translation and does not allow + /// coordinates of either cloud to be rescaled (multiplied by a scalar). + /// To enable the ability to rescale the coordinates, set allow_rescale=true. + /// (By default, this feature is disabled.) + /// + /// @returns + /// The RMSD between the 2 pointclouds after optimal rotation, translation + /// (and scaling if requested) was applied to the "mobile" point cloud. + /// After this function is called, the optimal rotation, translation, + /// and scale (if requested) will be stored in the "R", "T", and "c" + /// public data members. + Scalar Superpose(ConstArrayOfCoords aaXf, //!< coords for the "frozen" object + ConstArrayOfCoords aaXm, //!< coords for the "mobile" object + bool allow_rescale=false //!< rescale mobile object? (c≠1?) + ); + + // C++ boilerplate: copy and move constructor, swap, and assignment operator + Superpose3D(const Superpose3D& source); + Superpose3D(Superpose3D&& other); + void swap(Superpose3D &other); + Superpose3D& operator = (Superpose3D source); + +private: + + // memory management: + void Alloc(size_t N); + void Init(); + void Dealloc(); + +}; // class Superpose3D + + + + + +// -------------- IMPLEMENTATION -------------- + + +template +static inline Scalar SQR(Scalar x) {return x*x;} + +template +Scalar Superpose3D:: +Superpose(ConstArrayOfCoords aaXf, // coords for the "frozen" object + ConstArrayOfCoords aaXm, // coords for the "mobile" object + bool allow_rescale) // rescale mobile object? (c!=1?) +{ + // Find the center of mass of each object: + Scalar aCenter_f[3] = {0.0, 0.0, 0.0}; + Scalar aCenter_m[3] = {0.0, 0.0, 0.0}; + Scalar sum_weights = 0.0; + for (size_t n=0; n < N; n++) { + Scalar weight = aWeights[n]; + for (int d=0; d < 3; d++) { + aCenter_f[d] += aaXf[n][d]*weight; + aCenter_m[d] += aaXm[n][d]*weight; + } + sum_weights += weight; + } + + //assert(sum_weights != 0.0); + + for (int d=0; d < 3; d++) { + aCenter_f[d] /= sum_weights; + aCenter_m[d] /= sum_weights; + } + + //Subtract the centers-of-mass from the original coordinates for each object + for (size_t n=0; n < N; n++) { + for (int d=0; d < 3; d++) { + // shift the coordinates so that the new center of mass is at the origin + aaXf_shifted[n][d] = aaXf[n][d] - aCenter_f[d]; + aaXm_shifted[n][d] = aaXm[n][d] - aCenter_m[d]; + } + } + + // Calculate the "M" array from the Diamond paper (equation 16) + Scalar M[3][3]; + for (int i=0; i < 3; i++) + for (int j=0; j < 3; j++) + M[i][j] = 0.0; + + for (size_t n=0; n < N; n++) { + Scalar weight = aWeights[n]; + for (int i=0; i < 3; i++) { + for (int j=0; j < 3; j++) { + M[i][j] += weight * aaXm_shifted[n][i] * aaXf_shifted[n][j]; + } + } + } + + // Calculate Q (equation 17) + Scalar traceM = 0.0; + for (int i=0; i < 3; i++) + traceM += M[i][i]; + Scalar Q[3][3]; + for (int i=0; i < 3; i++) { + for (int j=0; j < 3; j++) { + Q[i][j] = M[i][j] + M[j][i]; + if (i==j) + Q[i][j] -= 2.0 * traceM; + } + } + + // Calculate V (equation 18) + Scalar V[3]; + V[0] = M[1][2] - M[2][1]; + V[1] = M[2][0] - M[0][2]; + V[2] = M[0][1] - M[1][0]; + + // Calculate "P" (equation 22) + // First we must allocate space for the P matrix. It's not safe to declare: + // Scalar P[4][4]; + // ...because most matrix solvers expect arrays in pointer-to-pointer format. + // (a different format). Below I create a fixed size matrix P in this format. + Scalar _P[4*4]; // Contiguous 1D array for storing contents of the 2D P array + Scalar *P[4]; // This version of P has has ** (pointer-to-pointer) format. + for (int i=0; i < 4; i++) // We must make sure that + P[i] = &(_P[4*i]); // P[i] points to the appropriate location in memory + + // Now fill the P array + for (int i=0; i < 3; i++) + for (int j=0; j < 3; j++) + P[i][j] = Q[i][j]; + P[0][3] = V[0]; + P[3][0] = V[0]; + P[1][3] = V[1]; + P[3][1] = V[1]; + P[2][3] = V[2]; + P[3][2] = V[2]; + P[3][3] = 0.0; + + // The vector "p" contains the optimal rotation (backwards quaternion format) + Scalar p[4] = {0.0, 0.0, 0.0, 1.0}; // default value + Scalar pPp = 0.0; // = p^T * P * p (zero by default) + Scalar rmsd = 0.0; // default value + + bool singular = N<2; // (it doesn't make sense to rotate a single point) + + if (! singular) { + // Calculate the principal eigenvalue and eigenvector of matrix P. + // Store the principal eigenvector in "p" + // The vector "p" will contain the optimal rotation (in quaternion format) + + Scalar Evl[4]; // Store the eigenvalues of P here. + Scalar *Evc[4]; // Store the eigevectors here. This version has ** format. + Scalar _Evc[4*4]; // Contiguous 1D array for storing contents of "Evc" array + for (int i=0; i < 4; i++) // We must make sure that + Evc[i] = &(_Evc[4*i]); // Evc[i] points to the correct location in memory + + eigen_calc.Diagonalize(P, Evl, Evc); + + // Note: The eigenvalues are sorted in decreasing order by default. + pPp = Evl[0]; // = the maximum eigenvalue of P + for (int i=0; i < 4; i++) + p[i] = Evc[0][i]; //copy eigenvector corresponding to this eigenvalue to p + } //if (! singular) + + // Now normalize p + Scalar pnorm = 0.0; + for (int i=0; i < 4; i++) + pnorm += p[i]*p[i]; + pnorm = sqrt(pnorm); + for (int i=0; i < 4; i++) + p[i] /= pnorm; + + // Finally, calculate the rotation matrix corresponding to "p" + // (convert a quaternion into a 3x3 rotation matrix) + + R[0][0] = (p[0]*p[0])-(p[1]*p[1])-(p[2]*p[2])+(p[3]*p[3]); + R[1][1] = -(p[0]*p[0])+(p[1]*p[1])-(p[2]*p[2])+(p[3]*p[3]); + R[2][2] = -(p[0]*p[0])-(p[1]*p[1])+(p[2]*p[2])+(p[3]*p[3]); + R[0][1] = 2*(p[0]*p[1] - p[2]*p[3]); + R[1][0] = 2*(p[0]*p[1] + p[2]*p[3]); + R[1][2] = 2*(p[1]*p[2] - p[0]*p[3]); + R[2][1] = 2*(p[1]*p[2] + p[0]*p[3]); + R[0][2] = 2*(p[0]*p[2] + p[1]*p[3]); + R[2][0] = 2*(p[0]*p[2] - p[1]*p[3]); + + q[0] = p[3]; // Note: The "p" variable is not a quaternion in the + q[1] = p[0]; // conventional sense because its elements + q[2] = p[1]; // are in the wrong order. I correct for that here. + q[3] = p[2]; // "q" is the quaternion correspond to rotation R. + + // Optional: Decide the scale factor, c + c = 1.0; // by default, don't rescale the coordinates + + if ((allow_rescale) && (! singular)) { + Scalar Waxaixai = 0.0; + Scalar WaxaiXai = 0.0; + for (size_t a=0; a < N; a++) { + Scalar weight = aWeights[a]; + for (int i=0; i < 3; i++) { + Waxaixai += weight * aaXm_shifted[a][i] * aaXm_shifted[a][i]; + WaxaiXai += weight * aaXm_shifted[a][i] * aaXf_shifted[a][i]; + } + } + c = (WaxaiXai + pPp) / Waxaixai; + + } // if (allow_rescale) + + // Finally compute the RMSD between the two coordinate sets: + // First compute E0 from equation 24 of the paper + Scalar E0 = 0.0; + for (size_t n=0; n < N; n++) { + Scalar weight = aWeights[n]; + for (int d=0; d < 3; d++) + // (remember to include the scale factor "c" that we inserted) + E0 += weight * (SQR(aaXf_shifted[n][d] - c*aaXm_shifted[n][d])); + } + Scalar sum_sqr_dist = E0 - c*2.0*pPp; + if (sum_sqr_dist < 0.0) //(edge case due to rounding error) + sum_sqr_dist = 0.0; + + if (! singular) + rmsd = sqrt(sum_sqr_dist/sum_weights); + + // Lastly, calculate the translational offset. + // If c!=1, this is slightly more complicated than it seems. Recall that: + //RMSD=sqrt((Sum_i w_i * |X_i - Sum_j(c*R_ij*x_j + T_i))|^2) / (Sum_j w_j)) + // =sqrt((Sum_i w_i * |X_i - x_i')|^2) / (Sum_j w_j)) + // where + // x_i' = Sum_j(c*R_ij*x_j) + T_i + // = Xcm_i + c*R_ij*(x_j - xcm_j) + // and Xcm and xcm = center_of_mass for the frozen and mobile point clouds + // + // Hence: + // T_i = Xcm_i - Sum_j c*R_ij*xcm_j + // In the code, Xcm_i is represented by "aCenter_f[i]" + // and xcm_j is represented by "aCenter_m[j]" + + for (int i=0; i < 3; i++) { + T[i] = aCenter_f[i]; + for (int j=0; j < 3; j++) { + T[i] -= c*R[i][j]*aCenter_m[j]; + } + } + + return rmsd; + +} //Superpose3D::Superpose(aaXf, aaXm, allow_rescale) + + +template +void Superpose3D:: +SetNumPoints(size_t N) { + Dealloc(); + Alloc(N); +} + +template +void Superpose3D:: +SetWeights(ConstArray aWeights) { + for (size_t i = 0; i < N; i++) + this->aWeights[i] = aWeights[i]; +} + +template +Superpose3D::Superpose3D(size_t N) + :eigen_calc(4) +{ + Init(); + Alloc(N); +} + +template +Superpose3D:: +Superpose3D(size_t N, ConstArray aWeights) + :eigen_calc(4) +{ + Init(); + Alloc(N); + SetWeights(aWeights); +} + +template +Superpose3D::~Superpose3D() { + Dealloc(); +} + +template +void Superpose3D:: +Init() { + R = nullptr; + aWeights = nullptr; + aaXf_shifted = nullptr; + aaXm_shifted = nullptr; +} + +// memory management: + +template +void Superpose3D:: +Alloc(size_t N) { + this->N = N; + aWeights = new Scalar [N]; + for (size_t i = 0; i < N; i++) + aWeights[i] = 1.0 / N; + MathEigen::Alloc2D(3, 3, &R); + MathEigen::Alloc2D(N, 3, &aaXf_shifted); + MathEigen::Alloc2D(N, 3, &aaXm_shifted); +} + +template +void Superpose3D:: +Dealloc() { + if (R) + MathEigen::Dealloc2D(&R); + if (aWeights) + delete [] aWeights; + if (aaXf_shifted) + MathEigen::Dealloc2D(&aaXf_shifted); + if (aaXm_shifted) + MathEigen::Dealloc2D(&aaXm_shifted); +} + +// memory management: copy and move constructor, swap, and assignment operator: + +template +Superpose3D:: +Superpose3D(const Superpose3D& source) + :eigen_calc(4) +{ + Init(); + Alloc(source.N); + + //assert(N == source.N); + + for (int i = 0; i < N; i++) { + std::copy(source.aaXf_shifted[i], + source.aaXf_shifted[i] + 3, + aaXf_shifted[i]); + std::copy(source.aaXm_shifted[i], + source.aaXm_shifted[i] + 3, + aaXm_shifted[i]); + } +} + +template +void Superpose3D:: +swap(Superpose3D &other) { + std::swap(N, other.N); + std::swap(R, other.R); + std::swap(aaXf_shifted, other.aaXf_shifted); + std::swap(aaXm_shifted, other.aaXm_shifted); +} + +// Move constructor (C++11) +template +Superpose3D:: +Superpose3D(Superpose3D&& other) { + Init(); + swap(*this, other); +} + +// Using the "copy-swap" idiom for the assignment operator +template +Superpose3D& +Superpose3D:: +operator = (Superpose3D source) { + this->swap(source); + return *this; +} + + +#endif //#ifndef LMP_SUPERPOSE3D_H diff --git a/src/USER-REAXC/compute_spec_atom.cpp b/src/USER-REAXC/compute_spec_atom.cpp index bc5b26b699..1c4856d728 100644 --- a/src/USER-REAXC/compute_spec_atom.cpp +++ b/src/USER-REAXC/compute_spec_atom.cpp @@ -117,8 +117,8 @@ ComputeSpecAtom::ComputeSpecAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; } diff --git a/src/USER-REAXC/fix_qeq_reax.cpp b/src/USER-REAXC/fix_qeq_reax.cpp index b9cff75d65..33a9633c0f 100644 --- a/src/USER-REAXC/fix_qeq_reax.cpp +++ b/src/USER-REAXC/fix_qeq_reax.cpp @@ -19,7 +19,7 @@ ------------------------------------------------------------------------- */ #include "fix_qeq_reax.h" -#include + #include #include #include "pair_reaxc.h" @@ -60,18 +60,16 @@ static const char cite_fix_qeq_reax[] = /* ---------------------------------------------------------------------- */ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), pertype_option(NULL) + Fix(lmp, narg, arg), pertype_option(nullptr) { - if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reax); + if (narg<8 || narg>11) error->all(FLERR,"Illegal fix qeq/reax command"); - if (narg<8 || narg>9) error->all(FLERR,"Illegal fix qeq/reax command"); - - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix qeq/reax command"); - swa = force->numeric(FLERR,arg[4]); - swb = force->numeric(FLERR,arg[5]); - tolerance = force->numeric(FLERR,arg[6]); + swa = utils::numeric(FLERR,arg[4],false,lmp); + swb = utils::numeric(FLERR,arg[5],false,lmp); + tolerance = utils::numeric(FLERR,arg[6],false,lmp); int len = strlen(arg[7]) + 1; pertype_option = new char[len]; strcpy(pertype_option,arg[7]); @@ -79,37 +77,46 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : // dual CG support only available for USER-OMP variant // check for compatibility is in Fix::post_constructor() dual_enabled = 0; - if (narg == 9) { - if (strcmp(arg[8],"dual") == 0) dual_enabled = 1; - else error->all(FLERR,"Illegal fix qeq/reax command"); - } - shld = NULL; + imax = 200; - n = n_cap = 0; - N = nmax = 0; + int iarg = 8; + while (iarg < narg) { + if (strcmp(arg[iarg],"dual") == 0) dual_enabled = 1; + else if (strcmp(arg[iarg],"maxiter") == 0) { + if (iarg+1 > narg-1) + error->all(FLERR,"Illegal fix qeq/reax command"); + imax = utils::numeric(FLERR,arg[iarg+1],false,lmp); + iarg++; + } else error->all(FLERR,"Illegal fix qeq/reax command"); + iarg++; + } + shld = nullptr; + + nn = n_cap = 0; + NN = nmax = 0; m_fill = m_cap = 0; pack_flag = 0; - s = NULL; - t = NULL; + s = nullptr; + t = nullptr; nprev = 4; - Hdia_inv = NULL; - b_s = NULL; - b_t = NULL; - b_prc = NULL; - b_prm = NULL; + Hdia_inv = nullptr; + b_s = nullptr; + b_t = nullptr; + b_prc = nullptr; + b_prm = nullptr; // CG - p = NULL; - q = NULL; - r = NULL; - d = NULL; + p = nullptr; + q = nullptr; + r = nullptr; + d = nullptr; // H matrix - H.firstnbr = NULL; - H.numnbrs = NULL; - H.jlist = NULL; - H.val = NULL; + H.firstnbr = nullptr; + H.numnbrs = nullptr; + H.jlist = nullptr; + H.val = nullptr; // dual CG support // Update comm sizes for this fix @@ -119,15 +126,11 @@ FixQEqReax::FixQEqReax(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - reaxc = NULL; + reaxc = nullptr; reaxc = (PairReaxC *) force->pair_match("^reax/c",0); - s_hist = t_hist = NULL; - grow_arrays(atom->nmax); - atom->add_callback(0); - for (int i = 0; i < atom->nmax; i++) - for (int j = 0; j < nprev; ++j) - s_hist[i][j] = t_hist[i][j] = 0; + s_hist = t_hist = nullptr; + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -140,7 +143,7 @@ FixQEqReax::~FixQEqReax() // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(s_hist); memory->destroy(t_hist); @@ -161,6 +164,13 @@ FixQEqReax::~FixQEqReax() void FixQEqReax::post_constructor() { + if (lmp->citeme) lmp->citeme->add(cite_fix_qeq_reax); + + grow_arrays(atom->nmax); + for (int i = 0; i < atom->nmax; i++) + for (int j = 0; j < nprev; ++j) + s_hist[i][j] = t_hist[i][j] = 0; + pertype_parameters(pertype_option); if (dual_enabled) error->all(FLERR,"Dual keyword only supported with fix qeq/reax/omp"); @@ -184,13 +194,13 @@ void FixQEqReax::pertype_parameters(char *arg) if (strcmp(arg,"reax/c") == 0) { reaxflag = 1; Pair *pair = force->pair_match("reax/c",0); - if (pair == NULL) error->all(FLERR,"No pair reax/c for fix qeq/reax"); + if (pair == nullptr) error->all(FLERR,"No pair reax/c for fix qeq/reax"); int tmp; chi = (double *) pair->extract("chi",tmp); eta = (double *) pair->extract("eta",tmp); gamma = (double *) pair->extract("gamma",tmp); - if (chi == NULL || eta == NULL || gamma == NULL) + if (chi == nullptr || eta == nullptr || gamma == nullptr) error->all(FLERR, "Fix qeq/reax could not extract params from pair reax/c"); return; @@ -208,7 +218,7 @@ void FixQEqReax::pertype_parameters(char *arg) memory->create(gamma,ntypes+1,"qeq/reax:gamma"); if (comm->me == 0) { - if ((pf = fopen(arg,"r")) == NULL) + if ((pf = fopen(arg,"r")) == nullptr) error->one(FLERR,"Fix qeq/reax parameter file could not be found"); for (i = 1; i <= ntypes && !feof(pf); i++) { @@ -287,8 +297,7 @@ void FixQEqReax::reallocate_storage() void FixQEqReax::allocate_matrix() { - int i,ii,inum,m; - int *ilist, *numneigh; + int i,ii,n,m; int mincap; double safezone; @@ -306,18 +315,8 @@ void FixQEqReax::allocate_matrix() // determine the total space for the H matrix - if (reaxc) { - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - } else { - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - } - m = 0; - for (ii = 0; ii < inum; ii++) { + for (ii = 0; ii < nn; ii++) { i = ilist[ii]; m += numneigh[i]; } @@ -390,7 +389,7 @@ void FixQEqReax::init_shielding() int ntypes; ntypes = atom->ntypes; - if (shld == NULL) + if (shld == nullptr) memory->create(shld,ntypes+1,ntypes+1,"qeq:shielding"); for (i = 1; i <= ntypes; ++i) @@ -432,6 +431,20 @@ void FixQEqReax::init_taper() void FixQEqReax::setup_pre_force(int vflag) { + if (reaxc) { + nn = reaxc->list->inum; + NN = reaxc->list->inum + reaxc->list->gnum; + ilist = reaxc->list->ilist; + numneigh = reaxc->list->numneigh; + firstneigh = reaxc->list->firstneigh; + } else { + nn = list->inum; + NN = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + } + deallocate_storage(); allocate_storage(); @@ -495,8 +508,21 @@ void FixQEqReax::pre_force(int /*vflag*/) if (update->ntimestep % nevery) return; if (comm->me == 0) t_start = MPI_Wtime(); - n = atom->nlocal; - N = atom->nlocal + atom->nghost; + int n = atom->nlocal; + + if (reaxc) { + nn = reaxc->list->inum; + NN = reaxc->list->inum + reaxc->list->gnum; + ilist = reaxc->list->ilist; + numneigh = reaxc->list->numneigh; + firstneigh = reaxc->list->firstneigh; + } else { + nn = list->inum; + NN = list->inum + list->gnum; + ilist = list->ilist; + numneigh = list->numneigh; + firstneigh = list->firstneigh; + } // grow arrays if necessary // need to be atom->nmax in length @@ -540,16 +566,7 @@ void FixQEqReax::init_matvec() /* fill-in H matrix */ compute_H(); - int nn, ii, i; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } + int ii, i; for (ii = 0; ii < nn; ++ii) { i = ilist[ii]; @@ -578,7 +595,7 @@ void FixQEqReax::init_matvec() void FixQEqReax::compute_H() { - int inum, jnum, *ilist, *jlist, *numneigh, **firstneigh; + int jnum; int i, j, ii, jj, flag; double dx, dy, dz, r_sqr; const double SMALL = 0.0001; @@ -588,22 +605,10 @@ void FixQEqReax::compute_H() double **x = atom->x; int *mask = atom->mask; - if (reaxc) { - inum = reaxc->list->inum; - ilist = reaxc->list->ilist; - numneigh = reaxc->list->numneigh; - firstneigh = reaxc->list->firstneigh; - } else { - inum = list->inum; - ilist = list->ilist; - numneigh = list->numneigh; - firstneigh = list->firstneigh; - } - // fill in the H matrix m_fill = 0; r_sqr = 0; - for (ii = 0; ii < inum; ii++) { + for (ii = 0; ii < nn; ii++) { i = ilist[ii]; if (mask[i] & groupbit) { jlist = firstneigh[i]; @@ -621,7 +626,7 @@ void FixQEqReax::compute_H() flag = 0; if (r_sqr <= SQR(swb)) { - if (j < n) flag = 1; + if (j < atom->nlocal) flag = 1; else if (tag[i] < tag[j]) flag = 1; else if (tag[i] == tag[j]) { if (dz > SMALL) flag = 1; @@ -676,21 +681,11 @@ double FixQEqReax::calculate_H( double r, double gamma) int FixQEqReax::CG( double *b, double *x) { - int i, j, imax; + int i, j; double tmp, alpha, beta, b_norm; double sig_old, sig_new; - int nn, jj; - int *ilist; - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } - - imax = 200; + int jj; pack_flag = 1; sparse_matvec( &H, x, q); @@ -748,18 +743,7 @@ int FixQEqReax::CG( double *b, double *x) void FixQEqReax::sparse_matvec( sparse_matrix *A, double *x, double *b) { int i, j, itr_j; - int nn, NN, ii; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - NN = reaxc->list->inum + reaxc->list->gnum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - NN = list->inum + list->gnum; - ilist = list->ilist; - } + int ii; for (ii = 0; ii < nn; ++ii) { i = ilist[ii]; @@ -794,16 +778,7 @@ void FixQEqReax::calculate_Q() double u, s_sum, t_sum; double *q = atom->q; - int nn, ii; - int *ilist; - - if (reaxc) { - nn = reaxc->list->inum; - ilist = reaxc->list->ilist; - } else { - nn = list->inum; - ilist = list->ilist; - } + int ii; s_sum = parallel_vector_acc( s, nn); t_sum = parallel_vector_acc( t, nn); @@ -988,12 +963,6 @@ double FixQEqReax::parallel_norm( double *v, int n) double my_sum, norm_sqr; int ii; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; my_sum = 0.0; norm_sqr = 0.0; @@ -1016,12 +985,6 @@ double FixQEqReax::parallel_dot( double *v1, double *v2, int n) double my_dot, res; int ii; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; my_dot = 0.0; res = 0.0; @@ -1044,12 +1007,6 @@ double FixQEqReax::parallel_vector_acc( double *v, int n) double my_acc, res; int ii; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; my_acc = 0.0; res = 0.0; @@ -1070,12 +1027,6 @@ void FixQEqReax::vector_sum( double* dest, double c, double* v, double d, double* y, int k) { int kk; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; for (--k; k>=0; --k) { kk = ilist[k]; @@ -1089,12 +1040,6 @@ void FixQEqReax::vector_sum( double* dest, double c, double* v, void FixQEqReax::vector_add( double* dest, double c, double* v, int k) { int kk; - int *ilist; - - if (reaxc) - ilist = reaxc->list->ilist; - else - ilist = list->ilist; for (--k; k>=0; --k) { kk = ilist[k]; @@ -1102,3 +1047,4 @@ void FixQEqReax::vector_add( double* dest, double c, double* v, int k) dest[kk] += c * v[kk]; } } + diff --git a/src/USER-REAXC/fix_qeq_reax.h b/src/USER-REAXC/fix_qeq_reax.h index 96a174b908..5658167aca 100644 --- a/src/USER-REAXC/fix_qeq_reax.h +++ b/src/USER-REAXC/fix_qeq_reax.h @@ -57,12 +57,13 @@ class FixQEqReax : public Fix { protected: int nevery,reaxflag; - int n, N, m_fill; + int nn, NN, m_fill; int n_cap, nmax, m_cap; int pack_flag; int nlevels_respa; class NeighList *list; class PairReaxC *reaxc; + int *ilist, *jlist, *numneigh, **firstneigh; double swa, swb; // lower/upper Taper cutoff radius double Tap[8]; // Taper function @@ -94,6 +95,7 @@ class FixQEqReax : public Fix { //CG storage double *p, *q, *r, *d; + int imax; //GMRES storage //double *g,*y; diff --git a/src/USER-REAXC/fix_reaxc.cpp b/src/USER-REAXC/fix_reaxc.cpp index c98adf5b45..2200d66daa 100644 --- a/src/USER-REAXC/fix_reaxc.cpp +++ b/src/USER-REAXC/fix_reaxc.cpp @@ -41,10 +41,10 @@ FixReaxC::FixReaxC(LAMMPS *lmp,int narg, char **arg) : // register with atom class oldnmax = 0; - num_bonds = NULL; - num_hbonds = NULL; + num_bonds = nullptr; + num_hbonds = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize arrays to MIN so atom migration is OK the 1st time // it is done in grow_arrays() now @@ -60,7 +60,7 @@ FixReaxC::~FixReaxC() { // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/USER-REAXC/fix_reaxc_bonds.cpp b/src/USER-REAXC/fix_reaxc_bonds.cpp index f7ad7ed6d4..a16446e769 100644 --- a/src/USER-REAXC/fix_reaxc_bonds.cpp +++ b/src/USER-REAXC/fix_reaxc_bonds.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_reaxc_bonds.h" -#include + #include #include "atom.h" #include "update.h" @@ -44,7 +44,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : ntypes = atom->ntypes; nmax = atom->nmax; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0 ) error->all(FLERR,"Illegal fix reax/c/bonds command"); @@ -65,7 +65,7 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : #endif } else fp = fopen(arg[4],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix reax/c/bonds file %s",arg[4]); error->one(FLERR,str); @@ -75,9 +75,9 @@ FixReaxCBonds::FixReaxCBonds(LAMMPS *lmp, int narg, char **arg) : if (atom->tag_consecutive() == 0) error->all(FLERR,"Atom IDs must be consecutive for fix reax/c bonds"); - abo = NULL; - neighid = NULL; - numneigh = NULL; + abo = nullptr; + neighid = nullptr; + numneigh = nullptr; allocate(); } @@ -114,7 +114,7 @@ void FixReaxCBonds::setup(int /*vflag*/) void FixReaxCBonds::init() { reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/bonds without " + if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/bonds without " "pair_style reax/c, reax/c/kk, or reax/c/omp"); } @@ -235,7 +235,7 @@ void FixReaxCBonds::PassBuffer(double *buf, int &nbuf_local) } j += (5+numbonds); - if (atom->molecule == NULL ) buf[j] = 0.0; + if (atom->molecule == nullptr ) buf[j] = 0.0; else buf[j] = atom->molecule[i]; j ++; diff --git a/src/USER-REAXC/fix_reaxc_species.cpp b/src/USER-REAXC/fix_reaxc_species.cpp index 74692f1c9b..9527485705 100644 --- a/src/USER-REAXC/fix_reaxc_species.cpp +++ b/src/USER-REAXC/fix_reaxc_species.cpp @@ -17,8 +17,8 @@ ------------------------------------------------------------------------- */ #include "fix_reaxc_species.h" -#include -#include + + #include #include "fix_ave_atom.h" #include "atom.h" @@ -97,7 +97,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : error->warning(FLERR,"Resetting reneighboring criteria for fix reax/c/species"); } - tmparg = NULL; + tmparg = nullptr; memory->create(tmparg,4,4,"reax/c/species:tmparg"); strcpy(tmparg[0],arg[3]); strcpy(tmparg[1],arg[4]); @@ -119,28 +119,28 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : #endif } else fp = fopen(arg[6],"w"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open fix reax/c/species file %s",arg[6]); error->one(FLERR,str); } } - x0 = NULL; - clusterID = NULL; + x0 = nullptr; + clusterID = nullptr; int ntmp = 1; memory->create(x0,ntmp,"reax/c/species:x0"); memory->create(clusterID,ntmp,"reax/c/species:clusterID"); vector_atom = clusterID; - BOCut = NULL; - Name = NULL; - MolName = NULL; - MolType = NULL; - NMol = NULL; - nd = NULL; - molmap = NULL; + BOCut = nullptr; + Name = nullptr; + MolName = nullptr; + MolType = nullptr; + NMol = nullptr; + nd = nullptr; + molmap = nullptr; nmax = 0; setupflag = 0; @@ -156,8 +156,8 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : BOCut[i][j] = bg_cut; // optional args - eletype = NULL; - ele = filepos = NULL; + eletype = nullptr; + ele = filepos = nullptr; eleflag = posflag = padflag = 0; singlepos_opened = multipos_opened = 0; @@ -213,7 +213,7 @@ FixReaxCSpecies::FixReaxCSpecies(LAMMPS *lmp, int narg, char **arg) : } else { if (me == 0) { pos = fopen(filepos, "w"); - if (pos == NULL) error->one(FLERR,"Cannot open fix reax/c/species position file"); + if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); } singlepos_opened = 1; multipos = 0; @@ -278,7 +278,7 @@ int FixReaxCSpecies::setmask() void FixReaxCSpecies::setup(int /*vflag*/) { ntotal = static_cast (atom->natoms); - if (Name == NULL) + if (Name == nullptr) memory->create(Name,ntypes,"reax/c/species:Name"); post_integrate(); @@ -292,7 +292,7 @@ void FixReaxCSpecies::init() error->all(FLERR,"Cannot use fix reax/c/species unless atoms have IDs"); reaxc = (PairReaxC *) force->pair_match("reax/c",0); - if (reaxc == NULL) error->all(FLERR,"Cannot use fix reax/c/species without " + if (reaxc == nullptr) error->all(FLERR,"Cannot use fix reax/c/species without " "pair_style reax/c, reax/c/kk, or reax/c/omp"); reaxc->fixspecies_flag = 1; @@ -579,7 +579,7 @@ void FixReaxCSpecies::FindMolecule () void FixReaxCSpecies::SortMolecule(int &Nmole) { memory->destroy(molmap); - molmap = NULL; + molmap = nullptr; int n, idlo, idhi; int *mask =atom->mask; @@ -641,7 +641,7 @@ void FixReaxCSpecies::SortMolecule(int &Nmole) } memory->destroy(molmap); - molmap = NULL; + molmap = nullptr; } @@ -656,11 +656,11 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) int *Nameall, *NMolall; memory->destroy(MolName); - MolName = NULL; + MolName = nullptr; memory->create(MolName,Nmole*(ntypes+1),"reax/c/species:MolName"); memory->destroy(NMol); - NMol = NULL; + NMol = nullptr; memory->create(NMol,Nmole,"reax/c/species:NMol"); for (m = 0; m < Nmole; m ++) NMol[m] = 1; @@ -705,11 +705,11 @@ void FixReaxCSpecies::FindSpecies(int Nmole, int &Nspec) memory->destroy(Nameall); memory->destroy(nd); - nd = NULL; + nd = nullptr; memory->create(nd,Nspec,"reax/c/species:nd"); memory->destroy(MolType); - MolType = NULL; + MolType = nullptr; memory->create(MolType,Nspec*(ntypes+2),"reax/c/species:MolType"); } @@ -793,8 +793,8 @@ void FixReaxCSpecies::OpenPos() if (me == 0) { pos = fopen(filecurrent, "w"); - if (pos == NULL) error->one(FLERR,"Cannot open fix reax/c/species position file"); - } else pos = NULL; + if (pos == nullptr) error->one(FLERR,"Cannot open fix reax/c/species position file"); + } else pos = nullptr; multipos_opened = 1; free(filecurrent); @@ -831,7 +831,7 @@ void FixReaxCSpecies::WritePos(int Nmole, int Nspec) fprintf(pos,"ID\tAtom_Count\tType\tAve_q\t\tCoM_x\t\tCoM_y\t\tCoM_z\n"); } - Nameall = NULL; + Nameall = nullptr; memory->create(Nameall,ntypes,"reax/c/species:Nameall"); for (m = 1; m <= Nmole; m ++) { diff --git a/src/USER-REAXC/pair_reaxc.cpp b/src/USER-REAXC/pair_reaxc.cpp index c89ac5ba77..fd97a26359 100644 --- a/src/USER-REAXC/pair_reaxc.cpp +++ b/src/USER-REAXC/pair_reaxc.cpp @@ -21,9 +21,9 @@ ------------------------------------------------------------------------- */ #include "pair_reaxc.h" -#include + #include -#include + #include #include #include "atom.h" @@ -39,7 +39,7 @@ #include "citeme.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "reaxc_defs.h" #include "reaxc_types.h" @@ -117,16 +117,16 @@ PairReaxC::PairReaxC(LAMMPS *lmp) : Pair(lmp) system->bndry_cuts.ghost_hbond = 0; system->bndry_cuts.ghost_bond = 0; system->bndry_cuts.ghost_cutoff = 0; - system->my_atoms = NULL; + system->my_atoms = nullptr; system->pair_ptr = this; system->error_ptr = error; control->error_ptr = error; system->omp_active = 0; - fix_reax = NULL; - tmpid = NULL; - tmpbo = NULL; + fix_reax = nullptr; + tmpid = nullptr; + tmpbo = nullptr; nextra = 14; pvector = new double[nextra]; @@ -274,20 +274,20 @@ void PairReaxC::settings(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"safezone") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); - system->safezone = force->numeric(FLERR,arg[iarg+1]); + system->safezone = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (system->safezone < 0.0) error->all(FLERR,"Illegal pair_style reax/c safezone command"); system->saferzone = system->safezone*1.2 + 0.2; iarg += 2; } else if (strcmp(arg[iarg],"mincap") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); - system->mincap = force->inumeric(FLERR,arg[iarg+1]); + system->mincap = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (system->mincap < 0) error->all(FLERR,"Illegal pair_style reax/c mincap command"); iarg += 2; } else if (strcmp(arg[iarg],"minhbonds") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_style reax/c command"); - system->minhbonds = force->inumeric(FLERR,arg[iarg+1]); + system->minhbonds = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (system->minhbonds < 0) error->all(FLERR,"Illegal pair_style reax/c minhbonds command"); iarg += 2; @@ -317,8 +317,8 @@ void PairReaxC::coeff( int nargs, char **args ) char *file = args[2]; FILE *fp; - fp = force->open_potential(file); - if (fp != NULL) + fp = utils::open_potential(file,lmp,nullptr); + if (fp != nullptr) Read_Force_Field(fp, &(system->reax_param), control); else { char str[128]; @@ -327,7 +327,7 @@ void PairReaxC::coeff( int nargs, char **args ) } // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" int itmp = 0; int nreax_types = system->reax_param.num_atom_types; @@ -424,7 +424,7 @@ void PairReaxC::init_style( ) if (lists[i].allocated != 1) lists[i].allocated = 0; - if (fix_reax == NULL) { + if (fix_reax == nullptr) { char **fixarg = new char*[3]; fixarg[0] = (char *) fix_id; fixarg[1] = (char *) "all"; @@ -819,7 +819,7 @@ void *PairReaxC::extract(const char *str, int &dim) else gamma[i] = 0.0; return (void *) gamma; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-REAXC/reaxc_allocate.cpp b/src/USER-REAXC/reaxc_allocate.cpp index f0b0e82299..0390769b53 100644 --- a/src/USER-REAXC/reaxc_allocate.cpp +++ b/src/USER-REAXC/reaxc_allocate.cpp @@ -57,10 +57,10 @@ int PreAllocate_Space( reax_system *system, control_params * /*control*/, // Nullify some arrays only used in omp styles // Should be safe to do here since called in pair->setup(); #ifdef LMP_USER_OMP - workspace->CdDeltaReduction = NULL; - workspace->forceReduction = NULL; - workspace->valence_angle_atom_myoffset = NULL; - workspace->my_ext_pressReduction = NULL; + workspace->CdDeltaReduction = nullptr; + workspace->forceReduction = nullptr; + workspace->valence_angle_atom_myoffset = nullptr; + workspace->my_ext_pressReduction = nullptr; #else LMP_UNUSED_PARAM(workspace); #endif diff --git a/src/USER-REAXC/reaxc_control.cpp b/src/USER-REAXC/reaxc_control.cpp index 12aa989fa2..1c8c24c315 100644 --- a/src/USER-REAXC/reaxc_control.cpp +++ b/src/USER-REAXC/reaxc_control.cpp @@ -41,7 +41,7 @@ char Read_Control_File( char *control_file, control_params* control, double val; /* open control file */ - if ( (fp = fopen( control_file, "r" ) ) == NULL ) { + if ( (fp = fopen( control_file, "r" ) ) == nullptr ) { control->error_ptr->all(FLERR, "The control file cannot be opened"); } diff --git a/src/USER-REAXC/reaxc_io_tools.cpp b/src/USER-REAXC/reaxc_io_tools.cpp index f68a2a2abb..866e3c9891 100644 --- a/src/USER-REAXC/reaxc_io_tools.cpp +++ b/src/USER-REAXC/reaxc_io_tools.cpp @@ -50,7 +50,7 @@ int Init_Output_Files( reax_system *system, control_params *control, /* init potentials file */ sprintf( temp, "%s.pot", control->sim_name ); - if ((out_control->pot = fopen( temp, "w" )) != NULL) { + if ((out_control->pot = fopen( temp, "w" )) != nullptr) { fflush( out_control->pot ); } else { strcpy( msg, "init_out_controls: .pot file could not be opened\n" ); @@ -65,7 +65,7 @@ int Init_Output_Files( reax_system *system, control_params *control, control->ensemble == iNPT || control->ensemble == sNPT ) { sprintf( temp, "%s.prs", control->sim_name ); - if ((out_control->prs = fopen( temp, "w" )) != NULL) { + if ((out_control->prs = fopen( temp, "w" )) != nullptr) { fprintf(out_control->prs,"%8s%13s%13s%13s%13s%13s%13s%13s\n", "step", "Pint/norm[x]", "Pint/norm[y]", "Pint/norm[z]", "Pext/Ptot[x]", "Pext/Ptot[y]", "Pext/Ptot[z]", "Pkin/V" ); @@ -91,12 +91,12 @@ int Close_Output_Files( reax_system *system, control_params * /* control */, if (system->my_rank == MASTER_NODE) { if (out_control->pot) { fclose( out_control->pot ); - out_control->pot = NULL; + out_control->pot = nullptr; } if (out_control->prs) { fclose(out_control->prs); - out_control->prs = NULL; + out_control->prs = nullptr; } } diff --git a/src/USER-REAXC/reaxc_list.cpp b/src/USER-REAXC/reaxc_list.cpp index 0880d96311..ea59b84ff9 100644 --- a/src/USER-REAXC/reaxc_list.cpp +++ b/src/USER-REAXC/reaxc_list.cpp @@ -106,37 +106,37 @@ void Delete_List( reax_list *l ) sfree(l->error_ptr, l->index, "list:index" ); sfree(l->error_ptr, l->end_index, "list:end_index" ); - l->index = NULL; - l->end_index = NULL; + l->index = nullptr; + l->end_index = nullptr; switch(l->type) { case TYP_VOID: sfree(l->error_ptr, l->select.v, "list:v" ); - l->select.v = NULL; + l->select.v = nullptr; break; case TYP_HBOND: sfree(l->error_ptr, l->select.hbond_list, "list:hbonds" ); - l->select.hbond_list = NULL; + l->select.hbond_list = nullptr; break; case TYP_FAR_NEIGHBOR: sfree(l->error_ptr, l->select.far_nbr_list, "list:far_nbrs" ); - l->select.far_nbr_list = NULL; + l->select.far_nbr_list = nullptr; break; case TYP_BOND: sfree(l->error_ptr, l->select.bond_list, "list:bonds" ); - l->select.bond_list = NULL; + l->select.bond_list = nullptr; break; case TYP_DBO: sfree(l->error_ptr, l->select.dbo_list, "list:dbos" ); - l->select.dbo_list = NULL; + l->select.dbo_list = nullptr; break; case TYP_DDELTA: sfree(l->error_ptr, l->select.dDelta_list, "list:dDeltas" ); - l->select.dDelta_list = NULL; + l->select.dDelta_list = nullptr; break; case TYP_THREE_BODY: sfree(l->error_ptr, l->select.three_body_list, "list:three_bodies" ); - l->select.three_body_list = NULL; + l->select.three_body_list = nullptr; break; default: diff --git a/src/USER-REAXC/reaxc_lookup.cpp b/src/USER-REAXC/reaxc_lookup.cpp index 562cbe995f..5ca4a30b8c 100644 --- a/src/USER-REAXC/reaxc_lookup.cpp +++ b/src/USER-REAXC/reaxc_lookup.cpp @@ -37,7 +37,7 @@ void Tridiagonal_Solve( const double *a, const double *b, c[0] /= b[0]; /* Division by zero risk. */ d[0] /= b[0]; /* Division by zero would imply a singular matrix. */ - for(i = 1; i < n; i++){ + for(i = 1; i < (int)n; i++){ id = (b[i] - c[i-1] * a[i]); /* Division by zero risk. */ c[i] /= id; /* Last value calculated is redundant. */ d[i] = (d[i] - d[i-1] * a[i])/id; @@ -64,26 +64,26 @@ void Natural_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const d /* build the linear system */ a[0] = a[1] = a[n-1] = 0; - for( i = 2; i < n-1; ++i ) + for( i = 2; i < (int)n-1; ++i ) a[i] = h[i-1]; b[0] = b[n-1] = 0; - for( i = 1; i < n-1; ++i ) + for( i = 1; i < (int)n-1; ++i ) b[i] = 2 * (h[i-1] + h[i]); c[0] = c[n-2] = c[n-1] = 0; - for( i = 1; i < n-2; ++i ) + for( i = 1; i < (int)n-2; ++i ) c[i] = h[i]; d[0] = d[n-1] = 0; - for( i = 1; i < n-1; ++i ) + for( i = 1; i < (int)n-1; ++i ) d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]); v[0] = 0; v[n-1] = 0; Tridiagonal_Solve( &(a[1]), &(b[1]), &(c[1]), &(d[1]), &(v[1]), n-2 ); - for( i = 1; i < n; ++i ){ + for( i = 1; i < (int)n; ++i ){ coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]); coef[i-1].c = v[i]/2; coef[i-1].b = (f[i]-f[i-1])/h[i-1] + h[i-1]*(2*v[i] + v[i-1])/6; @@ -114,25 +114,25 @@ void Complete_Cubic_Spline( LAMMPS_NS::Error* error_ptr, const double *h, const /* build the linear system */ a[0] = 0; - for( i = 1; i < n; ++i ) + for( i = 1; i < (int)n; ++i ) a[i] = h[i-1]; b[0] = 2*h[0]; - for( i = 1; i < n; ++i ) + for( i = 1; i < (int)n; ++i ) b[i] = 2 * (h[i-1] + h[i]); c[n-1] = 0; - for( i = 0; i < n-1; ++i ) + for( i = 0; i < (int)n-1; ++i ) c[i] = h[i]; d[0] = 6 * (f[1]-f[0])/h[0] - 6 * v0; d[n-1] = 6 * vlast - 6 * (f[n-1]-f[n-2]/h[n-2]); - for( i = 1; i < n-1; ++i ) + for( i = 1; i < (int)n-1; ++i ) d[i] = 6 * ((f[i+1]-f[i])/h[i] - (f[i]-f[i-1])/h[i-1]); Tridiagonal_Solve( &(a[0]), &(b[0]), &(c[0]), &(d[0]), &(v[0]), n ); - for( i = 1; i < n; ++i ){ + for( i = 1; i < (int)n; ++i ){ coef[i-1].d = (v[i] - v[i-1]) / (6*h[i-1]); coef[i-1].c = v[i]/2; coef[i-1].b = (f[i]-f[i-1])/h[i-1] + h[i-1]*(2*v[i] + v[i-1])/6; diff --git a/src/USER-REAXC/reaxc_tool_box.cpp b/src/USER-REAXC/reaxc_tool_box.cpp index 07a45b9467..b78b00568d 100644 --- a/src/USER-REAXC/reaxc_tool_box.cpp +++ b/src/USER-REAXC/reaxc_tool_box.cpp @@ -48,7 +48,7 @@ double Get_Time( ) t /= 1000.0; return t; #else - gettimeofday(&tim, NULL ); + gettimeofday(&tim, nullptr ); return( tim.tv_sec + (tim.tv_usec / 1000000.0) ); #endif } @@ -62,7 +62,7 @@ int Tokenize( char* s, char*** tok ) strncpy( test, s, MAX_LINE-1); - for( word = strtok(test, sep); word; word = strtok(NULL, sep) ) { + for( word = strtok(test, sep); word; word = strtok(nullptr, sep) ) { strncpy( (*tok)[count], word, MAX_LINE ); count++; } @@ -84,11 +84,11 @@ void *smalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, const char *name ) if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } ptr = malloc( n ); - if (ptr == NULL) { + if (ptr == nullptr) { snprintf(errmsg, 256, "Failed to allocate %ld bytes for array %s", n, name); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); @@ -109,7 +109,7 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c "returning NULL.\n", n, name ); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } if (size <= 0) { @@ -117,11 +117,11 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c "returning NULL", name, size ); if (error_ptr) error_ptr->one(FLERR,errmsg); else fputs(errmsg,stderr); - return NULL; + return nullptr; } ptr = calloc( n, size ); - if (ptr == NULL) { + if (ptr == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Failed to allocate %ld bytes for array %s", n*size, name); if (error_ptr) error_ptr->one(FLERR,errmsg); @@ -135,7 +135,7 @@ void *scalloc( LAMMPS_NS::Error *error_ptr, rc_bigint n, rc_bigint size, const c /* safe free */ void sfree( LAMMPS_NS::Error* error_ptr, void *ptr, const char *name ) { - if (ptr == NULL) { + if (ptr == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Trying to free the already NULL pointer %s", name ); if (error_ptr) error_ptr->one(FLERR,errmsg); @@ -144,6 +144,6 @@ void sfree( LAMMPS_NS::Error* error_ptr, void *ptr, const char *name ) } free( ptr ); - ptr = NULL; + ptr = nullptr; } diff --git a/src/USER-REAXC/reaxc_traj.cpp b/src/USER-REAXC/reaxc_traj.cpp index 717bf741e7..698715de22 100644 --- a/src/USER-REAXC/reaxc_traj.cpp +++ b/src/USER-REAXC/reaxc_traj.cpp @@ -41,7 +41,7 @@ int Reallocate_Output_Buffer( LAMMPS_NS::Error *error_ptr, output_controls *out_ out_control->buffer_len = (int)(req_space*REAX_SAFE_ZONE); out_control->buffer = (char*) malloc(out_control->buffer_len*sizeof(char)); - if (out_control->buffer == NULL) { + if (out_control->buffer == nullptr) { char errmsg[256]; snprintf(errmsg, 256, "Insufficient memory for required buffer size %d", (int) (req_space*REAX_SAFE_ZONE)); error_ptr->one(FLERR,errmsg); @@ -341,7 +341,7 @@ int Init_Traj( reax_system *system, control_params *control, /* allocate line & buffer space */ out_control->line = (char*) calloc( MAX_TRJ_LINE_LEN + 1, sizeof(char) ); out_control->buffer_len = 0; - out_control->buffer = NULL; + out_control->buffer = nullptr; /* write trajectory header and atom info, if applicable */ if (out_control->traj_method == REG_TRAJ) { diff --git a/src/USER-SCAFACOS/scafacos.cpp b/src/USER-SCAFACOS/scafacos.cpp index 497442fbe8..42f46cd005 100644 --- a/src/USER-SCAFACOS/scafacos.cpp +++ b/src/USER-SCAFACOS/scafacos.cpp @@ -42,10 +42,10 @@ Scafacos::Scafacos(LAMMPS *lmp) : KSpace(lmp) initialized = 0; maxatom = 0; - xpbc = NULL; - epot = NULL; - efield = NULL; - fcs = NULL; + xpbc = nullptr; + epot = nullptr; + efield = nullptr; + fcs = nullptr; } /* ---------------------------------------------------------------------- */ @@ -57,7 +57,7 @@ void Scafacos::settings(int narg, char **arg) int n = strlen(arg[0]) + 1; method = new char[n]; strcpy(method,arg[0]); - tolerance = force->numeric(FLERR,arg[1]); + tolerance = utils::numeric(FLERR,arg[1],false,lmp); // optional ScaFaCoS library setting defaults // choose the correct default tolerance type for chosen method @@ -118,7 +118,7 @@ void Scafacos::init() if (atom->natoms > INT_MAX && sizeof(int) != 8) error->all(FLERR,"Scafacos atom count exceeds 2B"); - if (atom->molecular > 0) + if (atom->molecular != Atom::ATOMIC) error->all(FLERR, "Cannot use Scafacos with molecular charged systems yet"); diff --git a/src/USER-SDPD/fix_meso_move.cpp b/src/USER-SDPD/fix_meso_move.cpp index 6db2aaa478..ca76963033 100644 --- a/src/USER-SDPD/fix_meso_move.cpp +++ b/src/USER-SDPD/fix_meso_move.cpp @@ -43,9 +43,9 @@ enum{EQUAL,ATOM}; FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), - vxvarstr(NULL), vyvarstr(NULL), vzvarstr(NULL), - xoriginal(NULL), displace(NULL), velocity(NULL) { + xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), + vxvarstr(nullptr), vyvarstr(nullptr), vzvarstr(nullptr), + xoriginal(nullptr), displace(nullptr), velocity(nullptr) { if ((atom->esph_flag != 1) || (atom->rho_flag != 1)) error->all(FLERR, "fix meso/move command requires atom_style with both energy and density"); @@ -74,17 +74,17 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) vxflag = 0; else { vxflag = 1; - vx = force->numeric(FLERR,arg[4]); + vx = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) vyflag = 0; else { vyflag = 1; - vy = force->numeric(FLERR,arg[5]); + vy = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) vzflag = 0; else { vzflag = 1; - vz = force->numeric(FLERR,arg[6]); + vz = utils::numeric(FLERR,arg[6],false,lmp); } } else if (strcmp(arg[3],"wiggle") == 0) { @@ -94,69 +94,69 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) axflag = 0; else { axflag = 1; - ax = force->numeric(FLERR,arg[4]); + ax = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) ayflag = 0; else { ayflag = 1; - ay = force->numeric(FLERR,arg[5]); + ay = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) azflag = 0; else { azflag = 1; - az = force->numeric(FLERR,arg[6]); + az = utils::numeric(FLERR,arg[6],false,lmp); } - period = force->numeric(FLERR,arg[7]); + period = utils::numeric(FLERR,arg[7],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix meso/move command"); } else if (strcmp(arg[3],"rotate") == 0) { if (narg < 11) error->all(FLERR,"Illegal fix meso/move command"); iarg = 11; mstyle = ROTATE; - point[0] = force->numeric(FLERR,arg[4]); - point[1] = force->numeric(FLERR,arg[5]); - point[2] = force->numeric(FLERR,arg[6]); - axis[0] = force->numeric(FLERR,arg[7]); - axis[1] = force->numeric(FLERR,arg[8]); - axis[2] = force->numeric(FLERR,arg[9]); - period = force->numeric(FLERR,arg[10]); + point[0] = utils::numeric(FLERR,arg[4],false,lmp); + point[1] = utils::numeric(FLERR,arg[5],false,lmp); + point[2] = utils::numeric(FLERR,arg[6],false,lmp); + axis[0] = utils::numeric(FLERR,arg[7],false,lmp); + axis[1] = utils::numeric(FLERR,arg[8],false,lmp); + axis[2] = utils::numeric(FLERR,arg[9],false,lmp); + period = utils::numeric(FLERR,arg[10],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix meso/move command"); } else if (strcmp(arg[3],"variable") == 0) { if (narg < 10) error->all(FLERR,"Illegal fix meso/move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL; + if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL; + if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL; + if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (strstr(arg[6],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL; + if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (strstr(arg[7],"v_") == arg[7]) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL; + if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (strstr(arg[8],"v_") == arg[8]) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix meso/move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL; + if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (strstr(arg[9],"v_") == arg[9]) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; @@ -234,10 +234,10 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); - displace = velocity = NULL; + displace = velocity = nullptr; // xoriginal = initial unwrapped positions of atoms @@ -259,8 +259,8 @@ FixMesoMove::FixMesoMove (LAMMPS *lmp, int narg, char **arg) : FixMesoMove::~FixMesoMove () { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays @@ -353,9 +353,9 @@ void FixMesoMove::init () { memory->destroy(displace); memory->destroy(velocity); if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = NULL; + else displace = nullptr; if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = NULL; + else velocity = nullptr; } void FixMesoMove::setup_pre_force (int /*vflag*/) { @@ -731,7 +731,7 @@ void FixMesoMove::initial_integrate (int /*vflag*/) { } /* ---------------------------------------------------------------------- - final NVE of particles with NULL components + final NVE of particles with nullptr components ------------------------------------------------------------------------- */ void FixMesoMove::final_integrate () { diff --git a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp index b6f0c63546..b3a084ab1d 100644 --- a/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp +++ b/src/USER-SDPD/pair_sdpd_taitwater_isothermal.cpp @@ -19,17 +19,19 @@ ------------------------------------------------------------------------- */ #include "pair_sdpd_taitwater_isothermal.h" -#include + #include "atom.h" -#include "force.h" #include "comm.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "memory.h" -#include "error.h" #include "domain.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neighbor.h" #include "update.h" + +#include + #ifndef USE_ZEST #include "random_mars.h" #endif @@ -242,15 +244,15 @@ void PairSDPDTaitwaterIsothermal::settings (int narg, char **arg) { error->all (FLERR, "Illegal number of arguments for " "pair_style sdpd/taitwater/isothermal"); - temperature = force->numeric (FLERR, arg[0]); - viscosity = force->numeric (FLERR, arg[1]); + temperature = utils::numeric(FLERR, arg[0], false, lmp); + viscosity = utils::numeric(FLERR, arg[1], false, lmp); if (temperature <= 0) error->all (FLERR, "Temperature must be positive"); if (viscosity <= 0) error->all (FLERR, "Viscosity must be positive"); // seed is immune to underflow/overflow because it is unsigned seed = comm->nprocs + comm->me + atom->nlocal; - if (narg == 3) seed += force->inumeric (FLERR, arg[2]); + if (narg == 3) seed += utils::inumeric(FLERR, arg[2], false, lmp); #ifdef USE_ZEST generator.seed (seed); #else @@ -270,12 +272,12 @@ void PairSDPDTaitwaterIsothermal::coeff (int narg, char **arg) { if (!allocated) allocate(); int ilo, ihi, jlo, jhi; - force->bounds (FLERR, arg[0], atom->ntypes, ilo, ihi); - force->bounds (FLERR, arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR, arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR, arg[1], 1, atom->ntypes, jlo, jhi, error); - double rho0_one = force->numeric (FLERR,arg[2]); - double soundspeed_one = force->numeric (FLERR,arg[3]); - double cut_one = force->numeric (FLERR,arg[4]); + double rho0_one = utils::numeric(FLERR,arg[2], false, lmp); + double soundspeed_one = utils::numeric(FLERR,arg[3], false, lmp); + double cut_one = utils::numeric(FLERR,arg[4], false, lmp); double B_one = soundspeed_one * soundspeed_one * rho0_one / 7.0; if (rho0_one <= 0) error->all (FLERR, "Density must be positive"); @@ -305,7 +307,7 @@ void PairSDPDTaitwaterIsothermal::coeff (int narg, char **arg) { void PairSDPDTaitwaterIsothermal::init_style() { - if ((!atom->rho_flag) || (atom->drho == NULL)) + if ((!atom->rho_flag) || (atom->drho == nullptr)) error->all(FLERR,"Pair style dpd/taitwater/isothermal requires atom " "attributes rho and drho"); diff --git a/src/USER-SMD/atom_vec_smd.cpp b/src/USER-SMD/atom_vec_smd.cpp index 670783a3d7..26b63b6022 100644 --- a/src/USER-SMD/atom_vec_smd.cpp +++ b/src/USER-SMD/atom_vec_smd.cpp @@ -23,9 +23,10 @@ ------------------------------------------------------------------------- */ #include "atom_vec_smd.h" -#include + #include "atom.h" -#include "error.h" + +#include using namespace LAMMPS_NS; @@ -36,8 +37,8 @@ using namespace LAMMPS_NS; AtomVecSMD::AtomVecSMD(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->smd_flag = 1; diff --git a/src/USER-SMD/compute_smd_contact_radius.cpp b/src/USER-SMD/compute_smd_contact_radius.cpp index 46cbc602f2..ccab79f85e 100644 --- a/src/USER-SMD/compute_smd_contact_radius.cpp +++ b/src/USER-SMD/compute_smd_contact_radius.cpp @@ -46,7 +46,7 @@ ComputeSMDContactRadius::ComputeSMDContactRadius(LAMMPS *lmp, int narg, char **a size_peratom_cols = 0; nmax = 0; - contact_radius_vector = NULL; + contact_radius_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_damage.cpp b/src/USER-SMD/compute_smd_damage.cpp index 96a936cd82..9e58903c95 100644 --- a/src/USER-SMD/compute_smd_damage.cpp +++ b/src/USER-SMD/compute_smd_damage.cpp @@ -46,7 +46,7 @@ ComputeSMDDamage::ComputeSMDDamage(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - damage_vector = NULL; + damage_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_hourglass_error.cpp b/src/USER-SMD/compute_smd_hourglass_error.cpp index 3b6b900004..4118025039 100644 --- a/src/USER-SMD/compute_smd_hourglass_error.cpp +++ b/src/USER-SMD/compute_smd_hourglass_error.cpp @@ -49,7 +49,7 @@ ComputeSMDHourglassError::ComputeSMDHourglassError(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - hourglass_error_vector = NULL; + hourglass_error_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -86,7 +86,7 @@ void ComputeSMDHourglassError::compute_peratom() { int itmp = 0; double *hourglass_error = (double *) force->pair->extract("smd/tlsph/hourglass_error_ptr", itmp); - if (hourglass_error == NULL) { + if (hourglass_error == nullptr) { error->all(FLERR, "compute smd/hourglass_error failed to access hourglass_error array"); } diff --git a/src/USER-SMD/compute_smd_internal_energy.cpp b/src/USER-SMD/compute_smd_internal_energy.cpp index 90ddb74839..c7b11e22cf 100644 --- a/src/USER-SMD/compute_smd_internal_energy.cpp +++ b/src/USER-SMD/compute_smd_internal_energy.cpp @@ -46,7 +46,7 @@ ComputeSMDInternalEnergy::ComputeSMDInternalEnergy(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - internal_energy_vector = NULL; + internal_energy_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_plastic_strain.cpp b/src/USER-SMD/compute_smd_plastic_strain.cpp index c1c001a5dd..842d848890 100644 --- a/src/USER-SMD/compute_smd_plastic_strain.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain.cpp @@ -46,7 +46,7 @@ ComputeSMDPlasticStrain::ComputeSMDPlasticStrain(LAMMPS *lmp, int narg, char **a size_peratom_cols = 0; nmax = 0; - plastic_strain_vector = NULL; + plastic_strain_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp index 272a2c59e5..907e503f54 100644 --- a/src/USER-SMD/compute_smd_plastic_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_plastic_strain_rate.cpp @@ -46,7 +46,7 @@ ComputeSMDPlasticStrainRate::ComputeSMDPlasticStrainRate(LAMMPS *lmp, int narg, size_peratom_cols = 0; nmax = 0; - plastic_strain_rate_vector = NULL; + plastic_strain_rate_vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_rho.cpp b/src/USER-SMD/compute_smd_rho.cpp index d9c0a99b07..89db0b0acd 100644 --- a/src/USER-SMD/compute_smd_rho.cpp +++ b/src/USER-SMD/compute_smd_rho.cpp @@ -46,7 +46,7 @@ ComputeSMDRho::ComputeSMDRho(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - rhoVector = NULL; + rhoVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp index 09aeeea74a..b283a41c4f 100644 --- a/src/USER-SMD/compute_smd_tlsph_defgrad.cpp +++ b/src/USER-SMD/compute_smd_tlsph_defgrad.cpp @@ -23,14 +23,16 @@ ------------------------------------------------------------------------- */ #include "compute_smd_tlsph_defgrad.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "comm.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include +#include // IWYU pragma: export using namespace Eigen; using namespace std; @@ -47,7 +49,7 @@ ComputeSMDTLSPHDefgrad::ComputeSMDTLSPHDefgrad(LAMMPS *lmp, int narg, char **arg size_peratom_cols = 10; nmax = 0; - defgradVector = NULL; + defgradVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_tlsph_dt.cpp b/src/USER-SMD/compute_smd_tlsph_dt.cpp index 7752436b8a..a02ff838d4 100644 --- a/src/USER-SMD/compute_smd_tlsph_dt.cpp +++ b/src/USER-SMD/compute_smd_tlsph_dt.cpp @@ -49,7 +49,7 @@ ComputeSMDTlsphDt::ComputeSMDTlsphDt(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - dt_vector = NULL; + dt_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void ComputeSMDTlsphDt::compute_peratom() { int itmp = 0; double *particle_dt = (double *) force->pair->extract("smd/tlsph/particle_dt_ptr", itmp); - if (particle_dt == NULL) { + if (particle_dt == nullptr) { error->all(FLERR, "compute smd/tlsph_dt failed to access particle_dt array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp index 347b138412..f5f14fa500 100644 --- a/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_tlsph_num_neighs.cpp @@ -47,7 +47,7 @@ ComputeSMDTLSPHNumNeighs::ComputeSMDTLSPHNumNeighs(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - numNeighsRefConfigOutput = NULL; + numNeighsRefConfigOutput = nullptr; } /* ---------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ void ComputeSMDTLSPHNumNeighs::compute_peratom() { int itmp = 0; int *numNeighsRefConfig = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (numNeighsRefConfig == NULL) { + if (numNeighsRefConfig == nullptr) { error->all(FLERR, "compute smd/tlsph_num_neighs failed to access numNeighsRefConfig array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_shape.cpp b/src/USER-SMD/compute_smd_tlsph_shape.cpp index ba1a9306ef..a978fd2e9e 100644 --- a/src/USER-SMD/compute_smd_tlsph_shape.cpp +++ b/src/USER-SMD/compute_smd_tlsph_shape.cpp @@ -23,16 +23,18 @@ ------------------------------------------------------------------------- */ #include "compute_smd_tlsph_shape.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" +#include "modify.h" #include "pair.h" +#include "update.h" + +#include +#include // IWYU pragma: export using namespace Eigen; using namespace std; @@ -49,7 +51,7 @@ ComputeSmdTlsphShape::ComputeSmdTlsphShape(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 7; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -87,12 +89,12 @@ void ComputeSmdTlsphShape::compute_peratom() { int itmp = 0; Matrix3d *R = (Matrix3d *) force->pair->extract("smd/tlsph/rotation_ptr", itmp); - if (R == NULL) { + if (R == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access rotation array"); } Matrix3d *F = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); - if (F == NULL) { + if (F == nullptr) { error->all(FLERR, "compute smd/tlsph_shape failed to access deformation gradient array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_strain.cpp b/src/USER-SMD/compute_smd_tlsph_strain.cpp index f0061bf7a1..5e86f4fd38 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain.cpp @@ -24,16 +24,18 @@ ------------------------------------------------------------------------- */ #include "compute_smd_tlsph_strain.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" +#include "modify.h" #include "pair.h" +#include "update.h" + +#include +#include // IWYU pragma: export using namespace Eigen; using namespace std; @@ -50,7 +52,7 @@ ComputeSMDTLSPHstrain::ComputeSMDTLSPHstrain(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 6; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -90,7 +92,7 @@ void ComputeSMDTLSPHstrain::compute_peratom() { // copy data to output array int itmp = 0; Matrix3d *Fincr = (Matrix3d *) force->pair->extract("smd/tlsph/Fincr_ptr", itmp); - if (Fincr == NULL) { + if (Fincr == nullptr) { error->all(FLERR, "compute smd/tlsph_strain failed to access Fincr array"); } diff --git a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp index 895a973f6a..3d9f467694 100644 --- a/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_tlsph_strain_rate.cpp @@ -23,17 +23,19 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -#include -#include #include "compute_smd_tlsph_strain_rate.h" + #include "atom.h" -#include "update.h" -#include "modify.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" +#include "modify.h" #include "pair.h" +#include "update.h" + +#include +#include // IWYU pragma: export using namespace Eigen; using namespace LAMMPS_NS; @@ -50,7 +52,7 @@ ComputeSMDTLSPHStrainRate::ComputeSMDTLSPHStrainRate(LAMMPS *lmp, int narg, char size_peratom_cols = 6; nmax = 0; - strain_rate_array = NULL; + strain_rate_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -87,7 +89,7 @@ void ComputeSMDTLSPHStrainRate::compute_peratom() { int itmp = 0; Matrix3d *D = (Matrix3d *) force->pair->extract("smd/tlsph/strain_rate_ptr", itmp); - if (D == NULL) { + if (D == nullptr) { error->all(FLERR, "compute smd/tlsph_strain_rate could not access strain rate. Are the matching pair styles present?"); } diff --git a/src/USER-SMD/compute_smd_tlsph_stress.cpp b/src/USER-SMD/compute_smd_tlsph_stress.cpp index 9c78b192ce..f668a7f82b 100644 --- a/src/USER-SMD/compute_smd_tlsph_stress.cpp +++ b/src/USER-SMD/compute_smd_tlsph_stress.cpp @@ -60,7 +60,7 @@ ComputeSMDTLSPHStress::ComputeSMDTLSPHStress(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 7; nmax = 0; - stress_array = NULL; + stress_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ void ComputeSMDTLSPHStress::compute_peratom() { int itmp = 0; Matrix3d *T = (Matrix3d *) force->pair->extract("smd/tlsph/stressTensor_ptr", itmp); - if (T == NULL) { + if (T == nullptr) { error->all(FLERR, "compute smd/tlsph_stress could not access stress tensors. Are the matching pair styles present?"); } int nlocal = atom->nlocal; diff --git a/src/USER-SMD/compute_smd_triangle_vertices.cpp b/src/USER-SMD/compute_smd_triangle_vertices.cpp index 06706a85ad..46555559d3 100644 --- a/src/USER-SMD/compute_smd_triangle_vertices.cpp +++ b/src/USER-SMD/compute_smd_triangle_vertices.cpp @@ -46,7 +46,7 @@ ComputeSMDTriangleVertices::ComputeSMDTriangleVertices(LAMMPS *lmp, int narg, ch size_peratom_cols = 9; nmax = 0; - outputVector = NULL; + outputVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_ulsph_effm.cpp b/src/USER-SMD/compute_smd_ulsph_effm.cpp index fc8637bbf0..4285d1c981 100644 --- a/src/USER-SMD/compute_smd_ulsph_effm.cpp +++ b/src/USER-SMD/compute_smd_ulsph_effm.cpp @@ -49,7 +49,7 @@ ComputeSMD_Ulsph_Effm::ComputeSMD_Ulsph_Effm(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 0; nmax = 0; - dt_vector = NULL; + dt_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -88,7 +88,7 @@ void ComputeSMD_Ulsph_Effm::compute_peratom() { int itmp = 0; double *particle_dt = (double *) force->pair->extract("smd/ulsph/effective_modulus_ptr", itmp); - if (particle_dt == NULL) { + if (particle_dt == nullptr) { error->all(FLERR, "compute smd/ulsph_effm failed to access particle_dt array"); } diff --git a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp index 4ef339db98..57460c2929 100644 --- a/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp +++ b/src/USER-SMD/compute_smd_ulsph_num_neighs.cpp @@ -47,7 +47,7 @@ ComputeSMDULSPHNumNeighs::ComputeSMDULSPHNumNeighs(LAMMPS *lmp, int narg, char * size_peratom_cols = 0; nmax = 0; - numNeighsOutput = NULL; + numNeighsOutput = nullptr; } /* ---------------------------------------------------------------------- */ @@ -84,7 +84,7 @@ void ComputeSMDULSPHNumNeighs::compute_peratom() { int itmp = 0; int *numNeighs = (int *) force->pair->extract("smd/ulsph/numNeighs_ptr", itmp); - if (numNeighs == NULL) { + if (numNeighs == nullptr) { error->all(FLERR, "compute smd/ulsph_num_neighs failed to access numNeighs array"); } diff --git a/src/USER-SMD/compute_smd_ulsph_strain.cpp b/src/USER-SMD/compute_smd_ulsph_strain.cpp index cf1535759c..a4211a6b60 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain.cpp @@ -46,7 +46,7 @@ ComputeSMDULSPHstrain::ComputeSMDULSPHstrain(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 6; nmax = 0; - strainVector = NULL; + strainVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp index f5ff4fef98..9118e6dded 100644 --- a/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp +++ b/src/USER-SMD/compute_smd_ulsph_strain_rate.cpp @@ -49,7 +49,7 @@ ComputeSMDULSPHStrainRate::ComputeSMDULSPHStrainRate(LAMMPS *lmp, int narg, char size_peratom_cols = 6; nmax = 0; - strain_rate_array = NULL; + strain_rate_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -87,7 +87,7 @@ void ComputeSMDULSPHStrainRate::compute_peratom() { int itmp = 0; Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); - if (L == NULL) { + if (L == nullptr) { error->all(FLERR, "compute smd/ulsph_strain_rate could not access any velocity gradients. Are the matching pair styles present?"); } diff --git a/src/USER-SMD/compute_smd_ulsph_stress.cpp b/src/USER-SMD/compute_smd_ulsph_stress.cpp index ea477375ce..c7078a5741 100644 --- a/src/USER-SMD/compute_smd_ulsph_stress.cpp +++ b/src/USER-SMD/compute_smd_ulsph_stress.cpp @@ -59,7 +59,7 @@ ComputeSMDULSPHStress::ComputeSMDULSPHStress(LAMMPS *lmp, int narg, char **arg) size_peratom_cols = 7; nmax = 0; - stress_array = NULL; + stress_array = nullptr; } /* ---------------------------------------------------------------------- */ @@ -99,7 +99,7 @@ void ComputeSMDULSPHStress::compute_peratom() { int itmp = 0; Matrix3d *T = (Matrix3d *) force->pair->extract("smd/ulsph/stressTensor_ptr", itmp); - if (T == NULL) { + if (T == nullptr) { error->all(FLERR, "compute smd/ulsph_stress could not access stress tensors. Are the matching pair styles present?"); } int nlocal = atom->nlocal; diff --git a/src/USER-SMD/compute_smd_vol.cpp b/src/USER-SMD/compute_smd_vol.cpp index eb1f144275..46aa7ea3c4 100644 --- a/src/USER-SMD/compute_smd_vol.cpp +++ b/src/USER-SMD/compute_smd_vol.cpp @@ -23,7 +23,7 @@ ------------------------------------------------------------------------- */ #include "compute_smd_vol.h" -#include + #include #include "atom.h" #include "update.h" @@ -48,7 +48,7 @@ ComputeSMDVol::ComputeSMDVol(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - volVector = NULL; + volVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/fix_smd_adjust_dt.cpp b/src/USER-SMD/fix_smd_adjust_dt.cpp index ab6dd5ef5c..047406f25d 100644 --- a/src/USER-SMD/fix_smd_adjust_dt.cpp +++ b/src/USER-SMD/fix_smd_adjust_dt.cpp @@ -23,8 +23,8 @@ ------------------------------------------------------------------------- */ #include "fix_smd_adjust_dt.h" -#include -#include + + #include "update.h" #include "force.h" #include "pair.h" @@ -108,28 +108,28 @@ void FixSMDTlsphDtReset::end_of_step() { double *dt_HERTZ = (double *) force->pair->extract("smd/hertz/stable_time_increment_ptr", itmp); double *dt_PERI_IPMB = (double *) force->pair->extract("smd/peri_ipmb/stable_time_increment_ptr", itmp); - if ((dtCFL_TLSPH == NULL) && (dtCFL_ULSPH == NULL) && (dt_TRI == NULL) && (dt_HERTZ == NULL) - && (dt_PERI_IPMB == NULL)) { + if ((dtCFL_TLSPH == nullptr) && (dtCFL_ULSPH == nullptr) && (dt_TRI == nullptr) && (dt_HERTZ == nullptr) + && (dt_PERI_IPMB == nullptr)) { error->all(FLERR, "fix smd/adjust_dt failed to access a valid dtCFL"); } - if (dtCFL_TLSPH != NULL) { + if (dtCFL_TLSPH != nullptr) { dtmin = MIN(dtmin, *dtCFL_TLSPH); } - if (dtCFL_ULSPH != NULL) { + if (dtCFL_ULSPH != nullptr) { dtmin = MIN(dtmin, *dtCFL_ULSPH); } - if (dt_TRI != NULL) { + if (dt_TRI != nullptr) { dtmin = MIN(dtmin, *dt_TRI); } - if (dt_HERTZ != NULL) { + if (dt_HERTZ != nullptr) { dtmin = MIN(dtmin, *dt_HERTZ); } - if (dt_PERI_IPMB != NULL) { + if (dt_PERI_IPMB != nullptr) { dtmin = MIN(dtmin, *dt_PERI_IPMB); } @@ -186,6 +186,7 @@ void FixSMDTlsphDtReset::end_of_step() { update->dt = dt; + update->dt_default = 0; if (force->pair) force->pair->reset_dt(); for (int i = 0; i < modify->nfix; i++) diff --git a/src/USER-SMD/fix_smd_integrate_tlsph.cpp b/src/USER-SMD/fix_smd_integrate_tlsph.cpp index ed039d39d4..741bd6ba14 100644 --- a/src/USER-SMD/fix_smd_integrate_tlsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_tlsph.cpp @@ -74,7 +74,7 @@ FixSMDIntegrateTlsph::FixSMDIntegrateTlsph(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "expected number following limit_velocity"); } - vlimit = force->numeric(FLERR, arg[iarg]); + vlimit = utils::numeric(FLERR, arg[iarg],false,lmp); if (comm->me == 0) { printf("... will limit velocities to <= %g\n", vlimit); } @@ -95,7 +95,7 @@ FixSMDIntegrateTlsph::FixSMDIntegrateTlsph(LAMMPS *lmp, int narg, char **arg) : // set comm sizes needed by this fix - atom->add_callback(0); + atom->add_callback(Atom::GROW); } @@ -139,7 +139,7 @@ void FixSMDIntegrateTlsph::initial_integrate(int /*vflag*/) { Vector3d *smoothVelDifference = (Vector3d *) force->pair->extract("smd/tlsph/smoothVel_ptr", itmp); if (xsphFlag) { - if (smoothVelDifference == NULL) { + if (smoothVelDifference == nullptr) { error->one(FLERR, "fix smd/integrate_tlsph failed to access smoothVel array. Check if a pair style exist which calculates this quantity."); } diff --git a/src/USER-SMD/fix_smd_integrate_ulsph.cpp b/src/USER-SMD/fix_smd_integrate_ulsph.cpp index 4978416e66..fba327026d 100644 --- a/src/USER-SMD/fix_smd_integrate_ulsph.cpp +++ b/src/USER-SMD/fix_smd_integrate_ulsph.cpp @@ -77,21 +77,21 @@ FixSMDIntegrateUlsph::FixSMDIntegrateUlsph(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR, "expected three numbers following adjust_radius: factor, min, max"); } - adjust_radius_factor = force->numeric(FLERR, arg[iarg]); + adjust_radius_factor = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three numbers following adjust_radius: factor, min, max"); } - min_nn = force->inumeric(FLERR, arg[iarg]); + min_nn = utils::inumeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three numbers following adjust_radius: factor, min, max"); } - max_nn = force->inumeric(FLERR, arg[iarg]); + max_nn = utils::inumeric(FLERR, arg[iarg],false,lmp); if (comm->me == 0) { printf("... will adjust smoothing length dynamically with factor %g to achieve %d to %d neighbors per particle.\n ", @@ -103,7 +103,7 @@ FixSMDIntegrateUlsph::FixSMDIntegrateUlsph(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected number following limit_velocity"); } - vlimit = force->numeric(FLERR, arg[iarg]); + vlimit = utils::numeric(FLERR, arg[iarg],false,lmp); if (comm->me == 0) { printf("... will limit velocities to <= %g\n", vlimit); @@ -123,7 +123,7 @@ FixSMDIntegrateUlsph::FixSMDIntegrateUlsph(LAMMPS *lmp, int narg, char **arg) : } // set comm sizes needed by this fix - atom->add_callback(0); + atom->add_callback(Atom::GROW); time_integrate = 1; } @@ -171,7 +171,7 @@ void FixSMDIntegrateUlsph::initial_integrate(int /*vflag*/) { Vector3d *smoothVel = (Vector3d *) force->pair->extract("smd/ulsph/smoothVel_ptr", itmp); if (xsphFlag) { - if (smoothVel == NULL) { + if (smoothVel == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to access smoothVel array"); } } @@ -259,12 +259,12 @@ void FixSMDIntegrateUlsph::final_integrate() { int itmp; int *nn = (int *) force->pair->extract("smd/ulsph/numNeighs_ptr", itmp); - if (nn == NULL) { + if (nn == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss num_neighs array"); } Matrix3d *L = (Matrix3d *) force->pair->extract("smd/ulsph/velocityGradient_ptr", itmp); - if (L == NULL) { + if (L == nullptr) { error->one(FLERR, "fix smd/integrate_ulsph failed to accesss velocityGradient array"); } diff --git a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp index cbaad9ac4c..ac77a7965d 100644 --- a/src/USER-SMD/fix_smd_move_triangulated_surface.cpp +++ b/src/USER-SMD/fix_smd_move_triangulated_surface.cpp @@ -23,15 +23,16 @@ ------------------------------------------------------------------------- */ #include "fix_smd_move_triangulated_surface.h" + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "math_const.h" +#include "update.h" + #include #include #include -#include "atom.h" -#include "comm.h" -#include "force.h" -#include "update.h" -#include "error.h" -#include "math_const.h" using namespace Eigen; using namespace LAMMPS_NS; @@ -77,19 +78,19 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected three floats for velocity following *LINEAR"); } - vx = force->numeric(FLERR, arg[iarg]); + vx = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three floats for velocity following *LINEAR"); } - vy = force->numeric(FLERR, arg[iarg]); + vy = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected three floats for velocity following *LINEAR"); } - vz = force->numeric(FLERR, arg[iarg]); + vz = utils::numeric(FLERR, arg[iarg],false,lmp); } else if (strcmp(arg[iarg], "*WIGGLE") == 0) { wiggleFlag = true; @@ -101,25 +102,25 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - vx = force->numeric(FLERR, arg[iarg]); + vx = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - vy = force->numeric(FLERR, arg[iarg]); + vy = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - vz = force->numeric(FLERR, arg[iarg]); + vz = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 4 floats following *WIGGLE : vx vy vz max_travel"); } - wiggle_max_travel = force->numeric(FLERR, arg[iarg]); + wiggle_max_travel = utils::numeric(FLERR, arg[iarg],false,lmp); } else if (strcmp(arg[iarg], "*ROTATE") == 0) { rotateFlag = true; @@ -128,43 +129,43 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - origin(0) = force->numeric(FLERR, arg[iarg]); + origin(0) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - origin(1) = force->numeric(FLERR, arg[iarg]); + origin(1) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - origin(2) = force->numeric(FLERR, arg[iarg]); + origin(2) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_axis(0) = force->numeric(FLERR, arg[iarg]); + rotation_axis(0) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_axis(1) = force->numeric(FLERR, arg[iarg]); + rotation_axis(1) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_axis(2) = force->numeric(FLERR, arg[iarg]); + rotation_axis(2) = utils::numeric(FLERR, arg[iarg],false,lmp); iarg++; if (iarg == narg) { error->all(FLERR, "expected 7 floats following *ROTATE: origin, rotation axis, and rotation period"); } - rotation_period = force->numeric(FLERR, arg[iarg]); + rotation_period = utils::numeric(FLERR, arg[iarg],false,lmp); /* * construct rotation matrix @@ -205,8 +206,8 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : // set comm sizes needed by this fix comm_forward = 12; - //atom->add_callback(0); - //atom->add_callback(1); + //atom->add_callback(Atom::GROW); + //atom->add_callback(Atom::RESTART); time_integrate = 1; } @@ -216,8 +217,8 @@ FixSMDMoveTriSurf::FixSMDMoveTriSurf(LAMMPS *lmp, int narg, char **arg) : FixSMDMoveTriSurf::~FixSMDMoveTriSurf() { // unregister callbacks to this fix from Atom class - //atom->delete_callback(id,0); - //atom->delete_callback(id,1); + //atom->delete_callback(id,Atom::GROW); + //atom->delete_callback(id,Atom::RESTART); } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/fix_smd_setvel.cpp b/src/USER-SMD/fix_smd_setvel.cpp index 2964ded544..3301999270 100644 --- a/src/USER-SMD/fix_smd_setvel.cpp +++ b/src/USER-SMD/fix_smd_setvel.cpp @@ -24,18 +24,18 @@ ------------------------------------------------------------------------- */ #include "fix_smd_setvel.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "domain.h" -#include "region.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" -#include "force.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "region.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -57,7 +57,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 1; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3], "v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -66,7 +66,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3], "NULL") == 0) { xstyle = NONE; } else { - xvalue = force->numeric(FLERR, arg[3]); + xvalue = utils::numeric(FLERR, arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4], "v_") == arg[4]) { @@ -76,7 +76,7 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4], "NULL") == 0) { ystyle = NONE; } else { - yvalue = force->numeric(FLERR, arg[4]); + yvalue = utils::numeric(FLERR, arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5], "v_") == arg[5]) { @@ -86,14 +86,14 @@ FixSMDSetVel::FixSMDSetVel(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[5], "NULL") == 0) { zstyle = NONE; } else { - zvalue = force->numeric(FLERR, arg[5]); + zvalue = utils::numeric(FLERR, arg[5],false,lmp); zstyle = CONSTANT; } // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -241,7 +241,7 @@ void FixSMDSetVel::post_force(int /*vflag*/) { // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp index 4ade21a6fd..476445388a 100644 --- a/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp +++ b/src/USER-SMD/fix_smd_tlsph_reference_configuration.cpp @@ -25,7 +25,7 @@ ------------------------------------------------------------------------- */ #include "fix_smd_tlsph_reference_configuration.h" -#include + #include #include "atom.h" #include "comm.h" @@ -55,18 +55,18 @@ using namespace SMD_Math; FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR, "Pair tlsph with partner list requires an atom map, see atom_modify"); maxpartner = 1; - npartner = NULL; - partner = NULL; - wfd_list = NULL; - wf_list = NULL; - energy_per_bond = NULL; - degradation_ij = NULL; + npartner = nullptr; + partner = nullptr; + wfd_list = nullptr; + wf_list = nullptr; + energy_per_bond = nullptr; + degradation_ij = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize npartner to 0 so neighbor list creation is OK the 1st time int nlocal = atom->nlocal; @@ -83,7 +83,7 @@ FixSMD_TLSPH_ReferenceConfiguration::FixSMD_TLSPH_ReferenceConfiguration(LAMMPS FixSMD_TLSPH_ReferenceConfiguration::~FixSMD_TLSPH_ReferenceConfiguration() { // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id, 0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays memory->destroy(npartner); @@ -130,13 +130,13 @@ void FixSMD_TLSPH_ReferenceConfiguration::pre_exchange() { } int *updateFlag_ptr = (int *) force->pair->extract("smd/tlsph/updateFlag_ptr", itmp); - if (updateFlag_ptr == NULL) { + if (updateFlag_ptr == nullptr) { error->one(FLERR, "fix FixSMD_TLSPH_ReferenceConfiguration failed to access updateFlag pointer. Check if a pair style exist which calculates this quantity."); } int *nn = (int *) force->pair->extract("smd/tlsph/numNeighsRefConfig_ptr", itmp); - if (nn == NULL) { + if (nn == nullptr) { error->all(FLERR, "FixSMDIntegrateTlsph::updateReferenceConfiguration() failed to access numNeighsRefConfig_ptr array"); } @@ -468,7 +468,7 @@ int FixSMD_TLSPH_ReferenceConfiguration::pack_restart(int i, double *buf) { ------------------------------------------------------------------------- */ void FixSMD_TLSPH_ReferenceConfiguration::unpack_restart(int /*nlocal*/, int /*nth*/) { -// ipage = NULL if being called from granular pair style init() +// ipage = nullptr if being called from granular pair style init() // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them diff --git a/src/USER-SMD/fix_smd_wall_surface.cpp b/src/USER-SMD/fix_smd_wall_surface.cpp index 9183bcd9ea..b55268a3ec 100644 --- a/src/USER-SMD/fix_smd_wall_surface.cpp +++ b/src/USER-SMD/fix_smd_wall_surface.cpp @@ -16,17 +16,16 @@ ------------------------------------------------------------------------- */ #include "fix_smd_wall_surface.h" -#include -#include -#include -#include + #include "atom.h" -#include "domain.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" #include "atom_vec.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "memory.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -44,15 +43,15 @@ FixSMDWallSurface::FixSMDWallSurface(LAMMPS *lmp, int narg, char **arg) : restart_peratom = 0; first = 1; - //atom->add_callback(0); - //atom->add_callback(1); + //atom->add_callback(Atom::GROW); + //atom->add_callback(Atom::RESTART); if (narg != 6) error->all(FLERR, "Illegal number of arguments for fix smd/wall_surface"); filename = strdup(arg[3]); - wall_particle_type = force->inumeric(FLERR, arg[4]); - wall_molecule_id = force->inumeric(FLERR, arg[5]); + wall_particle_type = utils::inumeric(FLERR,arg[4],false,lmp); + wall_molecule_id = utils::inumeric(FLERR,arg[5],false,lmp); if (wall_molecule_id < 65535) { error->one(FLERR, "wall molcule id must be >= 65535\n"); } @@ -70,11 +69,11 @@ FixSMDWallSurface::FixSMDWallSurface(LAMMPS *lmp, int narg, char **arg) : FixSMDWallSurface::~FixSMDWallSurface() { free(filename); - filename = NULL; + filename = nullptr; // unregister this fix so atom class doesn't invoke it any more - //atom->delete_callback(id, 0); - //atom->delete_callback(id, 1); + //atom->delete_callback(id,Atom::GROW); + //atom->delete_callback(id,Atom::RESTART); } /* ---------------------------------------------------------------------- */ @@ -199,12 +198,12 @@ int FixSMDWallSurface::count_words(const char *line) { if ((ptr = strchr(copy, '#'))) *ptr = '\0'; - if (strtok(copy, " \t\n\r\f") == NULL) { + if (strtok(copy, " \t\n\r\f") == nullptr) { memory->destroy(copy); return 0; } n = 1; - while (strtok(NULL, " \t\n\r\f")) + while (strtok(nullptr, " \t\n\r\f")) n++; memory->destroy(copy); @@ -230,7 +229,7 @@ void FixSMDWallSurface::read_triangles(int pass) { Vector3d normal, center; FILE *fp = fopen(filename, "r"); - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128, "Cannot open file %s", filename); error->one(FLERR, str); @@ -262,7 +261,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read STL solid name retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading number of triangle pairs"); } @@ -273,11 +272,11 @@ void FixSMDWallSurface::read_triangles(int pass) { // values = new char*[nwords]; // values[0] = strtok(line, " \t\n\r\f"); -// if (values[0] == NULL) +// if (values[0] == nullptr) // error->all(FLERR, "Incorrect atom format in data file"); // for (m = 1; m < nwords; m++) { -// values[m] = strtok(NULL, " \t\n\r\f"); -// if (values[m] == NULL) +// values[m] = strtok(nullptr, " \t\n\r\f"); +// if (values[m] == nullptr) // error->all(FLERR, "Incorrect atom format in data file"); // } // delete[] values; @@ -302,22 +301,24 @@ void FixSMDWallSurface::read_triangles(int pass) { values = new char*[nwords]; values[0] = strtok(line, " \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR, "Incorrect atom format in data file"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL, " \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr, " \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR, "Incorrect atom format in data file"); } - normal << force->numeric(FLERR, values[2]), force->numeric(FLERR, values[3]), force->numeric(FLERR, values[4]); + normal << utils::numeric(FLERR, values[2], false, lmp), + utils::numeric(FLERR, values[3], false, lmp), + utils::numeric(FLERR, values[4], false, lmp); //cout << "normal is " << normal << endl; delete[] values; // read outer loop line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR, "error reading outer loop"); } @@ -330,7 +331,7 @@ void FixSMDWallSurface::read_triangles(int pass) { for (int k = 0; k < 3; k++) { retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading vertex line"); } @@ -341,15 +342,17 @@ void FixSMDWallSurface::read_triangles(int pass) { values = new char*[nwords]; values[0] = strtok(line, " \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,"Incorrect vertex line"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL, " \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr, " \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR, "Incorrect vertex line"); } - vert[k] << force->numeric(FLERR, values[1]), force->numeric(FLERR, values[2]), force->numeric(FLERR, values[3]); + vert[k] << utils::numeric(FLERR, values[1], false, lmp), + utils::numeric(FLERR, values[2], false, lmp), + utils::numeric(FLERR, values[3], false, lmp); //cout << "vertex is " << vert[k] << endl; //printf("%s %s %s\n", values[1], values[2], values[3]); delete[] values; @@ -359,7 +362,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read end loop line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR, "error reading endloop"); } @@ -370,7 +373,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // read end facet line retpointer = fgets(line, sizeof(line), fp); - if (retpointer == NULL) { + if (retpointer == nullptr) { error->one(FLERR,"error reading endfacet"); } @@ -462,7 +465,7 @@ void FixSMDWallSurface::read_triangles(int pass) { // create global mapping of atoms // zero nghost in case are adding new atoms to existing atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); diff --git a/src/USER-SMD/pair_smd_hertz.cpp b/src/USER-SMD/pair_smd_hertz.cpp index 97be94d833..c966f5ba75 100644 --- a/src/USER-SMD/pair_smd_hertz.cpp +++ b/src/USER-SMD/pair_smd_hertz.cpp @@ -27,9 +27,9 @@ ------------------------------------------------------------------------- */ #include "pair_smd_hertz.h" -#include + #include -#include + #include #include "atom.h" #include "domain.h" @@ -41,6 +41,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; #define SQRT2 1.414213562e0 @@ -50,9 +51,9 @@ using namespace LAMMPS_NS; PairHertz::PairHertz(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; - bulkmodulus = NULL; - kn = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + bulkmodulus = nullptr; + kn = nullptr; scale = 1.0; } @@ -239,7 +240,7 @@ void PairHertz::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR, "Illegal number of args for pair_style hertz"); - scale = force->numeric(FLERR, arg[0]); + scale = utils::numeric(FLERR, arg[0],false,lmp); if (comm->me == 0) { printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); printf("SMD/HERTZ CONTACT SETTINGS:\n"); @@ -260,8 +261,8 @@ void PairHertz::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); double bulkmodulus_one = atof(arg[2]); @@ -373,6 +374,6 @@ void *PairHertz::extract(const char *str, int &/*i*/) { return (void *) &stable_time_increment; } - return NULL; + return nullptr; } diff --git a/src/USER-SMD/pair_smd_tlsph.cpp b/src/USER-SMD/pair_smd_tlsph.cpp index c932086a32..3c87119553 100644 --- a/src/USER-SMD/pair_smd_tlsph.cpp +++ b/src/USER-SMD/pair_smd_tlsph.cpp @@ -23,10 +23,10 @@ ------------------------------------------------------------------------- */ #include "pair_smd_tlsph.h" -#include + #include #include -#include + #include #include #include "fix_smd_tlsph_reference_configuration.h" @@ -63,28 +63,28 @@ using namespace SMD_Math; PairTlsph::PairTlsph(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; - failureModel = NULL; - strengthModel = eos = NULL; + failureModel = nullptr; + strengthModel = eos = nullptr; nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - Fdot = Fincr = K = PK1 = NULL; - R = FincrInv = W = D = NULL; - detF = NULL; - smoothVelDifference = NULL; - numNeighsRefConfig = NULL; - CauchyStress = NULL; - hourglass_error = NULL; - Lookup = NULL; - particle_dt = NULL; + Fdot = Fincr = K = PK1 = nullptr; + R = FincrInv = W = D = nullptr; + detF = nullptr; + smoothVelDifference = nullptr; + numNeighsRefConfig = nullptr; + CauchyStress = nullptr; + hourglass_error = nullptr; + Lookup = nullptr; + particle_dt = nullptr; updateFlag = 0; first = true; dtCFL = 0.0; // initialize dtCFL so it is set to safe value if extracted on zero-th timestep comm_forward = 22; // this pair style communicates 20 doubles to ghost atoms : PK1 tensor + F tensor + shepardWeight - fix_tlsph_reference_configuration = NULL; + fix_tlsph_reference_configuration = nullptr; cut_comm = MAX(neighbor->cutneighmax, comm->cutghostuser); // cutoff radius within which ghost atoms are communicated. } @@ -935,7 +935,7 @@ void PairTlsph::settings(int narg, char **arg) { } update_method = UPDATE_CONSTANT_THRESHOLD; - update_threshold = force->numeric(FLERR, arg[iarg]); + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); } else if (strcmp(arg[iarg], "*UPDATE_PAIRWISE") == 0) { iarg++; @@ -944,7 +944,7 @@ void PairTlsph::settings(int narg, char **arg) { } update_method = UPDATE_PAIRWISE_RATIO; - update_threshold = force->numeric(FLERR, arg[iarg]); + update_threshold = utils::numeric(FLERR, arg[iarg],false,lmp); } else { char msg[128]; @@ -1002,11 +1002,11 @@ void PairTlsph::coeff(int narg, char **arg) { /* * check that TLSPH parameters are given only in i,i form */ - if (force->inumeric(FLERR, arg[0]) != force->inumeric(FLERR, arg[1])) { + if (utils::inumeric(FLERR, arg[0], false, lmp) != utils::inumeric(FLERR, arg[1], false, lmp)) { sprintf(str, "TLSPH coefficients can only be specified between particles of same type!"); error->all(FLERR, str); } - itype = force->inumeric(FLERR, arg[0]); + itype = utils::inumeric(FLERR, arg[0],false,lmp); // set all eos, strength and failure models to inactive by default eos[itype] = EOS_NONE; @@ -1050,13 +1050,13 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[REFERENCE_DENSITY][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[YOUNGS_MODULUS][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[POISSON_RATIO][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[VISCOSITY_Q1][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[VISCOSITY_Q2][itype] = force->numeric(FLERR, arg[ioffset + 5]); - Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = force->numeric(FLERR, arg[ioffset + 6]); - Lookup[HEAT_CAPACITY][itype] = force->numeric(FLERR, arg[ioffset + 7]); + Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[YOUNGS_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[POISSON_RATIO][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[VISCOSITY_Q1][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[VISCOSITY_Q2][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); Lookup[LAME_LAMBDA][itype] = Lookup[YOUNGS_MODULUS][itype] * Lookup[POISSON_RATIO][itype] / ((1.0 + Lookup[POISSON_RATIO][itype]) * (1.0 - 2.0 * Lookup[POISSON_RATIO][itype])); @@ -1201,8 +1201,8 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[YIELD_STRESS][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[HARDENING_PARAMETER][itype] = force->numeric(FLERR, arg[ioffset + 2]); + Lookup[YIELD_STRESS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); if (comm->me == 0) { printf("%60s\n", "Linear elastic / perfectly plastic strength based on strain rate"); @@ -1245,14 +1245,14 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[JC_A][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[JC_B][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[JC_a][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[JC_C][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[JC_epdot0][itype] = force->numeric(FLERR, arg[ioffset + 5]); - Lookup[JC_T0][itype] = force->numeric(FLERR, arg[ioffset + 6]); - Lookup[JC_Tmelt][itype] = force->numeric(FLERR, arg[ioffset + 7]); - Lookup[JC_M][itype] = force->numeric(FLERR, arg[ioffset + 8]); + Lookup[JC_A][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[JC_B][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[JC_a][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[JC_C][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[JC_epdot0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[JC_T0][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[JC_Tmelt][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); + Lookup[JC_M][itype] = utils::numeric(FLERR, arg[ioffset + 8],false,lmp); if (comm->me == 0) { printf("%60s\n", "Johnson Cook material strength model"); @@ -1370,9 +1370,9 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_SHOCK_C0][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[EOS_SHOCK_S][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[EOS_SHOCK_GAMMA][itype] = force->numeric(FLERR, arg[ioffset + 3]); + Lookup[EOS_SHOCK_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_SHOCK_S][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_SHOCK_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "shock EOS based on strain rate"); printf("%60s : %g\n", "reference speed of sound", Lookup[EOS_SHOCK_C0][itype]); @@ -1411,13 +1411,13 @@ void PairTlsph::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_POLYNOMIAL_C0][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[EOS_POLYNOMIAL_C1][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[EOS_POLYNOMIAL_C2][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[EOS_POLYNOMIAL_C3][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[EOS_POLYNOMIAL_C4][itype] = force->numeric(FLERR, arg[ioffset + 5]); - Lookup[EOS_POLYNOMIAL_C5][itype] = force->numeric(FLERR, arg[ioffset + 6]); - Lookup[EOS_POLYNOMIAL_C6][itype] = force->numeric(FLERR, arg[ioffset + 7]); + Lookup[EOS_POLYNOMIAL_C0][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[EOS_POLYNOMIAL_C1][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[EOS_POLYNOMIAL_C2][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[EOS_POLYNOMIAL_C3][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[EOS_POLYNOMIAL_C4][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); + Lookup[EOS_POLYNOMIAL_C5][itype] = utils::numeric(FLERR, arg[ioffset + 6],false,lmp); + Lookup[EOS_POLYNOMIAL_C6][itype] = utils::numeric(FLERR, arg[ioffset + 7],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "polynomial EOS based on strain rate"); printf("%60s : %g\n", "parameter c0", Lookup[EOS_POLYNOMIAL_C0][itype]); @@ -1462,7 +1462,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_plastic_strain = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PLASTIC_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum plastic strain failure criterion"); @@ -1506,7 +1506,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_pairwise_strain = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PAIRWISE_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum pairwise strain failure criterion"); @@ -1546,7 +1546,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_principal_strain = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PRINCIPAL_STRAIN_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum principal strain failure criterion"); @@ -1583,11 +1583,11 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_johnson_cook = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_JC_D1][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[FAILURE_JC_D2][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[FAILURE_JC_D3][itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[FAILURE_JC_D4][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[FAILURE_JC_EPDOT0][itype] = force->numeric(FLERR, arg[ioffset + 5]); + Lookup[FAILURE_JC_D1][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[FAILURE_JC_D2][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[FAILURE_JC_D3][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[FAILURE_JC_D4][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[FAILURE_JC_EPDOT0][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "Johnson-Cook failure criterion"); @@ -1631,7 +1631,7 @@ void PairTlsph::coeff(int narg, char **arg) { failureModel[itype].failure_max_principal_stress = true; failureModel[itype].integration_point_wise = true; - Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[FAILURE_MAX_PRINCIPAL_STRESS_THRESHOLD][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "maximum principal stress failure criterion"); @@ -1666,7 +1666,7 @@ void PairTlsph::coeff(int narg, char **arg) { } failureModel[itype].failure_energy_release_rate = true; - Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[CRITICAL_ENERGY_RELEASE_RATE][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf("\n%60s\n", "critical energy release rate failure criterion"); @@ -1748,7 +1748,7 @@ void PairTlsph::init_style() { if (igroup == -1) error->all(FLERR, "Pair style tlsph requires its particles to be part of a group named tlsph. This group does not exist."); - if (fix_tlsph_reference_configuration == NULL) { + if (fix_tlsph_reference_configuration == nullptr) { char **fixarg = new char*[3]; fixarg[0] = (char *) "SMD_TLSPH_NEIGHBORS"; fixarg[1] = (char *) "tlsph"; @@ -1824,7 +1824,7 @@ void *PairTlsph::extract(const char *str, int &/*i*/) { return (void *) R; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SMD/pair_smd_triangulated_surface.cpp b/src/USER-SMD/pair_smd_triangulated_surface.cpp index 53a93df7f7..6e702ef825 100644 --- a/src/USER-SMD/pair_smd_triangulated_surface.cpp +++ b/src/USER-SMD/pair_smd_triangulated_surface.cpp @@ -27,9 +27,9 @@ ------------------------------------------------------------------------- */ #include "pair_smd_triangulated_surface.h" -#include + #include -#include + #include #include #include "atom.h" @@ -42,6 +42,7 @@ #include "memory.h" #include "error.h" + using namespace std; using namespace LAMMPS_NS; using namespace Eigen; @@ -53,9 +54,9 @@ using namespace Eigen; PairTriSurf::PairTriSurf(LAMMPS *lmp) : Pair(lmp) { - onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = NULL; - bulkmodulus = NULL; - kn = NULL; + onerad_dynamic = onerad_frozen = maxrad_dynamic = maxrad_frozen = nullptr; + bulkmodulus = nullptr; + kn = nullptr; scale = 1.0; } @@ -321,7 +322,7 @@ void PairTriSurf::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR, "Illegal number of args for pair_style smd/tri_surface"); - scale = force->numeric(FLERR, arg[0]); + scale = utils::numeric(FLERR, arg[0],false,lmp); if (comm->me == 0) { printf("\n>>========>>========>>========>>========>>========>>========>>========>>========\n"); printf("SMD/TRI_SURFACE CONTACT SETTINGS:\n"); @@ -342,8 +343,8 @@ void PairTriSurf::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1,atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1,atom->ntypes, jlo, jhi, error); double bulkmodulus_one = atof(arg[2]); @@ -832,6 +833,6 @@ void *PairTriSurf::extract(const char *str, int &/*i*/) { return (void *) &stable_time_increment; } - return NULL; + return nullptr; } diff --git a/src/USER-SMD/pair_smd_ulsph.cpp b/src/USER-SMD/pair_smd_ulsph.cpp index 8c8da7b2bc..bbb8cf3729 100644 --- a/src/USER-SMD/pair_smd_ulsph.cpp +++ b/src/USER-SMD/pair_smd_ulsph.cpp @@ -23,24 +23,22 @@ ------------------------------------------------------------------------- */ #include "pair_smd_ulsph.h" -#include -#include -#include -#include -#include + #include "atom.h" -#include "domain.h" -#include "force.h" -#include "update.h" #include "comm.h" -#include "neighbor.h" +#include "domain.h" +#include "error.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" +#include "neighbor.h" +#include "smd_kernels.h" #include "smd_material_models.h" #include "smd_math.h" -#include "smd_kernels.h" +#include "update.h" + +#include +#include using namespace SMD_Kernels; using namespace std; @@ -58,22 +56,22 @@ PairULSPH::PairULSPH(LAMMPS *lmp) : Pair(lmp) { // per-type arrays - Q1 = NULL; - eos = viscosity = strength = NULL; - c0_type = NULL; - c0 = NULL; - Lookup = NULL; - artificial_stress = NULL; - artificial_pressure = NULL; + Q1 = nullptr; + eos = viscosity = strength = nullptr; + c0_type = nullptr; + c0 = nullptr; + Lookup = nullptr; + artificial_stress = nullptr; + artificial_pressure = nullptr; nmax = 0; // make sure no atom on this proc such that initial memory allocation is correct - stressTensor = L = K = NULL; - shepardWeight = NULL; - smoothVel = NULL; - numNeighs = NULL; - F = NULL; - rho = NULL; - effm = NULL; + stressTensor = L = K = nullptr; + shepardWeight = nullptr; + smoothVel = nullptr; + numNeighs = nullptr; + F = nullptr; + rho = nullptr; + effm = nullptr; velocity_gradient_required = false; // turn off computation of velocity gradient by default density_summation = velocity_gradient = false; @@ -949,9 +947,9 @@ void PairULSPH::coeff(int narg, char **arg) { * if parameters are give in i,i form, i.e., no a cross interaction, set material parameters */ - if (force->inumeric(FLERR, arg[0]) == force->inumeric(FLERR, arg[1])) { + if (utils::inumeric(FLERR, arg[0], false, lmp) == utils::inumeric(FLERR, arg[1], false, lmp)) { - itype = force->inumeric(FLERR, arg[0]); + itype = utils::inumeric(FLERR, arg[0],false,lmp); eos[itype] = viscosity[itype] = strength[itype] = NONE; if (comm->me == 0) { @@ -992,11 +990,11 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[REFERENCE_DENSITY][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[REFERENCE_SOUNDSPEED][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Q1[itype] = force->numeric(FLERR, arg[ioffset + 3]); - Lookup[HEAT_CAPACITY][itype] = force->numeric(FLERR, arg[ioffset + 4]); - Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = force->numeric(FLERR, arg[ioffset + 5]); + Lookup[REFERENCE_DENSITY][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[REFERENCE_SOUNDSPEED][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Q1[itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); + Lookup[HEAT_CAPACITY][itype] = utils::numeric(FLERR, arg[ioffset + 4],false,lmp); + Lookup[HOURGLASS_CONTROL_AMPLITUDE][itype] = utils::numeric(FLERR, arg[ioffset + 5],false,lmp); Lookup[BULK_MODULUS][itype] = Lookup[REFERENCE_SOUNDSPEED][itype] * Lookup[REFERENCE_SOUNDSPEED][itype] * Lookup[REFERENCE_DENSITY][itype]; @@ -1057,7 +1055,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_TAIT_EXPONENT][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[EOS_TAIT_EXPONENT][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Tait EOS"); @@ -1094,7 +1092,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[EOS_PERFECT_GAS_GAMMA][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[EOS_PERFECT_GAS_GAMMA][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Perfect Gas EOS"); @@ -1168,9 +1166,9 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[SHEAR_MODULUS][itype] = force->numeric(FLERR, arg[ioffset + 1]); - Lookup[YIELD_STRENGTH][itype] = force->numeric(FLERR, arg[ioffset + 2]); - Lookup[HARDENING_PARAMETER][itype] = force->numeric(FLERR, arg[ioffset + 3]); + Lookup[SHEAR_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); + Lookup[YIELD_STRENGTH][itype] = utils::numeric(FLERR, arg[ioffset + 2],false,lmp); + Lookup[HARDENING_PARAMETER][itype] = utils::numeric(FLERR, arg[ioffset + 3],false,lmp); if (comm->me == 0) { printf(FORMAT2, "linear elastic / ideal plastic material mode"); @@ -1210,7 +1208,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[SHEAR_MODULUS][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[SHEAR_MODULUS][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "linear elastic strength model"); @@ -1248,7 +1246,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - Lookup[VISCOSITY_MU][itype] = force->numeric(FLERR, arg[ioffset + 1]); + Lookup[VISCOSITY_MU][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Newton viscosity model"); @@ -1282,7 +1280,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - artificial_pressure[itype][itype] = force->numeric(FLERR, arg[ioffset + 1]); + artificial_pressure[itype][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Artificial Pressure is enabled."); @@ -1316,7 +1314,7 @@ void PairULSPH::coeff(int narg, char **arg) { error->all(FLERR, str); } - artificial_stress[itype][itype] = force->numeric(FLERR, arg[ioffset + 1]); + artificial_stress[itype][itype] = utils::numeric(FLERR, arg[ioffset + 1],false,lmp); if (comm->me == 0) { printf(FORMAT2, "Artificial Stress is enabled."); @@ -1358,8 +1356,8 @@ void PairULSPH::coeff(int narg, char **arg) { * we are reading a cross-interaction line for particle types i, j */ - itype = force->inumeric(FLERR, arg[0]); - jtype = force->inumeric(FLERR, arg[1]); + itype = utils::inumeric(FLERR, arg[0],false,lmp); + jtype = utils::inumeric(FLERR, arg[1],false,lmp); if (strcmp(arg[2], "*CROSS") != 0) { sprintf(str, "ulsph cross interaction between particle type %d and %d requested, however, *CROSS keyword is missing", @@ -1577,7 +1575,7 @@ void *PairULSPH::extract(const char *str, int &/*i*/) { return (void *) K; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/USER-SMD/smd_material_models.cpp b/src/USER-SMD/smd_material_models.cpp index 096600df52..942b6a8cab 100644 --- a/src/USER-SMD/smd_material_models.cpp +++ b/src/USER-SMD/smd_material_models.cpp @@ -22,12 +22,13 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ #include "smd_material_models.h" + +#include "math_special.h" + #include #include -#include #include #include -#include "math_special.h" #include diff --git a/src/USER-SMTBQ/pair_smtbq.cpp b/src/USER-SMTBQ/pair_smtbq.cpp index fcf6d141f2..d84f302304 100644 --- a/src/USER-SMTBQ/pair_smtbq.cpp +++ b/src/USER-SMTBQ/pair_smtbq.cpp @@ -39,9 +39,9 @@ ------------------------------------------------------------------------- */ #include "pair_smtbq.h" -#include + #include -#include + #include #include #include @@ -101,50 +101,50 @@ PairSMTBQ::PairSMTBQ(LAMMPS *lmp) : Pair(lmp) kmax = 0; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - intparams = NULL; + params = nullptr; + intparams = nullptr; - intype = NULL; - coultype = NULL; - fafb = NULL; - dfafb = NULL; - potqn = NULL; - dpotqn = NULL; + intype = nullptr; + coultype = nullptr; + fafb = nullptr; + dfafb = nullptr; + potqn = nullptr; + dpotqn = nullptr; Vself = 0.0; - tabsmb = NULL; - tabsmr = NULL; - dtabsmb = NULL; - dtabsmr = NULL; + tabsmb = nullptr; + tabsmr = nullptr; + dtabsmb = nullptr; + dtabsmr = nullptr; - sbcov = NULL; - coord = NULL; - sbmet = NULL; - ecov = NULL; + sbcov = nullptr; + coord = nullptr; + sbmet = nullptr; + ecov = nullptr; - potmad = NULL; - potself = NULL; - potcov = NULL; - qf = NULL; - q1 = NULL; - q2 = NULL; - tab_comm = NULL; + potmad = nullptr; + potself = nullptr; + potcov = nullptr; + qf = nullptr; + q1 = nullptr; + q2 = nullptr; + tab_comm = nullptr; - nvsm = NULL; - vsm = NULL; - flag_QEq = NULL; - nQEqaall = NULL; - nQEqcall = NULL; - nQEqall = NULL; + nvsm = nullptr; + vsm = nullptr; + flag_QEq = nullptr; + nQEqaall = nullptr; + nQEqcall = nullptr; + nQEqall = nullptr; nteam = 0; cluster = 0; Nevery = 0.0; Neverypot = 0.0; - fct = NULL; + fct = nullptr; maxpage = 0; @@ -277,7 +277,7 @@ void PairSMTBQ::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -286,7 +286,7 @@ void PairSMTBQ::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -392,9 +392,9 @@ void PairSMTBQ::read_file(char *file) char **words; memory->sfree(params); - params = NULL; + params = nullptr; memory->sfree(intparams); - intparams = NULL; + intparams = nullptr; nparams = 0; maxparam = 0; maxintparam = 0; @@ -410,8 +410,8 @@ void PairSMTBQ::read_file(char *file) // open file on all processors FILE *fp; - fp = force->open_potential(file); - if ( fp == NULL ) { + fp = utils::open_potential(file,lmp,nullptr); + if ( fp == nullptr ) { char str[128]; snprintf(str,128,"Cannot open SMTBQ potential file %s",file); error->one(FLERR,str); @@ -3562,12 +3562,12 @@ int PairSMTBQ::Tokenize( char* s, char*** tok ) const char *sep = "' "; char *mot; int count=0; - mot = NULL; + mot = nullptr; strncpy( test, s, MAXLINE-1 ); - for( mot = strtok(test, sep); mot; mot = strtok(NULL, sep) ) { + for( mot = strtok(test, sep); mot; mot = strtok(nullptr, sep) ) { strncpy( (*tok)[count], mot, MAXLINE ); count++; } diff --git a/src/USER-SPH/atom_vec_sph.cpp b/src/USER-SPH/atom_vec_sph.cpp index 2811c57e6c..c653d6f7be 100644 --- a/src/USER-SPH/atom_vec_sph.cpp +++ b/src/USER-SPH/atom_vec_sph.cpp @@ -12,9 +12,10 @@ ------------------------------------------------------------------------- */ #include "atom_vec_sph.h" -#include + #include "atom.h" -#include "error.h" + +#include using namespace LAMMPS_NS; @@ -22,8 +23,8 @@ using namespace LAMMPS_NS; AtomVecSPH::AtomVecSPH(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; forceclearflag = 1; atom->esph_flag = 1; diff --git a/src/USER-SPH/compute_sph_e_atom.cpp b/src/USER-SPH/compute_sph_e_atom.cpp index 8869dae5f7..d8142fd790 100644 --- a/src/USER-SPH/compute_sph_e_atom.cpp +++ b/src/USER-SPH/compute_sph_e_atom.cpp @@ -36,7 +36,7 @@ ComputeSPHEAtom::ComputeSPHEAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - evector = NULL; + evector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/compute_sph_rho_atom.cpp b/src/USER-SPH/compute_sph_rho_atom.cpp index 1d6d03811c..edc788a1ab 100644 --- a/src/USER-SPH/compute_sph_rho_atom.cpp +++ b/src/USER-SPH/compute_sph_rho_atom.cpp @@ -35,7 +35,7 @@ ComputeSPHRhoAtom::ComputeSPHRhoAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - rhoVector = NULL; + rhoVector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/compute_sph_t_atom.cpp b/src/USER-SPH/compute_sph_t_atom.cpp index 063af70026..253e637485 100644 --- a/src/USER-SPH/compute_sph_t_atom.cpp +++ b/src/USER-SPH/compute_sph_t_atom.cpp @@ -36,7 +36,7 @@ ComputeSPHTAtom::ComputeSPHTAtom(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 0; nmax = 0; - tvector = NULL; + tvector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/USER-SPH/pair_sph_heatconduction.cpp b/src/USER-SPH/pair_sph_heatconduction.cpp index ebd2cef684..fb8c928f2d 100644 --- a/src/USER-SPH/pair_sph_heatconduction.cpp +++ b/src/USER-SPH/pair_sph_heatconduction.cpp @@ -20,6 +20,7 @@ #include "neigh_list.h" #include "domain.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -167,11 +168,11 @@ void PairSPHHeatConduction::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double alpha_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); + double alpha_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_idealgas.cpp b/src/USER-SPH/pair_sph_idealgas.cpp index 1f6b63e199..5480ff8e4c 100644 --- a/src/USER-SPH/pair_sph_idealgas.cpp +++ b/src/USER-SPH/pair_sph_idealgas.cpp @@ -20,6 +20,7 @@ #include "error.h" #include "domain.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -209,11 +210,11 @@ void PairSPHIdealGas::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double viscosity_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); + double viscosity_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_lj.cpp b/src/USER-SPH/pair_sph_lj.cpp index ae42c413e7..eb76d800c8 100644 --- a/src/USER-SPH/pair_sph_lj.cpp +++ b/src/USER-SPH/pair_sph_lj.cpp @@ -20,6 +20,7 @@ #include "error.h" #include "domain.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -217,11 +218,11 @@ void PairSPHLJ::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double viscosity_one = force->numeric(FLERR,arg[2]); - double cut_one = force->numeric(FLERR,arg[3]); + double viscosity_one = utils::numeric(FLERR,arg[2],false,lmp); + double cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_rhosum.cpp b/src/USER-SPH/pair_sph_rhosum.cpp index fa51dc3781..3d3065f839 100644 --- a/src/USER-SPH/pair_sph_rhosum.cpp +++ b/src/USER-SPH/pair_sph_rhosum.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "pair_sph_rhosum.h" + #include "atom.h" -#include "force.h" #include "comm.h" +#include "domain.h" +#include "error.h" +#include "memory.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" #include "neighbor.h" #include "update.h" -#include "domain.h" using namespace LAMMPS_NS; @@ -224,7 +224,7 @@ void PairSPHRhoSum::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR, "Illegal number of arguments for pair_style sph/rhosum"); - nstep = force->inumeric(FLERR,arg[0]); + nstep = utils::inumeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- @@ -238,10 +238,10 @@ void PairSPHRhoSum::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double cut_one = force->numeric(FLERR,arg[2]); + double cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/USER-SPH/pair_sph_taitwater.cpp b/src/USER-SPH/pair_sph_taitwater.cpp index 79d9ac7742..c0051201d0 100644 --- a/src/USER-SPH/pair_sph_taitwater.cpp +++ b/src/USER-SPH/pair_sph_taitwater.cpp @@ -21,6 +21,7 @@ #include "error.h" #include "domain.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -239,13 +240,13 @@ void PairSPHTaitwater::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double rho0_one = force->numeric(FLERR,arg[2]); - double soundspeed_one = force->numeric(FLERR,arg[3]); - double viscosity_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); + double rho0_one = utils::numeric(FLERR,arg[2],false,lmp); + double soundspeed_one = utils::numeric(FLERR,arg[3],false,lmp); + double viscosity_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); double B_one = soundspeed_one * soundspeed_one * rho0_one / 7.0; int count = 0; diff --git a/src/USER-SPH/pair_sph_taitwater_morris.cpp b/src/USER-SPH/pair_sph_taitwater_morris.cpp index 862d2a8053..497aea293b 100644 --- a/src/USER-SPH/pair_sph_taitwater_morris.cpp +++ b/src/USER-SPH/pair_sph_taitwater_morris.cpp @@ -21,6 +21,7 @@ #include "error.h" #include "domain.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ @@ -240,13 +241,13 @@ void PairSPHTaitwaterMorris::coeff(int narg, char **arg) { allocate(); int ilo, ihi, jlo, jhi; - force->bounds(FLERR,arg[0], atom->ntypes, ilo, ihi); - force->bounds(FLERR,arg[1], atom->ntypes, jlo, jhi); + utils::bounds(FLERR,arg[0], 1, atom->ntypes, ilo, ihi, error); + utils::bounds(FLERR,arg[1], 1, atom->ntypes, jlo, jhi, error); - double rho0_one = force->numeric(FLERR,arg[2]); - double soundspeed_one = force->numeric(FLERR,arg[3]); - double viscosity_one = force->numeric(FLERR,arg[4]); - double cut_one = force->numeric(FLERR,arg[5]); + double rho0_one = utils::numeric(FLERR,arg[2],false,lmp); + double soundspeed_one = utils::numeric(FLERR,arg[3],false,lmp); + double viscosity_one = utils::numeric(FLERR,arg[4],false,lmp); + double cut_one = utils::numeric(FLERR,arg[5],false,lmp); double B_one = soundspeed_one * soundspeed_one * rho0_one / 7.0; int count = 0; diff --git a/src/USER-TALLY/README b/src/USER-TALLY/README index 8cb9bcdd6b..afdf638154 100644 --- a/src/USER-TALLY/README +++ b/src/USER-TALLY/README @@ -22,6 +22,5 @@ at Temple University with a little help and inspiration from Loris Ercole (SISSA/ISAS Trieste), who contributed compute heat/flux/tally. Additional contributed compute styles for this package are welcome. -Please contact Axel, if you have questions about the implementation. diff --git a/src/USER-TALLY/compute_force_tally.cpp b/src/USER-TALLY/compute_force_tally.cpp index 9d15fbc441..a5ad46e77b 100644 --- a/src/USER-TALLY/compute_force_tally.cpp +++ b/src/USER-TALLY/compute_force_tally.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_force_tally.h" -#include + #include #include "atom.h" #include "group.h" @@ -49,7 +49,7 @@ ComputeForceTally::ComputeForceTally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - fatom = NULL; + fatom = nullptr; vector = new double[size_peratom_cols]; } @@ -66,7 +66,7 @@ ComputeForceTally::~ComputeForceTally() void ComputeForceTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute force/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_heat_flux_tally.cpp b/src/USER-TALLY/compute_heat_flux_tally.cpp index 350bc4b4b6..f57899c593 100644 --- a/src/USER-TALLY/compute_heat_flux_tally.cpp +++ b/src/USER-TALLY/compute_heat_flux_tally.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_heat_flux_tally.h" -#include + #include "atom.h" #include "group.h" #include "pair.h" @@ -48,8 +48,8 @@ ComputeHeatFluxTally::ComputeHeatFluxTally(LAMMPS *lmp, int narg, char **arg) : did_setup = 0; invoked_peratom = invoked_scalar = -1; nmax = -1; - stress = NULL; - eatom = NULL; + stress = nullptr; + eatom = nullptr; vector = new double[size_vector]; heatj = new double[size_vector]; } @@ -69,7 +69,7 @@ ComputeHeatFluxTally::~ComputeHeatFluxTally() void ComputeHeatFluxTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute heat/flux/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_pe_mol_tally.cpp b/src/USER-TALLY/compute_pe_mol_tally.cpp index ce647a04c3..77bf7973da 100644 --- a/src/USER-TALLY/compute_pe_mol_tally.cpp +++ b/src/USER-TALLY/compute_pe_mol_tally.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_pe_mol_tally.h" -#include + #include "atom.h" #include "group.h" #include "pair.h" @@ -59,7 +59,7 @@ ComputePEMolTally::~ComputePEMolTally() void ComputePEMolTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute pe/mol/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_pe_tally.cpp b/src/USER-TALLY/compute_pe_tally.cpp index edfa49b1b1..e330b56a80 100644 --- a/src/USER-TALLY/compute_pe_tally.cpp +++ b/src/USER-TALLY/compute_pe_tally.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_pe_tally.h" -#include + #include "atom.h" #include "group.h" #include "pair.h" @@ -48,7 +48,7 @@ ComputePETally::ComputePETally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - eatom = NULL; + eatom = nullptr; vector = new double[size_peratom_cols]; } @@ -65,7 +65,7 @@ ComputePETally::~ComputePETally() void ComputePETally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute pe/tally without a pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-TALLY/compute_stress_tally.cpp b/src/USER-TALLY/compute_stress_tally.cpp index 1ea096e286..58d42cd93d 100644 --- a/src/USER-TALLY/compute_stress_tally.cpp +++ b/src/USER-TALLY/compute_stress_tally.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_stress_tally.h" -#include + #include "atom.h" #include "group.h" #include "pair.h" @@ -49,7 +49,7 @@ ComputeStressTally::ComputeStressTally(LAMMPS *lmp, int narg, char **arg) : did_setup = invoked_peratom = invoked_scalar = -1; nmax = -1; - stress = NULL; + stress = nullptr; vector = new double[size_peratom_cols]; virial = new double[size_peratom_cols]; } @@ -68,7 +68,7 @@ ComputeStressTally::~ComputeStressTally() void ComputeStressTally::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Trying to use compute stress/tally without pair style"); else force->pair->add_tally_callback(this); diff --git a/src/USER-UEF/compute_pressure_uef.cpp b/src/USER-UEF/compute_pressure_uef.cpp index adb9970c12..e0c5f667a7 100644 --- a/src/USER-UEF/compute_pressure_uef.cpp +++ b/src/USER-UEF/compute_pressure_uef.cpp @@ -78,7 +78,7 @@ double ComputePressureUef::compute_scalar() addstep(update->ntimestep+1); int k =0; - scalar = 0; + scalar = 0.0; if (ext_flags[0]) { scalar += vector[0]; k++; @@ -92,7 +92,7 @@ double ComputePressureUef::compute_scalar() k++; } - scalar /= k; + if (k > 1) scalar /= k; return scalar; } diff --git a/src/USER-UEF/fix_nh_uef.cpp b/src/USER-UEF/fix_nh_uef.cpp index 80866bbd56..e833502952 100644 --- a/src/USER-UEF/fix_nh_uef.cpp +++ b/src/USER-UEF/fix_nh_uef.cpp @@ -57,7 +57,7 @@ static const char cite_user_uef_package[] = * temp/pressure fixes ---------------------------------------------------------------------- */ FixNHUef::FixNHUef(LAMMPS *lmp, int narg, char **arg) : - FixNH(lmp, narg, arg), uefbox(NULL) + FixNH(lmp, narg, arg), uefbox(nullptr) { if (lmp->citeme) lmp->citeme->add(cite_user_uef_package); @@ -82,14 +82,14 @@ FixNHUef::FixNHUef(LAMMPS *lmp, int narg, char **arg) : while (iarg narg) error->all(FLERR,"Illegal fix nvt/npt/uef command"); - erate[0] = force->numeric(FLERR,arg[iarg+1]); - erate[1] = force->numeric(FLERR,arg[iarg+2]); + erate[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + erate[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); erate_flag = true; iarg += 3; } else if (strcmp(arg[iarg],"strain")==0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix nvt/npt/uef command"); - strain[0] = force->numeric(FLERR,arg[iarg+1]); - strain[1] = force->numeric(FLERR,arg[iarg+2]); + strain[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + strain[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"ext")==0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/uef command"); diff --git a/src/USER-VTK/dump_vtk.cpp b/src/USER-VTK/dump_vtk.cpp index 7f1443c654..1e0f520dc8 100644 --- a/src/USER-VTK/dump_vtk.cpp +++ b/src/USER-VTK/dump_vtk.cpp @@ -23,7 +23,7 @@ ------------------------------------------------------------------------- */ #include -#include + #include #include "dump_vtk.h" #include "atom.h" @@ -128,11 +128,11 @@ DumpVTK::DumpVTK(LAMMPS *lmp, int narg, char **arg) : if (filewriter) reset_vtk_data_containers(); - label = NULL; + label = nullptr; { // parallel vtp/vtu requires proc number to be preceded by underscore '_' - multiname_ex = NULL; + multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { multiname_ex = new char[strlen(filename) + 16]; @@ -160,12 +160,12 @@ DumpVTK::DumpVTK(LAMMPS *lmp, int narg, char **arg) : nclusterprocs = nprocs; } - filecurrent = NULL; - domainfilecurrent = NULL; - parallelfilecurrent = NULL; - header_choice = NULL; - write_choice = NULL; - boxcorners = NULL; + filecurrent = nullptr; + domainfilecurrent = nullptr; + parallelfilecurrent = nullptr; + header_choice = nullptr; + write_choice = nullptr; + boxcorners = nullptr; } /* ---------------------------------------------------------------------- */ @@ -185,7 +185,7 @@ void DumpVTK::init_style() { // default for element names = C - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[2]; @@ -880,7 +880,7 @@ void DumpVTK::write() // sort buf as needed if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // filewriter = 1 = this proc writes to file @@ -939,13 +939,13 @@ void DumpVTK::write_data(int n, double *mybuf) void DumpVTK::setFileCurrent() { delete [] filecurrent; - filecurrent = NULL; + filecurrent = nullptr; char *filestar = filename; if (multiproc) { if (multiproc > 1) { // if dump_modify fileper or nfile was used delete [] multiname_ex; - multiname_ex = NULL; + multiname_ex = nullptr; char *ptr = strchr(filename,'%'); if (ptr) { int id; @@ -983,7 +983,7 @@ void DumpVTK::setFileCurrent() { // filename of domain box data file delete [] domainfilecurrent; - domainfilecurrent = NULL; + domainfilecurrent = nullptr; if (multiproc) { // remove '%' character char *ptr = strchr(filename,'%'); @@ -997,7 +997,7 @@ void DumpVTK::setFileCurrent() { *ptr = '\0'; sprintf(filestar,"%s_boundingBox.%s",domainfilecurrent,ptr+1); delete [] domainfilecurrent; - domainfilecurrent = NULL; + domainfilecurrent = nullptr; if (multifile == 0) { domainfilecurrent = new char[strlen(filestar) + 1]; @@ -1018,7 +1018,7 @@ void DumpVTK::setFileCurrent() { *ptr = '*'; } delete [] filestar; - filestar = NULL; + filestar = nullptr; } else { domainfilecurrent = new char[strlen(filecurrent) + 16]; char *ptr = strrchr(filecurrent,'.'); @@ -1030,7 +1030,7 @@ void DumpVTK::setFileCurrent() { // filename of parallel file if (multiproc && me == 0) { delete [] parallelfilecurrent; - parallelfilecurrent = NULL; + parallelfilecurrent = nullptr; // remove '%' character and add 'p' to file extension // -> string length stays the same @@ -1066,7 +1066,7 @@ void DumpVTK::setFileCurrent() { *ptr = '*'; } delete [] filestar; - filestar = NULL; + filestar = nullptr; } } @@ -1995,7 +1995,7 @@ int DumpVTK::add_variable(char *id) variable = new int[nvariable+1]; delete [] vbuf; vbuf = new double*[nvariable+1]; - for (int i = 0; i <= nvariable; i++) vbuf[i] = NULL; + for (int i = 0; i <= nvariable; i++) vbuf[i] = nullptr; int n = strlen(id) + 1; id_variable[nvariable] = new char[n]; @@ -2075,7 +2075,7 @@ int DumpVTK::modify_param(int narg, char **arg) if (typenames) { for (int i = 1; i <= ntypes; i++) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; @@ -2094,9 +2094,9 @@ int DumpVTK::modify_param(int narg, char **arg) memory->destroy(thresh_array); memory->destroy(thresh_op); memory->destroy(thresh_value); - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; } nthresh = 0; return 2; @@ -2296,7 +2296,7 @@ int DumpVTK::modify_param(int narg, char **arg) // set threshold value - thresh_value[nthresh] = force->numeric(FLERR,arg[3]); + thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp); nthresh++; return 4; @@ -2309,9 +2309,9 @@ int DumpVTK::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf, choose, variable arrays ------------------------------------------------------------------------- */ -bigint DumpVTK::memory_usage() +double DumpVTK::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(choose,maxlocal); bytes += memory->usage(dchoose,maxlocal); bytes += memory->usage(clist,maxlocal); diff --git a/src/USER-VTK/dump_vtk.h b/src/USER-VTK/dump_vtk.h index e8de87f11c..28fcca78d6 100644 --- a/src/USER-VTK/dump_vtk.h +++ b/src/USER-VTK/dump_vtk.h @@ -27,7 +27,7 @@ DumpStyle(vtk,DumpVTK) #include "dump_custom.h" #include #include -#include + #include #include @@ -77,7 +77,7 @@ class DumpVTK : public DumpCustom { int count(); void pack(tagint *); virtual void write_data(int, double *); - bigint memory_usage(); + double memory_usage(); int parse_fields(int, char **); void identify_vectors(); diff --git a/src/USER-YAFF/angle_cross.cpp b/src/USER-YAFF/angle_cross.cpp index 3d5715c23e..69dac7f58b 100644 --- a/src/USER-YAFF/angle_cross.cpp +++ b/src/USER-YAFF/angle_cross.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_cross.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -223,16 +223,16 @@ void AngleCross::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); int count = 0; - double kss_one = force->numeric(FLERR,arg[1]); - double kbs0_one = force->numeric(FLERR,arg[2]); - double kbs1_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); - double r1_one = force->numeric(FLERR,arg[5]); - double theta0_one = force->numeric(FLERR,arg[6]); + double kss_one = utils::numeric(FLERR,arg[1],false,lmp); + double kbs0_one = utils::numeric(FLERR,arg[2],false,lmp); + double kbs1_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); + double r1_one = utils::numeric(FLERR,arg[5],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[6],false,lmp); for (int i = ilo; i <= ihi; i++) { kss[i] = kss_one; @@ -279,12 +279,12 @@ void AngleCross::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&kss[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kbs0[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&kbs1[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r00[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&r01[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&kss[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kbs0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&kbs1[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r00[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&r01[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&kss[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/angle_mm3.cpp b/src/USER-YAFF/angle_mm3.cpp index cb3010e97c..d165a2d17c 100644 --- a/src/USER-YAFF/angle_mm3.cpp +++ b/src/USER-YAFF/angle_mm3.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "angle_mm3.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -180,12 +180,12 @@ void AngleMM3::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); int count = 0; - double k2_one = force->numeric(FLERR,arg[1]); - double theta0_one = force->numeric(FLERR,arg[2]); + double k2_one = utils::numeric(FLERR,arg[1],false,lmp); + double theta0_one = utils::numeric(FLERR,arg[2],false,lmp); // convert theta0 from degrees to radians @@ -226,8 +226,8 @@ void AngleMM3::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,NULL,error); - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nangletypes,fp,nullptr,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/bond_mm3.cpp b/src/USER-YAFF/bond_mm3.cpp index 8001e35d74..2c310c6310 100644 --- a/src/USER-YAFF/bond_mm3.cpp +++ b/src/USER-YAFF/bond_mm3.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "bond_mm3.h" -#include + #include #include "atom.h" #include "neighbor.h" @@ -24,7 +24,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -135,10 +135,10 @@ void BondMM3::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); - double k2_one = force->numeric(FLERR,arg[1]); - double r0_one = force->numeric(FLERR,arg[2]); + double k2_one = utils::numeric(FLERR,arg[1],false,lmp); + double r0_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -179,8 +179,8 @@ void BondMM3::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,NULL,error); - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&k2[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&k2[1],atom->nbondtypes,MPI_DOUBLE,0,world); MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/improper_distharm.cpp b/src/USER-YAFF/improper_distharm.cpp index 751e6e19c2..757695c3c8 100644 --- a/src/USER-YAFF/improper_distharm.cpp +++ b/src/USER-YAFF/improper_distharm.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "improper_distharm.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -219,10 +219,10 @@ void ImproperDistHarm::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians @@ -257,8 +257,8 @@ void ImproperDistHarm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/improper_sqdistharm.cpp b/src/USER-YAFF/improper_sqdistharm.cpp index 82bf4a1755..79245d3413 100644 --- a/src/USER-YAFF/improper_sqdistharm.cpp +++ b/src/USER-YAFF/improper_sqdistharm.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "improper_sqdistharm.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -219,10 +219,10 @@ void ImproperSQDistHarm::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); - double k_one = force->numeric(FLERR,arg[1]); - double chi_one = force->numeric(FLERR,arg[2]); + double k_one = utils::numeric(FLERR,arg[1],false,lmp); + double chi_one = utils::numeric(FLERR,arg[2],false,lmp); // convert chi from degrees to radians @@ -257,8 +257,8 @@ void ImproperSQDistHarm::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); - utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,NULL,error); + utils::sfread(FLERR,&k[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); + utils::sfread(FLERR,&chi[1],sizeof(double),atom->nimpropertypes,fp,nullptr,error); } MPI_Bcast(&k[1],atom->nimpropertypes,MPI_DOUBLE,0,world); MPI_Bcast(&chi[1],atom->nimpropertypes,MPI_DOUBLE,0,world); diff --git a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp index 37fc143e8b..5508ffbfdc 100644 --- a/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_lj_switch3_coulgauss_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_switch3_coulgauss_long.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -51,7 +51,7 @@ PairLJSwitch3CoulGaussLong::PairLJSwitch3CoulGaussLong(LAMMPS *lmp) : Pair(lmp) ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -267,14 +267,14 @@ void PairLJSwitch3CoulGaussLong::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 2) { cut_coul = cut_lj_global; - truncw = force->numeric(FLERR,arg[1]); + truncw = utils::numeric(FLERR,arg[1],false,lmp); } else { - cut_coul = force->numeric(FLERR,arg[1]); - truncw = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); + truncw = utils::numeric(FLERR,arg[2],false,lmp); } if (truncw>0.0) truncwi = 1.0/truncw; else truncwi = 0.0; @@ -299,15 +299,15 @@ void PairLJSwitch3CoulGaussLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double gamma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -358,11 +358,11 @@ void PairLJSwitch3CoulGaussLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -521,14 +521,14 @@ void PairLJSwitch3CoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -561,14 +561,14 @@ void PairLJSwitch3CoulGaussLong::write_restart_settings(FILE *fp) void PairLJSwitch3CoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&truncw,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&truncw,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -705,5 +705,5 @@ void *PairLJSwitch3CoulGaussLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamma") == 0) return (void *) gamma; - return NULL; + return nullptr; } diff --git a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp index 6b0466cd6d..d63f42cf3a 100644 --- a/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp +++ b/src/USER-YAFF/pair_mm3_switch3_coulgauss_long.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_mm3_switch3_coulgauss_long.h" -#include + #include #include #include "atom.h" @@ -31,7 +31,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -51,7 +51,7 @@ PairMM3Switch3CoulGaussLong::PairMM3Switch3CoulGaussLong(LAMMPS *lmp) : Pair(lmp ewaldflag = pppmflag = 1; respa_enable = 1; writedata = 1; - ftable = NULL; + ftable = nullptr; qdist = 0.0; } @@ -269,14 +269,14 @@ void PairMM3Switch3CoulGaussLong::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 2) { cut_coul = cut_lj_global; - truncw = force->numeric(FLERR,arg[1]); + truncw = utils::numeric(FLERR,arg[1],false,lmp); } else { - cut_coul = force->numeric(FLERR,arg[1]); - truncw = force->numeric(FLERR,arg[2]); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); + truncw = utils::numeric(FLERR,arg[2],false,lmp); } if (truncw>0.0) truncwi = 1.0/truncw; else truncwi = 0.0; @@ -301,15 +301,15 @@ void PairMM3Switch3CoulGaussLong::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double gamma_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 6) cut_lj_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -360,11 +360,11 @@ void PairMM3Switch3CoulGaussLong::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; // insure use of KSpace long-range solver, set g_ewald - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; @@ -521,14 +521,14 @@ void PairMM3Switch3CoulGaussLong::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -561,14 +561,14 @@ void PairMM3Switch3CoulGaussLong::write_restart_settings(FILE *fp) void PairMM3Switch3CoulGaussLong::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&truncw,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&truncw,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ncoultablebits,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tabinner,sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -705,5 +705,5 @@ void *PairMM3Switch3CoulGaussLong::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamma") == 0) return (void *) gamma; - return NULL; + return nullptr; } diff --git a/src/VORONOI/compute_voronoi_atom.cpp b/src/VORONOI/compute_voronoi_atom.cpp index 4be3ad7e76..1d7d4b8149 100644 --- a/src/VORONOI/compute_voronoi_atom.cpp +++ b/src/VORONOI/compute_voronoi_atom.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_voronoi_atom.h" -#include + #include #include #include @@ -41,10 +41,10 @@ using namespace voro; /* ---------------------------------------------------------------------- */ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : - Compute(lmp, narg, arg), con_mono(NULL), con_poly(NULL), - radstr(NULL), voro(NULL), edge(NULL), sendvector(NULL), - rfield(NULL), tags(NULL), occvec(NULL), sendocc(NULL), - lroot(NULL), lnext(NULL), faces(NULL) + Compute(lmp, narg, arg), con_mono(nullptr), con_poly(nullptr), + radstr(nullptr), voro(nullptr), edge(nullptr), sendvector(nullptr), + rfield(nullptr), tags(nullptr), occvec(nullptr), sendocc(nullptr), + lroot(nullptr), lnext(nullptr), faces(nullptr) { int sgroup; @@ -56,16 +56,16 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : surface = VOROSURF_NONE; maxedge = 0; fthresh = ethresh = 0.0; - radstr = NULL; + radstr = nullptr; onlyGroup = false; occupation = false; - con_mono = NULL; - con_poly = NULL; - tags = NULL; + con_mono = nullptr; + con_poly = nullptr; + tags = nullptr; oldmaxtag = 0; - occvec = sendocc = lroot = lnext = NULL; - faces = NULL; + occvec = sendocc = lroot = lnext = nullptr; + faces = nullptr; int iarg = 3; while ( iarg narg) error->all(FLERR,"Illegal compute voronoi/atom command"); - maxedge = force->inumeric(FLERR,arg[iarg+1]); + maxedge = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "face_threshold") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); - fthresh = force->numeric(FLERR,arg[iarg+1]); + fthresh = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "edge_threshold") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); - ethresh = force->numeric(FLERR,arg[iarg+1]); + ethresh = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg], "neighbors") == 0) { if (iarg + 2 > narg) error->all(FLERR,"Illegal compute voronoi/atom command"); @@ -129,12 +129,12 @@ ComputeVoronoi::ComputeVoronoi(LAMMPS *lmp, int narg, char **arg) : if (occupation && ( surface!=VOROSURF_NONE || maxedge>0 ) ) error->all(FLERR,"Illegal compute voronoi/atom command (occupation and (surface or edges))"); - if (occupation && (atom->map_style == 0)) + if (occupation && (atom->map_style == Atom::MAP_NONE)) error->all(FLERR,"Compute voronoi/atom occupation requires an atom map, see atom_modify"); nmax = rmax = 0; - edge = rfield = sendvector = NULL; - voro = NULL; + edge = rfield = sendvector = nullptr; + voro = nullptr; if ( maxedge > 0 ) { vector_flag = 1; @@ -207,7 +207,7 @@ void ComputeVoronoi::compute_peratom() if (occupation) { // build cells only once int i, nall = atom->nlocal + atom->nghost; - if (con_mono==NULL && con_poly==NULL) { + if (con_mono==nullptr && con_poly==nullptr) { // generate the voronoi cell network for the initial structure buildCells(); @@ -218,7 +218,7 @@ void ComputeVoronoi::compute_peratom() // linked list structure for cell occupation count on the atoms oldnall= nall; memory->create(lroot,nall,"voronoi/atom:lroot"); // point to first atom index in cell (or -1 for empty cell) - lnext = NULL; + lnext = nullptr; lmax = 0; // build the occupation buffer. @@ -543,10 +543,10 @@ void ComputeVoronoi::processCell(voronoicell_neighbor &c, int i) c.vertices(vcell); c.face_vertices(vlist); // for each face: vertex count followed list of vertex indices (n_1,v1_1,v2_1,v3_1,..,vn_1,n_2,v2_1,...) double dx, dy, dz, r2, t2 = ethresh*ethresh; - for( j=0; j #include "angle_hybrid.h" #include "comm.h" #include "force.h" #include "error.h" -#include "utils.h" using namespace LAMMPS_NS; diff --git a/src/angle_hybrid.cpp b/src/angle_hybrid.cpp index 882749b6b2..70779aa7b2 100644 --- a/src/angle_hybrid.cpp +++ b/src/angle_hybrid.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "angle_hybrid.h" -#include -#include -#include + #include "atom.h" #include "neighbor.h" #include "comm.h" #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + +#include +#include using namespace LAMMPS_NS; @@ -174,7 +174,7 @@ void AngleHybrid::allocate() maxangle = new int[nstyles]; anglelist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxangle[m] = 0; - for (int m = 0; m < nstyles; m++) anglelist[m] = NULL; + for (int m = 0; m < nstyles; m++) anglelist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -267,7 +267,7 @@ void AngleHybrid::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); // 2nd arg = angle sub-style name // allow for "none" or "skip" as valid sub-style name @@ -358,7 +358,7 @@ void AngleHybrid::write_restart(FILE *fp) void AngleHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Angle*[nstyles]; keywords = new char*[nstyles]; @@ -367,10 +367,10 @@ void AngleHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_angle(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/angle_zero.cpp b/src/angle_zero.cpp index 5da8e9d5bc..9d8255e84c 100644 --- a/src/angle_zero.cpp +++ b/src/angle_zero.cpp @@ -16,15 +16,14 @@ ------------------------------------------------------------------------- */ #include "angle_zero.h" -#include -#include + #include "atom.h" -#include "force.h" #include "comm.h" #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -87,11 +86,11 @@ void AngleZero::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nangletypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nangletypes,ilo,ihi,error); double theta0_one = 0.0; if (coeffflag && (narg == 2)) - theta0_one = force->numeric(FLERR,arg[1]); + theta0_one = utils::numeric(FLERR,arg[1],false,lmp); // convert theta0 from degrees to radians @@ -129,7 +128,7 @@ void AngleZero::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,NULL,error); + utils::sfread(FLERR,&theta0[1],sizeof(double),atom->nangletypes,fp,nullptr,error); } MPI_Bcast(&theta0[1],atom->nangletypes,MPI_DOUBLE,0,world); diff --git a/src/atom.cpp b/src/atom.cpp index e930a0255e..fbf7a067a9 100644 --- a/src/atom.cpp +++ b/src/atom.cpp @@ -12,31 +12,29 @@ ------------------------------------------------------------------------- */ #include "atom.h" -#include -#include -#include -#include -#include -#include -#include "style_atom.h" #include "atom_vec.h" -#include "atom_vec_ellipsoid.h" +#include "style_atom.h" // IWYU pragma: keep + #include "comm.h" -#include "neighbor.h" -#include "force.h" -#include "modify.h" -#include "fix.h" #include "compute.h" -#include "update.h" #include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" #include "group.h" #include "input.h" -#include "variable.h" -#include "molecule.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "modify.h" +#include "molecule.h" +#include "neighbor.h" +#include "update.h" +#include "variable.h" + +#include "library.h" + +#include +#include #ifdef LMP_USER_INTEL #include "neigh_request.h" @@ -51,6 +49,33 @@ using namespace MathConst; /* ---------------------------------------------------------------------- */ +/** \class LAMMPS_NS::Atom + * \brief Class to provide access to atom data + +\verbatim embed:rst +The Atom class provides access to atom style related global settings and +per-atom data that is stored with atoms and migrates with them from +sub-domain to sub-domain as atoms move around. This includes topology +data, which is stored with either one specific atom or all atoms involved +depending on the settings of the :doc:`newton command `. + +The actual per-atom data is allocated and managed by one of the various +classes derived from the AtomVec class as determined by +the :doc:`atom_style command `. The pointers in the Atom class +are updated by the AtomVec class as needed. +\endverbatim + */ + +/** Atom class constructor + * + * This resets and initialized all kinds of settings, + * parameters, and pointer variables for per-atom arrays. + * This also initializes the factory for creating + * instances of classes derived from the AtomVec base + * class, which correspond to the selected atom style. + * + * \param lmp pointer to the base LAMMPS class */ + Atom::Atom(LAMMPS *lmp) : Pointers(lmp) { natoms = 0; @@ -60,113 +85,113 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; nbonds = nangles = ndihedrals = nimpropers = 0; - firstgroupname = NULL; + firstgroupname = nullptr; sortfreq = 1000; nextsort = 0; userbinsize = 0.0; maxbin = maxnext = 0; - binhead = NULL; - next = permute = NULL; + binhead = nullptr; + next = permute = nullptr; // data structure with info on per-atom vectors/arrays nperatom = maxperatom = 0; - peratom = NULL; + peratom = nullptr; // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variables - tag = NULL; - type = mask = NULL; - image = NULL; - x = v = f = NULL; + tag = nullptr; + type = mask = nullptr; + image = nullptr; + x = v = f = nullptr; // charged and dipolar particles - q = NULL; - mu = NULL; + q = nullptr; + mu = nullptr; // finite-size particles - omega = angmom = torque = NULL; - radius = rmass = NULL; - ellipsoid = line = tri = body = NULL; + omega = angmom = torque = nullptr; + radius = rmass = nullptr; + ellipsoid = line = tri = body = nullptr; // molecular systems - molecule = NULL; - molindex = molatom = NULL; + molecule = nullptr; + molindex = molatom = nullptr; bond_per_atom = extra_bond_per_atom = 0; - num_bond = NULL; - bond_type = NULL; - bond_atom = NULL; + num_bond = nullptr; + bond_type = nullptr; + bond_atom = nullptr; angle_per_atom = extra_angle_per_atom = 0; - num_angle = NULL; - angle_type = NULL; - angle_atom1 = angle_atom2 = angle_atom3 = NULL; + num_angle = nullptr; + angle_type = nullptr; + angle_atom1 = angle_atom2 = angle_atom3 = nullptr; dihedral_per_atom = extra_dihedral_per_atom = 0; - num_dihedral = NULL; - dihedral_type = NULL; - dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL; + num_dihedral = nullptr; + dihedral_type = nullptr; + dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = nullptr; improper_per_atom = extra_improper_per_atom = 0; - num_improper = NULL; - improper_type = NULL; - improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL; + num_improper = nullptr; + improper_type = nullptr; + improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = nullptr; maxspecial = 1; - nspecial = NULL; - special = NULL; + nspecial = nullptr; + special = nullptr; // PERI package - vfrac = s0 = NULL; - x0 = NULL; + vfrac = s0 = nullptr; + x0 = nullptr; // SPIN package - sp = fm = fm_long = NULL; + sp = fm = fm_long = nullptr; // USER-EFF and USER-AWPMD packages - spin = NULL; - eradius = ervel = erforce = NULL; - ervelforce = NULL; - cs = csforce = vforce = NULL; - etag = NULL; + spin = nullptr; + eradius = ervel = erforce = nullptr; + ervelforce = nullptr; + cs = csforce = vforce = nullptr; + etag = nullptr; // USER-DPD package - uCond = uMech = uChem = uCG = uCGnew = NULL; - duChem = dpdTheta = NULL; + uCond = uMech = uChem = uCG = uCGnew = nullptr; + duChem = dpdTheta = nullptr; // USER-MESO package - cc = cc_flux = NULL; - edpd_temp = edpd_flux = edpd_cv = NULL; + cc = cc_flux = nullptr; + edpd_temp = edpd_flux = edpd_cv = nullptr; // USER-MESONT package - length = NULL; - buckling = NULL; - bond_nt = NULL; + length = nullptr; + buckling = nullptr; + bond_nt = nullptr; // USER-SMD package - contact_radius = NULL; - smd_data_9 = NULL; - smd_stress = NULL; - eff_plastic_strain = NULL; - eff_plastic_strain_rate = NULL; - damage = NULL; + contact_radius = nullptr; + smd_data_9 = nullptr; + smd_stress = nullptr; + eff_plastic_strain = nullptr; + eff_plastic_strain_rate = nullptr; + damage = nullptr; // USER-SPH package - rho = drho = esph = desph = cv = NULL; - vest = NULL; + rho = drho = esph = desph = cv = nullptr; + vest = nullptr; // end of customization section // -------------------------------------------------------------------- @@ -174,14 +199,14 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // user-defined molecules nmolecule = 0; - molecules = NULL; + molecules = nullptr; // custom atom arrays nivector = ndvector = 0; - ivector = NULL; - dvector = NULL; - iname = dname = NULL; + ivector = nullptr; + dvector = nullptr; + iname = dname = nullptr; // initialize atom style and array existence flags @@ -193,34 +218,34 @@ Atom::Atom(LAMMPS *lmp) : Pointers(lmp) // ntype-length arrays - mass = NULL; - mass_setflag = NULL; + mass = nullptr; + mass_setflag = nullptr; // callback lists & extra restart info nextra_grow = nextra_restart = nextra_border = 0; - extra_grow = extra_restart = extra_border = NULL; + extra_grow = extra_restart = extra_border = nullptr; nextra_grow_max = nextra_restart_max = nextra_border_max = 0; nextra_store = 0; - extra = NULL; + extra = nullptr; // default atom ID and mapping values tag_enable = 1; - map_style = map_user = 0; + map_style = map_user = MAP_NONE; map_tag_max = -1; map_maxarray = map_nhash = map_nbucket = -1; max_same = 0; - sametag = NULL; - map_array = NULL; - map_bucket = NULL; - map_hash = NULL; + sametag = nullptr; + map_array = nullptr; + map_bucket = nullptr; + map_hash = nullptr; unique_tags = nullptr; - atom_style = NULL; - avec = NULL; + atom_style = nullptr; + avec = nullptr; avec_map = new AtomVecCreatorMap(); @@ -265,7 +290,7 @@ Atom::~Atom() delete [] iname[i]; memory->destroy(ivector[i]); } - if (dvector != NULL) { + if (dvector != nullptr) { for (int i = 0; i < ndvector; i++) { delete [] dname[i]; memory->destroy(dvector[i]); @@ -329,7 +354,7 @@ void Atom::peratom_create() delete [] peratom[i].name; memory->sfree(peratom); - peratom = NULL; + peratom = nullptr; nperatom = maxperatom = 0; // -------------------------------------------------------------------- @@ -510,7 +535,7 @@ void Atom::add_peratom(const char *name, void *address, peratom[nperatom].datatype = datatype; peratom[nperatom].cols = cols; peratom[nperatom].threadflag = threadflag; - peratom[nperatom].address_length = NULL; + peratom[nperatom].address_length = nullptr; nperatom++; } @@ -606,8 +631,8 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu { delete [] atom_style; if (avec) delete avec; - atom_style = NULL; - avec = NULL; + atom_style = nullptr; + avec = nullptr; // unset atom style and array existence flags // may have been set by old avec @@ -643,7 +668,7 @@ void Atom::create_avec(const std::string &style, int narg, char **arg, int trysu molecular = avec->molecular; if (molecular && tag_enable == 0) error->all(FLERR,"Atom IDs must be used for molecular systems"); - if (molecular) map_style = 3; + if (molecular != Atom::ATOMIC) map_style = MAP_YES; } /* ---------------------------------------------------------------------- @@ -679,7 +704,7 @@ AtomVec *Atom::new_avec(const std::string &style, int trysuffix, int &sflag) } error->all(FLERR,utils::check_packages_for_style("atom",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -692,7 +717,6 @@ AtomVec *Atom::avec_creator(LAMMPS *lmp) return new T(lmp); } - /* ---------------------------------------------------------------------- */ void Atom::init() @@ -701,7 +725,7 @@ void Atom::init() if (nextra_store) { memory->destroy(extra); - extra = NULL; + extra = nullptr; nextra_store = 0; } @@ -734,7 +758,7 @@ void Atom::setup() /* ---------------------------------------------------------------------- return ptr to AtomVec class if matches style or to matching hybrid sub-class - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ AtomVec *Atom::style_match(const char *style) @@ -746,7 +770,7 @@ AtomVec *Atom::style_match(const char *style) if (strcmp(avec_hybrid->keywords[i],style) == 0) return avec_hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -785,7 +809,7 @@ void Atom::modify_params(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal atom_modify command"); if (strcmp(arg[iarg+1],"all") == 0) { delete [] firstgroupname; - firstgroupname = NULL; + firstgroupname = nullptr; } else { int n = strlen(arg[iarg+1]) + 1; firstgroupname = new char[n]; @@ -795,8 +819,8 @@ void Atom::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"sort") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal atom_modify command"); - sortfreq = force->inumeric(FLERR,arg[iarg+1]); - userbinsize = force->numeric(FLERR,arg[iarg+2]); + sortfreq = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + userbinsize = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (sortfreq < 0 || userbinsize < 0.0) error->all(FLERR,"Illegal atom_modify command"); if (sortfreq >= 0 && firstgroupname) @@ -961,33 +985,33 @@ void Atom::deallocate_topology() { memory->destroy(atom->bond_type); memory->destroy(atom->bond_atom); - atom->bond_type = NULL; - atom->bond_atom = NULL; + atom->bond_type = nullptr; + atom->bond_atom = nullptr; memory->destroy(atom->angle_type); memory->destroy(atom->angle_atom1); memory->destroy(atom->angle_atom2); memory->destroy(atom->angle_atom3); - atom->angle_type = NULL; - atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = NULL; + atom->angle_type = nullptr; + atom->angle_atom1 = atom->angle_atom2 = atom->angle_atom3 = nullptr; memory->destroy(atom->dihedral_type); memory->destroy(atom->dihedral_atom1); memory->destroy(atom->dihedral_atom2); memory->destroy(atom->dihedral_atom3); memory->destroy(atom->dihedral_atom4); - atom->dihedral_type = NULL; + atom->dihedral_type = nullptr; atom->dihedral_atom1 = atom->dihedral_atom2 = - atom->dihedral_atom3 = atom->dihedral_atom4 = NULL; + atom->dihedral_atom3 = atom->dihedral_atom4 = nullptr; memory->destroy(atom->improper_type); memory->destroy(atom->improper_atom1); memory->destroy(atom->improper_atom2); memory->destroy(atom->improper_atom3); memory->destroy(atom->improper_atom4); - atom->improper_type = NULL; + atom->improper_type = nullptr; atom->improper_atom1 = atom->improper_atom2 = - atom->improper_atom3 = atom->improper_atom4 = NULL; + atom->improper_atom3 = atom->improper_atom4 = nullptr; } /* ---------------------------------------------------------------------- @@ -1086,11 +1110,11 @@ void Atom::data_atoms(int n, char *buf, tagint id_offset, tagint mol_offset, next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,"Incorrect atom format in data file"); for (m = 1; m < nwords; m++) { - values[m] = strtok(NULL," \t\n\r\f"); - if (values[m] == NULL) + values[m] = strtok(nullptr," \t\n\r\f"); + if (values[m] == nullptr) error->all(FLERR,"Incorrect atom format in data file"); } @@ -1173,7 +1197,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); tagdata = ATOTAGINT(values[0]) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) @@ -1188,7 +1212,7 @@ void Atom::data_vels(int n, char *buf, tagint id_offset) /* ---------------------------------------------------------------------- process N bonds read into buf from data files - if count is non-NULL, just count bonds per atom + if count is non-nullptr, just count bonds per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1243,7 +1267,7 @@ void Atom::data_bonds(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N angles read into buf from data files - if count is non-NULL, just count angles per atom + if count is non-nullptr, just count angles per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1315,7 +1339,7 @@ void Atom::data_angles(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N dihedrals read into buf from data files - if count is non-NULL, just count diihedrals per atom + if count is non-nullptr, just count diihedrals per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1406,7 +1430,7 @@ void Atom::data_dihedrals(int n, char *buf, int *count, tagint id_offset, /* ---------------------------------------------------------------------- process N impropers read into buf from data files - if count is non-NULL, just count impropers per atom + if count is non-nullptr, just count impropers per atom else store them with atoms check that atom IDs are > 0 and <= map_tag_max ------------------------------------------------------------------------- */ @@ -1525,7 +1549,7 @@ void Atom::data_bonus(int n, char *buf, AtomVec *avec_bonus, tagint id_offset) values[0] = strtok(buf," \t\n\r\f"); for (j = 1; j < nwords; j++) - values[j] = strtok(NULL," \t\n\r\f"); + values[j] = strtok(nullptr," \t\n\r\f"); tagdata = ATOTAGINT(values[0]) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) @@ -1555,8 +1579,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) int maxint = 0; int maxdouble = 0; - int *ivalues = NULL; - double *dvalues = NULL; + int *ivalues = nullptr; + double *dvalues = nullptr; if (!unique_tags) unique_tags = new std::set; @@ -1566,7 +1590,7 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) for (int i = 0; i < n; i++) { if (i == 0) tagdata = ATOTAGINT(strtok(buf," \t\n\r\f")) + id_offset; - else tagdata = ATOTAGINT(strtok(NULL," \t\n\r\f")) + id_offset; + else tagdata = ATOTAGINT(strtok(nullptr," \t\n\r\f")) + id_offset; if (tagdata <= 0 || tagdata > map_tag_max) error->one(FLERR,"Invalid atom ID in Bodies section of data file"); @@ -1576,8 +1600,8 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) else error->one(FLERR,"Duplicate atom ID in Bodies section of data file"); - ninteger = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); - ndouble = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + ninteger = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); + ndouble = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); if ((m = map(tagdata)) >= 0) { if (ninteger > maxint) { @@ -1592,16 +1616,16 @@ void Atom::data_bodies(int n, char *buf, AtomVec *avec_body, tagint id_offset) } for (j = 0; j < ninteger; j++) - ivalues[j] = force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); + ivalues[j] = utils::inumeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); for (j = 0; j < ndouble; j++) - dvalues[j] = force->numeric(FLERR,strtok(NULL," \t\n\r\f")); + dvalues[j] = utils::numeric(FLERR,strtok(nullptr," \t\n\r\f"),false,lmp); avec_body->data_body(m,ninteger,ndouble,ivalues,dvalues); } else { nvalues = ninteger + ndouble; // number of values to skip for (j = 0; j < nvalues; j++) - strtok(NULL," \t\n\r\f"); + strtok(nullptr," \t\n\r\f"); } } @@ -1643,7 +1667,7 @@ void Atom::data_fix_compute_variable(int nprev, int nnew) void Atom::allocate_type_arrays() { - if (avec->mass_type) { + if (avec->mass_type == AtomVec::PER_TYPE) { mass = new double[ntypes+1]; mass_setflag = new int[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) mass_setflag[itype] = 0; @@ -1658,7 +1682,7 @@ void Atom::allocate_type_arrays() void Atom::set_mass(const char *file, int line, const char *str, int type_offset) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); int itype; double mass_one; @@ -1682,7 +1706,7 @@ void Atom::set_mass(const char *file, int line, const char *str, int type_offset void Atom::set_mass(const char *file, int line, int itype, double value) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); if (itype < 1 || itype > ntypes) error->all(file,line,"Invalid type for mass set"); @@ -1699,10 +1723,10 @@ void Atom::set_mass(const char *file, int line, int itype, double value) void Atom::set_mass(const char *file, int line, int /*narg*/, char **arg) { - if (mass == NULL) error->all(file,line,"Cannot set mass for this atom style"); + if (mass == nullptr) error->all(file,line,"Cannot set mass for this atom style"); int lo,hi; - force->bounds(file,line,arg[0],ntypes,lo,hi); + utils::bounds(file,line,arg[0],1,ntypes,lo,hi,error); if (lo < 1 || hi > ntypes) error->all(file,line,"Invalid type for mass set"); for (int itype = lo; itype <= hi; itype++) { @@ -1732,7 +1756,7 @@ void Atom::set_mass(double *values) void Atom::check_mass(const char *file, int line) { - if (mass == NULL) return; + if (mass == nullptr) return; if (rmass_flag) return; for (int itype = 1; itype <= ntypes; itype++) if (mass_setflag[itype] == 0) @@ -1842,7 +1866,7 @@ void Atom::add_molecule(int narg, char **arg) int Atom::find_molecule(char *id) { - if(id == NULL) return -1; + if(id == nullptr) return -1; int imol; for (imol = 0; imol < nmolecule; imol++) if (strcmp(id,molecules[imol]->id) == 0) return imol; @@ -2179,20 +2203,20 @@ void Atom::add_callback(int flag) int ifix; // find the fix - // if find NULL ptr: + // if find null pointer: // it's this one, since it is being replaced and has just been deleted // at this point in re-creation - // if don't find NULL ptr: + // if don't find null pointer: // i is set to nfix = new one currently being added at end of list for (ifix = 0; ifix < modify->nfix; ifix++) - if (modify->fix[ifix] == NULL) break; + if (modify->fix[ifix] == nullptr) break; // add callback to lists and sort, reallocating if necessary // sorting is required in cases where fixes were replaced as it ensures atom // data is read/written/transfered in the same order that fixes are called - if (flag == 0) { + if (flag == GROW) { if (nextra_grow == nextra_grow_max) { nextra_grow_max += DELTA; memory->grow(extra_grow,nextra_grow_max,"atom:extra_grow"); @@ -2200,7 +2224,7 @@ void Atom::add_callback(int flag) extra_grow[nextra_grow] = ifix; nextra_grow++; std::sort(extra_grow, extra_grow + nextra_grow); - } else if (flag == 1) { + } else if (flag == RESTART) { if (nextra_restart == nextra_restart_max) { nextra_restart_max += DELTA; memory->grow(extra_restart,nextra_restart_max,"atom:extra_restart"); @@ -2208,7 +2232,7 @@ void Atom::add_callback(int flag) extra_restart[nextra_restart] = ifix; nextra_restart++; std::sort(extra_restart, extra_restart + nextra_restart); - } else if (flag == 2) { + } else if (flag == BORDER) { if (nextra_border == nextra_border_max) { nextra_border_max += DELTA; memory->grow(extra_border,nextra_border_max,"atom:extra_border"); @@ -2227,13 +2251,13 @@ void Atom::add_callback(int flag) void Atom::delete_callback(const char *id, int flag) { - if (id == NULL) return; + if (id == nullptr) return; int ifix = modify->find_fix(id); // compact the list of callbacks - if (flag == 0) { + if (flag == GROW) { int match; for (match = 0; match < nextra_grow; match++) if (extra_grow[match] == ifix) break; @@ -2243,7 +2267,7 @@ void Atom::delete_callback(const char *id, int flag) extra_grow[i] = extra_grow[i+1]; nextra_grow--; - } else if (flag == 1) { + } else if (flag == RESTART) { int match; for (match = 0; match < nextra_restart; match++) if (extra_restart[match] == ifix) break; @@ -2253,7 +2277,7 @@ void Atom::delete_callback(const char *id, int flag) extra_restart[i] = extra_restart[i+1]; nextra_restart--; - } else if (flag == 2) { + } else if (flag == BORDER) { int match; for (match = 0; match < nextra_border; match++) if (extra_border[match] == ifix) break; @@ -2288,7 +2312,7 @@ void Atom::update_callback(int ifix) int Atom::find_custom(const char *name, int &flag) { - if(name == NULL) return -1; + if(name == nullptr) return -1; for (int i = 0; i < nivector; i++) if (iname[i] && strcmp(iname[i],name) == 0) { @@ -2305,12 +2329,17 @@ int Atom::find_custom(const char *name, int &flag) return -1; } -/* ---------------------------------------------------------------------- - add a custom variable with name of type flag = 0/1 for int/double - assumes name does not already exist - return index in ivector or dvector of its location -------------------------------------------------------------------------- */ +/** \brief Add a custom per-atom property with the given name and type +\verbatim embed:rst +This function will add a custom per-atom property with the name "name" +as either list of int or double to the list of custom properties. This +function is called, e.g. from :doc:`fix property/atom `. +\endverbatim + * \param name Name of the property (w/o a "d_" or "i_" prefix) + * \param flag Data type of property: 0 for int, 1 for double + * \return Index of property in the respective list of properties + */ int Atom::add_custom(const char *name, int flag) { int index; @@ -2342,37 +2371,158 @@ int Atom::add_custom(const char *name, int flag) return index; } -/* ---------------------------------------------------------------------- - remove a custom variable of type flag = 0/1 for int/double at index - free memory for vector and name and set ptrs to NULL - ivector/dvector and iname/dname lists never shrink -------------------------------------------------------------------------- */ - +/*! \brief Remove a custom per-atom property of a given type + * +\verbatim embed:rst +This will remove a property that was requested e.g. by the +:doc:`fix property/atom ` command. It frees the +allocated memory and sets the pointer to ``nullptr`` to the entry in +the list can be reused. The lists of those pointers will never be +compacted or never shrink, so that index to name mappings remain valid. +\endverbatim + * + * \param flag whether the property is integer (=0) or double (=1) + * \param index of that property in the respective list. + */ void Atom::remove_custom(int flag, int index) { if (flag == 0) { memory->destroy(ivector[index]); - ivector[index] = NULL; + ivector[index] = nullptr; delete [] iname[index]; - iname[index] = NULL; + iname[index] = nullptr; } else { memory->destroy(dvector[index]); - dvector[index] = NULL; + dvector[index] = nullptr; delete [] dname[index]; - dname[index] = NULL; + dname[index] = nullptr; } } -/* ---------------------------------------------------------------------- - return a pointer to a named internal variable - if don't recognize name, return NULL -------------------------------------------------------------------------- */ +/** Provide access to internal data of the Atom class by keyword + * +\verbatim embed:rst -void *Atom::extract(char *name) +This function is a way to access internal per-atom data. This data is +distributed across MPI ranks and thus only the data for "local" atoms +are expected to be available. Whether also data for "ghost" atoms is +stored and up-to-date depends on various simulation settings. + +This table lists a large part of the supported names, their data types, +length of the data area, and a short description. + +.. list-table:: + :header-rows: 1 + :widths: auto + + * - Name + - Type + - Items per atom + - Description + * - mass + - double + - 1 + - per-type mass. This array is **NOT** a per-atom array + but of length ``ntypes+1``, element 0 is ignored. + * - id + - tagint + - 1 + - atom ID of the particles + * - type + - int + - 1 + - atom type of the particles + * - mask + - int + - 1 + - bitmask for mapping to groups. Individual bits are set + to 0 or 1 for each group. + * - image + - imageint + - 1 + - 3 image flags encoded into a single integer. + See :cpp:func:`lammps_encode_image_flags`. + * - x + - double + - 3 + - x-, y-, and z-coordinate of the particles + * - v + - double + - 3 + - x-, y-, and z-component of the velocity of the particles + * - f + - double + - 3 + - x-, y-, and z-component of the force on the particles + * - molecule + - int + - 1 + - molecule ID of the particles + * - q + - double + - 1 + - charge of the particles + * - mu + - double + - 3 + - dipole moment of the particles + * - omega + - double + - 3 + - x-, y-, and z-component of rotational velocity of the particles + * - angmom + - double + - 3 + - x-, y-, and z-component of angular momentum of the particles + * - torque + - double + - 3 + - x-, y-, and z-component of the torque on the particles + * - radius + - double + - 1 + - radius of the (extended) particles + * - rmass + - double + - 1 + - per-atom mass of the particles. ``nullptr`` if per-type masses are + used. See the :cpp:func:`rmass_flag` setting. + * - ellipsoid + - int + - 1 + - 1 if the particle is an ellipsoidal particle, 0 if not + * - line + - int + - 1 + - 1 if the particle is a line particle, 0 if not + * - tri + - int + - 1 + - 1 if the particle is a triangulated particle, 0 if not + * - body + - int + - 1 + - 1 if the particle is a body particle, 0 if not + +*See also* + :cpp:func:`lammps_extract_atom` + +\endverbatim + * + * \sa extract_datatype + * + * \param name string with the keyword of the desired property. + Typically the name of the pointer variable returned + * \return pointer to the requested data cast to ``void *`` or ``nullptr`` */ + +void *Atom::extract(const char *name) { // -------------------------------------------------------------------- // 4th customization section: customize by adding new variable name + // please see the following function to set the type of the data + // so that programs can detect it dynamically at run time. + /* NOTE: this array is only of length ntypes+1 */ if (strcmp(name,"mass") == 0) return (void *) mass; if (strcmp(name,"id") == 0) return (void *) tag; @@ -2393,6 +2543,7 @@ void *Atom::extract(char *name) if (strcmp(name,"ellipsoid") == 0) return (void *) ellipsoid; if (strcmp(name,"line") == 0) return (void *) line; if (strcmp(name,"tri") == 0) return (void *) tri; + if (strcmp(name,"body") == 0) return (void *) body; if (strcmp(name,"vfrac") == 0) return (void *) vfrac; if (strcmp(name,"s0") == 0) return (void *) s0; @@ -2435,7 +2586,90 @@ void *Atom::extract(char *name) // end of customization section // -------------------------------------------------------------------- - return NULL; + return nullptr; +} + + +/** Provide data type info about internal data of the Atom class + * +\verbatim embed:rst + +.. versionadded:: 18Sep2020 + +\endverbatim + * + * \sa extract + * + * \param name string with the keyword of the desired property. + * \return data type constant for desired property or -1 */ + +int Atom::extract_datatype(const char *name) +{ + // -------------------------------------------------------------------- + // 5th customization section: customize by adding new variable name + + if (strcmp(name,"mass") == 0) return LAMMPS_DOUBLE; + + if (strcmp(name,"id") == 0) return LAMMPS_TAGINT; + if (strcmp(name,"type") == 0) return LAMMPS_INT; + if (strcmp(name,"mask") == 0) return LAMMPS_INT; + if (strcmp(name,"image") == 0) return LAMMPS_TAGINT; + if (strcmp(name,"x") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"v") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"f") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"molecule") == 0) return LAMMPS_TAGINT; + if (strcmp(name,"q") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"mu") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"omega") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"angmom") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"torque") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"radius") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"rmass") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"ellipsoid") == 0) return LAMMPS_INT; + if (strcmp(name,"line") == 0) return LAMMPS_INT; + if (strcmp(name,"tri") == 0) return LAMMPS_INT; + if (strcmp(name,"body") == 0) return LAMMPS_INT; + + if (strcmp(name,"vfrac") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"s0") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"x0") == 0) return LAMMPS_DOUBLE_2D; + + if (strcmp(name,"spin") == 0) return LAMMPS_INT; + if (strcmp(name,"eradius") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"ervel") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"erforce") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"ervelforce") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"cs") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"csforce") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"vforce") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name,"etag") == 0) return LAMMPS_INT; + + if (strcmp(name,"rho") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"drho") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"esph") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"desph") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"cv") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"vest") == 0) return LAMMPS_DOUBLE_2D; + + // USER-MESONT package + if (strcmp(name,"length") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"buckling") == 0) return LAMMPS_INT; + if (strcmp(name,"bond_nt") == 0) return LAMMPS_TAGINT_2D; + + if (strcmp(name, "contact_radius") == 0) return LAMMPS_DOUBLE; + if (strcmp(name, "smd_data_9") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name, "smd_stress") == 0) return LAMMPS_DOUBLE_2D; + if (strcmp(name, "eff_plastic_strain") == 0) return LAMMPS_DOUBLE; + if (strcmp(name, "eff_plastic_strain_rate") == 0) return LAMMPS_DOUBLE; + if (strcmp(name, "damage") == 0) return LAMMPS_DOUBLE; + + if (strcmp(name,"dpdTheta") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"edpd_temp") == 0) return LAMMPS_DOUBLE; + + // end of customization section + // -------------------------------------------------------------------- + + return -1; } /* ---------------------------------------------------------------------- @@ -2444,14 +2678,14 @@ void *Atom::extract(char *name) add in global to local mapping storage ------------------------------------------------------------------------- */ -bigint Atom::memory_usage() +double Atom::memory_usage() { - bigint bytes = avec->memory_usage(); + double bytes = avec->memory_usage(); bytes += max_same*sizeof(int); - if (map_style == 1) + if (map_style == MAP_ARRAY) bytes += memory->usage(map_array,map_maxarray); - else if (map_style == 2) { + else if (map_style == MAP_HASH) { bytes += map_nbucket*sizeof(int); bytes += map_nhash*sizeof(HashElem); } diff --git a/src/atom.h b/src/atom.h index 4dac15d758..bc69d3b27a 100644 --- a/src/atom.h +++ b/src/atom.h @@ -15,17 +15,24 @@ #define LMP_ATOM_H #include "pointers.h" + #include #include -#include namespace LAMMPS_NS { + // forward declaration + + class AtomVec; + class Atom : protected Pointers { public: char *atom_style; - class AtomVec *avec; + AtomVec *avec; enum{DOUBLE,INT,BIGINT}; + enum{GROW=0,RESTART=1,BORDER=2}; + enum{ATOMIC=0,MOLECULAR=1,TEMPLATE=2}; + enum{MAP_NONE=0,MAP_ARRAY=1,MAP_HASH=2,MAP_YES=3}; // atom counts @@ -51,7 +58,7 @@ class Atom : protected Pointers { int firstgroup; // store atoms in this group first, -1 if unset int nfirst; // # of atoms in first group on this proc - char *firstgroupname; // group-ID to store first, NULL if unset + char *firstgroupname; // group-ID to store first, null pointer if unset // -------------------------------------------------------------------- // 1st customization section: customize by adding new per-atom variable @@ -273,12 +280,12 @@ class Atom : protected Pointers { void add_peratom_vary(const char *, void *, int, int *, void *, int collength=0); void create_avec(const std::string &, int, char **, int); - virtual class AtomVec *new_avec(const std::string &, int, int &); + virtual AtomVec *new_avec(const std::string &, int, int &); void init(); void setup(); - class AtomVec *style_match(const char *); + AtomVec *style_match(const char *); void modify_params(int, char **); void tag_check(); void tag_extend(); @@ -296,8 +303,8 @@ class Atom : protected Pointers { void data_angles(int, char *, int *, tagint, int); void data_dihedrals(int, char *, int *, tagint, int); void data_impropers(int, char *, int *, tagint, int); - void data_bonus(int, char *, class AtomVec *, tagint); - void data_bodies(int, char *, class AtomVec *, tagint); + void data_bonus(int, char *, AtomVec *, tagint); + void data_bodies(int, char *, AtomVec *, tagint); void data_fix_compute_variable(int, int); virtual void allocate_type_arrays(); @@ -327,7 +334,8 @@ class Atom : protected Pointers { virtual void sync_modify(ExecutionSpace, unsigned int, unsigned int) {} - void *extract(char *); + void *extract(const char *); + int extract_datatype(const char *); inline int* get_map_array() {return map_array;}; inline int get_map_size() {return map_tag_max+1;}; @@ -337,7 +345,7 @@ class Atom : protected Pointers { // NOTE: placeholder method until KOKKOS/AtomVec is refactored int memcheck(const char *) {return 1;} - bigint memory_usage(); + double memory_usage(); // functions for global to local ID mapping // map lookup function inlined for efficiency diff --git a/src/atom_map.cpp b/src/atom_map.cpp index c23aeec83c..8d8f4ef934 100644 --- a/src/atom_map.cpp +++ b/src/atom_map.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "atom.h" -#include -#include + #include "comm.h" -#include "memory.h" #include "error.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; @@ -43,15 +44,15 @@ void Atom::map_init(int check) int recreate = 0; if (check) recreate = map_style_set(); - if (map_style == 1 && map_tag_max > map_maxarray) recreate = 1; - else if (map_style == 2 && nlocal+nghost > map_nhash) recreate = 1; + if (map_style == MAP_ARRAY && map_tag_max > map_maxarray) recreate = 1; + else if (map_style == MAP_HASH && nlocal+nghost > map_nhash) recreate = 1; // if not recreating: // for array, initialize current map_tag_max values // for hash, set all buckets to empty, put all entries in free list if (!recreate) { - if (map_style == 1) { + if (map_style == MAP_ARRAY) { for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1; } else { for (int i = 0; i < map_nbucket; i++) map_bucket[i] = -1; @@ -66,7 +67,7 @@ void Atom::map_init(int check) } else { map_delete(); - if (map_style == 1) { + if (map_style == MAP_ARRAY) { map_maxarray = map_tag_max; memory->create(map_array,map_maxarray+1,"atom:map_array"); for (int i = 0; i <= map_tag_max; i++) map_array[i] = -1; @@ -113,7 +114,7 @@ void Atom::map_init(int check) void Atom::map_clear() { - if (map_style == 1) { + if (map_style == MAP_ARRAY) { int nall = nlocal + nghost; for (int i = 0; i < nall; i++) { sametag[i] = -1; @@ -168,7 +169,7 @@ void Atom::map_set() { int nall = nlocal + nghost; - if (map_style == 1) { + if (map_style == MAP_ARRAY) { // possible reallocation of sametag must come before loop over atoms // since loop sets sametag @@ -246,7 +247,7 @@ void Atom::map_set() void Atom::map_one(tagint global, int local) { - if (map_style == 1) map_array[global] = local; + if (map_style == MAP_ARRAY) map_array[global] = local; else { // search for key // if found it, just overwrite local value with index @@ -304,9 +305,12 @@ int Atom::map_style_set() // else use array int map_style_old = map_style; - if (map_user == 1 || map_user == 2) map_style = map_user; - else if (map_tag_max > 1000000 && !lmp->kokkos) map_style = 2; - else map_style = 1; + if (map_user == MAP_ARRAY || map_user == MAP_HASH) { + map_style = map_user; + } else { // map_user == MAP_YES + if (map_tag_max > 1000000 && !lmp->kokkos) map_style = MAP_HASH; + else map_style = MAP_ARRAY; + } // recreate = 1 if must create new map b/c map_style changed @@ -322,18 +326,18 @@ int Atom::map_style_set() void Atom::map_delete() { memory->destroy(sametag); - sametag = NULL; + sametag = nullptr; max_same = 0; - if (map_style == 1) { + if (map_style == MAP_ARRAY) { memory->destroy(map_array); - map_array = NULL; + map_array = nullptr; } else { if (map_nhash) { delete [] map_bucket; delete [] map_hash; - map_bucket = NULL; - map_hash = NULL; + map_bucket = nullptr; + map_hash = nullptr; } map_nhash = map_nbucket = 0; } diff --git a/src/atom_vec.cpp b/src/atom_vec.cpp index 261b068997..b6275795f8 100644 --- a/src/atom_vec.cpp +++ b/src/atom_vec.cpp @@ -12,20 +12,19 @@ ------------------------------------------------------------------------- */ #include "atom_vec.h" -#include -#include + #include "atom.h" #include "comm.h" #include "domain.h" -#include "force.h" -#include "modify.h" +#include "error.h" #include "fix.h" +#include "force.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "modify.h" #include "tokenizer.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -40,9 +39,9 @@ AtomVec::AtomVec(LAMMPS *lmp) : Pointers(lmp) nmax = 0; ngrow = 0; - molecular = 0; + molecular = Atom::ATOMIC; bonds_allow = angles_allow = dihedrals_allow = impropers_allow = 0; - mass_type = dipole_type = 0; + mass_type = dipole_type = PER_ATOM; forceclearflag = 0; maxexchange = 0; bonus_flag = 0; @@ -2061,7 +2060,7 @@ void AtomVec::write_vel(FILE *fp, int n, double **buf) } /* ---------------------------------------------------------------------- - pack bond info for data file into buf if non-NULL + pack bond info for data file into buf if non-nullptr return count of bonds from this proc do not count/pack bonds with bondtype = 0 if bondtype is negative, flip back to positive @@ -2119,7 +2118,7 @@ void AtomVec::write_bond(FILE *fp, int n, tagint **buf, int index) } /* ---------------------------------------------------------------------- - pack angle info for data file into buf if non-NULL + pack angle info for data file into buf if non-nullptr return count of angles from this proc do not count/pack angles with angletype = 0 if angletype is negative, flip back to positive @@ -2307,12 +2306,12 @@ void AtomVec::write_improper(FILE *fp, int n, tagint **buf, int index) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVec::memory_usage() +double AtomVec::memory_usage() { int datatype,cols,maxcols; void *pdata; - bigint bytes = 0; + double bytes = 0; bytes += memory->usage(tag,nmax); bytes += memory->usage(type,nmax); diff --git a/src/atom_vec.h b/src/atom_vec.h index 07dec63506..8e670304ed 100644 --- a/src/atom_vec.h +++ b/src/atom_vec.h @@ -20,7 +20,8 @@ namespace LAMMPS_NS { class AtomVec : protected Pointers { public: - int molecular; // 0 = atomic, 1 = molecular system + enum {PER_ATOM=0,PER_TYPE=1}; + int molecular; // 0 = atomic, 1 = molecular system, 2 = molecular template system int bonds_allow,angles_allow; // 1 if bonds, angles are used int dihedrals_allow,impropers_allow; // 1 if dihedrals, impropers used int mass_type; // 1 if per-type masses @@ -151,8 +152,8 @@ class AtomVec : protected Pointers { virtual int property_atom(char *) {return -1;} virtual void pack_property_atom(int, double *, int, int) {} - virtual bigint memory_usage(); - virtual bigint memory_usage_bonus() {return 0;} + virtual double memory_usage(); + virtual double memory_usage_bonus() {return 0;} // old hybrid functions, needed by Kokkos package diff --git a/src/atom_vec_atomic.cpp b/src/atom_vec_atomic.cpp index eb8dfc1b7e..1cd409a354 100644 --- a/src/atom_vec_atomic.cpp +++ b/src/atom_vec_atomic.cpp @@ -13,14 +13,16 @@ #include "atom_vec_atomic.h" +#include "atom.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ AtomVecAtomic::AtomVecAtomic(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings diff --git a/src/atom_vec_body.cpp b/src/atom_vec_body.cpp index 10cbb9c841..ad83b372a9 100644 --- a/src/atom_vec_body.cpp +++ b/src/atom_vec_body.cpp @@ -12,18 +12,17 @@ ------------------------------------------------------------------------- */ #include "atom_vec_body.h" -#include -#include -#include "my_pool_chunk.h" -#include "style_body.h" -#include "body.h" +#include "style_body.h" // IWYU pragma: keep + #include "atom.h" -#include "domain.h" -#include "modify.h" +#include "body.h" +#include "error.h" #include "fix.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "modify.h" +#include "my_pool_chunk.h" + +#include using namespace LAMMPS_NS; @@ -31,7 +30,7 @@ using namespace LAMMPS_NS; AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; // first 3 sizes do not include values from body itself @@ -50,9 +49,9 @@ AtomVecBody::AtomVecBody(LAMMPS *lmp) : AtomVec(lmp) atom->radius_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; - bptr = NULL; + bptr = nullptr; if (sizeof(double) == sizeof(int)) intdoubleratio = 1; else if (sizeof(double) == 2*sizeof(int)) intdoubleratio = 2; @@ -105,7 +104,7 @@ void AtomVecBody::process_args(int narg, char **arg) if (narg < 1) error->all(FLERR,"Invalid atom_style body command"); - if (0) bptr = NULL; + if (0) bptr = nullptr; #define BODY_CLASS #define BodyStyle(key,Class) \ @@ -552,11 +551,11 @@ void AtomVecBody::data_body(int m, int ninteger, int ndouble, return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint AtomVecBody::memory_usage_bonus() +double AtomVecBody::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); - bytes += icp->size + dcp->size; + bytes += icp->size() + dcp->size(); int nall = nlocal_bonus + nghost_bonus; for (int i = 0; i < nall; i++) { @@ -583,7 +582,7 @@ void AtomVecBody::pack_data_pre(int ilocal) /* ---------------------------------------------------------------------- pack bonus body info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecBody::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_body.h b/src/atom_vec_body.h index 809d90c25f..4a4c0d0e60 100644 --- a/src/atom_vec_body.h +++ b/src/atom_vec_body.h @@ -56,7 +56,7 @@ class AtomVecBody : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_body(int, int, int, int *, double *); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/atom_vec_charge.cpp b/src/atom_vec_charge.cpp index 5957ef5215..e50bf6fe35 100644 --- a/src/atom_vec_charge.cpp +++ b/src/atom_vec_charge.cpp @@ -20,8 +20,8 @@ using namespace LAMMPS_NS; AtomVecCharge::AtomVecCharge(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; - mass_type = 1; + molecular = Atom::ATOMIC; + mass_type = PER_TYPE; atom->q_flag = 1; diff --git a/src/atom_vec_ellipsoid.cpp b/src/atom_vec_ellipsoid.cpp index dc2760c5f9..6518a5fc89 100644 --- a/src/atom_vec_ellipsoid.cpp +++ b/src/atom_vec_ellipsoid.cpp @@ -16,16 +16,16 @@ ------------------------------------------------------------------------- */ #include "atom_vec_ellipsoid.h" -#include -#include "math_extra.h" + #include "atom.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "math_const.h" +#include "math_extra.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -34,7 +34,7 @@ using namespace MathConst; AtomVecEllipsoid::AtomVecEllipsoid(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; size_forward_bonus = 4; @@ -46,7 +46,7 @@ AtomVecEllipsoid::AtomVecEllipsoid(LAMMPS *lmp) : AtomVec(lmp) atom->rmass_flag = atom->angmom_flag = atom->torque_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -414,9 +414,9 @@ void AtomVecEllipsoid::data_atom_bonus(int m, char **values) return # of bytes of allocated bonus memory ------------------------------------------------------------------------- */ -bigint AtomVecEllipsoid::memory_usage_bonus() +double AtomVecEllipsoid::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); return bytes; } @@ -484,7 +484,7 @@ void AtomVecEllipsoid::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus ellipsoid info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecEllipsoid::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_ellipsoid.h b/src/atom_vec_ellipsoid.h index 041a20affd..57646522ec 100644 --- a/src/atom_vec_ellipsoid.h +++ b/src/atom_vec_ellipsoid.h @@ -49,7 +49,7 @@ class AtomVecEllipsoid : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_atom_bonus(int, char **); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/atom_vec_hybrid.cpp b/src/atom_vec_hybrid.cpp index db593dcee0..a8d2adb39a 100644 --- a/src/atom_vec_hybrid.cpp +++ b/src/atom_vec_hybrid.cpp @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #include "atom_vec_hybrid.h" -#include + #include "atom.h" #include "comm.h" -#include "memory.h" #include "error.h" #include "tokenizer.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -30,13 +30,13 @@ enum{ELLIPSOID,LINE,TRIANGLE,BODY}; // also in WriteData AtomVecHybrid::AtomVecHybrid(LAMMPS *lmp) : AtomVec(lmp) { nstyles = 0; - styles = NULL; - keywords = NULL; - fieldstrings = NULL; + styles = nullptr; + keywords = nullptr; + fieldstrings = nullptr; bonus_flag = 0; nstyles_bonus = 0; - styles_bonus = NULL; + styles_bonus = nullptr; // these strings will be concatenated from sub-style strings // fields_data_atom & fields_data_vel start with fields common to all styles @@ -121,12 +121,12 @@ void AtomVecHybrid::process_args(int narg, char **arg) // hybrid settings are MAX or MIN of sub-style settings // check for both mass_type = 0 and 1, so can warn - molecular = 0; + molecular = Atom::ATOMIC; maxexchange = 0; for (int k = 0; k < nstyles; k++) { - if ((styles[k]->molecular == 1 && molecular == 2) || - (styles[k]->molecular == 2 && molecular == 1)) + if ((styles[k]->molecular == Atom::MOLECULAR && molecular == Atom::TEMPLATE) || + (styles[k]->molecular == Atom::TEMPLATE && molecular == Atom::MOLECULAR)) error->all(FLERR, "Cannot mix molecular and molecule template atom styles"); molecular = MAX(molecular,styles[k]->molecular); @@ -140,7 +140,7 @@ void AtomVecHybrid::process_args(int narg, char **arg) forceclearflag = MAX(forceclearflag,styles[k]->forceclearflag); maxexchange += styles[k]->maxexchange; - if (styles[k]->molecular == 2) onemols = styles[k]->onemols; + if (styles[k]->molecular == Atom::TEMPLATE) onemols = styles[k]->onemols; } // issue a warning if both per-type mass and per-atom rmass are defined @@ -187,7 +187,7 @@ void AtomVecHybrid::process_args(int narg, char **arg) // save concat_grow to check for duplicates of special-case fields char *concat_grow;; - char *null = NULL; + char *null = nullptr; fields_grow = merge_fields(0,fields_grow,1,concat_grow); fields_copy = merge_fields(1,fields_copy,0,null); @@ -379,9 +379,9 @@ int AtomVecHybrid::unpack_restart_bonus(int ilocal, double *buf) /* ---------------------------------------------------------------------- */ -bigint AtomVecHybrid::memory_usage_bonus() +double AtomVecHybrid::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; for (int k = 0; k < nstyles_bonus; k++) bytes += styles_bonus[k]->memory_usage_bonus(); return bytes; @@ -595,7 +595,7 @@ void AtomVecHybrid::build_styles() nallstyles = 0; #define ATOM_CLASS #define AtomStyle(key,Class) nallstyles++; -#include "style_atom.h" +#include "style_atom.h" // IWYU pragma: keep #undef AtomStyle #undef ATOM_CLASS @@ -609,7 +609,7 @@ void AtomVecHybrid::build_styles() allstyles[nallstyles] = new char[n]; \ strcpy(allstyles[nallstyles],#key); \ nallstyles++; -#include "style_atom.h" +#include "style_atom.h" // IWYU pragma: keep #undef AtomStyle #undef ATOM_CLASS } diff --git a/src/atom_vec_hybrid.h b/src/atom_vec_hybrid.h index 00be1b0418..2d8d5dec29 100644 --- a/src/atom_vec_hybrid.h +++ b/src/atom_vec_hybrid.h @@ -48,7 +48,7 @@ class AtomVecHybrid : public AtomVec { int size_restart_bonus(); int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void pack_restart_pre(int); void pack_restart_post(int); diff --git a/src/atom_vec_line.cpp b/src/atom_vec_line.cpp index af768f9943..9dd1eba372 100644 --- a/src/atom_vec_line.cpp +++ b/src/atom_vec_line.cpp @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #include "atom_vec_line.h" -#include -#include + #include "atom.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -33,7 +33,7 @@ using namespace MathConst; AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; size_forward_bonus = 1; @@ -47,7 +47,7 @@ AtomVecLine::AtomVecLine(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -380,9 +380,9 @@ void AtomVecLine::data_atom_bonus(int m, char **values) return # of bytes of allocated bonus memory ------------------------------------------------------------------------- */ -bigint AtomVecLine::memory_usage_bonus() +double AtomVecLine::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); return bytes; } @@ -457,7 +457,7 @@ void AtomVecLine::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus line info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecLine::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_line.h b/src/atom_vec_line.h index 55a4b8bc02..449d8a1c04 100644 --- a/src/atom_vec_line.h +++ b/src/atom_vec_line.h @@ -49,7 +49,7 @@ class AtomVecLine : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_atom_bonus(int, char **); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/atom_vec_sphere.cpp b/src/atom_vec_sphere.cpp index 03f417b1d0..27dc95e360 100644 --- a/src/atom_vec_sphere.cpp +++ b/src/atom_vec_sphere.cpp @@ -12,14 +12,15 @@ ------------------------------------------------------------------------- */ #include "atom_vec_sphere.h" -#include + #include "atom.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "fix_adapt.h" #include "math_const.h" -#include "error.h" -#include "utils.h" +#include "modify.h" + +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -28,8 +29,8 @@ using namespace MathConst; AtomVecSphere::AtomVecSphere(LAMMPS *lmp) : AtomVec(lmp) { - mass_type = 0; - molecular = 0; + mass_type = PER_ATOM; + molecular = Atom::ATOMIC; atom->sphere_flag = 1; atom->radius_flag = atom->rmass_flag = atom->omega_flag = diff --git a/src/atom_vec_tri.cpp b/src/atom_vec_tri.cpp index d5b48b9540..138a9966a8 100644 --- a/src/atom_vec_tri.cpp +++ b/src/atom_vec_tri.cpp @@ -12,18 +12,19 @@ ------------------------------------------------------------------------- */ #include "atom_vec_tri.h" -#include -#include -#include "math_extra.h" + #include "atom.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "math_const.h" +#include "math_extra.h" +#include "math_eigen.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -34,7 +35,7 @@ using namespace MathConst; AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp) { - molecular = 0; + molecular = Atom::ATOMIC; bonus_flag = 1; size_forward_bonus = 4; @@ -49,7 +50,7 @@ AtomVecTri::AtomVecTri(LAMMPS *lmp) : AtomVec(lmp) atom->sphere_flag = 1; nlocal_bonus = nghost_bonus = nmax_bonus = 0; - bonus = NULL; + bonus = nullptr; // strings with peratom variables to include in each AtomVec method // strings cannot contain fields in corresponding AtomVec default strings @@ -555,7 +556,7 @@ void AtomVecTri::data_atom_bonus(int m, char **values) tensor[0][2] = tensor[2][0] = inertia[4]; tensor[0][1] = tensor[1][0] = inertia[5]; - int ierror = MathExtra::jacobi(tensor,bonus[nlocal_bonus].inertia,evectors); + int ierror = MathEigen::jacobi3(tensor,bonus[nlocal_bonus].inertia,evectors); if (ierror) error->one(FLERR,"Insufficient Jacobi rotations for triangle"); double ex_space[3],ey_space[3],ez_space[3]; @@ -601,9 +602,9 @@ void AtomVecTri::data_atom_bonus(int m, char **values) return # of bytes of allocated bonus memory ------------------------------------------------------------------------- */ -bigint AtomVecTri::memory_usage_bonus() +double AtomVecTri::memory_usage_bonus() { - bigint bytes = 0; + double bytes = 0; bytes += nmax_bonus*sizeof(Bonus); return bytes; } @@ -688,7 +689,7 @@ void AtomVecTri::pack_data_post(int ilocal) /* ---------------------------------------------------------------------- pack bonus tri info for writing to data file - if buf is NULL, just return buffer size + if buf is nullptr, just return buffer size ------------------------------------------------------------------------- */ int AtomVecTri::pack_data_bonus(double *buf, int /*flag*/) diff --git a/src/atom_vec_tri.h b/src/atom_vec_tri.h index 9becf315f6..06898f20f5 100644 --- a/src/atom_vec_tri.h +++ b/src/atom_vec_tri.h @@ -51,7 +51,7 @@ class AtomVecTri : public AtomVec { int pack_restart_bonus(int, double *); int unpack_restart_bonus(int, double *); void data_atom_bonus(int, char **); - bigint memory_usage_bonus(); + double memory_usage_bonus(); void create_atom_post(int); void data_atom_post(int); diff --git a/src/balance.cpp b/src/balance.cpp index 49cd6ecad5..5a8b787ce1 100644 --- a/src/balance.cpp +++ b/src/balance.cpp @@ -19,28 +19,26 @@ // #define BALANCE_DEBUG 1 #include "balance.h" -#include -#include -#include + #include "atom.h" #include "comm.h" -#include "rcb.h" -#include "irregular.h" #include "domain.h" -#include "force.h" -#include "update.h" -#include "modify.h" +#include "error.h" #include "fix_store.h" #include "imbalance.h" #include "imbalance_group.h" -#include "imbalance_time.h" #include "imbalance_neigh.h" #include "imbalance_store.h" +#include "imbalance_time.h" #include "imbalance_var.h" +#include "irregular.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" +#include "rcb.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -54,17 +52,17 @@ Balance::Balance(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - user_xsplit = user_ysplit = user_zsplit = NULL; + user_xsplit = user_ysplit = user_zsplit = nullptr; shift_allocate = 0; - proccost = allproccost = NULL; + proccost = allproccost = nullptr; - rcb = NULL; + rcb = nullptr; nimbalance = 0; - imbalances = NULL; - fixstore = NULL; + imbalances = nullptr; + fixstore = nullptr; - fp = NULL; + fp = nullptr; firststep = 1; } @@ -99,7 +97,7 @@ Balance::~Balance() // check nfix in case all fixes have already been deleted if (fixstore && modify->nfix) modify->delete_fix(fixstore->id); - fixstore = NULL; + fixstore = nullptr; if (fp) fclose(fp); } @@ -119,7 +117,7 @@ void Balance::command(int narg, char **arg) if (narg < 2) error->all(FLERR,"Illegal balance command"); - thresh = force->numeric(FLERR,arg[0]); + thresh = utils::numeric(FLERR,arg[0],false,lmp); int dimension = domain->dimension; int *procgrid = comm->procgrid; @@ -145,7 +143,7 @@ void Balance::command(int narg, char **arg) user_xsplit[0] = 0.0; iarg++; for (int i = 1; i < procgrid[0]; i++) - user_xsplit[i] = force->numeric(FLERR,arg[iarg++]); + user_xsplit[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); user_xsplit[procgrid[0]] = 1.0; } } else if (strcmp(arg[iarg],"y") == 0) { @@ -165,7 +163,7 @@ void Balance::command(int narg, char **arg) user_ysplit[0] = 0.0; iarg++; for (int i = 1; i < procgrid[1]; i++) - user_ysplit[i] = force->numeric(FLERR,arg[iarg++]); + user_ysplit[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); user_ysplit[procgrid[1]] = 1.0; } } else if (strcmp(arg[iarg],"z") == 0) { @@ -185,7 +183,7 @@ void Balance::command(int narg, char **arg) user_zsplit[0] = 0.0; iarg++; for (int i = 1; i < procgrid[2]; i++) - user_zsplit[i] = force->numeric(FLERR,arg[iarg++]); + user_zsplit[i] = utils::numeric(FLERR,arg[iarg++],false,lmp); user_zsplit[procgrid[2]] = 1.0; } @@ -195,9 +193,9 @@ void Balance::command(int narg, char **arg) style = SHIFT; if (strlen(arg[iarg+1]) > 3) error->all(FLERR,"Illegal balance command"); strcpy(bstr,arg[iarg+1]); - nitermax = force->inumeric(FLERR,arg[iarg+2]); + nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nitermax <= 0) error->all(FLERR,"Illegal balance command"); - stopthresh = force->numeric(FLERR,arg[iarg+3]); + stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (stopthresh < 1.0) error->all(FLERR,"Illegal balance command"); iarg += 4; @@ -248,7 +246,7 @@ void Balance::command(int narg, char **arg) // process remaining optional args options(iarg,narg,arg); - if (wtflag) weight_storage(NULL); + if (wtflag) weight_storage(nullptr); // insure particles are in current box & update box via shrink-wrap // init entire system since comm->setup is done @@ -265,7 +263,7 @@ void Balance::command(int narg, char **arg) domain->reset_box(); comm->setup(); comm->exchange(); - if (atom->map_style) atom->map_set(); + if (atom->map_style != Atom::MAP_NONE) atom->map_set(); if (domain->triclinic) domain->lamda2x(atom->nlocal); // imbinit = initial imbalance @@ -387,20 +385,20 @@ void Balance::command(int narg, char **arg) MPI_Wtime()-start_time); mesg += fmt::format(" iteration count = {}\n",niter); for (int i = 0; i < nimbalance; ++i) mesg += imbalances[i]->info(); - mesg += fmt::format(" initial/final maximal load/proc = {} {}\n" - " initial/final imbalance factor = {:.6g} {:.6g}\n", + mesg += fmt::format(" initial/final maximal load/proc = {:.8} {:.8}\n" + " initial/final imbalance factor = {:.8} {:.8}\n", maxinit,maxfinal,imbinit,imbfinal); if (style != BISECTION) { mesg += " x cuts:"; for (int i = 0; i <= comm->procgrid[0]; i++) - mesg += fmt::format(" {}",comm->xsplit[i]); + mesg += fmt::format(" {:.8}",comm->xsplit[i]); mesg += "\n y cuts:"; for (int i = 0; i <= comm->procgrid[1]; i++) - mesg += fmt::format(" {}",comm->ysplit[i]); + mesg += fmt::format(" {:.8}",comm->ysplit[i]); mesg += "\n z cuts:"; for (int i = 0; i <= comm->procgrid[2]; i++) - mesg += fmt::format(" {}",comm->zsplit[i]); + mesg += fmt::format(" {:.8}",comm->zsplit[i]); mesg += "\n"; } @@ -427,7 +425,7 @@ void Balance::options(int iarg, int narg, char **arg) oldrcb = 0; outflag = 0; int outarg = 0; - fp = NULL; + fp = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"weight") == 0) { @@ -475,7 +473,7 @@ void Balance::options(int iarg, int narg, char **arg) if (outflag && comm->me == 0) { fp = fopen(arg[outarg],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open (fix) balance output file {}: {}", arg[outarg], utils::getsyserror())); } @@ -641,12 +639,12 @@ int *Balance::bisection(int sortflag) if (wtflag) { weight = fixstore->vstore; rcb->compute_old(dim,atom->nlocal,atom->x,weight,shrinklo,shrinkhi); - } else rcb->compute_old(dim,atom->nlocal,atom->x,NULL,shrinklo,shrinkhi); + } else rcb->compute_old(dim,atom->nlocal,atom->x,nullptr,shrinklo,shrinkhi); } else { if (wtflag) { weight = fixstore->vstore; rcb->compute(dim,atom->nlocal,atom->x,weight,shrinklo,shrinkhi); - } else rcb->compute(dim,atom->nlocal,atom->x,NULL,shrinklo,shrinkhi); + } else rcb->compute(dim,atom->nlocal,atom->x,nullptr,shrinklo,shrinkhi); } if (triclinic) domain->lamda2x(nlocal); @@ -1275,7 +1273,7 @@ void Balance::dumpout(bigint tstep) void Balance::debug_shift_output(int idim, int m, int np, double *split) { int i; - const char *dim = NULL; + const char *dim = nullptr; double *boxlo = domain->boxlo; double *prd = domain->prd; diff --git a/src/body.cpp b/src/body.cpp index c0e58d3f4c..9bc0bfc041 100644 --- a/src/body.cpp +++ b/src/body.cpp @@ -23,8 +23,8 @@ Body::Body(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) int n = strlen(arg[0]) + 1; style = new char[n]; strcpy(style,arg[0]); - icp = NULL; - dcp = NULL; + icp = nullptr; + dcp = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/body.h b/src/body.h index 1c742d3e65..c9c289792e 100644 --- a/src/body.h +++ b/src/body.h @@ -15,7 +15,7 @@ #define LMP_BODY_H #include "pointers.h" -#include "atom_vec_body.h" +#include "atom_vec_body.h" // IWYU pragma: keep namespace LAMMPS_NS { diff --git a/src/bond.cpp b/src/bond.cpp index 0fb42da98a..1ff7017132 100644 --- a/src/bond.cpp +++ b/src/bond.cpp @@ -12,20 +12,18 @@ ------------------------------------------------------------------------- */ #include "bond.h" -#include -#include -#include + #include "atom.h" +#include "atom_masks.h" #include "comm.h" +#include "error.h" #include "force.h" +#include "memory.h" #include "neighbor.h" #include "suffix.h" -#include "atom_masks.h" -#include "memory.h" -#include "error.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -46,9 +44,9 @@ Bond::Bond(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = 0; - eatom = NULL; - vatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; @@ -236,16 +234,16 @@ void Bond::write_file(int narg, char **arg) int itype = 0; int jtype = 0; if (narg == 8) { - itype = force->inumeric(FLERR,arg[6]); - jtype = force->inumeric(FLERR,arg[7]); + itype = utils::inumeric(FLERR,arg[6],false,lmp); + jtype = utils::inumeric(FLERR,arg[7],false,lmp); if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes) error->all(FLERR,"Invalid atom types in bond_write command"); } - int btype = force->inumeric(FLERR,arg[0]); - int n = force->inumeric(FLERR,arg[1]); - double inner = force->numeric(FLERR,arg[2]); - double outer = force->numeric(FLERR,arg[3]); + int btype = utils::inumeric(FLERR,arg[0],false,lmp); + int n = utils::inumeric(FLERR,arg[1],false,lmp); + double inner = utils::numeric(FLERR,arg[2],false,lmp); + double outer = utils::numeric(FLERR,arg[3],false,lmp); if (inner <= 0.0 || inner >= outer) error->all(FLERR,"Invalid rlo/rhi values in bond_write command"); @@ -278,7 +276,7 @@ void Bond::write_file(int narg, char **arg) fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; - time_t tv = time(NULL); + time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); utils::logmesg(lmp,fmt::format("Creating table file {} with " "DATE: {}\n", table_file, datebuf)); @@ -286,7 +284,7 @@ void Bond::write_file(int narg, char **arg) if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by bond_write\n", datebuf, update->unit_style); } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open bond_write file {}: {}", arg[4], utils::getsyserror())); } diff --git a/src/bond.h b/src/bond.h index 8d7585b388..5406aa3f02 100644 --- a/src/bond.h +++ b/src/bond.h @@ -52,7 +52,7 @@ class Bond : protected Pointers { virtual void write_data(FILE *) {} virtual double single(int, double, int, int, double &) = 0; virtual double memory_usage(); - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void reinit(); void write_file(int, char**); diff --git a/src/bond_deprecated.cpp b/src/bond_deprecated.cpp index 0d91f73ea7..5422ab35f6 100644 --- a/src/bond_deprecated.cpp +++ b/src/bond_deprecated.cpp @@ -16,12 +16,11 @@ ------------------------------------------------------------------------- */ #include "bond_deprecated.h" -#include + #include "bond_hybrid.h" #include "comm.h" -#include "force.h" #include "error.h" -#include "utils.h" +#include "force.h" using namespace LAMMPS_NS; diff --git a/src/bond_hybrid.cpp b/src/bond_hybrid.cpp index aadc25987a..46eeab5802 100644 --- a/src/bond_hybrid.cpp +++ b/src/bond_hybrid.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "bond_hybrid.h" -#include -#include -#include + #include "atom.h" -#include "neighbor.h" #include "comm.h" +#include "error.h" #include "force.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "neighbor.h" + +#include +#include using namespace LAMMPS_NS; @@ -166,7 +166,7 @@ void BondHybrid::allocate() maxbond = new int[nstyles]; bondlist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxbond[m] = 0; - for (int m = 0; m < nstyles; m++) bondlist[m] = NULL; + for (int m = 0; m < nstyles; m++) bondlist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -268,7 +268,7 @@ void BondHybrid::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); // 2nd arg = bond sub-style name // allow for "none" as valid sub-style name @@ -351,7 +351,7 @@ void BondHybrid::write_restart(FILE *fp) void BondHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Bond*[nstyles]; keywords = new char*[nstyles]; @@ -360,10 +360,10 @@ void BondHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_bond(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/bond_zero.cpp b/src/bond_zero.cpp index cb336ddd67..06e5549161 100644 --- a/src/bond_zero.cpp +++ b/src/bond_zero.cpp @@ -16,14 +16,13 @@ ------------------------------------------------------------------------- */ #include "bond_zero.h" -#include -#include + #include "atom.h" -#include "force.h" #include "comm.h" -#include "memory.h" #include "error.h" -#include "utils.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; @@ -85,11 +84,11 @@ void BondZero::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nbondtypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nbondtypes,ilo,ihi,error); double r0_one = 0.0; if (coeffflag && (narg == 2)) - r0_one = force->numeric(FLERR,arg[1]); + r0_one = utils::numeric(FLERR,arg[1],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -127,7 +126,7 @@ void BondZero::read_restart(FILE *fp) allocate(); if (comm->me == 0) { - utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,NULL,error); + utils::sfread(FLERR,&r0[1],sizeof(double),atom->nbondtypes,fp,nullptr,error); } MPI_Bcast(&r0[1],atom->nbondtypes,MPI_DOUBLE,0,world); @@ -158,5 +157,5 @@ void *BondZero::extract(const char *str, int &dim) { dim = 1; if (strcmp(str,"r0")==0) return (void*) r0; - return NULL; + return nullptr; } diff --git a/src/change_box.cpp b/src/change_box.cpp index ff7658a01f..a214a56969 100644 --- a/src/change_box.cpp +++ b/src/change_box.cpp @@ -12,22 +12,20 @@ ------------------------------------------------------------------------- */ #include "change_box.h" -#include + +#include "atom.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "group.h" +#include "irregular.h" +#include "lattice.h" +#include "modify.h" +#include "output.h" + #include #include -#include "atom.h" -#include "modify.h" -#include "fix.h" -#include "domain.h" -#include "lattice.h" -#include "comm.h" -#include "irregular.h" -#include "output.h" -#include "group.h" -#include "error.h" -#include "force.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -83,23 +81,23 @@ void ChangeBox::command(int narg, char **arg) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = FINAL; - ops[nops].flo = force->numeric(FLERR,arg[iarg+2]); - ops[nops].fhi = force->numeric(FLERR,arg[iarg+3]); + ops[nops].flo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ops[nops].fhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; nops++; iarg += 4; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = DELTA; - ops[nops].dlo = force->numeric(FLERR,arg[iarg+2]); - ops[nops].dhi = force->numeric(FLERR,arg[iarg+3]); + ops[nops].dlo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ops[nops].dhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; nops++; iarg += 4; } else if (strcmp(arg[iarg+1],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = SCALE; - ops[nops].scale = force->numeric(FLERR,arg[iarg+2]); + ops[nops].scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); ops[nops].vdim1 = ops[nops].vdim2 = -1; nops++; iarg += 3; @@ -129,13 +127,13 @@ void ChangeBox::command(int narg, char **arg) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = FINAL; - ops[nops].ftilt = force->numeric(FLERR,arg[iarg+2]); + ops[nops].ftilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); nops++; iarg += 3; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal change_box command"); ops[nops].flavor = DELTA; - ops[nops].dtilt = force->numeric(FLERR,arg[iarg+2]); + ops[nops].dtilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); nops++; iarg += 3; } else error->all(FLERR,"Illegal change_box command"); @@ -178,7 +176,7 @@ void ChangeBox::command(int narg, char **arg) int move_atoms = 0; for (int m = 0; m < nops; m++) { - if (ops[m].style != ORTHO || ops[m].style != TRICLINIC) move_atoms = 1; + if (ops[m].style != ORTHO && ops[m].style != TRICLINIC) move_atoms = 1; } // error if moving atoms and there is stored per-atom restart state diff --git a/src/citeme.cpp b/src/citeme.cpp index c8745891cf..b638eaf475 100644 --- a/src/citeme.cpp +++ b/src/citeme.cpp @@ -28,7 +28,7 @@ static const char cite_nagline[] = "\nPlease see the log.cite file " CiteMe::CiteMe(LAMMPS *lmp) : Pointers(lmp) { - fp = NULL; + fp = nullptr; cs = new citeset(); } diff --git a/src/comm.cpp b/src/comm.cpp index 7902545330..32a4152294 100644 --- a/src/comm.cpp +++ b/src/comm.cpp @@ -12,31 +12,29 @@ ------------------------------------------------------------------------- */ #include "comm.h" -#include -#include -#include -#include "universe.h" -#include "atom.h" -#include "atom_vec.h" -#include "force.h" -#include "pair.h" -#include "bond.h" -#include "modify.h" -#include "neighbor.h" -#include "fix.h" -#include "compute.h" -#include "domain.h" -#include "output.h" -#include "dump.h" -#include "group.h" -#include "procmap.h" -#include "irregular.h" + #include "accelerator_kokkos.h" -#include "memory.h" +#include "atom.h" // IWYU pragma: keep +#include "atom_vec.h" +#include "bond.h" +#include "compute.h" +#include "domain.h" // IWYU pragma: keep +#include "dump.h" #include "error.h" +#include "fix.h" +#include "force.h" +#include "group.h" +#include "irregular.h" +#include "memory.h" // IWYU pragma: keep +#include "modify.h" +#include "neighbor.h" // IWYU pragma: keep +#include "output.h" +#include "pair.h" +#include "procmap.h" +#include "universe.h" #include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include #ifdef _OPENMP #include @@ -59,15 +57,15 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) mode = 0; bordergroup = 0; cutghostuser = 0.0; - cutusermulti = NULL; + cutusermulti = nullptr; ghost_velocity = 0; user_procgrid[0] = user_procgrid[1] = user_procgrid[2] = 0; coregrid[0] = coregrid[1] = coregrid[2] = 1; gridflag = ONELEVEL; mapflag = CART; - customfile = NULL; - outfile = NULL; + customfile = nullptr; + outfile = nullptr; recv_from_partition = send_to_partition = -1; otherflag = 0; @@ -75,8 +73,8 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) maxexchange_fix_dynamic = 0; bufextra = BUFEXTRA; - grid2proc = NULL; - xsplit = ysplit = zsplit = NULL; + grid2proc = nullptr; + xsplit = ysplit = zsplit = nullptr; rcbnew = 0; // use of OpenMP threads @@ -90,7 +88,7 @@ Comm::Comm(LAMMPS *lmp) : Pointers(lmp) #ifdef _OPENMP if (lmp->kokkos) { nthreads = lmp->kokkos->nthreads * lmp->kokkos->numa; - } else if (getenv("OMP_NUM_THREADS") == NULL) { + } else if (getenv("OMP_NUM_THREADS") == nullptr) { nthreads = 1; if (me == 0) error->message(FLERR,"OMP_NUM_THREADS environment is not set. " @@ -278,7 +276,7 @@ void Comm::modify_params(int narg, char **arg) // need to reset cutghostuser when switching comm mode if (mode == Comm::MULTI) cutghostuser = 0.0; memory->destroy(cutusermulti); - cutusermulti = NULL; + cutusermulti = nullptr; mode = Comm::SINGLE; } else if (strcmp(arg[iarg+1],"multi") == 0) { // need to reset cutghostuser when switching comm mode @@ -291,7 +289,7 @@ void Comm::modify_params(int narg, char **arg) bordergroup = group->find(arg[iarg+1]); if (bordergroup < 0) error->all(FLERR,"Invalid group in comm_modify command"); - if (bordergroup && (atom->firstgroupname == NULL || + if (bordergroup && (atom->firstgroupname == nullptr || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) error->all(FLERR,"Comm_modify group != atom_modify first group"); iarg += 2; @@ -300,7 +298,7 @@ void Comm::modify_params(int narg, char **arg) if (mode == Comm::MULTI) error->all(FLERR, "Use cutoff/multi keyword to set cutoff in multi mode"); - cutghostuser = force->numeric(FLERR,arg[iarg+1]); + cutghostuser = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutghostuser < 0.0) error->all(FLERR,"Invalid cutoff in comm_modify command"); iarg += 2; @@ -315,13 +313,13 @@ void Comm::modify_params(int narg, char **arg) const int ntypes = atom->ntypes; if (iarg+3 > narg) error->all(FLERR,"Illegal comm_modify command"); - if (cutusermulti == NULL) { + if (cutusermulti == nullptr) { memory->create(cutusermulti,ntypes+1,"comm:cutusermulti"); for (i=0; i < ntypes+1; ++i) cutusermulti[i] = -1.0; } - force->bounds(FLERR,arg[iarg+1],ntypes,nlo,nhi,1); - cut = force->numeric(FLERR,arg[iarg+2]); + utils::bounds(FLERR,arg[iarg+1],1,ntypes,nlo,nhi,error); + cut = utils::numeric(FLERR,arg[iarg+2],false,lmp); cutghostuser = MAX(cutghostuser,cut); if (cut < 0.0) error->all(FLERR,"Invalid cutoff in comm_modify command"); @@ -348,11 +346,11 @@ void Comm::set_processors(int narg, char **arg) if (narg < 3) error->all(FLERR,"Illegal processors command"); if (strcmp(arg[0],"*") == 0) user_procgrid[0] = 0; - else user_procgrid[0] = force->inumeric(FLERR,arg[0]); + else user_procgrid[0] = utils::inumeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"*") == 0) user_procgrid[1] = 0; - else user_procgrid[1] = force->inumeric(FLERR,arg[1]); + else user_procgrid[1] = utils::inumeric(FLERR,arg[1],false,lmp); if (strcmp(arg[2],"*") == 0) user_procgrid[2] = 0; - else user_procgrid[2] = force->inumeric(FLERR,arg[2]); + else user_procgrid[2] = utils::inumeric(FLERR,arg[2],false,lmp); if (user_procgrid[0] < 0 || user_procgrid[1] < 0 || user_procgrid[2] < 0) error->all(FLERR,"Illegal processors command"); @@ -373,13 +371,13 @@ void Comm::set_processors(int narg, char **arg) if (iarg+6 > narg) error->all(FLERR,"Illegal processors command"); gridflag = TWOLEVEL; - ncores = force->inumeric(FLERR,arg[iarg+2]); + ncores = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"*") == 0) user_coregrid[0] = 0; - else user_coregrid[0] = force->inumeric(FLERR,arg[iarg+3]); + else user_coregrid[0] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (strcmp(arg[iarg+4],"*") == 0) user_coregrid[1] = 0; - else user_coregrid[1] = force->inumeric(FLERR,arg[iarg+4]); + else user_coregrid[1] = utils::inumeric(FLERR,arg[iarg+4],false,lmp); if (strcmp(arg[iarg+5],"*") == 0) user_coregrid[2] = 0; - else user_coregrid[2] = force->inumeric(FLERR,arg[iarg+5]); + else user_coregrid[2] = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (ncores <= 0 || user_coregrid[0] < 0 || user_coregrid[1] < 0 || user_coregrid[2] < 0) @@ -422,8 +420,8 @@ void Comm::set_processors(int narg, char **arg) error->all(FLERR, "Cannot use processors part command " "without using partitions"); - int isend = force->inumeric(FLERR,arg[iarg+1]); - int irecv = force->inumeric(FLERR,arg[iarg+2]); + int isend = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int irecv = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (isend < 1 || isend > universe->nworlds || irecv < 1 || irecv > universe->nworlds || isend == irecv) error->all(FLERR,"Invalid partitions in processors part command"); @@ -772,7 +770,7 @@ int Comm::binary(double value, int n, double *vec) callback() is invoked to allow caller to process/update each proc's inbuf if self=1 (default), then callback() is invoked on final iteration using original inbuf, which may have been updated - for non-NULL outbuf, final updated inbuf is copied to it + for non-nullptr outbuf, final updated inbuf is copied to it ok to specify outbuf = inbuf the ptr argument is a pointer to the instance of calling class ------------------------------------------------------------------------- */ @@ -794,7 +792,7 @@ void Comm::ring(int n, int nper, void *inbuf, int messtag, // sanity check - if ((nbytes > 0) && inbuf == NULL) + if ((nbytes > 0) && inbuf == nullptr) error->one(FLERR,"Cannot put data on ring from NULL pointer"); char *buf,*bufcopy; @@ -890,7 +888,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, if (inorder) nrvous = irregular->create_data_grouped(n,procs); else nrvous = irregular->create_data(n,procs); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -927,7 +925,7 @@ rendezvous_irregular(int n, char *inbuf, int insize, int inorder, int *procs, nout = irregular->create_data_grouped(nrvous_out,procs_rvous); else nout = irregular->create_data(nrvous_out,procs_rvous); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1, "rendezvous:outbuf"); @@ -969,7 +967,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!inorder) { memory->create(procs_a2a,nprocs,"rendezvous:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer inbuf_a2a = (char *) memory->smalloc((bigint) n*insize+1, "rendezvous:inbuf"); @@ -1034,7 +1032,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, } // all2all comm of inbuf from caller decomp to rendezvous decomp - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer char *inbuf_rvous = (char *) memory->smalloc((bigint) nrvous*insize+1, "rendezvous:inbuf"); @@ -1076,7 +1074,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, if (!outorder) { memory->create(procs_a2a,nprocs,"rendezvous_a2a:procs"); - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf_a2a = (char *) memory->smalloc((bigint) nrvous_out*outsize+1, "rendezvous:outbuf"); @@ -1137,7 +1135,7 @@ rendezvous_all2all(int n, char *inbuf, int insize, int inorder, int *procs, // all2all comm of outbuf from rendezvous decomp back to caller decomp // caller will free outbuf - // add 1 item to the allocated buffer size, so the returned pointer is not NULL + // add 1 item to the allocated buffer size, so the returned pointer is not a null pointer outbuf = (char *) memory->smalloc((bigint) nout*outsize+1,"rendezvous:outbuf"); diff --git a/src/comm.h b/src/comm.h index 1743436e22..c8d7add79c 100644 --- a/src/comm.h +++ b/src/comm.h @@ -104,7 +104,7 @@ class Comm : protected Pointers { // memory usage - virtual bigint memory_usage() = 0; + virtual double memory_usage() = 0; // non-virtual functions common to all Comm styles @@ -118,7 +118,7 @@ class Comm : protected Pointers { int read_lines_from_file_universe(FILE *, int, int, char *); // extract data useful to other classes - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} protected: int bordergroup; // only communicate this group in borders @@ -242,7 +242,7 @@ E: Processor count in z must be 1 for 2d simulation Self-explanatory. -E: Cannot put data on ring from NULL pointer +E: Cannot put data on ring from nullptr pointer W: Communication cutoff is 0.0. No ghost atoms will be generated. Atoms may get lost. diff --git a/src/comm_brick.cpp b/src/comm_brick.cpp index c5ec8b35f4..374c394b0b 100644 --- a/src/comm_brick.cpp +++ b/src/comm_brick.cpp @@ -16,19 +16,20 @@ ------------------------------------------------------------------------- */ #include "comm_brick.h" -#include -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "pair.h" -#include "domain.h" -#include "neighbor.h" -#include "fix.h" #include "compute.h" +#include "domain.h" #include "dump.h" #include "error.h" +#include "fix.h" #include "memory.h" +#include "neighbor.h" +#include "pair.h" + +#include +#include using namespace LAMMPS_NS; @@ -40,17 +41,17 @@ using namespace LAMMPS_NS; CommBrick::CommBrick(LAMMPS *lmp) : Comm(lmp), - sendnum(NULL), recvnum(NULL), sendproc(NULL), recvproc(NULL), - size_forward_recv(NULL), - size_reverse_send(NULL), size_reverse_recv(NULL), - slablo(NULL), slabhi(NULL), multilo(NULL), multihi(NULL), - cutghostmulti(NULL), pbc_flag(NULL), pbc(NULL), firstrecv(NULL), - sendlist(NULL), localsendlist(NULL), maxsendlist(NULL), - buf_send(NULL), buf_recv(NULL) + sendnum(nullptr), recvnum(nullptr), sendproc(nullptr), recvproc(nullptr), + size_forward_recv(nullptr), + size_reverse_send(nullptr), size_reverse_recv(nullptr), + slablo(nullptr), slabhi(nullptr), multilo(nullptr), multihi(nullptr), + cutghostmulti(nullptr), pbc_flag(nullptr), pbc(nullptr), firstrecv(nullptr), + sendlist(nullptr), localsendlist(nullptr), maxsendlist(nullptr), + buf_send(nullptr), buf_recv(nullptr) { style = 0; layout = Comm::LAYOUT_UNIFORM; - pbc_flag = NULL; + pbc_flag = nullptr; init_buffers(); } @@ -97,10 +98,10 @@ CommBrick::CommBrick(LAMMPS * /*lmp*/, Comm *oldcomm) : Comm(*oldcomm) void CommBrick::init_buffers() { - multilo = multihi = NULL; - cutghostmulti = NULL; + multilo = multihi = nullptr; + cutghostmulti = nullptr; - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; grow_send(maxsend,2); memory->create(buf_recv,maxrecv,"comm:buf_recv"); @@ -129,7 +130,7 @@ void CommBrick::init() // memory for multi-style communication - if (mode == Comm::MULTI && multilo == NULL) { + if (mode == Comm::MULTI && multilo == nullptr) { allocate_multi(maxswap); memory->create(cutghostmulti,atom->ntypes+1,3,"comm:cutghostmulti"); } @@ -588,7 +589,7 @@ void CommBrick::exchange() // map_set() is done at end of borders() // clear ghost count and any ghost bonus data internal to AtomVec - if (map_style) atom->map_clear(); + if (map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); @@ -854,6 +855,14 @@ void CommBrick::borders() } } + // For molecular systems we lose some bits for local atom indices due + // to encoding of special pairs in neighbor lists. Check for overflows. + + if ((atom->molecular != Atom::ATOMIC) + && ((atom->nlocal + atom->nghost) > NEIGHMASK)) + error->one(FLERR,"Per-processor number of atoms is too large for " + "molecular neighbor lists"); + // insure send/recv buffers are long enough for all forward & reverse comm int max = MAX(maxforward*smax,maxreverse*rmax); @@ -863,7 +872,7 @@ void CommBrick::borders() // reset global->local map - if (map_style) atom->map_set(); + if (map_style != Atom::MAP_NONE) atom->map_set(); } /* ---------------------------------------------------------------------- @@ -1462,7 +1471,7 @@ void CommBrick::free_multi() { memory->destroy(multilo); memory->destroy(multihi); - multilo = multihi = NULL; + multilo = multihi = nullptr; } /* ---------------------------------------------------------------------- @@ -1491,16 +1500,16 @@ void *CommBrick::extract(const char *str, int &dim) return (void *) localsendlist; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint CommBrick::memory_usage() +double CommBrick::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += nprocs * sizeof(int); // grid2proc for (int i = 0; i < nswap; i++) bytes += memory->usage(sendlist[i],maxsendlist[i]); diff --git a/src/comm_brick.h b/src/comm_brick.h index 05268da63e..6165f54de5 100644 --- a/src/comm_brick.h +++ b/src/comm_brick.h @@ -47,7 +47,7 @@ class CommBrick : public Comm { void forward_comm_array(int, double **); // forward comm of array int exchange_variable(int, double *, double *&); // exchange on neigh stencil void *extract(const char *,int &); - virtual bigint memory_usage(); + virtual double memory_usage(); protected: int nswap; // # of swaps to perform = sum of maxneed diff --git a/src/comm_tiled.cpp b/src/comm_tiled.cpp index 9f0169568d..dbdc887097 100644 --- a/src/comm_tiled.cpp +++ b/src/comm_tiled.cpp @@ -17,19 +17,20 @@ ------------------------------------------------------------------------- */ #include "comm_tiled.h" -#include -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "domain.h" -#include "pair.h" -#include "neighbor.h" -#include "fix.h" #include "compute.h" +#include "domain.h" #include "dump.h" -#include "memory.h" #include "error.h" +#include "fix.h" +#include "memory.h" +#include "neighbor.h" +#include "pair.h" + +#include +#include using namespace LAMMPS_NS; @@ -46,12 +47,12 @@ CommTiled::CommTiled(LAMMPS *lmp) : Comm(lmp) { style = 1; layout = Comm::LAYOUT_UNIFORM; - pbc_flag = NULL; - buf_send = NULL; - buf_recv = NULL; - overlap = NULL; - rcbinfo = NULL; - cutghostmulti = NULL; + pbc_flag = nullptr; + buf_send = nullptr; + buf_recv = nullptr; + overlap = nullptr; + rcbinfo = nullptr; + cutghostmulti = nullptr; init_buffers(); } @@ -88,16 +89,16 @@ CommTiled::~CommTiled() void CommTiled::init_buffers() { - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; grow_send(maxsend,2); memory->create(buf_recv,maxrecv,"comm:buf_recv"); maxoverlap = 0; - overlap = NULL; - rcbinfo = NULL; - cutghostmulti = NULL; - sendbox_multi = NULL; + overlap = nullptr; + rcbinfo = nullptr; + cutghostmulti = nullptr; + sendbox_multi = nullptr; maxswap = 6; allocate_swap(maxswap); @@ -776,7 +777,7 @@ void CommTiled::exchange() // map_set() is done at end of borders() // clear ghost count and any ghost bonus data internal to AtomVec - if (map_style) atom->map_clear(); + if (map_style != Atom::MAP_NONE) atom->map_clear(); atom->nghost = 0; atom->avec->clear_bonus(); @@ -1151,6 +1152,14 @@ void CommTiled::borders() atom->nghost += forward_recv_offset[iswap][n-1] + recvnum[iswap][n-1]; } + // For molecular systems we lose some bits for local atom indices due + // to encoding of special pairs in neighbor lists. Check for overflows. + + if ((atom->molecular != Atom::ATOMIC) + && ((atom->nlocal + atom->nghost) > NEIGHMASK)) + error->one(FLERR,"Per-processor number of atoms is too large for " + "molecular neighbor lists"); + // insure send/recv buffers are long enough for all forward & reverse comm // send buf is for one forward or reverse sends to one proc // recv buf is for all forward or reverse recvs in one swap @@ -1162,7 +1171,7 @@ void CommTiled::borders() // reset global->local map - if (map_style) atom->map_set(); + if (map_style != Atom::MAP_NONE) atom->map_set(); } /* ---------------------------------------------------------------------- @@ -2084,22 +2093,22 @@ void CommTiled::allocate_swap(int n) sendlist = new int**[n]; for (int i = 0; i < n; i++) { - sendproc[i] = recvproc[i] = NULL; - sendnum[i] = recvnum[i] = NULL; - size_forward_recv[i] = firstrecv[i] = NULL; - size_reverse_send[i] = size_reverse_recv[i] = NULL; - forward_recv_offset[i] = reverse_recv_offset[i] = NULL; + sendproc[i] = recvproc[i] = nullptr; + sendnum[i] = recvnum[i] = nullptr; + size_forward_recv[i] = firstrecv[i] = nullptr; + size_reverse_send[i] = size_reverse_recv[i] = nullptr; + forward_recv_offset[i] = reverse_recv_offset[i] = nullptr; - pbc_flag[i] = NULL; - pbc[i] = NULL; - sendbox[i] = NULL; - sendbox_multi[i] = NULL; - maxsendlist[i] = NULL; - sendlist[i] = NULL; + pbc_flag[i] = nullptr; + pbc[i] = nullptr; + sendbox[i] = nullptr; + sendbox_multi[i] = nullptr; + maxsendlist[i] = nullptr; + sendlist[i] = nullptr; } maxrequest = 0; - requests = NULL; + requests = nullptr; for (int i = 0; i < n; i++) { nprocmax[i] = DELTA_PROCS; @@ -2248,8 +2257,8 @@ void CommTiled::deallocate_swap(int n) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint CommTiled::memory_usage() +double CommTiled::memory_usage() { - bigint bytes = 0; + double bytes = 0; return bytes; } diff --git a/src/comm_tiled.h b/src/comm_tiled.h index aa8867b2c3..fa2c76e6e9 100644 --- a/src/comm_tiled.h +++ b/src/comm_tiled.h @@ -50,7 +50,7 @@ class CommTiled : public Comm { void coord2proc_setup(); int coord2proc(double *, int &, int &, int &); - bigint memory_usage(); + double memory_usage(); private: int nswap; // # of swaps to perform = 2*dim diff --git a/src/compute.cpp b/src/compute.cpp index 4009396eb0..bd07b0c6d6 100644 --- a/src/compute.cpp +++ b/src/compute.cpp @@ -12,16 +12,17 @@ ------------------------------------------------------------------------- */ #include "compute.h" + +#include "atom_masks.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "group.h" +#include "memory.h" +#include "modify.h" + #include #include -#include "domain.h" -#include "force.h" -#include "group.h" -#include "modify.h" -#include "fix.h" -#include "atom_masks.h" -#include "memory.h" -#include "error.h" using namespace LAMMPS_NS; @@ -36,10 +37,10 @@ int Compute::instance_total = 0; Compute::Compute(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp), - id(NULL), style(NULL), - vector(NULL), array(NULL), vector_atom(NULL), - array_atom(NULL), vector_local(NULL), array_local(NULL), extlist(NULL), - tlist(NULL), vbiasall(NULL) + id(nullptr), style(nullptr), + vector(nullptr), array(nullptr), vector_atom(nullptr), + array_atom(nullptr), vector_local(nullptr), array_local(nullptr), extlist(nullptr), + tlist(nullptr), vbiasall(nullptr) { instance_me = instance_total++; @@ -129,7 +130,7 @@ void Compute::modify_params(int narg, char **arg) if (strcmp(arg[iarg],"extra") == 0 || strcmp(arg[iarg],"extra/dof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute_modify command"); - extra_dof = force->numeric(FLERR,arg[iarg+1]); + extra_dof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dynamic") == 0 || strcmp(arg[iarg],"dynamic/dof") == 0) { diff --git a/src/compute_adf.cpp b/src/compute_adf.cpp index dee5fb214f..e0213872d6 100644 --- a/src/compute_adf.cpp +++ b/src/compute_adf.cpp @@ -16,20 +16,21 @@ ------------------------------------------------------------------------- */ #include "compute_adf.h" -#include -#include -#include + #include "atom.h" -#include "update.h" +#include "comm.h" +#include "error.h" #include "force.h" -#include "pair.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "neigh_list.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "comm.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -42,18 +43,18 @@ enum{DEGREE, RADIAN, COSINE}; ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), klo(NULL), khi(NULL), - hist(NULL), histall(NULL), - rcutinnerj(NULL), rcutinnerk(NULL), - rcutouterj(NULL), rcutouterk(NULL), - list(NULL), - iatomcount(NULL), iatomcountall(NULL), iatomflag(NULL), - maxjatom(NULL), maxkatom(NULL), - numjatom(NULL), numkatom(NULL), - neighjatom(NULL),neighkatom(NULL), - jatomflag(NULL), katomflag(NULL), - maxjkatom(NULL), numjkatom(NULL), - neighjkatom(NULL), bothjkatom(NULL), delrjkatom(NULL) + ilo(nullptr), ihi(nullptr), jlo(nullptr), jhi(nullptr), klo(nullptr), khi(nullptr), + hist(nullptr), histall(nullptr), + rcutinnerj(nullptr), rcutinnerk(nullptr), + rcutouterj(nullptr), rcutouterk(nullptr), + list(nullptr), + iatomcount(nullptr), iatomcountall(nullptr), iatomflag(nullptr), + maxjatom(nullptr), maxkatom(nullptr), + numjatom(nullptr), numkatom(nullptr), + neighjatom(nullptr),neighkatom(nullptr), + jatomflag(nullptr), katomflag(nullptr), + maxjkatom(nullptr), numjkatom(nullptr), + neighjkatom(nullptr), bothjkatom(nullptr), delrjkatom(nullptr) { int nargsperadf = 7; @@ -67,7 +68,7 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : ordinate_style = DEGREE; cutflag = 0; - nbin = force->inumeric(FLERR,arg[3]); + nbin = utils::inumeric(FLERR,arg[3],false,lmp); if (nbin < 1) error->all(FLERR,"Illegal compute adf command"); // optional args @@ -134,19 +135,19 @@ ComputeADF::ComputeADF(LAMMPS *lmp, int narg, char **arg) : cutflag = 1; iarg = 4; for (int m = 0; m < ntriples; m++) { - force->bounds(FLERR,arg[iarg],atom->ntypes,ilo[m],ihi[m]); - force->bounds(FLERR,arg[iarg+1],atom->ntypes,jlo[m],jhi[m]); - force->bounds(FLERR,arg[iarg+2],atom->ntypes,klo[m],khi[m]); + utils::bounds(FLERR,arg[iarg],1,atom->ntypes,ilo[m],ihi[m],error); + utils::bounds(FLERR,arg[iarg+1],1,atom->ntypes,jlo[m],jhi[m],error); + utils::bounds(FLERR,arg[iarg+2],1,atom->ntypes,klo[m],khi[m],error); if (ilo[m] > ihi[m] || jlo[m] > jhi[m] || klo[m] > khi[m]) error->all(FLERR,"Illegal compute adf command"); - rcutinnerj[m] = force->numeric(FLERR,arg[iarg+3]); - rcutouterj[m] = force->numeric(FLERR,arg[iarg+4]); + rcutinnerj[m] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + rcutouterj[m] = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (rcutinnerj[m] < 0.0 || rcutinnerj[m] >= rcutouterj[m]) error->all(FLERR,"Illegal compute adf command"); - rcutinnerk[m] = force->numeric(FLERR,arg[iarg+5]); - rcutouterk[m] = force->numeric(FLERR,arg[iarg+6]); + rcutinnerk[m] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + rcutouterk[m] = utils::numeric(FLERR,arg[iarg+6],false,lmp); if (rcutinnerk[m] < 0.0 || rcutinnerk[m] >= rcutouterk[m]) error->all(FLERR,"Illegal compute adf command"); iarg += nargsperadf; diff --git a/src/compute_aggregate_atom.cpp b/src/compute_aggregate_atom.cpp index e495ac6899..97f8c6ff9e 100644 --- a/src/compute_aggregate_atom.cpp +++ b/src/compute_aggregate_atom.cpp @@ -16,23 +16,23 @@ ------------------------------------------------------------------------- */ #include "compute_aggregate_atom.h" -#include -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "update.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "group.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" +#include "neighbor.h" #include "pair.h" -#include "force.h" -#include "comm.h" -#include "memory.h" -#include "error.h" +#include "update.h" -#include "group.h" +#include +#include using namespace LAMMPS_NS; @@ -40,11 +40,11 @@ using namespace LAMMPS_NS; ComputeAggregateAtom::ComputeAggregateAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - aggregateID(NULL) + aggregateID(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute aggregate/atom command"); - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); cutsq = cutoff*cutoff; if (atom->avec->bonds_allow == 0) @@ -71,10 +71,10 @@ void ComputeAggregateAtom::init() { if (atom->tag_enable == 0) error->all(FLERR,"Cannot use compute aggregate/atom unless atoms have IDs"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Compute aggregate/atom requires a bond style to be defined"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cluster/atom requires a pair style to be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_angle.cpp b/src/compute_angle.cpp index fc72a58453..83daeedb9a 100644 --- a/src/compute_angle.cpp +++ b/src/compute_angle.cpp @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #include "compute_angle.h" -#include + #include "angle.h" -#include "update.h" -#include "force.h" #include "angle_hybrid.h" #include "error.h" +#include "force.h" +#include "update.h" using namespace LAMMPS_NS; @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeAngle::ComputeAngle(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute angle command"); diff --git a/src/compute_angle_local.cpp b/src/compute_angle_local.cpp index b100824ea9..ec031875eb 100644 --- a/src/compute_angle_local.cpp +++ b/src/compute_angle_local.cpp @@ -38,7 +38,7 @@ enum{THETA,ENG,VARIABLE}; ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), tstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), tstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute angle/local command"); @@ -77,7 +77,7 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - tstr = NULL; + tstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -123,8 +123,8 @@ ComputeAngleLocal::ComputeAngleLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -146,7 +146,7 @@ ComputeAngleLocal::~ComputeAngleLocal() void ComputeAngleLocal::init() { - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"No angle style is defined for compute angle/local"); if (nvar) { @@ -227,7 +227,7 @@ int ComputeAngleLocal::compute_angles(int flag) for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; - if (molecular == 1) na = num_angle[atom2]; + if (molecular == Atom::MOLECULAR) na = num_angle[atom2]; else { if (molindex[atom2] < 0) continue; imol = molindex[atom2]; @@ -236,7 +236,7 @@ int ComputeAngleLocal::compute_angles(int flag) } for (i = 0; i < na; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (tag[atom2] != angle_atom2[atom2][i]) continue; atype = angle_type[atom2][i]; atom1 = atom->map(angle_atom1[atom2][i]); diff --git a/src/compute_angmom_chunk.cpp b/src/compute_angmom_chunk.cpp index 05ea963b82..eb22dcee5d 100644 --- a/src/compute_angmom_chunk.cpp +++ b/src/compute_angmom_chunk.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "compute_angmom_chunk.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "compute_chunk_atom.h" #include "domain.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -28,7 +29,7 @@ using namespace LAMMPS_NS; ComputeAngmomChunk::ComputeAngmomChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), angmom(NULL), angmomall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), angmom(nullptr), angmomall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute angmom/chunk command"); diff --git a/src/compute_bond.cpp b/src/compute_bond.cpp index 5cc947c764..f7c4206857 100644 --- a/src/compute_bond.cpp +++ b/src/compute_bond.cpp @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #include "compute_bond.h" -#include + #include "bond.h" -#include "update.h" -#include "force.h" #include "bond_hybrid.h" #include "error.h" +#include "force.h" +#include "update.h" using namespace LAMMPS_NS; @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeBond::ComputeBond(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute bond command"); diff --git a/src/compute_bond_local.cpp b/src/compute_bond_local.cpp index 010e8db627..1ae4d1b079 100644 --- a/src/compute_bond_local.cpp +++ b/src/compute_bond_local.cpp @@ -39,7 +39,7 @@ enum{DIST,VELVIB,OMEGA,ENGTRANS,ENGVIB,ENGROT,ENGPOT,FORCE,FX,FY,FZ,VARIABLE}; ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), dstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), dstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute bond/local command"); @@ -84,7 +84,7 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - dstr = NULL; + dstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -142,8 +142,8 @@ ComputeBondLocal::ComputeBondLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -165,7 +165,7 @@ ComputeBondLocal::~ComputeBondLocal() void ComputeBondLocal::init() { - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"No bond style is defined for compute bond/local"); if (nvar) { @@ -268,7 +268,7 @@ int ComputeBondLocal::compute_bonds(int flag) for (atom1 = 0; atom1 < nlocal; atom1++) { if (!(mask[atom1] & groupbit)) continue; - if (molecular == 1) nb = num_bond[atom1]; + if (molecular == Atom::MOLECULAR) nb = num_bond[atom1]; else { if (molindex[atom1] < 0) continue; imol = molindex[atom1]; @@ -277,7 +277,7 @@ int ComputeBondLocal::compute_bonds(int flag) } for (i = 0; i < nb; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { btype = bond_type[atom1][i]; atom2 = atom->map(bond_atom[atom1][i]); } else { diff --git a/src/compute_centro_atom.cpp b/src/compute_centro_atom.cpp index 18fc31390f..af32a8e9a3 100644 --- a/src/compute_centro_atom.cpp +++ b/src/compute_centro_atom.cpp @@ -36,14 +36,14 @@ using namespace LAMMPS_NS; ComputeCentroAtom::ComputeCentroAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - distsq(NULL), nearest(NULL), centro(NULL) + distsq(nullptr), nearest(nullptr), centro(nullptr) { if (narg < 4 || narg > 6) error->all(FLERR,"Illegal compute centro/atom command"); if (strcmp(arg[3],"fcc") == 0) nnn = 12; else if (strcmp(arg[3],"bcc") == 0) nnn = 8; - else nnn = force->inumeric(FLERR,arg[3]); + else nnn = utils::inumeric(FLERR,arg[3],false,lmp); // default values @@ -88,7 +88,7 @@ ComputeCentroAtom::~ComputeCentroAtom() void ComputeCentroAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute centro/atom requires a pair style be defined"); int count = 0; diff --git a/src/compute_centroid_stress_atom.cpp b/src/compute_centroid_stress_atom.cpp index 7c979c66d7..499d903451 100644 --- a/src/compute_centroid_stress_atom.cpp +++ b/src/compute_centroid_stress_atom.cpp @@ -36,7 +36,7 @@ enum{NOBIAS,BIAS}; ComputeCentroidStressAtom::ComputeCentroidStressAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_temp(NULL), stress(NULL) + id_temp(nullptr), stress(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute centroid/stress/atom command"); @@ -49,7 +49,7 @@ ComputeCentroidStressAtom::ComputeCentroidStressAtom(LAMMPS *lmp, int narg, char // store temperature ID used by stress computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -237,7 +237,7 @@ void ComputeCentroidStressAtom::compute_peratom() } // add in per-atom contributions from relevant fixes - // skip if vatom = NULL + // skip if vatom = nullptr // possible during setup phase if fix has not initialized its vatom yet // e.g. fix ave/spatial defined before fix shake, // and fix ave/spatial uses a per-atom stress from this compute as input diff --git a/src/compute_chunk_atom.cpp b/src/compute_chunk_atom.cpp index c8e4269b56..7fe9394b43 100644 --- a/src/compute_chunk_atom.cpp +++ b/src/compute_chunk_atom.cpp @@ -14,29 +14,27 @@ // NOTE: allow for bin center to be variables for sphere/cylinder #include "compute_chunk_atom.h" -#include -#include -#include -#include -#include -#include + #include "atom.h" -#include "update.h" -#include "force.h" +#include "comm.h" #include "domain.h" -#include "region.h" -#include "lattice.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "fix_store.h" -#include "comm.h" #include "group.h" #include "input.h" -#include "variable.h" +#include "lattice.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "fmt/format.h" +#include "modify.h" +#include "region.h" +#include "update.h" +#include "variable.h" + +#include +#include +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -56,10 +54,10 @@ enum{LIMITMAX,LIMITEXACT}; ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - chunk_volume_vec(NULL), coord(NULL), ichunk(NULL), chunkID(NULL), - cfvid(NULL), idregion(NULL), region(NULL), cchunk(NULL), fchunk(NULL), - varatom(NULL), id_fix(NULL), fixstore(NULL), lockfix(NULL), chunk(NULL), - exclude(NULL), hash(NULL) + chunk_volume_vec(nullptr), coord(nullptr), ichunk(nullptr), chunkID(nullptr), + cfvid(nullptr), idregion(nullptr), region(nullptr), cchunk(nullptr), fchunk(nullptr), + varatom(nullptr), id_fix(nullptr), fixstore(nullptr), lockfix(nullptr), chunk(nullptr), + exclude(nullptr), hash(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute chunk/atom command"); @@ -75,7 +73,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : binflag = 0; ncoord = 0; - cfvid = NULL; + cfvid = nullptr; if (strcmp(arg[3],"bin/1d") == 0) { binflag = 1; @@ -108,12 +106,12 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : ncoord = 1; iarg = 4; if (iarg+6 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); - sorigin_user[0] = force->numeric(FLERR,arg[iarg]); - sorigin_user[1] = force->numeric(FLERR,arg[iarg+1]); - sorigin_user[2] = force->numeric(FLERR,arg[iarg+2]); - sradmin_user = force->numeric(FLERR,arg[iarg+3]); - sradmax_user = force->numeric(FLERR,arg[iarg+4]); - nsbin = force->inumeric(FLERR,arg[iarg+5]); + sorigin_user[0] = utils::numeric(FLERR,arg[iarg],false,lmp); + sorigin_user[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + sorigin_user[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + sradmin_user = utils::numeric(FLERR,arg[iarg+3],false,lmp); + sradmax_user = utils::numeric(FLERR,arg[iarg+4],false,lmp); + nsbin = utils::inumeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else if (strcmp(arg[3],"bin/cylinder") == 0) { binflag = 1; @@ -134,12 +132,12 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : } if (iarg+5 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); corigin_user[dim[0]] = 0.0; - corigin_user[cdim1] = force->numeric(FLERR,arg[iarg]); - corigin_user[cdim2] = force->numeric(FLERR,arg[iarg+1]); - cradmin_user = force->numeric(FLERR,arg[iarg+2]); - cradmax_user = force->numeric(FLERR,arg[iarg+3]); + corigin_user[cdim1] = utils::numeric(FLERR,arg[iarg],false,lmp); + corigin_user[cdim2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + cradmin_user = utils::numeric(FLERR,arg[iarg+2],false,lmp); + cradmax_user = utils::numeric(FLERR,arg[iarg+3],false,lmp); - ncbin = force->inumeric(FLERR,arg[iarg+4]); + ncbin = utils::inumeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[3],"type") == 0) { @@ -179,7 +177,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // optional args regionflag = 0; - idregion = NULL; + idregion = nullptr; nchunksetflag = 0; nchunkflag = EVERY; limit = 0; @@ -218,7 +216,7 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"limit") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute chunk/atom command"); - limit = force->inumeric(FLERR,arg[iarg+1]); + limit = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (limit < 0) error->all(FLERR,"Illegal compute chunk/atom command"); if (limit && !compress) limitfirst = 1; iarg += 2; @@ -261,11 +259,11 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+2],"lower") == 0) minflag[idim] = LOWER; else minflag[idim] = COORD; if (minflag[idim] == COORD) - minvalue[idim] = force->numeric(FLERR,arg[iarg+2]); + minvalue[idim] = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"upper") == 0) maxflag[idim] = UPPER; else maxflag[idim] = COORD; if (maxflag[idim] == COORD) - maxvalue[idim] = force->numeric(FLERR,arg[iarg+3]); + maxvalue[idim] = utils::numeric(FLERR,arg[iarg+3],false,lmp); else error->all(FLERR,"Illegal compute chunk/atom command"); iarg += 4; } else if (strcmp(arg[iarg],"units") == 0) { @@ -450,16 +448,16 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : // initialize chunk vector and per-chunk info nmax = 0; - chunk = NULL; + chunk = nullptr; nmaxint = -1; - ichunk = NULL; - exclude = NULL; + ichunk = nullptr; + exclude = nullptr; nchunk = 0; chunk_volume_scalar = 1.0; - chunk_volume_vec = NULL; - coord = NULL; - chunkID = NULL; + chunk_volume_vec = nullptr; + coord = nullptr; + chunkID = nullptr; // computeflag = 1 if this compute might invoke another compute // during assign_chunk_ids() @@ -472,17 +470,17 @@ ComputeChunkAtom::ComputeChunkAtom(LAMMPS *lmp, int narg, char **arg) : invoked_setup = -1; invoked_ichunk = -1; - id_fix = NULL; - fixstore = NULL; + id_fix = nullptr; + fixstore = nullptr; if (compress) hash = new std::map(); - else hash = NULL; + else hash = nullptr; maxvar = 0; - varatom = NULL; + varatom = nullptr; lockcount = 0; - lockfix = NULL; + lockfix = nullptr; if (which == MOLECULE) molcheck = 1; else molcheck = 0; @@ -595,7 +593,7 @@ void ComputeChunkAtom::init() if ((idsflag != ONCE && !lockcount) && fixstore) { modify->delete_fix(id_fix); - fixstore = NULL; + fixstore = nullptr; } } @@ -667,7 +665,7 @@ double ComputeChunkAtom::compute_scalar() void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep) { - if (lockfix == NULL) { + if (lockfix == nullptr) { lockfix = fixptr; lockstart = startstep; lockstop = stopstep; @@ -691,7 +689,7 @@ void ComputeChunkAtom::lock(Fix *fixptr, bigint startstep, bigint stopstep) void ComputeChunkAtom::unlock(Fix *fixptr) { if (fixptr != lockfix) return; - lockfix = NULL; + lockfix = nullptr; } /* ---------------------------------------------------------------------- @@ -1051,7 +1049,7 @@ void ComputeChunkAtom::compress_chunk_ids() // create my list of populated IDs - int *list = NULL; + int *list = nullptr; memory->create(list,n,"chunk/atom:list"); n = 0; @@ -1096,7 +1094,7 @@ void ComputeChunkAtom::compress_chunk_ids() memory->destroy(listall); } else { - comm->ring(n,sizeof(int),list,1,idring,NULL,(void *)this,0); + comm->ring(n,sizeof(int),list,1,idring,nullptr,(void *)this,0); } memory->destroy(list); @@ -1983,9 +1981,9 @@ void ComputeChunkAtom::readdim(int narg, char **arg, int iarg, int idim) else if (strcmp(arg[iarg+1],"upper") == 0) originflag[idim] = UPPER; else originflag[idim] = COORD; if (originflag[idim] == COORD) - origin[idim] = force->numeric(FLERR,arg[iarg+1]); + origin[idim] = utils::numeric(FLERR,arg[iarg+1],false,lmp); - delta[idim] = force->numeric(FLERR,arg[iarg+2]); + delta[idim] = utils::numeric(FLERR,arg[iarg+2],false,lmp); } /* ---------------------------------------------------------------------- diff --git a/src/compute_chunk_atom.h b/src/compute_chunk_atom.h index 98a3ea9a2b..392179043a 100644 --- a/src/compute_chunk_atom.h +++ b/src/compute_chunk_atom.h @@ -96,7 +96,7 @@ class ComputeChunkAtom : public Compute { class FixStore *fixstore; class Fix *lockfix; // ptr to FixAveChunk that is locking out setups - // NULL if no lock currently in place + // null pointer if no lock currently in place bigint lockstart,lockstop; // timesteps for start and stop of locking bigint invoked_setup; // last timestep setup_chunks and nchunk calculated diff --git a/src/compute_chunk_spread_atom.cpp b/src/compute_chunk_spread_atom.cpp index 41dbf2d5cb..b3b57d75d3 100644 --- a/src/compute_chunk_spread_atom.cpp +++ b/src/compute_chunk_spread_atom.cpp @@ -12,18 +12,17 @@ ------------------------------------------------------------------------- */ #include "compute_chunk_spread_atom.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" -#include "fix.h" #include "compute.h" #include "compute_chunk_atom.h" -#include "input.h" -#include "memory.h" #include "error.h" -#include "utils.h" +#include "fix.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -38,7 +37,7 @@ enum{COMPUTE,FIX}; ComputeChunkSpreadAtom:: ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), ids(NULL), which(NULL), argindex(NULL), value2index(NULL) + idchunk(nullptr), ids(nullptr), which(nullptr), argindex(nullptr), value2index(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute chunk/spread/atom command"); @@ -54,7 +53,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : int iarg = 4; int expand = 0; char **earg; - int nargnew = input->expand_args(narg-iarg,&arg[iarg],1,earg); + int nargnew = utils::expand_args(FLERR,narg-iarg,&arg[iarg],1,earg,lmp); if (earg != &arg[iarg]) expand = 1; arg = earg; @@ -69,7 +68,7 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0) { @@ -162,8 +161,8 @@ ComputeChunkSpreadAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom vector or array nmax = 0; - vector_atom = NULL; - array_atom = NULL; + vector_atom = nullptr; + array_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_cluster_atom.cpp b/src/compute_cluster_atom.cpp index ff227b3590..fa31e738bc 100644 --- a/src/compute_cluster_atom.cpp +++ b/src/compute_cluster_atom.cpp @@ -12,22 +12,22 @@ ------------------------------------------------------------------------- */ #include "compute_cluster_atom.h" -#include -#include -#include + #include "atom.h" -#include "update.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "group.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" +#include "neighbor.h" #include "pair.h" -#include "comm.h" -#include "memory.h" -#include "error.h" +#include "update.h" -#include "group.h" +#include +#include using namespace LAMMPS_NS; @@ -37,11 +37,11 @@ enum{CLUSTER,MASK,COORDS}; ComputeClusterAtom::ComputeClusterAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - clusterID(NULL) + clusterID(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cluster/atom command"); - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); cutsq = cutoff*cutoff; peratom_flag = 1; @@ -64,7 +64,7 @@ void ComputeClusterAtom::init() { if (atom->tag_enable == 0) error->all(FLERR,"Cannot use compute cluster/atom unless atoms have IDs"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cluster/atom requires a pair style to be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_cna_atom.cpp b/src/compute_cna_atom.cpp index 7ab9e8adf2..9a7a9b5d15 100644 --- a/src/compute_cna_atom.cpp +++ b/src/compute_cna_atom.cpp @@ -16,21 +16,21 @@ ------------------------------------------------------------------------- */ #include "compute_cna_atom.h" -#include -#include -#include + #include "atom.h" -#include "update.h" +#include "comm.h" +#include "error.h" #include "force.h" -#include "pair.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "fmt/format.h" +#include "neighbor.h" +#include "pair.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -44,14 +44,14 @@ enum{NCOMMON,NBOND,MAXBOND,MINBOND}; ComputeCNAAtom::ComputeCNAAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - list(NULL), nearest(NULL), nnearest(NULL), pattern(NULL) + list(nullptr), nearest(nullptr), nnearest(nullptr), pattern(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute cna/atom command"); peratom_flag = 1; size_peratom_cols = 0; - double cutoff = force->numeric(FLERR,arg[3]); + double cutoff = utils::numeric(FLERR,arg[3],false,lmp); if (cutoff < 0.0) error->all(FLERR,"Illegal compute cna/atom command"); cutsq = cutoff*cutoff; @@ -71,7 +71,7 @@ ComputeCNAAtom::~ComputeCNAAtom() void ComputeCNAAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute cna/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR,"Compute cna/atom cutoff is longer than pairwise cutoff"); diff --git a/src/compute_com_chunk.cpp b/src/compute_com_chunk.cpp index c39911214c..39ea6cfa82 100644 --- a/src/compute_com_chunk.cpp +++ b/src/compute_com_chunk.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "compute_com_chunk.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "compute_chunk_atom.h" #include "domain.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -30,7 +31,7 @@ enum{ONCE,NFREQ,EVERY}; ComputeCOMChunk::ComputeCOMChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), masstotal(NULL), massproc(NULL), com(NULL), comall(NULL) + idchunk(nullptr), masstotal(nullptr), massproc(nullptr), com(nullptr), comall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute com/chunk command"); diff --git a/src/compute_contact_atom.cpp b/src/compute_contact_atom.cpp index 7a288afb43..11f0c14893 100644 --- a/src/compute_contact_atom.cpp +++ b/src/compute_contact_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeContactAtom::ComputeContactAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - contact(NULL) + contact(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute contact/atom command"); @@ -57,7 +57,7 @@ ComputeContactAtom::~ComputeContactAtom() void ComputeContactAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute contact/atom requires a pair style be defined"); int count = 0; diff --git a/src/compute_coord_atom.cpp b/src/compute_coord_atom.cpp index 4a96c29a24..05d299fa26 100644 --- a/src/compute_coord_atom.cpp +++ b/src/compute_coord_atom.cpp @@ -12,22 +12,23 @@ ------------------------------------------------------------------------- */ #include "compute_coord_atom.h" -#include -#include -#include "compute_orientorder_atom.h" + #include "atom.h" -#include "update.h" -#include "modify.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "force.h" -#include "pair.h" #include "comm.h" +#include "compute_orientorder_atom.h" +#include "error.h" +#include "force.h" #include "group.h" #include "memory.h" -#include "error.h" -#include "utils.h" +#include "modify.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -37,8 +38,8 @@ using namespace LAMMPS_NS; ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - typelo(NULL), typehi(NULL), cvec(NULL), carray(NULL), - group2(NULL), id_orientorder(NULL), normv(NULL) + typelo(nullptr), typehi(nullptr), cvec(nullptr), carray(nullptr), + group2(nullptr), id_orientorder(nullptr), normv(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute coord/atom command"); @@ -48,7 +49,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"cutoff") == 0) { cstyle = CUTOFF; - double cutoff = force->numeric(FLERR,arg[4]); + double cutoff = utils::numeric(FLERR,arg[4],false,lmp); cutsq = cutoff*cutoff; int iarg = 5; @@ -75,7 +76,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : } else { ncol = 0; while (iarg < narg) { - force->bounds(FLERR,arg[iarg],ntypes,typelo[ncol],typehi[ncol]); + utils::bounds(FLERR,arg[iarg],1,ntypes,typelo[ncol],typehi[ncol],error); if (typelo[ncol] > typehi[ncol]) error->all(FLERR,"Illegal compute coord/atom command"); ncol++; @@ -97,7 +98,7 @@ ComputeCoordAtom::ComputeCoordAtom(LAMMPS *lmp, int narg, char **arg) : if (!utils::strmatch(modify->compute[iorientorder]->style,"^orientorder/atom")) error->all(FLERR,"Compute coord/atom compute ID is not orientorder/atom"); - threshold = force->numeric(FLERR,arg[5]); + threshold = utils::numeric(FLERR,arg[5],false,lmp); if (threshold <= -1.0 || threshold >= 1.0) error->all(FLERR,"Compute coord/atom threshold not between -1 and 1"); @@ -146,7 +147,7 @@ void ComputeCoordAtom::init() "option in compute orientorder/atom"); } - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute coord/atom requires a pair style be defined"); if (sqrt(cutsq) > force->pair->cutforce) error->all(FLERR, diff --git a/src/compute_deprecated.cpp b/src/compute_deprecated.cpp index 2419e5bc8b..4b7e3dae3c 100644 --- a/src/compute_deprecated.cpp +++ b/src/compute_deprecated.cpp @@ -12,10 +12,9 @@ ------------------------------------------------------------------------- */ #include "compute_deprecated.h" -#include + #include "comm.h" #include "error.h" -#include "utils.h" using namespace LAMMPS_NS; diff --git a/src/compute_dihedral.cpp b/src/compute_dihedral.cpp index e50903104a..64d9c8b37e 100644 --- a/src/compute_dihedral.cpp +++ b/src/compute_dihedral.cpp @@ -12,12 +12,12 @@ ------------------------------------------------------------------------- */ #include "compute_dihedral.h" -#include -#include "update.h" -#include "force.h" + #include "dihedral.h" #include "dihedral_hybrid.h" #include "error.h" +#include "force.h" +#include "update.h" using namespace LAMMPS_NS; @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeDihedral::ComputeDihedral(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute dihedral command"); diff --git a/src/compute_dihedral_local.cpp b/src/compute_dihedral_local.cpp index ac2c884c3f..64bcdc16fb 100644 --- a/src/compute_dihedral_local.cpp +++ b/src/compute_dihedral_local.cpp @@ -38,7 +38,7 @@ enum{PHI,VARIABLE}; ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bstyle(NULL), vvar(NULL), pstr(NULL), vstr(NULL), vlocal(NULL), alocal(NULL) + bstyle(nullptr), vvar(nullptr), pstr(nullptr), vstr(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute dihedral/local command"); @@ -74,7 +74,7 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : // optional args setflag = 0; - pstr = NULL; + pstr = nullptr; while (iarg < narg) { if (strcmp(arg[iarg],"set") == 0) { @@ -122,8 +122,8 @@ ComputeDihedralLocal::ComputeDihedralLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -145,7 +145,7 @@ ComputeDihedralLocal::~ComputeDihedralLocal() void ComputeDihedralLocal::init() { - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"No dihedral style is defined for compute dihedral/local"); if (nvar) { @@ -224,7 +224,7 @@ int ComputeDihedralLocal::compute_dihedrals(int flag) for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; - if (molecular == 1) nd = num_dihedral[atom2]; + if (molecular == Atom::MOLECULAR) nd = num_dihedral[atom2]; else { if (molindex[atom2] < 0) continue; imol = molindex[atom2]; @@ -233,7 +233,7 @@ int ComputeDihedralLocal::compute_dihedrals(int flag) } for (i = 0; i < nd; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (tag[atom2] != dihedral_atom2[atom2][i]) continue; atom1 = atom->map(dihedral_atom1[atom2][i]); atom3 = atom->map(dihedral_atom3[atom2][i]); diff --git a/src/compute_dipole_chunk.cpp b/src/compute_dipole_chunk.cpp index 3790da2035..f387786b83 100644 --- a/src/compute_dipole_chunk.cpp +++ b/src/compute_dipole_chunk.cpp @@ -12,17 +12,18 @@ ------------------------------------------------------------------------- */ #include "compute_dipole_chunk.h" -#include -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "compute_chunk_atom.h" #include "domain.h" -#include "memory.h" #include "error.h" #include "math_special.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathSpecial; @@ -33,9 +34,9 @@ enum { MASSCENTER, GEOMCENTER }; ComputeDipoleChunk::ComputeDipoleChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), chrgproc(NULL), - chrgtotal(NULL), com(NULL), - comall(NULL), dipole(NULL), dipoleall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), chrgproc(nullptr), + chrgtotal(nullptr), com(nullptr), + comall(nullptr), dipole(nullptr), dipoleall(nullptr) { if ((narg != 4) && (narg != 5)) error->all(FLERR,"Illegal compute dipole/chunk command"); diff --git a/src/compute_displace_atom.cpp b/src/compute_displace_atom.cpp index b20dd3bec3..bd939f1402 100644 --- a/src/compute_displace_atom.cpp +++ b/src/compute_displace_atom.cpp @@ -12,19 +12,20 @@ ------------------------------------------------------------------------- */ #include "compute_displace_atom.h" + +#include "atom.h" +#include "domain.h" +#include "error.h" +#include "fix_store.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + #include #include -#include "atom.h" -#include "update.h" -#include "group.h" -#include "domain.h" -#include "modify.h" -#include "fix_store.h" -#include "input.h" -#include "variable.h" -#include "memory.h" -#include "error.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -32,7 +33,7 @@ using namespace LAMMPS_NS; ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - displace(NULL), id_fix(NULL) + displace(nullptr), id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute displace/atom command"); @@ -43,7 +44,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // optional args refreshflag = 0; - rvar = NULL; + rvar = nullptr; int iarg = 3; while (iarg < narg) { @@ -101,7 +102,7 @@ ComputeDisplaceAtom::ComputeDisplaceAtom(LAMMPS *lmp, int narg, char **arg) : // per-atom displacement array nmax = nvmax = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_erotate_sphere.cpp b/src/compute_erotate_sphere.cpp index 2a8588f061..447b28b51a 100644 --- a/src/compute_erotate_sphere.cpp +++ b/src/compute_erotate_sphere.cpp @@ -12,11 +12,11 @@ ------------------------------------------------------------------------- */ #include "compute_erotate_sphere.h" -#include + #include "atom.h" -#include "update.h" -#include "force.h" #include "error.h" +#include "force.h" +#include "update.h" using namespace LAMMPS_NS; diff --git a/src/compute_erotate_sphere_atom.cpp b/src/compute_erotate_sphere_atom.cpp index 78664a912f..d3f0d723c6 100644 --- a/src/compute_erotate_sphere_atom.cpp +++ b/src/compute_erotate_sphere_atom.cpp @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeErotateSphereAtom:: ComputeErotateSphereAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - erot(NULL) + erot(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute erotate/sphere//atom command"); diff --git a/src/compute_fragment_atom.cpp b/src/compute_fragment_atom.cpp index 664e2fa9ec..85497bce02 100644 --- a/src/compute_fragment_atom.cpp +++ b/src/compute_fragment_atom.cpp @@ -16,17 +16,17 @@ ------------------------------------------------------------------------- */ #include "compute_fragment_atom.h" -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "update.h" -#include "modify.h" -#include "force.h" -#include "group.h" #include "comm.h" -#include "memory.h" #include "error.h" +#include "group.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -36,7 +36,7 @@ using namespace LAMMPS_NS; ComputeFragmentAtom::ComputeFragmentAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - fragmentID(NULL) + fragmentID(nullptr) { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Compute fragment/atom used when bonds are not allowed"); @@ -61,9 +61,9 @@ ComputeFragmentAtom::ComputeFragmentAtom(LAMMPS *lmp, int narg, char **arg) : } nmax = 0; - stack = NULL; - clist = NULL; - markflag = NULL; + stack = nullptr; + clist = nullptr; + markflag = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_global_atom.cpp b/src/compute_global_atom.cpp index f015ec910a..03d9ba4ecb 100644 --- a/src/compute_global_atom.cpp +++ b/src/compute_global_atom.cpp @@ -12,16 +12,17 @@ ------------------------------------------------------------------------- */ #include "compute_global_atom.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "input.h" -#include "variable.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; @@ -38,8 +39,8 @@ enum{VECTOR,ARRAY}; ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idref(NULL), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), - indices(NULL), varatom(NULL), vecglobal(NULL) + idref(nullptr), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), + indices(nullptr), varatom(nullptr), vecglobal(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute global/atom command"); @@ -80,7 +81,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - int nargnew = input->expand_args(narg-iarg,&arg[iarg],1,earg); + int nargnew = utils::expand_args(FLERR,narg-iarg,&arg[iarg],1,earg,lmp); if (earg != &arg[iarg]) expand = 1; arg = earg; @@ -95,7 +96,7 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0 || strncmp(arg[iarg],"v_",2) == 0) { @@ -233,8 +234,8 @@ ComputeGlobalAtom::ComputeGlobalAtom(LAMMPS *lmp, int narg, char **arg) : else size_peratom_cols = nvalues; nmax = maxvector = 0; - vector_atom = NULL; - array_atom = NULL; + vector_atom = nullptr; + array_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_group_group.cpp b/src/compute_group_group.cpp index c8876daeef..90956c6b15 100644 --- a/src/compute_group_group.cpp +++ b/src/compute_group_group.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "compute_group_group.h" -#include + #include #include #include "atom.h" @@ -45,7 +45,7 @@ enum{OFF,INTER,INTRA}; ComputeGroupGroup::ComputeGroupGroup(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - group2(NULL) + group2(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute group/group command"); @@ -122,15 +122,15 @@ void ComputeGroupGroup::init() // if non-hybrid, then error if single_enable = 0 // if hybrid, let hybrid determine if sub-style sets single_enable = 0 - if (pairflag && force->pair == NULL) + if (pairflag && force->pair == nullptr) error->all(FLERR,"No pair style defined for compute group/group"); - if (force->pair_match("^hybrid",0) == NULL + if (force->pair_match("^hybrid",0) == nullptr && force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute group/group"); // error if Kspace style does not compute group/group interactions - if (kspaceflag && force->kspace == NULL) + if (kspaceflag && force->kspace == nullptr) error->all(FLERR,"No Kspace style defined for compute group/group"); if (kspaceflag && force->kspace->group_group_enable == 0) error->all(FLERR,"Kspace style does not support compute group/group"); @@ -138,10 +138,10 @@ void ComputeGroupGroup::init() if (pairflag) { pair = force->pair; cutsq = force->pair->cutsq; - } else pair = NULL; + } else pair = nullptr; if (kspaceflag) kspace = force->kspace; - else kspace = NULL; + else kspace = nullptr; // compute Kspace correction terms diff --git a/src/compute_gyration.cpp b/src/compute_gyration.cpp index bce0c0de85..81876109c4 100644 --- a/src/compute_gyration.cpp +++ b/src/compute_gyration.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_gyration.h" -#include + #include "update.h" #include "atom.h" #include "group.h" diff --git a/src/compute_gyration_chunk.cpp b/src/compute_gyration_chunk.cpp index 5677ce4b6a..f7e7c8ced9 100644 --- a/src/compute_gyration_chunk.cpp +++ b/src/compute_gyration_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_gyration_chunk.h" -#include + #include #include #include "atom.h" @@ -29,8 +29,8 @@ using namespace LAMMPS_NS; ComputeGyrationChunk::ComputeGyrationChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - rg(NULL), rgall(NULL), rgt(NULL), rgtall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), + rg(nullptr), rgall(nullptr), rgt(nullptr), rgtall(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute gyration/chunk command"); diff --git a/src/compute_heat_flux.cpp b/src/compute_heat_flux.cpp index 7b607bd4db..bcb10c833a 100644 --- a/src/compute_heat_flux.cpp +++ b/src/compute_heat_flux.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "compute_heat_flux.h" -#include + #include #include "atom.h" #include "update.h" @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputeHeatFlux::ComputeHeatFlux(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_ke(NULL), id_pe(NULL), id_stress(NULL) + id_ke(nullptr), id_pe(nullptr), id_stress(nullptr) { if (narg != 6) error->all(FLERR,"Illegal compute heat/flux command"); diff --git a/src/compute_hexorder_atom.cpp b/src/compute_hexorder_atom.cpp index b4ffd91b43..736a7e64c6 100644 --- a/src/compute_hexorder_atom.cpp +++ b/src/compute_hexorder_atom.cpp @@ -45,7 +45,7 @@ using namespace MathConst; ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - distsq(NULL), nearest(NULL), qnarray(NULL) + distsq(nullptr), nearest(nullptr), qnarray(nullptr) { if (narg < 3 ) error->all(FLERR,"Illegal compute hexorder/atom command"); @@ -59,7 +59,7 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"degree") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute hexorder/atom command"); - ndegree = force->numeric(FLERR,arg[iarg+1]); + ndegree = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (ndegree < 0) error->all(FLERR,"Illegal compute hexorder/atom command"); iarg += 2; @@ -68,14 +68,14 @@ ComputeHexOrderAtom::ComputeHexOrderAtom(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"NULL") == 0) nnn = 0; else { - nnn = force->numeric(FLERR,arg[iarg+1]); + nnn = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (nnn < 0) error->all(FLERR,"Illegal compute hexorder/atom command"); } iarg += 2; } else if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute hexorder/atom command"); - double cutoff = force->numeric(FLERR,arg[iarg+1]); + double cutoff = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Illegal compute hexorder/atom command"); cutsq = cutoff*cutoff; @@ -104,7 +104,7 @@ ComputeHexOrderAtom::~ComputeHexOrderAtom() void ComputeHexOrderAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute hexorder/atom requires a pair style be defined"); if (cutsq == 0.0) cutsq = force->pair->cutforce * force->pair->cutforce; else if (sqrt(cutsq) > force->pair->cutforce) diff --git a/src/compute_improper.cpp b/src/compute_improper.cpp index 181771dcfb..aa65bde661 100644 --- a/src/compute_improper.cpp +++ b/src/compute_improper.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_improper.h" -#include + #include "update.h" #include "force.h" #include "improper.h" @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; ComputeImproper::ComputeImproper(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - emine(NULL) + emine(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute improper command"); diff --git a/src/compute_improper_local.cpp b/src/compute_improper_local.cpp index e363749b67..edad52050c 100644 --- a/src/compute_improper_local.cpp +++ b/src/compute_improper_local.cpp @@ -35,7 +35,7 @@ using namespace MathConst; ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vlocal(NULL), alocal(NULL) + vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute improper/local command"); @@ -57,8 +57,8 @@ ComputeImproperLocal::ComputeImproperLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -73,7 +73,7 @@ ComputeImproperLocal::~ComputeImproperLocal() void ComputeImproperLocal::init() { - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"No improper style is defined for compute improper/local"); // do initial memory allocation so that memory_usage() is correct @@ -135,7 +135,7 @@ int ComputeImproperLocal::compute_impropers(int flag) if (cflag >= 0) cbuf = vlocal; } else { if (cflag >= 0 && alocal) cbuf = &alocal[0][cflag]; - else cbuf = NULL; + else cbuf = nullptr; } } @@ -143,7 +143,7 @@ int ComputeImproperLocal::compute_impropers(int flag) for (atom2 = 0; atom2 < nlocal; atom2++) { if (!(mask[atom2] & groupbit)) continue; - if (molecular == 1) ni = num_improper[atom2]; + if (molecular == Atom::MOLECULAR) ni = num_improper[atom2]; else { if (molindex[atom2] < 0) continue; imol = molindex[atom2]; @@ -152,7 +152,7 @@ int ComputeImproperLocal::compute_impropers(int flag) } for (i = 0; i < ni; i++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (tag[atom2] != improper_atom2[atom2][i]) continue; atom1 = atom->map(improper_atom1[atom2][i]); atom3 = atom->map(improper_atom3[atom2][i]); diff --git a/src/compute_inertia_chunk.cpp b/src/compute_inertia_chunk.cpp index be980a08ee..ba7c4f36fc 100644 --- a/src/compute_inertia_chunk.cpp +++ b/src/compute_inertia_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_inertia_chunk.h" -#include + #include #include "atom.h" #include "update.h" @@ -28,8 +28,8 @@ using namespace LAMMPS_NS; ComputeInertiaChunk::ComputeInertiaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), - inertia(NULL), inertiaall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), + inertia(nullptr), inertiaall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute inertia/chunk command"); diff --git a/src/compute_ke.cpp b/src/compute_ke.cpp index c6ba478dcb..e673f7fe53 100644 --- a/src/compute_ke.cpp +++ b/src/compute_ke.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_ke.h" -#include + #include "atom.h" #include "update.h" #include "force.h" diff --git a/src/compute_ke_atom.cpp b/src/compute_ke_atom.cpp index 102d6364ff..65b3140d79 100644 --- a/src/compute_ke_atom.cpp +++ b/src/compute_ke_atom.cpp @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; ComputeKEAtom::ComputeKEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - ke(NULL) + ke(nullptr) { if (narg != 3) error->all(FLERR,"Illegal compute ke/atom command"); diff --git a/src/compute_msd.cpp b/src/compute_msd.cpp index 930f979bf0..41ffa95fef 100644 --- a/src/compute_msd.cpp +++ b/src/compute_msd.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "compute_msd.h" -#include + #include -#include + #include "atom.h" #include "update.h" #include "group.h" @@ -22,7 +22,7 @@ #include "modify.h" #include "fix_store.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; @@ -30,7 +30,7 @@ using namespace LAMMPS_NS; ComputeMSD::ComputeMSD(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL) + id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute msd command"); diff --git a/src/compute_msd_chunk.cpp b/src/compute_msd_chunk.cpp index dda921ef42..2c3c2811d2 100644 --- a/src/compute_msd_chunk.cpp +++ b/src/compute_msd_chunk.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "compute_msd_chunk.h" -#include + #include -#include + #include "atom.h" #include "group.h" #include "update.h" @@ -24,7 +24,7 @@ #include "fix_store.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; ComputeMSDChunk::ComputeMSDChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), id_fix(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), msd(NULL) + idchunk(nullptr), id_fix(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), msd(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute msd/chunk command"); diff --git a/src/compute_omega_chunk.cpp b/src/compute_omega_chunk.cpp index 327c64493f..b88db4be92 100644 --- a/src/compute_omega_chunk.cpp +++ b/src/compute_omega_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_omega_chunk.h" -#include + #include #include "atom.h" #include "update.h" @@ -20,6 +20,7 @@ #include "compute_chunk_atom.h" #include "domain.h" #include "math_extra.h" +#include "math_eigen.h" #include "memory.h" #include "error.h" @@ -31,8 +32,8 @@ using namespace LAMMPS_NS; ComputeOmegaChunk::ComputeOmegaChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL),massproc(NULL),masstotal(NULL),com(NULL),comall(NULL), - inertia(NULL),inertiaall(NULL),angmom(NULL),angmomall(NULL),omega(NULL) + idchunk(nullptr),massproc(nullptr),masstotal(nullptr),com(nullptr),comall(nullptr), + inertia(nullptr),inertiaall(nullptr),angmom(nullptr),angmomall(nullptr),omega(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute omega/chunk command"); @@ -250,10 +251,10 @@ void ComputeOmegaChunk::compute_array() // handle each (nearly) singular I matrix // due to 2-atom chunk or linear molecule - // use jacobi() and angmom_to_omega() to calculate valid omega + // use jacobi3() and angmom_to_omega() to calculate valid omega } else { - int ierror = MathExtra::jacobi(ione,idiag,evectors); + int ierror = MathEigen::jacobi3(ione,idiag,evectors); if (ierror) error->all(FLERR, "Insufficient Jacobi rotations for omega/chunk"); diff --git a/src/compute_orientorder_atom.cpp b/src/compute_orientorder_atom.cpp index c278ccc520..e76081e0b8 100644 --- a/src/compute_orientorder_atom.cpp +++ b/src/compute_orientorder_atom.cpp @@ -17,26 +17,25 @@ ------------------------------------------------------------------------- */ #include "compute_orientorder_atom.h" -#include -#include -#include + #include "atom.h" -#include "update.h" +#include "comm.h" +#include "error.h" +#include "force.h" +#include "math_const.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" #include "neigh_list.h" #include "neigh_request.h" -#include "force.h" +#include "neighbor.h" #include "pair.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "math_const.h" -#include "fmt/format.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; -using namespace std; #ifdef DBL_EPSILON #define MY_EPSILON (10.0*DBL_EPSILON) @@ -50,8 +49,8 @@ using namespace std; ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - qlist(NULL), distsq(NULL), nearest(NULL), rlist(NULL), - qnarray(NULL), qnm_r(NULL), qnm_i(NULL), cglist(NULL) + qlist(nullptr), distsq(nullptr), nearest(nullptr), rlist(nullptr), + qnarray(nullptr), qnm_r(nullptr), qnm_i(nullptr), cglist(nullptr) { if (narg < 3 ) error->all(FLERR,"Illegal compute orientorder/atom command"); @@ -85,7 +84,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg if (strcmp(arg[iarg+1],"NULL") == 0) { nnn = 0; } else { - nnn = force->numeric(FLERR,arg[iarg+1]); + nnn = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (nnn <= 0) error->all(FLERR,"Illegal compute orientorder/atom command"); } @@ -93,7 +92,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg } else if (strcmp(arg[iarg],"degrees") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - nqlist = force->numeric(FLERR,arg[iarg+1]); + nqlist = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (nqlist <= 0) error->all(FLERR,"Illegal compute orientorder/atom command"); memory->destroy(qlist); @@ -103,7 +102,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg error->all(FLERR,"Illegal compute orientorder/atom command"); qmax = 0; for (int il = 0; il < nqlist; il++) { - qlist[il] = force->numeric(FLERR,arg[iarg+il]); + qlist[il] = utils::numeric(FLERR,arg[iarg+il],false,lmp); if (qlist[il] < 0) error->all(FLERR,"Illegal compute orientorder/atom command"); if (qlist[il] > qmax) qmax = qlist[il]; @@ -127,7 +126,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg qlcompflag = 1; if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - qlcomp = force->numeric(FLERR,arg[iarg+1]); + qlcomp = utils::numeric(FLERR,arg[iarg+1],false,lmp); iqlcomp = -1; for (int il = 0; il < nqlist; il++) if (qlcomp == qlist[il]) { @@ -140,7 +139,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg } else if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - double cutoff = force->numeric(FLERR,arg[iarg+1]); + double cutoff = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutoff <= 0.0) error->all(FLERR,"Illegal compute orientorder/atom command"); cutsq = cutoff*cutoff; @@ -148,7 +147,7 @@ ComputeOrientOrderAtom::ComputeOrientOrderAtom(LAMMPS *lmp, int narg, char **arg } else if (strcmp(arg[iarg],"chunksize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute orientorder/atom command"); - chunksize = force->numeric(FLERR,arg[iarg+1]); + chunksize = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (chunksize <= 0) error->all(FLERR,"Illegal compute orientorder/atom command"); iarg += 2; @@ -187,7 +186,7 @@ ComputeOrientOrderAtom::~ComputeOrientOrderAtom() void ComputeOrientOrderAtom::init() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Compute orientorder/atom requires a " "pair style be defined"); if (cutsq == 0.0) cutsq = force->pair->cutforce * force->pair->cutforce; diff --git a/src/compute_pair.cpp b/src/compute_pair.cpp index e9a3faf723..15b5bec19a 100644 --- a/src/compute_pair.cpp +++ b/src/compute_pair.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_pair.h" -#include + #include #include #include "update.h" @@ -28,7 +28,7 @@ enum{EPAIR,EVDWL,ECOUL}; ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pair(NULL), one(NULL) + pstyle(nullptr), pair(nullptr), one(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pair command"); @@ -48,7 +48,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : if (narg > iarg) { if (isdigit(arg[iarg][0])) { - nsub = force->inumeric(FLERR,arg[iarg]); + nsub = utils::inumeric(FLERR,arg[iarg],false,lmp); ++iarg; if (nsub <= 0) error->all(FLERR,"Illegal compute pair command"); @@ -82,7 +82,7 @@ ComputePair::ComputePair(LAMMPS *lmp, int narg, char **arg) : extvector = 1; one = new double[npair]; vector = new double[npair]; - } else one = vector = NULL; + } else one = vector = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_pair_local.cpp b/src/compute_pair_local.cpp index 2018d929f3..a8fa247e4d 100644 --- a/src/compute_pair_local.cpp +++ b/src/compute_pair_local.cpp @@ -12,18 +12,19 @@ ------------------------------------------------------------------------- */ #include "compute_pair_local.h" + +#include "atom.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "pair.h" +#include "update.h" + #include #include -#include -#include "atom.h" -#include "update.h" -#include "force.h" -#include "pair.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "neigh_list.h" -#include "memory.h" -#include "error.h" using namespace LAMMPS_NS; @@ -36,7 +37,7 @@ enum{TYPE,RADIUS}; ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - pstyle(NULL), pindex(NULL), vlocal(NULL), alocal(NULL) + pstyle(nullptr), pindex(nullptr), vlocal(nullptr), alocal(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pair/local command"); @@ -96,8 +97,8 @@ ComputePairLocal::ComputePairLocal(LAMMPS *lmp, int narg, char **arg) : else size_local_cols = nvalues; nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -114,7 +115,7 @@ ComputePairLocal::~ComputePairLocal() void ComputePairLocal::init() { - if (singleflag && force->pair == NULL) + if (singleflag && force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute pair/local"); if (singleflag && force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute pair/local"); diff --git a/src/compute_pe.cpp b/src/compute_pe.cpp index 379de0f9de..d9ed312328 100644 --- a/src/compute_pe.cpp +++ b/src/compute_pe.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_pe.h" -#include + #include #include "atom.h" #include "update.h" diff --git a/src/compute_pe_atom.cpp b/src/compute_pe_atom.cpp index 6bdd729502..374a3151ce 100644 --- a/src/compute_pe_atom.cpp +++ b/src/compute_pe_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePEAtom::ComputePEAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - energy(NULL) + energy(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute pe/atom command"); diff --git a/src/compute_pressure.cpp b/src/compute_pressure.cpp index cb0743a7d6..5c6cbcb71a 100644 --- a/src/compute_pressure.cpp +++ b/src/compute_pressure.cpp @@ -12,30 +12,31 @@ ------------------------------------------------------------------------- */ #include "compute_pressure.h" -#include -#include + +#include "angle.h" #include "atom.h" -#include "update.h" +#include "bond.h" +#include "dihedral.h" #include "domain.h" -#include "modify.h" +#include "error.h" #include "fix.h" #include "force.h" -#include "pair.h" -#include "pair_hybrid.h" -#include "bond.h" -#include "angle.h" -#include "dihedral.h" #include "improper.h" #include "kspace.h" -#include "error.h" +#include "modify.h" +#include "pair.h" +#include "pair_hybrid.h" +#include "update.h" +#include +#include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vptr(NULL), id_temp(NULL) + vptr(nullptr), id_temp(nullptr), pstyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute pressure command"); if (igroup) error->all(FLERR,"Compute pressure must use group all"); @@ -50,7 +51,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : // store temperature ID used by pressure computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -90,7 +91,7 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : if (narg > iarg) { if (isdigit(arg[iarg][0])) { - nsub = force->inumeric(FLERR,arg[iarg]); + nsub = utils::inumeric(FLERR,arg[iarg],false,lmp); ++iarg; if (nsub <= 0) error->all(FLERR,"Illegal compute pressure command"); @@ -129,13 +130,13 @@ ComputePressure::ComputePressure(LAMMPS *lmp, int narg, char **arg) : // error check - if (keflag && id_temp == NULL) + if (keflag && id_temp == nullptr) error->all(FLERR,"Compute pressure requires temperature ID " "to include kinetic energy"); vector = new double[size_vector]; nvirial = 0; - vptr = NULL; + vptr = nullptr; } /* ---------------------------------------------------------------------- */ @@ -145,6 +146,7 @@ ComputePressure::~ComputePressure() delete [] id_temp; delete [] vector; delete [] vptr; + delete [] pstyle; } /* ---------------------------------------------------------------------- */ @@ -184,14 +186,16 @@ void ComputePressure::init() delete [] vptr; nvirial = 0; - vptr = NULL; + vptr = nullptr; if (pairhybridflag && force->pair) nvirial++; if (pairflag && force->pair) nvirial++; - if (bondflag && atom->molecular && force->bond) nvirial++; - if (angleflag && atom->molecular && force->angle) nvirial++; - if (dihedralflag && atom->molecular && force->dihedral) nvirial++; - if (improperflag && atom->molecular && force->improper) nvirial++; + if (atom->molecular != Atom::ATOMIC) { + if (bondflag && force->bond) nvirial++; + if (angleflag && force->angle) nvirial++; + if (dihedralflag && force->dihedral) nvirial++; + if (improperflag && force->improper) nvirial++; + } if (fixflag) for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->thermo_virial) nvirial++; @@ -220,7 +224,7 @@ void ComputePressure::init() // flag Kspace contribution separately, since not summed across procs if (kspaceflag && force->kspace) kspace_virial = force->kspace->virial; - else kspace_virial = NULL; + else kspace_virial = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/compute_property_atom.cpp b/src/compute_property_atom.cpp index 9c637edc1e..e23458d201 100644 --- a/src/compute_property_atom.cpp +++ b/src/compute_property_atom.cpp @@ -33,7 +33,7 @@ using namespace LAMMPS_NS; ComputePropertyAtom::ComputePropertyAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - index(NULL), pack_choice(NULL) + index(nullptr), pack_choice(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute property/atom command"); @@ -441,7 +441,7 @@ void ComputePropertyAtom::compute_peratom() (this->*pack_choice[0])(0); } else { if (nmax) buf = &array_atom[0][0]; - else buf = NULL; + else buf = nullptr; for (int n = 0; n < nvalues; n++) (this->*pack_choice[n])(n); } diff --git a/src/compute_property_chunk.cpp b/src/compute_property_chunk.cpp index 579c7cae3f..ad21e80296 100644 --- a/src/compute_property_chunk.cpp +++ b/src/compute_property_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_property_chunk.h" -#include + #include #include "atom.h" #include "update.h" @@ -27,7 +27,7 @@ using namespace LAMMPS_NS; ComputePropertyChunk::ComputePropertyChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), count_one(NULL), count_all(NULL) + idchunk(nullptr), count_one(nullptr), count_all(nullptr) { if (narg < 5) error->all(FLERR,"Illegal compute property/chunk command"); diff --git a/src/compute_property_local.cpp b/src/compute_property_local.cpp index 651e1190b1..36940164aa 100644 --- a/src/compute_property_local.cpp +++ b/src/compute_property_local.cpp @@ -35,7 +35,7 @@ enum{TYPE,RADIUS}; ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - vlocal(NULL), alocal(NULL), indices(NULL), pack_choice(NULL) + vlocal(nullptr), alocal(nullptr), indices(nullptr), pack_choice(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute property/local command"); @@ -233,7 +233,7 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : // error check - if (atom->molecular == 2 && (kindflag == BOND || kindflag == ANGLE || + if (atom->molecular == Atom::TEMPLATE && (kindflag == BOND || kindflag == ANGLE || kindflag == DIHEDRAL || kindflag == IMPROPER)) error->all(FLERR,"Compute property/local does not (yet) work " "with atom_style template"); @@ -254,8 +254,8 @@ ComputePropertyLocal::ComputePropertyLocal(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute property/local requires atom attribute radius"); nmax = 0; - vlocal = NULL; - alocal = NULL; + vlocal = nullptr; + alocal = nullptr; } /* ---------------------------------------------------------------------- */ @@ -273,7 +273,7 @@ ComputePropertyLocal::~ComputePropertyLocal() void ComputePropertyLocal::init() { if (kindflag == NEIGH || kindflag == PAIR) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"No pair style is defined for compute property/local"); if (force->pair->single_enable == 0) error->all(FLERR,"Pair style does not support compute property/local"); diff --git a/src/compute_rdf.cpp b/src/compute_rdf.cpp index 501a506c98..f4d553d2db 100644 --- a/src/compute_rdf.cpp +++ b/src/compute_rdf.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_rdf.h" -#include + #include #include #include "atom.h" @@ -33,6 +33,7 @@ #include "error.h" #include "comm.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -40,16 +41,16 @@ using namespace MathConst; ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - rdfpair(NULL), nrdfpair(NULL), ilo(NULL), ihi(NULL), jlo(NULL), jhi(NULL), - hist(NULL), histall(NULL), typecount(NULL), icount(NULL), jcount(NULL), - duplicates(NULL) + rdfpair(nullptr), nrdfpair(nullptr), ilo(nullptr), ihi(nullptr), jlo(nullptr), jhi(nullptr), + hist(nullptr), histall(nullptr), typecount(nullptr), icount(nullptr), jcount(nullptr), + duplicates(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute rdf command"); array_flag = 1; extarray = 0; - nbin = force->inumeric(FLERR,arg[3]); + nbin = utils::inumeric(FLERR,arg[3],false,lmp); if (nbin < 1) error->all(FLERR,"Illegal compute rdf command"); // optional args @@ -66,7 +67,7 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"cutoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute rdf command"); - cutoff_user = force->numeric(FLERR,arg[iarg+1]); + cutoff_user = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (cutoff_user <= 0.0) cutflag = 0; else cutflag = 1; iarg += 2; @@ -98,8 +99,8 @@ ComputeRDF::ComputeRDF(LAMMPS *lmp, int narg, char **arg) : } else { iarg = 4; for (int ipair = 0; ipair < npairs; ipair++) { - force->bounds(FLERR,arg[iarg],atom->ntypes,ilo[ipair],ihi[ipair]); - force->bounds(FLERR,arg[iarg+1],atom->ntypes,jlo[ipair],jhi[ipair]); + utils::bounds(FLERR,arg[iarg],1,atom->ntypes,ilo[ipair],ihi[ipair],error); + utils::bounds(FLERR,arg[iarg+1],1,atom->ntypes,jlo[ipair],jhi[ipair],error); if (ilo[ipair] > ihi[ipair] || jlo[ipair] > jhi[ipair]) error->all(FLERR,"Illegal compute rdf command"); iarg += 2; diff --git a/src/compute_reduce.cpp b/src/compute_reduce.cpp index 8467554faa..66af301e48 100644 --- a/src/compute_reduce.cpp +++ b/src/compute_reduce.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "compute_reduce.h" -#include + #include -#include + #include "atom.h" #include "update.h" #include "domain.h" @@ -26,6 +26,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; enum{SUM,SUMSQ,MINN,MAXX,AVE,AVESQ}; // also in ComputeReduceRegion @@ -43,14 +44,14 @@ enum{PERATOM,LOCAL}; ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), flavor(NULL), - value2index(NULL), ids(NULL), onevec(NULL), replace(NULL), indices(NULL), - owner(NULL), idregion(NULL), varatom(NULL) + nvalues(0), which(nullptr), argindex(nullptr), flavor(nullptr), + value2index(nullptr), ids(nullptr), onevec(nullptr), replace(nullptr), indices(nullptr), + owner(nullptr), idregion(nullptr), varatom(nullptr) { int iarg = 0; if (strcmp(style,"reduce") == 0) { if (narg < 5) error->all(FLERR,"Illegal compute reduce command"); - idregion = NULL; + idregion = nullptr; iarg = 3; } else if (strcmp(style,"reduce/region") == 0) { if (narg < 6) error->all(FLERR,"Illegal compute reduce/region command"); @@ -78,7 +79,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - int nargnew = input->expand_args(narg-iarg,&arg[iarg],1,earg); + int nargnew = utils::expand_args(FLERR,narg-iarg,&arg[iarg],1,earg,lmp); if (earg != &arg[iarg]) expand = 1; arg = earg; @@ -92,13 +93,13 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { which[i] = argindex[i] = flavor[i] = value2index[i] = UNKNOWN; - ids[i] = NULL; + ids[i] = nullptr; } nvalues = 0; iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"x") == 0) { which[nvalues] = X; @@ -189,7 +190,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : if (replace[i] >= 0) flag = 1; if (!flag) { delete [] replace; - replace = NULL; + replace = nullptr; } // if wildcard expansion occurred, free earg memory from expand_args() @@ -284,8 +285,8 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : scalar_flag = 1; if (mode == SUM || mode == SUMSQ) extscalar = 1; else extscalar = 0; - vector = onevec = NULL; - indices = owner = NULL; + vector = onevec = nullptr; + indices = owner = nullptr; } else { vector_flag = 1; size_vector = nvalues; @@ -298,7 +299,7 @@ ComputeReduce::ComputeReduce(LAMMPS *lmp, int narg, char **arg) : } maxatom = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_reduce.h b/src/compute_reduce.h index 9701f0e61e..00c1a9a6b9 100644 --- a/src/compute_reduce.h +++ b/src/compute_reduce.h @@ -20,7 +20,7 @@ ComputeStyle(reduce,ComputeReduce) #ifndef LMP_COMPUTE_REDUCE_H #define LMP_COMPUTE_REDUCE_H -#include "compute.h" +#include "compute.h" // IWYU pragma: export namespace LAMMPS_NS { diff --git a/src/compute_reduce_chunk.cpp b/src/compute_reduce_chunk.cpp index 3b68e20fcb..fbcf82619f 100644 --- a/src/compute_reduce_chunk.cpp +++ b/src/compute_reduce_chunk.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "compute_reduce_chunk.h" -#include + #include -#include + #include "atom.h" #include "update.h" #include "modify.h" @@ -26,6 +26,7 @@ #include "memory.h" #include "error.h" + using namespace LAMMPS_NS; enum{SUM,MINN,MAXX}; @@ -39,8 +40,8 @@ enum{UNKNOWN=-1,COMPUTE,FIX,VARIABLE}; ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - which(NULL), argindex(NULL), value2index(NULL), idchunk(NULL), ids(NULL), - vlocal(NULL), vglobal(NULL), alocal(NULL), aglobal(NULL), varatom(NULL) + which(nullptr), argindex(nullptr), value2index(nullptr), idchunk(nullptr), ids(nullptr), + vlocal(nullptr), vglobal(nullptr), alocal(nullptr), aglobal(nullptr), varatom(nullptr) { if (narg < 6) error->all(FLERR,"Illegal compute reduce/chunk command"); @@ -64,7 +65,7 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - int nargnew = input->expand_args(narg-iarg,&arg[iarg],1,earg); + int nargnew = utils::expand_args(FLERR,narg-iarg,&arg[iarg],1,earg,lmp); if (earg != &arg[iarg]) expand = 1; arg = earg; @@ -77,13 +78,13 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nargnew]; for (int i=0; i < nargnew; ++i) { which[i] = argindex[i] = value2index[i] = UNKNOWN; - ids[i] = NULL; + ids[i] = nullptr; } nvalues = 0; iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strncmp(arg[iarg],"c_",2) == 0 || strncmp(arg[iarg],"f_",2) == 0 || @@ -192,11 +193,11 @@ ComputeReduceChunk::ComputeReduceChunk(LAMMPS *lmp, int narg, char **arg) : else if (mode == MAXX) initvalue = -BIG; maxchunk = 0; - vlocal = vglobal = NULL; - alocal = aglobal = NULL; + vlocal = vglobal = nullptr; + alocal = aglobal = nullptr; maxatom = 0; - varatom = NULL; + varatom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/compute_reduce_region.cpp b/src/compute_reduce_region.cpp index 9074124a61..8153618a88 100644 --- a/src/compute_reduce_region.cpp +++ b/src/compute_reduce_region.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_reduce_region.h" -#include + #include "atom.h" #include "update.h" #include "modify.h" diff --git a/src/compute_slice.cpp b/src/compute_slice.cpp index 67b60882f6..7c56f07582 100644 --- a/src/compute_slice.cpp +++ b/src/compute_slice.cpp @@ -12,17 +12,16 @@ ------------------------------------------------------------------------- */ #include "compute_slice.h" -#include -#include -#include -#include "update.h" -#include "modify.h" + +#include "error.h" #include "fix.h" #include "input.h" -#include "variable.h" #include "memory.h" -#include "error.h" -#include "force.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; @@ -35,15 +34,15 @@ enum{COMPUTE,FIX,VARIABLE}; ComputeSlice::ComputeSlice(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr) { if (narg < 7) error->all(FLERR,"Illegal compute slice command"); MPI_Comm_rank(world,&me); - nstart = force->inumeric(FLERR,arg[3]); - nstop = force->inumeric(FLERR,arg[4]); - nskip = force->inumeric(FLERR,arg[5]); + nstart = utils::inumeric(FLERR,arg[3],false,lmp); + nstop = utils::inumeric(FLERR,arg[4],false,lmp); + nskip = utils::inumeric(FLERR,arg[5],false,lmp); if (nstart < 1 || nstop < nstart || nskip < 1) error->all(FLERR,"Illegal compute slice command"); @@ -225,6 +224,7 @@ ComputeSlice::~ComputeSlice() for (int m = 0; m < nvalues; m++) delete [] ids[m]; delete [] ids; delete [] value2index; + delete [] extlist; memory->destroy(vector); memory->destroy(array); diff --git a/src/compute_stress_atom.cpp b/src/compute_stress_atom.cpp index 9c65ee86c2..279d2af07c 100644 --- a/src/compute_stress_atom.cpp +++ b/src/compute_stress_atom.cpp @@ -36,7 +36,7 @@ enum{NOBIAS,BIAS}; ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_temp(NULL), stress(NULL) + id_temp(nullptr), stress(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute stress/atom command"); @@ -49,7 +49,7 @@ ComputeStressAtom::ComputeStressAtom(LAMMPS *lmp, int narg, char **arg) : // store temperature ID used by stress computation // insure it is valid for temperature computation - if (strcmp(arg[3],"NULL") == 0) id_temp = NULL; + if (strcmp(arg[3],"NULL") == 0) id_temp = nullptr; else { int n = strlen(arg[3]) + 1; id_temp = new char[n]; @@ -213,7 +213,7 @@ void ComputeStressAtom::compute_peratom() } // add in per-atom contributions from relevant fixes - // skip if vatom = NULL + // skip if vatom = nullptr // possible during setup phase if fix has not initialized its vatom yet // e.g. fix ave/spatial defined before fix shake, // and fix ave/spatial uses a per-atom stress from this compute as input diff --git a/src/compute_temp.cpp b/src/compute_temp.cpp index 402b84bb4b..6af5d2b86c 100644 --- a/src/compute_temp.cpp +++ b/src/compute_temp.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp.h" -#include + #include "atom.h" #include "update.h" #include "force.h" diff --git a/src/compute_temp_chunk.cpp b/src/compute_temp_chunk.cpp index 0fa5bbbb8a..f3110cfeca 100644 --- a/src/compute_temp_chunk.cpp +++ b/src/compute_temp_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_chunk.h" -#include + #include #include "atom.h" #include "update.h" @@ -31,8 +31,8 @@ enum{TEMP,KECOM,INTERNAL}; ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - which(NULL), idchunk(NULL), id_bias(NULL), sum(NULL), sumall(NULL), count(NULL), - countall(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) + which(nullptr), idchunk(nullptr), id_bias(nullptr), sum(nullptr), sumall(nullptr), count(nullptr), + countall(nullptr), massproc(nullptr), masstotal(nullptr), vcm(nullptr), vcmall(nullptr) { if (narg < 4) error->all(FLERR,"Illegal compute temp/chunk command"); @@ -71,7 +71,7 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : comflag = 0; biasflag = 0; - id_bias = NULL; + id_bias = nullptr; adof = domain->dimension; cdof = 0.0; @@ -94,12 +94,12 @@ ComputeTempChunk::ComputeTempChunk(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"adof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/chunk command"); - adof = force->numeric(FLERR,arg[iarg+1]); + adof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"cdof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/chunk command"); - cdof = force->numeric(FLERR,arg[iarg+1]); + cdof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else error->all(FLERR,"Illegal compute temp/chunk command"); } diff --git a/src/compute_temp_com.cpp b/src/compute_temp_com.cpp index dc12e8f6db..f69eaadf2b 100644 --- a/src/compute_temp_com.cpp +++ b/src/compute_temp_com.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_com.h" -#include + #include "atom.h" #include "update.h" #include "force.h" diff --git a/src/compute_temp_deform.cpp b/src/compute_temp_deform.cpp index 7d81a84bc4..75b784c858 100644 --- a/src/compute_temp_deform.cpp +++ b/src/compute_temp_deform.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_deform.h" -#include + #include #include "domain.h" #include "atom.h" @@ -47,7 +47,7 @@ ComputeTempDeform::ComputeTempDeform(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_partial.cpp b/src/compute_temp_partial.cpp index f5f29d9dc0..5ce62dfeb2 100644 --- a/src/compute_temp_partial.cpp +++ b/src/compute_temp_partial.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_partial.h" -#include + #include "atom.h" #include "update.h" #include "force.h" @@ -37,9 +37,9 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 1; - xflag = force->inumeric(FLERR,arg[3]); - yflag = force->inumeric(FLERR,arg[4]); - zflag = force->inumeric(FLERR,arg[5]); + xflag = utils::inumeric(FLERR,arg[3],false,lmp); + yflag = utils::inumeric(FLERR,arg[4],false,lmp); + zflag = utils::inumeric(FLERR,arg[5],false,lmp); if ((xflag != 0 && xflag != 1) || (yflag != 0 && yflag != 1) || (zflag != 0 && zflag != 1)) error->all(FLERR,"Illegal compute temp/partial command"); @@ -47,7 +47,7 @@ ComputeTempPartial::ComputeTempPartial(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Compute temp/partial cannot use vz for 2d systemx"); maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_profile.cpp b/src/compute_temp_profile.cpp index fce145848e..0344880e13 100644 --- a/src/compute_temp_profile.cpp +++ b/src/compute_temp_profile.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_profile.h" -#include + #include #include "atom.h" #include "update.h" @@ -30,7 +30,7 @@ enum{TENSOR,BIN}; ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - bin(NULL), vbin(NULL), binave(NULL), tbin(NULL), tbinall(NULL) + bin(nullptr), vbin(nullptr), binave(nullptr), tbin(nullptr), tbinall(nullptr) { if (narg < 7) error->all(FLERR,"Illegal compute temp/profile command"); @@ -39,9 +39,9 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : tempflag = 1; tempbias = 1; - xflag = force->inumeric(FLERR,arg[3]); - yflag = force->inumeric(FLERR,arg[4]); - zflag = force->inumeric(FLERR,arg[5]); + xflag = utils::inumeric(FLERR,arg[3],false,lmp); + yflag = utils::inumeric(FLERR,arg[4],false,lmp); + zflag = utils::inumeric(FLERR,arg[5],false,lmp); if (zflag && domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot use vz for 2d systemx"); @@ -57,44 +57,44 @@ ComputeTempProfile::ComputeTempProfile(LAMMPS *lmp, int narg, char **arg) : int iarg = 6; if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); - nbiny = force->inumeric(FLERR,arg[iarg+1]); + nbiny = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbinz = force->inumeric(FLERR,arg[iarg+1]); + nbinz = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); - nbiny = force->inumeric(FLERR,arg[iarg+2]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbiny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbiny = force->inumeric(FLERR,arg[iarg+1]); - nbinz = force->inumeric(FLERR,arg[iarg+2]); + nbiny = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbinz = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); - nbinz = force->inumeric(FLERR,arg[iarg+2]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbinz = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"xyz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal compute temp/profile command"); if (domain->dimension == 2) error->all(FLERR,"Compute temp/profile cannot bin z for 2d systems"); - nbinx = force->inumeric(FLERR,arg[iarg+1]); - nbiny = force->inumeric(FLERR,arg[iarg+2]); - nbinz = force->inumeric(FLERR,arg[iarg+3]); + nbinx = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nbiny = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nbinz = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else error->all(FLERR,"Illegal compute temp/profile command"); diff --git a/src/compute_temp_ramp.cpp b/src/compute_temp_ramp.cpp index 30f6701fcd..17509b85a0 100644 --- a/src/compute_temp_ramp.cpp +++ b/src/compute_temp_ramp.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_ramp.h" -#include + #include #include "atom.h" #include "update.h" @@ -71,14 +71,14 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal compute temp/ramp command"); if (v_dim == 0) { - v_lo = xscale*force->numeric(FLERR,arg[4]); - v_hi = xscale*force->numeric(FLERR,arg[5]); + v_lo = xscale*utils::numeric(FLERR,arg[4],false,lmp); + v_hi = xscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (v_dim == 1) { - v_lo = yscale*force->numeric(FLERR,arg[4]); - v_hi = yscale*force->numeric(FLERR,arg[5]); + v_lo = yscale*utils::numeric(FLERR,arg[4],false,lmp); + v_hi = yscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (v_dim == 2) { - v_lo = zscale*force->numeric(FLERR,arg[4]); - v_hi = zscale*force->numeric(FLERR,arg[5]); + v_lo = zscale*utils::numeric(FLERR,arg[4],false,lmp); + v_hi = zscale*utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"x") == 0) coord_dim = 0; @@ -87,18 +87,18 @@ ComputeTempRamp::ComputeTempRamp(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal compute temp/ramp command"); if (coord_dim == 0) { - coord_lo = xscale*force->numeric(FLERR,arg[7]); - coord_hi = xscale*force->numeric(FLERR,arg[8]); + coord_lo = xscale*utils::numeric(FLERR,arg[7],false,lmp); + coord_hi = xscale*utils::numeric(FLERR,arg[8],false,lmp); } else if (coord_dim == 1) { - coord_lo = yscale*force->numeric(FLERR,arg[7]); - coord_hi = yscale*force->numeric(FLERR,arg[8]); + coord_lo = yscale*utils::numeric(FLERR,arg[7],false,lmp); + coord_hi = yscale*utils::numeric(FLERR,arg[8],false,lmp); } else if (coord_dim == 2) { - coord_lo = zscale*force->numeric(FLERR,arg[7]); - coord_hi = zscale*force->numeric(FLERR,arg[8]); + coord_lo = zscale*utils::numeric(FLERR,arg[7],false,lmp); + coord_hi = zscale*utils::numeric(FLERR,arg[8],false,lmp); } maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_region.cpp b/src/compute_temp_region.cpp index 4c0b925eb6..8a8d671dfd 100644 --- a/src/compute_temp_region.cpp +++ b/src/compute_temp_region.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_region.h" -#include + #include #include "atom.h" #include "update.h" @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idregion(NULL) + idregion(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute temp/region command"); @@ -48,7 +48,7 @@ ComputeTempRegion::ComputeTempRegion(LAMMPS *lmp, int narg, char **arg) : tempbias = 1; maxbias = 0; - vbiasall = NULL; + vbiasall = nullptr; vector = new double[size_vector]; } diff --git a/src/compute_temp_sphere.cpp b/src/compute_temp_sphere.cpp index 786ef523ad..42dc790a3a 100644 --- a/src/compute_temp_sphere.cpp +++ b/src/compute_temp_sphere.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_temp_sphere.h" -#include + #include #include "atom.h" #include "update.h" @@ -32,7 +32,7 @@ enum{ROTATE,ALL}; ComputeTempSphere::ComputeTempSphere(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_bias(NULL) + id_bias(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute temp/sphere command"); diff --git a/src/compute_torque_chunk.cpp b/src/compute_torque_chunk.cpp index 35eef8fe10..df25591450 100644 --- a/src/compute_torque_chunk.cpp +++ b/src/compute_torque_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_torque_chunk.h" -#include + #include #include "atom.h" #include "update.h" @@ -28,7 +28,7 @@ using namespace LAMMPS_NS; ComputeTorqueChunk::ComputeTorqueChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), com(NULL), comall(NULL), torque(NULL), torqueall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), com(nullptr), comall(nullptr), torque(nullptr), torqueall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute torque/chunk command"); diff --git a/src/compute_vacf.cpp b/src/compute_vacf.cpp index ec19137a0e..a34c4bac8e 100644 --- a/src/compute_vacf.cpp +++ b/src/compute_vacf.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "compute_vacf.h" -#include + #include -#include + #include "atom.h" #include "update.h" #include "group.h" #include "modify.h" #include "fix_store.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; @@ -29,7 +29,7 @@ using namespace LAMMPS_NS; ComputeVACF::ComputeVACF(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - id_fix(NULL) + id_fix(nullptr) { if (narg < 3) error->all(FLERR,"Illegal compute vacf command"); diff --git a/src/compute_vcm_chunk.cpp b/src/compute_vcm_chunk.cpp index b0a8dbeee7..7edab91d54 100644 --- a/src/compute_vcm_chunk.cpp +++ b/src/compute_vcm_chunk.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "compute_vcm_chunk.h" -#include + #include #include "atom.h" #include "update.h" @@ -29,7 +29,7 @@ enum{ONCE,NFREQ,EVERY}; ComputeVCMChunk::ComputeVCMChunk(LAMMPS *lmp, int narg, char **arg) : Compute(lmp, narg, arg), - idchunk(NULL), massproc(NULL), masstotal(NULL), vcm(NULL), vcmall(NULL) + idchunk(nullptr), massproc(nullptr), masstotal(nullptr), vcm(nullptr), vcmall(nullptr) { if (narg != 4) error->all(FLERR,"Illegal compute vcm/chunk command"); diff --git a/src/create_atoms.cpp b/src/create_atoms.cpp index de20e15698..a22273f0e2 100644 --- a/src/create_atoms.cpp +++ b/src/create_atoms.cpp @@ -16,31 +16,27 @@ ------------------------------------------------------------------------- */ #include "create_atoms.h" -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "molecule.h" #include "comm.h" -#include "irregular.h" -#include "modify.h" -#include "force.h" -#include "special.h" #include "domain.h" -#include "lattice.h" -#include "region.h" -#include "input.h" -#include "variable.h" -#include "random_park.h" -#include "random_mars.h" -#include "math_extra.h" -#include "math_const.h" #include "error.h" +#include "input.h" +#include "irregular.h" +#include "lattice.h" +#include "math_const.h" +#include "math_extra.h" #include "memory.h" +#include "modify.h" +#include "molecule.h" +#include "random_mars.h" +#include "random_park.h" +#include "region.h" +#include "special.h" +#include "variable.h" -#include -#include "utils.h" -#include "fmt/format.h" +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -88,7 +84,7 @@ void CreateAtoms::command(int narg, char **arg) // parse arguments if (narg < 2) error->all(FLERR,"Illegal create_atoms command"); - ntype = force->inumeric(FLERR,arg[0]); + ntype = utils::inumeric(FLERR,arg[0],false,lmp); int iarg; if (strcmp(arg[1],"box") == 0) { @@ -107,15 +103,15 @@ void CreateAtoms::command(int narg, char **arg) } else if (strcmp(arg[1],"single") == 0) { style = SINGLE; if (narg < 5) error->all(FLERR,"Illegal create_atoms command"); - xone[0] = force->numeric(FLERR,arg[2]); - xone[1] = force->numeric(FLERR,arg[3]); - xone[2] = force->numeric(FLERR,arg[4]); + xone[0] = utils::numeric(FLERR,arg[2],false,lmp); + xone[1] = utils::numeric(FLERR,arg[3],false,lmp); + xone[2] = utils::numeric(FLERR,arg[4],false,lmp); iarg = 5; } else if (strcmp(arg[1],"random") == 0) { style = RANDOM; if (narg < 5) error->all(FLERR,"Illegal create_atoms command"); - nrandom = force->inumeric(FLERR,arg[2]); - seed = force->inumeric(FLERR,arg[3]); + nrandom = utils::inumeric(FLERR,arg[2],false,lmp); + seed = utils::inumeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"NULL") == 0) nregion = -1; else { nregion = domain->find_region(arg[4]); @@ -134,7 +130,7 @@ void CreateAtoms::command(int narg, char **arg) mode = ATOM; int molseed; varflag = 0; - vstr = xstr = ystr = zstr = NULL; + vstr = xstr = ystr = zstr = nullptr; quatone[0] = quatone[1] = quatone[2] = 0.0; subsetflag = NONE; int subsetseed; @@ -146,8 +142,8 @@ void CreateAtoms::command(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"basis") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command"); - int ibasis = force->inumeric(FLERR,arg[iarg+1]); - int itype = force->inumeric(FLERR,arg[iarg+2]); + int ibasis = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int itype = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (ibasis <= 0 || ibasis > nbasis || itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Invalid basis setting in create_atoms command"); basistype[ibasis-1] = itype; @@ -168,7 +164,7 @@ void CreateAtoms::command(int narg, char **arg) "create_atoms has multiple molecules"); mode = MOLECULE; onemol = atom->molecules[imol]; - molseed = force->inumeric(FLERR,arg[iarg+2]); + molseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"units") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_atoms command"); @@ -207,10 +203,10 @@ void CreateAtoms::command(int narg, char **arg) if (iarg+5 > narg) error->all(FLERR,"Illegal create_atoms command"); double thetaone; double axisone[3]; - thetaone = force->numeric(FLERR,arg[iarg+1]) / 180.0 * MY_PI;; - axisone[0] = force->numeric(FLERR,arg[iarg+2]); - axisone[1] = force->numeric(FLERR,arg[iarg+3]); - axisone[2] = force->numeric(FLERR,arg[iarg+4]); + thetaone = utils::numeric(FLERR,arg[iarg+1],false,lmp) / 180.0 * MY_PI;; + axisone[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + axisone[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + axisone[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (axisone[0] == 0.0 && axisone[1] == 0.0 && axisone[2] == 0.0) error->all(FLERR,"Illegal create_atoms command"); if (domain->dimension == 2 && (axisone[0] != 0.0 || axisone[1] != 0.0)) @@ -221,16 +217,16 @@ void CreateAtoms::command(int narg, char **arg) } else if (strcmp(arg[iarg],"ratio") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command"); subsetflag = RATIO; - subsetfrac = force->numeric(FLERR,arg[iarg+1]); - subsetseed = force->inumeric(FLERR,arg[iarg+2]); + subsetfrac = utils::numeric(FLERR,arg[iarg+1],false,lmp); + subsetseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (subsetfrac <= 0.0 || subsetfrac > 1.0 || subsetseed <= 0) error->all(FLERR,"Illegal create_atoms command"); iarg += 3; } else if (strcmp(arg[iarg],"subset") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal create_atoms command"); subsetflag = SUBSET; - nsubset = force->bnumeric(FLERR,arg[iarg+1]); - subsetseed = force->inumeric(FLERR,arg[iarg+2]); + nsubset = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); + subsetseed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nsubset <= 0 || subsetseed <= 0) error->all(FLERR,"Illegal create_atoms command"); iarg += 3; @@ -249,7 +245,7 @@ void CreateAtoms::command(int narg, char **arg) // error check and further setup for mode = MOLECULE - ranmol = NULL; + ranmol = nullptr; if (mode == MOLECULE) { if (onemol->xflag == 0) error->all(FLERR,"Create_atoms molecule must have coordinates"); @@ -271,7 +267,7 @@ void CreateAtoms::command(int narg, char **arg) ranmol = new RanMars(lmp,molseed+me); } - ranlatt = NULL; + ranlatt = nullptr; if (subsetflag != NONE) ranlatt = new RanMars(lmp,subsetseed+me); // error check and further setup for variable test @@ -429,7 +425,7 @@ void CreateAtoms::command(int narg, char **arg) // if global map exists, reset it // invoke map_init() b/c atom count has grown - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -515,10 +511,10 @@ void CreateAtoms::command(int narg, char **arg) molecule[ilocal] = moloffset + 1; } } - if (molecular == 2) { + if (molecular == Atom::TEMPLATE) { atom->molindex[ilocal] = 0; atom->molatom[ilocal] = m; - } else if (molecular) { + } else if (molecular != Atom::ATOMIC) { if (onemol->bondflag) for (int j = 0; j < num_bond[ilocal]; j++) bond_atom[ilocal][j] += offset; @@ -589,7 +585,7 @@ void CreateAtoms::command(int narg, char **arg) // only if onemol added bonds but not special info if (mode == MOLECULE) { - if (atom->molecular == 1 && onemol->bondflag && !onemol->specialflag) { + if (atom->molecular == Atom::MOLECULAR && onemol->bondflag && !onemol->specialflag) { Special special(lmp); special.build(); diff --git a/src/create_atoms.h b/src/create_atoms.h index 87d15d00bd..5508752f00 100644 --- a/src/create_atoms.h +++ b/src/create_atoms.h @@ -62,7 +62,7 @@ class CreateAtoms : protected Pointers { void add_random(); void add_lattice(); void loop_lattice(int); - void add_molecule(double *, double * = NULL); + void add_molecule(double *, double * = nullptr); int vartest(double *); // evaluate a variable with new atom position }; diff --git a/src/create_bonds.cpp b/src/create_bonds.cpp index e210a5e061..7bface4d02 100644 --- a/src/create_bonds.cpp +++ b/src/create_bonds.cpp @@ -18,21 +18,19 @@ ------------------------------------------------------------------------- */ #include "create_bonds.h" -#include -#include -#include + #include "atom.h" -#include "domain.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "neigh_list.h" #include "comm.h" -#include "group.h" -#include "special.h" +#include "domain.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "force.h" +#include "group.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "special.h" + +#include using namespace LAMMPS_NS; @@ -69,38 +67,38 @@ void CreateBonds::command(int narg, char **arg) igroup = group->find(arg[2]); if (igroup == -1) error->all(FLERR,"Cannot find create_bonds group ID"); group2bit = group->bitmask[igroup]; - btype = force->inumeric(FLERR,arg[3]); - rmin = force->numeric(FLERR,arg[4]); - rmax = force->numeric(FLERR,arg[5]); + btype = utils::inumeric(FLERR,arg[3],false,lmp); + rmin = utils::numeric(FLERR,arg[4],false,lmp); + rmax = utils::numeric(FLERR,arg[5],false,lmp); if (rmin > rmax) error->all(FLERR,"Illegal create_bonds command"); iarg = 6; } else if (strcmp(arg[0],"single/bond") == 0) { style = SBOND; if (narg < 4) error->all(FLERR,"Illegal create_bonds command"); - btype = force->inumeric(FLERR,arg[1]); - batom1 = force->tnumeric(FLERR,arg[2]); - batom2 = force->tnumeric(FLERR,arg[3]); + btype = utils::inumeric(FLERR,arg[1],false,lmp); + batom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + batom2 = utils::tnumeric(FLERR,arg[3],false,lmp); if (batom1 == batom2) error->all(FLERR,"Illegal create_bonds command"); iarg = 4; } else if (strcmp(arg[0],"single/angle") == 0) { style = SANGLE; if (narg < 5) error->all(FLERR,"Illegal create_bonds command"); - atype = force->inumeric(FLERR,arg[1]); - aatom1 = force->tnumeric(FLERR,arg[2]); - aatom2 = force->tnumeric(FLERR,arg[3]); - aatom3 = force->tnumeric(FLERR,arg[4]); + atype = utils::inumeric(FLERR,arg[1],false,lmp); + aatom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + aatom2 = utils::tnumeric(FLERR,arg[3],false,lmp); + aatom3 = utils::tnumeric(FLERR,arg[4],false,lmp); if ((aatom1 == aatom2) || (aatom1 == aatom3) || (aatom2 == aatom3)) error->all(FLERR,"Illegal create_bonds command"); iarg = 5; } else if (strcmp(arg[0],"single/dihedral") == 0) { style = SDIHEDRAL; if (narg < 6) error->all(FLERR,"Illegal create_bonds command"); - dtype = force->inumeric(FLERR,arg[1]); - datom1 = force->tnumeric(FLERR,arg[2]); - datom2 = force->tnumeric(FLERR,arg[3]); - datom3 = force->tnumeric(FLERR,arg[4]); - datom4 = force->tnumeric(FLERR,arg[5]); + dtype = utils::inumeric(FLERR,arg[1],false,lmp); + datom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + datom2 = utils::tnumeric(FLERR,arg[3],false,lmp); + datom3 = utils::tnumeric(FLERR,arg[4],false,lmp); + datom4 = utils::tnumeric(FLERR,arg[5],false,lmp); if ((datom1 == datom2) || (datom1 == datom3) || (datom1 == datom4) || (datom2 == datom3) || (datom2 == datom4) || (datom3 == datom4)) error->all(FLERR,"Illegal create_bonds command"); @@ -108,11 +106,11 @@ void CreateBonds::command(int narg, char **arg) } else if (strcmp(arg[0],"single/improper") == 0) { style = SIMPROPER; if (narg < 6) error->all(FLERR,"Illegal create_bonds command"); - dtype = force->inumeric(FLERR,arg[1]); - datom1 = force->tnumeric(FLERR,arg[2]); - datom2 = force->tnumeric(FLERR,arg[3]); - datom3 = force->tnumeric(FLERR,arg[4]); - datom4 = force->tnumeric(FLERR,arg[5]); + dtype = utils::inumeric(FLERR,arg[1],false,lmp); + datom1 = utils::tnumeric(FLERR,arg[2],false,lmp); + datom2 = utils::tnumeric(FLERR,arg[3],false,lmp); + datom3 = utils::tnumeric(FLERR,arg[4],false,lmp); + datom4 = utils::tnumeric(FLERR,arg[5],false,lmp); if ((datom1 == datom2) || (datom1 == datom3) || (datom1 == datom4) || (datom2 == datom3) || (datom2 == datom4) || (datom3 == datom4)) error->all(FLERR,"Illegal create_bonds command"); @@ -199,14 +197,14 @@ void CreateBonds::many() // error check on cutoff // if no pair style, neighbor list will be empty - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Create_bonds requires a pair style be defined"); if (rmax > neighbor->cutneighmax) error->all(FLERR,"Create_bonds max distance > neighbor cutoff"); if (rmax > neighbor->cutneighmin && comm->me == 0) error->warning(FLERR,"Create_bonds max distance > minimum neighbor cutoff"); - // require special_bonds 1-2 weights = 0.0 and KSpace = NULL + // require special_bonds 1-2 weights = 0.0 and KSpace = nullptr // so that already bonded atom pairs do not appear in neighbor list // otherwise with newton_bond = 1, // would be hard to check if I-J bond already existed diff --git a/src/create_box.cpp b/src/create_box.cpp index 4a826cb691..f5d9edb844 100644 --- a/src/create_box.cpp +++ b/src/create_box.cpp @@ -96,7 +96,7 @@ void CreateBox::command(int narg, char **arg) // set atom and topology type quantities - atom->ntypes = force->inumeric(FLERR,arg[0]); + atom->ntypes = utils::inumeric(FLERR,arg[0],false,lmp); atom->nbondtypes = 0; atom->nangletypes = 0; atom->ndihedraltypes = 0; @@ -110,53 +110,53 @@ void CreateBox::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->bonds_allow) error->all(FLERR,"No bonds allowed with this atom style"); - atom->nbondtypes = force->inumeric(FLERR,arg[iarg+1]); + atom->nbondtypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"angle/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->angles_allow) error->all(FLERR,"No angles allowed with this atom style"); - atom->nangletypes = force->inumeric(FLERR,arg[iarg+1]); + atom->nangletypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dihedral/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->dihedrals_allow) error->all(FLERR,"No dihedrals allowed with this atom style"); - atom->ndihedraltypes = force->inumeric(FLERR,arg[iarg+1]); + atom->ndihedraltypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"improper/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->impropers_allow) error->all(FLERR,"No impropers allowed with this atom style"); - atom->nimpropertypes = force->inumeric(FLERR,arg[iarg+1]); + atom->nimpropertypes = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/bond/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->bonds_allow) error->all(FLERR,"No bonds allowed with this atom style"); - atom->bond_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->bond_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/angle/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->angles_allow) error->all(FLERR,"No angles allowed with this atom style"); - atom->angle_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->angle_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/dihedral/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->dihedrals_allow) error->all(FLERR,"No dihedrals allowed with this atom style"); - atom->dihedral_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->dihedral_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/improper/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); if (!atom->avec->impropers_allow) error->all(FLERR,"No impropers allowed with this atom style"); - atom->improper_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->improper_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"extra/special/per/atom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal create_box command"); - force->special_extra = force->inumeric(FLERR,arg[iarg+1]); + force->special_extra = utils::inumeric(FLERR,arg[iarg+1],false,lmp); atom->maxspecial += force->special_extra; iarg += 2; } else error->all(FLERR,"Illegal create_box command"); diff --git a/src/delete_atoms.cpp b/src/delete_atoms.cpp index 03d5d2f65d..153e0c3bd7 100644 --- a/src/delete_atoms.cpp +++ b/src/delete_atoms.cpp @@ -12,33 +12,30 @@ ------------------------------------------------------------------------- */ #include "delete_atoms.h" -#include -#include -#include + #include "atom.h" #include "atom_vec.h" +#include "atom_vec_body.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "atom_vec_body.h" -#include "molecule.h" #include "comm.h" #include "domain.h" +#include "error.h" #include "force.h" #include "group.h" -#include "region.h" +#include "memory.h" #include "modify.h" -#include "neighbor.h" +#include "molecule.h" #include "neigh_list.h" #include "neigh_request.h" +#include "neighbor.h" #include "random_mars.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "region.h" +#include #include -#include +#include using namespace LAMMPS_NS; @@ -119,7 +116,7 @@ void DeleteAtoms::command(int narg, char **arg) // set all atom IDs to 0, call tag_extend() if (compress_flag) { - if (atom->molecular == 0) { + if (atom->molecular == Atom::ATOMIC) { tagint *tag = atom->tag; int nlocal = atom->nlocal; for (int i = 0; i < nlocal; i++) tag[i] = 0; @@ -162,7 +159,7 @@ void DeleteAtoms::command(int narg, char **arg) // reset atom->map if it exists // set nghost to 0 so old ghosts of deleted atoms won't be mapped - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->nghost = 0; atom->map_init(); atom->map_set(); @@ -270,7 +267,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) // read args - double cut = force->numeric(FLERR,arg[1]); + double cut = utils::numeric(FLERR,arg[1],false,lmp); double cutsq = cut*cut; int igroup1 = group->find(arg[2]); @@ -302,7 +299,7 @@ void DeleteAtoms::delete_overlap(int narg, char **arg) // error check on cutoff // if no pair style, neighbor list will be empty - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Delete_atoms requires a pair style be defined"); if (cut > neighbor->cutneighmax) error->all(FLERR,"Delete_atoms cutoff > max neighbor cutoff"); @@ -430,8 +427,8 @@ void DeleteAtoms::delete_porosity(int narg, char **arg) if (iregion == -1) error->all(FLERR,"Could not find delete_atoms region ID"); domain->regions[iregion]->prematch(); - double porosity_fraction = force->numeric(FLERR,arg[2]); - int seed = force->inumeric(FLERR,arg[3]); + double porosity_fraction = utils::numeric(FLERR,arg[2],false,lmp); + int seed = utils::inumeric(FLERR,arg[3],false,lmp); options(narg-4,&arg[4]); RanMars *random = new RanMars(lmp,seed + comm->me); @@ -479,7 +476,7 @@ void DeleteAtoms::delete_bond() for (int i = 0; i < nlocal; i++) if (dlist[i]) list[n++] = tag[i]; - comm->ring(n,sizeof(tagint),list,1,bondring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,bondring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -517,7 +514,7 @@ void DeleteAtoms::delete_molecule() std::map::iterator pos; for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first; - comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -525,7 +522,7 @@ void DeleteAtoms::delete_molecule() /* ---------------------------------------------------------------------- update bond,angle,etc counts - different for atom->molecular = 1 or 2 + different for atom->molecular = Atom::MOLECULAR or Atom::TEMPLATE ------------------------------------------------------------------------- */ void DeleteAtoms::recount_topology() @@ -535,7 +532,7 @@ void DeleteAtoms::recount_topology() bigint ndihedrals = 0; bigint nimpropers = 0; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { int *num_bond = atom->num_bond; int *num_angle = atom->num_angle; int *num_dihedral = atom->num_dihedral; @@ -549,7 +546,7 @@ void DeleteAtoms::recount_topology() if (num_improper) nimpropers += num_improper[i]; } - } else if (atom->molecular == 2) { + } else if (atom->molecular == Atom::TEMPLATE) { Molecule **onemols = atom->avec->onemols; int *molindex = atom->molindex; int *molatom = atom->molatom; @@ -745,10 +742,10 @@ void DeleteAtoms::options(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"bond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal delete_atoms command"); - if (atom->molecular == 0) + if (atom->molecular == Atom::ATOMIC) error->all(FLERR,"Cannot delete_atoms bond yes for " "non-molecular systems"); - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Cannot use delete_atoms bond yes with " "atom_style template"); if (strcmp(arg[iarg+1],"yes") == 0) bond_flag = 1; diff --git a/src/delete_bonds.cpp b/src/delete_bonds.cpp index 7b9260bc52..4b68a461f1 100644 --- a/src/delete_bonds.cpp +++ b/src/delete_bonds.cpp @@ -12,20 +12,17 @@ ------------------------------------------------------------------------- */ #include "delete_bonds.h" -#include -#include -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "domain.h" #include "comm.h" +#include "domain.h" +#include "error.h" #include "force.h" #include "group.h" #include "special.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -75,10 +72,10 @@ void DeleteBonds::command(int narg, char **arg) else error->all(FLERR,"Illegal delete_bonds command"); // setup list of types (atom,bond,etc) to consider - // use force->bounds(FLERR,) to allow setting of range of types + // use utils::bounds(FLERR,) to allow setting of range of types // range can be 0 to ntypes inclusive - int *tlist = NULL; + int *tlist = nullptr; int iarg = 2; if (style != MULTI && style != STATS) { @@ -94,7 +91,7 @@ void DeleteBonds::command(int narg, char **arg) tlist = new int[n+1]; for (int i = 0; i <= n; i++) tlist[i] = 0; int nlo,nhi; - force->bounds(FLERR,arg[2],n,nlo,nhi,0); + utils::bounds(FLERR,arg[2],0,n,nlo,nhi,error); for (int i = nlo; i <= nhi; i++) tlist[i] = 1; iarg++; diff --git a/src/deprecated.cpp b/src/deprecated.cpp index dc0ab400d4..ab9cc8cf44 100644 --- a/src/deprecated.cpp +++ b/src/deprecated.cpp @@ -16,11 +16,10 @@ ------------------------------------------------------------------------- */ #include "deprecated.h" -#include + #include "comm.h" #include "error.h" #include "input.h" -#include "utils.h" using namespace LAMMPS_NS; diff --git a/src/dihedral.cpp b/src/dihedral.cpp index ac2d432cfb..f75b89139f 100644 --- a/src/dihedral.cpp +++ b/src/dihedral.cpp @@ -36,10 +36,10 @@ Dihedral::Dihedral(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/dihedral_deprecated.cpp b/src/dihedral_deprecated.cpp index 1709f7d3d7..91ef3e8e9e 100644 --- a/src/dihedral_deprecated.cpp +++ b/src/dihedral_deprecated.cpp @@ -16,12 +16,12 @@ ------------------------------------------------------------------------- */ #include "dihedral_deprecated.h" -#include -#include "dihedral_hybrid.h" + #include "comm.h" -#include "force.h" +#include "dihedral_hybrid.h" #include "error.h" -#include "utils.h" +#include "force.h" + using namespace LAMMPS_NS; diff --git a/src/dihedral_hybrid.cpp b/src/dihedral_hybrid.cpp index ca5c90093c..83feb2f841 100644 --- a/src/dihedral_hybrid.cpp +++ b/src/dihedral_hybrid.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "dihedral_hybrid.h" -#include + #include #include #include "atom.h" @@ -21,7 +21,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -161,7 +161,7 @@ void DihedralHybrid::allocate() maxdihedral = new int[nstyles]; dihedrallist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maxdihedral[m] = 0; - for (int m = 0; m < nstyles; m++) dihedrallist[m] = NULL; + for (int m = 0; m < nstyles; m++) dihedrallist[m] = nullptr; } /* ---------------------------------------------------------------------- @@ -255,7 +255,7 @@ void DihedralHybrid::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); // 2nd arg = dihedral sub-style name // allow for "none" or "skip" as valid sub-style name @@ -329,7 +329,7 @@ void DihedralHybrid::write_restart(FILE *fp) void DihedralHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Dihedral*[nstyles]; keywords = new char*[nstyles]; @@ -338,10 +338,10 @@ void DihedralHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_dihedral(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/dihedral_zero.cpp b/src/dihedral_zero.cpp index daf46fe79a..9570590c09 100644 --- a/src/dihedral_zero.cpp +++ b/src/dihedral_zero.cpp @@ -16,11 +16,12 @@ ------------------------------------------------------------------------- */ #include "dihedral_zero.h" -#include + #include "atom.h" -#include "force.h" -#include "memory.h" #include "error.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; @@ -80,7 +81,7 @@ void DihedralZero::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ndihedraltypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ndihedraltypes,ilo,ihi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/displace_atoms.cpp b/src/displace_atoms.cpp index 82b7bf9492..4f84956991 100644 --- a/src/displace_atoms.cpp +++ b/src/displace_atoms.cpp @@ -12,30 +12,28 @@ ------------------------------------------------------------------------- */ #include "displace_atoms.h" -#include -#include -#include + #include "atom.h" -#include "modify.h" -#include "domain.h" -#include "lattice.h" -#include "comm.h" -#include "irregular.h" -#include "group.h" -#include "math_const.h" -#include "random_park.h" -#include "force.h" -#include "input.h" -#include "variable.h" +#include "atom_vec_body.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "atom_vec_body.h" +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "group.h" +#include "input.h" +#include "irregular.h" +#include "lattice.h" +#include "math_const.h" #include "math_extra.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" +#include "random_park.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -46,7 +44,7 @@ enum{MOVE,RAMP,RANDOM,ROTATE}; DisplaceAtoms::DisplaceAtoms(LAMMPS *lmp) : Pointers(lmp) { - mvec = NULL; + mvec = nullptr; } /* ---------------------------------------------------------------------- */ @@ -128,14 +126,14 @@ void DisplaceAtoms::command(int narg, char **arg) double d_lo,d_hi; if (d_dim == 0) { - d_lo = xscale*force->numeric(FLERR,arg[3]); - d_hi = xscale*force->numeric(FLERR,arg[4]); + d_lo = xscale*utils::numeric(FLERR,arg[3],false,lmp); + d_hi = xscale*utils::numeric(FLERR,arg[4],false,lmp); } else if (d_dim == 1) { - d_lo = yscale*force->numeric(FLERR,arg[3]); - d_hi = yscale*force->numeric(FLERR,arg[4]); + d_lo = yscale*utils::numeric(FLERR,arg[3],false,lmp); + d_hi = yscale*utils::numeric(FLERR,arg[4],false,lmp); } else if (d_dim == 2) { - d_lo = zscale*force->numeric(FLERR,arg[3]); - d_hi = zscale*force->numeric(FLERR,arg[4]); + d_lo = zscale*utils::numeric(FLERR,arg[3],false,lmp); + d_hi = zscale*utils::numeric(FLERR,arg[4],false,lmp); } int coord_dim = 0; @@ -146,14 +144,14 @@ void DisplaceAtoms::command(int narg, char **arg) double coord_lo,coord_hi; if (coord_dim == 0) { - coord_lo = xscale*force->numeric(FLERR,arg[6]); - coord_hi = xscale*force->numeric(FLERR,arg[7]); + coord_lo = xscale*utils::numeric(FLERR,arg[6],false,lmp); + coord_hi = xscale*utils::numeric(FLERR,arg[7],false,lmp); } else if (coord_dim == 1) { - coord_lo = yscale*force->numeric(FLERR,arg[6]); - coord_hi = yscale*force->numeric(FLERR,arg[7]); + coord_lo = yscale*utils::numeric(FLERR,arg[6],false,lmp); + coord_hi = yscale*utils::numeric(FLERR,arg[7],false,lmp); } else if (coord_dim == 2) { - coord_lo = zscale*force->numeric(FLERR,arg[6]); - coord_hi = zscale*force->numeric(FLERR,arg[7]); + coord_lo = zscale*utils::numeric(FLERR,arg[6],false,lmp); + coord_hi = zscale*utils::numeric(FLERR,arg[7],false,lmp); } double **x = atom->x; @@ -179,10 +177,10 @@ void DisplaceAtoms::command(int narg, char **arg) if (style == RANDOM) { RanPark *random = new RanPark(lmp,1); - double dx = xscale*force->numeric(FLERR,arg[2]); - double dy = yscale*force->numeric(FLERR,arg[3]); - double dz = zscale*force->numeric(FLERR,arg[4]); - int seed = force->inumeric(FLERR,arg[5]); + double dx = xscale*utils::numeric(FLERR,arg[2],false,lmp); + double dy = yscale*utils::numeric(FLERR,arg[3],false,lmp); + double dz = zscale*utils::numeric(FLERR,arg[4],false,lmp); + int seed = utils::inumeric(FLERR,arg[5],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal displace_atoms random command"); double **x = atom->x; @@ -219,13 +217,13 @@ void DisplaceAtoms::command(int narg, char **arg) double *quat; int dim = domain->dimension; - point[0] = xscale*force->numeric(FLERR,arg[2]); - point[1] = yscale*force->numeric(FLERR,arg[3]); - point[2] = zscale*force->numeric(FLERR,arg[4]); - axis[0] = force->numeric(FLERR,arg[5]); - axis[1] = force->numeric(FLERR,arg[6]); - axis[2] = force->numeric(FLERR,arg[7]); - double theta = force->numeric(FLERR,arg[8]); + point[0] = xscale*utils::numeric(FLERR,arg[2],false,lmp); + point[1] = yscale*utils::numeric(FLERR,arg[3],false,lmp); + point[2] = zscale*utils::numeric(FLERR,arg[4],false,lmp); + axis[0] = utils::numeric(FLERR,arg[5],false,lmp); + axis[1] = utils::numeric(FLERR,arg[6],false,lmp); + axis[2] = utils::numeric(FLERR,arg[7],false,lmp); + double theta = utils::numeric(FLERR,arg[8],false,lmp); if (dim == 2 && (axis[0] != 0.0 || axis[1] != 0.0)) error->all(FLERR,"Invalid displace_atoms rotate axis for 2d"); @@ -315,7 +313,7 @@ void DisplaceAtoms::command(int narg, char **arg) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) @@ -372,7 +370,7 @@ void DisplaceAtoms::move(int idim, char *arg, double scale) int nlocal = atom->nlocal; if (strstr(arg,"v_") != arg) { - double delta = scale*force->numeric(FLERR,arg); + double delta = scale*utils::numeric(FLERR,arg,false,lmp); for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += delta; @@ -386,7 +384,7 @@ void DisplaceAtoms::move(int idim, char *arg, double scale) for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += delta; } else if (input->variable->atomstyle(ivar)) { - if (mvec == NULL) memory->create(mvec,nlocal,"displace_atoms:mvec"); + if (mvec == nullptr) memory->create(mvec,nlocal,"displace_atoms:mvec"); input->variable->compute_atom(ivar,igroup,mvec,1,0); for (int i = 0; i < nlocal; i++) if (mask[i] & groupbit) x[i][idim] += scale*mvec[i]; diff --git a/src/domain.cpp b/src/domain.cpp index 81de88d1ee..b5d6675a3f 100644 --- a/src/domain.cpp +++ b/src/domain.cpp @@ -16,30 +16,28 @@ ------------------------------------------------------------------------- */ #include "domain.h" -#include -#include -#include -#include -#include "style_region.h" +#include "style_region.h" // IWYU pragma: keep + #include "atom.h" #include "atom_vec.h" -#include "molecule.h" -#include "force.h" -#include "kspace.h" -#include "update.h" -#include "modify.h" +#include "comm.h" +#include "error.h" #include "fix.h" #include "fix_deform.h" -#include "region.h" +#include "force.h" +#include "kspace.h" #include "lattice.h" -#include "comm.h" +#include "memory.h" +#include "modify.h" +#include "molecule.h" #include "output.h" +#include "region.h" #include "thermo.h" #include "universe.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -91,7 +89,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) boxlo_lamda[0] = boxlo_lamda[1] = boxlo_lamda[2] = 0.0; boxhi_lamda[0] = boxhi_lamda[1] = boxhi_lamda[2] = 1.0; - lattice = NULL; + lattice = nullptr; char **args = new char*[2]; args[0] = (char *) "none"; args[1] = (char *) "1.0"; @@ -99,7 +97,7 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) delete [] args; nregion = maxregion = 0; - regions = NULL; + regions = nullptr; copymode = 0; @@ -108,7 +106,8 @@ Domain::Domain(LAMMPS *lmp) : Pointers(lmp) #define REGION_CLASS #define RegionStyle(key,Class) \ (*region_map)[#key] = ®ion_creator; -#include "style_region.h" +#include "style_region.h" // IWYU pragma: keep + #undef RegionStyle #undef REGION_CLASS } @@ -728,7 +727,7 @@ void Domain::image_check() // if running verlet/split, don't check on KSpace partition since // it has no ghost atoms and thus bond partners won't exist - if (!atom->molecular) return; + if (atom->molecular == Atom::ATOMIC) return; if (!xperiodic && !yperiodic && (dimension == 2 || !zperiodic)) return; if (strncmp(update->integrate_style,"verlet/split",12) == 0 && universe->iworld != 0) return; @@ -769,7 +768,7 @@ void Domain::image_check() int flag = 0; for (i = 0; i < nlocal; i++) { - if (molecular == 1) n = num_bond[i]; + if (molecular == Atom::MOLECULAR) n = num_bond[i]; else { if (molindex[i] < 0) continue; imol = molindex[i]; @@ -778,7 +777,7 @@ void Domain::image_check() } for (j = 0; j < n; j++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (bond_type[i][j] <= 0) continue; k = atom->map(bond_atom[i][j]); } else { @@ -838,7 +837,7 @@ void Domain::box_too_small_check() // if running verlet/split, don't check on KSpace partition since // it has no ghost atoms and thus bond partners won't exist - if (!atom->molecular) return; + if (atom->molecular == Atom::ATOMIC) return; if (!xperiodic && !yperiodic && (dimension == 2 || !zperiodic)) return; if (strncmp(update->integrate_style,"verlet/split",12) == 0 && universe->iworld != 0) return; @@ -868,7 +867,7 @@ void Domain::box_too_small_check() int nmissing = 0; for (i = 0; i < nlocal; i++) { - if (molecular == 1) n = num_bond[i]; + if (molecular == Atom::MOLECULAR) n = num_bond[i]; else { if (molindex[i] < 0) continue; imol = molindex[i]; @@ -877,7 +876,7 @@ void Domain::box_too_small_check() } for (j = 0; j < n; j++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { if (bond_type[i][j] <= 0) continue; k = atom->map(bond_atom[i][j]); } else { @@ -1641,7 +1640,7 @@ void Domain::image_flip(int m, int n, int p) return 1 if this proc owns atom with coords x, else return 0 x is returned remapped into periodic box if image flag is passed, flag is updated via remap(x,image) - if image = NULL is passed, no update with remap(x) + if image = nullptr is passed, no update with remap(x) if shrinkexceed, atom can be outside shrinkwrap boundaries called from create_atoms() in library.cpp ------------------------------------------------------------------------- */ @@ -1728,7 +1727,7 @@ int Domain::ownatom(int /*id*/, double *x, imageint *image, int shrinkexceed) void Domain::set_lattice(int narg, char **arg) { if (lattice) delete lattice; - lattice = NULL; + lattice = nullptr; lattice = new Lattice(lmp,narg,arg); } diff --git a/src/domain.h b/src/domain.h index 58b935ce01..d807463bf3 100644 --- a/src/domain.h +++ b/src/domain.h @@ -14,12 +14,13 @@ #ifndef LMP_DOMAIN_H #define LMP_DOMAIN_H -#include -#include -#include #include "pointers.h" +#include +#include + namespace LAMMPS_NS { + class Region; class Domain : protected Pointers { public: @@ -90,7 +91,7 @@ class Domain : protected Pointers { int nregion; // # of defined Regions int maxregion; // max # list can hold - class Region **regions; // list of defined Regions + Region **regions; // list of defined Regions int copymode; enum{NO_REMAP,X_REMAP,V_REMAP}; diff --git a/src/dump.cpp b/src/dump.cpp index 83b74f1bbc..23b8173f09 100644 --- a/src/dump.cpp +++ b/src/dump.cpp @@ -12,28 +12,26 @@ ------------------------------------------------------------------------- */ #include "dump.h" -#include -#include + #include "atom.h" #include "irregular.h" #include "update.h" #include "domain.h" #include "group.h" #include "output.h" -#include "force.h" #include "modify.h" #include "fix.h" #include "compute.h" #include "memory.h" #include "error.h" +#include + using namespace LAMMPS_NS; #if defined(LMP_QSORT) // allocate space for static class variable Dump *Dump::dumpptr; -#else -#include "mergesort.h" #endif #define BIG 1.0e20 @@ -68,17 +66,17 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) first_flag = 0; flush_flag = 1; - format = NULL; - format_default = NULL; + format = nullptr; + format_default = nullptr; - format_line_user = NULL; - format_float_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_column_user = NULL; + format_line_user = nullptr; + format_float_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_column_user = nullptr; refreshflag = 0; - refresh = NULL; + refresh = nullptr; clearstep = 0; sort_flag = 0; @@ -95,20 +93,20 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) maxfiles = -1; numfiles = 0; fileidx = 0; - nameslist = NULL; + nameslist = nullptr; maxbuf = maxids = maxsort = maxproc = 0; - buf = bufsort = NULL; - ids = idsort = NULL; - index = proclist = NULL; - irregular = NULL; + buf = bufsort = nullptr; + ids = idsort = nullptr; + index = proclist = nullptr; + irregular = nullptr; maxsbuf = 0; - sbuf = NULL; + sbuf = nullptr; maxpbc = 0; - xpbc = vpbc = NULL; - imagepbc = NULL; + xpbc = vpbc = nullptr; + imagepbc = nullptr; // parse filename for special syntax // if contains '%', write one file per proc and replace % with proc-ID @@ -116,9 +114,10 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) // check file suffixes // if ends in .bin = binary file // else if ends in .gz = gzipped text file + // else if ends in .zst = Zstd compressed text file // else ASCII text file - fp = NULL; + fp = nullptr; singlefile_opened = 0; compressed = 0; binary = 0; @@ -129,7 +128,7 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) filewriter = 0; if (me == 0) filewriter = 1; fileproc = 0; - multiname = NULL; + multiname = nullptr; char *ptr; if ((ptr = strchr(filename,'%'))) { @@ -153,6 +152,8 @@ Dump::Dump(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp) if (suffix > filename && strcmp(suffix,".bin") == 0) binary = 1; suffix = filename + strlen(filename) - strlen(".gz"); if (suffix > filename && strcmp(suffix,".gz") == 0) compressed = 1; + suffix = filename + strlen(filename) - strlen(".zst"); + if (suffix > filename && strcmp(suffix,".zst") == 0) compressed = 1; } /* ---------------------------------------------------------------------- */ @@ -201,15 +202,15 @@ Dump::~Dump() delete[] nameslist; } - // XTC style sets fp to NULL since it closes file in its destructor + // XTC style sets fp to a null pointer since it closes file in its destructor - if (multifile == 0 && fp != NULL) { + if (multifile == 0 && fp != nullptr) { if (compressed) { if (filewriter) pclose(fp); } else { if (filewriter) fclose(fp); } - fp = NULL; + fp = nullptr; } } @@ -228,10 +229,10 @@ void Dump::init() delete irregular; maxids = maxsort = maxproc = 0; - bufsort = NULL; - ids = idsort = NULL; - index = proclist = NULL; - irregular = NULL; + bufsort = nullptr; + ids = idsort = nullptr; + index = proclist = nullptr; + irregular = nullptr; } if (sort_flag) { @@ -242,7 +243,7 @@ void Dump::init() error->all(FLERR,"Cannot dump sort on atom IDs with no atom IDs defined"); if (sortcol && sortcol > size_one) error->all(FLERR,"Dump sort column is invalid"); - if (nprocs > 1 && irregular == NULL) + if (nprocs > 1 && irregular == nullptr) irregular = new Irregular(lmp); bigint size = group->count(igroup); @@ -437,7 +438,7 @@ void Dump::write() // sort buf as needed if (sort_flag && sortcol == 0) pack(ids); - else pack(NULL); + else pack(nullptr); if (sort_flag) sort(); // if buffering, convert doubles into strings @@ -527,11 +528,11 @@ void Dump::write() if (multifile) { if (compressed) { - if (filewriter && fp != NULL) pclose(fp); + if (filewriter && fp != nullptr) pclose(fp); } else { - if (filewriter && fp != NULL) fclose(fp); + if (filewriter && fp != nullptr) fclose(fp); } - fp = NULL; + fp = nullptr; } } @@ -608,8 +609,8 @@ void Dump::openfile() fp = fopen(filecurrent,"w"); } - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); - } else fp = NULL; + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); + } else fp = nullptr; // delete string with timestep replaced @@ -763,9 +764,9 @@ void Dump::sort() #else if (!reorderflag) { for (i = 0; i < nme; i++) index[i] = i; - if (sortcol == 0) merge_sort(index,nme,(void *)this,idcompare); - else if (sortorder == ASCEND) merge_sort(index,nme,(void *)this,bufcompare); - else merge_sort(index,nme,(void *)this,bufcompare_reverse); + if (sortcol == 0) utils::merge_sort(index,nme,(void *)this,idcompare); + else if (sortorder == ASCEND) utils::merge_sort(index,nme,(void *)this,bufcompare); + else utils::merge_sort(index,nme,(void *)this,bufcompare_reverse); } #endif @@ -938,7 +939,7 @@ void Dump::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"delay") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); - delaystep = force->bnumeric(FLERR,arg[iarg+1]); + delaystep = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (delaystep >= 0) delay_flag = 1; else delay_flag = 0; iarg += 2; @@ -956,7 +957,7 @@ void Dump::modify_params(int narg, char **arg) strcpy(output->var_dump[idump],&arg[iarg+1][2]); n = 0; } else { - n = force->inumeric(FLERR,arg[iarg+1]); + n = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (n <= 0) error->all(FLERR,"Illegal dump_modify command"); } output->every_dump[idump] = n; @@ -967,7 +968,7 @@ void Dump::modify_params(int narg, char **arg) if (!multiproc) error->all(FLERR,"Cannot use dump_modify fileper " "without % in dump file name"); - int nper = force->inumeric(FLERR,arg[iarg+1]); + int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nper <= 0) error->all(FLERR,"Illegal dump_modify command"); multiproc = nprocs/nper; @@ -1012,10 +1013,10 @@ void Dump::modify_params(int narg, char **arg) delete [] format_int_user; delete [] format_bigint_user; delete [] format_float_user; - format_line_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_float_user = NULL; + format_line_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_float_user = nullptr; // pass format none to child classes which may use it // not an error if they don't modify_param(narg-iarg,&arg[iarg]); @@ -1048,13 +1049,13 @@ void Dump::modify_params(int narg, char **arg) delete[] nameslist[idx]; delete[] nameslist; } - maxfiles = force->inumeric(FLERR,arg[iarg+1]); + maxfiles = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (maxfiles == 0) error->all(FLERR,"Illegal dump_modify command"); if (maxfiles > 0) { nameslist = new char*[maxfiles]; numfiles = 0; for (int idx=0; idx < maxfiles; ++idx) - nameslist[idx] = NULL; + nameslist[idx] = nullptr; fileidx = 0; } iarg += 2; @@ -1063,7 +1064,7 @@ void Dump::modify_params(int narg, char **arg) if (!multiproc) error->all(FLERR,"Cannot use dump_modify nfile " "without % in dump file name"); - int nfile = force->inumeric(FLERR,arg[iarg+1]); + int nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nfile <= 0) error->all(FLERR,"Illegal dump_modify command"); nfile = MIN(nfile,nprocs); @@ -1093,7 +1094,7 @@ void Dump::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"pad") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump_modify command"); - padflag = force->inumeric(FLERR,arg[iarg+1]); + padflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (padflag < 0) error->all(FLERR,"Illegal dump_modify command"); iarg += 2; @@ -1113,7 +1114,7 @@ void Dump::modify_params(int narg, char **arg) sortorder = ASCEND; } else { sort_flag = 1; - sortcol = force->inumeric(FLERR,arg[iarg+1]); + sortcol = utils::inumeric(FLERR,arg[iarg+1],false,lmp); sortorder = ASCEND; if (sortcol == 0) error->all(FLERR,"Illegal dump_modify command"); if (sortcol < 0) { @@ -1171,9 +1172,9 @@ void Dump::pbc_allocate() return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint Dump::memory_usage() +double Dump::memory_usage() { - bigint bytes = memory->usage(buf,size_one*maxbuf); + double bytes = memory->usage(buf,size_one*maxbuf); bytes += memory->usage(sbuf,maxsbuf); if (sort_flag) { if (sortcol == 0) bytes += memory->usage(ids,maxids); diff --git a/src/dump.h b/src/dump.h index 17e9434faa..fb6627a2b3 100644 --- a/src/dump.h +++ b/src/dump.h @@ -47,7 +47,7 @@ class Dump : protected Pointers { virtual void unpack_reverse_comm(int, int *, double *) {} void modify_params(int, char **); - virtual bigint memory_usage(); + virtual double memory_usage(); protected: int me,nprocs; // proc info diff --git a/src/dump_atom.cpp b/src/dump_atom.cpp index 401b47051d..f8d02904fa 100644 --- a/src/dump_atom.cpp +++ b/src/dump_atom.cpp @@ -34,7 +34,7 @@ DumpAtom::DumpAtom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg) image_flag = 0; buffer_allow = 1; buffer_flag = 1; - format_default = NULL; + format_default = nullptr; } /* ---------------------------------------------------------------------- */ @@ -166,8 +166,83 @@ void DumpAtom::write_data(int n, double *mybuf) /* ---------------------------------------------------------------------- */ +void DumpAtom::format_magic_string_binary() +{ + // use negative ntimestep as marker for new format + bigint fmtlen = strlen(MAGIC_STRING); + bigint marker = -fmtlen; + fwrite(&marker, sizeof(bigint), 1, fp); + fwrite(MAGIC_STRING, sizeof(char), fmtlen, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtom::format_endian_binary() +{ + int endian = ENDIAN; + fwrite(&endian, sizeof(int), 1, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtom::format_revision_binary() +{ + int revision = FORMAT_REVISION; + fwrite(&revision, sizeof(int), 1, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtom::header_unit_style_binary() +{ + int len = 0; + if (unit_flag && !unit_count) { + ++unit_count; + len = strlen(update->unit_style); + fwrite(&len, sizeof(int), 1, fp); + fwrite(update->unit_style, sizeof(char), len, fp); + } else { + fwrite(&len, sizeof(int), 1, fp); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtom::header_columns_binary() +{ + int len = strlen(columns); + fwrite(&len, sizeof(int), 1, fp); + fwrite(columns, sizeof(char), len, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtom::header_time_binary() +{ + char flag = time_flag ? 1 : 0; + fwrite(&flag, sizeof(char), 1, fp); + + if (time_flag) { + double t = compute_time(); + fwrite(&t, sizeof(double), 1, fp); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpAtom::header_format_binary() +{ + format_magic_string_binary(); + format_endian_binary(); + format_revision_binary(); +} + +/* ---------------------------------------------------------------------- */ + void DumpAtom::header_binary(bigint ndump) { + header_format_binary(); + fwrite(&update->ntimestep,sizeof(bigint),1,fp); fwrite(&ndump,sizeof(bigint),1,fp); fwrite(&domain->triclinic,sizeof(int),1,fp); @@ -179,6 +254,11 @@ void DumpAtom::header_binary(bigint ndump) fwrite(&boxzlo,sizeof(double),1,fp); fwrite(&boxzhi,sizeof(double),1,fp); fwrite(&size_one,sizeof(int),1,fp); + + header_unit_style_binary(); + header_time_binary(); + header_columns_binary(); + if (multiproc) fwrite(&nclusterprocs,sizeof(int),1,fp); else fwrite(&nprocs,sizeof(int),1,fp); } @@ -187,6 +267,8 @@ void DumpAtom::header_binary(bigint ndump) void DumpAtom::header_binary_triclinic(bigint ndump) { + header_format_binary(); + fwrite(&update->ntimestep,sizeof(bigint),1,fp); fwrite(&ndump,sizeof(bigint),1,fp); fwrite(&domain->triclinic,sizeof(int),1,fp); @@ -201,6 +283,11 @@ void DumpAtom::header_binary_triclinic(bigint ndump) fwrite(&boxxz,sizeof(double),1,fp); fwrite(&boxyz,sizeof(double),1,fp); fwrite(&size_one,sizeof(int),1,fp); + + header_unit_style_binary(); + header_time_binary(); + header_columns_binary(); + if (multiproc) fwrite(&nclusterprocs,sizeof(int),1,fp); else fwrite(&nprocs,sizeof(int),1,fp); } diff --git a/src/dump_atom.h b/src/dump_atom.h index ce317fea4f..47c2e0699b 100644 --- a/src/dump_atom.h +++ b/src/dump_atom.h @@ -28,6 +28,10 @@ class DumpAtom : public Dump { public: DumpAtom(LAMMPS *, int, char**); + const char * MAGIC_STRING = "DUMPATOM"; + const int FORMAT_REVISION = 0x0002; + const int ENDIAN = 0x0001; + protected: int scale_flag; // 1 if atom coords are scaled, 0 if no int image_flag; // 1 if append box count to atom coords, 0 if no @@ -41,6 +45,14 @@ class DumpAtom : public Dump { int convert_string(int, double *); void write_data(int, double *); + void header_format_binary(); + void header_unit_style_binary(); + void header_time_binary(); + void header_columns_binary(); + void format_magic_string_binary(); + void format_endian_binary(); + void format_revision_binary(); + typedef void (DumpAtom::*FnPtrHeader)(bigint); FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); diff --git a/src/dump_cfg.cpp b/src/dump_cfg.cpp index da9740d9ca..ffff1e85c7 100644 --- a/src/dump_cfg.cpp +++ b/src/dump_cfg.cpp @@ -32,7 +32,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg), auxname(NULL) + DumpCustom(lmp, narg, arg), auxname(nullptr) { multifile_override = 0; @@ -63,7 +63,7 @@ DumpCFG::DumpCFG(LAMMPS *lmp, int narg, char **arg) : // convert 'X_ID[m]' (X=c,f,v) to 'X_ID_m' if (nfield > 5) auxname = new char*[nfield]; - else auxname = NULL; + else auxname = nullptr; int i = 0; for (int iarg = 5; iarg < nfield; iarg++, i++) { diff --git a/src/dump_custom.cpp b/src/dump_custom.cpp index e82636efac..b5609b754f 100644 --- a/src/dump_custom.cpp +++ b/src/dump_custom.cpp @@ -12,24 +12,22 @@ ------------------------------------------------------------------------- */ #include "dump_custom.h" -#include -#include -#include + #include "atom.h" -#include "force.h" -#include "domain.h" -#include "region.h" -#include "group.h" -#include "input.h" -#include "modify.h" #include "compute.h" +#include "domain.h" +#include "error.h" #include "fix.h" #include "fix_store.h" +#include "group.h" +#include "input.h" #include "memory.h" -#include "error.h" +#include "modify.h" +#include "region.h" #include "update.h" #include "variable.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -55,19 +53,19 @@ enum{LT,LE,GT,GE,EQ,NEQ,XOR}; DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - idregion(NULL), thresh_array(NULL), thresh_op(NULL), thresh_value(NULL), - thresh_last(NULL), thresh_fix(NULL), thresh_fixID(NULL), thresh_first(NULL), - earg(NULL), vtype(NULL), vformat(NULL), columns(NULL), choose(NULL), - dchoose(NULL), clist(NULL), field2index(NULL), argindex(NULL), id_compute(NULL), - compute(NULL), id_fix(NULL), fix(NULL), id_variable(NULL), variable(NULL), - vbuf(NULL), id_custom(NULL), flag_custom(NULL), typenames(NULL), - pack_choice(NULL) + idregion(nullptr), thresh_array(nullptr), thresh_op(nullptr), thresh_value(nullptr), + thresh_last(nullptr), thresh_fix(nullptr), thresh_fixID(nullptr), thresh_first(nullptr), + earg(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), choose(nullptr), + dchoose(nullptr), clist(nullptr), field2index(nullptr), argindex(nullptr), id_compute(nullptr), + compute(nullptr), id_fix(nullptr), fix(nullptr), id_variable(nullptr), variable(nullptr), + vbuf(nullptr), id_custom(nullptr), flag_custom(nullptr), typenames(nullptr), + pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump custom arguments specified"); clearstep = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal dump custom command"); // expand args if any have wildcard character "*" @@ -76,7 +74,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : // nfield may be shrunk below if extra optional args exist expand = 0; - nfield = nargnew = input->expand_args(narg-5,&arg[5],1,earg); + nfield = nargnew = utils::expand_args(FLERR,narg-5,&arg[5],1,earg,lmp); if (earg != &arg[5]) expand = 1; // allocate field vectors @@ -89,37 +87,37 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : buffer_allow = 1; buffer_flag = 1; iregion = -1; - idregion = NULL; + idregion = nullptr; nthresh = 0; - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; - thresh_last = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; + thresh_last = nullptr; nthreshlast = 0; - thresh_fix = NULL; - thresh_fixID = NULL; - thresh_first = NULL; + thresh_fix = nullptr; + thresh_fixID = nullptr; + thresh_first = nullptr; // computes, fixes, variables which the dump accesses ncompute = 0; - id_compute = NULL; - compute = NULL; + id_compute = nullptr; + compute = nullptr; nfix = 0; - id_fix = NULL; - fix = NULL; + id_fix = nullptr; + fix = nullptr; nvariable = 0; - id_variable = NULL; - variable = NULL; - vbuf = NULL; + id_variable = nullptr; + variable = nullptr; + vbuf = nullptr; ncustom = 0; - id_custom = NULL; - flag_custom = NULL; + id_custom = nullptr; + flag_custom = nullptr; // process attributes // ioptional = start of additional optional args in expanded args @@ -144,9 +142,9 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : // atom selection arrays maxlocal = 0; - choose = NULL; - dchoose = NULL; - clist = NULL; + choose = nullptr; + dchoose = nullptr; + clist = nullptr; // default element name for all types = C @@ -169,11 +167,11 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : else if (vtype[i] == Dump::DOUBLE) strcat(format_default,"%g "); else if (vtype[i] == Dump::STRING) strcat(format_default,"%s "); else if (vtype[i] == Dump::BIGINT) strcat(format_default,BIGINT_FORMAT " "); - vformat[i] = NULL; + vformat[i] = nullptr; } format_column_user = new char*[size_one]; - for (int i = 0; i < size_one; i++) format_column_user[i] = NULL; + for (int i = 0; i < size_one; i++) format_column_user[i] = nullptr; // setup column string @@ -183,7 +181,7 @@ DumpCustom::DumpCustom(LAMMPS *lmp, int narg, char **arg) : columns[0] = '\0'; for (int iarg = 0; iarg < nfield; iarg++) { strcat(columns,earg[iarg]); - strcat(columns," "); + if (iarg+1 < nfield) strcat(columns," "); } } @@ -236,7 +234,7 @@ DumpCustom::~DumpCustom() for (int i = 0; i < ncustom; i++) delete [] id_custom[i]; memory->sfree(id_custom); - delete [] flag_custom; + memory->sfree(flag_custom); memory->destroy(choose); memory->destroy(dchoose); @@ -281,8 +279,8 @@ void DumpCustom::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { @@ -302,7 +300,7 @@ void DumpCustom::init_style() strcpy(vformat[i],ptr); } - vformat[i] = strcat(vformat[i]," "); + if (i+1 < size_one) vformat[i] = strcat(vformat[i]," "); } // setup boundary string @@ -381,8 +379,83 @@ void DumpCustom::write_header(bigint ndump) /* ---------------------------------------------------------------------- */ +void DumpCustom::format_magic_string_binary() +{ + // use negative ntimestep as marker for new format + bigint fmtlen = strlen(MAGIC_STRING); + bigint marker = -fmtlen; + fwrite(&marker, sizeof(bigint), 1, fp); + fwrite(MAGIC_STRING, sizeof(char), fmtlen, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::format_endian_binary() +{ + int endian = ENDIAN; + fwrite(&endian, sizeof(int), 1, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::format_revision_binary() +{ + int revision = FORMAT_REVISION; + fwrite(&revision, sizeof(int), 1, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::header_unit_style_binary() +{ + int len = 0; + if (unit_flag && !unit_count) { + ++unit_count; + len = strlen(update->unit_style); + fwrite(&len, sizeof(int), 1, fp); + fwrite(update->unit_style, sizeof(char), len, fp); + } else { + fwrite(&len, sizeof(int), 1, fp); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::header_columns_binary() +{ + int len = strlen(columns); + fwrite(&len, sizeof(int), 1, fp); + fwrite(columns, sizeof(char), len, fp); +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::header_time_binary() +{ + char flag = time_flag ? 1 : 0; + fwrite(&flag, sizeof(char), 1, fp); + + if (time_flag) { + double t = compute_time(); + fwrite(&t, sizeof(double), 1, fp); + } +} + +/* ---------------------------------------------------------------------- */ + +void DumpCustom::header_format_binary() +{ + format_magic_string_binary(); + format_endian_binary(); + format_revision_binary(); +} + +/* ---------------------------------------------------------------------- */ + void DumpCustom::header_binary(bigint ndump) { + header_format_binary(); + fwrite(&update->ntimestep,sizeof(bigint),1,fp); fwrite(&ndump,sizeof(bigint),1,fp); fwrite(&domain->triclinic,sizeof(int),1,fp); @@ -394,6 +467,11 @@ void DumpCustom::header_binary(bigint ndump) fwrite(&boxzlo,sizeof(double),1,fp); fwrite(&boxzhi,sizeof(double),1,fp); fwrite(&size_one,sizeof(int),1,fp); + + header_unit_style_binary(); + header_time_binary(); + header_columns_binary(); + if (multiproc) fwrite(&nclusterprocs,sizeof(int),1,fp); else fwrite(&nprocs,sizeof(int),1,fp); } @@ -402,6 +480,8 @@ void DumpCustom::header_binary(bigint ndump) void DumpCustom::header_binary_triclinic(bigint ndump) { + header_format_binary(); + fwrite(&update->ntimestep,sizeof(bigint),1,fp); fwrite(&ndump,sizeof(bigint),1,fp); fwrite(&domain->triclinic,sizeof(int),1,fp); @@ -416,6 +496,11 @@ void DumpCustom::header_binary_triclinic(bigint ndump) fwrite(&boxxz,sizeof(double),1,fp); fwrite(&boxyz,sizeof(double),1,fp); fwrite(&size_one,sizeof(int),1,fp); + + header_unit_style_binary(); + header_time_binary(); + header_columns_binary(); + if (multiproc) fwrite(&nclusterprocs,sizeof(int),1,fp); else fwrite(&nprocs,sizeof(int),1,fp); } @@ -1563,7 +1648,7 @@ int DumpCustom::add_variable(char *id) variable = new int[nvariable+1]; delete [] vbuf; vbuf = new double*[nvariable+1]; - for (int i = 0; i <= nvariable; i++) vbuf[i] = NULL; + for (int i = 0; i <= nvariable; i++) vbuf[i] = nullptr; int n = strlen(id) + 1; id_variable[nvariable] = new char[n]; @@ -1626,7 +1711,7 @@ int DumpCustom::modify_param(int narg, char **arg) // just clear format_column_user allocated by this dump child class for (int i = 0; i < size_one; i++) { delete [] format_column_user[i]; - format_column_user[i] = NULL; + format_column_user[i] = nullptr; } return 2; } @@ -1644,7 +1729,7 @@ int DumpCustom::modify_param(int narg, char **arg) // replace "d" in format_int_user with bigint format specifier // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR, "Dump_modify int format does not contain d character"); char str[8]; @@ -1660,7 +1745,7 @@ int DumpCustom::modify_param(int narg, char **arg) strcpy(format_float_user,arg[2]); } else { - int i = force->inumeric(FLERR,arg[1]) - 1; + int i = utils::inumeric(FLERR,arg[1],false,lmp) - 1; if (i < 0 || i >= size_one) error->all(FLERR,"Illegal dump_modify command"); if (format_column_user[i]) delete [] format_column_user[i]; @@ -1706,17 +1791,17 @@ int DumpCustom::modify_param(int narg, char **arg) memory->destroy(thresh_array); memory->destroy(thresh_op); memory->destroy(thresh_value); - thresh_array = NULL; - thresh_op = NULL; - thresh_value = NULL; - thresh_last = NULL; + thresh_array = nullptr; + thresh_op = nullptr; + thresh_value = nullptr; + thresh_last = nullptr; for (int i = 0; i < nthreshlast; i++) { modify->delete_fix(thresh_fixID[i]); delete [] thresh_fixID[i]; } - thresh_fix = NULL; - thresh_fixID = NULL; - thresh_first = NULL; + thresh_fix = nullptr; + thresh_fixID = nullptr; + thresh_first = nullptr; } nthresh = nthreshlast = 0; return 2; @@ -1972,7 +2057,7 @@ int DumpCustom::modify_param(int narg, char **arg) // id = dump-ID + nthreshlast + DUMP_STORE, fix group = dump group if (strcmp(arg[3],"LAST") != 0) { - thresh_value[nthresh] = force->numeric(FLERR,arg[3]); + thresh_value[nthresh] = utils::numeric(FLERR,arg[3],false,lmp); thresh_last[nthresh] = -1; } else { thresh_fix = (FixStore **) @@ -2006,9 +2091,9 @@ int DumpCustom::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf, choose, variable arrays ------------------------------------------------------------------------- */ -bigint DumpCustom::memory_usage() +double DumpCustom::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(choose,maxlocal); bytes += memory->usage(dchoose,maxlocal); bytes += memory->usage(clist,maxlocal); diff --git a/src/dump_custom.h b/src/dump_custom.h index 1420d69b9b..654a87fc6a 100644 --- a/src/dump_custom.h +++ b/src/dump_custom.h @@ -29,6 +29,10 @@ class DumpCustom : public Dump { DumpCustom(class LAMMPS *, int, char **); virtual ~DumpCustom(); + const char * MAGIC_STRING = "DUMPCUSTOM"; + const int FORMAT_REVISION = 0x0002; + const int ENDIAN = 0x0001; + protected: int nevery; // dump frequency for output int iregion; // -1 if no region, else which region @@ -98,7 +102,7 @@ class DumpCustom : public Dump { void pack(tagint *); virtual int convert_string(int, double *); virtual void write_data(int, double *); - bigint memory_usage(); + double memory_usage(); int parse_fields(int, char **); int add_compute(char *); @@ -107,6 +111,14 @@ class DumpCustom : public Dump { int add_custom(char *, int); virtual int modify_param(int, char **); + void header_format_binary(); + void header_unit_style_binary(); + void header_time_binary(); + void header_columns_binary(); + void format_magic_string_binary(); + void format_endian_binary(); + void format_revision_binary(); + typedef void (DumpCustom::*FnPtrHeader)(bigint); FnPtrHeader header_choice; // ptr to write header functions void header_binary(bigint); diff --git a/src/dump_dcd.cpp b/src/dump_dcd.cpp index 254b371e22..e1c57f2b71 100644 --- a/src/dump_dcd.cpp +++ b/src/dump_dcd.cpp @@ -51,7 +51,7 @@ static inline void fwrite_int32(FILE* fd, uint32_t i) /* ---------------------------------------------------------------------- */ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - coords(NULL) + coords(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump dcd command"); if (binary || compressed || multifile || multiproc) @@ -62,7 +62,7 @@ DumpDCD::DumpDCD(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), sortcol = 0; unwrap_flag = 0; - format_default = NULL; + format_default = nullptr; // allocate global array for atom coords @@ -115,7 +115,7 @@ void DumpDCD::openfile() { if (me == 0) { fp = fopen(filename,"wb"); - if (fp == NULL) error->one(FLERR,"Cannot open dump file"); + if (fp == nullptr) error->one(FLERR,"Cannot open dump file"); } } @@ -263,9 +263,9 @@ int DumpDCD::modify_param(int narg, char **arg) return # of bytes of allocated memory in buf and global coords array ------------------------------------------------------------------------- */ -bigint DumpDCD::memory_usage() +double DumpDCD::memory_usage() { - bigint bytes = Dump::memory_usage(); + double bytes = Dump::memory_usage(); bytes += memory->usage(coords,natoms*3); return bytes; } @@ -342,7 +342,7 @@ void DumpDCD::write_dcd_header(const char *remarks) strncpy(title_string,remarks,80); title_string[79] = '\0'; fwrite(title_string,80,1,fp); - cur_time=time(NULL); + cur_time=time(nullptr); tmbuf=localtime(&cur_time); memset(title_string,' ',81); strftime(title_string,80,"REMARKS Created %d %B,%Y at %H:%M",tmbuf); diff --git a/src/dump_dcd.h b/src/dump_dcd.h index 15f6faf4be..3f59490b11 100644 --- a/src/dump_dcd.h +++ b/src/dump_dcd.h @@ -42,7 +42,7 @@ class DumpDCD : public Dump { void pack(tagint *); void write_data(int, double *); int modify_param(int, char **); - bigint memory_usage(); + double memory_usage(); void write_frame(); void write_dcd_header(const char *); diff --git a/src/dump_deprecated.cpp b/src/dump_deprecated.cpp index 822bed7832..ed8336eebc 100644 --- a/src/dump_deprecated.cpp +++ b/src/dump_deprecated.cpp @@ -12,10 +12,9 @@ ------------------------------------------------------------------------- */ #include "dump_deprecated.h" -#include + #include "comm.h" #include "error.h" -#include "utils.h" using namespace LAMMPS_NS; diff --git a/src/dump_image.cpp b/src/dump_image.cpp index a78c214e08..0dc0b9b26d 100644 --- a/src/dump_image.cpp +++ b/src/dump_image.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "dump_image.h" -#include + #include #include #include @@ -36,6 +36,7 @@ #include "error.h" #include "memory.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -49,12 +50,12 @@ enum{NO,YES}; /* ---------------------------------------------------------------------- */ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : - DumpCustom(lmp, narg, arg), thetastr(NULL), phistr(NULL), cxstr(NULL), - cystr(NULL), czstr(NULL), upxstr(NULL), upystr(NULL), upzstr(NULL), - zoomstr(NULL), perspstr(NULL), diamtype(NULL), diamelement(NULL), - bdiamtype(NULL), colortype(NULL), colorelement(NULL), bcolortype(NULL), - avec_line(NULL), avec_tri(NULL), avec_body(NULL), fixptr(NULL), image(NULL), - chooseghost(NULL), bufcopy(NULL) + DumpCustom(lmp, narg, arg), thetastr(nullptr), phistr(nullptr), cxstr(nullptr), + cystr(nullptr), czstr(nullptr), upxstr(nullptr), upystr(nullptr), upzstr(nullptr), + zoomstr(nullptr), diamtype(nullptr), diamelement(nullptr), + bdiamtype(nullptr), colortype(nullptr), colorelement(nullptr), bcolortype(nullptr), + avec_line(nullptr), avec_tri(nullptr), avec_body(nullptr), fixptr(nullptr), image(nullptr), + chooseghost(nullptr), bufcopy(nullptr) { if (binary || multiproc) error->all(FLERR,"Invalid dump image filename"); @@ -123,16 +124,15 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : bdiam = NUMERIC; bdiamvalue = 0.5; } - char *fixID = NULL; + char *fixID = nullptr; - thetastr = phistr = NULL; + thetastr = phistr = nullptr; cflag = STATIC; cx = cy = cz = 0.5; - cxstr = cystr = czstr = NULL; + cxstr = cystr = czstr = nullptr; - upxstr = upystr = upzstr = NULL; - zoomstr = NULL; - perspstr = NULL; + upxstr = upystr = upzstr = nullptr; + zoomstr = nullptr; boxflag = YES; boxdiam = 0.02; axesflag = NO; @@ -152,7 +152,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"adiam") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); adiam = NUMERIC; - adiamvalue = force->numeric(FLERR,arg[iarg+1]); + adiamvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (adiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 2; @@ -167,7 +167,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal dump image command"); if (!islower(arg[iarg+2][0])) { bdiam = NUMERIC; - bdiamvalue = force->numeric(FLERR,arg[iarg+2]); + bdiamvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (bdiamvalue <= 0.0) error->all(FLERR,"Illegal dump image command"); } else if (strcmp(arg[iarg+2],"atom") == 0) bdiam = ATOM; else if (strcmp(arg[iarg+2],"type") == 0) bdiam = TYPE; @@ -182,7 +182,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"type") == 0) lcolor = TYPE; else error->all(FLERR,"Illegal dump image command"); ldiam = NUMERIC; - ldiamvalue = force->numeric(FLERR,arg[iarg+2]); + ldiamvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg],"tri") == 0) { @@ -190,8 +190,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : triflag = YES; if (strcmp(arg[iarg+1],"type") == 0) tcolor = TYPE; else error->all(FLERR,"Illegal dump image command"); - tstyle = force->inumeric(FLERR,arg[iarg+2]); - tdiamvalue = force->numeric(FLERR,arg[iarg+3]); + tstyle = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + tdiamvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"body") == 0) { @@ -199,8 +199,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : bodyflag = YES; if (strcmp(arg[iarg+1],"type") == 0) bodycolor = TYPE; else error->all(FLERR,"Illegal dump image command"); - bodyflag1 = force->numeric(FLERR,arg[iarg+2]); - bodyflag2 = force->numeric(FLERR,arg[iarg+3]); + bodyflag1 = utils::numeric(FLERR,arg[iarg+2],false,lmp); + bodyflag2 = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"fix") == 0) { @@ -209,14 +209,14 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : fixID = arg[iarg+1]; if (strcmp(arg[iarg+2],"type") == 0) fixcolor = TYPE; else error->all(FLERR,"Illegal dump image command"); - fixflag1 = force->numeric(FLERR,arg[iarg+3]); - fixflag2 = force->numeric(FLERR,arg[iarg+4]); + fixflag1 = utils::numeric(FLERR,arg[iarg+3],false,lmp); + fixflag2 = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"size") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command"); - int width = force->inumeric(FLERR,arg[iarg+1]); - int height = force->inumeric(FLERR,arg[iarg+2]); + int width = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + int height = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (width <= 0 || height <= 0) error->all(FLERR,"Illegal dump image command"); image->width = width; @@ -230,7 +230,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : thetastr = new char[n]; strcpy(thetastr,&arg[iarg+1][2]); } else { - double theta = force->numeric(FLERR,arg[iarg+1]); + double theta = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (theta < 0.0 || theta > 180.0) error->all(FLERR,"Invalid dump image theta value"); theta *= MY_PI/180.0; @@ -241,7 +241,7 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : phistr = new char[n]; strcpy(phistr,&arg[iarg+2][2]); } else { - double phi = force->numeric(FLERR,arg[iarg+2]); + double phi = utils::numeric(FLERR,arg[iarg+2],false,lmp); phi *= MY_PI/180.0; image->phi = phi; } @@ -257,19 +257,19 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : cxstr = new char[n]; strcpy(cxstr,&arg[iarg+2][2]); cflag = DYNAMIC; - } else cx = force->numeric(FLERR,arg[iarg+2]); + } else cx = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; cystr = new char[n]; strcpy(cystr,&arg[iarg+3][2]); cflag = DYNAMIC; - } else cy = force->numeric(FLERR,arg[iarg+3]); + } else cy = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { int n = strlen(&arg[iarg+4][2]) + 1; czstr = new char[n]; strcpy(czstr,&arg[iarg+4][2]); cflag = DYNAMIC; - } else cz = force->numeric(FLERR,arg[iarg+4]); + } else cz = utils::numeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"up") == 0) { @@ -278,17 +278,17 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : int n = strlen(&arg[iarg+1][2]) + 1; upxstr = new char[n]; strcpy(upxstr,&arg[iarg+1][2]); - } else image->up[0] = force->numeric(FLERR,arg[iarg+1]); + } else image->up[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; upystr = new char[n]; strcpy(upystr,&arg[iarg+2][2]); - } else image->up[1] = force->numeric(FLERR,arg[iarg+2]); + } else image->up[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; upzstr = new char[n]; strcpy(upzstr,&arg[iarg+3][2]); - } else image->up[2] = force->numeric(FLERR,arg[iarg+3]); + } else image->up[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"zoom") == 0) { @@ -298,32 +298,18 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : zoomstr = new char[n]; strcpy(zoomstr,&arg[iarg+1][2]); } else { - double zoom = force->numeric(FLERR,arg[iarg+1]); + double zoom = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (zoom <= 0.0) error->all(FLERR,"Illegal dump image command"); image->zoom = zoom; } iarg += 2; - } else if (strcmp(arg[iarg],"persp") == 0) { - error->all(FLERR,"Dump image persp option is not yet supported"); - if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); - if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) { - int n = strlen(&arg[iarg+1][2]) + 1; - perspstr = new char[n]; - strcpy(perspstr,&arg[iarg+1][2]); - } else { - double persp = force->numeric(FLERR,arg[iarg+1]); - if (persp < 0.0) error->all(FLERR,"Illegal dump image command"); - image->persp = persp; - } - iarg += 2; - } else if (strcmp(arg[iarg],"box") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal dump image command"); if (strcmp(arg[iarg+1],"yes") == 0) boxflag = YES; else if (strcmp(arg[iarg+1],"no") == 0) boxflag = NO; else error->all(FLERR,"Illegal dump image command"); - boxdiam = force->numeric(FLERR,arg[iarg+2]); + boxdiam = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (boxdiam < 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 3; @@ -332,8 +318,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) axesflag = YES; else if (strcmp(arg[iarg+1],"no") == 0) axesflag = NO; else error->all(FLERR,"Illegal dump image command"); - axeslen = force->numeric(FLERR,arg[iarg+2]); - axesdiam = force->numeric(FLERR,arg[iarg+3]); + axeslen = utils::numeric(FLERR,arg[iarg+2],false,lmp); + axesdiam = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (axeslen < 0.0 || axesdiam < 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 4; @@ -343,13 +329,13 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) subboxflag = YES; else if (strcmp(arg[iarg+1],"no") == 0) subboxflag = NO; else error->all(FLERR,"Illegal dump image command"); - subboxdiam = force->numeric(FLERR,arg[iarg+2]); + subboxdiam = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (subboxdiam < 0.0) error->all(FLERR,"Illegal dump image command"); iarg += 3; } else if (strcmp(arg[iarg],"shiny") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal dump image command"); - double shiny = force->numeric(FLERR,arg[iarg+1]); + double shiny = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (shiny < 0.0 || shiny > 1.0) error->all(FLERR,"Illegal dump image command"); image->shiny = shiny; @@ -360,10 +346,10 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg+1],"yes") == 0) image->ssao = YES; else if (strcmp(arg[iarg+1],"no") == 0) image->ssao = NO; else error->all(FLERR,"Illegal dump image command"); - int seed = force->inumeric(FLERR,arg[iarg+2]); + int seed = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (seed <= 0) error->all(FLERR,"Illegal dump image command"); image->seed = seed; - double ssaoint = force->numeric(FLERR,arg[iarg+3]); + double ssaoint = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (ssaoint < 0.0 || ssaoint > 1.0) error->all(FLERR,"Illegal dump image command"); image->ssaoint = ssaoint; @@ -440,15 +426,15 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : else if (i % 6 == 0) bcolortype[i] = image->color2rgb("cyan"); } } else { - bdiamtype = NULL; - bcolortype = NULL; + bdiamtype = nullptr; + bcolortype = nullptr; } // viewflag = DYNAMIC if any view parameter is dynamic viewflag = STATIC; if (thetastr || phistr || cflag == DYNAMIC || - upxstr || upystr || upzstr || zoomstr || perspstr) viewflag = DYNAMIC; + upxstr || upystr || upzstr || zoomstr) viewflag = DYNAMIC; box_bounds(); if (cflag == STATIC) box_center(); @@ -457,8 +443,8 @@ DumpImage::DumpImage(LAMMPS *lmp, int narg, char **arg) : // local data maxbufcopy = 0; - chooseghost = NULL; - bufcopy = NULL; + chooseghost = nullptr; + bufcopy = nullptr; } /* ---------------------------------------------------------------------- */ @@ -552,20 +538,13 @@ void DumpImage::init_style() if (!input->variable->equalstyle(zoomvar)) error->all(FLERR,"Variable for dump image zoom is invalid style"); } - if (perspstr) { - perspvar = input->variable->find(perspstr); - if (perspvar < 0) - error->all(FLERR,"Variable name for dump image persp does not exist"); - if (!input->variable->equalstyle(perspvar)) - error->all(FLERR,"Variable for dump image persp is invalid style"); - } // set up type -> element mapping if (atomflag && acolor == ELEMENT) { for (int i = 1; i <= ntypes; i++) { colorelement[i] = image->element2color(typenames[i]); - if (colorelement[i] == NULL) + if (colorelement[i] == nullptr) error->all(FLERR,"Invalid dump image element name"); } } @@ -605,7 +584,7 @@ void DumpImage::write() // pack buf with color & diameter - pack(NULL); + pack(nullptr); // set minmax color range if using dynamic atom color map @@ -640,7 +619,7 @@ void DumpImage::write() else image->write_PPM(fp); if (multifile) { fclose(fp); - fp = NULL; + fp = nullptr; } } } @@ -718,12 +697,10 @@ void DumpImage::view_params() if (upystr) image->up[1] = input->variable->compute_equal(upyvar); if (upzstr) image->up[2] = input->variable->compute_equal(upzvar); - // zoom and perspective + // zoom if (zoomstr) image->zoom = input->variable->compute_equal(zoomvar); if (image->zoom <= 0.0) error->all(FLERR,"Invalid dump image zoom value"); - if (perspstr) image->persp = input->variable->compute_equal(perspvar); - if (image->persp < 0.0) error->all(FLERR,"Invalid dump image persp value"); // remainder of view setup is internal to Image class @@ -951,7 +928,7 @@ void DumpImage::create_image() for (i = 0; i < nchoose; i++) { atom1 = clist[i]; - if (molecular == 1) n = num_bond[atom1]; + if (molecular == Atom::MOLECULAR) n = num_bond[atom1]; else { if (molindex[atom1] < 0) continue; imol = molindex[atom1]; @@ -960,7 +937,7 @@ void DumpImage::create_image() } for (m = 0; m < n; m++) { - if (molecular == 1) { + if (molecular == Atom::MOLECULAR) { btype = bond_type[atom1][m]; atom2 = atom->map(bond_atom[atom1][m]); } else { @@ -1246,7 +1223,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"acolor") == 0) { if (narg < 3) error->all(FLERR,"Illegal dump_modify command"); int nlo,nhi; - force->bounds(FLERR,arg[1],atom->ntypes,nlo,nhi); + utils::bounds(FLERR,arg[1],1,atom->ntypes,nlo,nhi,error); // ptrs = list of ncount colornames separated by '/' @@ -1260,7 +1237,7 @@ int DumpImage::modify_param(int narg, char **arg) char **ptrs = new char*[ncount+1]; ncount = 0; ptrs[ncount++] = strtok(arg[2],"/"); - while ((ptrs[ncount++] = strtok(NULL,"/"))); + while ((ptrs[ncount++] = strtok(nullptr,"/"))); ncount--; // assign each of ncount colors in round-robin fashion to types @@ -1268,7 +1245,7 @@ int DumpImage::modify_param(int narg, char **arg) int m = 0; for (int i = nlo; i <= nhi; i++) { colortype[i] = image->color2rgb(ptrs[m%ncount]); - if (colortype[i] == NULL) + if (colortype[i] == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); m++; } @@ -1280,8 +1257,8 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"adiam") == 0) { if (narg < 3) error->all(FLERR,"Illegal dump_modify command"); int nlo,nhi; - force->bounds(FLERR,arg[1],atom->ntypes,nlo,nhi); - double diam = force->numeric(FLERR,arg[2]); + utils::bounds(FLERR,arg[1],1,atom->ntypes,nlo,nhi,error); + double diam = utils::numeric(FLERR,arg[2],false,lmp); if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command"); for (int i = nlo; i <= nhi; i++) diamtype[i] = diam; return 3; @@ -1295,7 +1272,7 @@ int DumpImage::modify_param(int narg, char **arg) else if (arg[3][0] == 'c') factor = 2; else if (arg[3][0] == 'd') factor = 3; else error->all(FLERR,"Illegal dump_modify command"); - int nentry = force->inumeric(FLERR,arg[5]); + int nentry = utils::inumeric(FLERR,arg[5],false,lmp); if (nentry < 1) error->all(FLERR,"Illegal dump_modify command"); int n = 6 + factor*nentry; if (narg < n) error->all(FLERR,"Illegal dump_modify command"); @@ -1309,7 +1286,7 @@ int DumpImage::modify_param(int narg, char **arg) if (atom->nbondtypes == 0) error->all(FLERR,"Dump modify bcolor not allowed with no bond types"); int nlo,nhi; - force->bounds(FLERR,arg[1],atom->nbondtypes,nlo,nhi); + utils::bounds(FLERR,arg[1],1,atom->nbondtypes,nlo,nhi,error); // ptrs = list of ncount colornames separated by '/' @@ -1323,7 +1300,7 @@ int DumpImage::modify_param(int narg, char **arg) char **ptrs = new char*[ncount+1]; ncount = 0; ptrs[ncount++] = strtok(arg[2],"/"); - while ((ptrs[ncount++] = strtok(NULL,"/"))); + while ((ptrs[ncount++] = strtok(nullptr,"/"))); ncount--; // assign each of ncount colors in round-robin fashion to types @@ -1331,7 +1308,7 @@ int DumpImage::modify_param(int narg, char **arg) int m = 0; for (int i = nlo; i <= nhi; i++) { bcolortype[i] = image->color2rgb(ptrs[m%ncount]); - if (bcolortype[i] == NULL) + if (bcolortype[i] == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); m++; } @@ -1345,8 +1322,8 @@ int DumpImage::modify_param(int narg, char **arg) if (atom->nbondtypes == 0) error->all(FLERR,"Dump modify bdiam not allowed with no bond types"); int nlo,nhi; - force->bounds(FLERR,arg[1],atom->nbondtypes,nlo,nhi); - double diam = force->numeric(FLERR,arg[2]); + utils::bounds(FLERR,arg[1],1,atom->nbondtypes,nlo,nhi,error); + double diam = utils::numeric(FLERR,arg[2],false,lmp); if (diam <= 0.0) error->all(FLERR,"Illegal dump_modify command"); for (int i = nlo; i <= nhi; i++) bdiamtype[i] = diam; return 3; @@ -1355,7 +1332,7 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"backcolor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); double *color = image->color2rgb(arg[1]); - if (color == NULL) error->all(FLERR,"Invalid color in dump_modify command"); + if (color == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); image->background[0] = static_cast (color[0]*255.0); image->background[1] = static_cast (color[1]*255.0); image->background[2] = static_cast (color[2]*255.0); @@ -1365,14 +1342,16 @@ int DumpImage::modify_param(int narg, char **arg) if (strcmp(arg[0],"boxcolor") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); image->boxcolor = image->color2rgb(arg[1]); - if (image->boxcolor == NULL) + if (image->boxcolor == nullptr) error->all(FLERR,"Invalid color in dump_modify command"); return 2; } if (strcmp(arg[0],"color") == 0) { if (narg < 5) error->all(FLERR,"Illegal dump_modify command"); - int flag = image->addcolor(arg[1],force->numeric(FLERR,arg[2]),force->numeric(FLERR,arg[3]),force->numeric(FLERR,arg[4])); + int flag = image->addcolor(arg[1],utils::numeric(FLERR,arg[2],false,lmp), + utils::numeric(FLERR,arg[3],false,lmp), + utils::numeric(FLERR,arg[4],false,lmp)); if (flag) error->all(FLERR,"Illegal dump_modify command"); return 5; } diff --git a/src/dump_image.h b/src/dump_image.h index 4faf558b1a..fb560e252d 100644 --- a/src/dump_image.h +++ b/src/dump_image.h @@ -67,8 +67,8 @@ class DumpImage : public DumpCustom { int cxvar,cyvar,czvar; // index to box center vars char *upxstr,*upystr,*upzstr; // view up vector variables int upxvar,upyvar,upzvar; // index to up vector vars - char *zoomstr,*perspstr; // view zoom and perspective variables - int zoomvar,perspvar; // index to zoom,persp vars + char *zoomstr; // view zoom variable name + int zoomvar; // index to zoom variable int boxflag,axesflag; // 0/1 for draw box and axes double boxdiam,axeslen,axesdiam; // params for drawing box and axes int subboxflag; @@ -136,10 +136,6 @@ E: Invalid dump image theta value Theta must be between 0.0 and 180.0 inclusive. -E: Dump image persp option is not yet supported - -Self-explanatory. - E: Dump image line requires atom style line Self-explanatory. @@ -196,14 +192,6 @@ E: Variable for dump image zoom is invalid style Must be an equal-style variable. -E: Variable name for dump image persp does not exist - -Self-explanatory. - -E: Variable for dump image persp is invalid style - -Must be an equal-style variable. - E: Invalid dump image element name The specified element name was not in the standard list of elements. @@ -218,10 +206,6 @@ E: Invalid dump image zoom value Zoom value must be > 0.0. -E: Invalid dump image persp value - -Persp value must be >= 0.0. - E: Invalid color in dump_modify command The specified color name was not in the list of recognized colors. diff --git a/src/dump_local.cpp b/src/dump_local.cpp index 21a96d1e8a..988ff269de 100644 --- a/src/dump_local.cpp +++ b/src/dump_local.cpp @@ -12,18 +12,16 @@ ------------------------------------------------------------------------- */ #include "dump_local.h" -#include -#include -#include -#include "modify.h" -#include "fix.h" + #include "compute.h" #include "domain.h" -#include "update.h" -#include "input.h" -#include "memory.h" #include "error.h" -#include "force.h" +#include "fix.h" +#include "memory.h" +#include "modify.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -37,15 +35,15 @@ enum{INT,DOUBLE}; DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - label(NULL), vtype(NULL), vformat(NULL), columns(NULL), field2index(NULL), - argindex(NULL), id_compute(NULL), compute(NULL), id_fix(NULL), fix(NULL), - pack_choice(NULL) + label(nullptr), vtype(nullptr), vformat(nullptr), columns(nullptr), field2index(nullptr), + argindex(nullptr), id_compute(nullptr), compute(nullptr), id_fix(nullptr), fix(nullptr), + pack_choice(nullptr) { if (narg == 5) error->all(FLERR,"No dump local arguments specified"); clearstep = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal dump local command"); if (binary) @@ -57,7 +55,7 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - nfield = input->expand_args(nfield,&arg[5],1,earg); + nfield = utils::expand_args(FLERR,nfield,&arg[5],1,earg,lmp); if (earg != &arg[5]) expand = 1; @@ -75,12 +73,12 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : argindex = new int[nfield]; ncompute = 0; - id_compute = NULL; - compute = NULL; + id_compute = nullptr; + compute = nullptr; nfix = 0; - id_fix = NULL; - fix = NULL; + id_fix = nullptr; + fix = nullptr; // process attributes @@ -97,11 +95,11 @@ DumpLocal::DumpLocal(LAMMPS *lmp, int narg, char **arg) : for (int i = 0; i < size_one; i++) { if (vtype[i] == INT) strcat(format_default,"%d "); else if (vtype[i] == DOUBLE) strcat(format_default,"%g "); - vformat[i] = NULL; + vformat[i] = nullptr; } format_column_user = new char*[size_one]; - for (int i = 0; i < size_one; i++) format_column_user[i] = NULL; + for (int i = 0; i < size_one; i++) format_column_user[i] = nullptr; // setup column string @@ -182,8 +180,8 @@ void DumpLocal::init_style() char *ptr; for (int i = 0; i < size_one; i++) { if (i == 0) ptr = strtok(format," \0"); - else ptr = strtok(NULL," \0"); - if (ptr == NULL) error->all(FLERR,"Dump_modify format line is too short"); + else ptr = strtok(nullptr," \0"); + if (ptr == nullptr) error->all(FLERR,"Dump_modify format line is too short"); delete [] vformat[i]; if (format_column_user[i]) { @@ -268,14 +266,14 @@ void DumpLocal::write_header(bigint ndump) fprintf(fp,BIGINT_FORMAT "\n",ndump); if (domain->triclinic) { fprintf(fp,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); - fprintf(fp,"%g %g %g\n",boxxlo,boxxhi,boxxy); - fprintf(fp,"%g %g %g\n",boxylo,boxyhi,boxxz); - fprintf(fp,"%g %g %g\n",boxzlo,boxzhi,boxyz); + fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxxlo,boxxhi,boxxy); + fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxylo,boxyhi,boxxz); + fprintf(fp,"%-1.16e %-1.16e %-1.16e\n",boxzlo,boxzhi,boxyz); } else { fprintf(fp,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fp,"%g %g\n",boxxlo,boxxhi); - fprintf(fp,"%g %g\n",boxylo,boxyhi); - fprintf(fp,"%g %g\n",boxzlo,boxzhi); + fprintf(fp,"%-1.16e %-1.16e\n",boxxlo,boxxhi); + fprintf(fp,"%-1.16e %-1.16e\n",boxylo,boxyhi); + fprintf(fp,"%-1.16e %-1.16e\n",boxzlo,boxzhi); } fprintf(fp,"ITEM: %s %s\n",label,columns); } diff --git a/src/dump_movie.cpp b/src/dump_movie.cpp index 68a77c8f63..951768978c 100644 --- a/src/dump_movie.cpp +++ b/src/dump_movie.cpp @@ -16,11 +16,11 @@ ------------------------------------------------------------------------- */ #include "dump_movie.h" -#include + #include "comm.h" -#include "force.h" #include "error.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -35,7 +35,7 @@ DumpMovie::DumpMovie(LAMMPS *lmp, int narg, char **arg) : filetype = PPM; bitrate = 2000; framerate = 24; - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- */ @@ -44,7 +44,7 @@ void DumpMovie::openfile() { char moviecmd[1024]; - if ((comm->me == 0) && (fp == NULL)) { + if ((comm->me == 0) && (fp == nullptr)) { #ifdef LAMMPS_FFMPEG sprintf(moviecmd,"ffmpeg -v error -y -r %.2f -f image2pipe -c:v ppm -i - " @@ -59,7 +59,7 @@ void DumpMovie::openfile() fp = popen(moviecmd,"w"); #endif - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Failed to open FFmpeg pipeline to " "file {}",filename)); } @@ -84,14 +84,14 @@ int DumpMovie::modify_param(int narg, char **arg) if (strcmp(arg[0],"bitrate") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - bitrate = force->inumeric(FLERR,arg[1]); + bitrate = utils::inumeric(FLERR,arg[1],false,lmp); if (bitrate <= 0.0) error->all(FLERR,"Illegal dump_modify command"); return 2; } if (strcmp(arg[0],"framerate") == 0) { if (narg < 2) error->all(FLERR,"Illegal dump_modify command"); - framerate = force->numeric(FLERR,arg[1]); + framerate = utils::numeric(FLERR,arg[1],false,lmp); if ((framerate <= 0.1) || (framerate > 24.0)) error->all(FLERR,"Illegal dump_modify framerate command"); return 2; diff --git a/src/dump_xyz.cpp b/src/dump_xyz.cpp index 10ba10f995..d4352b0747 100644 --- a/src/dump_xyz.cpp +++ b/src/dump_xyz.cpp @@ -26,7 +26,7 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), - typenames(NULL) + typenames(nullptr) { if (narg != 5) error->all(FLERR,"Illegal dump xyz command"); if (binary || multiproc) error->all(FLERR,"Invalid dump xyz filename"); @@ -46,7 +46,7 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), strcpy(format_default,str); ntypes = atom->ntypes; - typenames = NULL; + typenames = nullptr; } /* ---------------------------------------------------------------------- */ @@ -54,13 +54,13 @@ DumpXYZ::DumpXYZ(LAMMPS *lmp, int narg, char **arg) : Dump(lmp, narg, arg), DumpXYZ::~DumpXYZ() { delete[] format_default; - format_default = NULL; + format_default = nullptr; if (typenames) { for (int i = 1; i <= ntypes; i++) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } } @@ -83,7 +83,7 @@ void DumpXYZ::init_style() // initialize typenames array to be backward compatible by default // a 32-bit int can be maximally 10 digits plus sign - if (typenames == NULL) { + if (typenames == nullptr) { typenames = new char*[ntypes+1]; for (int itype = 1; itype <= ntypes; itype++) { typenames[itype] = new char[12]; @@ -114,7 +114,7 @@ int DumpXYZ::modify_param(int narg, char **arg) delete [] typenames[i]; delete [] typenames; - typenames = NULL; + typenames = nullptr; } typenames = new char*[ntypes+1]; diff --git a/src/error.cpp b/src/error.cpp index 7458f816c0..fff3072bb1 100644 --- a/src/error.cpp +++ b/src/error.cpp @@ -12,16 +12,11 @@ ------------------------------------------------------------------------- */ #include "error.h" -#include -#include -#include -#include -#include "universe.h" -#include "output.h" -#include "input.h" + #include "accelerator_kokkos.h" -#include "utils.h" -#include "fmt/format.h" +#include "input.h" +#include "output.h" +#include "universe.h" #if defined(LAMMPS_EXCEPTIONS) #include "update.h" @@ -74,7 +69,7 @@ void Error::universe_all(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -100,7 +95,7 @@ void Error::universe_one(const std::string &file, int line, const std::string &s #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -148,7 +143,7 @@ void Error::all(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -174,7 +169,7 @@ void Error::all(const std::string &file, int line, const std::string &str) /* ---------------------------------------------------------------------- called by one proc in world - write to world screen only if non-NULL on this proc + write to world screen only if non-nullptr on this proc always write to universe screen forces abort of entire world (and universe) if any proc in world calls ------------------------------------------------------------------------- */ @@ -197,7 +192,7 @@ void Error::one(const std::string &file, int line, const std::string &str) #ifdef LAMMPS_EXCEPTIONS // allow commands if an exception was caught in a run - // update may be NULL when catching command line errors + // update may be a null pointer when catching command line errors if (update) update->whichflag = 0; @@ -212,7 +207,7 @@ void Error::one(const std::string &file, int line, const std::string &str) /* ---------------------------------------------------------------------- called by one proc in world - only write to screen if non-NULL on this proc since could be file + only write to screen if non-nullptr on this proc since could be file ------------------------------------------------------------------------- */ void Error::warning(const std::string &file, int line, const std::string &str, int logflag) diff --git a/src/error.h b/src/error.h index 40c1559464..dedebc4148 100644 --- a/src/error.h +++ b/src/error.h @@ -15,7 +15,6 @@ #define LMP_ERROR_H #include "pointers.h" -#include #ifdef LAMMPS_EXCEPTIONS #include "exceptions.h" diff --git a/src/file_writer.h b/src/file_writer.h new file mode 100644 index 0000000000..8597ab570d --- /dev/null +++ b/src/file_writer.h @@ -0,0 +1,53 @@ + +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Richard Berger (Temple U) +------------------------------------------------------------------------- */ + +#ifndef LMP_FILE_WRITER_H +#define LMP_FILE_WRITER_H + +#include + +namespace LAMMPS_NS { + +class FileWriter { +public: + FileWriter() = default; + virtual ~FileWriter() = default; + virtual void open(const std::string &path) = 0; + virtual void close() = 0; + virtual void flush() = 0; + virtual size_t write(const void * buffer, size_t length) = 0; + virtual bool isopen() const = 0; +}; + +class FileWriterException : public std::exception { + std::string message; +public: + FileWriterException(const std::string &msg) : message(msg) { + } + + ~FileWriterException() throw() { + } + + virtual const char * what() const throw() { + return message.c_str(); + } +}; + +} + +#endif diff --git a/src/finish.cpp b/src/finish.cpp index 51f886b5db..7525f5e632 100644 --- a/src/finish.cpp +++ b/src/finish.cpp @@ -12,28 +12,26 @@ ------------------------------------------------------------------------- */ #include "finish.h" -#include -#include -#include -#include + #include "accelerator_kokkos.h" #include "atom.h" #include "atom_vec.h" -#include "molecule.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "update.h" +#include "memory.h" // IWYU pragma: keep #include "min.h" -#include "neighbor.h" +#include "molecule.h" #include "neigh_list.h" #include "neigh_request.h" -#include "memory.h" -#include "error.h" -#include "timer.h" +#include "neighbor.h" // IWYU pragma: keep +#include "timer.h" // IWYU pragma: keep #include "universe.h" -#include "utils.h" -#include "fmt/format.h" +#include "update.h" + +#include +#include #ifdef LMP_USER_OMP #include "modify.h" @@ -204,12 +202,12 @@ void Finish::end(int flag) update->minimize->einitial, update->minimize->eprevious, update->minimize->efinal); - mesg += fmt::format(" Force two-norm initial, final = {} {}\n", + mesg += fmt::format(" Force two-norm initial, final = {:.8} {:.8}\n", update->minimize->fnorm2_init,update->minimize->fnorm2_final); - mesg += fmt::format(" Force max component initial, final = {} {}\n", + mesg += fmt::format(" Force max component initial, final = {:.8} {:.8}\n", update->minimize->fnorminf_init, update->minimize->fnorminf_final); - mesg += fmt::format(" Final line search alpha, max atom move = {} {}\n", + mesg += fmt::format(" Final line search alpha, max atom move = {:.8} {:.8}\n", update->minimize->alpha_final, update->minimize->alpha_final* update->minimize->fnorminf_final); @@ -334,7 +332,7 @@ void Finish::end(int flag) mpi_timings("Pair",timer,Timer::PAIR, world,nprocs, nthreads,me,time_loop,screen,logfile); - if (atom->molecular) + if (atom->molecular != Atom::ATOMIC) mpi_timings("Bond",timer,Timer::BOND,world,nprocs, nthreads,me,time_loop,screen,logfile); @@ -393,7 +391,7 @@ void Finish::end(int flag) utils::logmesg(lmp,fmt::format(thr_fmt,me,thr_total,thr_total/time_loop*100.0)); omp_times(fixomp,"Pair",Timer::PAIR,nthreads,screen,logfile); - if (atom->molecular) + if (atom->molecular != Atom::ATOMIC) omp_times(fixomp,"Bond",Timer::BOND,nthreads,screen,logfile); if (force->kspace) omp_times(fixomp,"Kspace",Timer::KSPACE,nthreads,screen,logfile); @@ -557,14 +555,14 @@ void Finish::end(int flag) int nspec; double nspec_all = 0; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { int **nspecial = atom->nspecial; int nlocal = atom->nlocal; nspec = 0; for (i = 0; i < nlocal; i++) nspec += nspecial[i][2]; tmp = nspec; MPI_Allreduce(&tmp,&nspec_all,1,MPI_DOUBLE,MPI_SUM,world); - } else if (atom->molecular == 2) { + } else if (atom->molecular == Atom::TEMPLATE) { Molecule **onemols = atom->avec->onemols; int *molindex = atom->molindex; int *molatom = atom->molatom; @@ -587,7 +585,7 @@ void Finish::end(int flag) mesg += fmt::format("Total # of neighbors = {:.8g}\n",nall); if (atom->natoms > 0) mesg += fmt::format("Ave neighs/atom = {:.8}\n",nall/atom->natoms); - if (atom->molecular && atom->natoms > 0) + if ((atom->molecular != Atom::ATOMIC) && (atom->natoms > 0)) mesg += fmt::format("Ave special neighs/atom = {:.8}\n", nspec_all/atom->natoms); mesg += fmt::format("Neighbor list builds = {}\n",neighbor->ncalls); diff --git a/src/fix.cpp b/src/fix.cpp index c15f5638e2..8d6d3f8829 100644 --- a/src/fix.cpp +++ b/src/fix.cpp @@ -12,14 +12,15 @@ ------------------------------------------------------------------------- */ #include "fix.h" + +#include "atom.h" +#include "atom_masks.h" +#include "error.h" +#include "group.h" +#include "memory.h" + #include #include -#include "atom.h" -#include "group.h" -#include "force.h" -#include "atom_masks.h" -#include "memory.h" -#include "error.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -32,8 +33,8 @@ int Fix::instance_total = 0; Fix::Fix(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp), - id(NULL), style(NULL), extlist(NULL), vector_atom(NULL), array_atom(NULL), - vector_local(NULL), array_local(NULL), eatom(NULL), vatom(NULL) + id(nullptr), style(nullptr), extlist(nullptr), vector_atom(nullptr), array_atom(nullptr), + vector_local(nullptr), array_local(nullptr), eatom(nullptr), vatom(nullptr) { instance_me = instance_total++; @@ -163,7 +164,7 @@ void Fix::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"respa") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix_modify command"); if (!respa_level_support) error->all(FLERR,"Illegal fix_modify command"); - int lvl = force->inumeric(FLERR,arg[iarg+1]); + int lvl = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (lvl < 0) error->all(FLERR,"Illegal fix_modify command"); respa_level = lvl-1; iarg += 2; diff --git a/src/fix.h b/src/fix.h index ab8dddf1d9..07a222063c 100644 --- a/src/fix.h +++ b/src/fix.h @@ -215,7 +215,7 @@ class Fix : protected Pointers { virtual int image(int *&, double **&) {return 0;} virtual int modify_param(int, char **) {return 0;} - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual double memory_usage() {return 0.0;} diff --git a/src/fix_adapt.cpp b/src/fix_adapt.cpp index c502dc6595..52f4236985 100644 --- a/src/fix_adapt.cpp +++ b/src/fix_adapt.cpp @@ -30,8 +30,8 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -43,10 +43,10 @@ enum{DIAMETER,CHARGE}; /* ---------------------------------------------------------------------- */ FixAdapt::FixAdapt(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) +nadapt(0), id_fix_diam(nullptr), id_fix_chg(nullptr), adapt(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix adapt command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix adapt command"); dynamic_group_allow = 1; @@ -96,12 +96,12 @@ nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) strcpy(adapt[nadapt].pstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].pparam = new char[n]; - adapt[nadapt].pair = NULL; + adapt[nadapt].pair = nullptr; strcpy(adapt[nadapt].pparam,arg[iarg+2]); - force->bounds(FLERR,arg[iarg+3],atom->ntypes, - adapt[nadapt].ilo,adapt[nadapt].ihi); - force->bounds(FLERR,arg[iarg+4],atom->ntypes, - adapt[nadapt].jlo,adapt[nadapt].jhi); + utils::bounds(FLERR,arg[iarg+3],1,atom->ntypes, + adapt[nadapt].ilo,adapt[nadapt].ihi,error); + utils::bounds(FLERR,arg[iarg+4],1,atom->ntypes, + adapt[nadapt].jlo,adapt[nadapt].jhi,error); if (strstr(arg[iarg+5],"v_") == arg[iarg+5]) { n = strlen(&arg[iarg+5][2]) + 1; adapt[nadapt].var = new char[n]; @@ -118,10 +118,10 @@ nadapt(0), id_fix_diam(NULL), id_fix_chg(NULL), adapt(NULL) strcpy(adapt[nadapt].bstyle,arg[iarg+1]); n = strlen(arg[iarg+2]) + 1; adapt[nadapt].bparam = new char[n]; - adapt[nadapt].bond = NULL; + adapt[nadapt].bond = nullptr; strcpy(adapt[nadapt].bparam,arg[iarg+2]); - force->bounds(FLERR,arg[iarg+3],atom->nbondtypes, - adapt[nadapt].ilo,adapt[nadapt].ihi); + utils::bounds(FLERR,arg[iarg+3],1,atom->nbondtypes, + adapt[nadapt].ilo,adapt[nadapt].ihi,error); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { n = strlen(&arg[iarg+4][2]) + 1; adapt[nadapt].var = new char[n]; @@ -263,8 +263,8 @@ void FixAdapt::post_constructor() // new id = fix-ID + FIX_STORE_ATTRIBUTE // new fix group = group for this fix - id_fix_diam = NULL; - id_fix_chg = NULL; + id_fix_diam = nullptr; + id_fix_chg = nullptr; if (diamflag && atom->radius_flag) { std::string fixcmd = id + std::string("_FIX_STORE_DIAM"); @@ -340,7 +340,7 @@ void FixAdapt::init() if (ad->which == PAIR) { anypair = 1; - ad->pair = NULL; + ad->pair = nullptr; // if ad->pstyle has trailing sub-style annotation ":N", // strip it for pstyle arg to pair_match() and set nsub = N @@ -354,7 +354,7 @@ void FixAdapt::init() int nsub = 0; if ((cptr = strchr(pstyle,':'))) { *cptr = '\0'; - nsub = force->inumeric(FLERR,cptr+1); + nsub = utils::inumeric(FLERR,cptr+1,false,lmp); } if (lmp->suffix_enable) { @@ -366,12 +366,12 @@ void FixAdapt::init() ad->pair = force->pair_match(psuffix,1,nsub); delete[] psuffix; } - if (ad->pair == NULL) ad->pair = force->pair_match(pstyle,1,nsub); - if (ad->pair == NULL) + if (ad->pair == nullptr) ad->pair = force->pair_match(pstyle,1,nsub); + if (ad->pair == nullptr) error->all(FLERR,"Fix adapt pair style does not exist"); void *ptr = ad->pair->extract(ad->pparam,ad->pdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt pair style param not supported"); // for pair styles only parameters that are 2-d arrays in atom types or @@ -396,7 +396,7 @@ void FixAdapt::init() delete [] pstyle; } else if (ad->which == BOND){ - ad->bond = NULL; + ad->bond = nullptr; anybond = 1; int n = strlen(ad->bstyle) + 1; @@ -412,13 +412,13 @@ void FixAdapt::init() ad->bond = force->bond_match(bsuffix); delete [] bsuffix; } - if (ad->bond == NULL) ad->bond = force->bond_match(bstyle); - if (ad->bond == NULL ) + if (ad->bond == nullptr) ad->bond = force->bond_match(bstyle); + if (ad->bond == nullptr ) error->all(FLERR,"Fix adapt bond style does not exist"); void *ptr = ad->bond->extract(ad->bparam,ad->bdim); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR,"Fix adapt bond style param not supported"); // for bond styles, use a vector @@ -431,7 +431,7 @@ void FixAdapt::init() delete [] bstyle; } else if (ad->which == KSPACE) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Fix adapt kspace style does not exist"); kspace_scale = (double *) force->kspace->extract("scale"); diff --git a/src/fix_addforce.cpp b/src/fix_addforce.cpp index 275ec2c846..a8b7a46e4f 100644 --- a/src/fix_addforce.cpp +++ b/src/fix_addforce.cpp @@ -12,21 +12,20 @@ ------------------------------------------------------------------------- */ #include "fix_addforce.h" -#include -#include -#include + #include "atom.h" #include "atom_masks.h" -#include "update.h" -#include "modify.h" #include "domain.h" +#include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" #include "region.h" #include "respa.h" -#include "input.h" +#include "update.h" #include "variable.h" -#include "memory.h" -#include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -37,7 +36,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), estr(NULL), idregion(NULL), sforce(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), estr(nullptr), idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix addforce command"); @@ -53,14 +52,14 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : ilevel_respa = 0; virial_flag = 1; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[3][2]); } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -68,7 +67,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : ystr = new char[n]; strcpy(ystr,&arg[4][2]); } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -76,7 +75,7 @@ FixAddForce::FixAddForce(LAMMPS *lmp, int narg, char **arg) : zstr = new char[n]; strcpy(zstr,&arg[5][2]); } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } @@ -254,7 +253,7 @@ void FixAddForce::post_force(int vflag) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_ave_atom.cpp b/src/fix_ave_atom.cpp index 694df2bcf7..b1b3d9b1b1 100644 --- a/src/fix_ave_atom.cpp +++ b/src/fix_ave_atom.cpp @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #include "fix_ave_atom.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" -#include "force.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -35,14 +35,14 @@ enum{X,V,F,COMPUTE,FIX,VARIABLE}; FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), array(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), array(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/atom command"); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - peratom_freq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + peratom_freq = utils::inumeric(FLERR,arg[5],false,lmp); nvalues = narg - 6; @@ -51,7 +51,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - nvalues = input->expand_args(nvalues,&arg[6],1,earg); + nvalues = utils::expand_args(FLERR,nvalues,&arg[6],1,earg,lmp); if (earg != &arg[6]) expand = 1; arg = earg; @@ -64,7 +64,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : value2index = new int[nvalues]; for (int i = 0; i < nvalues; i++) { - ids[i] = NULL; + ids[i] = nullptr; if (strcmp(arg[i],"x") == 0) { which[i] = X; @@ -194,7 +194,7 @@ FixAveAtom::FixAveAtom(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // zero the array since dump may access it on timestep 0 // zero the array since a variable may access it before first run @@ -221,7 +221,7 @@ FixAveAtom::~FixAveAtom() { // unregister callback to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); delete [] which; delete [] argindex; @@ -376,7 +376,7 @@ void FixAveAtom::end_of_step() } else if (which[m] == VARIABLE) { if (array) input->variable->compute_atom(n,igroup,&array[0][m],nvalues,1); - else input->variable->compute_atom(n,igroup,NULL,nvalues,1); + else input->variable->compute_atom(n,igroup,nullptr,nvalues,1); } } @@ -394,7 +394,7 @@ void FixAveAtom::end_of_step() nvalid = ntimestep+peratom_freq - (nrepeat-1)*nevery; modify->addstep_compute(nvalid); - if (array == NULL) return; + if (array == nullptr) return; // average the final result for the Nfreq timestep @@ -424,7 +424,7 @@ void FixAveAtom::grow_arrays(int nmax) memory->grow(array,nmax,nvalues,"fix_ave/atom:array"); array_atom = array; if (array) vector_atom = array[0]; - else vector_atom = NULL; + else vector_atom = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_ave_chunk.cpp b/src/fix_ave_chunk.cpp index 2987783b2a..c178cf63c0 100644 --- a/src/fix_ave_chunk.cpp +++ b/src/fix_ave_chunk.cpp @@ -12,8 +12,8 @@ ------------------------------------------------------------------------- */ #include "fix_ave_chunk.h" -#include -#include + + #include #include #include "atom.h" @@ -27,8 +27,8 @@ #include "variable.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -46,20 +46,20 @@ enum{ONE,RUNNING,WINDOW}; FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), nvalues(0), nrepeat(0), - which(NULL), argindex(NULL), value2index(NULL), ids(NULL), - fp(NULL), idchunk(NULL), varatom(NULL), - count_one(NULL), count_many(NULL), count_sum(NULL), - values_one(NULL), values_many(NULL), values_sum(NULL), - count_total(NULL), count_list(NULL), - values_total(NULL), values_list(NULL) + which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), + fp(nullptr), idchunk(nullptr), varatom(nullptr), + count_one(nullptr), count_many(nullptr), count_sum(nullptr), + values_one(nullptr), values_many(nullptr), values_sum(nullptr), + count_total(nullptr), count_list(nullptr), + values_total(nullptr), values_list(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/chunk command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); int n = strlen(arg[6]) + 1; idchunk = new char[n]; @@ -72,7 +72,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - int nargnew = input->expand_args(narg-7,&arg[7],1,earg); + int nargnew = utils::expand_args(FLERR,narg-7,&arg[7],1,earg,lmp); if (earg != &arg[7]) expand = 1; arg = earg; @@ -88,7 +88,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : int iarg = 0; while (iarg < nargnew) { - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"vx") == 0) { which[nvalues] = V; @@ -164,15 +164,15 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : ave = ONE; nwindow = 0; biasflag = 0; - id_bias = NULL; + id_bias = nullptr; adof = domain->dimension; cdof = 0.0; overwrite = 0; - format_user = NULL; + format_user = nullptr; format = (char *) " %g"; - char *title1 = NULL; - char *title2 = NULL; - char *title3 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; + char *title3 = nullptr; while (iarg < nargnew) { if (strcmp(arg[iarg],"norm") == 0) { @@ -196,7 +196,7 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Illegal fix ave/chunk command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/chunk command"); } iarg += 2; @@ -213,19 +213,19 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"adof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); - adof = force->numeric(FLERR,arg[iarg+1]); + adof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"cdof") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); - cdof = force->numeric(FLERR,arg[iarg+1]); + cdof = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/chunk command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/chunk file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -409,12 +409,12 @@ FixAveChunk::FixAveChunk(LAMMPS *lmp, int narg, char **arg) : normcount = 0; maxvar = 0; - varatom = NULL; + varatom = nullptr; - count_one = count_many = count_sum = count_total = NULL; - count_list = NULL; - values_one = values_many = values_sum = values_total = NULL; - values_list = NULL; + count_one = count_many = count_sum = count_total = nullptr; + count_list = nullptr; + values_one = values_many = values_sum = values_total = nullptr; + values_list = nullptr; maxchunk = 0; nchunk = 1; @@ -466,24 +466,24 @@ FixAveChunk::~FixAveChunk() } delete [] idchunk; - which = NULL; - argindex = NULL; - ids = NULL; - value2index = NULL; - fp = NULL; - varatom = NULL; - count_one = NULL; - count_many = NULL; - count_sum = NULL; - count_total = NULL; - count_list = NULL; - values_one = NULL; - values_many = NULL; - values_sum = NULL; - values_total = NULL; - values_list = NULL; - idchunk = NULL; - cchunk = NULL; + which = nullptr; + argindex = nullptr; + ids = nullptr; + value2index = nullptr; + fp = nullptr; + varatom = nullptr; + count_one = nullptr; + count_many = nullptr; + count_sum = nullptr; + count_total = nullptr; + count_list = nullptr; + values_one = nullptr; + values_many = nullptr; + values_sum = nullptr; + values_total = nullptr; + values_list = nullptr; + idchunk = nullptr; + cchunk = nullptr; } /* ---------------------------------------------------------------------- */ @@ -1110,7 +1110,7 @@ void FixAveChunk::allocate() double FixAveChunk::compute_array(int i, int j) { - if (values_total == NULL) return 0.0; + if (values_total == nullptr) return 0.0; if (i >= nchunk) return 0.0; if (j < colextra) { if (cchunk->compress) { diff --git a/src/fix_ave_correlate.cpp b/src/fix_ave_correlate.cpp index 2231611d1e..5576c7fb66 100644 --- a/src/fix_ave_correlate.cpp +++ b/src/fix_ave_correlate.cpp @@ -18,20 +18,17 @@ ------------------------------------------------------------------------- */ #include "fix_ave_correlate.h" -#include -#include + +#include "compute.h" +#include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + #include #include -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -48,16 +45,16 @@ enum{AUTO,UPPER,LOWER,AUTOUPPER,AUTOLOWER,FULL}; FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): Fix (lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), fp(NULL), - count(NULL), values(NULL), corr(NULL), save_count(NULL), save_corr(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), fp(nullptr), + count(nullptr), values(nullptr), corr(nullptr), save_count(nullptr), save_corr(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/correlate command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; @@ -65,7 +62,7 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): int expand = 0; char **earg; - int nargnew = input->expand_args(narg-6,&arg[6],0,earg); + int nargnew = utils::expand_args(FLERR,narg-6,&arg[6],0,earg,lmp); if (earg != &arg[6]) expand = 1; arg = earg; @@ -115,11 +112,11 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): ave = ONE; startstep = 0; prefactor = 1.0; - fp = NULL; + fp = nullptr; overwrite = 0; - char *title1 = NULL; - char *title2 = NULL; - char *title3 = NULL; + char *title1 = nullptr; + char *title2 = nullptr; + char *title3 = nullptr; while (iarg < nargnew) { if (strcmp(arg[iarg],"type") == 0) { @@ -140,17 +137,17 @@ FixAveCorrelate::FixAveCorrelate(LAMMPS * lmp, int narg, char **arg): iarg += 2; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"prefactor") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); - prefactor = force->numeric(FLERR,arg[iarg+1]); + prefactor = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"file") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/correlate command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/correlate file {}:"" {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_ave_histo.cpp b/src/fix_ave_histo.cpp index d0bedba34a..5d5abdc9ac 100644 --- a/src/fix_ave_histo.cpp +++ b/src/fix_ave_histo.cpp @@ -12,21 +12,18 @@ ------------------------------------------------------------------------- */ #include "fix_ave_histo.h" -#include -#include + +#include "atom.h" +#include "compute.h" +#include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + #include #include -#include "atom.h" -#include "update.h" -#include "modify.h" -#include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -48,18 +45,18 @@ enum{IGNORE,END,EXTRA}; FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), fp(NULL), stats_list(NULL), - bin(NULL), bin_total(NULL), bin_all(NULL), bin_list(NULL), - coord(NULL), vector(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), fp(nullptr), stats_list(nullptr), + bin(nullptr), bin_total(nullptr), bin_all(nullptr), bin_list(nullptr), + coord(nullptr), vector(nullptr) { if (narg < 10) error->all(FLERR,"Illegal fix ave/histo command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; vector_flag = 1; @@ -70,9 +67,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : extarray = 0; dynamic_group_allow = 1; - lo = force->numeric(FLERR,arg[6]); - hi = force->numeric(FLERR,arg[7]); - nbins = force->inumeric(FLERR,arg[8]); + lo = utils::numeric(FLERR,arg[6],false,lmp); + hi = utils::numeric(FLERR,arg[7],false,lmp); + nbins = utils::inumeric(FLERR,arg[8],false,lmp); // scan values to count them // then read options so know mode = SCALAR/VECTOR before re-reading values @@ -107,7 +104,7 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - nvalues = input->expand_args(nvalues,&arg[9],mode,earg); + nvalues = utils::expand_args(FLERR,nvalues,&arg[9],mode,earg,lmp); if (earg != &arg[9]) expand = 1; arg = earg; @@ -123,41 +120,41 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[i],"x") == 0) { which[i] = X; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"y") == 0) { which[i] = X; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"z") == 0) { which[i] = X; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vx") == 0) { which[i] = V; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vy") == 0) { which[i] = V; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"vz") == 0) { which[i] = V; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fx") == 0) { which[i] = F; argindex[i] = 0; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fy") == 0) { which[i] = F; argindex[i] = 1; - ids[i] = NULL; + ids[i] = nullptr; } else if (strcmp(arg[i],"fz") == 0) { which[i] = F; argindex[i] = 2; - ids[i] = NULL; + ids[i] = nullptr; } else if ((strncmp(arg[i],"c_",2) == 0) || (strncmp(arg[i],"f_",2) == 0) || @@ -470,9 +467,9 @@ FixAveHisto::FixAveHisto(LAMMPS *lmp, int narg, char **arg) : bin_all = new double[nbins]; coord = new double[nbins]; - stats_list = NULL; - bin_list = NULL; - vector = NULL; + stats_list = nullptr; + bin_list = nullptr; + vector = nullptr; maxatom = 0; if (ave == WINDOW) { @@ -763,7 +760,7 @@ void FixAveHisto::end_of_step() } irepeat = 0; - nvalid = ntimestep + nfreq - (nrepeat-1)*nevery; + nvalid = ntimestep + nfreq - static_cast(nrepeat-1)*nevery; modify->addstep_compute(nvalid); // merge histogram stats across procs if necessary @@ -947,16 +944,16 @@ void FixAveHisto::options(int iarg, int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; kind = DEFAULT; ave = ONE; startstep = 0; mode = SCALAR; beyond = IGNORE; overwrite = 0; - title1 = NULL; - title2 = NULL; - title3 = NULL; + title1 = nullptr; + title2 = nullptr; + title3 = nullptr; // optional args @@ -965,7 +962,7 @@ void FixAveHisto::options(int iarg, int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/histo file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -985,14 +982,14 @@ void FixAveHisto::options(int iarg, int narg, char **arg) else error->all(FLERR,"Illegal fix ave/histo command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/histo command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/histo command"); } iarg += 2; if (ave == WINDOW) iarg++; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mode") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/histo command"); @@ -1049,7 +1046,7 @@ bigint FixAveHisto::nextvalid() if (nvalid-nfreq == update->ntimestep && nrepeat == 1) nvalid = update->ntimestep; else - nvalid -= (nrepeat-1)*nevery; + nvalid -= static_cast(nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += nfreq; return nvalid; } diff --git a/src/fix_ave_histo_weight.cpp b/src/fix_ave_histo_weight.cpp index 4b86681153..08ec3632b4 100644 --- a/src/fix_ave_histo_weight.cpp +++ b/src/fix_ave_histo_weight.cpp @@ -15,7 +15,7 @@ Contributing author: Shawn Coleman (ARL) ------------------------------------------------------------------------- */ #include "fix_ave_histo_weight.h" -#include + #include #include "fix.h" #include "atom.h" @@ -126,7 +126,7 @@ void FixAveHistoWeight::end_of_step() // calculate weight factors which are 2nd value (i = 1) double weight = 0.0; - double *weights = NULL; + double *weights = nullptr; int stride = 0; i = 1; @@ -270,11 +270,11 @@ void FixAveHistoWeight::end_of_step() // atom attributes - if (which[i] == X && weights != NULL) + if (which[i] == X && weights != nullptr) bin_atoms_weights(&atom->x[0][j],3,weights,stride); - else if (which[i] == V && weights != NULL) + else if (which[i] == V && weights != nullptr) bin_atoms_weights(&atom->v[0][j],3,weights,stride); - else if (which[i] == F && weights != NULL) + else if (which[i] == F && weights != nullptr) bin_atoms_weights(&atom->f[0][j],3,weights,stride); // invoke compute if not previously invoked @@ -403,7 +403,7 @@ void FixAveHistoWeight::end_of_step() } irepeat = 0; - nvalid = ntimestep + nfreq - (nrepeat-1)*nevery; + nvalid = ntimestep + nfreq - static_cast(nrepeat-1)*nevery; modify->addstep_compute(nvalid); // merge histogram stats across procs if necessary diff --git a/src/fix_ave_time.cpp b/src/fix_ave_time.cpp index 84c5c04f11..4a25cca6e5 100644 --- a/src/fix_ave_time.cpp +++ b/src/fix_ave_time.cpp @@ -16,20 +16,17 @@ ------------------------------------------------------------------------- */ #include "fix_ave_time.h" -#include -#include + +#include "compute.h" +#include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + #include #include -#include "update.h" -#include "force.h" -#include "modify.h" -#include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -46,19 +43,19 @@ enum{SCALAR,VECTOR}; FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - offcol(NULL), varlen(NULL), ids(NULL), - fp(NULL), offlist(NULL), format(NULL), format_user(NULL), - vector(NULL), vector_total(NULL), vector_list(NULL), - column(NULL), array(NULL), array_total(NULL), array_list(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + offcol(nullptr), varlen(nullptr), ids(nullptr), + fp(nullptr), offlist(nullptr), format(nullptr), format_user(nullptr), + vector(nullptr), vector_total(nullptr), vector_list(nullptr), + column(nullptr), array(nullptr), array_total(nullptr), array_list(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix ave/time command"); MPI_Comm_rank(world,&me); - nevery = force->inumeric(FLERR,arg[3]); - nrepeat = force->inumeric(FLERR,arg[4]); - nfreq = force->inumeric(FLERR,arg[5]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + nrepeat = utils::inumeric(FLERR,arg[4],false,lmp); + nfreq = utils::inumeric(FLERR,arg[5],false,lmp); global_freq = nfreq; @@ -88,7 +85,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : int expand = 0; char **earg; - nvalues = input->expand_args(nvalues,&arg[6],mode,earg); + nvalues = utils::expand_args(FLERR,nvalues,&arg[6],mode,earg,lmp); if (earg != &arg[6]) expand = 1; arg = earg; @@ -246,7 +243,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // nrows = # of rows in output array // if all columns are variable length, just set nrows = 1 for now - column = NULL; + column = nullptr; if (mode == VECTOR) { if (all_variable_length == 0) nrows = column_length(0); else nrows = 1; @@ -307,10 +304,10 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // allocate memory for averaging - vector = vector_total = NULL; - vector_list = NULL; - array = array_total = NULL; - array_list = NULL; + vector = vector_total = nullptr; + vector_list = nullptr; + array = array_total = nullptr; + array_list = nullptr; if (mode == SCALAR) { vector = new double[nvalues]; @@ -324,7 +321,7 @@ FixAveTime::FixAveTime(LAMMPS *lmp, int narg, char **arg) : // VECTOR mode produces either a vector or array // intensive/extensive flags set by compute,fix,variable that produces value - extlist = NULL; + extlist = nullptr; if (mode == SCALAR) { if (nvalues == 1) { @@ -643,7 +640,7 @@ void FixAveTime::invoke_scalar(bigint ntimestep) } irepeat = 0; - nvalid = ntimestep + nfreq - (nrepeat-1)*nevery; + nvalid = ntimestep + nfreq - static_cast(nrepeat-1)*nevery; modify->addstep_compute(nvalid); // average the final result for the Nfreq timestep @@ -746,7 +743,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) if (!varlen[i] || which[i] != COMPUTE) continue; if (nrepeat > 1 && ave == ONE) { Compute *compute = modify->compute[value2index[i]]; - compute->lock(this,ntimestep,ntimestep+(nrepeat-1)*nevery); + compute->lock(this,ntimestep,ntimestep+static_cast(nrepeat-1)*nevery); } else if ((ave == RUNNING || ave == WINDOW) && !lockforever) { Compute *compute = modify->compute[value2index[i]]; compute->lock(this,update->ntimestep,-1); @@ -841,7 +838,7 @@ void FixAveTime::invoke_vector(bigint ntimestep) } irepeat = 0; - nvalid = ntimestep+nfreq - (nrepeat-1)*nevery; + nvalid = ntimestep+nfreq - static_cast(nrepeat-1)*nevery; modify->addstep_compute(nvalid); // unlock any variable length computes at end of Nfreq epoch @@ -1025,18 +1022,18 @@ void FixAveTime::options(int iarg, int narg, char **arg) { // option defaults - fp = NULL; + fp = nullptr; ave = ONE; startstep = 0; mode = SCALAR; noff = 0; - offlist = NULL; + offlist = nullptr; overwrite = 0; - format_user = NULL; + format_user = nullptr; format = (char *) " %g"; - title1 = NULL; - title2 = NULL; - title3 = NULL; + title1 = nullptr; + title2 = nullptr; + title3 = nullptr; // optional args @@ -1045,7 +1042,7 @@ void FixAveTime::options(int iarg, int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); if (me == 0) { fp = fopen(arg[iarg+1],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix ave/time file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -1058,14 +1055,14 @@ void FixAveTime::options(int iarg, int narg, char **arg) else error->all(FLERR,"Illegal fix ave/time command"); if (ave == WINDOW) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix ave/time command"); - nwindow = force->inumeric(FLERR,arg[iarg+2]); + nwindow = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nwindow <= 0) error->all(FLERR,"Illegal fix ave/time command"); } iarg += 2; if (ave == WINDOW) iarg++; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); - startstep = force->inumeric(FLERR,arg[iarg+1]); + startstep = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"mode") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); @@ -1076,7 +1073,7 @@ void FixAveTime::options(int iarg, int narg, char **arg) } else if (strcmp(arg[iarg],"off") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix ave/time command"); memory->grow(offlist,noff+1,"ave/time:offlist"); - offlist[noff++] = force->inumeric(FLERR,arg[iarg+1]); + offlist[noff++] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"overwrite") == 0) { overwrite = 1; @@ -1149,7 +1146,7 @@ bigint FixAveTime::nextvalid() if (nvalid-nfreq == update->ntimestep && nrepeat == 1) nvalid = update->ntimestep; else - nvalid -= (nrepeat-1)*nevery; + nvalid -= static_cast(nrepeat-1)*nevery; if (nvalid < update->ntimestep) nvalid += nfreq; return nvalid; } diff --git a/src/fix_aveforce.cpp b/src/fix_aveforce.cpp index 8ad07780a9..324f6eaa6b 100644 --- a/src/fix_aveforce.cpp +++ b/src/fix_aveforce.cpp @@ -12,18 +12,18 @@ ------------------------------------------------------------------------- */ #include "fix_aveforce.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "domain.h" +#include "error.h" +#include "input.h" +#include "modify.h" #include "region.h" #include "respa.h" -#include "input.h" +#include "update.h" #include "variable.h" -#include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -34,7 +34,7 @@ enum{NONE,CONSTANT,EQUAL}; FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix aveforce command"); @@ -46,7 +46,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = nlevels_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -55,7 +55,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"NULL") == 0) { xstyle = NONE; } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -65,7 +65,7 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4],"NULL") == 0) { ystyle = NONE; } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -75,14 +75,14 @@ FixAveForce::FixAveForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[5],"NULL") == 0) { zstyle = NONE; } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -197,7 +197,7 @@ void FixAveForce::post_force(int /*vflag*/) { // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -265,7 +265,7 @@ void FixAveForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) if (ilevel == ilevel_respa) post_force(vflag); else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_balance.cpp b/src/fix_balance.cpp index f374a7c5c5..735b6b3bd0 100644 --- a/src/fix_balance.cpp +++ b/src/fix_balance.cpp @@ -35,7 +35,7 @@ enum{SHIFT,BISECTION}; /* ---------------------------------------------------------------------- */ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), balance(NULL), irregular(NULL) + Fix(lmp, narg, arg), balance(nullptr), irregular(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix balance command"); @@ -52,9 +52,9 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : int dimension = domain->dimension; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix balance command"); - thresh = force->numeric(FLERR,arg[4]); + thresh = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"shift") == 0) lbstyle = SHIFT; else if (strcmp(arg[5],"rcb") == 0) lbstyle = BISECTION; @@ -66,9 +66,9 @@ FixBalance::FixBalance(LAMMPS *lmp, int narg, char **arg) : if (strlen(arg[iarg+1]) > 3) error->all(FLERR,"Illegal fix balance command"); strcpy(bstr,arg[iarg+1]); - nitermax = force->inumeric(FLERR,arg[iarg+2]); + nitermax = utils::inumeric(FLERR,arg[iarg+2],false,lmp); if (nitermax <= 0) error->all(FLERR,"Illegal fix balance command"); - stopthresh = force->numeric(FLERR,arg[iarg+3]); + stopthresh = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (stopthresh < 1.0) error->all(FLERR,"Illegal fix balance command"); iarg += 4; } else if (lbstyle == BISECTION) { diff --git a/src/fix_box_relax.cpp b/src/fix_box_relax.cpp index 832799831e..8d8b4af107 100644 --- a/src/fix_box_relax.cpp +++ b/src/fix_box_relax.cpp @@ -18,7 +18,7 @@ #include "fix_box_relax.h" #include #include -#include + #include "atom.h" #include "domain.h" #include "update.h" @@ -29,7 +29,7 @@ #include "compute.h" #include "error.h" #include "math_extra.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -43,7 +43,7 @@ enum{ISO,ANISO,TRICLINIC}; FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_temp(NULL), id_press(NULL), tflag(0), pflag(0) + id_temp(nullptr), id_press(nullptr), tflag(0), pflag(0) { if (narg < 5) error->all(FLERR,"Illegal fix box/relax command"); @@ -90,7 +90,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"iso") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); pcouple = XYZ; - p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = p_target[1] = p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_target[2] = 0.0; @@ -100,7 +100,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"aniso") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); pcouple = NONE; - p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = p_target[1] = p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_target[2] = 0.0; @@ -111,7 +111,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); pcouple = NONE; scalexy = scalexz = scaleyz = 0; - p_target[0] = p_target[1] = p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = p_target[1] = p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_target[3] = p_target[4] = p_target[5] = 0.0; p_flag[3] = p_flag[4] = p_flag[5] = 1; @@ -123,19 +123,19 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[0] = force->numeric(FLERR,arg[iarg+1]); + p_target[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[0] = 1; deviatoric_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[1] = force->numeric(FLERR,arg[iarg+1]); + p_target[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[1] = 1; deviatoric_flag = 1; iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[2] = force->numeric(FLERR,arg[iarg+1]); + p_target[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[2] = 1; deviatoric_flag = 1; iarg += 2; @@ -144,7 +144,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[3] = force->numeric(FLERR,arg[iarg+1]); + p_target[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[3] = 1; deviatoric_flag = 1; scaleyz = 0; @@ -153,7 +153,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix box/relax command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[4] = force->numeric(FLERR,arg[iarg+1]); + p_target[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[4] = 1; deviatoric_flag = 1; scalexz = 0; @@ -162,7 +162,7 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix box/relax command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - p_target[5] = force->numeric(FLERR,arg[iarg+1]); + p_target[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_flag[5] = 1; deviatoric_flag = 1; scalexy = 0; @@ -186,11 +186,11 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"vmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - vmax = force->numeric(FLERR,arg[iarg+1]); + vmax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix box/relax command"); - nreset_h0 = force->inumeric(FLERR,arg[iarg+1]); + nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nreset_h0 < 0) error->all(FLERR,"Illegal fix box/relax command"); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { @@ -213,9 +213,9 @@ FixBoxRelax::FixBoxRelax(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix box/relax command"); - fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]); - fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]); - fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]); + fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else error->all(FLERR,"Illegal fix box/relax command"); } @@ -395,7 +395,7 @@ void FixBoxRelax::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_controller.cpp b/src/fix_controller.cpp index f7012e5565..edeaf60f42 100644 --- a/src/fix_controller.cpp +++ b/src/fix_controller.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "fix_controller.h" -#include -#include -#include "force.h" -#include "update.h" -#include "modify.h" + #include "compute.h" -#include "input.h" -#include "variable.h" #include "error.h" +#include "input.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -34,7 +34,7 @@ enum{COMPUTE,FIX,VARIABLE}; FixController::FixController(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pvID(NULL), cvID(NULL) + pvID(nullptr), cvID(nullptr) { if (narg != 11) error->all(FLERR,"Illegal fix controller command"); @@ -43,13 +43,13 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : global_freq = 1; extvector = 0; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix controller command"); - alpha = force->numeric(FLERR,arg[4]); - kp = force->numeric(FLERR,arg[5]); - ki = force->numeric(FLERR,arg[6]); - kd = force->numeric(FLERR,arg[7]); + alpha = utils::numeric(FLERR,arg[4],false,lmp); + kp = utils::numeric(FLERR,arg[5],false,lmp); + ki = utils::numeric(FLERR,arg[6],false,lmp); + kd = utils::numeric(FLERR,arg[7],false,lmp); // process variable arg @@ -84,7 +84,7 @@ FixController::FixController(LAMMPS *lmp, int narg, char **arg) : // setpoint arg - setpoint = force->numeric(FLERR,arg[iarg]); + setpoint = utils::numeric(FLERR,arg[iarg],false,lmp); iarg++; // control variable arg diff --git a/src/fix_deform.cpp b/src/fix_deform.cpp index 2514f28fa5..4d3b1c647b 100644 --- a/src/fix_deform.cpp +++ b/src/fix_deform.cpp @@ -42,7 +42,7 @@ enum{ONE_FROM_ONE,ONE_FROM_TWO,TWO_FROM_ONE}; /* ---------------------------------------------------------------------- */ FixDeform::FixDeform(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -rfix(NULL), irregular(NULL), set(NULL) +rfix(nullptr), irregular(nullptr), set(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix deform command"); @@ -50,7 +50,7 @@ rfix(NULL), irregular(NULL), set(NULL) restart_global = 1; pre_exchange_migrate = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix deform command"); // set defaults @@ -77,34 +77,34 @@ rfix(NULL), irregular(NULL), set(NULL) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = FINAL; - set[index].flo = force->numeric(FLERR,arg[iarg+2]); - set[index].fhi = force->numeric(FLERR,arg[iarg+3]); + set[index].flo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].fhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = DELTA; - set[index].dlo = force->numeric(FLERR,arg[iarg+2]); - set[index].dhi = force->numeric(FLERR,arg[iarg+3]); + set[index].dlo = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].dhi = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg+1],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = SCALE; - set[index].scale = force->numeric(FLERR,arg[iarg+2]); + set[index].scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"vel") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = VEL; - set[index].vel = force->numeric(FLERR,arg[iarg+2]); + set[index].vel = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"erate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = ERATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"trate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = TRATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"volume") == 0) { set[index].style = VOLUME; @@ -112,8 +112,8 @@ rfix(NULL), irregular(NULL), set(NULL) } else if (strcmp(arg[iarg+1],"wiggle") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = WIGGLE; - set[index].amplitude = force->numeric(FLERR,arg[iarg+2]); - set[index].tperiod = force->numeric(FLERR,arg[iarg+3]); + set[index].amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].tperiod = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (set[index].tperiod <= 0.0) error->all(FLERR,"Illegal fix deform command"); iarg += 4; @@ -149,33 +149,33 @@ rfix(NULL), irregular(NULL), set(NULL) if (strcmp(arg[iarg+1],"final") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = FINAL; - set[index].ftilt = force->numeric(FLERR,arg[iarg+2]); + set[index].ftilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"delta") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = DELTA; - set[index].dtilt = force->numeric(FLERR,arg[iarg+2]); + set[index].dtilt = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"vel") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = VEL; - set[index].vel = force->numeric(FLERR,arg[iarg+2]); + set[index].vel = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"erate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = ERATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"trate") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = TRATE; - set[index].rate = force->numeric(FLERR,arg[iarg+2]); + set[index].rate = utils::numeric(FLERR,arg[iarg+2],false,lmp); iarg += 3; } else if (strcmp(arg[iarg+1],"wiggle") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix deform command"); set[index].style = WIGGLE; - set[index].amplitude = force->numeric(FLERR,arg[iarg+2]); - set[index].tperiod = force->numeric(FLERR,arg[iarg+3]); + set[index].amplitude = utils::numeric(FLERR,arg[iarg+2],false,lmp); + set[index].tperiod = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (set[index].tperiod <= 0.0) error->all(FLERR,"Illegal fix deform command"); iarg += 4; @@ -353,7 +353,7 @@ rfix(NULL), irregular(NULL), set(NULL) flip = 0; if (force_reneighbor) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; TWOPI = 2.0*MY_PI; } @@ -618,7 +618,7 @@ void FixDeform::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_deprecated.cpp b/src/fix_deprecated.cpp index d3ceb69ea0..877eac0524 100644 --- a/src/fix_deprecated.cpp +++ b/src/fix_deprecated.cpp @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #include "fix_deprecated.h" -#include + #include "comm.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; diff --git a/src/fix_drag.cpp b/src/fix_drag.cpp index 9af5a37675..2400014569 100644 --- a/src/fix_drag.cpp +++ b/src/fix_drag.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "fix_drag.h" -#include -#include -#include + #include "atom.h" -#include "update.h" -#include "respa.h" #include "domain.h" #include "error.h" -#include "force.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -42,14 +42,14 @@ FixDrag::FixDrag(LAMMPS *lmp, int narg, char **arg) : xflag = yflag = zflag = 1; if (strcmp(arg[3],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[3]); + else xc = utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[4]); + else yc = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[5]); + else zc = utils::numeric(FLERR,arg[5],false,lmp); - f_mag = force->numeric(FLERR,arg[6]); - delta = force->numeric(FLERR,arg[7]); + f_mag = utils::numeric(FLERR,arg[6],false,lmp); + delta = utils::numeric(FLERR,arg[7],false,lmp); force_flag = 0; ftotal[0] = ftotal[1] = ftotal[2] = 0.0; diff --git a/src/fix_dt_reset.cpp b/src/fix_dt_reset.cpp index da4bdad827..4a9465e696 100644 --- a/src/fix_dt_reset.cpp +++ b/src/fix_dt_reset.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_dt_reset.h" -#include + #include #include #include "atom.h" @@ -50,16 +50,16 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) : extvector = 0; dynamic_group_allow = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix dt/reset command"); minbound = maxbound = 1; tmin = tmax = 0.0; if (strcmp(arg[4],"NULL") == 0) minbound = 0; - else tmin = force->numeric(FLERR,arg[4]); + else tmin = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) maxbound = 0; - else tmax = force->numeric(FLERR,arg[5]); - xmax = force->numeric(FLERR,arg[6]); + else tmax = utils::numeric(FLERR,arg[5],false,lmp); + xmax = utils::numeric(FLERR,arg[6],false,lmp); if (minbound && tmin < 0.0) error->all(FLERR,"Illegal fix dt/reset command"); if (maxbound && tmax < 0.0) error->all(FLERR,"Illegal fix dt/reset command"); @@ -80,7 +80,7 @@ FixDtReset::FixDtReset(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"emax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix dt/reset command"); - emax = force->numeric(FLERR,arg[iarg+1]); + emax = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (emax <= 0.0) error->all(FLERR,"Illegal fix dt/reset command"); iarg += 2; } else error->all(FLERR,"Illegal fix dt/reset command"); @@ -190,6 +190,7 @@ void FixDtReset::end_of_step() update->update_time(); update->dt = dt; + update->dt_default = 0; if (respaflag) update->integrate->reset_dt(); if (force->pair) force->pair->reset_dt(); for (int i = 0; i < modify->nfix; i++) modify->fix[i]->reset_dt(); diff --git a/src/fix_enforce2d.cpp b/src/fix_enforce2d.cpp index 7dd8c08204..02d76b8c27 100644 --- a/src/fix_enforce2d.cpp +++ b/src/fix_enforce2d.cpp @@ -19,7 +19,7 @@ #include "modify.h" #include "respa.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -28,7 +28,7 @@ using namespace FixConst; FixEnforce2D::FixEnforce2D(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - flist(NULL) + flist(nullptr) { if (narg != 3) error->all(FLERR,"Illegal fix enforce2d command"); diff --git a/src/fix_external.cpp b/src/fix_external.cpp index afb420df93..5c7b90ee47 100644 --- a/src/fix_external.cpp +++ b/src/fix_external.cpp @@ -12,12 +12,13 @@ ------------------------------------------------------------------------- */ #include "fix_external.h" -#include + #include "atom.h" -#include "update.h" -#include "memory.h" #include "error.h" -#include "force.h" +#include "memory.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -28,7 +29,7 @@ enum{PF_CALLBACK,PF_ARRAY}; FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fexternal(NULL), caller_vector(NULL) + fexternal(nullptr), caller_vector(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix external command"); @@ -41,31 +42,31 @@ FixExternal::FixExternal(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"pf/callback") == 0) { if (narg != 6) error->all(FLERR,"Illegal fix external command"); mode = PF_CALLBACK; - ncall = force->inumeric(FLERR,arg[4]); - napply = force->inumeric(FLERR,arg[5]); + ncall = utils::inumeric(FLERR,arg[4],false,lmp); + napply = utils::inumeric(FLERR,arg[5],false,lmp); if (ncall <= 0 || napply <= 0) error->all(FLERR,"Illegal fix external command"); } else if (strcmp(arg[3],"pf/array") == 0) { if (narg != 5) error->all(FLERR,"Illegal fix external command"); mode = PF_ARRAY; - napply = force->inumeric(FLERR,arg[4]); + napply = utils::inumeric(FLERR,arg[4],false,lmp); if (napply <= 0) error->all(FLERR,"Illegal fix external command"); } else error->all(FLERR,"Illegal fix external command"); - callback = NULL; + callback = nullptr; // perform initial allocation of atom-based array // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); user_energy = 0.0; // optional vector of values provided by caller // vector_flag and size_vector are setup via set_vector_length() - caller_vector = NULL; + caller_vector = nullptr; } /* ---------------------------------------------------------------------- */ @@ -74,7 +75,7 @@ FixExternal::~FixExternal() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); memory->destroy(fexternal); delete [] caller_vector; @@ -98,7 +99,7 @@ int FixExternal::setmask() void FixExternal::init() { - if (mode == PF_CALLBACK && callback == NULL) + if (mode == PF_CALLBACK && callback == nullptr) error->all(FLERR,"Fix external callback function not set"); } diff --git a/src/fix_gravity.cpp b/src/fix_gravity.cpp index 2c56181415..abef474b4c 100644 --- a/src/fix_gravity.cpp +++ b/src/fix_gravity.cpp @@ -12,19 +12,19 @@ ------------------------------------------------------------------------- */ #include "fix_gravity.h" -#include + +#include "atom.h" +#include "domain.h" +#include "error.h" +#include "input.h" +#include "math_const.h" +#include "modify.h" +#include "respa.h" +#include "update.h" +#include "variable.h" + #include #include -#include "atom.h" -#include "update.h" -#include "domain.h" -#include "respa.h" -#include "modify.h" -#include "input.h" -#include "variable.h" -#include "math_const.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -37,8 +37,8 @@ enum{CONSTANT,EQUAL}; // same as FixPour FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - mstr(NULL), vstr(NULL), pstr(NULL), tstr(NULL), - xstr(NULL), ystr(NULL), zstr(NULL) + mstr(nullptr), vstr(nullptr), pstr(nullptr), tstr(nullptr), + xstr(nullptr), ystr(nullptr), zstr(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix gravity command"); @@ -49,7 +49,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - mstr = vstr = pstr = tstr = xstr = ystr = zstr = NULL; + mstr = vstr = pstr = tstr = xstr = ystr = zstr = nullptr; mstyle = vstyle = pstyle = tstyle = xstyle = ystyle = zstyle = CONSTANT; if (strstr(arg[3],"v_") == arg[3]) { @@ -58,7 +58,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(mstr,&arg[3][2]); mstyle = EQUAL; } else { - magnitude = force->numeric(FLERR,arg[3]); + magnitude = utils::numeric(FLERR,arg[3],false,lmp); mstyle = CONSTANT; } @@ -73,7 +73,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(vstr,&arg[5][2]); vstyle = EQUAL; } else { - vert = force->numeric(FLERR,arg[5]); + vert = utils::numeric(FLERR,arg[5],false,lmp); vstyle = CONSTANT; } iarg = 6; @@ -87,7 +87,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(pstr,&arg[5][2]); pstyle = EQUAL; } else { - phi = force->numeric(FLERR,arg[5]); + phi = utils::numeric(FLERR,arg[5],false,lmp); pstyle = CONSTANT; } if (strstr(arg[6],"v_") == arg[6]) { @@ -96,7 +96,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(tstr,&arg[6][2]); tstyle = EQUAL; } else { - theta = force->numeric(FLERR,arg[6]); + theta = utils::numeric(FLERR,arg[6],false,lmp); tstyle = CONSTANT; } iarg = 7; @@ -110,7 +110,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(xstr,&arg[5][2]); xstyle = EQUAL; } else { - xdir = force->numeric(FLERR,arg[5]); + xdir = utils::numeric(FLERR,arg[5],false,lmp); xstyle = CONSTANT; } if (strstr(arg[6],"v_") == arg[6]) { @@ -119,7 +119,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(ystr,&arg[6][2]); ystyle = EQUAL; } else { - ydir = force->numeric(FLERR,arg[6]); + ydir = utils::numeric(FLERR,arg[6],false,lmp); ystyle = CONSTANT; } if (strstr(arg[7],"v_") == arg[7]) { @@ -128,7 +128,7 @@ FixGravity::FixGravity(LAMMPS *lmp, int narg, char **arg) : strcpy(zstr,&arg[7][2]); zstyle = EQUAL; } else { - zdir = force->numeric(FLERR,arg[7]); + zdir = utils::numeric(FLERR,arg[7],false,lmp); zstyle = CONSTANT; } iarg = 8; @@ -394,5 +394,5 @@ void *FixGravity::extract(const char *name, int &dim) dim = 1; return (void *) gvec; } - return NULL; + return nullptr; } diff --git a/src/fix_group.cpp b/src/fix_group.cpp index d2eea9f781..108a97157e 100644 --- a/src/fix_group.cpp +++ b/src/fix_group.cpp @@ -12,20 +12,21 @@ ------------------------------------------------------------------------- */ #include "fix_group.h" -#include -#include "group.h" -#include "update.h" + #include "atom.h" -#include "force.h" #include "comm.h" #include "domain.h" -#include "region.h" -#include "modify.h" -#include "respa.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "region.h" +#include "respa.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -33,7 +34,7 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixGroup::FixGroup(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -idregion(NULL), idvar(NULL), idprop(NULL) +idregion(nullptr), idvar(nullptr), idprop(nullptr) { // dgroupbit = bitmask of dynamic group // group ID is last part of fix ID @@ -86,7 +87,7 @@ idregion(NULL), idvar(NULL), idprop(NULL) iarg += 2; } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal group command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal group command"); iarg += 2; } else error->all(FLERR,"Illegal group command"); @@ -209,9 +210,9 @@ void FixGroup::set_group() // operate differently due to invocation this early in timestep // e.g. perform ghost comm update due to atoms having just moved - double *var = NULL; - int *ivector = NULL; - double *dvector = NULL; + double *var = nullptr; + int *ivector = nullptr; + double *dvector = nullptr; if (varflag) { update->post_integrate = 1; @@ -264,5 +265,5 @@ void *FixGroup::extract(const char *str, int &/*unused*/) if (strcmp(str,"property") == 0 && propflag) return (void *) idprop; if (strcmp(str,"variable") == 0 && varflag) return (void *) idvar; if (strcmp(str,"region") == 0 && regionflag) return (void *) idregion; - return NULL; + return nullptr; } diff --git a/src/fix_halt.cpp b/src/fix_halt.cpp index c5960dfe13..42f5c46a85 100644 --- a/src/fix_halt.cpp +++ b/src/fix_halt.cpp @@ -12,21 +12,19 @@ ------------------------------------------------------------------------- */ #include "fix_halt.h" -#include + +#include "atom.h" +#include "comm.h" +#include "error.h" +#include "input.h" +#include "modify.h" +#include "neighbor.h" +#include "timer.h" +#include "update.h" +#include "variable.h" + #include #include -#include -#include "update.h" -#include "force.h" -#include "input.h" -#include "variable.h" -#include "atom.h" -#include "neighbor.h" -#include "modify.h" -#include "comm.h" -#include "timer.h" -#include "error.h" -#include "fmt/format.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -39,15 +37,15 @@ enum{NOMSG,YESMSG}; /* ---------------------------------------------------------------------- */ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), idvar(NULL), dlimit_path(NULL) + Fix(lmp, narg, arg), idvar(nullptr), dlimit_path(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix halt command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix halt command"); // comparison args - idvar = NULL; + idvar = nullptr; int iarg = 4; if (strcmp(arg[iarg],"tlimit") == 0) { @@ -80,7 +78,7 @@ FixHalt::FixHalt(LAMMPS *lmp, int narg, char **arg) : else error->all(FLERR,"Invalid fix halt operator"); ++iarg; - value = force->numeric(FLERR,arg[iarg]); + value = utils::numeric(FLERR,arg[iarg],false,lmp); // parse optional args diff --git a/src/fix_heat.cpp b/src/fix_heat.cpp index 65ca47c46d..3c91341940 100644 --- a/src/fix_heat.cpp +++ b/src/fix_heat.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_heat.h" -#include + #include #include #include "atom.h" @@ -39,7 +39,7 @@ enum{CONSTANT,EQUAL,ATOM}; /* ---------------------------------------------------------------------- */ FixHeat::FixHeat(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) +idregion(nullptr), hstr(nullptr), vheat(nullptr), vscale(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix heat command"); @@ -47,17 +47,17 @@ idregion(NULL), hstr(NULL), vheat(NULL), vscale(NULL) global_freq = 1; extscalar = 0; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix heat command"); - hstr = NULL; + hstr = nullptr; if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; hstr = new char[n]; strcpy(hstr,&arg[4][2]); } else { - heat_input = force->numeric(FLERR,arg[4]); + heat_input = utils::numeric(FLERR,arg[4],false,lmp); hstyle = CONSTANT; } @@ -192,7 +192,7 @@ void FixHeat::end_of_step() // vsub = velocity subtracted from each atom to preserve momentum // overall KE cannot go negative - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_indent.cpp b/src/fix_indent.cpp index 04837ff39b..e96ad7ab8a 100644 --- a/src/fix_indent.cpp +++ b/src/fix_indent.cpp @@ -16,19 +16,19 @@ ------------------------------------------------------------------------- */ #include "fix_indent.h" -#include -#include -#include + #include "atom.h" -#include "input.h" -#include "variable.h" #include "domain.h" +#include "error.h" +#include "input.h" #include "lattice.h" -#include "update.h" #include "modify.h" #include "respa.h" -#include "error.h" -#include "force.h" +#include "update.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -40,7 +40,7 @@ enum{INSIDE,OUTSIDE}; FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL), pstr(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr), pstr(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix indent command"); @@ -53,7 +53,7 @@ FixIndent::FixIndent(LAMMPS *lmp, int narg, char **arg) : respa_level_support = 1; ilevel_respa = 0; - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); k3 = k/3.0; // read options from end of input line @@ -407,7 +407,7 @@ void FixIndent::options(int narg, char **arg) if (narg < 0) error->all(FLERR,"Illegal fix indent command"); istyle = NONE; - xstr = ystr = zstr = rstr = pstr = NULL; + xstr = ystr = zstr = rstr = pstr = nullptr; xvalue = yvalue = zvalue = rvalue = pvalue = 0.0; scaleflag = 1; side = OUTSIDE; @@ -421,22 +421,22 @@ void FixIndent::options(int narg, char **arg) int n = strlen(&arg[iarg+1][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+1][2]); - } else xvalue = force->numeric(FLERR,arg[iarg+1]); + } else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+2][2]); - } else yvalue = force->numeric(FLERR,arg[iarg+2]); + } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); - } else zvalue = force->numeric(FLERR,arg[iarg+3]); + } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { int n = strlen(&arg[iarg+4][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[iarg+4][2]); - } else rvalue = force->numeric(FLERR,arg[iarg+4]); + } else rvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); istyle = SPHERE; iarg += 5; @@ -450,43 +450,43 @@ void FixIndent::options(int narg, char **arg) int n = strlen(&arg[iarg+2][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+2][2]); - } else yvalue = force->numeric(FLERR,arg[iarg+2]); + } else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); - } else zvalue = force->numeric(FLERR,arg[iarg+3]); + } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"y") == 0) { cdim = 1; if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+2][2]); - } else xvalue = force->numeric(FLERR,arg[iarg+2]); + } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[iarg+3][2]); - } else zvalue = force->numeric(FLERR,arg[iarg+3]); + } else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else if (strcmp(arg[iarg+1],"z") == 0) { cdim = 2; if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { int n = strlen(&arg[iarg+2][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[iarg+2][2]); - } else xvalue = force->numeric(FLERR,arg[iarg+2]); + } else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) { int n = strlen(&arg[iarg+3][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[iarg+3][2]); - } else yvalue = force->numeric(FLERR,arg[iarg+3]); + } else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); } else error->all(FLERR,"Illegal fix indent command"); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) { int n = strlen(&arg[iarg+4][2]) + 1; rstr = new char[n]; strcpy(rstr,&arg[iarg+4][2]); - } else rvalue = force->numeric(FLERR,arg[iarg+4]); + } else rvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); istyle = CYLINDER; iarg += 5; @@ -502,7 +502,7 @@ void FixIndent::options(int narg, char **arg) int n = strlen(&arg[iarg+2][2]) + 1; pstr = new char[n]; strcpy(pstr,&arg[iarg+2][2]); - } else pvalue = force->numeric(FLERR,arg[iarg+2]); + } else pvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strcmp(arg[iarg+3],"lo") == 0) planeside = -1; else if (strcmp(arg[iarg+3],"hi") == 0) planeside = 1; diff --git a/src/fix_langevin.cpp b/src/fix_langevin.cpp index 4ec34a3631..ecb7a9caf8 100644 --- a/src/fix_langevin.cpp +++ b/src/fix_langevin.cpp @@ -20,7 +20,7 @@ ------------------------------------------------------------------------- */ #include "fix_langevin.h" -#include + #include #include #include "math_extra.h" @@ -38,7 +38,7 @@ #include "memory.h" #include "error.h" #include "group.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -53,8 +53,8 @@ enum{CONSTANT,EQUAL,ATOM}; FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - gjfflag(0), gfactor1(NULL), gfactor2(NULL), ratio(NULL), tstr(NULL), - flangevin(NULL), tforce(NULL), franprev(NULL), lv(NULL), id_temp(NULL), random(NULL) + gjfflag(0), gfactor1(nullptr), gfactor2(nullptr), ratio(nullptr), tstr(nullptr), + flangevin(nullptr), tforce(nullptr), franprev(nullptr), lv(nullptr), id_temp(nullptr), random(nullptr) { if (narg < 7) error->all(FLERR,"Illegal fix langevin command"); @@ -69,14 +69,14 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : tstr = new char[n]; strcpy(tstr,&arg[3][2]); } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); - seed = force->inumeric(FLERR,arg[6]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + seed = utils::inumeric(FLERR,arg[6],false,lmp); if (t_period <= 0.0) error->all(FLERR,"Fix langevin period must be > 0.0"); if (seed <= 0) error->all(FLERR,"Illegal fix langevin command"); @@ -107,7 +107,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"angmom") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command"); if (strcmp(arg[iarg+1],"no") == 0) ascale = 0.0; - else ascale = force->numeric(FLERR,arg[iarg+1]); + else ascale = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"gjf") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix langevin command"); @@ -133,8 +133,8 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix langevin command"); - int itype = force->inumeric(FLERR,arg[iarg+1]); - double scale = force->numeric(FLERR,arg[iarg+2]); + int itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + double scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Illegal fix langevin command"); ratio[itype] = scale; @@ -154,10 +154,10 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : } else error->all(FLERR,"Illegal fix langevin command"); } - // set temperature = NULL, user can override via fix_modify if wants bias + // set temperature = nullptr, user can override via fix_modify if wants bias - id_temp = NULL; - temperature = NULL; + id_temp = nullptr; + temperature = nullptr; energy = 0.0; @@ -165,11 +165,11 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : // compute_scalar checks for this and returns 0.0 // if flangevin_allocated is not set - flangevin = NULL; + flangevin = nullptr; flangevin_allocated = 0; - franprev = NULL; - lv = NULL; - tforce = NULL; + franprev = nullptr; + lv = nullptr; + tforce = nullptr; maxatom1 = maxatom2 = 0; // setup atom-based array for franprev @@ -178,7 +178,7 @@ FixLangevin::FixLangevin(LAMMPS *lmp, int narg, char **arg) : if (gjfflag) { grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // initialize franprev to zero @@ -211,7 +211,7 @@ FixLangevin::~FixLangevin() if (gjfflag) { memory->destroy(franprev); memory->destroy(lv); - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); } } @@ -1104,7 +1104,7 @@ void *FixLangevin::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_lineforce.cpp b/src/fix_lineforce.cpp index c153ee65dd..cacec13302 100644 --- a/src/fix_lineforce.cpp +++ b/src/fix_lineforce.cpp @@ -12,13 +12,14 @@ ------------------------------------------------------------------------- */ #include "fix_lineforce.h" + +#include "atom.h" +#include "error.h" +#include "respa.h" +#include "update.h" + #include #include -#include "atom.h" -#include "update.h" -#include "respa.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -31,9 +32,9 @@ FixLineForce::FixLineForce(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; if (narg != 6) error->all(FLERR,"Illegal fix lineforce command"); - xdir = force->numeric(FLERR,arg[3]); - ydir = force->numeric(FLERR,arg[4]); - zdir = force->numeric(FLERR,arg[5]); + xdir = utils::numeric(FLERR,arg[3],false,lmp); + ydir = utils::numeric(FLERR,arg[4],false,lmp); + zdir = utils::numeric(FLERR,arg[5],false,lmp); double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir); if (len == 0.0) error->all(FLERR,"Illegal fix lineforce command"); diff --git a/src/fix_minimize.cpp b/src/fix_minimize.cpp index 93b13fac49..1fe86e2c06 100644 --- a/src/fix_minimize.cpp +++ b/src/fix_minimize.cpp @@ -23,12 +23,12 @@ using namespace FixConst; FixMinimize::FixMinimize(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvector(0), peratom(NULL), vectors(NULL) + nvector(0), peratom(nullptr), vectors(nullptr) { // register callback to this fix from Atom class // don't perform initial allocation here, must wait until add_vector() - atom->add_callback(0); + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -37,7 +37,7 @@ FixMinimize::~FixMinimize() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored data diff --git a/src/fix_momentum.cpp b/src/fix_momentum.cpp index a363cb8eac..259099e07c 100644 --- a/src/fix_momentum.cpp +++ b/src/fix_momentum.cpp @@ -12,14 +12,14 @@ ------------------------------------------------------------------------- */ #include "fix_momentum.h" -#include -#include -#include + #include "atom.h" #include "domain.h" -#include "group.h" #include "error.h" -#include "force.h" +#include "group.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -34,7 +34,7 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) { if (narg < 4) error->all(FLERR,"Illegal fix momentum command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix momentum command"); dynamic = linear = angular = rescale = 0; @@ -44,9 +44,9 @@ FixMomentum::FixMomentum(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"linear") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix momentum command"); linear = 1; - xflag = force->inumeric(FLERR,arg[iarg+1]); - yflag = force->inumeric(FLERR,arg[iarg+2]); - zflag = force->inumeric(FLERR,arg[iarg+3]); + xflag = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + yflag = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + zflag = utils::inumeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"angular") == 0) { angular = 1; diff --git a/src/fix_move.cpp b/src/fix_move.cpp index 8c58146c52..8c7a6c2f75 100644 --- a/src/fix_move.cpp +++ b/src/fix_move.cpp @@ -46,10 +46,10 @@ enum{EQUAL,ATOM}; FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xvarstr(NULL), yvarstr(NULL), zvarstr(NULL), vxvarstr(NULL), - vyvarstr(NULL), vzvarstr(NULL), - xoriginal(NULL), toriginal(NULL), qoriginal(NULL), - displace(NULL), velocity(NULL) + xvarstr(nullptr), yvarstr(nullptr), zvarstr(nullptr), vxvarstr(nullptr), + vyvarstr(nullptr), vzvarstr(nullptr), + xoriginal(nullptr), toriginal(nullptr), qoriginal(nullptr), + displace(nullptr), velocity(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix move command"); @@ -75,17 +75,17 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) vxflag = 0; else { vxflag = 1; - vx = force->numeric(FLERR,arg[4]); + vx = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) vyflag = 0; else { vyflag = 1; - vy = force->numeric(FLERR,arg[5]); + vy = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) vzflag = 0; else { vzflag = 1; - vz = force->numeric(FLERR,arg[6]); + vz = utils::numeric(FLERR,arg[6],false,lmp); } } else if (strcmp(arg[3],"wiggle") == 0) { @@ -95,69 +95,69 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[4],"NULL") == 0) axflag = 0; else { axflag = 1; - ax = force->numeric(FLERR,arg[4]); + ax = utils::numeric(FLERR,arg[4],false,lmp); } if (strcmp(arg[5],"NULL") == 0) ayflag = 0; else { ayflag = 1; - ay = force->numeric(FLERR,arg[5]); + ay = utils::numeric(FLERR,arg[5],false,lmp); } if (strcmp(arg[6],"NULL") == 0) azflag = 0; else { azflag = 1; - az = force->numeric(FLERR,arg[6]); + az = utils::numeric(FLERR,arg[6],false,lmp); } - period = force->numeric(FLERR,arg[7]); + period = utils::numeric(FLERR,arg[7],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix move command"); } else if (strcmp(arg[3],"rotate") == 0) { if (narg < 11) error->all(FLERR,"Illegal fix move command"); iarg = 11; mstyle = ROTATE; - point[0] = force->numeric(FLERR,arg[4]); - point[1] = force->numeric(FLERR,arg[5]); - point[2] = force->numeric(FLERR,arg[6]); - axis[0] = force->numeric(FLERR,arg[7]); - axis[1] = force->numeric(FLERR,arg[8]); - axis[2] = force->numeric(FLERR,arg[9]); - period = force->numeric(FLERR,arg[10]); + point[0] = utils::numeric(FLERR,arg[4],false,lmp); + point[1] = utils::numeric(FLERR,arg[5],false,lmp); + point[2] = utils::numeric(FLERR,arg[6],false,lmp); + axis[0] = utils::numeric(FLERR,arg[7],false,lmp); + axis[1] = utils::numeric(FLERR,arg[8],false,lmp); + axis[2] = utils::numeric(FLERR,arg[9],false,lmp); + period = utils::numeric(FLERR,arg[10],false,lmp); if (period <= 0.0) error->all(FLERR,"Illegal fix move command"); } else if (strcmp(arg[3],"variable") == 0) { if (narg < 10) error->all(FLERR,"Illegal fix move command"); iarg = 10; mstyle = VARIABLE; - if (strcmp(arg[4],"NULL") == 0) xvarstr = NULL; + if (strcmp(arg[4],"NULL") == 0) xvarstr = nullptr; else if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; xvarstr = new char[n]; strcpy(xvarstr,&arg[4][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[5],"NULL") == 0) yvarstr = NULL; + if (strcmp(arg[5],"NULL") == 0) yvarstr = nullptr; else if (strstr(arg[5],"v_") == arg[5]) { int n = strlen(&arg[5][2]) + 1; yvarstr = new char[n]; strcpy(yvarstr,&arg[5][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[6],"NULL") == 0) zvarstr = NULL; + if (strcmp(arg[6],"NULL") == 0) zvarstr = nullptr; else if (strstr(arg[6],"v_") == arg[6]) { int n = strlen(&arg[6][2]) + 1; zvarstr = new char[n]; strcpy(zvarstr,&arg[6][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[7],"NULL") == 0) vxvarstr = NULL; + if (strcmp(arg[7],"NULL") == 0) vxvarstr = nullptr; else if (strstr(arg[7],"v_") == arg[7]) { int n = strlen(&arg[7][2]) + 1; vxvarstr = new char[n]; strcpy(vxvarstr,&arg[7][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[8],"NULL") == 0) vyvarstr = NULL; + if (strcmp(arg[8],"NULL") == 0) vyvarstr = nullptr; else if (strstr(arg[8],"v_") == arg[8]) { int n = strlen(&arg[8][2]) + 1; vyvarstr = new char[n]; strcpy(vyvarstr,&arg[8][2]); } else error->all(FLERR,"Illegal fix move command"); - if (strcmp(arg[9],"NULL") == 0) vzvarstr = NULL; + if (strcmp(arg[9],"NULL") == 0) vzvarstr = nullptr; else if (strstr(arg[9],"v_") == arg[9]) { int n = strlen(&arg[9][2]) + 1; vzvarstr = new char[n]; @@ -256,10 +256,10 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); - displace = velocity = NULL; + displace = velocity = nullptr; // AtomVec pointers to retrieve per-atom storage of extra quantities @@ -297,7 +297,7 @@ FixMove::FixMove(LAMMPS *lmp, int narg, char **arg) : if (quat_flag) { double *quat; for (int i = 0; i < nlocal; i++) { - quat = NULL; + quat = nullptr; if (mask[i] & groupbit) { if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; @@ -334,8 +334,8 @@ FixMove::~FixMove() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays @@ -439,9 +439,9 @@ void FixMove::init() memory->destroy(displace); memory->destroy(velocity); if (displaceflag) memory->create(displace,maxatom,3,"move:displace"); - else displace = NULL; + else displace = nullptr; if (velocityflag) memory->create(velocity,maxatom,3,"move:velocity"); - else velocity = NULL; + else velocity = nullptr; if (strstr(update->integrate_style,"respa")) nlevels_respa = ((Respa *) update->integrate)->nlevels; @@ -664,7 +664,7 @@ void FixMove::initial_integrate(int /*vflag*/) // angmom for ellipsoids, tris, and bodies if (angmom_flag) { - quat = inertia = NULL; + quat = inertia = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) { quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; shape = avec_ellipsoid->bonus[ellipsoid[i]].shape; @@ -701,7 +701,7 @@ void FixMove::initial_integrate(int /*vflag*/) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) @@ -873,7 +873,7 @@ void FixMove::initial_integrate(int /*vflag*/) } /* ---------------------------------------------------------------------- - final NVE of particles with NULL components + final NVE of particles with nullptr components ------------------------------------------------------------------------- */ void FixMove::final_integrate() @@ -1121,7 +1121,7 @@ void FixMove::set_arrays(int i) // quats for ellipsoids, tris, and bodies if (quat_flag) { - quat = NULL; + quat = nullptr; if (ellipsoid_flag && ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[ellipsoid[i]].quat; else if (tri_flag && tri[i] >= 0) diff --git a/src/fix_neigh_history.cpp b/src/fix_neigh_history.cpp index 933bcdc265..88cb3fa64e 100644 --- a/src/fix_neigh_history.cpp +++ b/src/fix_neigh_history.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_neigh_history.h" -#include + #include #include "my_page.h" #include "atom.h" @@ -34,8 +34,8 @@ enum{DEFAULT,NPARTNER,PERPARTNER}; // also set in fix neigh/history/omp FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - pair(NULL), npartner(NULL), partner(NULL), valuepartner(NULL), - ipage_atom(NULL), dpage_atom(NULL), ipage_neigh(NULL), dpage_neigh(NULL) + pair(nullptr), npartner(nullptr), partner(nullptr), valuepartner(nullptr), + ipage_atom(nullptr), dpage_atom(nullptr), ipage_neigh(nullptr), dpage_neigh(nullptr) { if (narg != 4) error->all(FLERR,"Illegal fix NEIGH_HISTORY command"); @@ -45,7 +45,7 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : newton_pair = force->newton_pair; - dnum = force->inumeric(FLERR,arg[3]); + dnum = utils::inumeric(FLERR,arg[3],false,lmp); dnumbytes = dnum * sizeof(double); zeroes = new double[dnum]; @@ -63,23 +63,23 @@ FixNeighHistory::FixNeighHistory(LAMMPS *lmp, int narg, char **arg) : // register with atom class grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); pgsize = oneatom = 0; // other per-atom vectors - firstflag = NULL; - firstvalue = NULL; + firstflag = nullptr; + firstvalue = nullptr; maxatom = 0; // per-atom and per-neighbor data structs - ipage_atom = NULL; - dpage_atom = NULL; - ipage_neigh = NULL; - dpage_neigh = NULL; + ipage_atom = nullptr; + dpage_atom = nullptr; + ipage_neigh = nullptr; + dpage_neigh = nullptr; // initialize npartner to 0 so neighbor list creation is OK the 1st time @@ -99,8 +99,8 @@ FixNeighHistory::~FixNeighHistory() // unregister this fix so atom class doesn't invoke it any more - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored arrays @@ -120,13 +120,13 @@ FixNeighHistory::~FixNeighHistory() // to better detect use-after-delete errors - firstflag = NULL; - firstvalue = NULL; + firstflag = nullptr; + firstvalue = nullptr; - pair = NULL; - npartner = NULL; - partner = NULL; - valuepartner = NULL; + pair = nullptr; + npartner = nullptr; + partner = nullptr; + valuepartner = nullptr; } /* ---------------------------------------------------------------------- */ @@ -172,7 +172,7 @@ void FixNeighHistory::init() void FixNeighHistory::allocate_pages() { int create = 0; - if (ipage_atom == NULL) create = 1; + if (ipage_atom == nullptr) create = 1; if (pgsize != neighbor->pgsize) create = 1; if (oneatom != neighbor->oneatom) create = 1; @@ -279,7 +279,7 @@ void FixNeighHistory::pre_exchange_onesided() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } @@ -383,7 +383,7 @@ void FixNeighHistory::pre_exchange_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -392,7 +392,7 @@ void FixNeighHistory::pre_exchange_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) { + if (partner[i] == nullptr || valuepartner[i] == nullptr) { error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } } @@ -506,7 +506,7 @@ void FixNeighHistory::pre_exchange_no_newton() n = npartner[i]; partner[i] = ipage_atom->get(n); valuepartner[i] = dpage_atom->get(dnum*n); - if (partner[i] == NULL || valuepartner[i] == NULL) + if (partner[i] == nullptr || valuepartner[i] == nullptr) error->one(FLERR,"Neighbor history overflow, boost neigh_modify one"); } @@ -853,7 +853,7 @@ int FixNeighHistory::pack_restart(int i, double *buf) memcpy(&buf[m],&valuepartner[i][dnum*n],dnumbytes); m += dnum; } - // pack buf[0] this way because other fixes unpack it + // pack buf[0] this way because other fixes unpack it buf[0] = m; return m; } @@ -864,9 +864,9 @@ int FixNeighHistory::pack_restart(int i, double *buf) void FixNeighHistory::unpack_restart(int nlocal, int nth) { - // ipage_atom = NULL if being called from granular pair style init() + // ipage_atom = nullptr if being called from granular pair style init() - if (ipage_atom == NULL) allocate_pages(); + if (ipage_atom == nullptr) allocate_pages(); // skip to Nth set of extra values // unpack the Nth first values this way because other fixes pack them diff --git a/src/fix_nh.cpp b/src/fix_nh.cpp index 014a2b8855..aa353b19a2 100644 --- a/src/fix_nh.cpp +++ b/src/fix_nh.cpp @@ -51,10 +51,10 @@ enum{ISO,ANISO,TRICLINIC}; FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rfix(NULL), id_dilate(NULL), irregular(NULL), id_temp(NULL), id_press(NULL), - eta(NULL), eta_dot(NULL), eta_dotdot(NULL), - eta_mass(NULL), etap(NULL), etap_dot(NULL), etap_dotdot(NULL), - etap_mass(NULL) + rfix(nullptr), id_dilate(nullptr), irregular(nullptr), id_temp(nullptr), id_press(nullptr), + eta(nullptr), eta_dot(nullptr), eta_dotdot(nullptr), + eta_mass(nullptr), etap(nullptr), etap_dot(nullptr), etap_dotdot(nullptr), + etap_mass(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix nvt/npt/nph command"); @@ -72,7 +72,7 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : pcouple = NONE; drag = 0.0; allremap = 1; - id_dilate = NULL; + id_dilate = nullptr; mtchain = mpchain = 3; nc_tchain = nc_pchain = 1; mtk_flag = 1; @@ -88,8 +88,8 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : tcomputeflag = 0; pcomputeflag = 0; - id_temp = NULL; - id_press = NULL; + id_temp = nullptr; + id_press = nullptr; // turn on tilt factor scaling, whenever applicable @@ -129,10 +129,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"temp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); tstat_flag = 1; - t_start = force->numeric(FLERR,arg[iarg+1]); + t_start = utils::numeric(FLERR,arg[iarg+1],false,lmp); t_target = t_start; - t_stop = force->numeric(FLERR,arg[iarg+2]); - t_period = force->numeric(FLERR,arg[iarg+3]); + t_stop = utils::numeric(FLERR,arg[iarg+2],false,lmp); + t_period = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (t_start <= 0.0 || t_stop <= 0.0) error->all(FLERR, "Target temperature for fix nvt/npt/nph cannot be 0.0"); @@ -141,10 +141,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"iso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -154,10 +154,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"aniso") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); pcouple = NONE; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -168,15 +168,15 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); pcouple = NONE; scalexy = scalexz = scaleyz = 0; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); p_period[0] = p_period[1] = p_period[2] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; p_start[3] = p_start[4] = p_start[5] = 0.0; p_stop[3] = p_stop[4] = p_stop[5] = 0.0; p_period[3] = p_period[4] = p_period[5] = - force->numeric(FLERR,arg[iarg+3]); + utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = p_flag[4] = p_flag[5] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -189,25 +189,25 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 4; } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; deviatoric_flag = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; deviatoric_flag = 1; iarg += 4; @@ -216,9 +216,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"yz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[3] = force->numeric(FLERR,arg[iarg+1]); - p_stop[3] = force->numeric(FLERR,arg[iarg+2]); - p_period[3] = force->numeric(FLERR,arg[iarg+3]); + p_start[3] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[3] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[3] = 1; deviatoric_flag = 1; scaleyz = 0; @@ -227,9 +227,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"xz") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[4] = force->numeric(FLERR,arg[iarg+1]); - p_stop[4] = force->numeric(FLERR,arg[iarg+2]); - p_period[4] = force->numeric(FLERR,arg[iarg+3]); + p_start[4] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[4] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[4] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[4] = 1; deviatoric_flag = 1; scalexz = 0; @@ -238,9 +238,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Invalid fix nvt/npt/nph command for a 2d simulation"); } else if (strcmp(arg[iarg],"xy") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_start[5] = force->numeric(FLERR,arg[iarg+1]); - p_stop[5] = force->numeric(FLERR,arg[iarg+2]); - p_period[5] = force->numeric(FLERR,arg[iarg+3]); + p_start[5] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[5] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[5] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[5] = 1; deviatoric_flag = 1; scalexy = 0; @@ -258,12 +258,12 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"drag") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - drag = force->numeric(FLERR,arg[iarg+1]); + drag = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (drag < 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"ptemp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - p_temp = force->numeric(FLERR,arg[iarg+1]); + p_temp = utils::numeric(FLERR,arg[iarg+1],false,lmp); p_temp_flag = 1; if (p_temp <= 0.0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; @@ -284,14 +284,14 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"tchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - mtchain = force->inumeric(FLERR,arg[iarg+1]); + mtchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); // used by FixNVTSllod to preserve non-default value mtchain_default_flag = 0; if (mtchain < 1) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"pchain") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - mpchain = force->inumeric(FLERR,arg[iarg+1]); + mpchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mpchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"mtk") == 0) { @@ -302,17 +302,17 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"tloop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - nc_tchain = force->inumeric(FLERR,arg[iarg+1]); + nc_tchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_tchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"ploop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - nc_pchain = force->inumeric(FLERR,arg[iarg+1]); + nc_pchain = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nc_pchain < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"nreset") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - nreset_h0 = force->inumeric(FLERR,arg[iarg+1]); + nreset_h0 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nreset_h0 < 0) error->all(FLERR,"Illegal fix nvt/npt/nph command"); iarg += 2; } else if (strcmp(arg[iarg],"scalexy") == 0) { @@ -349,9 +349,9 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : iarg += 2; } else if (strcmp(arg[iarg],"fixedpoint") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix nvt/npt/nph command"); - fixedpoint[0] = force->numeric(FLERR,arg[iarg+1]); - fixedpoint[1] = force->numeric(FLERR,arg[iarg+2]); - fixedpoint[2] = force->numeric(FLERR,arg[iarg+3]); + fixedpoint[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + fixedpoint[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + fixedpoint[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; // disc keyword is also parsed in fix/nh/sphere @@ -579,10 +579,10 @@ FixNH::FixNH(LAMMPS *lmp, int narg, char **arg) : } nrigid = 0; - rfix = NULL; + rfix = nullptr; if (pre_exchange_flag) irregular = new Irregular(lmp); - else irregular = NULL; + else irregular = nullptr; // initialize vol0,t0 to zero to signal uninitialized // values then assigned in init(), if necessary @@ -740,7 +740,7 @@ void FixNH::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; @@ -767,7 +767,7 @@ void FixNH::setup(int /*vflag*/) // If no thermostat or using fix nphug, // t_target must be defined by other means. - if (tstat_flag && strstr(style,"nphug") == NULL) { + if (tstat_flag && strstr(style,"nphug") == nullptr) { compute_temp_target(); } else if (pstat_flag) { @@ -1768,7 +1768,7 @@ void *FixNH::extract(const char *str, int &dim) } else if (pstat_flag && strcmp(str,"p_target") == 0) { return &p_target; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/fix_nh.h b/src/fix_nh.h index 624b0c8bb4..f137ecbe55 100644 --- a/src/fix_nh.h +++ b/src/fix_nh.h @@ -14,7 +14,7 @@ #ifndef LMP_FIX_NH_H #define LMP_FIX_NH_H -#include "fix.h" +#include "fix.h" // IWYU pragma: export namespace LAMMPS_NS { diff --git a/src/fix_nh_sphere.cpp b/src/fix_nh_sphere.cpp index 1ff3fc2d4d..d60798e007 100644 --- a/src/fix_nh_sphere.cpp +++ b/src/fix_nh_sphere.cpp @@ -16,15 +16,16 @@ ------------------------------------------------------------------------- */ #include "fix_nh_sphere.h" -#include -#include + #include "atom.h" -#include "atom_vec.h" +#include "domain.h" #include "error.h" #include "force.h" -#include "domain.h" -#include "math_vector.h" #include "math_extra.h" +#include "math_vector.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/fix_nph.cpp b/src/fix_nph.cpp index 9251ce384e..f4ff71d3a3 100644 --- a/src/fix_nph.cpp +++ b/src/fix_nph.cpp @@ -13,7 +13,7 @@ #include "fix_nph.h" #include -#include + #include "modify.h" #include "error.h" diff --git a/src/fix_nph_sphere.cpp b/src/fix_nph_sphere.cpp index cf2298f5f8..b49eb0c5c5 100644 --- a/src/fix_nph_sphere.cpp +++ b/src/fix_nph_sphere.cpp @@ -13,7 +13,7 @@ #include "fix_nph_sphere.h" #include -#include + #include "modify.h" #include "error.h" diff --git a/src/fix_npt.cpp b/src/fix_npt.cpp index 6949ead1d6..f6ec24991b 100644 --- a/src/fix_npt.cpp +++ b/src/fix_npt.cpp @@ -13,7 +13,7 @@ #include "fix_npt.h" #include -#include + #include "modify.h" #include "error.h" diff --git a/src/fix_npt_sphere.cpp b/src/fix_npt_sphere.cpp index e38d88fadd..1bd879c786 100644 --- a/src/fix_npt_sphere.cpp +++ b/src/fix_npt_sphere.cpp @@ -13,7 +13,7 @@ #include "fix_npt_sphere.h" #include -#include + #include "modify.h" #include "error.h" diff --git a/src/fix_numdiff.cpp b/src/fix_numdiff.cpp index a4ac86e0c5..b05d36a579 100644 --- a/src/fix_numdiff.cpp +++ b/src/fix_numdiff.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "fix_numdiff.h" -#include + #include #include "atom.h" #include "domain.h" @@ -40,8 +40,8 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : - Fix(lmp, narg, arg), id_pe(NULL), numdiff_forces(NULL), - temp_x(NULL), temp_f(NULL) + Fix(lmp, narg, arg), id_pe(nullptr), numdiff_forces(nullptr), + temp_x(nullptr), temp_f(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix numdiff command"); @@ -50,8 +50,8 @@ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : size_peratom_cols = 3; respa_level_support = 1; - nevery = force->inumeric(FLERR,arg[3]); - delta = force->numeric(FLERR,arg[4]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); + delta = utils::numeric(FLERR,arg[4],false,lmp); if (nevery <= 0 || delta <= 0.0) error->all(FLERR,"Illegal fix numdiff command"); @@ -64,7 +64,7 @@ FixNumDiff::FixNumDiff(LAMMPS *lmp, int narg, char **arg) : maxatom = 0; - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix numdiff requires an atom map, see atom_modify"); // perform initial allocation of atom-based arrays @@ -338,7 +338,7 @@ void FixNumDiff::reallocate() double FixNumDiff::memory_usage() { - bigint bytes = 0.0; + double bytes = 0.0; bytes += 3 * maxatom*3 * sizeof(double); return bytes; } diff --git a/src/fix_nve_limit.cpp b/src/fix_nve_limit.cpp index d63c736e73..ed79c6b21b 100644 --- a/src/fix_nve_limit.cpp +++ b/src/fix_nve_limit.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "fix_nve_limit.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "modify.h" #include "comm.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -40,7 +40,7 @@ FixNVELimit::FixNVELimit(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; dynamic_group_allow = 1; - xlimit = force->numeric(FLERR,arg[3]); + xlimit = utils::numeric(FLERR,arg[3],false,lmp); ncount = 0; } diff --git a/src/fix_nve_sphere.cpp b/src/fix_nve_sphere.cpp index c0fea17c2b..87fba3eca3 100644 --- a/src/fix_nve_sphere.cpp +++ b/src/fix_nve_sphere.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "fix_nve_sphere.h" -#include -#include + #include "atom.h" #include "domain.h" -#include "atom_vec.h" -#include "force.h" #include "error.h" -#include "math_vector.h" +#include "force.h" #include "math_extra.h" +#include "math_vector.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/fix_nvt.cpp b/src/fix_nvt.cpp index 7868693b69..f7a53cf382 100644 --- a/src/fix_nvt.cpp +++ b/src/fix_nvt.cpp @@ -13,11 +13,11 @@ #include "fix_nvt.h" #include -#include + #include "group.h" #include "modify.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/fix_nvt_sllod.cpp b/src/fix_nvt_sllod.cpp index ccf7aaecaf..3cc88772d7 100644 --- a/src/fix_nvt_sllod.cpp +++ b/src/fix_nvt_sllod.cpp @@ -26,7 +26,7 @@ #include "fix_deform.h" #include "compute.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/fix_nvt_sphere.cpp b/src/fix_nvt_sphere.cpp index 40c3ba19e3..7c4159455f 100644 --- a/src/fix_nvt_sphere.cpp +++ b/src/fix_nvt_sphere.cpp @@ -13,11 +13,11 @@ #include "fix_nvt_sphere.h" #include -#include + #include "group.h" #include "modify.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; diff --git a/src/fix_planeforce.cpp b/src/fix_planeforce.cpp index a3f27277bd..2e3bcadd69 100644 --- a/src/fix_planeforce.cpp +++ b/src/fix_planeforce.cpp @@ -12,13 +12,14 @@ ------------------------------------------------------------------------- */ #include "fix_planeforce.h" + +#include "atom.h" +#include "error.h" +#include "respa.h" +#include "update.h" + #include #include -#include "atom.h" -#include "update.h" -#include "respa.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -31,9 +32,9 @@ FixPlaneForce::FixPlaneForce(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; if (narg != 6) error->all(FLERR,"Illegal fix planeforce command"); - xdir = force->numeric(FLERR,arg[3]); - ydir = force->numeric(FLERR,arg[4]); - zdir = force->numeric(FLERR,arg[5]); + xdir = utils::numeric(FLERR,arg[3],false,lmp); + ydir = utils::numeric(FLERR,arg[4],false,lmp); + zdir = utils::numeric(FLERR,arg[5],false,lmp); double len = sqrt(xdir*xdir + ydir*ydir + zdir*zdir); if (len == 0.0) error->all(FLERR,"Illegal fix planeforce command"); diff --git a/src/fix_press_berendsen.cpp b/src/fix_press_berendsen.cpp index db6d56799a..a156c0d588 100644 --- a/src/fix_press_berendsen.cpp +++ b/src/fix_press_berendsen.cpp @@ -14,7 +14,7 @@ #include "fix_press_berendsen.h" #include #include -#include + #include "atom.h" #include "force.h" #include "comm.h" @@ -37,7 +37,7 @@ enum{ISO,ANISO}; FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - id_temp(NULL), id_press(NULL), tflag(0), pflag(0) + id_temp(nullptr), id_press(nullptr), tflag(0), pflag(0) { if (narg < 5) error->all(FLERR,"Illegal fix press/berendsen command"); @@ -68,9 +68,9 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); pcouple = XYZ; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = p_period[1] = p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -81,9 +81,9 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); pcouple = NONE; - p_start[0] = p_start[1] = p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = p_stop[1] = p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = p_period[1] = p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = p_start[1] = p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = p_stop[1] = p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = p_period[1] = p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = p_flag[1] = p_flag[2] = 1; if (dimension == 2) { p_start[2] = p_stop[2] = p_period[2] = 0.0; @@ -94,25 +94,25 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - p_start[0] = force->numeric(FLERR,arg[iarg+1]); - p_stop[0] = force->numeric(FLERR,arg[iarg+2]); - p_period[0] = force->numeric(FLERR,arg[iarg+3]); + p_start[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[0] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[0] = 1; iarg += 4; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - p_start[1] = force->numeric(FLERR,arg[iarg+1]); - p_stop[1] = force->numeric(FLERR,arg[iarg+2]); - p_period[1] = force->numeric(FLERR,arg[iarg+3]); + p_start[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[1] = 1; iarg += 4; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - p_start[2] = force->numeric(FLERR,arg[iarg+1]); - p_stop[2] = force->numeric(FLERR,arg[iarg+2]); - p_period[2] = force->numeric(FLERR,arg[iarg+3]); + p_start[2] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + p_stop[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + p_period[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); p_flag[2] = 1; iarg += 4; if (dimension == 2) @@ -132,7 +132,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[iarg],"modulus") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal fix press/berendsen command"); - bulkmodulus = force->numeric(FLERR,arg[iarg+1]); + bulkmodulus = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (bulkmodulus <= 0.0) error->all(FLERR,"Illegal fix press/berendsen command"); iarg += 2; @@ -239,7 +239,7 @@ FixPressBerendsen::FixPressBerendsen(LAMMPS *lmp, int narg, char **arg) : pflag = 1; nrigid = 0; - rfix = NULL; + rfix = nullptr; } /* ---------------------------------------------------------------------- */ @@ -308,7 +308,7 @@ void FixPressBerendsen::init() delete [] rfix; nrigid = 0; - rfix = NULL; + rfix = nullptr; for (int i = 0; i < modify->nfix; i++) if (modify->fix[i]->rigid_flag) nrigid++; diff --git a/src/fix_print.cpp b/src/fix_print.cpp index fac639ae63..c8a7c8e610 100644 --- a/src/fix_print.cpp +++ b/src/fix_print.cpp @@ -12,17 +12,15 @@ ------------------------------------------------------------------------- */ #include "fix_print.h" -#include -#include -#include "update.h" -#include "input.h" -#include "modify.h" -#include "variable.h" -#include "memory.h" + #include "error.h" -#include "force.h" -#include "utils.h" -#include "fmt/format.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -31,7 +29,7 @@ using namespace FixConst; FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - fp(NULL), string(NULL), copy(NULL), work(NULL), var_print(NULL) + fp(nullptr), string(nullptr), copy(nullptr), work(nullptr), var_print(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix print command"); if (strstr(arg[3],"v_") == arg[3]) { @@ -40,7 +38,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : strcpy(var_print,&arg[3][2]); nevery = 1; } else { - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix print command"); } @@ -56,9 +54,9 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : // parse optional args - fp = NULL; + fp = nullptr; screenflag = 1; - char *title = NULL; + char *title = nullptr; int iarg = 5; while (iarg < narg) { @@ -67,7 +65,7 @@ FixPrint::FixPrint(LAMMPS *lmp, int narg, char **arg) : if (me == 0) { if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix print file {}: {}", arg[iarg+1], utils::getsyserror())); } diff --git a/src/fix_property_atom.cpp b/src/fix_property_atom.cpp index 374d0069fd..41de71152b 100644 --- a/src/fix_property_atom.cpp +++ b/src/fix_property_atom.cpp @@ -12,14 +12,14 @@ ------------------------------------------------------------------------- */ #include "fix_property_atom.h" -#include + #include #include "atom.h" #include "comm.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -30,7 +30,7 @@ enum{MOLECULE,CHARGE,RMASS,INTEGER,DOUBLE}; FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalue(0), style(NULL), index(NULL), astyle(NULL) + nvalue(0), style(nullptr), index(nullptr), astyle(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix property/atom command"); @@ -136,9 +136,9 @@ FixPropertyAtom::FixPropertyAtom(LAMMPS *lmp, int narg, char **arg) : nmax_old = 0; if (!lmp->kokkos) grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); - if (border) atom->add_callback(2); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); + if (border) atom->add_callback(Atom::BORDER); } /* ---------------------------------------------------------------------- */ @@ -147,26 +147,26 @@ FixPropertyAtom::~FixPropertyAtom() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); - if (border) atom->delete_callback(id,2); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); + if (border) atom->delete_callback(id,Atom::BORDER); // deallocate per-atom vectors in Atom class - // set ptrs to NULL, so they no longer exist for Atom class + // set ptrs to a null pointer, so they no longer exist for Atom class for (int m = 0; m < nvalue; m++) { if (style[m] == MOLECULE) { atom->molecule_flag = 0; memory->destroy(atom->molecule); - atom->molecule = NULL; + atom->molecule = nullptr; } else if (style[m] == CHARGE) { atom->q_flag = 0; memory->destroy(atom->q); - atom->q = NULL; + atom->q = nullptr; } else if (style[m] == RMASS) { atom->rmass_flag = 0; memory->destroy(atom->rmass); - atom->rmass = NULL; + atom->rmass = nullptr; } else if (style[m] == INTEGER) { atom->remove_custom(0,index[m]); } else if (style[m] == DOUBLE) { @@ -211,7 +211,7 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, char *next; int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -237,13 +237,13 @@ void FixPropertyAtom::read_data_section(char *keyword, int n, char *buf, next = strchr(buf,'\n'); values[0] = strtok(buf," \t\n\r\f"); - if (values[0] == NULL) + if (values[0] == nullptr) error->all(FLERR,fmt::format("Too few lines in {} section of data file",keyword)); int format_ok = 1; for (j = 1; j < nwords; j++) { - values[j] = strtok(NULL," \t\n\r\f"); - if (values[j] == NULL) format_ok = 0; + values[j] = strtok(nullptr," \t\n\r\f"); + if (values[j] == nullptr) format_ok = 0; } if (!format_ok) error->all(FLERR,fmt::format("Incorrect {} format in data file",keyword)); diff --git a/src/fix_read_restart.cpp b/src/fix_read_restart.cpp index afedf9c12c..6fa2157113 100644 --- a/src/fix_read_restart.cpp +++ b/src/fix_read_restart.cpp @@ -12,9 +12,9 @@ ------------------------------------------------------------------------- */ #include "fix_read_restart.h" + #include "atom.h" #include "memory.h" -#include "force.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -23,16 +23,16 @@ using namespace FixConst; FixReadRestart::FixReadRestart(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - count(NULL), extra(NULL) + count(nullptr), extra(nullptr) { - nextra = force->inumeric(FLERR,arg[3]); - int nfix = force->inumeric(FLERR,arg[4]); + nextra = utils::inumeric(FLERR,arg[3],false,lmp); + int nfix = utils::inumeric(FLERR,arg[4],false,lmp); // perform initial allocation of atom-based array // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // extra = copy of atom->extra @@ -54,7 +54,7 @@ FixReadRestart::~FixReadRestart() { // unregister callback to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/fix_recenter.cpp b/src/fix_recenter.cpp index f461e0fa52..3f9eec9ee4 100644 --- a/src/fix_recenter.cpp +++ b/src/fix_recenter.cpp @@ -16,18 +16,19 @@ ------------------------------------------------------------------------- */ #include "fix_recenter.h" -#include -#include + #include "atom.h" -#include "group.h" -#include "update.h" +#include "comm.h" #include "domain.h" +#include "error.h" +#include "group.h" #include "lattice.h" #include "modify.h" -#include "comm.h" #include "respa.h" -#include "error.h" -#include "force.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -56,13 +57,13 @@ FixRecenter::FixRecenter(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"NULL") == 0) xflag = 0; else if (strcmp(arg[3],"INIT") == 0) xinitflag = 1; - else xcom = force->numeric(FLERR,arg[3]); + else xcom = utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"NULL") == 0) yflag = 0; else if (strcmp(arg[4],"INIT") == 0) yinitflag = 1; - else ycom = force->numeric(FLERR,arg[4]); + else ycom = utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"NULL") == 0) zflag = 0; else if (strcmp(arg[5],"INIT") == 0) zinitflag = 1; - else zcom = force->numeric(FLERR,arg[5]); + else zcom = utils::numeric(FLERR,arg[5],false,lmp); // optional args diff --git a/src/fix_respa.cpp b/src/fix_respa.cpp index 742dd5c58b..a17c79abc7 100644 --- a/src/fix_respa.cpp +++ b/src/fix_respa.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "fix_respa.h" -#include + #include "atom.h" -#include "force.h" #include "memory.h" +#include + using namespace LAMMPS_NS; using namespace FixConst; @@ -24,11 +25,11 @@ using namespace FixConst; FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - store_torque(0), f_level(NULL), t_level(NULL) + store_torque(0), f_level(nullptr), t_level(nullptr) { // nlevels = # of rRESPA levels - nlevels = force->inumeric(FLERR,arg[3]); + nlevels = utils::inumeric(FLERR,arg[3],false,lmp); // optional arguments store_torque = 0; @@ -40,10 +41,10 @@ FixRespa::FixRespa(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based arrays // register with Atom class - f_level = NULL; - t_level = NULL; + f_level = nullptr; + t_level = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); } /* ---------------------------------------------------------------------- */ @@ -52,7 +53,7 @@ FixRespa::~FixRespa() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays diff --git a/src/fix_restrain.cpp b/src/fix_restrain.cpp index 07ff7dc13c..ad0877ba4c 100644 --- a/src/fix_restrain.cpp +++ b/src/fix_restrain.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_restrain.h" -#include + #include #include #include "atom.h" @@ -29,7 +29,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -45,9 +45,9 @@ enum{BOND,LBOUND,ANGLE,DIHEDRAL}; FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - rstyle(NULL), mult(NULL), ids(NULL), kstart(NULL), kstop(NULL), - deqstart(NULL), deqstop(NULL), target(NULL), cos_target(NULL), - sin_target(NULL) + rstyle(nullptr), mult(nullptr), ids(nullptr), kstart(nullptr), kstop(nullptr), + deqstart(nullptr), deqstop(nullptr), target(nullptr), cos_target(nullptr), + sin_target(nullptr) { if (narg < 4) error->all(FLERR,"Illegal fix restrain command"); @@ -83,62 +83,62 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[iarg],"bond") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = BOND; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+3]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+4]); - deqstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + deqstart[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); if (iarg+6 == narg) { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); iarg += 7; } } else if (strcmp(arg[iarg],"lbound") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = LBOUND; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+3]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+4]); - deqstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + deqstart[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); if (iarg+6 == narg) { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); iarg += 6; } else { - deqstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]); + deqstop[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); iarg += 7; } } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+7 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = ANGLE; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - ids[nrestrain][2] = force->tnumeric(FLERR,arg[iarg+3]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+4]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+5]); - target[nrestrain] = force->numeric(FLERR,arg[iarg+6]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + ids[nrestrain][2] = utils::tnumeric(FLERR,arg[iarg+3],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + target[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); target[nrestrain] *= MY_PI / 180.0; iarg += 7; } else if (strcmp(arg[iarg],"dihedral") == 0) { if (iarg+8 > narg) error->all(FLERR,"Illegal fix restrain command"); rstyle[nrestrain] = DIHEDRAL; mult[nrestrain] = 1; - ids[nrestrain][0] = force->tnumeric(FLERR,arg[iarg+1]); - ids[nrestrain][1] = force->tnumeric(FLERR,arg[iarg+2]); - ids[nrestrain][2] = force->tnumeric(FLERR,arg[iarg+3]); - ids[nrestrain][3] = force->tnumeric(FLERR,arg[iarg+4]); - kstart[nrestrain] = force->numeric(FLERR,arg[iarg+5]); - kstop[nrestrain] = force->numeric(FLERR,arg[iarg+6]); - target[nrestrain] = force->numeric(FLERR,arg[iarg+7]); + ids[nrestrain][0] = utils::tnumeric(FLERR,arg[iarg+1],false,lmp); + ids[nrestrain][1] = utils::tnumeric(FLERR,arg[iarg+2],false,lmp); + ids[nrestrain][2] = utils::tnumeric(FLERR,arg[iarg+3],false,lmp); + ids[nrestrain][3] = utils::tnumeric(FLERR,arg[iarg+4],false,lmp); + kstart[nrestrain] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + kstop[nrestrain] = utils::numeric(FLERR,arg[iarg+6],false,lmp); + target[nrestrain] = utils::numeric(FLERR,arg[iarg+7],false,lmp); target[nrestrain] *= MY_PI / 180.0; cos_target[nrestrain] = cos(target[nrestrain]); sin_target[nrestrain] = sin(target[nrestrain]); iarg += 8; if ((iarg < narg) && (strcmp("mult",arg[iarg]) == 0)) { if (iarg+1 > narg) error->all(FLERR,"Illegal fix restrain command"); - mult[nrestrain] = force->inumeric(FLERR,arg[iarg+1]); + mult[nrestrain] = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (mult[nrestrain] < 0) error->all(FLERR,"Illegal fix restrain command"); iarg += 2; @@ -150,7 +150,7 @@ FixRestrain::FixRestrain(LAMMPS *lmp, int narg, char **arg) : // require atom map to lookup atom IDs - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Fix restrain requires an atom map, see atom_modify"); } diff --git a/src/fix_setforce.cpp b/src/fix_setforce.cpp index 108d18afb6..3acd449646 100644 --- a/src/fix_setforce.cpp +++ b/src/fix_setforce.cpp @@ -12,19 +12,19 @@ ------------------------------------------------------------------------- */ #include "fix_setforce.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "modify.h" #include "domain.h" +#include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" #include "region.h" #include "respa.h" -#include "input.h" +#include "update.h" #include "variable.h" -#include "memory.h" -#include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -35,7 +35,7 @@ enum{NONE,CONSTANT,EQUAL,ATOM}; FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xstr(NULL), ystr(NULL), zstr(NULL), idregion(NULL), sforce(NULL) + xstr(nullptr), ystr(nullptr), zstr(nullptr), idregion(nullptr), sforce(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix setforce command"); @@ -46,7 +46,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : extvector = 1; respa_level_support = 1; ilevel_respa = nlevels_respa = 0; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; @@ -55,7 +55,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[3],"NULL") == 0) { xstyle = NONE; } else { - xvalue = force->numeric(FLERR,arg[3]); + xvalue = utils::numeric(FLERR,arg[3],false,lmp); xstyle = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -65,7 +65,7 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[4],"NULL") == 0) { ystyle = NONE; } else { - yvalue = force->numeric(FLERR,arg[4]); + yvalue = utils::numeric(FLERR,arg[4],false,lmp); ystyle = CONSTANT; } if (strstr(arg[5],"v_") == arg[5]) { @@ -75,14 +75,14 @@ FixSetForce::FixSetForce(LAMMPS *lmp, int narg, char **arg) : } else if (strcmp(arg[5],"NULL") == 0) { zstyle = NONE; } else { - zvalue = force->numeric(FLERR,arg[5]); + zvalue = utils::numeric(FLERR,arg[5],false,lmp); zstyle = CONSTANT; } // optional args iregion = -1; - idregion = NULL; + idregion = nullptr; int iarg = 6; while (iarg < narg) { @@ -228,7 +228,7 @@ void FixSetForce::post_force(int /*vflag*/) // update region if necessary - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); @@ -305,7 +305,7 @@ void FixSetForce::post_force_respa(int vflag, int ilevel, int /*iloop*/) foriginal[1] += foriginal_saved[1]; foriginal[2] += foriginal_saved[2]; } else { - Region *region = NULL; + Region *region = nullptr; if (iregion >= 0) { region = domain->regions[iregion]; region->prematch(); diff --git a/src/fix_spring.cpp b/src/fix_spring.cpp index 510b194ab7..ac08cbb497 100644 --- a/src/fix_spring.cpp +++ b/src/fix_spring.cpp @@ -16,14 +16,15 @@ ------------------------------------------------------------------------- */ #include "fix_spring.h" + +#include "atom.h" +#include "error.h" +#include "group.h" +#include "respa.h" +#include "update.h" + #include #include -#include "atom.h" -#include "update.h" -#include "respa.h" -#include "force.h" -#include "group.h" -#include "error.h" using namespace LAMMPS_NS; using namespace FixConst; @@ -36,7 +37,7 @@ enum{TETHER,COUPLE}; FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - group2(NULL) + group2(nullptr) { if (narg < 9) error->all(FLERR,"Illegal fix spring command"); @@ -53,15 +54,15 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : if (strcmp(arg[3],"tether") == 0) { if (narg != 9) error->all(FLERR,"Illegal fix spring command"); styleflag = TETHER; - k_spring = force->numeric(FLERR,arg[4]); + k_spring = utils::numeric(FLERR,arg[4],false,lmp); xflag = yflag = zflag = 1; if (strcmp(arg[5],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[5]); + else xc = utils::numeric(FLERR,arg[5],false,lmp); if (strcmp(arg[6],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[6]); + else yc = utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[7]); - r0 = force->numeric(FLERR,arg[8]); + else zc = utils::numeric(FLERR,arg[7],false,lmp); + r0 = utils::numeric(FLERR,arg[8],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command"); } else if (strcmp(arg[3],"couple") == 0) { @@ -78,15 +79,15 @@ FixSpring::FixSpring(LAMMPS *lmp, int narg, char **arg) : error->all(FLERR,"Two groups cannot be the same in fix spring couple"); group2bit = group->bitmask[igroup2]; - k_spring = force->numeric(FLERR,arg[5]); + k_spring = utils::numeric(FLERR,arg[5],false,lmp); xflag = yflag = zflag = 1; if (strcmp(arg[6],"NULL") == 0) xflag = 0; - else xc = force->numeric(FLERR,arg[6]); + else xc = utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"NULL") == 0) yflag = 0; - else yc = force->numeric(FLERR,arg[7]); + else yc = utils::numeric(FLERR,arg[7],false,lmp); if (strcmp(arg[8],"NULL") == 0) zflag = 0; - else zc = force->numeric(FLERR,arg[8]); - r0 = force->numeric(FLERR,arg[9]); + else zc = utils::numeric(FLERR,arg[8],false,lmp); + r0 = utils::numeric(FLERR,arg[9],false,lmp); if (r0 < 0) error->all(FLERR,"R0 < 0 for fix spring command"); } else error->all(FLERR,"Illegal fix spring command"); diff --git a/src/fix_spring_chunk.cpp b/src/fix_spring_chunk.cpp index e14936a976..b7ffea3d68 100644 --- a/src/fix_spring_chunk.cpp +++ b/src/fix_spring_chunk.cpp @@ -12,17 +12,19 @@ ------------------------------------------------------------------------- */ #include "fix_spring_chunk.h" -#include -#include + #include "atom.h" -#include "update.h" -#include "force.h" -#include "respa.h" -#include "modify.h" +#include "comm.h" #include "compute_chunk_atom.h" #include "compute_com_chunk.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "modify.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -33,17 +35,18 @@ using namespace FixConst; FixSpringChunk::FixSpringChunk(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idchunk(NULL), idcom(NULL), com0(NULL), fcom(NULL) + idchunk(nullptr), idcom(nullptr), com0(nullptr), fcom(nullptr) { if (narg != 6) error->all(FLERR,"Illegal fix spring/chunk command"); + restart_global = 1; scalar_flag = 1; global_freq = 1; extscalar = 1; respa_level_support = 1; ilevel_respa = 0; - k_spring = force->numeric(FLERR,arg[3]); + k_spring = utils::numeric(FLERR,arg[3],false,lmp); int n = strlen(arg[4]) + 1; idchunk = new char[n]; @@ -152,7 +155,7 @@ void FixSpringChunk::post_force(int /*vflag*/) // will be unlocked in destructor // necessary b/c this fix stores original COM - if (com0 == NULL) cchunk->lock(this,update->ntimestep,-1); + if (com0 == nullptr) cchunk->lock(this,update->ntimestep,-1); // calculate current centers of mass for each chunk // extract pointers from idchunk and idcom @@ -167,7 +170,7 @@ void FixSpringChunk::post_force(int /*vflag*/) // check if first time cchunk was queried via ccom // if so, allocate com0,fcom and store initial COM - if (com0 == NULL) { + if (com0 == nullptr) { memory->create(com0,nchunk,3,"spring/chunk:com0"); memory->create(fcom,nchunk,3,"spring/chunk:fcom"); @@ -241,6 +244,58 @@ void FixSpringChunk::min_post_force(int vflag) post_force(vflag); } +/* ---------------------------------------------------------------------- + writ number of chunks and position of original COM into restart +------------------------------------------------------------------------- */ + +void FixSpringChunk::write_restart(FILE *fp) +{ + double n = nchunk; + + if (comm->me == 0) { + int size = (3*n+1) * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(&n,sizeof(double),1,fp); + fwrite(&com0[0][0],3*sizeof(double),nchunk,fp); + } +} + +/* ---------------------------------------------------------------------- + use state info from restart file to restart the Fix +------------------------------------------------------------------------- */ + +void FixSpringChunk::restart(char *buf) +{ + double *list = (double *) buf; + int n = list[0]; + + memory->destroy(com0); + memory->destroy(fcom); + + int icompute = modify->find_compute(idchunk); + if (icompute < 0) + error->all(FLERR,"Chunk/atom compute does not exist for fix spring/chunk"); + cchunk = (ComputeChunkAtom *) modify->compute[icompute]; + if (strcmp(cchunk->style,"chunk/atom") != 0) + error->all(FLERR,"Fix spring/chunk does not use chunk/atom compute"); + nchunk = cchunk->setup_chunks(); + cchunk->compute_ichunk(); + memory->create(com0,nchunk,3,"spring/chunk:com0"); + memory->create(fcom,nchunk,3,"spring/chunk:fcom"); + printf("restart chunks:%d computed chunks: %d\n",n,nchunk); + + if (n != nchunk) { + if (comm->me == 0) + error->warning(FLERR,"Number of chunks has changed. Cannot use restart"); + memory->destroy(com0); + memory->destroy(fcom); + nchunk = 1; + } else { + cchunk->lock(this,update->ntimestep,-1); + memcpy(&com0[0][0],list+1,3*n*sizeof(double)); + } +} + /* ---------------------------------------------------------------------- energy of stretched spring ------------------------------------------------------------------------- */ diff --git a/src/fix_spring_chunk.h b/src/fix_spring_chunk.h index 9ba6d3a2f8..2955d4b67d 100644 --- a/src/fix_spring_chunk.h +++ b/src/fix_spring_chunk.h @@ -35,6 +35,8 @@ class FixSpringChunk : public Fix { void post_force(int); void post_force_respa(int, int, int); void min_post_force(int); + void write_restart(FILE *); + void restart(char *); double compute_scalar(); private: diff --git a/src/fix_spring_rg.cpp b/src/fix_spring_rg.cpp index f1e68bffa4..6cd8637a5c 100644 --- a/src/fix_spring_rg.cpp +++ b/src/fix_spring_rg.cpp @@ -17,14 +17,16 @@ ------------------------------------------------------------------------- */ #include "fix_spring_rg.h" -#include + #include "atom.h" -#include "update.h" -#include "group.h" -#include "respa.h" +#include "comm.h" #include "domain.h" #include "error.h" -#include "force.h" +#include "group.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -36,11 +38,14 @@ FixSpringRG::FixSpringRG(LAMMPS *lmp, int narg, char **arg) : { if (narg != 5) error->all(FLERR,"Illegal fix spring/rg command"); - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); rg0_flag = 0; if (strcmp(arg[4],"NULL") == 0) rg0_flag = 1; - else rg0 = force->numeric(FLERR,arg[4]); + else rg0 = utils::numeric(FLERR,arg[4],false,lmp); + restart_global = 1; + scalar_flag = 1; + restart_global = 1; dynamic_group_allow = 1; respa_level_support = 1; ilevel_respa = 0; @@ -62,7 +67,7 @@ void FixSpringRG::init() { masstotal = group->mass(igroup); - // if rg0 was specified as NULL, compute current Rg + // Compute current Rg // only occurs on 1st run if (rg0_flag) { @@ -144,3 +149,43 @@ void FixSpringRG::post_force_respa(int vflag, int ilevel, int /*iloop*/) { if (ilevel == ilevel_respa) post_force(vflag); } + +/* ---------------------------------------------------------------------- + pack entire state of Fix into one write +------------------------------------------------------------------------- */ + +void FixSpringRG::write_restart(FILE *fp) +{ + int n = 0; + double list[1]; + list[n++] = rg0; + + if (comm->me == 0) { + int size = n * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(list,sizeof(double),n,fp); + } +} + +/* ---------------------------------------------------------------------- + use state info from restart file to restart the Fix +------------------------------------------------------------------------- */ + +void FixSpringRG::restart(char *buf) +{ + int n = 0; + double *list = (double *) buf; + + rg0 = list[n++]; + rg0_flag = 0; +} + + +/* ---------------------------------------------------------------------- + return reference radius of gyration +------------------------------------------------------------------------- */ + +double FixSpringRG::compute_scalar() +{ + return rg0; +} diff --git a/src/fix_spring_rg.h b/src/fix_spring_rg.h index 17337be6fd..a46df0fa75 100644 --- a/src/fix_spring_rg.h +++ b/src/fix_spring_rg.h @@ -32,6 +32,9 @@ class FixSpringRG : public Fix { void setup(int); void post_force(int); void post_force_respa(int, int, int); + void write_restart(FILE *); + void restart(char *); + double compute_scalar(); private: int ilevel_respa,rg0_flag; diff --git a/src/fix_spring_self.cpp b/src/fix_spring_self.cpp index 4f8a03c8bd..2e5ca0962f 100644 --- a/src/fix_spring_self.cpp +++ b/src/fix_spring_self.cpp @@ -16,15 +16,15 @@ ------------------------------------------------------------------------- */ #include "fix_spring_self.h" -#include -#include + #include "atom.h" -#include "update.h" #include "domain.h" -#include "respa.h" -#include "memory.h" #include "error.h" -#include "force.h" +#include "memory.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -33,7 +33,7 @@ using namespace FixConst; FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - xoriginal(NULL) + xoriginal(nullptr) { if ((narg < 4) || (narg > 5)) error->all(FLERR,"Illegal fix spring/self command"); @@ -44,7 +44,7 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : extscalar = 1; respa_level_support = 1; - k = force->numeric(FLERR,arg[3]); + k = utils::numeric(FLERR,arg[3],false,lmp); if (k <= 0.0) error->all(FLERR,"Illegal fix spring/self command"); xflag = yflag = zflag = 1; @@ -70,10 +70,10 @@ FixSpringSelf::FixSpringSelf(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - xoriginal = NULL; + xoriginal = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // xoriginal = initial unwrapped positions of atoms @@ -96,8 +96,8 @@ FixSpringSelf::~FixSpringSelf() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); // delete locally stored array diff --git a/src/fix_store.cpp b/src/fix_store.cpp index 3cf3125be5..e1d102aff0 100644 --- a/src/fix_store.cpp +++ b/src/fix_store.cpp @@ -12,12 +12,13 @@ ------------------------------------------------------------------------- */ #include "fix_store.h" -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "memory.h" #include "error.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -27,7 +28,7 @@ enum{UNKNOWN,GLOBAL,PERATOM}; /* ---------------------------------------------------------------------- */ FixStore::FixStore(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -vstore(NULL), astore(NULL), rbuf(NULL) +vstore(nullptr), astore(nullptr), rbuf(nullptr) { if (narg != 6) error->all(FLERR,"Illegal fix store command"); @@ -52,24 +53,24 @@ vstore(NULL), astore(NULL), rbuf(NULL) if (flavor == GLOBAL) { restart_global = 1; - nrow = force->inumeric(FLERR,arg[4]); - ncol = force->inumeric(FLERR,arg[5]); + nrow = utils::inumeric(FLERR,arg[4],false,lmp); + ncol = utils::inumeric(FLERR,arg[5],false,lmp); if (nrow <= 0 || ncol <= 0) error->all(FLERR,"Illegal fix store command"); vecflag = 0; if (ncol == 1) vecflag = 1; } if (flavor == PERATOM) { - restart_peratom = force->inumeric(FLERR,arg[4]); - nvalues = force->inumeric(FLERR,arg[5]); + restart_peratom = utils::inumeric(FLERR,arg[4],false,lmp); + nvalues = utils::inumeric(FLERR,arg[5],false,lmp); if (restart_peratom < 0 or restart_peratom > 1 || nvalues <= 0) error->all(FLERR,"Illegal fix store command"); vecflag = 0; if (nvalues == 1) vecflag = 1; } - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; // allocate vector or array and restart buffer rbuf // for PERATOM, register with Atom class @@ -81,9 +82,9 @@ vstore(NULL), astore(NULL), rbuf(NULL) } if (flavor == PERATOM) { grow_arrays(atom->nmax); - atom->add_callback(0); - if (restart_peratom) atom->add_callback(1); - rbuf = NULL; + atom->add_callback(Atom::GROW); + if (restart_peratom) atom->add_callback(Atom::RESTART); + rbuf = nullptr; } // zero the storage @@ -116,8 +117,8 @@ FixStore::~FixStore() // unregister callbacks to this fix from Atom class if (flavor == PERATOM) { - atom->delete_callback(id,0); - if (restart_peratom) atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + if (restart_peratom) atom->delete_callback(id,Atom::RESTART); } memory->destroy(vstore); @@ -144,8 +145,8 @@ void FixStore::reset_global(int nrow_caller, int ncol_caller) memory->destroy(vstore); memory->destroy(astore); memory->destroy(rbuf); - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; vecflag = 0; if (ncol_caller == 1) vecflag = 1; @@ -198,8 +199,8 @@ void FixStore::restart(char *buf) memory->destroy(vstore); memory->destroy(astore); memory->destroy(rbuf); - vstore = NULL; - astore = NULL; + vstore = nullptr; + astore = nullptr; vecflag = 0; if (ncol_restart == 1) vecflag = 1; diff --git a/src/fix_store_force.cpp b/src/fix_store_force.cpp index 5c25f0e162..ae01848d7b 100644 --- a/src/fix_store_force.cpp +++ b/src/fix_store_force.cpp @@ -26,7 +26,7 @@ using namespace FixConst; FixStoreForce::FixStoreForce(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - foriginal(NULL) + foriginal(nullptr) { if (narg < 3) error->all(FLERR,"Illegal fix store/coord command"); diff --git a/src/fix_store_state.cpp b/src/fix_store_state.cpp index e1e2aab663..79c9c18ed3 100644 --- a/src/fix_store_state.cpp +++ b/src/fix_store_state.cpp @@ -12,20 +12,20 @@ ------------------------------------------------------------------------- */ #include "fix_store_state.h" -#include -#include + #include "atom.h" -#include "domain.h" -#include "update.h" -#include "group.h" -#include "modify.h" #include "compute.h" -#include "fix.h" -#include "input.h" -#include "variable.h" -#include "memory.h" +#include "domain.h" #include "error.h" -#include "force.h" +#include "fix.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -38,16 +38,16 @@ enum{KEYWORD,COMPUTE,FIX,VARIABLE,DNAME,INAME}; FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), - ids(NULL), values(NULL), - vbuf(NULL), pack_choice(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), + ids(nullptr), values(nullptr), + vbuf(nullptr), pack_choice(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix store/state command"); restart_peratom = 1; peratom_freq = 1; - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal fix store/state command"); // parse values until one isn't recognized @@ -64,7 +64,7 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : int iarg = 4; while (iarg < narg) { which[nvalues] = KEYWORD; - ids[nvalues] = NULL; + ids[nvalues] = nullptr; if (strcmp(arg[iarg],"id") == 0) { pack_choice[nvalues++] = &FixStoreState::pack_id; @@ -348,10 +348,10 @@ FixStoreState::FixStoreState(LAMMPS *lmp, int narg, char **arg) : // perform initial allocation of atom-based array // register with Atom class - values = NULL; + values = nullptr; grow_arrays(atom->nmax); - atom->add_callback(0); - atom->add_callback(1); + atom->add_callback(Atom::GROW); + atom->add_callback(Atom::RESTART); // zero the array since dump may access it on timestep 0 // zero the array since a variable may access it before first run @@ -375,8 +375,8 @@ FixStoreState::~FixStoreState() { // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); - atom->delete_callback(id,1); + atom->delete_callback(id,Atom::GROW); + atom->delete_callback(id,Atom::RESTART); delete [] which; delete [] argindex; @@ -479,7 +479,7 @@ void FixStoreState::end_of_step() // fill vector or array with per-atom values if (values) vbuf = &values[0][0]; - else vbuf = NULL; + else vbuf = nullptr; for (int m = 0; m < nvalues; m++) { if (which[m] == KEYWORD && kflag) (this->*pack_choice[m])(m); @@ -572,7 +572,7 @@ void FixStoreState::grow_arrays(int nmax) memory->grow(values,nmax,nvalues,"store/state:values"); if (nvalues == 1) { if (nmax) vector_atom = &values[0][0]; - else vector_atom = NULL; + else vector_atom = nullptr; } else array_atom = values; } diff --git a/src/fix_temp_berendsen.cpp b/src/fix_temp_berendsen.cpp index 7a1d1d06fc..610cc7310a 100644 --- a/src/fix_temp_berendsen.cpp +++ b/src/fix_temp_berendsen.cpp @@ -13,7 +13,7 @@ #include "fix_temp_berendsen.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -25,7 +25,7 @@ #include "modify.h" #include "compute.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -37,7 +37,7 @@ enum{CONSTANT,EQUAL}; FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), tflag(0) + tstr(nullptr), id_temp(nullptr), tflag(0) { if (narg != 6) error->all(FLERR,"Illegal fix temp/berendsen command"); @@ -50,20 +50,20 @@ FixTempBerendsen::FixTempBerendsen(LAMMPS *lmp, int narg, char **arg) : global_freq = nevery; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); // error checks @@ -280,5 +280,5 @@ void *FixTempBerendsen::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_csld.cpp b/src/fix_temp_csld.cpp index 0a0face0ed..c8016f3200 100644 --- a/src/fix_temp_csld.cpp +++ b/src/fix_temp_csld.cpp @@ -17,7 +17,7 @@ #include "fix_temp_csld.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -31,7 +31,7 @@ #include "compute.h" #include "random_mars.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -43,7 +43,7 @@ enum{CONSTANT,EQUAL}; FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - vhold(NULL), tstr(NULL), id_temp(NULL), random(NULL) + vhold(nullptr), tstr(nullptr), id_temp(nullptr), random(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix temp/csld command"); @@ -56,21 +56,21 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // error checks @@ -90,7 +90,7 @@ FixTempCSLD::FixTempCSLD(LAMMPS *lmp, int narg, char **arg) : modify->add_compute(cmd); tflag = 1; - vhold = NULL; + vhold = nullptr; nmax = -1; energy = 0.0; } @@ -108,7 +108,7 @@ FixTempCSLD::~FixTempCSLD() delete random; memory->destroy(vhold); - vhold = NULL; + vhold = nullptr; nmax = -1; } @@ -306,10 +306,12 @@ double FixTempCSLD::compute_scalar() void FixTempCSLD::write_restart(FILE *fp) { int nsize = (98+2+3)*comm->nprocs+2; // pRNG state per proc + nprocs + energy - double *list; - if (comm->me == 0) list = new double[nsize]; - list[0] = energy; - list[1] = comm->nprocs; + double *list = nullptr; + if (comm->me == 0) { + list = new double[nsize]; + list[0] = energy; + list[1] = comm->nprocs; + } double state[103]; random->get_state(state); MPI_Gather(state,103,MPI_DOUBLE,list+2,103*comm->nprocs,MPI_DOUBLE,0,world); @@ -318,8 +320,8 @@ void FixTempCSLD::write_restart(FILE *fp) int size = nsize * sizeof(double); fwrite(&size,sizeof(int),1,fp); fwrite(list,sizeof(double),nsize,fp); + delete[] list; } - if (comm->me == 0) delete[] list; } /* ---------------------------------------------------------------------- @@ -348,5 +350,5 @@ void *FixTempCSLD::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_csvr.cpp b/src/fix_temp_csvr.cpp index 54fc820927..649f0d9870 100644 --- a/src/fix_temp_csvr.cpp +++ b/src/fix_temp_csvr.cpp @@ -17,10 +17,10 @@ ------------------------------------------------------------------------- */ #include "fix_temp_csvr.h" -#include + #include #include -#include + #include "atom.h" #include "force.h" #include "comm.h" @@ -32,7 +32,7 @@ #include "compute.h" #include "random_mars.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -120,7 +120,7 @@ double FixTempCSVR::resamplekin(double ekin_old, double ekin_new){ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), random(NULL) + tstr(nullptr), id_temp(nullptr), random(nullptr) { if (narg != 7) error->all(FLERR,"Illegal fix temp/csvr command"); @@ -133,21 +133,21 @@ FixTempCSVR::FixTempCSVR(LAMMPS *lmp, int narg, char **arg) : dynamic_group_allow = 1; extscalar = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[3],"v_") == arg[3]) { int n = strlen(&arg[3][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[3][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[3],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[4]); - t_period = force->numeric(FLERR,arg[5]); - int seed = force->inumeric(FLERR,arg[6]); + t_stop = utils::numeric(FLERR,arg[4],false,lmp); + t_period = utils::numeric(FLERR,arg[5],false,lmp); + int seed = utils::inumeric(FLERR,arg[6],false,lmp); // error checks @@ -339,10 +339,12 @@ double FixTempCSVR::compute_scalar() void FixTempCSVR::write_restart(FILE *fp) { int nsize = (98+2+3)*comm->nprocs+2; // pRNG state per proc + nprocs + energy - double *list; - if (comm->me == 0) list = new double[nsize]; - list[0] = energy; - list[1] = comm->nprocs; + double *list = nullptr; + if (comm->me == 0) { + list = new double[nsize]; + list[0] = energy; + list[1] = comm->nprocs; + } double state[103]; random->get_state(state); MPI_Gather(state,103,MPI_DOUBLE,list+2,103*comm->nprocs,MPI_DOUBLE,0,world); @@ -351,8 +353,8 @@ void FixTempCSVR::write_restart(FILE *fp) int size = nsize * sizeof(double); fwrite(&size,sizeof(int),1,fp); fwrite(list,sizeof(double),nsize,fp); + delete[] list; } - if (comm->me == 0) delete[] list; } /* ---------------------------------------------------------------------- @@ -381,5 +383,5 @@ void *FixTempCSVR::extract(const char *str, int &dim) if (strcmp(str,"t_target") == 0) { return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_rescale.cpp b/src/fix_temp_rescale.cpp index 575a81c40b..bd3ae9ecdc 100644 --- a/src/fix_temp_rescale.cpp +++ b/src/fix_temp_rescale.cpp @@ -13,7 +13,7 @@ #include "fix_temp_rescale.h" #include -#include + #include #include "atom.h" #include "force.h" @@ -25,7 +25,7 @@ #include "modify.h" #include "compute.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; using namespace FixConst; @@ -37,33 +37,34 @@ enum{CONSTANT,EQUAL}; FixTempRescale::FixTempRescale(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - tstr(NULL), id_temp(NULL), tflag(0) + tstr(nullptr), id_temp(nullptr), tflag(0) { if (narg < 8) error->all(FLERR,"Illegal fix temp/rescale command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix temp/rescale command"); + restart_global = 1; scalar_flag = 1; global_freq = nevery; extscalar = 1; dynamic_group_allow = 1; - tstr = NULL; + tstr = nullptr; if (strstr(arg[4],"v_") == arg[4]) { int n = strlen(&arg[4][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[4][2]); tstyle = EQUAL; } else { - t_start = force->numeric(FLERR,arg[4]); + t_start = utils::numeric(FLERR,arg[4],false,lmp); t_target = t_start; tstyle = CONSTANT; } - t_stop = force->numeric(FLERR,arg[5]); - t_window = force->numeric(FLERR,arg[6]); - fraction = force->numeric(FLERR,arg[7]); + t_stop = utils::numeric(FLERR,arg[5],false,lmp); + t_window = utils::numeric(FLERR,arg[6],false,lmp); + fraction = utils::numeric(FLERR,arg[7],false,lmp); // create a new compute temp // id = fix-ID + temp, compute group = fix group @@ -238,6 +239,35 @@ double FixTempRescale::compute_scalar() return energy; } +/* ---------------------------------------------------------------------- + pack entire state of Fix into one write +------------------------------------------------------------------------- */ + +void FixTempRescale::write_restart(FILE *fp) +{ + int n = 0; + double list[1]; + list[n++] = energy; + + if (comm->me == 0) { + int size = n * sizeof(double); + fwrite(&size,sizeof(int),1,fp); + fwrite(list,sizeof(double),n,fp); + } +} + +/* ---------------------------------------------------------------------- + use state info from restart file to restart the Fix +------------------------------------------------------------------------- */ + +void FixTempRescale::restart(char *buf) +{ + int n = 0; + double *list = (double *) buf; + + energy = list[n++]; +} + /* ---------------------------------------------------------------------- extract thermostat properties ------------------------------------------------------------------------- */ @@ -248,5 +278,5 @@ void *FixTempRescale::extract(const char *str, int &dim) dim = 0; return &t_target; } - return NULL; + return nullptr; } diff --git a/src/fix_temp_rescale.h b/src/fix_temp_rescale.h index 20f4686f30..b90ca905cb 100644 --- a/src/fix_temp_rescale.h +++ b/src/fix_temp_rescale.h @@ -34,6 +34,8 @@ class FixTempRescale : public Fix { int modify_param(int, char **); void reset_target(double); double compute_scalar(); + void write_restart(FILE *); + void restart(char *buf); virtual void *extract(const char *, int &); protected: diff --git a/src/fix_tmd.cpp b/src/fix_tmd.cpp index 5db7bacbc6..5f925b9d93 100644 --- a/src/fix_tmd.cpp +++ b/src/fix_tmd.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "fix_tmd.h" -#include + #include #include #include "atom.h" @@ -29,8 +29,8 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + + using namespace LAMMPS_NS; using namespace FixConst; @@ -41,12 +41,12 @@ using namespace FixConst; /* ---------------------------------------------------------------------- */ FixTMD::FixTMD(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), -nfileevery(0), fp(NULL), xf(NULL), xold(NULL) +nfileevery(0), fp(nullptr), xf(nullptr), xold(nullptr) { if (narg < 6) error->all(FLERR,"Illegal fix tmd command"); - rho_stop = force->numeric(FLERR,arg[3]); - nfileevery = force->inumeric(FLERR,arg[5]); + rho_stop = utils::numeric(FLERR,arg[3],false,lmp); + nfileevery = utils::inumeric(FLERR,arg[5],false,lmp); if (rho_stop < 0 || nfileevery < 0) error->all(FLERR,"Illegal fix tmd command"); if (nfileevery && narg != 7) error->all(FLERR,"Illegal fix tmd command"); @@ -57,11 +57,11 @@ nfileevery(0), fp(NULL), xf(NULL), xold(NULL) // register with Atom class grow_arrays(atom->nmax); - atom->add_callback(0); + atom->add_callback(Atom::GROW); // make sure an atom map exists before reading in target coordinates - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use fix TMD unless atom map exists"); // read from arg[4] and store coordinates of final target in xf @@ -74,7 +74,7 @@ nfileevery(0), fp(NULL), xf(NULL), xold(NULL) if (narg != 7) error->all(FLERR,"Illegal fix tmd command"); if (me == 0) { fp = fopen(arg[6],"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open fix tmd file {}: {}", arg[6], utils::getsyserror())); fprintf(fp,"%s %s\n","# Step rho_target rho_old gamma_back", @@ -128,7 +128,7 @@ FixTMD::~FixTMD() // unregister callbacks to this fix from Atom class - atom->delete_callback(id,0); + atom->delete_callback(id,Atom::GROW); // delete locally stored arrays @@ -396,7 +396,7 @@ void FixTMD::readfile(char *file) int firstline = 1; int ncount = 0; - char *eof = NULL; + char *eof = nullptr; xprd = yprd = zprd = -1.0; do { @@ -404,7 +404,7 @@ void FixTMD::readfile(char *file) m = 0; for (nlines = 0; nlines < CHUNK; nlines++) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) break; + if (eof == nullptr) break; m += strlen(&buffer[m]); } if (buffer[m-1] != '\n') strcpy(&buffer[m++],"\n"); @@ -486,7 +486,7 @@ void FixTMD::readfile(char *file) } bufptr = next + 1; } - } while (eof != NULL); + } while (eof != nullptr); // clean up @@ -540,7 +540,7 @@ void FixTMD::open(char *file) #endif } - if (fp == NULL) { + if (fp == nullptr) { char str[128]; snprintf(str,128,"Cannot open file %s",file); error->one(FLERR,str); diff --git a/src/fix_vector.cpp b/src/fix_vector.cpp index 53093acbf6..141f00e65e 100644 --- a/src/fix_vector.cpp +++ b/src/fix_vector.cpp @@ -12,16 +12,16 @@ ------------------------------------------------------------------------- */ #include "fix_vector.h" -#include -#include -#include "update.h" -#include "force.h" -#include "modify.h" + #include "compute.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -38,11 +38,11 @@ enum{SCALAR,VECTOR}; FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - nvalues(0), which(NULL), argindex(NULL), value2index(NULL), ids(NULL), vector(NULL), array(NULL) + nvalues(0), which(nullptr), argindex(nullptr), value2index(nullptr), ids(nullptr), vector(nullptr), array(nullptr) { if (narg < 5) error->all(FLERR,"Illegal fix vector command"); - nevery = force->inumeric(FLERR,arg[3]); + nevery = utils::inumeric(FLERR,arg[3],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal fix vector command"); nvalues = narg-4; @@ -154,8 +154,8 @@ FixVector::FixVector(LAMMPS *lmp, int narg, char **arg) : // ncount = current size of vector or array - vector = NULL; - array = NULL; + vector = nullptr; + array = nullptr; ncount = ncountmax = 0; if (nvalues == 1) size_vector = 0; else size_array_rows = 0; diff --git a/src/fix_viscous.cpp b/src/fix_viscous.cpp index bdd1e19976..d07d547c29 100644 --- a/src/fix_viscous.cpp +++ b/src/fix_viscous.cpp @@ -12,12 +12,13 @@ ------------------------------------------------------------------------- */ #include "fix_viscous.h" -#include + #include "atom.h" -#include "update.h" -#include "respa.h" #include "error.h" -#include "force.h" +#include "respa.h" +#include "update.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -26,13 +27,13 @@ using namespace FixConst; FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - gamma(NULL) + gamma(nullptr) { dynamic_group_allow = 1; if (narg < 4) error->all(FLERR,"Illegal fix viscous command"); - double gamma_one = force->numeric(FLERR,arg[3]); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); gamma = new double[atom->ntypes+1]; for (int i = 1; i <= atom->ntypes; i++) gamma[i] = gamma_one; @@ -42,8 +43,8 @@ FixViscous::FixViscous(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"scale") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal fix viscous command"); - int itype = force->inumeric(FLERR,arg[iarg+1]); - double scale = force->numeric(FLERR,arg[iarg+2]); + int itype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + double scale = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (itype <= 0 || itype > atom->ntypes) error->all(FLERR,"Illegal fix viscous command"); gamma[itype] = gamma_one * scale; diff --git a/src/fix_wall.cpp b/src/fix_wall.cpp index a30b14c231..2394922e26 100644 --- a/src/fix_wall.cpp +++ b/src/fix_wall.cpp @@ -12,18 +12,17 @@ ------------------------------------------------------------------------- */ #include "fix_wall.h" -#include -#include -#include "input.h" -#include "variable.h" + #include "domain.h" +#include "error.h" +#include "input.h" #include "lattice.h" -#include "update.h" #include "modify.h" #include "respa.h" -#include "error.h" -#include "force.h" -#include "utils.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -52,7 +51,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : fldflag = 0; int pbcflag = 0; - for (int i = 0; i < 6; i++) xstr[i] = estr[i] = sstr[i] = NULL; + for (int i = 0; i < 6; i++) xstr[i] = estr[i] = sstr[i] = nullptr; int iarg = 3; while (iarg < narg) { @@ -87,7 +86,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(xstr[nwall],&arg[iarg+1][2]); } else { xstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) { @@ -96,7 +95,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(estr[nwall],&arg[iarg+2][2]); estyle[nwall] = VARIABLE; } else { - epsilon[nwall] = force->numeric(FLERR,arg[iarg+2]); + epsilon[nwall] = utils::numeric(FLERR,arg[iarg+2],false,lmp); estyle[nwall] = CONSTANT; } @@ -107,7 +106,7 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(astr[nwall],&arg[iarg+3][2]); astyle[nwall] = VARIABLE; } else { - alpha[nwall] = force->numeric(FLERR,arg[iarg+3]); + alpha[nwall] = utils::numeric(FLERR,arg[iarg+3],false,lmp); astyle[nwall] = CONSTANT; } ++iarg; @@ -119,11 +118,11 @@ FixWall::FixWall(LAMMPS *lmp, int narg, char **arg) : strcpy(sstr[nwall],&arg[iarg+3][2]); sstyle[nwall] = VARIABLE; } else { - sigma[nwall] = force->numeric(FLERR,arg[iarg+3]); + sigma[nwall] = utils::numeric(FLERR,arg[iarg+3],false,lmp); sstyle[nwall] = CONSTANT; } - cutoff[nwall] = force->numeric(FLERR,arg[iarg+4]); + cutoff[nwall] = utils::numeric(FLERR,arg[iarg+4],false,lmp); nwall++; iarg += 5; diff --git a/src/fix_wall_reflect.cpp b/src/fix_wall_reflect.cpp index 032a11e328..227ef66564 100644 --- a/src/fix_wall_reflect.cpp +++ b/src/fix_wall_reflect.cpp @@ -12,17 +12,18 @@ ------------------------------------------------------------------------- */ #include "fix_wall_reflect.h" -#include + #include "atom.h" #include "comm.h" -#include "update.h" -#include "modify.h" #include "domain.h" -#include "force.h" -#include "lattice.h" -#include "input.h" -#include "variable.h" #include "error.h" +#include "input.h" +#include "lattice.h" +#include "modify.h" +#include "update.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -79,7 +80,7 @@ FixWallReflect::FixWallReflect(LAMMPS *lmp, int narg, char **arg) : strcpy(varstr[nwall],&arg[iarg+1][2]); } else { wallstyle[nwall] = CONSTANT; - coord0[nwall] = force->numeric(FLERR,arg[iarg+1]); + coord0[nwall] = utils::numeric(FLERR,arg[iarg+1],false,lmp); } nwall++; diff --git a/src/fix_wall_region.cpp b/src/fix_wall_region.cpp index 70bde90d2b..6ec3a27a58 100644 --- a/src/fix_wall_region.cpp +++ b/src/fix_wall_region.cpp @@ -12,17 +12,17 @@ ------------------------------------------------------------------------- */ #include "fix_wall_region.h" -#include -#include -#include + #include "atom.h" #include "domain.h" -#include "region.h" -#include "force.h" -#include "update.h" -#include "respa.h" #include "error.h" #include "math_const.h" +#include "region.h" +#include "respa.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -34,7 +34,7 @@ enum{LJ93,LJ126,LJ1043,COLLOID,HARMONIC,MORSE}; FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg), - idregion(NULL) + idregion(nullptr) { if (narg < 8) error->all(FLERR,"Illegal fix wall/region command"); @@ -71,18 +71,18 @@ FixWallRegion::FixWallRegion(LAMMPS *lmp, int narg, char **arg) : if (narg != 9) error->all(FLERR,"Illegal fix wall/region command"); - epsilon = force->numeric(FLERR,arg[5]); - alpha = force->numeric(FLERR,arg[6]); - sigma = force->numeric(FLERR,arg[7]); - cutoff = force->numeric(FLERR,arg[8]); + epsilon = utils::numeric(FLERR,arg[5],false,lmp); + alpha = utils::numeric(FLERR,arg[6],false,lmp); + sigma = utils::numeric(FLERR,arg[7],false,lmp); + cutoff = utils::numeric(FLERR,arg[8],false,lmp); } else { if (narg != 8) error->all(FLERR,"Illegal fix wall/region command"); - epsilon = force->numeric(FLERR,arg[5]); - sigma = force->numeric(FLERR,arg[6]); - cutoff = force->numeric(FLERR,arg[7]); + epsilon = utils::numeric(FLERR,arg[5],false,lmp); + sigma = utils::numeric(FLERR,arg[6],false,lmp); + cutoff = utils::numeric(FLERR,arg[7],false,lmp); } if (cutoff <= 0.0) error->all(FLERR,"Fix wall/region cutoff <= 0.0"); diff --git a/src/fmt/core.h b/src/fmt/core.h index f9155000ec..6d87ab290a 100644 --- a/src/fmt/core.h +++ b/src/fmt/core.h @@ -18,7 +18,7 @@ #include // The fmt library version in the form major * 10000 + minor * 100 + patch. -#define FMT_VERSION 70002 +#define FMT_VERSION 70003 #ifdef __clang__ # define FMT_CLANG_VERSION (__clang_major__ * 100 + __clang_minor__) @@ -177,6 +177,12 @@ # endif #endif +// LAMMPS customization +// use 'v7_lmp' namespace instead of 'v7' so that our +// bundled copy does not collide with linking other code +// using system wide installations which may be using +// a different version. + #ifndef FMT_BEGIN_NAMESPACE # if FMT_HAS_FEATURE(cxx_inline_namespaces) || FMT_GCC_VERSION >= 404 || \ FMT_MSC_VER >= 1900 @@ -299,7 +305,7 @@ template struct std_string_view {}; #ifdef FMT_USE_INT128 // Do nothing. -#elif defined(__SIZEOF_INT128__) && !FMT_NVCC +#elif defined(__SIZEOF_INT128__) && !FMT_NVCC && !(FMT_CLANG_VERSION && FMT_MSC_VER) # define FMT_USE_INT128 1 using int128_t = __int128_t; using uint128_t = __uint128_t; @@ -489,6 +495,8 @@ constexpr basic_string_view to_string_view(const S& s) { return s; } +// LAMMPS customization using 'v7_lmp' instead of 'v7' + namespace detail { void to_string_view(...); using fmt::v7_lmp::to_string_view; @@ -1713,7 +1721,7 @@ template class basic_format_args { } template int get_id(basic_string_view name) const { - if (!has_named_args()) return {}; + if (!has_named_args()) return -1; const auto& named_args = (is_packed() ? values_[-1] : args_[-1].value_).named_args; for (size_t i = 0; i < named_args.size; ++i) { diff --git a/src/fmt/format.h b/src/fmt/format.h index 5427042b4e..a4911b9fdb 100644 --- a/src/fmt/format.h +++ b/src/fmt/format.h @@ -69,6 +69,12 @@ # define FMT_NOINLINE #endif +// LAMMPS customizations: +// 1) Intel compilers on MacOS have __clang__ defined +// but fail to recognize [[clang::fallthrough]] +// 2) Intel compilers on Linux identify as GCC compatible +// but fail to recognize [[gnu::fallthrough]] + #if __cplusplus == 201103L || __cplusplus == 201402L # if defined(__clang__) && !defined(__INTEL_COMPILER) # define FMT_FALLTHROUGH [[clang::fallthrough]] @@ -724,13 +730,18 @@ class FMT_API format_error : public std::runtime_error { namespace detail { +template +using is_signed = + std::integral_constant::is_signed || + std::is_same::value>; + // Returns true if value is negative, false otherwise. // Same as `value < 0` but doesn't produce warnings if T is an unsigned type. -template ::is_signed)> +template ::value)> FMT_CONSTEXPR bool is_negative(T value) { return value < 0; } -template ::is_signed)> +template ::value)> FMT_CONSTEXPR bool is_negative(T) { return false; } @@ -745,9 +756,9 @@ FMT_CONSTEXPR bool is_supported_floating_point(T) { // Smallest of uint32_t, uint64_t, uint128_t that is large enough to // represent all values of T. template -using uint32_or_64_or_128_t = conditional_t< - num_bits() <= 32, uint32_t, - conditional_t() <= 64, uint64_t, uint128_t>>; +using uint32_or_64_or_128_t = + conditional_t() <= 32, uint32_t, + conditional_t() <= 64, uint64_t, uint128_t>>; // Static data is placed in this class template for the header-only config. template struct FMT_EXTERN_TEMPLATE_API basic_data { @@ -1593,7 +1604,11 @@ template struct int_writer { make_checked(p, s.size())); } if (prefix_size != 0) p[-1] = static_cast('-'); - write(out, basic_string_view(buffer.data(), buffer.size()), specs); + using iterator = remove_reference_t; + auto data = buffer.data(); + out = write_padded(out, specs, size, size, [=](iterator it) { + return copy_str(data, data + size, it); + }); } void on_chr() { *out++ = static_cast(abs_value); } diff --git a/src/force.cpp b/src/force.cpp index d2eb137d06..3547f7c964 100644 --- a/src/force.cpp +++ b/src/force.cpp @@ -12,31 +12,27 @@ ------------------------------------------------------------------------- */ #include "force.h" -#include -#include -#include -#include -#include "style_bond.h" -#include "style_angle.h" -#include "style_dihedral.h" -#include "style_improper.h" -#include "style_pair.h" -#include "style_kspace.h" +#include "style_angle.h" // IWYU pragma: keep +#include "style_bond.h" // IWYU pragma: keep +#include "style_dihedral.h" // IWYU pragma: keep +#include "style_improper.h" // IWYU pragma: keep +#include "style_kspace.h" // IWYU pragma: keep +#include "style_pair.h" // IWYU pragma: keep + +#include "angle.h" #include "atom.h" +#include "bond.h" +#include "bond_hybrid.h" #include "comm.h" +#include "dihedral.h" +#include "error.h" +#include "improper.h" +#include "kspace.h" #include "pair.h" #include "pair_hybrid.h" #include "pair_hybrid_overlay.h" -#include "bond.h" -#include "bond_hybrid.h" -#include "angle.h" -#include "dihedral.h" -#include "improper.h" -#include "kspace.h" -#include "error.h" -#include "update.h" -#include "utils.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -58,12 +54,12 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) qqr2e_lammps_real = 332.06371; // these constants are toggled qqr2e_charmm_real = 332.0716; // by new CHARMM pair styles - pair = NULL; - bond = NULL; - angle = NULL; - dihedral = NULL; - improper = NULL; - kspace = NULL; + pair = nullptr; + bond = nullptr; + angle = nullptr; + dihedral = nullptr; + improper = nullptr; + kspace = nullptr; char *str = (char *) "none"; int n = strlen(str) + 1; @@ -80,7 +76,7 @@ Force::Force(LAMMPS *lmp) : Pointers(lmp) kspace_style = new char[n]; strcpy(kspace_style,str); - pair_restart = NULL; + pair_restart = nullptr; create_factories(); } @@ -163,12 +159,12 @@ Force::~Force() if (improper) delete improper; if (kspace) delete kspace; - pair = NULL; - bond = NULL; - angle = NULL; - dihedral = NULL; - improper = NULL; - kspace = NULL; + pair = nullptr; + bond = nullptr; + angle = nullptr; + dihedral = nullptr; + improper = nullptr; + kspace = nullptr; delete pair_map; delete bond_map; @@ -237,9 +233,9 @@ void Force::create_pair(const std::string &style, int trysuffix) delete [] pair_style; if (pair) delete pair; if (pair_restart) delete [] pair_restart; - pair_style = NULL; - pair = NULL; - pair_restart = NULL; + pair_style = nullptr; + pair = nullptr; + pair_restart = nullptr; int sflag; pair = new_pair(style,trysuffix,sflag); @@ -274,7 +270,7 @@ Pair *Force::new_pair(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (pair_map->find(style) != pair_map->end()) { PairCreator &pair_creator = (*pair_map)[style]; return pair_creator(lmp); @@ -282,7 +278,7 @@ Pair *Force::new_pair(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("pair",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -300,7 +296,7 @@ Pair *Force::pair_creator(LAMMPS *lmp) if exact, then style name must be exact match to word if not exact, style name must contain word if nsub > 0, match Nth hybrid sub-style - return NULL if no match or if nsub=0 and multiple sub-styles match + return nullptr if no match or if nsub=0 and multiple sub-styles match ------------------------------------------------------------------------- */ Pair *Force::pair_match(const std::string &word, int exact, int nsub) @@ -322,13 +318,13 @@ Pair *Force::pair_match(const std::string &word, int exact, int nsub) if (count == 1) return hybrid->styles[iwhich]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- return style name of Pair class that matches Pair ptr called by Neighbor::print_neigh_info() - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ char *Force::pair_match_ptr(Pair *ptr) @@ -341,7 +337,7 @@ char *Force::pair_match_ptr(Pair *ptr) if (ptr == hybrid->styles[i]) return hybrid->keywords[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -385,7 +381,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (bond_map->find(style) != bond_map->end()) { BondCreator &bond_creator = (*bond_map)[style]; return bond_creator(lmp); @@ -393,7 +389,7 @@ Bond *Force::new_bond(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("bond",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -418,7 +414,7 @@ Bond *Force::bond_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -462,7 +458,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (angle_map->find(style) != angle_map->end()) { AngleCreator &angle_creator = (*angle_map)[style]; return angle_creator(lmp); @@ -470,7 +466,7 @@ Angle *Force::new_angle(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("angle",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -495,7 +491,7 @@ Angle *Force::angle_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -539,7 +535,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (dihedral_map->find(style) != dihedral_map->end()) { DihedralCreator &dihedral_creator = (*dihedral_map)[style]; return dihedral_creator(lmp); @@ -547,7 +543,7 @@ Dihedral *Force::new_dihedral(const std::string &style, int trysuffix, int &sfla error->all(FLERR,utils::check_packages_for_style("dihedral",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -572,7 +568,7 @@ Dihedral *Force::dihedral_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -616,7 +612,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (improper_map->find(style) != improper_map->end()) { ImproperCreator &improper_creator = (*improper_map)[style]; return improper_creator(lmp); @@ -624,7 +620,7 @@ Improper *Force::new_improper(const std::string &style, int trysuffix, int &sfla error->all(FLERR,utils::check_packages_for_style("improper",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -649,7 +645,7 @@ Improper *Force::improper_match(const std::string &style) for (int i = 0; i < hybrid->nstyles; i++) if (style == hybrid->keywords[i]) return hybrid->styles[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -664,10 +660,6 @@ void Force::create_kspace(const std::string &style, int trysuffix) int sflag; kspace = new_kspace(style,trysuffix,sflag); store_style(kspace_style,style,sflag); - - if (comm->style == 1 && !kspace_match("ewald",0)) - error->all(FLERR, - "Cannot yet use KSpace solver with grid with comm style tiled"); } /* ---------------------------------------------------------------------- @@ -697,7 +689,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) } sflag = 0; - if (style == "none") return NULL; + if (style == "none") return nullptr; if (kspace_map->find(style) != kspace_map->end()) { KSpaceCreator &kspace_creator = (*kspace_map)[style]; return kspace_creator(lmp); @@ -705,7 +697,7 @@ KSpace *Force::new_kspace(const std::string &style, int trysuffix, int &sflag) error->all(FLERR,utils::check_packages_for_style("kspace",style,lmp)); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -722,14 +714,14 @@ KSpace *Force::kspace_creator(LAMMPS *lmp) return ptr to Kspace class if matches word if exact, then style name must be exact match to word if not exact, style name must contain word - return NULL if no match + return nullptr if no match ------------------------------------------------------------------------- */ KSpace *Force::kspace_match(const std::string &word, int exact) { if (exact && (word == kspace_style)) return kspace; else if (!exact && utils::strmatch(kspace_style,word)) return kspace; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -803,21 +795,21 @@ void Force::set_special(int narg, char **arg) iarg += 1; } else if (strcmp(arg[iarg],"lj/coul") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command"); - special_lj[1] = special_coul[1] = numeric(FLERR,arg[iarg+1]); - special_lj[2] = special_coul[2] = numeric(FLERR,arg[iarg+2]); - special_lj[3] = special_coul[3] = numeric(FLERR,arg[iarg+3]); + special_lj[1] = special_coul[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + special_lj[2] = special_coul[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + special_lj[3] = special_coul[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"lj") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command"); - special_lj[1] = numeric(FLERR,arg[iarg+1]); - special_lj[2] = numeric(FLERR,arg[iarg+2]); - special_lj[3] = numeric(FLERR,arg[iarg+3]); + special_lj[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + special_lj[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + special_lj[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"coul") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal special_bonds command"); - special_coul[1] = numeric(FLERR,arg[iarg+1]); - special_coul[2] = numeric(FLERR,arg[iarg+2]); - special_coul[3] = numeric(FLERR,arg[iarg+3]); + special_coul[1] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + special_coul[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + special_coul[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal special_bonds command"); @@ -840,232 +832,13 @@ void Force::set_special(int narg, char **arg) error->all(FLERR,"Illegal special_bonds command"); } -/* ---------------------------------------------------------------------- - compute bounds implied by numeric str with a possible wildcard asterik - 1 = lower bound, nmax = upper bound - 5 possibilities: - (1) i = i to i, (2) * = nmin to nmax, - (3) i* = i to nmax, (4) *j = nmin to j, (5) i*j = i to j - return nlo,nhi -------------------------------------------------------------------------- */ - -void Force::bounds(const char *file, int line, char *str, - int nmax, int &nlo, int &nhi, int nmin) -{ - char *ptr = strchr(str,'*'); - - if (ptr == NULL) { - nlo = nhi = atoi(str); - } else if (strlen(str) == 1) { - nlo = nmin; - nhi = nmax; - } else if (ptr == str) { - nlo = nmin; - nhi = atoi(ptr+1); - } else if (strlen(ptr+1) == 0) { - nlo = atoi(str); - nhi = nmax; - } else { - nlo = atoi(str); - nhi = atoi(ptr+1); - } - - if (nlo < nmin || nhi > nmax || nlo > nhi) - error->all(file,line,"Numeric index is out of bounds"); -} - -/* ---------------------------------------------------------------------- - compute bounds implied by numeric str with a possible wildcard asterik - 1 = lower bound, nmax = upper bound - 5 possibilities: - (1) i = i to i, (2) * = nmin to nmax, - (3) i* = i to nmax, (4) *j = nmin to j, (5) i*j = i to j - return nlo,nhi -------------------------------------------------------------------------- */ - -void Force::boundsbig(const char *file, int line, char *str, - bigint nmax, bigint &nlo, bigint &nhi, bigint nmin) -{ - char *ptr = strchr(str,'*'); - - if (ptr == NULL) { - nlo = nhi = ATOBIGINT(str); - } else if (strlen(str) == 1) { - nlo = nmin; - nhi = nmax; - } else if (ptr == str) { - nlo = nmin; - nhi = ATOBIGINT(ptr+1); - } else if (strlen(ptr+1) == 0) { - nlo = ATOBIGINT(str); - nhi = nmax; - } else { - nlo = ATOBIGINT(str); - nhi = ATOBIGINT(ptr+1); - } - - if (nlo < nmin || nhi > nmax || nlo > nhi) - error->all(file,line,"Numeric index is out of bounds"); -} - -/* ---------------------------------------------------------------------- - read a floating point value from a string - generate an error if not a legitimate floating point value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -double Force::numeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected floating point parameter instead of" - " NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i])) continue; - if (str[i] == '-' || str[i] == '+' || str[i] == '.') continue; - if (str[i] == 'e' || str[i] == 'E') continue; - error->all(file,line,fmt::format("Expected floating point parameter " - "instead of '{}' in input script or data file",str)); - } - - return atof(str); -} - -/* ---------------------------------------------------------------------- - read an integer value from a string - generate an error if not a legitimate integer value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -int Force::inumeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected integer parameter instead of " - "NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line,fmt::format("Expected integer parameter instead " - "of '{}' in input script or data file",str)); - } - - return atoi(str); -} - -/* ---------------------------------------------------------------------- - read a big integer value from a string - generate an error if not a legitimate integer value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -bigint Force::bnumeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected integer parameter instead of " - "NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line,fmt::format("Expected integer parameter instead " - "of '{}' in input script or data file",str)); - } - - return ATOBIGINT(str); -} - -/* ---------------------------------------------------------------------- - read a tag integer value from a string - generate an error if not a legitimate integer value - called by various commands to check validity of their arguments -------------------------------------------------------------------------- */ - -tagint Force::tnumeric(const char *file, int line, char *str) -{ - int n = 0; - - if (str) n = strlen(str); - if (n == 0) - error->all(file,line,"Expected integer parameter instead of " - "NULL or empty string in input script or data file"); - - for (int i = 0; i < n; i++) { - if (isdigit(str[i]) || str[i] == '-' || str[i] == '+') continue; - error->all(file,line,fmt::format("Expected integer parameter instead " - "of '{}' in input script or data file",str)); - } - - return ATOTAGINT(str); -} - -/* ---------------------------------------------------------------------- - open a potential file as specified by name - if fails, search in dir specified by env variable LAMMPS_POTENTIALS -------------------------------------------------------------------------- */ - -FILE *Force::open_potential(const char *name, int *auto_convert) -{ - std::string filepath = utils::get_potential_file_path(name); - - if(!filepath.empty()) { - std::string unit_style = update->unit_style; - std::string date = utils::get_potential_date(filepath, "potential"); - std::string units = utils::get_potential_units(filepath, "potential"); - - if(!date.empty() && (comm->me == 0)) { - utils::logmesg(lmp, fmt::format("Reading potential file {} " - "with DATE: {}\n", name, date)); - } - - if (auto_convert == nullptr) { - if (!units.empty() && (units != unit_style) && (comm->me == 0)) { - error->one(FLERR, fmt::format("Potential file {} requires {} units " - "but {} units are in use", name, units, - unit_style)); - return nullptr; - } - } else { - if (units.empty() || units == unit_style) { - *auto_convert = utils::NOCONVERT; - } else { - if ((units == "metal") && (unit_style == "real") - && (*auto_convert & utils::METAL2REAL)) { - *auto_convert = utils::METAL2REAL; - } else if ((units == "real") && (unit_style == "metal") - && (*auto_convert & utils::REAL2METAL)) { - *auto_convert = utils::REAL2METAL; - } else { - error->one(FLERR, fmt::format("Potential file {} requires {} units " - "but {} units are in use", name, - units, unit_style)); - return nullptr; - } - } - if ((*auto_convert != utils::NOCONVERT) && (comm->me == 0)) - lmp->error->warning(FLERR, fmt::format("Converting potential file in " - "{} units to {} units", - units, unit_style)); - } - return fopen(filepath.c_str(), "r"); - } - return nullptr; -} - /* ---------------------------------------------------------------------- memory usage of force classes ------------------------------------------------------------------------- */ -bigint Force::memory_usage() +double Force::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (pair) bytes += static_cast (pair->memory_usage()); if (bond) bytes += static_cast (bond->memory_usage()); if (angle) bytes += static_cast (angle->memory_usage()); diff --git a/src/force.h b/src/force.h index b566f02fb7..a2cc37f0b8 100644 --- a/src/force.h +++ b/src/force.h @@ -15,10 +15,16 @@ #define LMP_FORCE_H #include "pointers.h" + #include -#include namespace LAMMPS_NS { + class Angle; + class Bond; + class Dihedral; + class Improper; + class KSpace; + class Pair; class Force : protected Pointers { public: @@ -47,23 +53,23 @@ class Force : protected Pointers { int newton,newton_pair,newton_bond; // Newton's 3rd law settings - class Pair *pair; + Pair *pair; char *pair_style; char *pair_restart; - class Bond *bond; + Bond *bond; char *bond_style; - class Angle *angle; + Angle *angle; char *angle_style; - class Dihedral *dihedral; + Dihedral *dihedral; char *dihedral_style; - class Improper *improper; + Improper *improper; char *improper_style; - class KSpace *kspace; + KSpace *kspace; char *kspace_style; typedef Pair *(*PairCreator)(LAMMPS *); @@ -102,42 +108,34 @@ class Force : protected Pointers { void setup(); void create_pair(const std::string &, int); - class Pair *new_pair(const std::string &, int, int &); - class Pair *pair_match(const std::string &, int, int nsub=0); + Pair *new_pair(const std::string &, int, int &); + Pair *pair_match(const std::string &, int, int nsub=0); char *pair_match_ptr(Pair *); void create_bond(const std::string &, int); - class Bond *new_bond(const std::string &, int, int &); - class Bond *bond_match(const std::string &); + Bond *new_bond(const std::string &, int, int &); + Bond *bond_match(const std::string &); void create_angle(const std::string &, int); - class Angle *new_angle(const std::string &, int, int &); - class Angle *angle_match(const std::string &); + Angle *new_angle(const std::string &, int, int &); + Angle *angle_match(const std::string &); void create_dihedral(const std::string &, int); - class Dihedral *new_dihedral(const std::string &, int, int &); - class Dihedral *dihedral_match(const std::string &); + Dihedral *new_dihedral(const std::string &, int, int &); + Dihedral *dihedral_match(const std::string &); void create_improper(const std::string &, int); - class Improper *new_improper(const std::string &, int, int &); - class Improper *improper_match(const std::string &); + Improper *new_improper(const std::string &, int, int &); + Improper *improper_match(const std::string &); void create_kspace(const std::string &, int); - class KSpace *new_kspace(const std::string &, int, int &); - class KSpace *kspace_match(const std::string &, int); + KSpace *new_kspace(const std::string &, int, int &); + KSpace *kspace_match(const std::string &, int); void store_style(char *&, const std::string &, int); void set_special(int, char **); - void bounds(const char *, int, char *, int, int &, int &, int nmin=1); - void boundsbig(const char *, int, char *, bigint, bigint &, bigint &, bigint nmin=1); - double numeric(const char *, int, char *); - int inumeric(const char *, int, char *); - bigint bnumeric(const char *, int, char *); - tagint tnumeric(const char *, int, char *); - FILE *open_potential(const char *, int *auto_convert = nullptr); - - bigint memory_usage(); + double memory_usage(); private: void create_factories(); diff --git a/src/group.cpp b/src/group.cpp index 79405c9344..7717323b52 100644 --- a/src/group.cpp +++ b/src/group.cpp @@ -12,30 +12,29 @@ ------------------------------------------------------------------------- */ #include "group.h" -#include + +#include "atom.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "dump.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "input.h" +#include "math_extra.h" +#include "math_eigen.h" +#include "memory.h" +#include "modify.h" +#include "output.h" +#include "region.h" +#include "variable.h" + #include #include -#include -#include -#include "domain.h" -#include "atom.h" -#include "force.h" -#include "comm.h" -#include "region.h" -#include "modify.h" -#include "fix.h" -#include "compute.h" -#include "output.h" -#include "input.h" -#include "variable.h" -#include "dump.h" -#include "math_extra.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" - #include +#include +#include using namespace LAMMPS_NS; @@ -60,7 +59,7 @@ Group::Group(LAMMPS *lmp) : Pointers(lmp) inversemask = new int[MAX_GROUP]; dynamic = new int[MAX_GROUP]; - for (int i = 0; i < MAX_GROUP; i++) names[i] = NULL; + for (int i = 0; i < MAX_GROUP; i++) names[i] = nullptr; for (int i = 0; i < MAX_GROUP; i++) bitmask[i] = 1 << i; for (int i = 0; i < MAX_GROUP; i++) inversemask[i] = bitmask[i] ^ ~0; for (int i = 0; i < MAX_GROUP; i++) dynamic[i] = 0; @@ -128,7 +127,7 @@ void Group::assign(int narg, char **arg) modify->delete_fix(std::string("GROUP_") + names[igroup]); delete [] names[igroup]; - names[igroup] = NULL; + names[igroup] = nullptr; dynamic[igroup] = 0; ngroup--; @@ -229,16 +228,16 @@ void Group::assign(int narg, char **arg) else error->all(FLERR,"Illegal group command"); tagint bound1,bound2; - bound1 = force->tnumeric(FLERR,arg[3]); + bound1 = utils::tnumeric(FLERR,arg[3],false,lmp); bound2 = -1; if (condition == BETWEEN) { if (narg != 5) error->all(FLERR,"Illegal group command"); - bound2 = force->tnumeric(FLERR,arg[4]); + bound2 = utils::tnumeric(FLERR,arg[4],false,lmp); } else if (narg != 4) error->all(FLERR,"Illegal group command"); - int *attribute = NULL; - tagint *tattribute = NULL; + int *attribute = nullptr; + tagint *tattribute = nullptr; if (category == TYPE) attribute = atom->type; else if (category == MOLECULE) tattribute = atom->molecule; else if (category == ID) tattribute = atom->tag; @@ -298,8 +297,8 @@ void Group::assign(int narg, char **arg) // args = list of values } else { - int *attribute = NULL; - tagint *tattribute = NULL; + int *attribute = nullptr; + tagint *tattribute = nullptr; if (category == TYPE) attribute = atom->type; else if (category == MOLECULE) tattribute = atom->molecule; else if (category == ID) tattribute = atom->tag; @@ -311,13 +310,13 @@ void Group::assign(int narg, char **arg) delta = 1; if (strchr(arg[iarg],':')) { ptr = strtok(arg[iarg],":"); - start = force->tnumeric(FLERR,ptr); - ptr = strtok(NULL,":"); - stop = force->tnumeric(FLERR,ptr); - ptr = strtok(NULL,":"); - if (ptr) delta = force->tnumeric(FLERR,ptr); + start = utils::tnumeric(FLERR,ptr,false,lmp); + ptr = strtok(nullptr,":"); + stop = utils::tnumeric(FLERR,ptr,false,lmp); + ptr = strtok(nullptr,":"); + if (ptr) delta = utils::tnumeric(FLERR,ptr,false,lmp); } else { - start = stop = force->tnumeric(FLERR,arg[iarg]); + start = stop = utils::tnumeric(FLERR,arg[iarg],false,lmp); } if (delta < 1) error->all(FLERR,"Illegal range increment value"); @@ -538,7 +537,7 @@ void Group::assign(int narg, char **arg) void Group::assign(const std::string &groupcmd) { - std::vector args = utils::split_words(groupcmd); + auto args = utils::split_words(groupcmd); char **newarg = new char*[args.size()]; int i=0; for (const auto &arg : args) { @@ -619,7 +618,7 @@ int Group::find_or_create(const char *name) int Group::find_unused() { for (int igroup = 0; igroup < MAX_GROUP; igroup++) - if (names[igroup] == NULL) return igroup; + if (names[igroup] == nullptr) return igroup; return -1; } @@ -656,7 +655,7 @@ void Group::add_molecules(int /*igroup*/, int bit) for (pos = hash->begin(); pos != hash->end(); ++pos) list[n++] = pos->first; molbit = bit; - comm->ring(n,sizeof(tagint),list,1,molring,NULL,(void *)this); + comm->ring(n,sizeof(tagint),list,1,molring,nullptr,(void *)this); delete hash; memory->destroy(list); @@ -726,7 +725,7 @@ void Group::read_restart(FILE *fp) for (i = 0; i < MAX_GROUP; i++) delete [] names[i]; - if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&ngroup,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&ngroup,1,MPI_INT,0,world); // use count to not change restart format with deleted groups @@ -735,17 +734,17 @@ void Group::read_restart(FILE *fp) int count = 0; for (i = 0; i < MAX_GROUP; i++) { if (count == ngroup) { - names[i] = NULL; + names[i] = nullptr; continue; } - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n) { names[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,names[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(names[i],n,MPI_CHAR,0,world); count++; - } else names[i] = NULL; + } else names[i] = nullptr; } } @@ -1729,11 +1728,11 @@ void Group::omega(double *angmom, double inertia[3][3], double *w) // handle (nearly) singular I matrix // typically due to 2-atom group or linear molecule - // use jacobi() and angmom_to_omega() to calculate valid omega + // use jacobi3() and angmom_to_omega() to calculate valid omega // less exact answer than matrix inversion, due to iterative Jacobi method } else { - int ierror = MathExtra::jacobi(inertia,idiag,evectors); + int ierror = MathEigen::jacobi3(inertia, idiag, evectors); if (ierror) error->all(FLERR, "Insufficient Jacobi rotations for group::omega"); diff --git a/src/group.h b/src/group.h index b9a5c27140..39c446d119 100644 --- a/src/group.h +++ b/src/group.h @@ -15,8 +15,8 @@ #define LMP_GROUP_H #include "pointers.h" + #include -#include namespace LAMMPS_NS { diff --git a/src/image.cpp b/src/image.cpp index 315348065a..6912bdee80 100644 --- a/src/image.cpp +++ b/src/image.cpp @@ -16,16 +16,16 @@ ------------------------------------------------------------------------- */ #include "image.h" -#include -#include -#include -#include -#include "math_extra.h" -#include "random_mars.h" -#include "math_const.h" + #include "error.h" -#include "force.h" +#include "math_const.h" +#include "math_extra.h" #include "memory.h" +#include "random_mars.h" + +#include +#include +#include #ifdef LAMMPS_JPEG #include @@ -74,8 +74,8 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) // colors ncolors = 0; - username = NULL; - userrgb = NULL; + username = nullptr; + userrgb = nullptr; boxcolor = color2rgb("yellow"); background[0] = background[1] = background[2] = 0; @@ -112,7 +112,7 @@ Image::Image(LAMMPS *lmp, int nmap_caller) : Pointers(lmp) backLightColor[1] = 0.9; backLightColor[2] = 0.9; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -651,7 +651,7 @@ void Image::draw_cylinder(double *x, double *y, double c = surface[0] * surface[0] + surface[1] * surface[1] - radsq; double partial = b*b - 4*a*c; - if (partial < 0) continue; + if ((partial < 0.0) || (a == 0.0)) continue; partial = sqrt (partial); double t = (-b + partial) / (2*a); @@ -1029,13 +1029,13 @@ void Image::write_PNG(FILE *fp) png_structp png_ptr; png_infop info_ptr; - png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL, NULL, NULL); + png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, nullptr, nullptr, nullptr); if (!png_ptr) return; info_ptr = png_create_info_struct(png_ptr); if (!info_ptr) { - png_destroy_write_struct(&png_ptr, NULL); + png_destroy_write_struct(&png_ptr, nullptr); return; } @@ -1166,7 +1166,7 @@ int Image::addcolor(char *name, double r, double g, double b) if index < 0, return ptr to -index-1 color from userrgb if index = 0, search the 2 lists of color names for the string color search user-defined color names first, then the list of NCOLORS names - return a pointer to the 3 floating point RGB values or NULL if didn't find + return a pointer to the 3 floating point RGB values or nullptr if didn't find ------------------------------------------------------------------------- */ double *Image::color2rgb(const char *color, int index) @@ -1458,11 +1458,11 @@ double *Image::color2rgb(const char *color, int index) }; if (index > 0) { - if (index > NCOLORS) return NULL; + if (index > NCOLORS) return nullptr; return rgb[index-1]; } if (index < 0) { - if (-index > ncolors) return NULL; + if (-index > ncolors) return nullptr; return userrgb[-index-1]; } @@ -1472,7 +1472,7 @@ double *Image::color2rgb(const char *color, int index) for (int i = 0; i < NCOLORS; i++) if (strcmp(color,name[i]) == 0) return rgb[i]; } - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1620,7 +1620,7 @@ double *Image::element2color(char *element) for (int i = 0; i < NELEMENTS; i++) if (strcmp(element,name[i]) == 0) return rgb[i]; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1708,13 +1708,13 @@ int ColorMap::reset(int narg, char **arg) { if (!islower(arg[0][0])) { mlo = NUMERIC; - mlovalue = force->numeric(FLERR,arg[0]); + mlovalue = utils::numeric(FLERR,arg[0],false,lmp); } else if (strcmp(arg[0],"min") == 0) mlo = MINVALUE; else return 1; if (!islower(arg[1][0])) { mhi = NUMERIC; - mhivalue = force->numeric(FLERR,arg[1]); + mhivalue = utils::numeric(FLERR,arg[1],false,lmp); } else if (strcmp(arg[1],"max") == 0) mhi = MAXVALUE; else return 1; @@ -1733,12 +1733,12 @@ int ColorMap::reset(int narg, char **arg) else return 1; if (mstyle == SEQUENTIAL) { - mbinsize = force->numeric(FLERR,arg[3]); + mbinsize = utils::numeric(FLERR,arg[3],false,lmp); if (mbinsize <= 0.0) return 1; mbinsizeinv = 1.0/mbinsize; } - nentry = force->inumeric(FLERR,arg[4]); + nentry = utils::inumeric(FLERR,arg[4],false,lmp); if (nentry < 1) return 1; delete [] mentry; mentry = new MapEntry[nentry]; @@ -1751,7 +1751,7 @@ int ColorMap::reset(int narg, char **arg) if (n+2 > narg) return 1; if (!islower(arg[n][0])) { mentry[i].single = NUMERIC; - mentry[i].svalue = force->numeric(FLERR,arg[n]); + mentry[i].svalue = utils::numeric(FLERR,arg[n],false,lmp); } else if (strcmp(arg[n],"min") == 0) mentry[i].single = MINVALUE; else if (strcmp(arg[n],"max") == 0) mentry[i].single = MAXVALUE; else return 1; @@ -1761,13 +1761,13 @@ int ColorMap::reset(int narg, char **arg) if (n+3 > narg) return 1; if (!islower(arg[n][0])) { mentry[i].lo = NUMERIC; - mentry[i].lvalue = force->numeric(FLERR,arg[n]); + mentry[i].lvalue = utils::numeric(FLERR,arg[n],false,lmp); } else if (strcmp(arg[n],"min") == 0) mentry[i].lo = MINVALUE; else if (strcmp(arg[n],"max") == 0) mentry[i].lo = MAXVALUE; else return 1; if (!islower(arg[n+1][0])) { mentry[i].hi = NUMERIC; - mentry[i].hvalue = force->numeric(FLERR,arg[n+1]); + mentry[i].hvalue = utils::numeric(FLERR,arg[n+1],false,lmp); } else if (strcmp(arg[n+1],"min") == 0) mentry[i].hi = MINVALUE; else if (strcmp(arg[n+1],"max") == 0) mentry[i].hi = MAXVALUE; else return 1; @@ -1791,13 +1791,13 @@ int ColorMap::reset(int narg, char **arg) if (n+1 > narg) return 1; mentry[i].color = image->color2rgb(arg[n]); } else if (expandflag == 1) { - mentry[i].color = image->color2rgb(NULL,i+1); + mentry[i].color = image->color2rgb(nullptr,i+1); } else if (expandflag == 2) { - mentry[i].color = image->color2rgb(NULL,-(i+1)); + mentry[i].color = image->color2rgb(nullptr,-(i+1)); } n += 1; } - if (mentry[i].color == NULL) return 1; + if (mentry[i].color == nullptr) return 1; } if (mstyle == CONTINUOUS) { @@ -1915,5 +1915,5 @@ double *ColorMap::value2color(double value) return mentry[ibin%nentry].color; } - return NULL; + return nullptr; } diff --git a/src/imbalance_group.cpp b/src/imbalance_group.cpp index dd3370ae92..f604f150b5 100644 --- a/src/imbalance_group.cpp +++ b/src/imbalance_group.cpp @@ -12,12 +12,10 @@ ------------------------------------------------------------------------- */ #include "imbalance_group.h" + #include "atom.h" -#include "force.h" -#include "group.h" #include "error.h" -#include -#include "fmt/format.h" +#include "group.h" using namespace LAMMPS_NS; @@ -40,7 +38,7 @@ int ImbalanceGroup::options(int narg, char **arg) { if (narg < 3) error->all(FLERR,"Illegal balance weight command"); - num = force->inumeric(FLERR,arg[0]); + num = utils::inumeric(FLERR,arg[0],false,lmp); if (num < 1) error->all(FLERR,"Illegal balance weight command"); if (2*num+1 > narg) error->all(FLERR,"Illegal balance weight command"); @@ -50,7 +48,7 @@ int ImbalanceGroup::options(int narg, char **arg) id[i] = group->find(arg[2*i+1]); if (id[i] < 0) error->all(FLERR,"Unknown group in balance weight command"); - factor[i] = force->numeric(FLERR,arg[2*i+2]); + factor[i] = utils::numeric(FLERR,arg[2*i+2],false,lmp); if (factor[i] <= 0.0) error->all(FLERR,"Illegal balance weight command"); } return 2*num+1; diff --git a/src/imbalance_neigh.cpp b/src/imbalance_neigh.cpp index c50b430c51..70d5580b9c 100644 --- a/src/imbalance_neigh.cpp +++ b/src/imbalance_neigh.cpp @@ -12,15 +12,13 @@ ------------------------------------------------------------------------- */ #include "imbalance_neigh.h" -#include + #include "atom.h" #include "comm.h" -#include "force.h" -#include "neighbor.h" -#include "neigh_request.h" -#include "neigh_list.h" #include "error.h" -#include "fmt/format.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" using namespace LAMMPS_NS; @@ -38,7 +36,7 @@ ImbalanceNeigh::ImbalanceNeigh(LAMMPS *lmp) : Imbalance(lmp) int ImbalanceNeigh::options(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal balance weight command"); - factor = force->numeric(FLERR,arg[0]); + factor = utils::numeric(FLERR,arg[0],false,lmp); if (factor <= 0.0) error->all(FLERR,"Illegal balance weight command"); return 1; } diff --git a/src/imbalance_store.cpp b/src/imbalance_store.cpp index 919d1f3f61..2661b57b25 100644 --- a/src/imbalance_store.cpp +++ b/src/imbalance_store.cpp @@ -12,10 +12,11 @@ ------------------------------------------------------------------------- */ #include "imbalance_store.h" -#include + #include "atom.h" #include "error.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; diff --git a/src/imbalance_time.cpp b/src/imbalance_time.cpp index 898d3ceef0..438728ef3e 100644 --- a/src/imbalance_time.cpp +++ b/src/imbalance_time.cpp @@ -12,12 +12,10 @@ ------------------------------------------------------------------------- */ #include "imbalance_time.h" -#include + #include "atom.h" -#include "force.h" -#include "timer.h" #include "error.h" -#include "fmt/format.h" +#include "timer.h" using namespace LAMMPS_NS; @@ -32,7 +30,7 @@ ImbalanceTime::ImbalanceTime(LAMMPS *lmp) : Imbalance(lmp) {} int ImbalanceTime::options(int narg, char **arg) { if (narg < 1) error->all(FLERR,"Illegal balance weight command"); - factor = force->numeric(FLERR,arg[0]); + factor = utils::numeric(FLERR,arg[0],false,lmp); if (factor <= 0.0) error->all(FLERR,"Illegal balance weight command"); return 1; } diff --git a/src/imbalance_var.cpp b/src/imbalance_var.cpp index d1a76ed9f7..a2c940789e 100644 --- a/src/imbalance_var.cpp +++ b/src/imbalance_var.cpp @@ -12,15 +12,15 @@ ------------------------------------------------------------------------- */ #include "imbalance_var.h" -#include -#include + #include "atom.h" +#include "error.h" #include "group.h" #include "input.h" -#include "variable.h" #include "memory.h" -#include "error.h" -#include "fmt/format.h" +#include "variable.h" + +#include using namespace LAMMPS_NS; diff --git a/src/improper.cpp b/src/improper.cpp index ad79a1a972..c657530a40 100644 --- a/src/improper.cpp +++ b/src/improper.cpp @@ -33,10 +33,10 @@ Improper::Improper(LAMMPS *lmp) : Pointers(lmp) suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; - setflag = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; + setflag = nullptr; execution_space = Host; datamask_read = ALL_MASK; diff --git a/src/improper_deprecated.cpp b/src/improper_deprecated.cpp index 0c1a45603e..431cc03997 100644 --- a/src/improper_deprecated.cpp +++ b/src/improper_deprecated.cpp @@ -16,12 +16,12 @@ ------------------------------------------------------------------------- */ #include "improper_deprecated.h" -#include + #include "improper_hybrid.h" #include "comm.h" #include "force.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; diff --git a/src/improper_hybrid.cpp b/src/improper_hybrid.cpp index 69dfc2d9cd..474d8c0c5a 100644 --- a/src/improper_hybrid.cpp +++ b/src/improper_hybrid.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "improper_hybrid.h" -#include + #include #include #include "atom.h" @@ -21,7 +21,7 @@ #include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -160,7 +160,7 @@ void ImproperHybrid::allocate() maximproper = new int[nstyles]; improperlist = new int**[nstyles]; for (int m = 0; m < nstyles; m++) maximproper[m] = 0; - for (int m = 0; m < nstyles; m++) improperlist[m] = NULL; + for (int m = 0; m < nstyles; m++) improperlist[m] = nullptr; } /* ---------------------------------------------------------------------- */ @@ -263,7 +263,7 @@ void ImproperHybrid::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); // 2nd arg = improper sub-style name // allow for "none" as valid sub-style name @@ -325,7 +325,7 @@ void ImproperHybrid::write_restart(FILE *fp) void ImproperHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); styles = new Improper*[nstyles]; keywords = new char*[nstyles]; @@ -334,10 +334,10 @@ void ImproperHybrid::read_restart(FILE *fp) int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_improper(keywords[m],0,dummy); styles[m]->read_restart_settings(fp); diff --git a/src/improper_zero.cpp b/src/improper_zero.cpp index efa70c8ff5..3da38a890c 100644 --- a/src/improper_zero.cpp +++ b/src/improper_zero.cpp @@ -16,11 +16,12 @@ ------------------------------------------------------------------------- */ #include "improper_zero.h" -#include + #include "atom.h" -#include "force.h" -#include "memory.h" #include "error.h" +#include "memory.h" + +#include using namespace LAMMPS_NS; @@ -80,7 +81,7 @@ void ImproperZero::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->nimpropertypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->nimpropertypes,ilo,ihi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { diff --git a/src/info.cpp b/src/info.cpp index 4501875d5b..dd913271a1 100644 --- a/src/info.cpp +++ b/src/info.cpp @@ -17,39 +17,37 @@ ------------------------------------------------------------------------- */ #include "info.h" -#include -#include -#include -#include -#include -#include -#include + #include "accelerator_kokkos.h" +#include "angle.h" #include "atom.h" +#include "bond.h" #include "comm.h" #include "compute.h" +#include "dihedral.h" #include "domain.h" #include "dump.h" +#include "error.h" #include "fix.h" #include "force.h" -#include "pair.h" -#include "pair_hybrid.h" -#include "bond.h" -#include "angle.h" -#include "dihedral.h" -#include "improper.h" #include "group.h" +#include "improper.h" #include "input.h" #include "modify.h" #include "neighbor.h" #include "output.h" +#include "pair.h" +#include "pair_hybrid.h" #include "region.h" #include "universe.h" -#include "variable.h" #include "update.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "variable.h" + +#include +#include +#include +#include +#include #ifdef _WIN32 #define PSAPI_VERSION 1 @@ -105,6 +103,8 @@ static const int STYLES = ATOM_STYLES | INTEGRATE_STYLES | MINIMIZE_STYLES | DUMP_STYLES | COMMAND_STYLES; } +using namespace LAMMPS_NS; + static const char *varstyles[] = { "index", "loop", "world", "universe", "uloop", "string", "getenv", "file", "atomfile", "format", "equal", "atom", "vector", "python", "internal", "(unknown)"}; @@ -116,17 +116,15 @@ static const char *commlayout[] = { "uniform", "nonuniform", "irregular" }; static const char bstyles[] = "pfsm"; -using namespace LAMMPS_NS; -using namespace std; +template +static void print_columns(FILE *fp, std::map *styles); template -static void print_columns(FILE* fp, map * styles); +static bool find_style(const LAMMPS *lmp, std::map *styles, + const std::string &name, bool suffix_check); template -static bool find_style(const LAMMPS * lmp, map * styles, const string & name, bool suffix_check); - -template -static vector get_style_names(map * styles); +static std::vector get_style_names(std::map *styles); /* ---------------------------------------------------------------------- */ @@ -261,15 +259,15 @@ void Info::command(int narg, char **arg) } } - if (out == NULL) return; + if (out == nullptr) return; fputs("\nInfo-Info-Info-Info-Info-Info-Info-Info-Info-Info-Info\n",out); - time_t now = time(NULL); + time_t now = time(nullptr); fmt::print(out,"Printed on {}\n",ctime(&now)); if (flags & CONFIG) { fmt::print(out,"\nLAMMPS version: {} / {}\n", - universe->version, universe->num_ver); + lmp->version, lmp->num_ver); if (lmp->has_git_info) fmt::print(out,"Git info: {} / {} / {}\n", @@ -317,47 +315,29 @@ void Info::command(int narg, char **arg) } if (flags & MEMORY) { + double meminfo[3]; + + get_memory_info(meminfo); fputs("\nMemory allocation information (MPI rank 0):\n\n",out); - - bigint bytes = 0; - bytes += atom->memory_usage(); - bytes += neighbor->memory_usage(); - bytes += comm->memory_usage(); - bytes += update->memory_usage(); - bytes += force->memory_usage(); - bytes += modify->memory_usage(); - for (int i = 0; i < output->ndump; i++) - bytes += output->dump[i]->memory_usage(); - double mbytes = bytes/1024.0/1024.0; - fmt::print(out,"Total dynamically allocated memory: {:.4} Mbyte\n",mbytes); + fmt::print(out,"Total dynamically allocated memory: {:.4} Mbyte\n", + meminfo[0]); #if defined(_WIN32) - HANDLE phandle = GetCurrentProcess(); - PROCESS_MEMORY_COUNTERS_EX pmc; - GetProcessMemoryInfo(phandle,(PROCESS_MEMORY_COUNTERS *)&pmc,sizeof(pmc)); - fmt::print(out,"Non-shared memory use: {:.4} Mbyte\n", - (double)pmc.PrivateUsage/1048576.0); - fmt::print(out,"Maximum working set size: {:.4} Mbyte\n", - (double)pmc.PeakWorkingSetSize/1048576.0); + fmt::print(out,"Non-shared memory use: {:.4} Mbyte\n",meminfo[1]); + fmt::print(out,"Maximum working set size: {:.4} Mbyte\n",meminfo[2]); #else #if defined(__linux__) - struct mallinfo mi; - mi = mallinfo(); fmt::print(out,"Current reserved memory pool size: {:.4} Mbyte\n", - (double)mi.uordblks/1048576.0+(double)mi.hblkhd/1048576.0); + meminfo[1]); #endif - struct rusage ru; - if (getrusage(RUSAGE_SELF, &ru) == 0) { - fmt::print(out,"Maximum resident set size: {:.4} Mbyte\n", - (double)ru.ru_maxrss/1024.0); - } + fmt::print(out,"Maximum resident set size: {:.4} Mbyte\n",meminfo[2]); #endif } if (flags & COMM) { int major,minor; - string version = get_mpi_info(major,minor); + std::string version = get_mpi_info(major,minor); fmt::print(out,"\nCommunication information:\n" "MPI library level: MPI v{}.{}\n" @@ -395,7 +375,7 @@ void Info::command(int narg, char **arg) fmt::print(out,"Atom map = {}\n", mapstyles[atom->map_style]); if (atom->molecular > 0) { const char *msg; - msg = (atom->molecular == 2) ? "template" : "standard"; + msg = (atom->molecular == Atom::TEMPLATE) ? "template" : "standard"; fmt::print(out,"Molecule type = {}\n",msg); } fmt::print(out,"Atoms = {:12}, types = {:8d}, style = {}\n", @@ -794,7 +774,7 @@ void Info::command_styles(FILE *out) bool Info::is_active(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; const char *style = "none"; if (strcmp(category,"package") == 0) { @@ -815,7 +795,7 @@ bool Info::is_active(const char *category, const char *name) else error->all(FLERR,"Unknown name for info newton category"); } else if (strcmp(category,"pair") == 0) { - if (force->pair == NULL) return false; + if (force->pair == nullptr) return false; if (strcmp(name,"single") == 0) return (force->pair->single_enable != 0); else if (strcmp(name,"respa") == 0) return (force->pair->respa_enable != 0); else if (strcmp(name,"manybody") == 0) return (force->pair->manybody_flag != 0); @@ -869,7 +849,7 @@ bool Info::is_active(const char *category, const char *name) bool Info::is_available(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; if (has_style(category, name)) { return true; @@ -899,7 +879,7 @@ bool Info::is_available(const char *category, const char *name) bool Info::is_defined(const char *category, const char *name) { - if ((category == NULL) || (name == NULL)) return false; + if ((category == nullptr) || (name == nullptr)) return false; if (strcmp(category,"compute") == 0) { int ncompute = modify->ncompute; @@ -949,7 +929,7 @@ bool Info::is_defined(const char *category, const char *name) return false; } -bool Info::has_style(const string & category, const string & name) +bool Info::has_style(const std::string &category, const std::string &name) { if ( category == "atom" ) { return find_style(lmp, atom->avec_map, name, false); @@ -983,7 +963,7 @@ bool Info::has_style(const string & category, const string & name) return false; } -vector Info::get_available_styles(const string & category) +std::vector Info::get_available_styles(const std::string &category) { if ( category == "atom" ) { return get_style_names(atom->avec_map); @@ -1014,13 +994,13 @@ vector Info::get_available_styles(const string & category) } else if( category == "command" ) { return get_style_names(input->command_map); } - return vector(); + return std::vector(); } template -static vector get_style_names(map * styles) +static std::vector get_style_names(std::map *styles) { - vector names; + std::vector names; names.reserve(styles->size()); for(auto const& kv : *styles) { @@ -1033,7 +1013,8 @@ static vector get_style_names(map * styles) } template -static bool find_style(const LAMMPS* lmp, map * styles, const string & name, bool suffix_check) +static bool find_style(const LAMMPS *lmp, std::map *styles, + const std::string &name, bool suffix_check) { if (styles->find(name) != styles->end()) { return true; @@ -1041,13 +1022,13 @@ static bool find_style(const LAMMPS* lmp, map * styles, const if (suffix_check && lmp->suffix_enable) { if (lmp->suffix) { - string name_w_suffix = name + "/" + lmp->suffix; + std::string name_w_suffix = name + "/" + lmp->suffix; if (find_style(lmp, styles, name_w_suffix, false)) { return true; } } if (lmp->suffix2) { - string name_w_suffix = name + "/" + lmp->suffix2; + std::string name_w_suffix = name + "/" + lmp->suffix2; if (find_style(lmp, styles, name_w_suffix, false)) { return true; } @@ -1057,7 +1038,7 @@ static bool find_style(const LAMMPS* lmp, map * styles, const } template -static void print_columns(FILE* fp, map * styles) +static void print_columns(FILE *fp, std::map *styles) { if (styles->empty()) { fprintf(fp, "\nNone"); @@ -1066,8 +1047,8 @@ static void print_columns(FILE* fp, map * styles) // std::map keys are already sorted int pos = 80; - for(typename map::iterator it = styles->begin(); it != styles->end(); ++it) { - const string & style_name = it->first; + for(typename std::map::iterator it = styles->begin(); it != styles->end(); ++it) { + const std::string &style_name = it->first; // skip "secret" styles if (isupper(style_name[0])) continue; @@ -1138,7 +1119,7 @@ bool Info::has_exceptions() { } bool Info::has_package(const char * package_name) { - for(int i = 0; LAMMPS::installed_packages[i] != NULL; ++i) { + for(int i = 0; LAMMPS::installed_packages[i] != nullptr; ++i) { if(strcmp(package_name, LAMMPS::installed_packages[i]) == 0) { return true; } @@ -1149,9 +1130,9 @@ bool Info::has_package(const char * package_name) { /* ---------------------------------------------------------------------- */ #define _INFOBUF_SIZE 256 -string Info::get_os_info() +std::string Info::get_os_info() { - string buf; + std::string buf; #if defined(_WIN32) DWORD fullversion,majorv,minorv,buildv=0; @@ -1191,9 +1172,9 @@ string Info::get_os_info() return buf; } -string Info::get_compiler_info() +std::string Info::get_compiler_info() { - string buf; + std::string buf; #if __clang__ buf = fmt::format("Clang C++ {}", __VERSION__); #elif __INTEL_COMPILER @@ -1208,7 +1189,7 @@ string Info::get_compiler_info() return buf; } -string Info::get_openmp_info() +std::string Info::get_openmp_info() { #if !defined(_OPENMP) @@ -1243,7 +1224,27 @@ string Info::get_openmp_info() #endif } -string Info::get_mpi_info(int &major, int &minor) +std::string Info::get_mpi_vendor() { + #if defined(MPI_STUBS) + return "MPI STUBS"; + #elif defined(OPEN_MPI) + return "Open MPI"; + #elif defined(MPICH_NAME) + return "MPICH"; + #elif defined(I_MPI_VERSION) + return "Intel MPI"; + #elif defined(PLATFORM_MPI) + return "Platform MPI"; + #elif defined(HP_MPI) + return "HP MPI"; + #elif defined(MSMPI_VER) + return "Microsoft MPI"; + #else + return "Unknown"; + #endif +} + +std::string Info::get_mpi_info(int &major, int &minor) { int len; #if (defined(MPI_VERSION) && (MPI_VERSION > 2)) || defined(MPI_STUBS) @@ -1259,10 +1260,10 @@ string Info::get_mpi_info(int &major, int &minor) char *ptr = strchr(version+80,'\n'); if (ptr) *ptr = '\0'; } - return string(version); + return std::string(version); } -string Info::get_cxx_info() +std::string Info::get_cxx_info() { #if __cplusplus > 201703L return "newer than C++17"; @@ -1281,6 +1282,41 @@ string Info::get_cxx_info() /* ---------------------------------------------------------------------- */ +void Info::get_memory_info(double *meminfo) +{ + double bytes = 0; + bytes += atom->memory_usage(); + bytes += neighbor->memory_usage(); + bytes += comm->memory_usage(); + bytes += update->memory_usage(); + bytes += force->memory_usage(); + bytes += modify->memory_usage(); + for (int i = 0; i < output->ndump; i++) + bytes += output->dump[i]->memory_usage(); + meminfo[0] = bytes/1024.0/1024.0; + meminfo[1] = 0; + meminfo[2] = 0; + +#if defined(_WIN32) + HANDLE phandle = GetCurrentProcess(); + PROCESS_MEMORY_COUNTERS_EX pmc; + GetProcessMemoryInfo(phandle,(PROCESS_MEMORY_COUNTERS *)&pmc,sizeof(pmc)); + meminfo[1] = (double)pmc.PrivateUsage/1048576.0; + meminfo[2] = (double)pmc.PeakWorkingSetSize/1048576.0; +#else +#if defined(__linux__) + struct mallinfo mi; + mi = mallinfo(); + meminfo[1] = (double)mi.uordblks/1048576.0+(double)mi.hblkhd/1048576.0; +#endif + struct rusage ru; + if (getrusage(RUSAGE_SELF, &ru) == 0) + meminfo[2] = (double)ru.ru_maxrss/1024.0; +#endif +} + +/* ---------------------------------------------------------------------- */ + char **Info::get_variable_names(int &num) { num = input->variable->nvar; return input->variable->names; diff --git a/src/info.h b/src/info.h index f57b94d102..e14a2be8db 100644 --- a/src/info.h +++ b/src/info.h @@ -21,7 +21,7 @@ CommandStyle(info,Info) #define LMP_INFO_H #include "pointers.h" -#include + #include namespace LAMMPS_NS { @@ -35,8 +35,8 @@ class Info : protected Pointers { bool is_defined(const char *, const char *); bool is_available(const char *, const char *); - bool has_style(const std::string & category, const std::string & name); - std::vector get_available_styles(const std::string & category); + bool has_style(const std::string &category, const std::string &name); + std::vector get_available_styles(const std::string &category); static bool has_gzip_support(); static bool has_png_support(); @@ -48,9 +48,11 @@ class Info : protected Pointers { static std::string get_os_info(); static std::string get_compiler_info(); static std::string get_openmp_info(); + static std::string get_mpi_vendor(); static std::string get_mpi_info(int &, int &); static std::string get_cxx_info(); + void get_memory_info(double *); char **get_variable_names(int &num); private: diff --git a/src/input.cpp b/src/input.cpp index dd640f18b0..420f840a14 100644 --- a/src/input.cpp +++ b/src/input.cpp @@ -12,45 +12,42 @@ ------------------------------------------------------------------------- */ #include "input.h" -#include -#include -#include -#include -#include -#include -#include -#include "style_command.h" -#include "universe.h" + +#include "accelerator_kokkos.h" +#include "angle.h" #include "atom.h" #include "atom_vec.h" +#include "bond.h" #include "comm.h" #include "comm_brick.h" #include "comm_tiled.h" -#include "group.h" -#include "domain.h" -#include "output.h" -#include "thermo.h" -#include "force.h" -#include "pair.h" -#include "min.h" -#include "modify.h" #include "compute.h" -#include "fix.h" -#include "bond.h" -#include "angle.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "group.h" #include "improper.h" #include "kspace.h" -#include "update.h" -#include "neighbor.h" -#include "special.h" -#include "timer.h" -#include "variable.h" -#include "accelerator_kokkos.h" -#include "error.h" #include "memory.h" -#include "utils.h" -#include "fmt/format.h" +#include "min.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" +#include "special.h" +#include "style_command.h" +#include "thermo.h" +#include "timer.h" +#include "universe.h" +#include "update.h" +#include "variable.h" + +#include +#include +#include +#include +#include #ifdef _WIN32 #include @@ -63,20 +60,51 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ +/** \class LAMMPS_NS::Input + * \brief Class for processing commands and input files + * +\verbatim embed:rst + +The Input class contains methods for reading, pre-processing and +parsing LAMMPS commands and input files and will dispatch commands +to the respective class instances or contains the code to execute +the commands directly. It also contains the instance of the +Variable class which performs computations and text substitutions. + +\endverbatim */ + +/** Input class constructor + * +\verbatim embed:rst + +This sets up the input processing, processes the *-var* and *-echo* +command line flags, holds the factory of commands and creates and +initializes an instance of the Variable class. + +To execute a command, a specific class instance, derived from +:cpp:class:`Pointers`, is created, then its ``command()`` member +function executed, and finally the class instance is deleted. + +\endverbatim + * + * \param lmp pointer to the base LAMMPS class + * \param argc number of entries in *argv* + * \param argv argument vector */ + Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) { MPI_Comm_rank(world,&me); maxline = maxcopy = maxwork = 0; - line = copy = work = NULL; + line = copy = work = nullptr; narg = maxarg = 0; - arg = NULL; + arg = nullptr; echo_screen = 0; echo_log = 1; label_active = 0; - labelstr = NULL; + labelstr = nullptr; jump_skip = 0; if (me == 0) { @@ -84,7 +112,7 @@ Input::Input(LAMMPS *lmp, int argc, char **argv) : Pointers(lmp) maxfile = 16; infiles = new FILE *[maxfile]; infiles[0] = infile; - } else infiles = NULL; + } else infiles = nullptr; variable = new Variable(lmp); @@ -140,10 +168,15 @@ Input::~Input() delete command_map; } -/* ---------------------------------------------------------------------- - process all input from infile - infile = stdin or file if command-line arg "-in" was used -------------------------------------------------------------------------- */ +/** Process all input from the ``FILE *`` pointer *infile* + * +\verbatim embed:rst + +This will read lines from *infile*, parse and execute them until the end +of the file is reached. The *infile* pointer will usually point to +``stdin`` or the input file given with the ``-in`` command line flag. + +\endverbatim */ void Input::file() { @@ -163,7 +196,7 @@ void Input::file() // end of file reached, so break // n == 0 if nothing read, else n = line with str terminator - if (fgets(&line[m],maxline-m,infile) == NULL) { + if (fgets(&line[m],maxline-m,infile) == nullptr) { if (m) n = strlen(line) + 1; else n = 0; break; @@ -219,7 +252,7 @@ void Input::file() // if no command, skip to next line in input script parse(); - if (command == NULL) continue; + if (command == nullptr) continue; // if scanning for label, skip command unless it's a label command @@ -232,10 +265,21 @@ void Input::file() } } -/* ---------------------------------------------------------------------- - process all input from file at filename - mostly called from library interface -------------------------------------------------------------------------- */ +/** Process all input from the file *filename* + * +\verbatim embed:rst + +This function opens the file at the path *filename*, put the current +file pointer stored in *infile* on a stack and instead assign *infile* +with the newly opened file pointer. Then it will call the +:cpp:func:`Input::file() ` function to read, +parse and execute the contents of that file. When the end of the file +is reached, it is closed and the previous file pointer from the infile +file pointer stack restored to *infile*. + +\endverbatim + * + * \param filename name of file with LAMMPS commands */ void Input::file(const char *filename) { @@ -248,7 +292,7 @@ void Input::file(const char *filename) error->one(FLERR,"Too many nested levels of input scripts"); infile = fopen(filename,"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", filename, utils::getsyserror())); @@ -266,11 +310,19 @@ void Input::file(const char *filename) } } -/* ---------------------------------------------------------------------- - invoke one command in single - first copy to line, then parse, then execute it - return command name to caller -------------------------------------------------------------------------- */ +/** Process a single command from a string in *single* + * +\verbatim embed:rst + +This function takes the text in *single*, makes a copy, parses that, +executes the command and returns the name of the command (without the +arguments). If there was no command in *single* it will return +``nullptr``. + +\endverbatim + * + * \param single string with LAMMPS command + * \return string with name of the parsed command w/o arguments */ char *Input::one(const std::string &single) { @@ -286,14 +338,14 @@ char *Input::one(const std::string &single) } // parse the line - // if no command, just return NULL + // if no command, just return a null pointer parse(); - if (command == NULL) return NULL; + if (command == nullptr) return nullptr; // if scanning for label, skip command unless it's a label command - if (label_active && strcmp(command,"label") != 0) return NULL; + if (label_active && strcmp(command,"label") != 0) return nullptr; // execute the command and return its name @@ -371,7 +423,7 @@ void Input::parse() char *next; command = nextword(copy,&next); - if (command == NULL) return; + if (command == nullptr) return; // point arg[] at each subsequent arg in copy string // nextword() inserts string terminators into copy string to delimit args @@ -398,7 +450,7 @@ void Input::parse() treat text between single/double/triple quotes as one arg matching quote must be followed by whitespace char if not end of string strip quotes from returned word - return ptr to start of word or NULL if no word in string + return ptr to start of word or null pointer if no word in string also return next = ptr after word ------------------------------------------------------------------------- */ @@ -409,16 +461,16 @@ char *Input::nextword(char *str, char **next) // start = first non-whitespace char start = &str[strspn(str," \t\n\v\f\r")]; - if (*start == '\0') return NULL; + if (*start == '\0') return nullptr; // if start is single/double/triple quote: // start = first char beyond quote // stop = first char of matching quote // next = first char beyond matching quote - // next must be NULL or whitespace + // next must be null char or whitespace // if start is not single/double/triple quote: // stop = first whitespace char after start - // next = char after stop, or stop itself if stop is NULL + // next = char after stop, or stop itself if stop is null char if (strstr(start,"\"\"\"") == start) { stop = strstr(&start[3],"\"\"\""); @@ -440,7 +492,7 @@ char *Input::nextword(char *str, char **next) else *next = stop+1; } - // set stop to NULL to terminate word + // set stop to null char to terminate word *stop = '\0'; return start; @@ -458,9 +510,9 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) // use str2 as scratch space to expand str, then copy back to str // reallocate str and str2 as necessary // do not replace $ inside single/double/triple quotes - // var = pts at variable name, ended by NULL - // if $ is followed by '{', trailing '}' becomes NULL - // else $x becomes x followed by NULL + // var = pts at variable name, ended by null char + // if $ is followed by '{', trailing '}' becomes null char + // else $x becomes x followed by null char // beyond = points to text following variable int i,n,paren_count; @@ -541,7 +593,7 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) value = variable->retrieve(var); } - if (value == NULL) + if (value == nullptr) error->one(FLERR,fmt::format("Substitution for illegal " "variable {}",var)); @@ -599,141 +651,6 @@ void Input::substitute(char *&str, char *&str2, int &max, int &max2, int flag) strcpy(str,str2); } -/* ---------------------------------------------------------------------- - expand arg to earg, for arguments with syntax c_ID[*] or f_ID[*] - fields to consider in input arg range from iarg to narg - return new expanded # of values, and copy them w/out "*" into earg - if any expansion occurs, earg is new allocation, must be freed by caller - if no expansion occurs, earg just points to arg, caller need not free -------------------------------------------------------------------------- */ - -int Input::expand_args(int narg, char **arg, int mode, char **&earg) -{ - int n,iarg,index,nlo,nhi,nmax,expandflag,icompute,ifix; - char *ptr1,*ptr2,*str; - - ptr1 = NULL; - for (iarg = 0; iarg < narg; iarg++) { - ptr1 = strchr(arg[iarg],'*'); - if (ptr1) break; - } - - if (!ptr1) { - earg = arg; - return narg; - } - - // maxarg should always end up equal to newarg, so caller can free earg - - int maxarg = narg-iarg; - earg = (char **) memory->smalloc(maxarg*sizeof(char *),"input:earg"); - - int newarg = 0; - for (iarg = 0; iarg < narg; iarg++) { - expandflag = 0; - - if (strncmp(arg[iarg],"c_",2) == 0 || - strncmp(arg[iarg],"f_",2) == 0) { - - ptr1 = strchr(&arg[iarg][2],'['); - if (ptr1) { - ptr2 = strchr(ptr1,']'); - if (ptr2) { - *ptr2 = '\0'; - if (strchr(ptr1,'*')) { - if (arg[iarg][0] == 'c') { - *ptr1 = '\0'; - icompute = modify->find_compute(&arg[iarg][2]); - *ptr1 = '['; - - // check for global vector/array, peratom array, local array - - if (icompute >= 0) { - if (mode == 0 && modify->compute[icompute]->vector_flag) { - nmax = modify->compute[icompute]->size_vector; - expandflag = 1; - } else if (mode == 1 && modify->compute[icompute]->array_flag) { - nmax = modify->compute[icompute]->size_array_cols; - expandflag = 1; - } else if (modify->compute[icompute]->peratom_flag && - modify->compute[icompute]->size_peratom_cols) { - nmax = modify->compute[icompute]->size_peratom_cols; - expandflag = 1; - } else if (modify->compute[icompute]->local_flag && - modify->compute[icompute]->size_local_cols) { - nmax = modify->compute[icompute]->size_local_cols; - expandflag = 1; - } - } - } else if (arg[iarg][0] == 'f') { - *ptr1 = '\0'; - ifix = modify->find_fix(&arg[iarg][2]); - *ptr1 = '['; - - // check for global vector/array, peratom array, local array - - if (ifix >= 0) { - if (mode == 0 && modify->fix[ifix]->vector_flag) { - nmax = modify->fix[ifix]->size_vector; - expandflag = 1; - } else if (mode == 1 && modify->fix[ifix]->array_flag) { - nmax = modify->fix[ifix]->size_array_cols; - expandflag = 1; - } else if (modify->fix[ifix]->peratom_flag && - modify->fix[ifix]->size_peratom_cols) { - nmax = modify->fix[ifix]->size_peratom_cols; - expandflag = 1; - } else if (modify->fix[ifix]->local_flag && - modify->fix[ifix]->size_local_cols) { - nmax = modify->fix[ifix]->size_local_cols; - expandflag = 1; - } - } - } - } - *ptr2 = ']'; - } - } - } - - if (expandflag) { - *ptr2 = '\0'; - force->bounds(FLERR,ptr1+1,nmax,nlo,nhi); - *ptr2 = ']'; - if (newarg+nhi-nlo+1 > maxarg) { - maxarg += nhi-nlo+1; - earg = (char **) - memory->srealloc(earg,maxarg*sizeof(char *),"input:earg"); - } - for (index = nlo; index <= nhi; index++) { - n = strlen(arg[iarg]) + 16; // 16 = space for large inserted integer - str = earg[newarg] = new char[n]; - strncpy(str,arg[iarg],ptr1+1-arg[iarg]); - sprintf(&str[ptr1+1-arg[iarg]],"%d",index); - strcat(str,ptr2); - newarg++; - } - - } else { - if (newarg == maxarg) { - maxarg++; - earg = (char **) - memory->srealloc(earg,maxarg*sizeof(char *),"input:earg"); - } - n = strlen(arg[iarg]) + 1; - earg[newarg] = new char[n]; - strcpy(earg[newarg],arg[iarg]); - newarg++; - } - } - - //printf("NEWARG %d\n",newarg); - //for (int i = 0; i < newarg; i++) - // printf(" arg %d: %s\n",i,earg[i]); - - return newarg; -} - /* ---------------------------------------------------------------------- return number of triple quotes in line ------------------------------------------------------------------------- */ @@ -1033,7 +950,7 @@ void Input::include() error->one(FLERR,"Too many nested levels of input scripts"); infile = fopen(arg[0],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[0], utils::getsyserror())); @@ -1067,7 +984,7 @@ void Input::jump() else { if (infile && infile != stdin) fclose(infile); infile = fopen(arg[0],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[0], utils::getsyserror())); @@ -1106,12 +1023,12 @@ void Input::log() if (me == 0) { if (logfile) fclose(logfile); - if (strcmp(arg[0],"none") == 0) logfile = NULL; + if (strcmp(arg[0],"none") == 0) logfile = nullptr; else { if (appendflag) logfile = fopen(arg[0],"a"); else logfile = fopen(arg[0],"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", arg[0], utils::getsyserror())); @@ -1139,15 +1056,15 @@ void Input::partition() else error->all(FLERR,"Illegal partition command"); int ilo,ihi; - force->bounds(FLERR,arg[1],universe->nworlds,ilo,ihi); + utils::bounds(FLERR,arg[1],1,universe->nworlds,ilo,ihi,error); // copy original line to copy, since will use strtok() on it // ptr = start of 4th word strcpy(copy,line); char *ptr = strtok(copy," \t\n\r\f"); - ptr = strtok(NULL," \t\n\r\f"); - ptr = strtok(NULL," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); + ptr = strtok(nullptr," \t\n\r\f"); ptr += strlen(ptr) + 1; ptr += strspn(ptr," \t\n\r\f"); @@ -1177,7 +1094,7 @@ void Input::print() // parse optional args - FILE *fp = NULL; + FILE *fp = nullptr; int screenflag = 1; int universeflag = 0; @@ -1186,10 +1103,10 @@ void Input::print() if (strcmp(arg[iarg],"file") == 0 || strcmp(arg[iarg],"append") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal print command"); if (me == 0) { - if (fp != NULL) fclose(fp); + if (fp != nullptr) fclose(fp); if (strcmp(arg[iarg],"file") == 0) fp = fopen(arg[iarg+1],"w"); else fp = fopen(arg[iarg+1],"a"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open print file {}: {}", arg[iarg+1], utils::getsyserror())); } @@ -1235,7 +1152,7 @@ void Input::python() void Input::quit() { if (narg == 0) error->done(0); // 1 would be fully backwards compatible - if (narg == 1) error->done(force->inumeric(FLERR,arg[0])); + if (narg == 1) error->done(utils::inumeric(FLERR,arg[0],false,lmp)); error->all(FLERR,"Illegal quit command"); } @@ -1317,12 +1234,11 @@ void Input::shell() } else if (strcmp(arg[0],"putenv") == 0) { if (narg < 2) error->all(FLERR,"Illegal shell putenv command"); for (int i = 1; i < narg; i++) { - char *ptr = strdup(arg[i]); rv = 0; #ifdef _WIN32 - if (ptr != NULL) rv = _putenv(ptr); + if (arg[i]) rv = _putenv(arg[i]); #else - if (ptr != NULL) rv = putenv(ptr); + if (arg[i]) rv = putenv(arg[i]); #endif rv = (rv < 0) ? errno : 0; MPI_Reduce(&rv,&err,1,MPI_INT,MPI_MAX,0,world); @@ -1374,7 +1290,7 @@ void Input::angle_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Angle_coeff command before simulation box is defined"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Angle_coeff command before angle_style is defined"); if (atom->avec->angles_allow == 0) error->all(FLERR,"Angle_coeff command when no angles allowed"); @@ -1415,7 +1331,7 @@ void Input::bond_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Bond_coeff command before simulation box is defined"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond_coeff command before bond_style is defined"); if (atom->avec->bonds_allow == 0) error->all(FLERR,"Bond_coeff command when no bonds allowed"); @@ -1439,7 +1355,7 @@ void Input::bond_write() { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Bond_write command when no bonds allowed"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Bond_write command before bond_style is defined"); else force->bond->write_file(narg,arg); } @@ -1509,7 +1425,7 @@ void Input::compute_modify() void Input::dielectric() { if (narg != 1) error->all(FLERR,"Illegal dielectric command"); - force->dielectric = force->numeric(FLERR,arg[0]); + force->dielectric = utils::numeric(FLERR,arg[0],false,lmp); } /* ---------------------------------------------------------------------- */ @@ -1518,7 +1434,7 @@ void Input::dihedral_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Dihedral_coeff command before simulation box is defined"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"Dihedral_coeff command before dihedral_style is defined"); if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Dihedral_coeff command when no dihedrals allowed"); @@ -1543,7 +1459,7 @@ void Input::dimension() if (narg != 1) error->all(FLERR,"Illegal dimension command"); if (domain->box_exist) error->all(FLERR,"Dimension command after simulation box is defined"); - domain->dimension = force->inumeric(FLERR,arg[0]); + domain->dimension = utils::inumeric(FLERR,arg[0],false,lmp); if (domain->dimension != 2 && domain->dimension != 3) error->all(FLERR,"Illegal dimension command"); @@ -1595,7 +1511,7 @@ void Input::improper_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Improper_coeff command before simulation box is defined"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"Improper_coeff command before improper_style is defined"); if (atom->avec->impropers_allow == 0) error->all(FLERR,"Improper_coeff command when no impropers allowed"); @@ -1617,7 +1533,7 @@ void Input::improper_style() void Input::kspace_modify() { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"KSpace style has not yet been set"); force->kspace->modify_params(narg,arg); } @@ -1733,7 +1649,7 @@ void Input::package() modify->add_fix(fixcmd); } else if (strcmp(arg[0],"kokkos") == 0) { - if (lmp->kokkos == NULL || lmp->kokkos->kokkos_exists == 0) + if (lmp->kokkos == nullptr || lmp->kokkos->kokkos_exists == 0) error->all(FLERR, "Package kokkos command without KOKKOS package enabled"); lmp->kokkos->accelerator(narg-1,&arg[1]); @@ -1765,7 +1681,7 @@ void Input::pair_coeff() { if (domain->box_exist == 0) error->all(FLERR,"Pair_coeff command before simulation box is defined"); - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_coeff command before pair_style is defined"); force->pair->coeff(narg,arg); } @@ -1774,7 +1690,7 @@ void Input::pair_coeff() void Input::pair_modify() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_modify command before pair_style is defined"); force->pair->modify_params(narg,arg); } @@ -1812,7 +1728,7 @@ void Input::pair_style() void Input::pair_write() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Pair_write command before pair_style is defined"); force->pair->write_file(narg,arg); } @@ -1874,7 +1790,7 @@ void Input::special_bonds() // if simulation box defined and saved values changed, redo special list - if (domain->box_exist && atom->molecular == 1) { + if (domain->box_exist && atom->molecular == Atom::MOLECULAR) { if (lj2 != force->special_lj[2] || lj3 != force->special_lj[3] || coul2 != force->special_coul[2] || coul3 != force->special_coul[3] || angle != force->special_angle || @@ -1953,7 +1869,8 @@ void Input::timer_command() void Input::timestep() { if (narg != 1) error->all(FLERR,"Illegal timestep command"); - update->dt = force->numeric(FLERR,arg[0]); + update->dt = utils::numeric(FLERR,arg[0],false,lmp); + update->dt_default = 0; } /* ---------------------------------------------------------------------- */ diff --git a/src/input.h b/src/input.h index a50f769561..b8ffb276f9 100644 --- a/src/input.h +++ b/src/input.h @@ -15,8 +15,8 @@ #define LMP_INPUT_H #include "pointers.h" + #include -#include namespace LAMMPS_NS { @@ -38,7 +38,6 @@ class Input : protected Pointers { char *one(const std::string&); // process a single command void substitute(char *&, char *&, int &, int &, int); // substitute for variables in a string - int expand_args(int, char **, int, char **&); // expand args due to wildcard void write_echo(const std::string &); // send text to active echo file pointers protected: diff --git a/src/integrate.cpp b/src/integrate.cpp index 1f50ff76c5..720e8ba276 100644 --- a/src/integrate.cpp +++ b/src/integrate.cpp @@ -25,8 +25,8 @@ using namespace LAMMPS_NS; Integrate::Integrate(LAMMPS *lmp, int /*narg*/, char **/*arg*/) : Pointers(lmp) { - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; external_force_clear = 0; } @@ -74,8 +74,8 @@ void Integrate::ev_setup() delete [] vlist_global; delete [] vlist_atom; delete [] cvlist_atom; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nelist_global = nelist_atom = 0; nvlist_global = nvlist_atom = ncvlist_atom = 0; diff --git a/src/integrate.h b/src/integrate.h index f07faacbfa..c9aa92e097 100644 --- a/src/integrate.h +++ b/src/integrate.h @@ -28,7 +28,7 @@ class Integrate : protected Pointers { virtual void run(int) = 0; virtual void cleanup() {} virtual void reset_dt() {} - virtual bigint memory_usage() {return 0;} + virtual double memory_usage() {return 0;} protected: int eflag,vflag; // flags for energy/virial computation diff --git a/src/irregular.cpp b/src/irregular.cpp index 2213b37d55..2581570986 100644 --- a/src/irregular.cpp +++ b/src/irregular.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "irregular.h" -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "domain.h" #include "comm.h" -#include "modify.h" +#include "domain.h" #include "fix.h" #include "memory.h" +#include "modify.h" + +#include using namespace LAMMPS_NS; @@ -30,7 +31,6 @@ using namespace LAMMPS_NS; int *Irregular::proc_recv_copy; static int compare_standalone(const void *, const void *); #else -#include "mergesort.h" // prototype for non-class function static int compare_standalone(const int, const int, void *); #endif @@ -52,15 +52,15 @@ Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp) // migrate work vectors maxlocal = 0; - mproclist = NULL; - msizes = NULL; + mproclist = nullptr; + msizes = nullptr; // send buffers maxdbuf = 0; - dbuf = NULL; + dbuf = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; // universal work vectors @@ -70,7 +70,7 @@ Irregular::Irregular(LAMMPS *lmp) : Pointers(lmp) // initialize buffers for migrate atoms, not used for datum comm // these can persist for multiple irregular operations - buf_send = buf_recv = NULL; + buf_send = buf_recv = nullptr; maxsend = maxrecv = BUFMIN; bufextra = BUFEXTRA; grow_send(maxsend,2); @@ -440,7 +440,7 @@ int Irregular::create_atom(int n, int *sizes, int *proclist, int sortflag) proc_recv_copy = proc_recv; qsort(order,nrecv_proc,sizeof(int),compare_standalone); #else - merge_sort(order,nrecv_proc,(void *)proc_recv,compare_standalone); + utils::merge_sort(order,nrecv_proc,(void *)proc_recv,compare_standalone); #endif int j; @@ -714,7 +714,7 @@ int Irregular::create_data(int n, int *proclist, int sortflag) proc_recv_copy = proc_recv; qsort(order,nrecv_proc,sizeof(int),compare_standalone); #else - merge_sort(order,nrecv_proc,(void *)proc_recv,compare_standalone); + utils::merge_sort(order,nrecv_proc,(void *)proc_recv,compare_standalone); #endif int j; @@ -888,7 +888,7 @@ int Irregular::create_data_grouped(int n, int *procs, int sortflag) proc_recv_copy = proc_recv; qsort(order,nrecv_proc,sizeof(int),compare_standalone); #else - merge_sort(order,nrecv_proc,(void *)proc_recv,compare_standalone); + utils::merge_sort(order,nrecv_proc,(void *)proc_recv,compare_standalone); #endif int j; @@ -1051,9 +1051,9 @@ void Irregular::grow_recv(int n) return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint Irregular::memory_usage() +double Irregular::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += maxsend*sizeof(double); // buf_send bytes += maxrecv*sizeof(double); // buf_recv bytes += maxdbuf*sizeof(double); // dbuf diff --git a/src/irregular.h b/src/irregular.h index 01fe40c46b..c6ea7bc691 100644 --- a/src/irregular.h +++ b/src/irregular.h @@ -30,13 +30,13 @@ class Irregular : protected Pointers { Irregular(class LAMMPS *); ~Irregular(); void migrate_atoms(int sortflag = 0, int preassign = 0, - int *procassign = NULL); + int *procassign = nullptr); int migrate_check(); int create_data(int, int *, int sortflag = 0); int create_data_grouped(int, int *, int sortflag = 0); void exchange_data(char *, int, char *); void destroy_data(); - bigint memory_usage(); + double memory_usage(); private: int me,nprocs; diff --git a/src/kspace.cpp b/src/kspace.cpp index 13be635794..117ae5465f 100644 --- a/src/kspace.cpp +++ b/src/kspace.cpp @@ -12,21 +12,19 @@ ------------------------------------------------------------------------- */ #include "kspace.h" -#include -#include -#include -#include -#include + #include "atom.h" -#include "comm.h" -#include "force.h" -#include "pair.h" -#include "memory.h" #include "atom_masks.h" -#include "error.h" -#include "suffix.h" +#include "comm.h" #include "domain.h" -#include "fmt/format.h" +#include "error.h" +#include "force.h" +#include "memory.h" +#include "pair.h" +#include "suffix.h" + +#include +#include using namespace LAMMPS_NS; @@ -88,8 +86,8 @@ KSpace::KSpace(LAMMPS *lmp) : Pointers(lmp) splittol = 1.0e-6; maxeatom = maxvatom = 0; - eatom = NULL; - vatom = NULL; + eatom = nullptr; + vatom = nullptr; execution_space = Host; datamask_read = ALL_MASK; @@ -190,7 +188,7 @@ void KSpace::compute_dummy(int eflag, int vflag) void KSpace::pair_check() { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"KSpace solver requires a pair style"); if (ewaldflag && !force->pair->ewaldflag) @@ -453,9 +451,9 @@ void KSpace::modify_params(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"mesh") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command"); - nx_pppm = nx_msm_max = force->inumeric(FLERR,arg[iarg+1]); - ny_pppm = ny_msm_max = force->inumeric(FLERR,arg[iarg+2]); - nz_pppm = nz_msm_max = force->inumeric(FLERR,arg[iarg+3]); + nx_pppm = nx_msm_max = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny_pppm = ny_msm_max = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz_pppm = nz_msm_max = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (nx_pppm == 0 && ny_pppm == 0 && nz_pppm == 0) gridflag = 0; else if (nx_pppm <= 0 || ny_pppm <= 0 || nz_pppm <= 0) @@ -465,9 +463,9 @@ void KSpace::modify_params(int narg, char **arg) iarg += 4; } else if (strcmp(arg[iarg],"mesh/disp") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal kspace_modify command"); - nx_pppm_6 = force->inumeric(FLERR,arg[iarg+1]); - ny_pppm_6 = force->inumeric(FLERR,arg[iarg+2]); - nz_pppm_6 = force->inumeric(FLERR,arg[iarg+3]); + nx_pppm_6 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + ny_pppm_6 = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + nz_pppm_6 = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (nx_pppm_6 == 0 && ny_pppm_6 == 0 && nz_pppm_6 == 0) gridflag_6 = 0; else if (nx_pppm_6 <= 0 || ny_pppm_6 <= 0 || nz_pppm_6 == 0) @@ -477,15 +475,15 @@ void KSpace::modify_params(int narg, char **arg) iarg += 4; } else if (strcmp(arg[iarg],"order") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - order = force->inumeric(FLERR,arg[iarg+1]); + order = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"order/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - order_6 = force->inumeric(FLERR,arg[iarg+1]); + order_6 = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"minorder") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - minorder = force->inumeric(FLERR,arg[iarg+1]); + minorder = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (minorder < 2) error->all(FLERR,"Illegal kspace_modify command"); iarg += 2; } else if (strcmp(arg[iarg],"overlap") == 0) { @@ -496,17 +494,17 @@ void KSpace::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"force") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - accuracy_absolute = force->numeric(FLERR,arg[iarg+1]); + accuracy_absolute = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"gewald") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - g_ewald = force->numeric(FLERR,arg[iarg+1]); + g_ewald = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (g_ewald == 0.0) gewaldflag = 0; else gewaldflag = 1; iarg += 2; } else if (strcmp(arg[iarg],"gewald/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal kspace_modify command"); - g_ewald_6 = force->numeric(FLERR,arg[iarg+1]); + g_ewald_6 = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (g_ewald_6 == 0.0) gewaldflag_6 = 0; else gewaldflag_6 = 1; iarg += 2; @@ -516,7 +514,7 @@ void KSpace::modify_params(int narg, char **arg) slabflag = 2; } else { slabflag = 1; - slab_volfactor = force->numeric(FLERR,arg[iarg+1]); + slab_volfactor = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (slab_volfactor <= 1.0) error->all(FLERR,"Bad kspace_modify slab parameter"); if (slab_volfactor < 2.0 && comm->me == 0) @@ -612,5 +610,5 @@ void KSpace::modify_params(int narg, char **arg) void *KSpace::extract(const char *str) { if (strcmp(str,"scale") == 0) return (void *) &scale; - return NULL; + return nullptr; } diff --git a/src/kspace.h b/src/kspace.h index e26b9490d6..110a790dfe 100644 --- a/src/kspace.h +++ b/src/kspace.h @@ -121,10 +121,10 @@ class KSpace : protected Pointers { virtual void compute(int, int) = 0; virtual void compute_group_group(int, int, int) {}; - virtual void pack_forward(int, FFT_SCALAR *, int, int *) {}; - virtual void unpack_forward(int, FFT_SCALAR *, int, int *) {}; - virtual void pack_reverse(int, FFT_SCALAR *, int, int *) {}; - virtual void unpack_reverse(int, FFT_SCALAR *, int, int *) {}; + virtual void pack_forward_grid(int, void *, int, int *) {}; + virtual void unpack_forward_grid(int, void *, int, int *) {}; + virtual void pack_reverse_grid(int, void *, int, int *) {}; + virtual void unpack_reverse_grid(int, void *, int, int *) {}; virtual int timing(int, double &, double &) {return 0;} virtual int timing_1d(int, double &) {return 0;} diff --git a/src/kspace_deprecated.cpp b/src/kspace_deprecated.cpp index 5dc2b50e2b..16e9ff6abb 100644 --- a/src/kspace_deprecated.cpp +++ b/src/kspace_deprecated.cpp @@ -16,11 +16,10 @@ ------------------------------------------------------------------------- */ #include "kspace_deprecated.h" -#include + #include "comm.h" #include "force.h" #include "error.h" -#include "utils.h" using namespace LAMMPS_NS; diff --git a/src/lammps.cpp b/src/lammps.cpp index ded9d93167..afe490c0a7 100644 --- a/src/lammps.cpp +++ b/src/lammps.cpp @@ -12,13 +12,7 @@ ------------------------------------------------------------------------- */ #include "lammps.h" -#include -#include -#include -#include -#include -#include -#include + #include "style_angle.h" // IWYU pragma: keep #include "style_atom.h" // IWYU pragma: keep #include "style_bond.h" // IWYU pragma: keep @@ -36,12 +30,12 @@ #include "universe.h" #include "input.h" #include "info.h" -#include "atom.h" +#include "atom.h" // IWYU pragma: keep #include "update.h" -#include "neighbor.h" +#include "neighbor.h" // IWYU pragma: keep #include "comm.h" #include "comm_brick.h" -#include "domain.h" +#include "domain.h" // IWYU pragma: keep #include "force.h" #include "modify.h" #include "group.h" @@ -54,8 +48,11 @@ #include "version.h" #include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" + +#include +#include +#include +#include #include "lmpinstalledpkgs.h" #include "lmpgitversion.h" @@ -83,31 +80,50 @@ struct LAMMPS_NS::package_styles_lists { using namespace LAMMPS_NS; -/* ---------------------------------------------------------------------- - start up LAMMPS - allocate fundamental classes (memory, error, universe, input) - parse input switches - initialize communicators, screen & logfile output - input is allocated at end after MPI info is setup -------------------------------------------------------------------------- */ +/** \class LAMMPS_NS::LAMMPS + * \brief LAMMPS simulation instance + * + * The LAMMPS class contains pointers of all constituent class instances + * and global variables that are used by a LAMMPS simulation. Its contents + * represent the entire state of the simulation. + * + * The LAMMPS class manages the components of an MD simulation by creating, + * deleting, and initializing instances of the classes it is composed of, + * processing command line flags, and providing access to some global properties. + * The specifics of setting up and running a simulation are handled by the + * individual component class instances. */ +/** Create a LAMMPS simulation instance + * + * The LAMMPS constructor starts up a simulation by allocating all + * fundamental classes in the necessary order, parses input switches + * and their arguments, initializes communicators, screen and logfile + * output FILE pointers. + * + * \param narg number of arguments + * \param arg list of arguments + * \param communicator MPI communicator used by this LAMMPS instance + */ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : - memory(NULL), error(NULL), universe(NULL), input(NULL), atom(NULL), - update(NULL), neighbor(NULL), comm(NULL), domain(NULL), force(NULL), - modify(NULL), group(NULL), output(NULL), timer(NULL), kokkos(NULL), - atomKK(NULL), memoryKK(NULL), python(NULL), citeme(NULL) + memory(nullptr), error(nullptr), universe(nullptr), input(nullptr), atom(nullptr), + update(nullptr), neighbor(nullptr), comm(nullptr), domain(nullptr), force(nullptr), + modify(nullptr), group(nullptr), output(nullptr), timer(nullptr), kokkos(nullptr), + atomKK(nullptr), memoryKK(nullptr), python(nullptr), citeme(nullptr) { memory = new Memory(this); error = new Error(this); universe = new Universe(this,communicator); + version = (const char *) LAMMPS_VERSION; + num_ver = utils::date2num(version); + clientserver = 0; - cslib = NULL; + cslib = nullptr; cscomm = 0; - screen = NULL; - logfile = NULL; - infile = NULL; + screen = nullptr; + logfile = nullptr; + infile = nullptr; initclock = MPI_Wtime(); @@ -157,19 +173,19 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : int citeflag = 1; int helpflag = 0; - suffix = suffix2 = NULL; + suffix = suffix2 = nullptr; suffix_enable = 0; if (arg) exename = arg[0]; - else exename = NULL; - packargs = NULL; + else exename = nullptr; + packargs = nullptr; num_package = 0; - char *restartfile = NULL; + char *restartfile = nullptr; int wfirst,wlast; int kkfirst,kklast; int npack = 0; - int *pfirst = NULL; - int *plast = NULL; + int *pfirst = nullptr; + int *plast = nullptr; iarg = 1; while (iarg < narg) { @@ -335,7 +351,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : error->universe_all(FLERR,"Invalid command-line argument"); delete [] suffix; delete [] suffix2; - suffix = suffix2 = NULL; + suffix = suffix2 = nullptr; suffix_enable = 1; // hybrid option to set fall-back for suffix2 if (strcmp(arg[iarg+1],"hybrid") == 0) { @@ -367,7 +383,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // if no partition command-line switch, universe is one world with all procs - if (universe->existflag == 0) universe->add_world(NULL); + if (universe->existflag == 0) universe->add_world(nullptr); // sum of procs in all worlds must equal total # of procs @@ -396,10 +412,10 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (screenflag == 0) universe->uscreen = stdout; else if (strcmp(arg[screenflag],"none") == 0) - universe->uscreen = NULL; + universe->uscreen = nullptr; else { universe->uscreen = fopen(arg[screenflag],"w"); - if (universe->uscreen == NULL) + if (universe->uscreen == nullptr) error->universe_one(FLERR,fmt::format("Cannot open universe screen " "file {}: {}",arg[screenflag], utils::getsyserror())); @@ -407,15 +423,15 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (logflag == 0) { if (helpflag == 0) { universe->ulogfile = fopen("log.lammps","w"); - if (universe->ulogfile == NULL) + if (universe->ulogfile == nullptr) error->universe_warn(FLERR,"Cannot open log.lammps for writing: " + utils::getsyserror()); } } else if (strcmp(arg[logflag],"none") == 0) - universe->ulogfile = NULL; + universe->ulogfile = nullptr; else { universe->ulogfile = fopen(arg[logflag],"w"); - if (universe->ulogfile == NULL) + if (universe->ulogfile == nullptr) error->universe_one(FLERR,fmt::format("Cannot open universe log " "file {}: {}",arg[logflag], utils::getsyserror())); @@ -424,8 +440,8 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (universe->me > 0) { if (screenflag == 0) universe->uscreen = stdout; - else universe->uscreen = NULL; - universe->ulogfile = NULL; + else universe->uscreen = nullptr; + universe->ulogfile = nullptr; } // make universe and single world the same, since no partition switch @@ -441,13 +457,13 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (universe->me == 0) { if (inflag == 0) infile = stdin; else infile = fopen(arg[inflag],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[inflag], utils::getsyserror())); } if ((universe->me == 0) && !helpflag) - utils::logmesg(this,fmt::format("LAMMPS ({})\n",universe->version)); + utils::logmesg(this,fmt::format("LAMMPS ({})\n",version)); // universe is one or more worlds, as setup by partition switch // split universe communicator into separate world communicators @@ -459,31 +475,31 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : MPI_Comm_split(universe->uworld,universe->iworld,0,&world); MPI_Comm_rank(world,&me); - screen = logfile = infile = NULL; + screen = logfile = infile = nullptr; if (me == 0) { std::string str; if (partscreenflag == 0) { if (screenflag == 0) { str = fmt::format("screen.{}",universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", str,utils::getsyserror())); } else if (strcmp(arg[screenflag],"none") == 0) { - screen = NULL; + screen = nullptr; } else { str = fmt::format("{}.{}",arg[screenflag],universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", arg[screenflag],utils::getsyserror())); } } else if (strcmp(arg[partscreenflag],"none") == 0) { - screen = NULL; + screen = nullptr; } else { str = fmt::format("{}.{}",arg[partscreenflag],universe->iworld); screen = fopen(str.c_str(),"w"); - if (screen == NULL) + if (screen == nullptr) error->one(FLERR,fmt::format("Cannot open screen file {}: {}", str,utils::getsyserror())); } @@ -492,30 +508,30 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if (logflag == 0) { str = fmt::format("log.lammps.{}",universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } else if (strcmp(arg[logflag],"none") == 0) { - logfile = NULL; + logfile = nullptr; } else { str = fmt::format("{}.{}",arg[logflag],universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } } else if (strcmp(arg[partlogflag],"none") == 0) { - logfile = NULL; + logfile = nullptr; } else { str = fmt::format("{}.{}",arg[partlogflag],universe->iworld); logfile = fopen(str.c_str(),"w"); - if (logfile == NULL) + if (logfile == nullptr) error->one(FLERR,fmt::format("Cannot open logfile {}: {}", str, utils::getsyserror())); } infile = fopen(arg[inflag],"r"); - if (infile == NULL) + if (infile == nullptr) error->one(FLERR,fmt::format("Cannot open input script {}: {}", arg[inflag], utils::getsyserror())); } @@ -525,15 +541,15 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : if ((universe->me == 0) && (!helpflag)) { const char fmt[] = "LAMMPS ({})\nRunning on {} partitions of processors\n"; if (universe->uscreen) - fmt::print(universe->uscreen,fmt,universe->version,universe->nworlds); + fmt::print(universe->uscreen,fmt,version,universe->nworlds); if (universe->ulogfile) - fmt::print(universe->ulogfile,fmt,universe->version,universe->nworlds); + fmt::print(universe->ulogfile,fmt,version,universe->nworlds); } if ((me == 0) && (!helpflag)) utils::logmesg(this,fmt::format("LAMMPS ({})\nProcessor partition = {}\n", - universe->version, universe->iworld)); + version, universe->iworld)); } // check consistency of datatype settings in lmptype.h @@ -577,7 +593,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // instantiation creates dummy Kokkos class if KOKKOS is not installed // add args between kkfirst and kklast to Kokkos instantiation - kokkos = NULL; + kokkos = nullptr; if (kokkosflag == 1) { kokkos = new KokkosLMP(this,kklast-kkfirst,&arg[kkfirst]); if (!kokkos->kokkos_exists) @@ -587,7 +603,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : // allocate CiteMe class if enabled if (citeflag) citeme = new CiteMe(this); - else citeme = NULL; + else citeme = nullptr; // allocate input class now that MPI is fully setup @@ -603,7 +619,7 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : packargs[i] = new char*[n+1]; for (int j=0; j < n; ++j) packargs[i][j] = strdup(arg[pfirst[i]+j]); - packargs[i][n] = NULL; + packargs[i][n] = nullptr; } memory->destroy(pfirst); memory->destroy(plast); @@ -639,14 +655,13 @@ LAMMPS::LAMMPS(int narg, char **arg, MPI_Comm communicator) : } } -/* ---------------------------------------------------------------------- - shutdown LAMMPS - delete top-level classes - close screen and log files in world and universe - output files were already closed in destroy() - delete fundamental classes -------------------------------------------------------------------------- */ - +/** Shut down a LAMMPS simulation instance + * + * The LAMMPS destructor shuts down the simulation by deleting top-level class + * instances, closing screen and log files for the global instance (aka "world") + * and files and MPI communicators in sub-partitions ("universes"). Then it + * deletes the fundamental class instances and copies of data inside the class. + */ LAMMPS::~LAMMPS() { const int me = comm->me; @@ -656,14 +671,14 @@ LAMMPS::~LAMMPS() if (num_package) { for (int i = 0; i < num_package; i++) { - for (char **ptr = packargs[i]; *ptr != NULL; ++ptr) + for (char **ptr = packargs[i]; *ptr != nullptr; ++ptr) free(*ptr); delete[] packargs[i]; } delete[] packargs; } num_package = 0; - packargs = NULL; + packargs = nullptr; double totalclock = MPI_Wtime() - initclock; if ((me == 0) && (screen || logfile)) { @@ -678,14 +693,14 @@ LAMMPS::~LAMMPS() if (universe->nworlds == 1) { if (screen && screen != stdout) fclose(screen); if (logfile) fclose(logfile); - logfile = NULL; - if (screen != stdout) screen = NULL; + logfile = nullptr; + if (screen != stdout) screen = nullptr; } else { if (screen && screen != stdout) fclose(screen); if (logfile) fclose(logfile); if (universe->ulogfile) fclose(universe->ulogfile); - logfile = NULL; - if (screen != stdout) screen = NULL; + logfile = nullptr; + if (screen != stdout) screen = nullptr; } if (infile && infile != stdin) fclose(infile); @@ -721,7 +736,7 @@ LAMMPS::~LAMMPS() void LAMMPS::create() { - force = NULL; // Domain->Lattice checks if Force exists + force = nullptr; // Domain->Lattice checks if Force exists // Comm class must be created before Atom class // so that nthreads is defined when create_avec invokes grow() @@ -743,9 +758,9 @@ void LAMMPS::create() else atom = new Atom(this); if (kokkos) - atom->create_avec("atomic/kk",0,NULL,1); + atom->create_avec("atomic/kk",0,nullptr,1); else - atom->create_avec("atomic",0,NULL,1); + atom->create_avec("atomic",0,nullptr,1); group = new Group(this); force = new Force(this); // must be after group, to create temperature @@ -787,7 +802,7 @@ void LAMMPS::post_create() if (strcmp(suffix,"intel") == 0 && !modify->check_package("INTEL")) error->all(FLERR,"Using suffix intel without USER-INTEL package installed"); if (strcmp(suffix,"kk") == 0 && - (kokkos == NULL || kokkos->kokkos_exists == 0)) + (kokkos == nullptr || kokkos->kokkos_exists == 0)) error->all(FLERR,"Using suffix kk without KOKKOS package enabled"); if (strcmp(suffix,"omp") == 0 && !modify->check_package("OMP")) error->all(FLERR,"Using suffix omp without USER-OMP package installed"); @@ -809,7 +824,7 @@ void LAMMPS::post_create() char str[256]; for (int i = 0; i < num_package; i++) { strcpy(str,"package"); - for (char **ptr = packargs[i]; *ptr != NULL; ++ptr) { + for (char **ptr = packargs[i]; *ptr != nullptr; ++ptr) { if (strlen(str) + strlen(*ptr) + 2 > 256) error->all(FLERR,"Too many -pk arguments in command line"); strcat(str," "); @@ -849,41 +864,41 @@ void LAMMPS::init() void LAMMPS::destroy() { delete update; - update = NULL; + update = nullptr; delete neighbor; - neighbor = NULL; + neighbor = nullptr; delete force; - force = NULL; + force = nullptr; delete group; - group = NULL; + group = nullptr; delete output; - output = NULL; + output = nullptr; delete modify; // modify must come after output, force, update // since they delete fixes - modify = NULL; + modify = nullptr; delete comm; // comm must come after modify // since fix destructors may access comm - comm = NULL; + comm = nullptr; delete domain; // domain must come after modify // since fix destructors access domain - domain = NULL; + domain = nullptr; delete atom; // atom must come after modify, neighbor // since fixes delete callbacks in atom - atom = NULL; + atom = nullptr; delete timer; - timer = NULL; + timer = nullptr; delete python; - python = NULL; + python = nullptr; } /* ---------------------------------------------------------------------- @@ -992,9 +1007,14 @@ void _noopt LAMMPS::init_pkg_lists() #undef REGION_CLASS } +/** Return true if a LAMMPS package is enabled in this binary + * + * \param pkg name of package + * \return true if yes, else false + */ bool LAMMPS::is_installed_pkg(const char *pkg) { - for (int i=0; installed_packages[i] != NULL; ++i) + for (int i=0; installed_packages[i] != nullptr; ++i) if (strcmp(installed_packages[i],pkg) == 0) return true; return false; @@ -1008,6 +1028,16 @@ bool LAMMPS::is_installed_pkg(const char *pkg) } \ } +/** \brief Return name of package that a specific style belongs to + * + * This function checks the given name against all list of styles + * for all type of styles and if the name and the style match, it + * returns which package this style belongs to. + * + * \param style Type of style (e.g. atom, pair, fix, etc.) + * \param name Name of style + * \return Name of the package this style is part of + */ const char *LAMMPS::match_style(const char *style, const char *name) { check_for_match(angle,style,name); @@ -1026,7 +1056,7 @@ const char *LAMMPS::match_style(const char *style, const char *name) check_for_match(pair,style,name); check_for_match(reader,style,name); check_for_match(region,style,name); - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1036,7 +1066,7 @@ const char *LAMMPS::match_style(const char *style, const char *name) void _noopt LAMMPS::help() { FILE *fp = screen; - const char *pager = NULL; + const char *pager = nullptr; // if output is "stdout", use a pipe to a pager for paged output. // this will avoid the most important help text to rush past the @@ -1045,7 +1075,7 @@ void _noopt LAMMPS::help() if (fp == stdout) { pager = getenv("PAGER"); - if (pager == NULL) pager = "more"; + if (pager == nullptr) pager = "more"; #if defined(_WIN32) fp = _popen(pager,"w"); #else @@ -1053,9 +1083,9 @@ void _noopt LAMMPS::help() #endif // reset to original state, if pipe command failed - if (fp == NULL) { + if (fp == nullptr) { fp = stdout; - pager = NULL; + pager = nullptr; } } @@ -1209,7 +1239,7 @@ void _noopt LAMMPS::help() // close pipe to pager, if active - if (pager != NULL) pclose(fp); + if (pager != nullptr) pclose(fp); } /* ---------------------------------------------------------------------- @@ -1282,7 +1312,7 @@ void LAMMPS::print_config(FILE *fp) sizeof(tagint)*8, sizeof(bigint)*8); fputs("\nInstalled packages:\n\n",fp); - for (int i = 0; NULL != (pkg = installed_packages[i]); ++i) { + for (int i = 0; nullptr != (pkg = installed_packages[i]); ++i) { ncword = strlen(pkg); if (ncline + ncword > 78) { ncline = 0; diff --git a/src/lammps.h b/src/lammps.h index dc2916f214..0d9442ffb9 100644 --- a/src/lammps.h +++ b/src/lammps.h @@ -38,6 +38,12 @@ class LAMMPS { class Output *output; // thermo/dump/restart class Timer *timer; // CPU timing info + const char *version; // LAMMPS version string = date + int num_ver; // numeric version id derived from *version* + // that is constructed so that will be greater + // for newer versions in numeric or string + // value comparisons + MPI_Comm world; // MPI communicator FILE *infile; // infile FILE *screen; // screen output @@ -85,8 +91,10 @@ class LAMMPS { struct package_styles_lists *pkg_lists; void init_pkg_lists(); void help(); - LAMMPS() {}; // prohibit using the default constructor - LAMMPS(const LAMMPS &) {}; // prohibit using the copy constructor + /// Default constructor. Declared private to prohibit its use + LAMMPS() {}; + /// Copy constructor. Declared private to prohibit its use + LAMMPS(const LAMMPS &) {}; }; } diff --git a/src/lattice.cpp b/src/lattice.cpp index 8ecf9fed73..625e243d64 100644 --- a/src/lattice.cpp +++ b/src/lattice.cpp @@ -12,17 +12,15 @@ ------------------------------------------------------------------------- */ #include "lattice.h" + +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "memory.h" +#include "update.h" + #include #include -#include -#include "update.h" -#include "domain.h" -#include "comm.h" -#include "force.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; @@ -33,7 +31,7 @@ using namespace LAMMPS_NS; Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) { nbasis = 0; - basis = NULL; + basis = nullptr; // parse style arg @@ -58,7 +56,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // before Force class is instantiated, just use atof() in that case if (force) - xlattice = ylattice = zlattice = force->numeric(FLERR,arg[1]); + xlattice = ylattice = zlattice = utils::numeric(FLERR,arg[1],false,lmp); else xlattice = ylattice = zlattice = atof(arg[1]); @@ -83,7 +81,7 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // scale = conversion factor between lattice and box units if (narg < 2) error->all(FLERR,"Illegal lattice command"); - scale = force->numeric(FLERR,arg[1]); + scale = utils::numeric(FLERR,arg[1],false,lmp); if (scale <= 0.0) error->all(FLERR,"Illegal lattice command"); // set basis atoms for each style @@ -150,9 +148,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) while (iarg < narg) { if (strcmp(arg[iarg],"origin") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); - origin[0] = force->numeric(FLERR,arg[iarg+1]); - origin[1] = force->numeric(FLERR,arg[iarg+2]); - origin[2] = force->numeric(FLERR,arg[iarg+3]); + origin[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + origin[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + origin[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (origin[0] < 0.0 || origin[0] >= 1.0 || origin[1] < 0.0 || origin[1] >= 1.0 || origin[2] < 0.0 || origin[2] >= 1.0) @@ -166,21 +164,21 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) else if (strcmp(arg[iarg+1],"y") == 0) dim = 1; else if (strcmp(arg[iarg+1],"z") == 0) dim = 2; else error->all(FLERR,"Illegal lattice command"); - int *orient = NULL; + int *orient = nullptr; if (dim == 0) orient = orientx; else if (dim == 1) orient = orienty; else if (dim == 2) orient = orientz; - orient[0] = force->inumeric(FLERR,arg[iarg+2]); - orient[1] = force->inumeric(FLERR,arg[iarg+3]); - orient[2] = force->inumeric(FLERR,arg[iarg+4]); + orient[0] = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + orient[1] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + orient[2] = utils::inumeric(FLERR,arg[iarg+4],false,lmp); iarg += 5; } else if (strcmp(arg[iarg],"spacing") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); spaceflag = 1; - xlattice = force->numeric(FLERR,arg[iarg+1]); - ylattice = force->numeric(FLERR,arg[iarg+2]); - zlattice = force->numeric(FLERR,arg[iarg+3]); + xlattice = utils::numeric(FLERR,arg[iarg+1],false,lmp); + ylattice = utils::numeric(FLERR,arg[iarg+2],false,lmp); + zlattice = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a1") == 0) { @@ -188,27 +186,27 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - a1[0] = force->numeric(FLERR,arg[iarg+1]); - a1[1] = force->numeric(FLERR,arg[iarg+2]); - a1[2] = force->numeric(FLERR,arg[iarg+3]); + a1[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + a1[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + a1[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a2") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - a2[0] = force->numeric(FLERR,arg[iarg+1]); - a2[1] = force->numeric(FLERR,arg[iarg+2]); - a2[2] = force->numeric(FLERR,arg[iarg+3]); + a2[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + a2[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + a2[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"a3") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal lattice command"); if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - a3[0] = force->numeric(FLERR,arg[iarg+1]); - a3[1] = force->numeric(FLERR,arg[iarg+2]); - a3[2] = force->numeric(FLERR,arg[iarg+3]); + a3[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + a3[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + a3[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"basis") == 0) { @@ -216,9 +214,9 @@ Lattice::Lattice(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) if (style != CUSTOM) error->all(FLERR, "Invalid option in lattice command for non-custom style"); - double x = force->numeric(FLERR,arg[iarg+1]); - double y = force->numeric(FLERR,arg[iarg+2]); - double z = force->numeric(FLERR,arg[iarg+3]); + double x = utils::numeric(FLERR,arg[iarg+1],false,lmp); + double y = utils::numeric(FLERR,arg[iarg+2],false,lmp); + double z = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (x < 0.0 || x >= 1.0 || y < 0.0 || y >= 1.0 || z < 0.0 || z >= 1.0) error->all(FLERR,"Illegal lattice command"); add_basis(x,y,z); diff --git a/src/library.cpp b/src/library.cpp index 2677d649e7..3192cf4eef 100644 --- a/src/library.cpp +++ b/src/library.cpp @@ -11,37 +11,40 @@ See the README file in the top-level LAMMPS directory. ------------------------------------------------------------------------- */ -// C or Fortran style library interface to LAMMPS -// customize by adding new LAMMPS-specific functions +// C style library interface to LAMMPS. +// See the manual for detailed documentation. #include "library.h" #include -#include -#include -#include -#include "universe.h" -#include "atom_vec.h" + #include "atom.h" +#include "atom_vec.h" +#include "comm.h" +#include "compute.h" #include "domain.h" -#include "update.h" +#include "dump.h" +#include "error.h" +#include "fix.h" +#include "fix_external.h" +#include "force.h" #include "group.h" +#include "info.h" #include "input.h" -#include "variable.h" +#include "memory.h" #include "modify.h" +#include "molecule.h" +#include "neigh_list.h" +#include "neighbor.h" +#include "region.h" #include "output.h" #include "thermo.h" -#include "compute.h" -#include "fix.h" -#include "comm.h" -#include "memory.h" -#include "error.h" -#include "force.h" -#include "info.h" -#include "fix_external.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" -#include "fmt/format.h" +#include "timer.h" +#include "universe.h" +#include "update.h" +#include "variable.h" + +#include +#include #if defined(LAMMPS_EXCEPTIONS) #include "exceptions.h" @@ -49,6 +52,17 @@ using namespace LAMMPS_NS; +// for printing the non-null pointer argument warning only once + +static int ptr_argument_flag = 1; +static void ptr_argument_warning() +{ + if (!ptr_argument_flag) return; + fprintf(stderr,"Using a 'void **' argument to return the LAMMPS handle " + "is deprecated. Please use the return value instead.\n"); + ptr_argument_flag = 0; +} + // ---------------------------------------------------------------------- // utility macros // ---------------------------------------------------------------------- @@ -70,11 +84,11 @@ using namespace LAMMPS_NS; #ifdef LAMMPS_EXCEPTIONS #define BEGIN_CAPTURE \ - Error * error = lmp->error; \ + Error *error = lmp->error; \ try #define END_CAPTURE \ - catch(LAMMPSAbortException & ae) { \ + catch(LAMMPSAbortException &ae) { \ int nprocs = 0; \ MPI_Comm_size(ae.universe, &nprocs ); \ \ @@ -83,7 +97,7 @@ using namespace LAMMPS_NS; } else { \ error->set_last_error(ae.message, ERROR_NORMAL); \ } \ - } catch(LAMMPSException & e) { \ + } catch(LAMMPSException &e) { \ error->set_last_error(e.message, ERROR_NORMAL); \ } #else @@ -92,166 +106,356 @@ using namespace LAMMPS_NS; #endif // ---------------------------------------------------------------------- -// helper functions, not in library API +// Library functions to create/destroy an instance of LAMMPS // ---------------------------------------------------------------------- -/* ---------------------------------------------------------------------- - concatenate one or more LAMMPS input lines starting at ptr - removes NULL terminator when last printable char of line = '&' - by replacing both NULL and '&' with space character - repeat as many times as needed - on return, ptr now points to longer line -------------------------------------------------------------------------- */ +/** Create instance of the LAMMPS class and return pointer to it. + * +\verbatim embed:rst -void concatenate_lines(char *ptr) +The :cpp:func:`lammps_open` function creates a new :cpp:class:`LAMMPS +` class instance while passing in a list of strings +as if they were :doc:`command-line arguments ` for the +LAMMPS executable, and an MPI communicator for LAMMPS to run under. +Since the list of arguments is **exactly** as when called from the +command line, the first argument would be the name of the executable and +thus is otherwise ignored. However ``argc`` may be set to 0 and then +``argv`` may be ``NULL``. If MPI is not yet initialized, ``MPI_Init()`` +will be called during creation of the LAMMPS class instance. + +If for some reason the creation or initialization of the LAMMPS instance +fails a null pointer is returned. + +.. versionchanged:: 18Sep2020 + + This function now has the pointer to the created LAMMPS class + instance as return value. For backward compatibility it is still + possible to provide the address of a pointer variable as final + argument *ptr*\ . + +.. deprecated:: 18Sep2020 + + The *ptr* argument will be removed in a future release of LAMMPS. + It should be set to ``NULL`` instead. + +.. note:: + + This function is not declared when the code linking to the LAMMPS + library interface is compiled with ``-DLAMMPS_LIB_NO_MPI``, or + contains a ``#define LAMMPS_LIB_NO_MPI 1`` statement before + ``#include "library.h"``. In that case, you must use the + :cpp:func:`lammps_open_no_mpi` function. + +*See also* + :cpp:func:`lammps_open_no_mpi`, :cpp:func:`lammps_open_fortran` + +\endverbatim + * + * \param argc number of command line arguments + * \param argv list of command line argument strings + * \param comm MPI communicator for this LAMMPS instance + * \param ptr pointer to a void pointer variable which serves + * as a handle; may be ``NULL`` + * \return pointer to new LAMMPS instance cast to ``void *`` */ + +void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr) { - int nend = strlen(ptr); - int n = nend-1; - while (n && isspace(ptr[n])) n--; - while (ptr[n] == '&') { - ptr[nend] = ' '; - ptr[n] = ' '; - strtok(ptr,"\n"); - nend = strlen(ptr); - n = nend-1; - while (n && isspace(ptr[n])) n--; - } -} + LAMMPS *lmp = nullptr; + lammps_mpi_init(); + if (ptr) ptr_argument_warning(); -// ---------------------------------------------------------------------- -// library API functions to create/destroy an instance of LAMMPS -// and communicate commands to it -// ---------------------------------------------------------------------- - -/* ---------------------------------------------------------------------- - create an instance of LAMMPS and return pointer to it - pass in command-line args and MPI communicator to run on -------------------------------------------------------------------------- */ - -void lammps_open(int argc, char **argv, MPI_Comm communicator, void **ptr) -{ #ifdef LAMMPS_EXCEPTIONS try { - LAMMPS *lmp = new LAMMPS(argc,argv,communicator); - *ptr = (void *) lmp; + lmp = new LAMMPS(argc, argv, comm); + if (ptr) *ptr = (void *) lmp; } - catch(LAMMPSException & e) { + catch(LAMMPSException &e) { fmt::print(stderr, "LAMMPS Exception: {}", e.message); - *ptr = (void *) NULL; + *ptr = nullptr; } #else - LAMMPS *lmp = new LAMMPS(argc,argv,communicator); - *ptr = (void *) lmp; + lmp = new LAMMPS(argc, argv, comm); + if (ptr) *ptr = (void *) lmp; #endif + return (void *) lmp; } -/* ---------------------------------------------------------------------- - create an instance of LAMMPS and return pointer to it - caller doesn't know MPI communicator, so use MPI_COMM_WORLD - initialize MPI if needed -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void lammps_open_no_mpi(int argc, char **argv, void **ptr) +/** Variant of ``lammps_open()`` that implicitly uses ``MPI_COMM_WORLD``. + * +\verbatim embed:rst + +This function is a version of :cpp:func:`lammps_open`, that is missing +the MPI communicator argument. It will use ``MPI_COMM_WORLD`` instead. +The type and purpose of arguments and return value are otherwise the +same. + +Outside of the convenience, this function is useful, when the LAMMPS +library was compiled in serial mode, but the calling code runs in +parallel and the ``MPI_Comm`` data type of the STUBS library would not +be compatible with that of the calling code. + +If for some reason the creation or initialization of the LAMMPS instance +fails a null pointer is returned. + +.. versionchanged:: 18Sep2020 + + This function now has the pointer to the created LAMMPS class + instance as return value. For backward compatibility it is still + possible to provide the address of a pointer variable as final + argument *ptr*\ . + +.. deprecated:: 18Sep2020 + + The *ptr* argument will be removed in a future release of LAMMPS. + It should be set to ``NULL`` instead. + + +*See also* + :cpp:func:`lammps_open`, :cpp:func:`lammps_open_fortran` + +\endverbatim + * + * \param argc number of command line arguments + * \param argv list of command line argument strings + * \param ptr pointer to a void pointer variable + * which serves as a handle; may be ``NULL`` + * \return pointer to new LAMMPS instance cast to ``void *`` */ + +void *lammps_open_no_mpi(int argc, char **argv, void **ptr) +{ + return lammps_open(argc,argv,MPI_COMM_WORLD,ptr); +} + +/* ---------------------------------------------------------------------- */ + +/** Variant of ``lammps_open()`` using a Fortran MPI communicator. + * +\verbatim embed:rst + +This function is a version of :cpp:func:`lammps_open`, that uses an +integer for the MPI communicator as the MPI Fortran interface does. It +is used in the :f:func:`lammps` constructor of the LAMMPS Fortran +module. Internally it converts the *f_comm* argument into a C-style MPI +communicator with ``MPI_Comm_f2c()`` and then calls +:cpp:func:`lammps_open`. + +If for some reason the creation or initialization of the LAMMPS instance +fails a null pointer is returned. + +.. versionadded:: 18Sep2020 + +*See also* + :cpp:func:`lammps_open_fortran`, :cpp:func:`lammps_open_no_mpi` + +\endverbatim + * + * \param argc number of command line arguments + * \param argv list of command line argument strings + * \param f_comm Fortran style MPI communicator for this LAMMPS instance + * \return pointer to new LAMMPS instance cast to ``void *`` */ + +void *lammps_open_fortran(int argc, char **argv, int f_comm) +{ + lammps_mpi_init(); + MPI_Comm c_comm = MPI_Comm_f2c((MPI_Fint)f_comm); + return lammps_open(argc, argv, c_comm, nullptr); +} + +/* ---------------------------------------------------------------------- */ + +/** Delete a LAMMPS instance created by lammps_open() or its variants. + * +\verbatim embed:rst + +This function deletes the LAMMPS class instance pointed to by ``handle`` +that was created by one of the :cpp:func:`lammps_open` variants. It +does **not** call ``MPI_Finalize()`` to allow creating and deleting +multiple LAMMPS instances concurrently or sequentially. See +:cpp:func:`lammps_mpi_finalize` for a function performing this operation. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance */ + +void lammps_close(void *handle) +{ + LAMMPS *lmp = (LAMMPS *) handle; + delete lmp; +} + +/* ---------------------------------------------------------------------- */ + +/** Ensure the MPI environment is initialized. + * +\verbatim embed:rst + +The MPI standard requires that any MPI application must call +``MPI_Init()`` exactly once before performing any other MPI function +calls. This function checks, whether MPI is already initialized and +calls ``MPI_Init()`` in case it is not. + +.. versionadded:: 18Sep2020 + +\endverbatim */ + +void lammps_mpi_init() { int flag; MPI_Initialized(&flag); if (!flag) { - int argc = 0; - char **argv = NULL; + // provide a dummy argc and argv for MPI_Init(). + int argc = 1; + char *args[] = { (char *)"liblammps" , nullptr }; + char **argv = args; MPI_Init(&argc,&argv); } - - MPI_Comm communicator = MPI_COMM_WORLD; - -#ifdef LAMMPS_EXCEPTIONS - try - { - LAMMPS *lmp = new LAMMPS(argc,argv,communicator); - *ptr = (void *) lmp; - } - catch(LAMMPSException & e) { - fmt::print(stderr, "LAMMPS Exception: {}", e.message); - *ptr = (void*) NULL; - } -#else - LAMMPS *lmp = new LAMMPS(argc,argv,communicator); - *ptr = (void *) lmp; -#endif } -/* ---------------------------------------------------------------------- - destruct an instance of LAMMPS -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void lammps_close(void *ptr) +/** Shut down the MPI infrastructure. + * +\verbatim embed:rst + +The MPI standard requires that any MPI application calls +``MPI_Finalize()`` before exiting. Even if a calling program does not +do any MPI calls, MPI is still initialized internally to avoid errors +accessing any MPI functions. This function should then be called right +before exiting the program to wait until all (parallel) tasks are +completed and then MPI is cleanly shut down. After this function no +more MPI calls may be made. + +.. versionadded:: 18Sep2020 + +\endverbatim */ + +void lammps_mpi_finalize() { - LAMMPS *lmp = (LAMMPS *) ptr; - delete lmp; + MPI_Barrier(MPI_COMM_WORLD); + MPI_Finalize(); } -/* ---------------------------------------------------------------------- - get the numerical representation of the current LAMMPS version -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -int lammps_version(void *ptr) +/** Free memory buffer allocated by LAMMPS. + * +\verbatim embed:rst + +Some of the LAMMPS C library interface functions return data as pointer +to a buffer that has been allocated by LAMMPS or the library interface. +This function can be used to delete those in order to avoid memory +leaks. + +\endverbatim + * + * \param ptr pointer to data allocated by LAMMPS */ + +void lammps_free(void *ptr) { - LAMMPS *lmp = (LAMMPS *) ptr; - return atoi(lmp->universe->num_ver); + free(ptr); } -/* ---------------------------------------------------------------------- - process an input script in filename str -------------------------------------------------------------------------- */ +// ---------------------------------------------------------------------- +// Library functions to process commands +// ---------------------------------------------------------------------- -void lammps_file(void *ptr, char *str) +/** Process LAMMPS input from a file. + * +\verbatim embed:rst + +This function processes commands in the file pointed to by *filename* +line by line and thus functions very similar to the :doc:`include +` command. The function returns when the end of the file is +reached and the commands have completed. + +The actual work is done by the functions +:cpp:func:`Input::file(const char *)` +and :cpp:func:`Input::file()`. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param filename name of a file with LAMMPS input */ + +void lammps_file(void *handle, const char *filename) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { if (lmp->update->whichflag != 0) - lmp->error->all(FLERR,"Library error: issuing LAMMPS command during run"); + lmp->error->all(FLERR,"Library error: issuing LAMMPS commands " + "during a run is not allowed."); else - lmp->input->file(str); + lmp->input->file(filename); } END_CAPTURE } -/* ---------------------------------------------------------------------- - process a single input command in str - does not matter if str ends in newline - return command name to caller -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -char *lammps_command(void *ptr, char *str) +/** Process a single LAMMPS input command from a string. + * +\verbatim embed:rst + +This function tells LAMMPS to execute the single command in the string +*cmd*. The entire string is considered as command and need not have a +(final) newline character. Newline characters in the body of the +string, however, will be treated as part of the command and will **not** +start a second command. The function :cpp:func:`lammps_commands_string` +processes a string with multiple command lines. + +The function returns the name of the command on success or ``NULL`` when +passing a string without a command. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param cmd string with a single LAMMPS command + * \return string with parsed command name or ``NULL`` */ + +char *lammps_command(void *handle, const char *cmd) { - LAMMPS *lmp = (LAMMPS *) ptr; - char *result = NULL; + LAMMPS *lmp = (LAMMPS *) handle; + char *result = nullptr; BEGIN_CAPTURE { if (lmp->update->whichflag != 0) - lmp->error->all(FLERR,"Library error: issuing LAMMPS command during run"); + lmp->error->all(FLERR,"Library error: issuing LAMMPS commands " + "during a run is not allowed."); else - result = lmp->input->one(str); + result = lmp->input->one(cmd); } END_CAPTURE return result; } -/* ---------------------------------------------------------------------- - process multiple input commands in cmds = list of strings - does not matter if each string ends in newline - create long contatentated string for processing by commands_string() - insert newlines in concatenated string as needed -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void lammps_commands_list(void *ptr, int ncmd, char **cmds) +/** Process multiple LAMMPS input commands from list of strings. + * +\verbatim embed:rst + +This function processes multiple commands from a list of strings by +first concatenating the individual strings in *cmds* into a single +string, inserting newline characters as needed. The combined string +is passed to :cpp:func:`lammps_commands_string` for processing. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param ncmd number of lines in *cmds* + * \param cmds list of strings with LAMMPS commands */ + +void lammps_commands_list(void *handle, int ncmd, const char **cmds) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; int n = ncmd+1; for (int i = 0; i < ncmd; i++) n += strlen(cmds[i]); @@ -270,19 +474,37 @@ void lammps_commands_list(void *ptr, int ncmd, char **cmds) } } - lammps_commands_string(ptr,str); + lammps_commands_string(handle,str); lmp->memory->sfree(str); } -/* ---------------------------------------------------------------------- - process multiple input commands in single long str, separated by newlines - single command can span multiple lines via continuation characters - multi-line commands enabled by triple quotes will not work -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void lammps_commands_string(void *ptr, char *str) +/** Process a block of LAMMPS input commands from a single string. + * +\verbatim embed:rst + +This function processes a multi-line string similar to a block of +commands from a file. The string may have multiple lines (separated by +newline characters) and also single commands may be distributed over +multiple lines with continuation characters ('&'). Those lines are +combined by removing the '&' and the following newline character. After +this processing the string is handed to LAMMPS for parsing and +executing. + +.. note:: + + Multi-line commands enabled by triple quotes will NOT work with + this function. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param str string with block of LAMMPS input commands */ + +void lammps_commands_string(void *handle, const char *str) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; // make copy of str so can strtok() it @@ -318,56 +540,625 @@ void lammps_commands_string(void *ptr, char *str) delete [] copy; } -/* ---------------------------------------------------------------------- - clean-up function to free memory allocated by lib and returned to caller -------------------------------------------------------------------------- */ +// ----------------------------------------------------------------------- +// Library functions to extract info from LAMMPS or set data in LAMMPS +// ----------------------------------------------------------------------- -void lammps_free(void *ptr) +/** Get numerical representation of the LAMMPS version date. + * +\verbatim embed:rst + +The :cpp:func:`lammps_version` function returns an integer representing +the version of the LAMMPS code in the format YYYYMMDD. This can be used +to implement backward compatibility in software using the LAMMPS library +interface. The specific format guarantees, that this version number is +growing with every new LAMMPS release. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \return an integer representing the version data in the + * format YYYYMMDD */ + +int lammps_version(void *handle) { - free(ptr); + LAMMPS *lmp = (LAMMPS *) handle; + return lmp->num_ver; } -// ---------------------------------------------------------------------- -// library API functions to extract info from LAMMPS or set info in LAMMPS -// ---------------------------------------------------------------------- +/* ---------------------------------------------------------------------- */ -/* ---------------------------------------------------------------------- - add LAMMPS-specific library functions - all must receive LAMMPS pointer as argument - customize by adding a function here and in library.h header file -------------------------------------------------------------------------- */ +/** Get memory usage information + * +\verbatim embed:rst -/* ---------------------------------------------------------------------- - extract a LAMMPS setting as an integer - only use for settings that require return of an int - customize by adding names -------------------------------------------------------------------------- */ +This function will retrieve memory usage information for the current +LAMMPS instance or process. The *meminfo* buffer will be filled with +3 different numbers (if supported by the operating system). The first +is the tally (in MBytes) of all large memory allocations made by LAMMPS. +This is a lower boundary of how much memory is requested and does not +account for memory allocated on the stack or allocations via ``new``. +The second number is the current memory allocation of the current process +as returned by a memory allocation reporting in the system library. The +third number is the maximum amount of RAM (not swap) used by the process +so far. If any of the two latter parameters is not supported by the operating +system it will be set to zero. -int lammps_extract_setting(void * /*ptr*/, char *name) +.. versionadded:: 18Sep2020 + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param meminfo buffer with space for at least 3 double to store + * data in. */ + +void lammps_memory_usage(void *handle, double *meminfo) { - if (strcmp(name,"bigint") == 0) return sizeof(bigint); - if (strcmp(name,"tagint") == 0) return sizeof(tagint); - if (strcmp(name,"imageint") == 0) return sizeof(imageint); + LAMMPS *lmp = (LAMMPS *) handle; + Info info(lmp); + info.get_memory_info(meminfo); +} + +/* ---------------------------------------------------------------------- */ + +/** Return current LAMMPS world communicator as integer + * +\verbatim embed:rst + +This will take the LAMMPS "world" communicator and convert it to an +integer using ``MPI_Comm_c2f()``, so it is equivalent to the +corresponding MPI communicator in Fortran. This way it can be safely +passed around between different programming languages. To convert it +to the C language representation use ``MPI_Comm_f2c()``. + +If LAMMPS was compiled with MPI_STUBS, this function returns -1. + +.. versionadded:: 18Sep2020 + +*See also* + :cpp:func:`lammps_open_fortran` + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \return Fortran representation of the LAMMPS world communicator */ + +int lammps_get_mpi_comm(void *handle) +{ +#ifdef MPI_STUBS + return -1; +#else + LAMMPS *lmp = (LAMMPS *) handle; + MPI_Fint f_comm = MPI_Comm_c2f(lmp->world); + return f_comm; +#endif +} + +/* ---------------------------------------------------------------------- */ + +/** Return the total number of atoms in the system. + * +\verbatim embed:rst + +This number may be very large when running large simulations across +multiple processors. Depending on compile time choices, LAMMPS may be +using either 32-bit or a 64-bit integer to store this number. For +portability this function returns thus a double precision +floating point number, which can represent up to a 53-bit signed +integer exactly (:math:`\approx 10^{16}`). + +As an alternative, you can use :cpp:func:`lammps_extract_global` +and cast the resulting pointer to an integer pointer of the correct +size and dereference it. The size of that integer (in bytes) can be +queried by calling :cpp:func:`lammps_extract_setting` to return +the size of a ``bigint`` integer. + +.. versionchanged:: 18Sep2020 + + The type of the return value was changed from ``int`` to ``double`` + to accommodate reporting atom counts for larger systems that would + overflow a 32-bit int without having to depend on a 64-bit bit + integer type definition. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \return total number of atoms or 0 if value is too large */ + +double lammps_get_natoms(void *handle) +{ + LAMMPS *lmp = (LAMMPS *) handle; + + double natoms = static_cast(lmp->atom->natoms); + if (natoms > 9.0e15) return 0; // TODO:XXX why not -1? + return natoms; +} + +/* ---------------------------------------------------------------------- */ + +/** Get current value of a thermo keyword. + * +\verbatim embed:rst + +This function returns the current value of a :doc:`thermo keyword +`. Unlike :cpp:func:`lammps_extract_global` it does not +give access to the storage of the desired data but returns its value as +a ``double``, so it can also return information that is computed on-the-fly. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param keyword string with the name of the thermo keyword + * \return value of the requested thermo property or 0.0 */ + +double lammps_get_thermo(void *handle, const char *keyword) +{ + LAMMPS *lmp = (LAMMPS *) handle; + double dval = 0.0; + + BEGIN_CAPTURE + { + lmp->output->thermo->evaluate_keyword(keyword,&dval); + } + END_CAPTURE + + return dval; +} + +/* ---------------------------------------------------------------------- */ + +/** Extract simulation box parameters. + * +\verbatim embed:rst + +This function (re-)initializes the simulation box and boundary +information and then assign the designated data to the locations in the +pointers passed as arguments. Any argument (except the first) may be +a NULL pointer and then will not be assigned. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param boxlo pointer to 3 doubles where the lower box boundary is stored + * \param boxhi pointer to 3 doubles where the upper box boundary is stored + * \param xy pointer to a double where the xy tilt factor is stored + * \param yz pointer to a double where the yz tilt factor is stored + * \param xz pointer to a double where the xz tilt factor is stored + * \param pflags pointer to 3 ints, set to 1 for periodic boundaries + and 0 for non-periodic + * \param boxflag pointer to an int, which is set to 1 if the box will be + * changed during a simulation by a fix and 0 if not. */ + +void lammps_extract_box(void *handle, double *boxlo, double *boxhi, + double *xy, double *yz, double *xz, + int *pflags, int *boxflag) +{ + LAMMPS *lmp = (LAMMPS *) handle; + Domain *domain = lmp->domain; + + BEGIN_CAPTURE + { + // do nothing if box does not yet exist + if ((lmp->domain->box_exist == 0) + && (lmp->comm->me == 0)) { + lmp->error->warning(FLERR,"Calling lammps_extract_box without a box"); + return; + } + + // domain->init() is needed to update domain->box_change + domain->init(); + + if (boxlo) { + boxlo[0] = domain->boxlo[0]; + boxlo[1] = domain->boxlo[1]; + boxlo[2] = domain->boxlo[2]; + } + if (boxhi) { + boxhi[0] = domain->boxhi[0]; + boxhi[1] = domain->boxhi[1]; + boxhi[2] = domain->boxhi[2]; + } + if (xy) *xy = domain->xy; + if (yz) *yz = domain->yz; + if (xz) *xz = domain->xz; + + if (pflags) { + pflags[0] = domain->periodicity[0]; + pflags[1] = domain->periodicity[1]; + pflags[2] = domain->periodicity[2]; + } + if (boxflag) *boxflag = domain->box_change; + } + END_CAPTURE +} + +/* ---------------------------------------------------------------------- */ + +/** Reset simulation box parameters. + * +\verbatim embed:rst + +This function sets the simulation box dimensions (upper and lower bounds +and tilt factors) from the provided data and then re-initializes the box +information and all derived settings. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param boxlo pointer to 3 doubles containing the lower box boundary + * \param boxhi pointer to 3 doubles containing the upper box boundary + * \param xy xy tilt factor + * \param yz yz tilt factor + * \param xz xz tilt factor */ + +void lammps_reset_box(void *handle, double *boxlo, double *boxhi, + double xy, double yz, double xz) +{ + LAMMPS *lmp = (LAMMPS *) handle; + Domain *domain = lmp->domain; + + BEGIN_CAPTURE + { + // error if box does not exist + if ((lmp->domain->box_exist == 0) + && (lmp->comm->me == 0)) { + lmp->error->warning(FLERR,"Calling lammps_reset_box without a box"); + return; + } + domain->boxlo[0] = boxlo[0]; + domain->boxlo[1] = boxlo[1]; + domain->boxlo[2] = boxlo[2]; + domain->boxhi[0] = boxhi[0]; + domain->boxhi[1] = boxhi[1]; + domain->boxhi[2] = boxhi[2]; + + domain->xy = xy; + domain->yz = yz; + domain->xz = xz; + + domain->set_global_box(); + lmp->comm->set_proc_grid(); + domain->set_local_box(); + } + END_CAPTURE +} + +/* ---------------------------------------------------------------------- */ + +/** Query LAMMPS about global settings. + * +\verbatim embed:rst + +This function will retrieve or compute global properties. In contrast to +:cpp:func:`lammps_get_thermo` this function returns an ``int``. The +following keywords are currently supported. If a keyword is not +recognized, the function returns -1. + +.. list-table:: + :header-rows: 1 + :widths: auto + + * - Keyword + - Description / Return value + * - bigint + - size of the ``bigint`` integer type, 4 or 8 bytes. + Set at :ref:`compile time `. + * - tagint + - size of the ``tagint`` integer type, 4 or 8 bytes. + Set at :ref:`compile time `. + * - imageint + - size of the ``imageint`` integer type, 4 or 8 bytes. + Set at :ref:`compile time `. + * - dimension + - Number of dimensions: 2 or 3. See :doc:`dimension`. + * - box_exist + - 1 if the simulation box is defined, 0 if not. + See :doc:`create_box`. + * - triclinic + - 1 if the the simulation box is triclinic, 0 if orthogonal. + See :doc:`change_box`. + * - nlocal + - number of "owned" atoms of the current MPI rank. + * - nghost + - number of "ghost" atoms of the current MPI rank. + * - nall + - number of all "owned" and "ghost" atoms of the current MPI rank. + * - nmax + - maximum of nlocal+nghost across all MPI ranks (for per-atom data array size). + * - ntypes + - number of atom types + * - molecule_flag + - 1 if the atom style includes molecular topology data. See :doc:`atom_style`. + * - q_flag + - 1 if the atom style includes point charges. See :doc:`atom_style`. + * - mu_flag + - 1 if the atom style includes point dipoles. See :doc:`atom_style`. + * - rmass_flag + - 1 if the atom style includes per-atom masses, 0 if there are per-type masses. See :doc:`atom_style`. + +*See also* + :cpp:func:`lammps_extract_global` + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param keyword string with the name of the thermo keyword + * \return value of the queried setting or -1 if unknown */ + +int lammps_extract_setting(void *handle, const char *keyword) +{ + LAMMPS *lmp = (LAMMPS *) handle; + +// This can be customized by adding keywords and documenting them in the section above. + if (strcmp(keyword,"bigint") == 0) return sizeof(bigint); + if (strcmp(keyword,"tagint") == 0) return sizeof(tagint); + if (strcmp(keyword,"imageint") == 0) return sizeof(imageint); + + if (strcmp(keyword,"dimension") == 0) return lmp->domain->dimension; + if (strcmp(keyword,"box_exist") == 0) return lmp->domain->box_exist; + if (strcmp(keyword,"triclinic") == 0) return lmp->domain->triclinic; + + if (strcmp(keyword,"nlocal") == 0) return lmp->atom->nlocal; + if (strcmp(keyword,"nghost") == 0) return lmp->atom->nghost; + if (strcmp(keyword,"nall") == 0) return lmp->atom->nlocal+lmp->atom->nghost; + if (strcmp(keyword,"nmax") == 0) return lmp->atom->nmax; + if (strcmp(keyword,"ntypes") == 0) return lmp->atom->ntypes; + + if (strcmp(keyword,"molecule_flag") == 0) return lmp->atom->molecule_flag; + if (strcmp(keyword,"q_flag") == 0) return lmp->atom->q_flag; + if (strcmp(keyword,"mu_flag") == 0) return lmp->atom->mu_flag; + if (strcmp(keyword,"rmass_flag") == 0) return lmp->atom->rmass_flag; return -1; } -/* ---------------------------------------------------------------------- - extract a pointer to an internal LAMMPS global entity - name = desired quantity, e.g. dt or boxyhi or natoms - returns a void pointer to the entity - which the caller can cast to the proper data type - returns a NULL if name not listed below - this function need only be invoked once - the returned pointer is a permanent valid reference to the quantity - customize by adding names -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void *lammps_extract_global(void *ptr, char *name) +/** Get pointer to internal global LAMMPS variables or arrays. + * +\verbatim embed:rst + +This function returns a pointer to the location of some global property +stored in one of the constituent classes of a LAMMPS instance. The +returned pointer is cast to ``void *`` and needs to be cast to a pointer +of the type that the entity represents. The pointers returned by this +function are generally persistent; therefore it is not necessary to call +the function again, unless a :doc:`clear` command is issued which wipes +out and recreates the contents of the :cpp:class:`LAMMPS +` class. + +Please also see :cpp:func:`lammps_extract_setting`, +:cpp:func:`lammps_get_thermo`, and :cpp:func:`lammps_extract_box`. + +.. warning:: + + Modifying the data in the location pointed to by the returned pointer + may lead to inconsistent internal data and thus may cause failures or + crashes or bogus simulations. In general it is thus usually better + to use a LAMMPS input command that sets or changes these parameters. + Those will takes care of all side effects and necessary updates of + settings derived from such settings. Where possible a reference to + such a command or a relevant section of the manual is given below. + +This table lists the supported names, their data types, length of the +data area, and a short description. The ``bigint`` type may be defined +to be either an ``int`` or an ``int64_t``. This is selected at +:ref:`compile time ` and can be queried through calling +:cpp:func:`lammps_extract_setting`. + +.. list-table:: + :header-rows: 1 + :widths: auto + + * - Name + - Type + - Length + - Description + * - units + - char \* + - 1 + - string with the current unit style. See :doc:`units`. + * - dt + - double + - 1 + - length of the time step. See :doc:`timestep`. + * - ntimestep + - bigint + - 1 + - current time step number. See :doc:`reset_timestep`. + * - boxlo + - double + - 3 + - lower box boundaries. See :doc:`create_box`. + * - boxhi + - double + - 3 + - upper box boundaries. See :doc:`create_box`. + * - boxxlo + - double + - 1 + - lower box boundary in x-direction. See :doc:`create_box`. + * - boxxhi + - double + - 1 + - upper box boundary in x-direction. See :doc:`create_box`. + * - boxylo + - double + - 1 + - lower box boundary in y-direction. See :doc:`create_box`. + * - boxyhi + - double + - 1 + - upper box boundary in y-direction. See :doc:`create_box`. + * - boxzlo + - double + - 1 + - lower box boundary in z-direction. See :doc:`create_box`. + * - boxzhi + - double + - 1 + - upper box boundary in z-direction. See :doc:`create_box`. + * - periodicity + - int + - 3 + - 0 if non-periodic, 1 if periodic for x, y, and z; + See :doc:`boundary`. + * - triclinic + - int + - 1 + - 1 if the the simulation box is triclinic, 0 if orthogonal; + See :doc:`change_box`. + * - xy + - double + - 1 + - triclinic tilt factor. See :doc:`Howto_triclinic`. + * - yz + - double + - 1 + - triclinic tilt factor. See :doc:`Howto_triclinic`. + * - xz + - double + - 1 + - triclinic tilt factor. See :doc:`Howto_triclinic`. + * - natoms + - bigint + - 1 + - total number of atoms in the simulation. + * - nbonds + - bigint + - 1 + - total number of bonds in the simulation. + * - nangles + - bigint + - 1 + - total number of angles in the simulation. + * - ndihedrals + - bigint + - 1 + - total number of dihedrals in the simulation. + * - nimpropers + - bigint + - 1 + - total number of impropers in the simulation. + * - nlocal + - int + - 1 + - number of "owned" atoms of the current MPI rank. + * - nghost + - int + - 1 + - number of "ghost" atoms of the current MPI rank. + * - nmax + - int + - 1 + - maximum of nlocal+nghost across all MPI ranks (for per-atom data array size). + * - ntypes + - int + - 1 + - number of atom types + * - q_flag + - int + - 1 + - 1 if the atom style includes point charges. See :doc:`atom_style`. + * - atime + - double + - 1 + - accumulated simulation time in time units. + * - atimestep + - bigint + - 1 + - the number of the timestep when "atime" was last updated. + * - boltz + - double + - 1 + - value of the "boltz" constant. See :doc:`units`. + * - hplanck + - double + - 1 + - value of the "hplanck" constant. See :doc:`units`. + * - mvv2e + - double + - 1 + - factor to convert :math:`\frac{1}{2}mv^2` for a particle to + the current energy unit; See :doc:`units`. + * - ftm2v + - double + - 1 + - (description missing) See :doc:`units`. + * - mv2d + - double + - 1 + - (description missing) See :doc:`units`. + * - nktv2p + - double + - 1 + - (description missing) See :doc:`units`. + * - qqr2e + - double + - 1 + - factor to convert :math:`\frac{q_i q_j}{r}` to energy units; + See :doc:`units`. + * - qe2f + - double + - 1 + - (description missing) See :doc:`units`. + * - vxmu2f + - double + - 1 + - (description missing) See :doc:`units`. + * - xxt2kmu + - double + - 1 + - (description missing) See :doc:`units`. + * - dielectric + - double + - 1 + - value of the dielectric constant. See :doc:`dielectric`. + * - qqrd2e + - double + - 1 + - (description missing) See :doc:`units`. + * - e_mass + - double + - 1 + - (description missing) See :doc:`units`. + * - hhmrr2e + - double + - 1 + - (description missing) See :doc:`units`. + * - mvh2r + - double + - 1 + - (description missing) See :doc:`units`. + * - angstrom + - double + - 1 + - constant to convert current length unit to angstroms; + 1.0 for reduced (aka "lj") units. See :doc:`units`. + * - femtosecond + - double + - 1 + - constant to convert current time unit to femtoseconds; + 1.0 for reduced (aka "lj") units + * - qelectron + - double + - 1 + - (description missing) See :doc:`units`. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param name string with the name of the extracted property + * \return pointer (cast to ``void *``) to the location of the + requested property. NULL if name is not known. */ + +void *lammps_extract_global(void *handle, const char *name) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; + if (strcmp(name,"units") == 0) return (void *) lmp->update->unit_style; if (strcmp(name,"dt") == 0) return (void *) &lmp->update->dt; + if (strcmp(name,"ntimestep") == 0) return (void *) &lmp->update->ntimestep; if (strcmp(name,"boxlo") == 0) return (void *) lmp->domain->boxlo; if (strcmp(name,"boxhi") == 0) return (void *) lmp->domain->boxhi; if (strcmp(name,"boxxlo") == 0) return (void *) &lmp->domain->boxlo[0]; @@ -377,7 +1168,7 @@ void *lammps_extract_global(void *ptr, char *name) if (strcmp(name,"boxzlo") == 0) return (void *) &lmp->domain->boxlo[2]; if (strcmp(name,"boxzhi") == 0) return (void *) &lmp->domain->boxhi[2]; if (strcmp(name,"periodicity") == 0) return (void *) lmp->domain->periodicity; - + if (strcmp(name,"triclinic") == 0) return (void *) &lmp->domain->triclinic; if (strcmp(name,"xy") == 0) return (void *) &lmp->domain->xy; if (strcmp(name,"xz") == 0) return (void *) &lmp->domain->xz; if (strcmp(name,"yz") == 0) return (void *) &lmp->domain->yz; @@ -390,10 +1181,6 @@ void *lammps_extract_global(void *ptr, char *name) if (strcmp(name,"nghost") == 0) return (void *) &lmp->atom->nghost; if (strcmp(name,"nmax") == 0) return (void *) &lmp->atom->nmax; if (strcmp(name,"ntypes") == 0) return (void *) &lmp->atom->ntypes; - if (strcmp(name,"ntimestep") == 0) return (void *) &lmp->update->ntimestep; - - if (strcmp(name,"units") == 0) return (void *) lmp->update->unit_style; - if (strcmp(name,"triclinic") == 0) return (void *) &lmp->domain->triclinic; if (strcmp(name,"q_flag") == 0) return (void *) &lmp->atom->q_flag; @@ -426,247 +1213,719 @@ void *lammps_extract_global(void *ptr, char *name) if (strcmp(name,"femtosecond") == 0) return (void *) &lmp->force->femtosecond; if (strcmp(name,"qelectron") == 0) return (void *) &lmp->force->qelectron; - return NULL; + return nullptr; } -/* ---------------------------------------------------------------------- - extract simulation box parameters - see domain.h for definition of these arguments - domain->init() call needed to set box_change -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void lammps_extract_box(void *ptr, double *boxlo, double *boxhi, - double *xy, double *yz, double *xz, - int *periodicity, int *box_change) +/** Get pointer to a LAMMPS per-atom property. + * +\verbatim embed:rst + +This function returns a pointer to the location of per-atom properties +(and per-atom-type properties in the case of the 'mass' keyword). +Per-atom data is distributed across sub-domains and thus MPI ranks. The +returned pointer is cast to ``void *`` and needs to be cast to a pointer +of data type that the entity represents. + +A table with supported keywords is included in the documentation +of the :cpp:func:`Atom::extract() ` function. + +.. warning:: + + The pointers returned by this function are generally not persistent + since per-atom data may be re-distributed, re-allocated, and + re-ordered at every re-neighboring operation. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param name string with the name of the extracted property + * \return pointer (cast to ``void *``) to the location of the + * requested data or ``NULL`` if not found. */ + +void *lammps_extract_atom(void *handle, const char *name) { - LAMMPS *lmp = (LAMMPS *) ptr; - Domain *domain = lmp->domain; - domain->init(); - - boxlo[0] = domain->boxlo[0]; - boxlo[1] = domain->boxlo[1]; - boxlo[2] = domain->boxlo[2]; - boxhi[0] = domain->boxhi[0]; - boxhi[1] = domain->boxhi[1]; - boxhi[2] = domain->boxhi[2]; - - *xy = domain->xy; - *yz = domain->yz; - *xz = domain->xz; - - periodicity[0] = domain->periodicity[0]; - periodicity[1] = domain->periodicity[1]; - periodicity[2] = domain->periodicity[2]; - - *box_change = domain->box_change; -} - -/* ---------------------------------------------------------------------- - extract a pointer to an internal LAMMPS atom-based entity - name = desired quantity, e.g. x or mass - returns a void pointer to the entity - which the caller can cast to the proper data type - returns a NULL if Atom::extract() does not recognize the name - the returned pointer is not a permanent valid reference to the - per-atom quantity, since LAMMPS may reallocate per-atom data - customize by adding names to Atom::extract() -------------------------------------------------------------------------- */ - -void *lammps_extract_atom(void *ptr, char *name) -{ - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; return lmp->atom->extract(name); } -/* ---------------------------------------------------------------------- - extract a pointer to an internal LAMMPS compute-based entity - the compute is invoked if its value(s) is not current - id = compute ID - style = 0 for global data, 1 for per-atom data, 2 for local data - type = 0 for scalar, 1 for vector, 2 for array - for global data, returns a pointer to the - compute's internal data structure for the entity - caller should cast it to (double *) for a scalar or vector - caller should cast it to (double **) for an array - for per-atom or local vector/array data, returns a pointer to the - compute's internal data structure for the entity - caller should cast it to (double *) for a vector - caller should cast it to (double **) for an array - for local data, accessing scalar data for the compute (type = 0), - returns a pointer that should be cast to (int *) which points to - an int with the number of local rows, i.e. the length of the local array. - returns a void pointer to the compute's internal data structure - for the entity which the caller can cast to the proper data type - returns a NULL if id is not recognized or style/type not supported - the returned pointer is not a permanent valid reference to the - compute data, this function should be re-invoked - IMPORTANT: if the compute is not current it will be invoked - LAMMPS cannot easily check here if it is valid to invoke the compute, - so caller must insure that it is OK -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void *lammps_extract_compute(void *ptr, char *id, int style, int type) +/** Get data type of internal global LAMMPS variables or arrays. + * +\verbatim embed:rst + +This function returns an integer that encodes the data type of the global +property with the specified name. See :cpp:enum:`_LMP_DATATYPE_CONST` for valid +values. Callers of :cpp:func:`lammps_extract_global` can use this information +to then decide how to cast the (void*) pointer and access the data. + +.. versionadded:: 18Sep2020 + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param name string with the name of the extracted property + * \return integer constant encoding the data type of the property + * or -1 if not found. */ + +int lammps_extract_global_datatype(void *handle, const char *name) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; + + if (strcmp(name,"units") == 0) return LAMMPS_STRING; + if (strcmp(name,"dt") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"ntimestep") == 0) return LAMMPS_BIGINT; + if (strcmp(name,"boxlo") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxhi") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxxlo") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxxhi") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxylo") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxyhi") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxzlo") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"boxzhi") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"periodicity") == 0) return LAMMPS_INT; + if (strcmp(name,"triclinic") == 0) return LAMMPS_INT; + if (strcmp(name,"xy") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"xz") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"yz") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"natoms") == 0) return LAMMPS_BIGINT; + if (strcmp(name,"nbonds") == 0) return LAMMPS_BIGINT; + if (strcmp(name,"nangles") == 0) return LAMMPS_BIGINT; + if (strcmp(name,"ndihedrals") == 0) return LAMMPS_BIGINT; + if (strcmp(name,"nimpropers") == 0) return LAMMPS_BIGINT; + if (strcmp(name,"nlocal") == 0) return LAMMPS_INT; + if (strcmp(name,"nghost") == 0) return LAMMPS_INT; + if (strcmp(name,"nmax") == 0) return LAMMPS_INT; + if (strcmp(name,"ntypes") == 0) return LAMMPS_INT; + + if (strcmp(name,"q_flag") == 0) return LAMMPS_INT; + + // update->atime can be referenced as a pointer + // thermo "timer" data cannot be, since it is computed on request + // lammps_get_thermo() can access all thermo keywords by value + + if (strcmp(name,"atime") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"atimestep") == 0) return LAMMPS_BIGINT; + + // global constants defined by units + + if (strcmp(name,"boltz") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"hplanck") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"mvv2e") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"ftm2v") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"mv2d") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"nktv2p") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"qqr2e") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"qe2f") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"vxmu2f") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"xxt2kmu") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"dielectric") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"qqrd2e") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"e_mass") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"hhmrr2e") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"mvh2r") == 0) return LAMMPS_DOUBLE; + + if (strcmp(name,"angstrom") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"femtosecond") == 0) return LAMMPS_DOUBLE; + if (strcmp(name,"qelectron") == 0) return LAMMPS_DOUBLE; + + return -1; +} + +/* ---------------------------------------------------------------------- */ + +/** Get data type of a LAMMPS per-atom property + * +\verbatim embed:rst + +This function returns an integer that encodes the data type of the per-atom +property with the specified name. See :cpp:enum:`_LMP_DATATYPE_CONST` for valid +values. Callers of :cpp:func:`lammps_extract_atom` can use this information +to then decide how to cast the (void*) pointer and access the data. + +.. versionadded:: 18Sep2020 + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param name string with the name of the extracted property + * \return integer constant encoding the data type of the property + * or -1 if not found. + * */ + +int lammps_extract_atom_datatype(void *handle, const char *name) +{ + LAMMPS *lmp = (LAMMPS *) handle; + return lmp->atom->extract_datatype(name); +} + +/* ---------------------------------------------------------------------- */ + +/** Create N atoms from list of coordinates + * +\verbatim embed:rst + +The prototype for this function when compiling with ``-DLAMMPS_BIGBIG`` +is: + +.. code-block:: c + + int lammps_create_atoms(void *handle, int n, int64_t *id, int *type, double *x, double *v, int64_t *image, int bexpand); + +This function creates additional atoms from a given list of coordinates +and a list of atom types. Additionally the atom-IDs, velocities, and +image flags may be provided. If atom-IDs are not provided, they will be +automatically created as a sequence following the largest existing +atom-ID. + +This function is useful to add atoms to a simulation or - in tandem with +:cpp:func:`lammps_reset_box` - to restore a previously extracted and +saved state of a simulation. Additional properties for the new atoms +can then be assigned via the :cpp:func:`lammps_scatter_atoms` +:cpp:func:`lammps_extract_atom` functions. + +For non-periodic boundaries, atoms will **not** be created that have +coordinates outside the box unless it is a shrink-wrap boundary and the +shrinkexceed flag has been set to a non-zero value. For periodic +boundaries atoms will be wrapped back into the simulation cell and its +image flags adjusted accordingly, unless explicit image flags are +provided. + +The function returns the number of atoms created or -1 on failure, e.g. +when called before as box has been created. + +Coordinates and velocities have to be given in a 1d-array in the order +X(1),Y(1),Z(1),X(2),Y(2),Z(2),...,X(N),Y(N),Z(N). + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param n number of atoms, N, to be added to the system + * \param id pointer to N atom IDs; ``NULL`` will generate IDs + * \param type pointer to N atom types (required) + * \param x pointer to 3N doubles with x-,y-,z- positions + of the new atoms (required) + * \param v pointer to 3N doubles with x-,y-,z- velocities + of the new atoms (set to 0.0 if ``NULL``) + * \param image pointer to N imageint sets of image flags, or ``NULL`` + * \param bexpand if 1, atoms outside of shrink-wrap boundaries will + still be created and not dropped and the box extended + * \return number of atoms created on success; + -1 on failure (no box, no atom IDs, etc.) */ + +int lammps_create_atoms(void *handle, int n, tagint *id, int *type, + double *x, double *v, imageint *image, + int bexpand) +{ + LAMMPS *lmp = (LAMMPS *) handle; + bigint natoms_prev = lmp->atom->natoms; + + BEGIN_CAPTURE + { + // error if box does not exist or tags not defined + + int flag = 0; + std::string msg("Failure in lammps_create_atoms: "); + if (lmp->domain->box_exist == 0) { + flag = 1; + msg += "trying to create atoms before before simulation box is defined"; + } + if (lmp->atom->tag_enable == 0) { + flag = 1; + msg += "must have atom IDs to use this function"; + } + + if (flag) { + if (lmp->comm->me == 0) lmp->error->warning(FLERR,msg.c_str()); + return -1; + } + + // loop over all N atoms on all MPI ranks + // if this proc would own it based on its coordinates, invoke create_atom() + // optionally set atom tags and velocities + + Atom *atom = lmp->atom; + Domain *domain = lmp->domain; + int nlocal = atom->nlocal; + + int nlocal_prev = nlocal; + double xdata[3]; + + for (int i = 0; i < n; i++) { + xdata[0] = x[3*i]; + xdata[1] = x[3*i+1]; + xdata[2] = x[3*i+2]; + imageint * img = image ? image + i : nullptr; + tagint tag = id ? id[i] : 0; + + // create atom only on MPI rank that would own it + + if (!domain->ownatom(tag, xdata, img, bexpand)) continue; + + atom->avec->create_atom(type[i],xdata); + if (id) atom->tag[nlocal] = id[i]; + else atom->tag[nlocal] = 0; + if (v) { + atom->v[nlocal][0] = v[3*i]; + atom->v[nlocal][1] = v[3*i+1]; + atom->v[nlocal][2] = v[3*i+2]; + } + if (image) atom->image[nlocal] = image[i]; + nlocal++; + } + + // if no tags are given explicitly, create new and unique tags + + if (id == nullptr) atom->tag_extend(); + + // reset box info, if extended when adding atoms. + + if (bexpand) domain->reset_box(); + + // need to reset atom->natoms inside LAMMPS + + bigint ncurrent = nlocal; + MPI_Allreduce(&ncurrent,&lmp->atom->natoms,1,MPI_LMP_BIGINT, + MPI_SUM,lmp->world); + + // init per-atom fix/compute/variable values for created atoms + + atom->data_fix_compute_variable(nlocal_prev,nlocal); + + // if global map exists, reset it + // invoke map_init() b/c atom count has grown + + if (lmp->atom->map_style != Atom::MAP_NONE) { + lmp->atom->map_init(); + lmp->atom->map_set(); + } + } + END_CAPTURE; + return (int) lmp->atom->natoms - natoms_prev; +} + +// ---------------------------------------------------------------------- +// Library functions to access data from computes, fixes, variables in LAMMPS +// ---------------------------------------------------------------------- + +/** Get pointer to data from a LAMMPS compute. + * +\verbatim embed:rst + +This function returns a pointer to the location of data provided by a +:doc:`compute` instance identified by the compute-ID. Computes may +provide global, per-atom, or local data, and those may be a scalar, a +vector, or an array or they may provide the information about the +dimensions of the respective data. Since computes may provide multiple +kinds of data, it is required to set style and type flags representing +what specific data is desired. This also determines to what kind of +pointer the returned pointer needs to be cast to access the data +correctly. The function returns ``NULL`` if the compute ID is not found +or the requested data is not available or current. The following table +lists the available options. + +.. list-table:: + :header-rows: 1 + :widths: auto + + * - Style (see :cpp:enum:`_LMP_STYLE_CONST`) + - Type (see :cpp:enum:`_LMP_TYPE_CONST`) + - Returned type + - Returned data + * - LMP_STYLE_GLOBAL + - LMP_TYPE_SCALAR + - ``double *`` + - Global scalar + * - LMP_STYLE_GLOBAL + - LMP_TYPE_VECTOR + - ``double *`` + - Global vector + * - LMP_STYLE_GLOBAL + - LMP_TYPE_ARRAY + - ``double **`` + - Global array + * - LMP_STYLE_GLOBAL + - LMP_SIZE_VECTOR + - ``int *`` + - Length of global vector + * - LMP_STYLE_GLOBAL + - LMP_SIZE_ROWS + - ``int *`` + - Rows of global array + * - LMP_STYLE_GLOBAL + - LMP_SIZE_COLS + - ``int *`` + - Columns of global array + * - LMP_STYLE_ATOM + - LMP_TYPE_VECTOR + - ``double *`` + - Per-atom value + * - LMP_STYLE_ATOM + - LMP_TYPE_ARRAY + - ``double **`` + - Per-atom vector + * - LMP_STYLE_ATOM + - LMP_SIZE_COLS + - ``int *`` + - Columns in per-atom array, 0 if vector + * - LMP_STYLE_LOCAL + - LMP_TYPE_VECTOR + - ``double *`` + - Local data vector + * - LMP_STYLE_LOCAL + - LMP_TYPE_ARRAY + - ``double **`` + - Local data array + * - LMP_STYLE_LOCAL + - LMP_SIZE_ROWS + - ``int *`` + - Number of local data rows + * - LMP_STYLE_LOCAL + - LMP_SIZE_COLS + - ``int *`` + - Number of local data columns + +.. warning:: + + The pointers returned by this function are generally not persistent + since the computed data may be re-distributed, re-allocated, and + re-ordered at every invocation. It is advisable to re-invoke this + function before the data is accessed, or make a copy if the data shall + be used after other LAMMPS commands have been issued. + +.. note:: + + If the compute's data is not computed for the current step, the + compute will be invoked. LAMMPS cannot easily check at that time, if + it is valid to invoke a compute, so it may fail with an error. The + caller has to check to avoid such an error. + + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param id string with ID of the compute + * \param style constant indicating the style of data requested + (global, per-atom, or local) + * \param type constant indicating type of data (scalar, vector, + or array) or size of rows or columns + * \return pointer (cast to ``void *``) to the location of the + * requested data or ``NULL`` if not found. */ + +void *lammps_extract_compute(void *handle, char *id, int style, int type) +{ + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { int icompute = lmp->modify->find_compute(id); - if (icompute < 0) return NULL; + if (icompute < 0) return nullptr; Compute *compute = lmp->modify->compute[icompute]; - if (style == 0) { - if (type == 0) { - if (!compute->scalar_flag) return NULL; + if (style == LMP_STYLE_GLOBAL) { + if (type == LMP_TYPE_SCALAR) { + if (!compute->scalar_flag) return nullptr; if (compute->invoked_scalar != lmp->update->ntimestep) compute->compute_scalar(); return (void *) &compute->scalar; } - if (type == 1) { - if (!compute->vector_flag) return NULL; + if ((type == LMP_TYPE_VECTOR) || (type == LMP_SIZE_VECTOR)) { + if (!compute->vector_flag) return nullptr; if (compute->invoked_vector != lmp->update->ntimestep) compute->compute_vector(); - return (void *) compute->vector; + if (type == LMP_TYPE_VECTOR) + return (void *) compute->vector; + else + return (void *) &compute->size_vector; } - if (type == 2) { - if (!compute->array_flag) return NULL; + if ((type == LMP_TYPE_ARRAY) || (type == LMP_SIZE_ROWS) || (type == LMP_SIZE_COLS)) { + if (!compute->array_flag) return nullptr; if (compute->invoked_array != lmp->update->ntimestep) compute->compute_array(); - return (void *) compute->array; + if (type == LMP_TYPE_ARRAY) + return (void *) compute->array; + else if (type == LMP_SIZE_ROWS) + return (void *) &compute->size_array_rows; + else + return (void *) &compute->size_array_cols; } } - if (style == 1) { - if (!compute->peratom_flag) return NULL; + if (style == LMP_STYLE_ATOM) { + if (!compute->peratom_flag) return nullptr; if (compute->invoked_peratom != lmp->update->ntimestep) compute->compute_peratom(); - if (type == 1) return (void *) compute->vector_atom; - if (type == 2) return (void *) compute->array_atom; + if (type == LMP_TYPE_VECTOR) return (void *) compute->vector_atom; + if (type == LMP_TYPE_ARRAY) return (void *) compute->array_atom; + if (type == LMP_SIZE_COLS) return (void *) &compute->size_peratom_cols; } - if (style == 2) { - if (!compute->local_flag) return NULL; + if (style == LMP_STYLE_LOCAL) { + if (!compute->local_flag) return nullptr; if (compute->invoked_local != lmp->update->ntimestep) compute->compute_local(); - if (type == 0) return (void *) &compute->size_local_rows; - if (type == 1) return (void *) compute->vector_local; - if (type == 2) return (void *) compute->array_local; + if (type == LMP_TYPE_SCALAR) return (void *) &compute->size_local_rows; /* for backward compatibility */ + if (type == LMP_TYPE_VECTOR) return (void *) compute->vector_local; + if (type == LMP_TYPE_ARRAY) return (void *) compute->array_local; + if (type == LMP_SIZE_ROWS) return (void *) &compute->size_local_rows; + if (type == LMP_SIZE_COLS) return (void *) &compute->size_local_cols; } } END_CAPTURE - return NULL; + return nullptr; } -/* ---------------------------------------------------------------------- - extract a pointer to an internal LAMMPS fix-based entity - id = fix ID - style = 0 for global data, 1 for per-atom data, 2 for local data - type = 0 for scalar, 1 for vector, 2 for array - i,j = indices needed only to specify which global vector or array value - for global data, returns a pointer to a memory location - which is allocated by this function - which the caller can cast to a (double *) which points to the value - for per-atom or local data, returns a pointer to the - fix's internal data structure for the entity - caller should cast it to (double *) for a vector - caller should cast it to (double **) for an array - returns a NULL if id is not recognized or style/type not supported - IMPORTANT: for global data, - this function allocates a double to store the value in, - so the caller must free this memory to avoid a leak, e.g. - double *dptr = (double *) lammps_extract_fix(); - double value = *dptr; - lammps_free(dptr); - IMPORTANT: LAMMPS cannot easily check here when info extracted from - the fix is valid, so caller must insure that it is OK -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void *lammps_extract_fix(void *ptr, char *id, int style, int type, - int i, int j) +/** Get pointer to data from a LAMMPS fix. + * +\verbatim embed:rst + +This function returns a pointer to data provided by a :doc:`fix` +instance identified by its fix-ID. Fixes may provide global, per-atom, +or local data, and those may be a scalar, a vector, or an array, or they +may provide the information about the dimensions of the respective data. +Since individual fixes may provide multiple kinds of data, it is +required to set style and type flags representing what specific data is +desired. This also determines to what kind of pointer the returned +pointer needs to be cast to access the data correctly. The function +returns ``NULL`` if the fix ID is not found or the requested data is not +available. + +.. note:: + + When requesting global data, the fix data can only be accessed one + item at a time without access to the pointer itself. Thus this + function will allocate storage for a single double value, copy the + returned value to it, and returns a pointer to the location of the + copy. Therefore the allocated storage needs to be freed after its + use to avoid a memory leak. Example: + + .. code-block:: c + + double *dptr = (double *) lammps_extract_fix(handle,name,0,1,0,0); + double value = *dptr; + lammps_free((void *)dptr); + +The following table lists the available options. + +.. list-table:: + :header-rows: 1 + :widths: auto + + * - Style (see :cpp:enum:`_LMP_STYLE_CONST`) + - Type (see :cpp:enum:`_LMP_TYPE_CONST`) + - Returned type + - Returned data + * - LMP_STYLE_GLOBAL + - LMP_TYPE_SCALAR + - ``double *`` + - Copy of global scalar + * - LMP_STYLE_GLOBAL + - LMP_TYPE_VECTOR + - ``double *`` + - Copy of global vector element at index nrow + * - LMP_STYLE_GLOBAL + - LMP_TYPE_ARRAY + - ``double *`` + - Copy of global array element at nrow, ncol + * - LMP_STYLE_GLOBAL + - LMP_SIZE_VECTOR + - ``int *`` + - Length of global vector + * - LMP_STYLE_GLOBAL + - LMP_SIZE_ROWS + - ``int *`` + - Rows in global array + * - LMP_STYLE_GLOBAL + - LMP_SIZE_COLS + - ``int *`` + - Columns in global array + * - LMP_STYLE_ATOM + - LMP_TYPE_VECTOR + - ``double *`` + - Per-atom value + * - LMP_STYLE_ATOM + - LMP_TYPE_ARRAY + - ``double **`` + - Per-atom vector + * - LMP_STYLE_ATOM + - LMP_SIZE_COLS + - ``int *`` + - Columns of per-atom array, 0 if vector + * - LMP_STYLE_LOCAL + - LMP_TYPE_VECTOR + - ``double *`` + - Local data vector + * - LMP_STYLE_LOCAL + - LMP_TYPE_ARRAY + - ``double **`` + - Local data array + * - LMP_STYLE_LOCAL + - LMP_SIZE_ROWS + - ``int *`` + - Number of local data rows + * - LMP_STYLE_LOCAL + - LMP_SIZE_COLS + - ``int *`` + - Number of local data columns + +.. warning:: + + The pointers returned by this function for per-atom or local data are + generally not persistent, since the computed data may be re-distributed, + re-allocated, and re-ordered at every invocation of the fix. It is thus + advisable to re-invoke this function before the data is accessed, or + make a copy, if the data shall be used after other LAMMPS commands have + been issued. + +.. note:: + + LAMMPS cannot easily check if it is valid to access the data, so it + may fail with an error. The caller has to avoid such an error. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param id string with ID of the fix + * \param style constant indicating the style of data requested + (global, per-atom, or local) + * \param type constant indicating type of data (scalar, vector, + or array) or size of rows or columns + * \param nrow row index (only used for global vectors and arrays) + * \param ncol column index (only used for global arrays) + * \return pointer (cast to ``void *``) to the location of the + * requested data or ``NULL`` if not found. */ + +void *lammps_extract_fix(void *handle, char *id, int style, int type, + int nrow, int ncol) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { int ifix = lmp->modify->find_fix(id); - if (ifix < 0) return NULL; + if (ifix < 0) return nullptr; Fix *fix = lmp->modify->fix[ifix]; - if (style == 0) { - if (type == 0) { - if (!fix->scalar_flag) return NULL; + if (style == LMP_STYLE_GLOBAL) { + if (type == LMP_TYPE_SCALAR) { + if (!fix->scalar_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); *dptr = fix->compute_scalar(); return (void *) dptr; } - if (type == 1) { - if (!fix->vector_flag) return NULL; + if (type == LMP_TYPE_VECTOR) { + if (!fix->vector_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); - *dptr = fix->compute_vector(i); + *dptr = fix->compute_vector(nrow); return (void *) dptr; } - if (type == 2) { - if (!fix->array_flag) return NULL; + if (type == LMP_TYPE_ARRAY) { + if (!fix->array_flag) return nullptr; double *dptr = (double *) malloc(sizeof(double)); - *dptr = fix->compute_array(i,j); + *dptr = fix->compute_array(nrow,ncol); return (void *) dptr; } + if (type == LMP_SIZE_VECTOR) { + if (!fix->vector_flag) return nullptr; + return (void *) &fix->size_vector; + } + if ((type == LMP_SIZE_ROWS) || (type == LMP_SIZE_COLS)) { + if (!fix->array_flag) return nullptr; + if (type == LMP_SIZE_ROWS) + return (void *) &fix->size_array_rows; + else + return (void *) &fix->size_array_cols; + } } - if (style == 1) { - if (!fix->peratom_flag) return NULL; - if (type == 1) return (void *) fix->vector_atom; - if (type == 2) return (void *) fix->array_atom; + if (style == LMP_STYLE_ATOM) { + if (!fix->peratom_flag) return nullptr; + if (type == LMP_TYPE_VECTOR) return (void *) fix->vector_atom; + if (type == LMP_TYPE_ARRAY) return (void *) fix->array_atom; + if (type == LMP_SIZE_COLS) return (void *) &fix->size_peratom_cols; } - if (style == 2) { - if (!fix->local_flag) return NULL; - if (type == 0) return (void *) &fix->size_local_rows; - if (type == 1) return (void *) fix->vector_local; - if (type == 2) return (void *) fix->array_local; + if (style == LMP_STYLE_LOCAL) { + if (!fix->local_flag) return nullptr; + if (type == LMP_TYPE_SCALAR) return (void *) &fix->size_local_rows; + if (type == LMP_TYPE_VECTOR) return (void *) fix->vector_local; + if (type == LMP_TYPE_ARRAY) return (void *) fix->array_local; + if (type == LMP_SIZE_ROWS) return (void *) &fix->size_local_rows; + if (type == LMP_SIZE_COLS) return (void *) &fix->size_local_cols; } } END_CAPTURE - return NULL; + return nullptr; } -/* ---------------------------------------------------------------------- - extract a pointer to an internal LAMMPS evaluated variable - name = variable name, must be equal-style or atom-style variable - group = group ID for evaluating an atom-style variable, else NULL - for equal-style variable, returns a pointer to a memory location - which is allocated by this function - which the caller can cast to a (double *) which points to the value - for atom-style variable, returns a pointer to the - vector of per-atom values on each processor, - which the caller can cast to a (double *) which points to the values - returns a NULL if name is not recognized or not equal-style or atom-style - IMPORTANT: for both equal-style and atom-style variables, - this function allocates memory to store the variable data in - so the caller must free this memory to avoid a leak - e.g. for equal-style variables - double *dptr = (double *) lammps_extract_variable(); - double value = *dptr; - lammps_free(dptr); - e.g. for atom-style variables - double *vector = (double *) lammps_extract_variable(); - use the vector values - lammps_free(vector); - IMPORTANT: LAMMPS cannot easily check here when it is valid to evaluate - the variable or any fixes or computes or thermodynamic info it references, - so caller must insure that it is OK -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -void *lammps_extract_variable(void *ptr, char *name, char *group) +/** Get pointer to data from a LAMMPS variable. + * +\verbatim embed:rst + +This function returns a pointer to data from a LAMMPS :doc:`variable` +identified by its name. The variable must be either an *equal*\ -style +compatible or an *atom*\ -style variable. Variables of style *internal* +are compatible with *equal*\ -style variables and so are *python*\ +-style variables, if they return a numeric value. The function returns +``NULL`` when a variable of the provided *name* is not found or of an +incompatible style. The *group* argument is only used for *atom*\ +-style variables and ignored otherwise. If set to ``NULL`` when +extracting data from and *atom*\ -style variable, the group is assumed +to be "all". + +.. note:: + + When requesting data from an *equal*\ -style or compatible variable + this function allocates storage for a single double value, copies the + returned value to it, and returns a pointer to the location of the + copy. Therefore the allocated storage needs to be freed after its + use to avoid a memory leak. Example: + + .. code-block:: c + + double *dptr = (double *) lammps_extract_variable(handle,name,NULL); + double value = *dptr; + lammps_free((void *)dptr); + + For *atom*\ -style variables the data returned is a pointer to an + allocated block of storage of double of the length ``atom->nlocal``. + To avoid a memory leak, also this pointer needs to be freed after use. + +Since the data is returned as copies, the location will persist, but its +values will not be updated, in case the variable is re-evaluated. + +.. note:: + + LAMMPS cannot easily check if it is valid to access the data + referenced by the variables, e.g. computes or fixes or thermodynamic + info, so it may fail with an error. The caller has to make certain, + that the data is extracted only when it safe to evaluate the variable + and thus an error and crash is avoided. + +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance + * \param name name of the variable + * \param group group-ID for atom style variable or ``NULL`` + * \return pointer (cast to ``void *``) to the location of the + * requested data or ``NULL`` if not found. */ + +void *lammps_extract_variable(void *handle, char *name, char *group) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { int ivar = lmp->input->variable->find(name); - if (ivar < 0) return NULL; + if (ivar < 0) return nullptr; if (lmp->input->variable->equalstyle(ivar)) { double *dptr = (double *) malloc(sizeof(double)); @@ -675,8 +1934,9 @@ void *lammps_extract_variable(void *ptr, char *name, char *group) } if (lmp->input->variable->atomstyle(ivar)) { + if (group == nullptr) group = (char *)"all"; int igroup = lmp->group->find(group); - if (igroup < 0) return NULL; + if (igroup < 0) return nullptr; int nlocal = lmp->atom->nlocal; double *vector = (double *) malloc(nlocal*sizeof(double)); lmp->input->variable->compute_atom(ivar,igroup,vector,1,0); @@ -685,54 +1945,25 @@ void *lammps_extract_variable(void *ptr, char *name, char *group) } END_CAPTURE - return NULL; + return nullptr; } -/* ---------------------------------------------------------------------- - return the current value of a thermo keyword as a double - unlike lammps_extract_global() this does not give access to the - storage of the data in question - instead it triggers the Thermo class to compute the current value - and returns it -------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- */ -double lammps_get_thermo(void *ptr, char *name) +/** Set the value of a string-style variable. + * + * This function assigns a new value from the string str to the + * string-style variable name. Returns -1 if a variable of that + * name does not exist or is not a string-style variable, otherwise 0. + * + * \param handle pointer to a previously created LAMMPS instance + * \param name name of the variable + * \param str new value of the variable + * \return 0 on success or -1 on failure + */ +int lammps_set_variable(void *handle, char *name, char *str) { - LAMMPS *lmp = (LAMMPS *) ptr; - double dval = 0.0; - - BEGIN_CAPTURE - { - lmp->output->thermo->evaluate_keyword(name,&dval); - } - END_CAPTURE - - return dval; -} - -/* ---------------------------------------------------------------------- - return the total number of atoms in the system - useful before call to lammps_get_atoms() so can pre-allocate vector -------------------------------------------------------------------------- */ - -int lammps_get_natoms(void *ptr) -{ - LAMMPS *lmp = (LAMMPS *) ptr; - - if (lmp->atom->natoms > MAXSMALLINT) return 0; - int natoms = static_cast (lmp->atom->natoms); - return natoms; -} - -/* ---------------------------------------------------------------------- - set the value of a STRING variable to str - return -1 if variable doesn't exist or not a STRING variable - return 0 for success -------------------------------------------------------------------------- */ - -int lammps_set_variable(void *ptr, char *name, char *str) -{ - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; int err = -1; BEGIN_CAPTURE @@ -744,33 +1975,9 @@ int lammps_set_variable(void *ptr, char *name, char *str) return err; } -/* ---------------------------------------------------------------------- - reset simulation box parameters - see domain.h for definition of these arguments - assumes domain->set_initial_box() has been invoked previously -------------------------------------------------------------------------- */ - -void lammps_reset_box(void *ptr, double *boxlo, double *boxhi, - double xy, double yz, double xz) -{ - LAMMPS *lmp = (LAMMPS *) ptr; - Domain *domain = lmp->domain; - - domain->boxlo[0] = boxlo[0]; - domain->boxlo[1] = boxlo[1]; - domain->boxlo[2] = boxlo[2]; - domain->boxhi[0] = boxhi[0]; - domain->boxhi[1] = boxhi[1]; - domain->boxhi[2] = boxhi[2]; - - domain->xy = xy; - domain->yz = yz; - domain->xz = xz; - - domain->set_global_box(); - lmp->comm->set_proc_grid(); - domain->set_local_box(); -} +// ---------------------------------------------------------------------- +// Library functions for scatter/gather operations of data +// ---------------------------------------------------------------------- /* ---------------------------------------------------------------------- gather the named atom-based entity for all atoms @@ -794,10 +2001,10 @@ void lammps_reset_box(void *ptr, double *boxlo, double *boxhi, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_gather_atoms(void *ptr, char * /*name */, +void lammps_gather_atoms(void *handle, char * /*name */, int /*type*/, int /*count*/, void * /*data*/) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -807,10 +2014,10 @@ void lammps_gather_atoms(void *ptr, char * /*name */, END_CAPTURE } #else -void lammps_gather_atoms(void *ptr, char *name, +void lammps_gather_atoms(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -832,7 +2039,7 @@ void lammps_gather_atoms(void *ptr, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name"); return; } @@ -842,8 +2049,8 @@ void lammps_gather_atoms(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -881,8 +2088,8 @@ void lammps_gather_atoms(void *ptr, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -935,10 +2142,10 @@ void lammps_gather_atoms(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_gather_atoms_concat(void *ptr, char * /*name */, +void lammps_gather_atoms_concat(void *handle, char * /*name */, int /*type*/, int /*count*/, void * /*data*/) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -948,10 +2155,10 @@ void lammps_gather_atoms_concat(void *ptr, char * /*name */, END_CAPTURE } #else -void lammps_gather_atoms_concat(void *ptr, char *name, +void lammps_gather_atoms_concat(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -972,7 +2179,7 @@ void lammps_gather_atoms_concat(void *ptr, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms: unknown property name"); return; } @@ -986,8 +2193,8 @@ void lammps_gather_atoms_concat(void *ptr, char *name, lmp->memory->create(displs,nprocs,"lib/gather:displs"); if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -1037,8 +2244,8 @@ void lammps_gather_atoms_concat(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -1094,11 +2301,11 @@ void lammps_gather_atoms_concat(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_gather_atoms_subset(void *ptr, char * /*name */, +void lammps_gather_atoms_subset(void *handle, char * /*name */, int /*type*/, int /*count*/, int /*ndata*/, int * /*ids*/, void * /*data*/) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1108,11 +2315,11 @@ void lammps_gather_atoms_subset(void *ptr, char * /*name */, END_CAPTURE } #else -void lammps_gather_atoms_subset(void *ptr, char *name, +void lammps_gather_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1132,7 +2339,7 @@ void lammps_gather_atoms_subset(void *ptr, char *name, } void *vptr = lmp->atom->extract(name); - if (vptr == NULL) { + if (vptr == nullptr) { lmp->error->warning(FLERR,"lammps_gather_atoms_subset: " "unknown property name"); return; @@ -1143,8 +2350,8 @@ void lammps_gather_atoms_subset(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgunpack) vector = (int *) vptr; @@ -1190,8 +2397,8 @@ void lammps_gather_atoms_subset(void *ptr, char *name, lmp->memory->destroy(copy); } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; @@ -1244,10 +2451,10 @@ void lammps_gather_atoms_subset(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_scatter_atoms(void *ptr, char * /*name */, +void lammps_scatter_atoms(void *handle, char * /*name */, int /*type*/, int /*count*/, void * /*data*/) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1257,10 +2464,10 @@ void lammps_scatter_atoms(void *ptr, char * /*name */, END_CAPTURE } #else -void lammps_scatter_atoms(void *ptr, char *name, +void lammps_scatter_atoms(void *handle, char *name, int type, int count, void *data) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1273,7 +2480,7 @@ void lammps_scatter_atoms(void *ptr, char *name, if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) flag = 1; if (lmp->atom->natoms > MAXSMALLINT) flag = 1; - if (lmp->atom->map_style == 0) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; if (flag) { if (lmp->comm->me == 0) lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms"); @@ -1283,7 +2490,7 @@ void lammps_scatter_atoms(void *ptr, char *name, int natoms = static_cast (lmp->atom->natoms); void *vptr = lmp->atom->extract(name); - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR, "lammps_scatter_atoms: unknown property name"); return; @@ -1294,8 +2501,8 @@ void lammps_scatter_atoms(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -1327,8 +2534,8 @@ void lammps_scatter_atoms(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -1372,11 +2579,11 @@ void lammps_scatter_atoms(void *ptr, char *name, ------------------------------------------------------------------------- */ #if defined(LAMMPS_BIGBIG) -void lammps_scatter_atoms_subset(void *ptr, char * /*name */, +void lammps_scatter_atoms_subset(void *handle, char * /*name */, int /*type*/, int /*count*/, int /*ndata*/, int * /*ids*/, void * /*data*/) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1386,11 +2593,11 @@ void lammps_scatter_atoms_subset(void *ptr, char * /*name */, END_CAPTURE } #else -void lammps_scatter_atoms_subset(void *ptr, char *name, +void lammps_scatter_atoms_subset(void *handle, char *name, int type, int count, int ndata, int *ids, void *data) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; BEGIN_CAPTURE { @@ -1403,7 +2610,7 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, int flag = 0; if (lmp->atom->tag_enable == 0) flag = 1; if (lmp->atom->natoms > MAXSMALLINT) flag = 1; - if (lmp->atom->map_style == 0) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; if (flag) { if (lmp->comm->me == 0) lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms_subset"); @@ -1411,7 +2618,7 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, } void *vptr = lmp->atom->extract(name); - if(vptr == NULL) { + if(vptr == nullptr) { lmp->error->warning(FLERR, "lammps_scatter_atoms_subset: unknown property name"); return; @@ -1422,8 +2629,8 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID if (type == 0) { - int *vector = NULL; - int **array = NULL; + int *vector = nullptr; + int **array = nullptr; const int imgpack = (count == 3) && (strcmp(name,"image") == 0); if ((count == 1) || imgpack) vector = (int *) vptr; @@ -1461,8 +2668,8 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, } } else { - double *vector = NULL; - double **array = NULL; + double *vector = nullptr; + double **array = nullptr; if (count == 1) vector = (double *) vptr; else array = (double **) vptr; double *dptr = (double *) data; @@ -1490,118 +2697,1173 @@ void lammps_scatter_atoms_subset(void *ptr, char *name, } #endif -/* ---------------------------------------------------------------------- - create N atoms and assign them to procs based on coords - id = atom IDs (optional, NULL will generate 1 to N) - type = N-length vector of atom types (required) - x = 3N-length 1d vector of atom coords (required) - v = 3N-length 1d vector of atom velocities (optional, NULL if just 0.0) - image flags can be treated in two ways: - (a) image = vector of current image flags - each atom will be remapped into periodic box by domain->ownatom() - image flag will be incremented accordingly and stored with atom - (b) image = NULL - each atom will be remapped into periodic box by domain->ownatom() - image flag will be set to 0 by atom->avec->create_atom() - shrinkexceed = 1 allows atoms to be outside a shrinkwrapped boundary - passed to ownatom() which will assign them to boundary proc - important if atoms may be (slightly) outside non-periodic dim - e.g. due to restoring a snapshot from a previous run and previous box - id and image must be 32-bit integers - x,v = ordered by xyz, then by atom - e.g. x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],... -------------------------------------------------------------------------- */ -void lammps_create_atoms(void *ptr, int n, tagint *id, int *type, - double *x, double *v, imageint *image, - int shrinkexceed) +/* ---------------------------------------------------------------------- + Contributing author: Thomas Swinburne (CNRS & CINaM, Marseille, France) + gather the named atom-based entity for all atoms + return it in user-allocated data + data will be ordered by atom ID + requirement for consecutive atom IDs (1 to N) + see gather_concat() to return data for all atoms, unordered + see gather_subset() to return data for only a subset of atoms + name = "x" , "f" or other atom properties + "d_name" or "i_name" for fix property/atom quantities + "f_fix", "c_compute" for fixes / computes + will return error if fix/compute doesn't isn't atom-based + type = 0 for integer values, 1 for double values + count = # of per-atom values, e.g. 1 for type or charge, 3 for x or f + use count = 3 with "image" if want single image flag unpacked into xyz + return atom-based values in 1d data, ordered by count, then by atom ID + e.g. x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],... + data must be pre-allocated by caller to correct length + correct length = count*Natoms, as queried by get_natoms() + method: + alloc and zero count*Natom length vector + loop over Nlocal to fill vector with my values + Allreduce to sum vector into data across all procs +------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_gather(void *ptr, char * /*name*/, int /*type*/, + int /*count*/, void * /*data*/) { LAMMPS *lmp = (LAMMPS *) ptr; BEGIN_CAPTURE { - // error if box does not exist or tags not defined - - int flag = 0; - if (lmp->domain->box_exist == 0) flag = 1; - if (lmp->atom->tag_enable == 0) flag = 1; - if (flag) { - if (lmp->comm->me == 0) - lmp->error->warning(FLERR,"Library error in lammps_create_atoms"); - return; - } - - // loop over N atoms of entire system - // if this proc owns it based on coords, invoke create_atom() - // optionally set atom tags and velocities - - Atom *atom = lmp->atom; - Domain *domain = lmp->domain; - int nlocal = atom->nlocal; - - bigint natoms_prev = atom->natoms; - int nlocal_prev = nlocal; - double xdata[3]; - - for (int i = 0; i < n; i++) { - xdata[0] = x[3*i]; - xdata[1] = x[3*i+1]; - xdata[2] = x[3*i+2]; - imageint * img = image ? &image[i] : NULL; - tagint tag = id ? id[i] : -1; - if (!domain->ownatom(tag, xdata, img, shrinkexceed)) continue; - - atom->avec->create_atom(type[i],xdata); - if (id) atom->tag[nlocal] = id[i]; - else atom->tag[nlocal] = i+1; - if (v) { - atom->v[nlocal][0] = v[3*i]; - atom->v[nlocal][1] = v[3*i+1]; - atom->v[nlocal][2] = v[3*i+2]; - } - if (image) atom->image[nlocal] = image[i]; - nlocal++; - } - - // need to reset atom->natoms inside LAMMPS - - bigint ncurrent = nlocal; - MPI_Allreduce(&ncurrent,&lmp->atom->natoms,1,MPI_LMP_BIGINT, - MPI_SUM,lmp->world); - - // init per-atom fix/compute/variable values for created atoms - - atom->data_fix_compute_variable(nlocal_prev,nlocal); - - // if global map exists, reset it - // invoke map_init() b/c atom count has grown - - if (lmp->atom->map_style) { - lmp->atom->map_init(); - lmp->atom->map_set(); - } - - // warn if new natoms is not correct - - if ((lmp->atom->natoms != natoms_prev + n) && (lmp->comm->me == 0)) - lmp->error->warning(FLERR,fmt::format("Library warning in " - "lammps_create_atoms: " - "invalid total atoms {} vs. {}", - lmp->atom->natoms,natoms_prev+n)); + lmp->error->all(FLERR,"Library function lammps_gather" + " not compatible with -DLAMMPS_BIGBIG"); } END_CAPTURE } +#else +void lammps_gather(void *ptr, char *name, int type, int count, void *data) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + int i,j,offset,fcid,ltype; + + // error if tags are not defined or not consecutive + int flag = 0; + if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) + flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (flag) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR,"Library error in lammps_gather"); + return; + } + + int natoms = static_cast (lmp->atom->natoms); + + void *vptr = lmp->atom->extract(name); + + if (vptr==nullptr && strstr(name,"f_") == name) { // fix + + fcid = lmp->modify->find_fix(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather: unknown fix id"); + return; + } + + if (lmp->modify->fix[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_gather:" + " fix does not return peratom data"); + return; + } + if (count>1 && lmp->modify->fix[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_gather:" + " count != values peratom for fix"); + return; + } + + if (lmp->update->ntimestep % lmp->modify->fix[fcid]->peratom_freq) { + lmp->error->all(FLERR,"lammps_gather:" + " fix not computed at compatible time"); + return; + } + + if(count==1) vptr = (void *) lmp->modify->fix[fcid]->vector_atom; + else vptr = (void *) lmp->modify->fix[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"c_") == name) { // compute + + fcid = lmp->modify->find_compute(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather: unknown compute id"); + return; + } + + if (lmp->modify->compute[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_gather:" + " compute does not return peratom data"); + return; + } + if (count>1 && lmp->modify->compute[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_gather:" + " count != values peratom for compute"); + return; + } + + if (lmp->modify->compute[fcid]->invoked_peratom != lmp->update->ntimestep) + lmp->modify->compute[fcid]->compute_peratom(); + + if(count==1) vptr = (void *) lmp->modify->compute[fcid]->vector_atom; + else vptr = (void *) lmp->modify->compute[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + + fcid = lmp->atom->find_custom(&name[2], ltype); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather: unknown property/atom id"); + return; + } + if (ltype != type) { + lmp->error->warning(FLERR,"lammps_gather: mismatch property/atom type"); + return; + } + if (count != 1) { + lmp->error->warning(FLERR,"lammps_gather: property/atom has count=1"); + return; + } + if(ltype==0) vptr = (void *) lmp->atom->ivector[fcid]; + else vptr = (void *) lmp->atom->dvector[fcid]; + + } + + + if (vptr == nullptr) { + lmp->error->warning(FLERR,"lammps_gather: unknown property name"); + return; + } + + // copy = Natom length vector of per-atom values + // use atom ID to insert each atom's values into copy + // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID + if (type==0) { + int *vector = nullptr; + int **array = nullptr; + + const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); + + if ((count == 1) || imgunpack) vector = (int *) vptr; + else array = (int **) vptr; + + int *copy; + lmp->memory->create(copy,count*natoms,"lib/gather:copy"); + for (i = 0; i < count*natoms; i++) copy[i] = 0; + + tagint *tag = lmp->atom->tag; + int nlocal = lmp->atom->nlocal; + + if (count == 1) { + for (i = 0; i < nlocal; i++) + copy[tag[i]-1] = vector[i]; + + } else if (imgunpack) { + for (i = 0; i < nlocal; i++) { + offset = count*(tag[i]-1); + const int image = vector[i]; + copy[offset++] = (image & IMGMASK) - IMGMAX; + copy[offset++] = ((image >> IMGBITS) & IMGMASK) - IMGMAX; + copy[offset++] = ((image >> IMG2BITS) & IMGMASK) - IMGMAX; + } + + } else { + for (i = 0; i < nlocal; i++) { + offset = count*(tag[i]-1); + for (j = 0; j < count; j++) + copy[offset++] = array[i][j]; + } + } + + MPI_Allreduce(copy,data,count*natoms,MPI_INT,MPI_SUM,lmp->world); + lmp->memory->destroy(copy); + + } else { + + double *vector = nullptr; + double **array = nullptr; + if (count == 1) vector = (double *) vptr; + else array = (double **) vptr; + + double *copy; + lmp->memory->create(copy,count*natoms,"lib/gather:copy"); + for (i = 0; i < count*natoms; i++) copy[i] = 0.0; + + tagint *tag = lmp->atom->tag; + int nlocal = lmp->atom->nlocal; + + if (count == 1) { + for (i = 0; i < nlocal; i++) + copy[tag[i]-1] = vector[i]; + } else { + for (i = 0; i < nlocal; i++) { + offset = count*(tag[i]-1); + for (j = 0; j < count; j++) + copy[offset++] = array[i][j]; + } + } + MPI_Allreduce(copy,data,count*natoms,MPI_DOUBLE,MPI_SUM,lmp->world); + lmp->memory->destroy(copy); + } + } + END_CAPTURE +} +#endif + +/* ---------------------------------------------------------------------- + Contributing author: Thomas Swinburne (CNRS & CINaM, Marseille, France) + gather the named atom-based entity for all atoms + return it in user-allocated data + data will be ordered by atom ID + requirement for consecutive atom IDs (1 to N) + see gather() to return data ordered by consecutive atom IDs + see gather_subset() to return data for only a subset of atoms + name = "x" , "f" or other atom properties + "d_name" or "i_name" for fix property/atom quantities + "f_fix", "c_compute" for fixes / computes + will return error if fix/compute doesn't isn't atom-based + type = 0 for integer values, 1 for double values + count = # of per-atom values, e.g. 1 for type or charge, 3 for x or f + use count = 3 with "image" if want single image flag unpacked into xyz + return atom-based values in 1d data, ordered by count, then by atom ID + e.g. x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],... + data must be pre-allocated by caller to correct length + correct length = count*Natoms, as queried by get_natoms() + method: + alloc and zero count*Natom length vector + loop over Nlocal to fill vector with my values + Allreduce to sum vector into data across all procs +------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_gather_concat(void *ptr, char * /*name*/, int /*type*/, + int /*count*/, void * /*data*/) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + lmp->error->all(FLERR,"Library function lammps_gather_concat" + " not compatible with -DLAMMPS_BIGBIG"); + } + END_CAPTURE +} +#else +void lammps_gather_concat(void *ptr, char *name, int type, int count, void *data) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + int i,j,offset,fcid,ltype; + + // error if tags are not defined or not consecutive + int flag = 0; + if (lmp->atom->tag_enable == 0) flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (flag) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR,"Library error in lammps_gather_concat"); + return; + } + + + int natoms = static_cast (lmp->atom->natoms); + + void *vptr = lmp->atom->extract(name); + + if (vptr==nullptr && strstr(name,"f_") == name) { // fix + + fcid = lmp->modify->find_fix(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather_concat: unknown fix id"); + return; + } + + if (lmp->modify->fix[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_gather_concat:" + " fix does not return peratom data"); + return; + } + if (count>1 && lmp->modify->fix[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_gather_concat:" + " count != values peratom for fix"); + return; + } + + + if (lmp->update->ntimestep % lmp->modify->fix[fcid]->peratom_freq) { + lmp->error->all(FLERR,"lammps_gather_concat:" + " fix not computed at compatible time"); + return; + } + + if(count==1) vptr = (void *) lmp->modify->fix[fcid]->vector_atom; + else vptr = (void *) lmp->modify->fix[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"c_") == name) { // compute + + fcid = lmp->modify->find_compute(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather_concat: unknown compute id"); + return; + } + + if (lmp->modify->compute[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_gather_concat:" + " compute does not return peratom data"); + return; + } + if (count>1 && lmp->modify->compute[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_gather_concat:" + " count != values peratom for compute"); + return; + } + + if (lmp->modify->compute[fcid]->invoked_peratom != lmp->update->ntimestep) + lmp->modify->compute[fcid]->compute_peratom(); + + if(count==1) vptr = (void *) lmp->modify->compute[fcid]->vector_atom; + else vptr = (void *) lmp->modify->compute[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + + fcid = lmp->atom->find_custom(&name[2], ltype); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather_concat: " + "unknown property/atom id"); + return; + } + if (ltype != type) { + lmp->error->warning(FLERR,"lammps_gather_concat: " + "mismatch property/atom type"); + return; + } + if (count != 1) { + lmp->error->warning(FLERR,"lammps_gather_concat: " + "property/atom has count=1"); + return; + } + if(ltype==0) vptr = (void *) lmp->atom->ivector[fcid]; + else vptr = (void *) lmp->atom->dvector[fcid]; + + } + + if (vptr == nullptr) { + lmp->error->warning(FLERR,"lammps_gather_concat: unknown property name"); + return; + } + + // perform MPI_Allgatherv on each proc's chunk of Nlocal atoms + + int nprocs = lmp->comm->nprocs; + + int *recvcounts,*displs; + lmp->memory->create(recvcounts,nprocs,"lib/gather:recvcounts"); + lmp->memory->create(displs,nprocs,"lib/gather:displs"); + + if (type == 0) { + int *vector = nullptr; + int **array = nullptr; + const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); + + if ((count == 1) || imgunpack) vector = (int *) vptr; + else array = (int **) vptr; + + int *copy; + lmp->memory->create(copy,count*natoms,"lib/gather:copy"); + for (i = 0; i < count*natoms; i++) copy[i] = 0; + + int nlocal = lmp->atom->nlocal; + + if (count == 1) { + MPI_Allgather(&nlocal,1,MPI_INT,recvcounts,1,MPI_INT,lmp->world); + displs[0] = 0; + for (i = 1; i < nprocs; i++) + displs[i] = displs[i-1] + recvcounts[i-1]; + MPI_Allgatherv(vector,nlocal,MPI_INT,data,recvcounts,displs, + MPI_INT,lmp->world); + + } else if (imgunpack) { + int *copy; + lmp->memory->create(copy,count*nlocal,"lib/gather:copy"); + offset = 0; + for (i = 0; i < nlocal; i++) { + const int image = vector[i]; + copy[offset++] = (image & IMGMASK) - IMGMAX; + copy[offset++] = ((image >> IMGBITS) & IMGMASK) - IMGMAX; + copy[offset++] = ((image >> IMG2BITS) & IMGMASK) - IMGMAX; + } + int n = count*nlocal; + MPI_Allgather(&n,1,MPI_INT,recvcounts,1,MPI_INT,lmp->world); + displs[0] = 0; + for (i = 1; i < nprocs; i++) + displs[i] = displs[i-1] + recvcounts[i-1]; + MPI_Allgatherv(copy,count*nlocal,MPI_INT, + data,recvcounts,displs,MPI_INT,lmp->world); + lmp->memory->destroy(copy); + + } else { + int n = count*nlocal; + MPI_Allgather(&n,1,MPI_INT,recvcounts,1,MPI_INT,lmp->world); + displs[0] = 0; + for (i = 1; i < nprocs; i++) + displs[i] = displs[i-1] + recvcounts[i-1]; + MPI_Allgatherv(&array[0][0],count*nlocal,MPI_INT, + data,recvcounts,displs,MPI_INT,lmp->world); + } + + } else { + double *vector = nullptr; + double **array = nullptr; + if (count == 1) vector = (double *) vptr; + else array = (double **) vptr; + + int nlocal = lmp->atom->nlocal; + + if (count == 1) { + MPI_Allgather(&nlocal,1,MPI_INT,recvcounts,1,MPI_INT,lmp->world); + displs[0] = 0; + for (i = 1; i < nprocs; i++) + displs[i] = displs[i-1] + recvcounts[i-1]; + MPI_Allgatherv(vector,nlocal,MPI_DOUBLE,data,recvcounts,displs, + MPI_DOUBLE,lmp->world); + + } else { + int n = count*nlocal; + MPI_Allgather(&n,1,MPI_INT,recvcounts,1,MPI_INT,lmp->world); + displs[0] = 0; + for (i = 1; i < nprocs; i++) + displs[i] = displs[i-1] + recvcounts[i-1]; + MPI_Allgatherv(&array[0][0],count*nlocal,MPI_DOUBLE, + data,recvcounts,displs,MPI_DOUBLE,lmp->world); + } + } + + lmp->memory->destroy(recvcounts); + lmp->memory->destroy(displs); + } + END_CAPTURE +} +#endif + +/* ---------------------------------------------------------------------- + Contributing author: Thomas Swinburne (CNRS & CINaM, Marseille, France) + gather the named atom-based entity for all atoms + return it in user-allocated data + data will be ordered by atom ID + requirement for consecutive atom IDs (1 to N) + see gather() to return data ordered by consecutive atom IDs + see gather_concat() to return data for all atoms, unordered + name = "x" , "f" or other atom properties + "d_name" or "i_name" for fix property/atom quantities + "f_fix", "c_compute" for fixes / computes + will return error if fix/compute doesn't isn't atom-based + type = 0 for integer values, 1 for double values + count = # of per-atom values, e.g. 1 for type or charge, 3 for x or f + use count = 3 with "image" if want single image flag unpacked into xyz + return atom-based values in 1d data, ordered by count, then by atom ID + e.g. x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],... + data must be pre-allocated by caller to correct length + correct length = count*Natoms, as queried by get_natoms() + method: + alloc and zero count*Natom length vector + loop over Nlocal to fill vector with my values + Allreduce to sum vector into data across all procs +------------------------------------------------------------------------- */ +#if defined(LAMMPS_BIGBIG) +void lammps_gather_subset(void *ptr, char * /*name */, + int /*type*/, int /*count*/, + int /*ndata*/, int * /*ids*/, void * /*data*/) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + lmp->error->all(FLERR,"Library function lammps_gather_subset() " + "is not compatible with -DLAMMPS_BIGBIG"); + } + END_CAPTURE +} +#else +void lammps_gather_subset(void *ptr, char *name, + int type, int count, + int ndata, int *ids, void *data) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + int i,j,m,offset,fcid,ltype; + tagint id; + + // error if tags are not defined or not consecutive + int flag = 0; + if (lmp->atom->tag_enable == 0) flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (flag) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR,"Library error in lammps_gather_subset"); + return; + } + + int natoms = static_cast (lmp->atom->natoms); + + void *vptr = lmp->atom->extract(name); + + if (vptr==nullptr && strstr(name,"f_") == name) { // fix + + fcid = lmp->modify->find_fix(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather_subset: unknown fix id"); + return; + } + + if (lmp->modify->fix[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_gather_subset:" + " fix does not return peratom data"); + return; + } + if (count>1 && lmp->modify->fix[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_gather_subset:" + " count != values peratom for fix"); + return; + } + + + if (lmp->update->ntimestep % lmp->modify->fix[fcid]->peratom_freq) { + lmp->error->all(FLERR,"lammps_gather_subset:" + " fix not computed at compatible time"); + return; + } + + if(count==1) vptr = (void *) lmp->modify->fix[fcid]->vector_atom; + else vptr = (void *) lmp->modify->fix[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"c_") == name) { // compute + + fcid = lmp->modify->find_compute(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather_subset: unknown compute id"); + return; + } + + if (lmp->modify->compute[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_gather_subset:" + " compute does not return peratom data"); + return; + } + if (count>1 && lmp->modify->compute[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_gather_subset:" + " count != values peratom for compute"); + return; + } + + if (lmp->modify->compute[fcid]->invoked_peratom != lmp->update->ntimestep) + lmp->modify->compute[fcid]->compute_peratom(); + + if(count==1) vptr = (void *) lmp->modify->compute[fcid]->vector_atom; + else vptr = (void *) lmp->modify->compute[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + + fcid = lmp->atom->find_custom(&name[2], ltype); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_gather_subset: " + "unknown property/atom id"); + return; + } + if (ltype != type) { + lmp->error->warning(FLERR,"lammps_gather_subset: " + "mismatch property/atom type"); + return; + } + if (count != 1) { + lmp->error->warning(FLERR,"lammps_gather_subset: " + "property/atom has count=1"); + return; + } + if(ltype==0) vptr = (void *) lmp->atom->ivector[fcid]; + else vptr = (void *) lmp->atom->dvector[fcid]; + + } + + if (vptr == nullptr) { + lmp->error->warning(FLERR,"lammps_gather_subset: " + "unknown property name"); + return; + } + + // copy = Ndata length vector of per-atom values + // use atom ID to insert each atom's values into copy + // MPI_Allreduce with MPI_SUM to merge into data + + if (type == 0) { + int *vector = nullptr; + int **array = nullptr; + const int imgunpack = (count == 3) && (strcmp(name,"image") == 0); + + if ((count == 1) || imgunpack) vector = (int *) vptr; + else array = (int **) vptr; + + int *copy; + lmp->memory->create(copy,count*ndata,"lib/gather:copy"); + for (i = 0; i < count*ndata; i++) copy[i] = 0; + + int nlocal = lmp->atom->nlocal; + + if (count == 1) { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0 && m < nlocal) + copy[i] = vector[m]; + } + + } else if (imgunpack) { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0 && m < nlocal) { + offset = count*i; + const int image = vector[m]; + copy[offset++] = (image & IMGMASK) - IMGMAX; + copy[offset++] = ((image >> IMGBITS) & IMGMASK) - IMGMAX; + copy[offset++] = ((image >> IMG2BITS) & IMGMASK) - IMGMAX; + } + } + + } else { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0 && m < nlocal) { + offset = count*i; + for (j = 0; j < count; j++) + copy[offset++] = array[m][j]; + } + } + } + + MPI_Allreduce(copy,data,count*ndata,MPI_INT,MPI_SUM,lmp->world); + lmp->memory->destroy(copy); + + } else { + double *vector = nullptr; + double **array = nullptr; + if (count == 1) vector = (double *) vptr; + else array = (double **) vptr; + + double *copy; + lmp->memory->create(copy,count*ndata,"lib/gather:copy"); + for (i = 0; i < count*ndata; i++) copy[i] = 0.0; + + int nlocal = lmp->atom->nlocal; + + if (count == 1) { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0 && m < nlocal) + copy[i] = vector[m]; + } + + } else { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0 && m < nlocal) { + offset = count*i; + for (j = 0; j < count; j++) + copy[offset++] = array[m][j]; + } + } + } + + MPI_Allreduce(copy,data,count*ndata,MPI_DOUBLE,MPI_SUM,lmp->world); + lmp->memory->destroy(copy); + } + } + END_CAPTURE +} +#endif + +/* ---------------------------------------------------------------------- + Contributing author: Thomas Swinburne (CNRS & CINaM, Marseille, France) + scatter the named atom-based entity in data to all atoms + data will be ordered by atom ID + requirement for consecutive atom IDs (1 to N) + see scatter_subset() to scatter data for some (or all) atoms, unordered + name = "x" , "f" or other atom properties + "d_name" or "i_name" for fix property/atom quantities + "f_fix", "c_compute" for fixes / computes + will return error if fix/compute doesn't isn't atom-based + type = 0 for integer values, 1 for double values + count = # of per-atom values, e.g. 1 for type or charge, 3 for x or f + use count = 3 with "image" if want single image flag unpacked into xyz + return atom-based values in 1d data, ordered by count, then by atom ID + e.g. x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],... + data must be pre-allocated by caller to correct length + correct length = count*Natoms, as queried by get_natoms() + method: + alloc and zero count*Natom length vector + loop over Nlocal to fill vector with my values + Allreduce to sum vector into data across all procs +------------------------------------------------------------------------- */ + +#if defined(LAMMPS_BIGBIG) +void lammps_scatter(void *ptr, char * /*name */, + int /*type*/, int /*count*/, void * /*data*/) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + lmp->error->all(FLERR,"Library function lammps_scatter() " + "is not compatible with -DLAMMPS_BIGBIG"); + } + END_CAPTURE +} +#else +void lammps_scatter(void *ptr, char *name, + int type, int count, void *data) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + int i,j,m,offset,fcid,ltype; + + // error if tags are not defined or not consecutive or no atom map + // NOTE: test that name = image or ids is not a 64-bit int in code? + + int flag = 0; + if (lmp->atom->tag_enable == 0 || lmp->atom->tag_consecutive() == 0) + flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; + if (flag) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR,"Library error in lammps_scatter"); + return; + } + + int natoms = static_cast (lmp->atom->natoms); + + void *vptr = lmp->atom->extract(name); + + if (vptr==nullptr && strstr(name,"f_") == name) { // fix + + fcid = lmp->modify->find_fix(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_scatter: unknown fix id"); + return; + } + + if (lmp->modify->fix[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_scatter:" + " fix does not return peratom data"); + return; + } + if (count>1 && lmp->modify->fix[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_scatter:" + " count != values peratom for fix"); + return; + } + + if(count==1) vptr = (void *) lmp->modify->fix[fcid]->vector_atom; + else vptr = (void *) lmp->modify->fix[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"c_") == name) { // compute + + fcid = lmp->modify->find_compute(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_scatter: unknown compute id"); + return; + } + + if (lmp->modify->compute[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_scatter:" + " compute does not return peratom data"); + return; + } + if (count>1 && lmp->modify->compute[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_scatter:" + " count != values peratom for compute"); + return; + } + + if (lmp->modify->compute[fcid]->invoked_peratom != lmp->update->ntimestep) + lmp->modify->compute[fcid]->compute_peratom(); + + if(count==1) vptr = (void *) lmp->modify->compute[fcid]->vector_atom; + else vptr = (void *) lmp->modify->compute[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + + fcid = lmp->atom->find_custom(&name[2], ltype); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_scatter: unknown property/atom id"); + return; + } + if (ltype != type) { + lmp->error->warning(FLERR,"lammps_scatter: mismatch property/atom type"); + return; + } + if (count != 1) { + lmp->error->warning(FLERR,"lammps_scatter: property/atom has count=1"); + return; + } + if(ltype==0) vptr = (void *) lmp->atom->ivector[fcid]; + else vptr = (void *) lmp->atom->dvector[fcid]; + + } + + if(vptr == nullptr) { + lmp->error->warning(FLERR,"lammps_scatter: unknown property name"); + return; + } + + // copy = Natom length vector of per-atom values + // use atom ID to insert each atom's values into copy + // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID + + if (type == 0) { + int *vector = nullptr; + int **array = nullptr; + const int imgpack = (count == 3) && (strcmp(name,"image") == 0); + + if ((count == 1) || imgpack) vector = (int *) vptr; + else array = (int **) vptr; + int *dptr = (int *) data; + + if (count == 1) { + for (i = 0; i < natoms; i++) + if ((m = lmp->atom->map(i+1)) >= 0) + vector[m] = dptr[i]; + + } else if (imgpack) { + for (i = 0; i < natoms; i++) + if ((m = lmp->atom->map(i+1)) >= 0) { + offset = count*i; + int image = dptr[offset++] + IMGMAX; + image += (dptr[offset++] + IMGMAX) << IMGBITS; + image += (dptr[offset++] + IMGMAX) << IMG2BITS; + vector[m] = image; + } + + } else { + for (i = 0; i < natoms; i++) + if ((m = lmp->atom->map(i+1)) >= 0) { + offset = count*i; + for (j = 0; j < count; j++) + array[m][j] = dptr[offset++]; + } + } + + } else { + double *vector = nullptr; + double **array = nullptr; + if (count == 1) vector = (double *) vptr; + else array = (double **) vptr; + double *dptr = (double *) data; + + if (count == 1) { + for (i = 0; i < natoms; i++) + if ((m = lmp->atom->map(i+1)) >= 0) + vector[m] = dptr[i]; + + } else { + for (i = 0; i < natoms; i++) { + if ((m = lmp->atom->map(i+1)) >= 0) { + offset = count*i; + for (j = 0; j < count; j++) + array[m][j] = dptr[offset++]; + } + } + } + } + } + END_CAPTURE +} +#endif + +/* ---------------------------------------------------------------------- + Contributing author: Thomas Swinburne (CNRS & CINaM, Marseille, France) + scatter the named atom-based entity in data to a subset of atoms + data is ordered by provided atom IDs + no requirement for consecutive atom IDs (1 to N) + see scatter_atoms() to scatter data for all atoms, ordered by consecutive IDs + name = desired quantity, e.g. x or charge + type = 0 for integer values, 1 for double values + count = # of per-atom values, e.g. 1 for type or charge, 3 for x or f + use count = 3 with "image" for xyz to be packed into single image flag + ndata = # of atoms in ids and data (could be all atoms) + ids = list of Ndata atom IDs to scatter data to + data = atom-based values in 1d data, ordered by count, then by atom ID + e.g. x[0][0],x[0][1],x[0][2],x[1][0],x[1][1],x[1][2],x[2][0],... + data must be correct length = count*Ndata + method: + loop over Ndata, if I own atom ID, set its values from data +------------------------------------------------------------------------- */ + +#if defined(LAMMPS_BIGBIG) +void lammps_scatter_subset(void *ptr, char * /*name */, + int /*type*/, int /*count*/, + int /*ndata*/, int * /*ids*/, void * /*data*/) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + lmp->error->all(FLERR,"Library function lammps_scatter_subset() " + "is not compatible with -DLAMMPS_BIGBIG"); + } + END_CAPTURE +} +#else +void lammps_scatter_subset(void *ptr, char *name, + int type, int count, + int ndata, int *ids, void *data) +{ + LAMMPS *lmp = (LAMMPS *) ptr; + + BEGIN_CAPTURE + { + int i,j,m,offset,fcid,ltype; + tagint id; + + // error if tags are not defined or no atom map + // NOTE: test that name = image or ids is not a 64-bit int in code? + + int flag = 0; + if (lmp->atom->tag_enable == 0) flag = 1; + if (lmp->atom->natoms > MAXSMALLINT) flag = 1; + if (lmp->atom->map_style == Atom::MAP_NONE) flag = 1; + if (flag) { + if (lmp->comm->me == 0) + lmp->error->warning(FLERR,"Library error in lammps_scatter_atoms_subset"); + return; + } + + void *vptr = lmp->atom->extract(name); + + if (vptr==nullptr && strstr(name,"f_") == name) { // fix + + fcid = lmp->modify->find_fix(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_scatter_subset: unknown fix id"); + return; + } + + if (lmp->modify->fix[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_scatter_subset:" + " fix does not return peratom data"); + return; + } + if (count>1 && lmp->modify->fix[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_scatter_subset:" + " count != values peratom for fix"); + return; + } + + if(count==1) vptr = (void *) lmp->modify->fix[fcid]->vector_atom; + else vptr = (void *) lmp->modify->fix[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"c_") == name) { // compute + + fcid = lmp->modify->find_compute(&name[2]); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_scatter_subset: unknown compute id"); + return; + } + + if (lmp->modify->compute[fcid]->peratom_flag == 0) { + lmp->error->warning(FLERR,"lammps_scatter_subset:" + " compute does not return peratom data"); + return; + } + if (count>1 && lmp->modify->compute[fcid]->size_peratom_cols != count) { + lmp->error->warning(FLERR,"lammps_scatter_subset:" + " count != values peratom for compute"); + return; + } + + if (lmp->modify->compute[fcid]->invoked_peratom != lmp->update->ntimestep) + lmp->modify->compute[fcid]->compute_peratom(); + + if(count==1) vptr = (void *) lmp->modify->compute[fcid]->vector_atom; + else vptr = (void *) lmp->modify->compute[fcid]->array_atom; + + + } + + if (vptr==nullptr && strstr(name,"d_") == name) { // property / atom + + fcid = lmp->atom->find_custom(&name[2], ltype); + if (fcid < 0) { + lmp->error->warning(FLERR,"lammps_scatter_subset: " + "unknown property/atom id"); + return; + } + if (ltype != type) { + lmp->error->warning(FLERR,"lammps_scatter_subset: " + "mismatch property/atom type"); + return; + } + if (count != 1) { + lmp->error->warning(FLERR,"lammps_scatter_subset: " + "property/atom has count=1"); + return; + } + if(ltype==0) vptr = (void *) lmp->atom->ivector[fcid]; + else vptr = (void *) lmp->atom->dvector[fcid]; + + } + + if(vptr == nullptr) { + lmp->error->warning(FLERR,"lammps_scatter_atoms_subset: " + "unknown property name"); + return; + } + + // copy = Natom length vector of per-atom values + // use atom ID to insert each atom's values into copy + // MPI_Allreduce with MPI_SUM to merge into data, ordered by atom ID + + if (type == 0) { + int *vector = nullptr; + int **array = nullptr; + const int imgpack = (count == 3) && (strcmp(name,"image") == 0); + + if ((count == 1) || imgpack) vector = (int *) vptr; + else array = (int **) vptr; + int *dptr = (int *) data; + + if (count == 1) { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) + vector[m] = dptr[i]; + } + + } else if (imgpack) { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) { + offset = count*i; + int image = dptr[offset++] + IMGMAX; + image += (dptr[offset++] + IMGMAX) << IMGBITS; + image += (dptr[offset++] + IMGMAX) << IMG2BITS; + vector[m] = image; + } + } + + } else { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) { + offset = count*i; + for (j = 0; j < count; j++) + array[m][j] = dptr[offset++]; + } + } + } + + } else { + double *vector = nullptr; + double **array = nullptr; + if (count == 1) vector = (double *) vptr; + else array = (double **) vptr; + double *dptr = (double *) data; + + if (count == 1) { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) + vector[m] = dptr[i]; + } + + } else { + for (i = 0; i < ndata; i++) { + id = ids[i]; + if ((m = lmp->atom->map(id)) >= 0) { + offset = count*i; + for (j = 0; j < count; j++) + array[m][j] = dptr[offset++]; + } + } + } + } + } + END_CAPTURE +} +#endif + /* ---------------------------------------------------------------------- find fix external with given ID and set the callback function and caller pointer ------------------------------------------------------------------------- */ -void lammps_set_fix_external_callback(void *ptr, char *id, FixExternalFnPtr callback_ptr, void * caller) +void lammps_set_fix_external_callback(void *handle, char *id, FixExternalFnPtr callback_ptr, void * caller) { - LAMMPS *lmp = (LAMMPS *) ptr; + LAMMPS *lmp = (LAMMPS *) handle; FixExternal::FnPtr callback = (FixExternal::FnPtr) callback_ptr; + BEGIN_CAPTURE + { + int ifix = lmp->modify->find_fix(id); + if (ifix < 0) { + char str[128]; + snprintf(str, 128, "Can not find fix with ID '%s'!", id); + lmp->error->all(FLERR,str); + } + + Fix *fix = lmp->modify->fix[ifix]; + + if (strcmp("external",fix->style) != 0){ + char str[128]; + snprintf(str, 128, "Fix '%s' is not of style external!", id); + lmp->error->all(FLERR,str); + } + + FixExternal * fext = (FixExternal*) fix; + fext->set_callback(callback, caller); + } + END_CAPTURE +} + +/* set global energy contribution from fix external */ +void lammps_fix_external_set_energy_global(void *handle, char *id, + double energy) +{ + LAMMPS *lmp = (LAMMPS *) handle; + BEGIN_CAPTURE { int ifix = lmp->modify->find_fix(id); @@ -1614,127 +3876,448 @@ void lammps_set_fix_external_callback(void *ptr, char *id, FixExternalFnPtr call lmp->error->all(FLERR,fmt::format("Fix '{}' is not of style external!", id)); FixExternal * fext = (FixExternal*) fix; - fext->set_callback(callback, caller); + fext->set_energy_global(energy); } END_CAPTURE } +/* set global virial contribution from fix external */ +void lammps_fix_external_set_virial_global(void *handle, char *id, + double *virial) +{ + LAMMPS *lmp = (LAMMPS *) handle; -// ---------------------------------------------------------------------- -// library API functions for accessing LAMMPS configuration -// ---------------------------------------------------------------------- + BEGIN_CAPTURE + { + int ifix = lmp->modify->find_fix(id); + if (ifix < 0) + lmp->error->all(FLERR,fmt::format("Can not find fix with ID '{}'!", id)); -int lammps_config_has_package(char * package_name) { - return Info::has_package(package_name); + Fix *fix = lmp->modify->fix[ifix]; + + if (strcmp("external",fix->style) != 0) + lmp->error->all(FLERR,fmt::format("Fix '{}' is not of style external!", id)); + + FixExternal * fext = (FixExternal*) fix; + fext->set_virial_global(virial); + } + END_CAPTURE } +// ---------------------------------------------------------------------- +// Library functions for accessing LAMMPS configuration +// ---------------------------------------------------------------------- + +/** Check if a specific package has been included in LAMMPS + * +\verbatim embed:rst +This function checks if the LAMMPS library in use includes the +specific :doc:`LAMMPS package ` provided as argument. +\endverbatim + * + * \param name string with the name of the package + * \return 1 if included, 0 if not. + */ +int lammps_config_has_package(const char *name) { + return Info::has_package(name) ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + +/** Count the number of installed packages in the LAMMPS library. + * +\verbatim embed:rst +This function counts how many :doc:`LAMMPS packages ` are +included in the LAMMPS library in use. +\endverbatim + * + * \return number of packages included + */ int lammps_config_package_count() { int i = 0; - while(LAMMPS::installed_packages[i] != NULL) { + while(LAMMPS::installed_packages[i] != nullptr) { ++i; } return i; } -int lammps_config_package_name(int index, char * buffer, int max_size) { - int i = 0; - while(LAMMPS::installed_packages[i] != NULL && i < index) { - ++i; +/* ---------------------------------------------------------------------- */ + +/** Get the name of a package in the list of installed packages in the LAMMPS library. + * +\verbatim embed:rst +This function copies the name of the package with the index *idx* into the +provided C-style string buffer. The length of the buffer must be provided +as *buf_size* argument. If the name of the package exceeds the length of the +buffer, it will be truncated accordingly. If the index is out of range, +the function returns 0 and *buffer* is set to an empty string, otherwise 1; +\endverbatim + * + * \param idx index of the package in the list of included packages (0 <= idx < package count) + * \param buffer string buffer to copy the name of the package to + * \param buf_size size of the provided string buffer + * \return 1 if successful, otherwise 0 + */ +int lammps_config_package_name(int idx, char *buffer, int buf_size) { + int maxidx = lammps_config_package_count(); + if ((idx < 0) || (idx >= maxidx)) { + buffer[0] = '\0'; + return 0; } - if(LAMMPS::installed_packages[i] != NULL) { - strncpy(buffer, LAMMPS::installed_packages[i], max_size); - return true; - } - - return false; + strncpy(buffer, LAMMPS::installed_packages[idx], buf_size); + return 1; } -int lammps_has_style(void * ptr, char * category, char * name) { - LAMMPS *lmp = (LAMMPS *) ptr; +/* ---------------------------------------------------------------------- */ + +/** Check if a specific style has been included in LAMMPS + * +\verbatim embed:rst +This function checks if the LAMMPS library in use includes the +specific *style* of a specific *category* provided as an argument. +Valid categories are: *atom*\ , *integrate*\ , *minimize*\ , +*pair*\ , *bond*\ , *angle*\ , *dihedral*\ , *improper*\ , *kspace*\ , +*compute*\ , *fix*\ , *region*\ , *dump*\ , and *command*\ . +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param category category of the style + * \param name name of the style + * \return 1 if included, 0 if not. + */ +int lammps_has_style(void *handle, const char *category, const char *name) { + LAMMPS *lmp = (LAMMPS *) handle; Info info(lmp); - return info.has_style(category, name); + return info.has_style(category, name) ? 1 : 0; } -int lammps_style_count(void * ptr, char * category) { - LAMMPS *lmp = (LAMMPS *) ptr; +/* ---------------------------------------------------------------------- */ + +/** Count the number of styles of category in the LAMMPS library. + * +\verbatim embed:rst +This function counts how many styles in the provided *category* +are included in the LAMMPS library in use. +Please see :cpp:func:`lammps_has_style` for a list of valid +categories. +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param category category of styles + * \return number of styles in category + */ +int lammps_style_count(void *handle, const char *category) { + LAMMPS *lmp = (LAMMPS *) handle; Info info(lmp); return info.get_available_styles(category).size(); } -int lammps_style_name(void* ptr, char * category, int index, char * buffer, int max_size) { - LAMMPS *lmp = (LAMMPS *) ptr; +/* ---------------------------------------------------------------------- */ + +/** Look up the name of a style by index in the list of style of a given category in the LAMMPS library. + * + * + * This function copies the name of the *category* style with the index + * *idx* into the provided C-style string buffer. The length of the buffer + * must be provided as *buf_size* argument. If the name of the style + * exceeds the length of the buffer, it will be truncated accordingly. + * If the index is out of range, the function returns 0 and *buffer* is + * set to an empty string, otherwise 1. + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param category category of styles + * \param idx index of the style in the list of *category* styles (0 <= idx < style count) + * \param buffer string buffer to copy the name of the style to + * \param buf_size size of the provided string buffer + * \return 1 if successful, otherwise 0 + */ +int lammps_style_name(void *handle, const char *category, int idx, + char *buffer, int buf_size) { + LAMMPS *lmp = (LAMMPS *) handle; Info info(lmp); auto styles = info.get_available_styles(category); - if (index < (int)styles.size()) { - strncpy(buffer, styles[index].c_str(), max_size); - return true; + if ((idx >=0) && (idx < (int) styles.size())) { + strncpy(buffer, styles[idx].c_str(), buf_size); + return 1; } - return false; + buffer[0] = '\0'; + return 0; } -int lammps_config_has_gzip_support() { - return Info::has_gzip_support(); -} +/* ---------------------------------------------------------------------- */ -int lammps_config_has_png_support() { - return Info::has_png_support(); -} +/** Check if a specific ID exists in the current LAMMPS instance + * +\verbatim embed:rst +This function checks if the current LAMMPS instance a *category* ID of +the given *name* exists. Valid categories are: *compute*\ , *dump*\ , +*fix*\ , *group*\ , *molecule*\ , *region*\ , and *variable*\ . +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param category category of the id + * \param name name of the id + * \return 1 if included, 0 if not. + */ +int lammps_has_id(void *handle, const char *category, const char *name) { + LAMMPS *lmp = (LAMMPS *) handle; -int lammps_config_has_jpeg_support() { - return Info::has_jpeg_support(); -} - -int lammps_config_has_ffmpeg_support() { - return Info::has_ffmpeg_support(); -} - -int lammps_config_has_exceptions() { - return Info::has_exceptions(); -} - -// ---------------------------------------------------------------------- -// library API functions for error handling -// ---------------------------------------------------------------------- - -#ifdef LAMMPS_EXCEPTIONS - -/* ---------------------------------------------------------------------- - check if a new error message -------------------------------------------------------------------------- */ - -int lammps_has_error(void *ptr) { - LAMMPS *lmp = (LAMMPS *)ptr; - Error *error = lmp->error; - return (error->get_last_error().empty()) ? 0 : 1; -} - -/* ---------------------------------------------------------------------- - copy the last error message of LAMMPS into a character buffer - return value encodes which type of error: - 1 = normal error (recoverable) - 2 = abort error (non-recoverable) -------------------------------------------------------------------------- */ - -int lammps_get_last_error_message(void *ptr, char * buffer, int buffer_size) { - LAMMPS *lmp = (LAMMPS *)ptr; - Error *error = lmp->error; - - if(!error->get_last_error().empty()) { - int error_type = error->get_last_error_type(); - strncpy(buffer, error->get_last_error().c_str(), buffer_size-1); - error->set_last_error("", ERROR_NONE); - return error_type; + if (strcmp(category,"compute") == 0) { + int ncompute = lmp->modify->ncompute; + Compute **compute = lmp->modify->compute; + for (int i=0; i < ncompute; ++i) { + if (strcmp(name,compute[i]->id) == 0) return 1; + } + } else if (strcmp(category,"dump") == 0) { + int ndump = lmp->output->ndump; + Dump **dump = lmp->output->dump; + for (int i=0; i < ndump; ++i) { + if (strcmp(name,dump[i]->id) == 0) return 1; + } + } else if (strcmp(category,"fix") == 0) { + int nfix = lmp->modify->nfix; + Fix **fix = lmp->modify->fix; + for (int i=0; i < nfix; ++i) { + if (strcmp(name,fix[i]->id) == 0) return 1; + } + } else if (strcmp(category,"group") == 0) { + int ngroup = lmp->group->ngroup; + char **groups = lmp->group->names; + for (int i=0; i < ngroup; ++i) { + if (strcmp(groups[i],name) == 0) return 1; + } + } else if (strcmp(category,"molecule") == 0) { + int nmolecule = lmp->atom->nmolecule; + Molecule **molecule = lmp->atom->molecules; + for (int i=0; i < nmolecule; ++i) { + if (strcmp(name,molecule[i]->id) == 0) return 1; + } + } else if (strcmp(category,"region") == 0) { + int nregion = lmp->domain->nregion; + Region **region = lmp->domain->regions; + for (int i=0; i < nregion; ++i) { + if (strcmp(name,region[i]->id) == 0) return 1; + } + } else if (strcmp(category,"variable") == 0) { + int nvariable = lmp->input->variable->nvar; + char **varnames = lmp->input->variable->names; + for (int i=0; i < nvariable; ++i) { + if (strcmp(name,varnames[i]) == 0) return 1; + } } return 0; } -#endif +/* ---------------------------------------------------------------------- */ -/******************************************************************************* - * Find neighbor list index of pair style neighbor list +/** Count the number of IDs of a category. + * +\verbatim embed:rst +This function counts how many IDs in the provided *category* +are defined in the current LAMMPS instance. +Please see :cpp:func:`lammps_has_id` for a list of valid +categories. +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param category category of IDs + * \return number of IDs in category + */ +int lammps_id_count(void *handle, const char *category) { + LAMMPS *lmp = (LAMMPS *) handle; + if (strcmp(category,"compute") == 0) { + return lmp->modify->ncompute; + } else if (strcmp(category,"dump") == 0) { + return lmp->output->ndump; + } else if (strcmp(category,"fix") == 0) { + return lmp->modify->nfix; + } else if (strcmp(category,"group") == 0) { + return lmp->group->ngroup; + } else if (strcmp(category,"molecule") == 0) { + return lmp->atom->nmolecule; + } else if (strcmp(category,"region") == 0) { + return lmp->domain->nregion; + } else if (strcmp(category,"variable") == 0) { + return lmp->input->variable->nvar; + } + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/** Look up the name of an ID by index in the list of IDs of a given category. + * + * This function copies the name of the *category* ID with the index + * *idx* into the provided C-style string buffer. The length of the buffer + * must be provided as *buf_size* argument. If the name of the style + * exceeds the length of the buffer, it will be truncated accordingly. + * If the index is out of range, the function returns 0 and *buffer* is + * set to an empty string, otherwise 1. + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param category category of IDs + * \param idx index of the ID in the list of *category* styles (0 <= idx < count) + * \param buffer string buffer to copy the name of the style to + * \param buf_size size of the provided string buffer + * \return 1 if successful, otherwise 0 + */ +int lammps_id_name(void *handle, const char *category, int idx, + char *buffer, int buf_size) { + LAMMPS *lmp = (LAMMPS *) handle; + + if (strcmp(category,"compute") == 0) { + if ((idx >=0) && (idx < lmp->modify->ncompute)) { + strncpy(buffer, lmp->modify->compute[idx]->id, buf_size); + return 1; + } + } else if (strcmp(category,"dump") == 0) { + if ((idx >=0) && (idx < lmp->output->ndump)) { + strncpy(buffer, lmp->output->dump[idx]->id, buf_size); + return 1; + } + } else if (strcmp(category,"fix") == 0) { + if ((idx >=0) && (idx < lmp->modify->nfix)) { + strncpy(buffer, lmp->modify->fix[idx]->id, buf_size); + return 1; + } + } else if (strcmp(category,"group") == 0) { + if ((idx >=0) && (idx < lmp->group->ngroup)) { + strncpy(buffer, lmp->group->names[idx], buf_size); + return 1; + } + } else if (strcmp(category,"molecule") == 0) { + if ((idx >=0) && (idx < lmp->atom->nmolecule)) { + strncpy(buffer, lmp->atom->molecules[idx]->id, buf_size); + return 1; + } + } else if (strcmp(category,"region") == 0) { + if ((idx >=0) && (idx < lmp->domain->nregion)) { + strncpy(buffer, lmp->domain->regions[idx]->id, buf_size); + return 1; + } + } else if (strcmp(category,"variable") == 0) { + if ((idx >=0) && (idx < lmp->input->variable->nvar)) { + strncpy(buffer, lmp->input->variable->names[idx], buf_size); + return 1; + } + } + buffer[0] = '\0'; + return 0; +} + +/* ---------------------------------------------------------------------- */ + +/** This function is used to query whether LAMMPS was compiled with + * a real MPI library or in serial. + * + * \return 0 when compiled with MPI STUBS, otherwise 1 */ + +int lammps_config_has_mpi_support() +{ +#ifdef MPI_STUBS + return 0; +#else + return 1; +#endif +} + +/* ---------------------------------------------------------------------- */ + +/** Check if the LAMMPS library supports compressed files via a pipe to gzip + +\verbatim embed:rst +Several LAMMPS commands (e.g. :doc:`read_data`, :doc:`write_data`, +:doc:`dump styles atom, custom, and xyz `) support reading and +writing compressed files via creating a pipe to the ``gzip`` program. +This function checks whether this feature was :ref:`enabled at compile +time `. It does **not** check whether the ``gzip`` itself is +installed and usable. +\endverbatim + * + * \return 1 if yes, otherwise 0 + */ +int lammps_config_has_gzip_support() { + return Info::has_gzip_support() ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + +/** Check if the LAMMPS library supports writing PNG format images + +\verbatim embed:rst +The LAMMPS :doc:`dump style image ` supports writing multiple +image file formats. Most of them need, however, support from an external +library and using that has to be :ref:`enabled at compile time `. +This function checks whether support for the `PNG image file format +`_ is available +in the current LAMMPS library. +\endverbatim + * + * \return 1 if yes, otherwise 0 + */ +int lammps_config_has_png_support() { + return Info::has_png_support() ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + +/** Check if the LAMMPS library supports writing JPEG format images + +\verbatim embed:rst +The LAMMPS :doc:`dump style image ` supports writing multiple +image file formats. Most of them need, however, support from an external +library and using that has to be :ref:`enabled at compile time `. +This function checks whether support for the `JPEG image file format +`_ is available in the current LAMMPS library. +\endverbatim + * + * \return 1 if yes, otherwise 0 + */ +int lammps_config_has_jpeg_support() { + return Info::has_jpeg_support() ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + +/** Check if the LAMMPS library supports creating movie files via a pipe to ffmpeg + +\verbatim embed:rst +The LAMMPS :doc:`dump style movie ` supports generating movies +from images on-the-fly via creating a pipe to the +`ffmpeg `_ program. +This function checks whether this feature was :ref:`enabled at compile time `. +It does **not** check whether the ``ffmpeg`` itself is installed and usable. +\endverbatim + * + * \return 1 if yes, otherwise 0 + */ +int lammps_config_has_ffmpeg_support() { + return Info::has_ffmpeg_support() ? 1 : 0; +} + +/* ---------------------------------------------------------------------- */ + +/** Check whether LAMMPS errors will throw a C++ exception + * +\verbatim embed:rst +In case of errors LAMMPS will either abort or throw a C++ exception. +The latter has to be :ref:`enabled at compile time `. +This function checks if exceptions were enabled. +\endverbatim + * \return 1 if yes, otherwise 0 + */ +int lammps_config_has_exceptions() { + return Info::has_exceptions() ? 1 : 0; +} + +// ---------------------------------------------------------------------- +// Library functions for accessing neighbor lists +// ---------------------------------------------------------------------- + +/** Find neighbor list index of pair style neighbor list * * Try finding pair instance that matches style. If exact is set, the pair must * match style exactly. If exact is 0, style must only be contained. If pair is @@ -1745,21 +4328,21 @@ int lammps_get_last_error_message(void *ptr, char * buffer, int buffer_size) { * index. Thus, providing this request index ensures that the correct neighbor * list index is returned. * - * @param ptr Pointer to LAMMPS instance - * @param style String used to search for pair style instance - * @param exact Flag to control whether style should match exactly or only + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param style String used to search for pair style instance + * \param exact Flag to control whether style should match exactly or only * must be contained in pair style name - * @param nsub match nsub-th hybrid sub-style - * @param request request index that specifies which neighbor list should be + * \param nsub match nsub-th hybrid sub-style + * \param request request index that specifies which neighbor list should be * returned, in case there are multiple neighbor lists requests * for the found pair style - * @return return neighbor list index if found, otherwise -1 - ******************************************************************************/ -int lammps_find_pair_neighlist(void* ptr, char * style, int exact, int nsub, int request) { - LAMMPS * lmp = (LAMMPS *) ptr; + * \return return neighbor list index if found, otherwise -1 + */ +int lammps_find_pair_neighlist(void* handle, char * style, int exact, int nsub, int request) { + LAMMPS * lmp = (LAMMPS *) handle; Pair* pair = lmp->force->pair_match(style, exact, nsub); - if (pair != NULL) { + if (pair != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -1773,18 +4356,19 @@ int lammps_find_pair_neighlist(void* ptr, char * style, int exact, int nsub, int return -1; } -/******************************************************************************* - * Find neighbor list index of fix neighbor list +/* ---------------------------------------------------------------------- */ + +/** Find neighbor list index of fix neighbor list * - * @param ptr Pointer to LAMMPS instance - * @param id Identifier of fix instance - * @param request request index that specifies which request should be returned, + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param id Identifier of fix instance + * \param request request index that specifies which request should be returned, * in case there are multiple neighbor lists for this fix - * @return return neighbor list index if found, otherwise -1 - ******************************************************************************/ -int lammps_find_fix_neighlist(void* ptr, char * id, int request) { - LAMMPS * lmp = (LAMMPS *) ptr; - Fix* fix = NULL; + * \return return neighbor list index if found, otherwise -1 + */ +int lammps_find_fix_neighlist(void* handle, char * id, int request) { + LAMMPS * lmp = (LAMMPS *) handle; + Fix* fix = nullptr; const int nfix = lmp->modify->nfix; // find fix with name @@ -1795,7 +4379,7 @@ int lammps_find_fix_neighlist(void* ptr, char * id, int request) { } } - if (fix != NULL) { + if (fix != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -1809,18 +4393,19 @@ int lammps_find_fix_neighlist(void* ptr, char * id, int request) { return -1; } -/******************************************************************************* - * Find neighbor list index of compute neighbor list +/* ---------------------------------------------------------------------- */ + +/** Find neighbor list index of compute neighbor list * - * @param ptr Pointer to LAMMPS instance - * @param id Identifier of fix instance - * @param request request index that specifies which request should be returned, + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param id Identifier of fix instance + * \param request request index that specifies which request should be returned, * in case there are multiple neighbor lists for this fix - * @return return neighbor list index if found, otherwise -1 - ******************************************************************************/ -int lammps_find_compute_neighlist(void* ptr, char * id, int request) { - LAMMPS * lmp = (LAMMPS *) ptr; - Compute* compute = NULL; + * \return return neighbor list index if found, otherwise -1 + */ +int lammps_find_compute_neighlist(void* handle, char * id, int request) { + LAMMPS * lmp = (LAMMPS *) handle; + Compute* compute = nullptr; const int ncompute = lmp->modify->ncompute; // find compute with name @@ -1831,7 +4416,7 @@ int lammps_find_compute_neighlist(void* ptr, char * id, int request) { } } - if (compute == NULL) { + if (compute != nullptr) { // find neigh list for (int i = 0; i < lmp->neighbor->nlist; i++) { NeighList * list = lmp->neighbor->lists[i]; @@ -1845,16 +4430,17 @@ int lammps_find_compute_neighlist(void* ptr, char * id, int request) { return -1; } -/******************************************************************************* - * Return the number of entries in the neighbor list with given index +/* ---------------------------------------------------------------------- */ + +/** Return the number of entries in the neighbor list with given index * - * @param ptr Pointer to LAMMPS instance - * @param idx neighbor list index - * @return return number of entries in neighbor list, -1 if idx is + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param idx neighbor list index + * \return return number of entries in neighbor list, -1 if idx is * not a valid index - ******************************************************************************/ -int lammps_neighlist_num_elements(void * ptr, int idx) { - LAMMPS * lmp = (LAMMPS *) ptr; + */ +int lammps_neighlist_num_elements(void * handle, int idx) { + LAMMPS * lmp = (LAMMPS *) handle; Neighbor * neighbor = lmp->neighbor; if(idx < 0 || idx >= neighbor->nlist) { @@ -1865,25 +4451,26 @@ int lammps_neighlist_num_elements(void * ptr, int idx) { return list->inum; } -/******************************************************************************* - * Return atom local index, number of neighbors, and array of neighbor local +/* ---------------------------------------------------------------------- */ + +/** Return atom local index, number of neighbors, and array of neighbor local * atom indices of neighbor list entry * - * @param ptr Pointer to LAMMPS instance - * @param idx neighbor list index - * @param element neighbor list element index - * @param[out] iatom atom local index in range [0, nlocal + nghost), -1 if - invalid idx or element index - * @param[out] numneigh number of neighbors of atom i or 0 - * @param[out] neighbors pointer to array of neighbor atom local indices or + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param idx index of this neighbor list in the list of all neighbor lists + * \param element index of this neighbor list entry + * \param[out] iatom local atom index (i.e. in the range [0, nlocal + nghost), -1 if + invalid idx or element value + * \param[out] numneigh number of neighbors of atom iatom or 0 + * \param[out] neighbors pointer to array of neighbor atom local indices or * NULL - ******************************************************************************/ -void lammps_neighlist_element_neighbors(void * ptr, int idx, int element, int * iatom, int * numneigh, int ** neighbors) { - LAMMPS * lmp = (LAMMPS *) ptr; + */ +void lammps_neighlist_element_neighbors(void * handle, int idx, int element, int * iatom, int * numneigh, int ** neighbors) { + LAMMPS * lmp = (LAMMPS *) handle; Neighbor * neighbor = lmp->neighbor; *iatom = -1; *numneigh = 0; - *neighbors = NULL; + *neighbors = nullptr; if(idx < 0 || idx >= neighbor->nlist) { return; @@ -1900,3 +4487,181 @@ void lammps_neighlist_element_neighbors(void * ptr, int idx, int element, int * *numneigh = list->numneigh[i]; *neighbors = list->firstneigh[i]; } + +// ---------------------------------------------------------------------- +// utility functions +// ---------------------------------------------------------------------- + +/** Encode three integer image flags into a single imageint. + * +\verbatim embed:rst + +The prototype for this function when compiling with ``-DLAMMPS_BIGBIG`` +is: + +.. code-block:: c + + int64_t lammps_encode_image_flags(int ix, int iy, int iz); + +This function performs the bit-shift, addition, and bit-wise OR +operations necessary to combine the values of three integers +representing the image flags in x-, y-, and z-direction. Unless +LAMMPS is compiled with -DLAMMPS_BIGBIG, those integers are +limited 10-bit signed integers [-512, 511]. Otherwise the return +type changes from ``int`` to ``int64_t`` and the valid range for +the individual image flags becomes [-1048576,1048575], +i.e. that of a 21-bit signed integer. There is no check on whether +the arguments conform to these requirements. + +\endverbatim + * + * \param ix image flag value in x + * \param iy image flag value in y + * \param iz image flag value in z + * \return encoded image flag integer */ + +imageint lammps_encode_image_flags(int ix, int iy, int iz) +{ + imageint image = ((imageint) (ix + IMGMAX) & IMGMASK) | + (((imageint) (iy + IMGMAX) & IMGMASK) << IMGBITS) | + (((imageint) (iz + IMGMAX) & IMGMASK) << IMG2BITS); + return image; +} + +/* ---------------------------------------------------------------------- */ + +/** Decode a single image flag integer into three regular integers + * +\verbatim embed:rst + +The prototype for this function when compiling with ``-DLAMMPS_BIGBIG`` +is: + +.. code-block:: c + + void lammps_decode_image_flags(int64_t image, int *flags); + +This function does the reverse operation of +:cpp:func:`lammps_encode_image_flags` and takes an image flag integer +does the bit-shift and bit-masking operations to decode it and stores +the resulting three regular integers into the buffer pointed to by +*flags*. + +\endverbatim + * + * \param image encoded image flag integer + * \param flags pointer to storage where the decoded image flags are stored. */ + +void lammps_decode_image_flags(imageint image, int *flags) +{ + flags[0] = (image & IMGMASK) - IMGMAX; + flags[1] = (image >> IMGBITS & IMGMASK) - IMGMAX; + flags[2] = (image >> IMG2BITS) - IMGMAX; +} + +/** Check if LAMMPS is currently inside a run or minimization + * + * This function can be used from signal handlers or multi-threaded + * applications to determine if the LAMMPS instance is currently active. + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \return 0 if idle or >0 if active */ + +int lammps_is_running(void *handle) +{ + LAMMPS * lmp = (LAMMPS *) handle; + return lmp->update->whichflag; +} + +/** Force a timeout to cleanly stop an ongoing run + * + * This function can be used from signal handlers or multi-threaded + * applications to cleanly terminate an ongoing run. + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *`` */ + +void lammps_force_timeout(void *handle) +{ + LAMMPS * lmp = (LAMMPS *) handle; + return lmp->timer->force_timeout(); +} + +// ---------------------------------------------------------------------- +// Library functions for error handling with exceptions enabled +// ---------------------------------------------------------------------- + +/** Check if there is a (new) error message available + +\verbatim embed:rst +This function can be used to query if an error inside of LAMMPS +has thrown a :ref:`C++ exception `. + +.. note: + + This function will always report "no error" when the LAMMPS library + has been compiled without ``-DLAMMPS_EXCEPTIONS`` which turns fatal + errors aborting LAMMPS into a C++ exceptions. You can use the library + function :cpp:func:`lammps_config_has_exceptions` to check if this is + the case. +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \return 0 on no error, 1 on error. + */ +int lammps_has_error(void *handle) { +#ifdef LAMMPS_EXCEPTIONS + LAMMPS * lmp = (LAMMPS *) handle; + Error * error = lmp->error; + return (error->get_last_error().empty()) ? 0 : 1; +#else + return 0; +#endif +} + +/* ---------------------------------------------------------------------- */ + +/** Copy the last error message into the provided buffer + +\verbatim embed:rst +This function can be used to retrieve the error message that was set +in the event of an error inside of LAMMPS which resulted in a +:ref:`C++ exception `. A suitable buffer for a C-style +string has to be provided and its length. If the internally stored +error message is longer, it will be truncated accordingly. The return +value of the function corresponds to the kind of error: a "1" indicates +an error that occurred on all MPI ranks and is often recoverable, while +a "2" indicates an abort that would happen only in a single MPI rank +and thus may not be recoverable as other MPI ranks may be waiting on +the failing MPI ranks to send messages. + +.. note: + + This function will do nothing when the LAMMPS library has been + compiled without ``-DLAMMPS_EXCEPTIONS`` which turns errors aborting + LAMMPS into a C++ exceptions. You can use the library function + :cpp:func:`lammps_config_has_exceptions` to check if this is the case. +\endverbatim + * + * \param handle pointer to a previously created LAMMPS instance cast to ``void *``. + * \param buffer string buffer to copy the error message to + * \param buf_size size of the provided string buffer + * \return 1 when all ranks had the error, 1 on a single rank error. + */ +int lammps_get_last_error_message(void *handle, char *buffer, int buf_size) { +#ifdef LAMMPS_EXCEPTIONS + LAMMPS *lmp = (LAMMPS *) handle; + Error *error = lmp->error; + + if(!error->get_last_error().empty()) { + int error_type = error->get_last_error_type(); + strncpy(buffer, error->get_last_error().c_str(), buf_size-1); + error->set_last_error("", ERROR_NONE); + return error_type; + } +#endif + return 0; +} + +// Local Variables: +// fill-column: 72 +// End: diff --git a/src/library.h b/src/library.h index d078474454..8089e51ade 100644 --- a/src/library.h +++ b/src/library.h @@ -1,4 +1,4 @@ -/* -*- c++ -*- ---------------------------------------------------------- +/* -*- c -*- ------------------------------------------------------------ LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator http://lammps.sandia.gov, Sandia National Laboratories Steve Plimpton, sjplimp@sandia.gov @@ -14,54 +14,150 @@ #ifndef LAMMPS_LIBRARY_H #define LAMMPS_LIBRARY_H -/* - C or Fortran style library interface to LAMMPS - new LAMMPS-specific functions can be added -*/ +/* C style library interface to LAMMPS which allows to create and + * control instances of the LAMMPS C++ class and exchange data with it. + * The C bindings are the basis for the Python and Fortran modules. + * + * If needed, new LAMMPS-specific functions can be added to expose + * additional LAMMPS functionality to this library interface. */ -/* - * Follow the behavior of regular LAMMPS compilation and assume - * -DLAMMPS_SMALLBIG when no define is set. - */ -#if !defined(LAMMPS_BIGBIG) && !defined(LAMMPS_SMALLBIG) && !defined(LAMMPS_SMALLSMALL) +/* We follow the behavior of regular LAMMPS compilation and assume + * -DLAMMPS_SMALLBIG when no define is set. */ + +#if !defined(LAMMPS_BIGBIG) \ + && !defined(LAMMPS_SMALLBIG) \ + && !defined(LAMMPS_SMALLSMALL) #define LAMMPS_SMALLBIG #endif +/* To allow including the library interface without MPI */ + +#if !defined(LAMMPS_LIB_NO_MPI) #include +#endif + #if defined(LAMMPS_BIGBIG) || defined(LAMMPS_SMALLBIG) #include /* for int64_t */ #endif -/* ifdefs allow this file to be included in a C program */ +/** Data type constants for extracting data from atoms, computes and fixes + * + * Must be kept in sync with the equivalent constants in lammps.py */ + +enum _LMP_DATATYPE_CONST { + LAMMPS_INT = 0, /*!< 32-bit integer (array) */ + LAMMPS_INT_2D = 1, /*!< two-dimensional 32-bit integer array */ + LAMMPS_DOUBLE = 2, /*!< 64-bit double (array) */ + LAMMPS_DOUBLE_2D = 3, /*!< two-dimensional 64-bit double array */ + LAMMPS_INT64 = 4, /*!< 64-bit integer (array) */ + LAMMPS_INT64_2D = 5, /*!< two-dimensional 64-bit integer array */ + LAMMPS_STRING = 6 /*!< C-String */ +}; + +/** Style constants for extracting data from computes and fixes. + * + * Must be kept in sync with the equivalent constants in lammps.py */ + +enum _LMP_STYLE_CONST { + LMP_STYLE_GLOBAL=0, /*!< return global data */ + LMP_STYLE_ATOM =1, /*!< return per-atom data */ + LMP_STYLE_LOCAL =2 /*!< return local data */ +}; + +/** Type and size constants for extracting data from computes and fixes. + * + * Must be kept in sync with the equivalent constants in lammps.py */ + +enum _LMP_TYPE_CONST { + LMP_TYPE_SCALAR=0, /*!< return scalar */ + LMP_TYPE_VECTOR=1, /*!< return vector */ + LMP_TYPE_ARRAY =2, /*!< return array */ + LMP_SIZE_VECTOR=3, /*!< return length of vector */ + LMP_SIZE_ROWS =4, /*!< return number of rows */ + LMP_SIZE_COLS =5 /*!< return number of columns */ +}; + +/* Ifdefs to allow this file to be included in C and C++ programs */ #ifdef __cplusplus extern "C" { #endif -void lammps_open(int, char **, MPI_Comm, void **); -void lammps_open_no_mpi(int, char **, void **); -void lammps_close(void *); -int lammps_version(void *); -void lammps_file(void *, char *); -char *lammps_command(void *, char *); -void lammps_commands_list(void *, int, char **); -void lammps_commands_string(void *, char *); -void lammps_free(void *); +/* ---------------------------------------------------------------------- + * Library functions to create/destroy an instance of LAMMPS + * ---------------------------------------------------------------------- */ -int lammps_extract_setting(void *, char *); -void *lammps_extract_global(void *, char *); -void lammps_extract_box(void *, double *, double *, - double *, double *, double *, int *, int *); -void *lammps_extract_atom(void *, char *); -void *lammps_extract_compute(void *, char *, int, int); -void *lammps_extract_fix(void *, char *, int, int, int, int); -void *lammps_extract_variable(void *, char *, char *); +#if !defined(LAMMPS_LIB_NO_MPI) +void *lammps_open(int argc, char **argv, MPI_Comm comm, void **ptr); +#endif +void *lammps_open_no_mpi(int argc, char **argv, void **ptr); +void *lammps_open_fortran(int argc, char **argv, int f_comm); +void lammps_close(void *handle); +void lammps_mpi_init(); +void lammps_mpi_finalize(); +void lammps_free(void *ptr); -double lammps_get_thermo(void *, char *); -int lammps_get_natoms(void *); +/* ---------------------------------------------------------------------- + * Library functions to process commands + * ---------------------------------------------------------------------- */ + +void lammps_file(void *handle, const char *file); + +char *lammps_command(void *handle, const char *cmd); +void lammps_commands_list(void *handle, int ncmd, const char **cmds); +void lammps_commands_string(void *handle, const char *str); + +/* ----------------------------------------------------------------------- + * Library functions to extract info from LAMMPS or set data in LAMMPS + * ----------------------------------------------------------------------- */ + +int lammps_version(void *handle); +void lammps_memory_usage(void *handle, double *meminfo); +int lammps_get_mpi_comm(void *handle); +double lammps_get_natoms(void *handle); +double lammps_get_thermo(void *handle, const char *keyword); + +void lammps_extract_box(void *handle, double *boxlo, double *boxhi, + double *xy, double *yz, double *xz, + int *pflags, int *boxflag); +void lammps_reset_box(void *handle, double *boxlo, double *boxhi, + double xy, double yz, double xz); + +int lammps_extract_setting(void *handle, const char *keyword); +void *lammps_extract_global(void *handle, const char *name); +void *lammps_extract_atom(void *handle, const char *name); + +int lammps_extract_global_datatype(void *handle, const char *name); +int lammps_extract_atom_datatype(void *handle, const char *name); + +#if !defined(LAMMPS_BIGBIG) +int lammps_create_atoms(void *handle, int n, int *id, int *type, + double *x, double *v, int *image, int bexpand); +#else +int lammps_create_atoms(void *handle, int n, int64_t *id, int *type, + double *x, double *v, int64_t* image, int bexpand); +#endif + +/* ---------------------------------------------------------------------- + * Library functions to access data from computes, fixes, variables in LAMMPS + * ---------------------------------------------------------------------- */ + +void *lammps_extract_compute(void *handle, char *id, int, int); +void *lammps_extract_fix(void *handle, char *, int, int, int, int); +void *lammps_extract_variable(void *handle, char *, char *); +int lammps_set_variable(void *, char *, char *); + +/* ---------------------------------------------------------------------- + * Library functions for scatter/gather operations of data + * ---------------------------------------------------------------------- */ + + +void lammps_gather(void *, char *, int, int, void *); +void lammps_gather_concat(void *, char *, int, int, void *); +void lammps_gather_subset(void *, char *, int, int, int, int *, void *); +void lammps_scatter(void *, char *, int, int, void *); +void lammps_scatter_subset(void *, char *, int, int, int, int *, void *); -int lammps_set_variable(void *, char *, char *); -void lammps_reset_box(void *, double *, double *, double, double, double); void lammps_gather_atoms(void *, char *, int, int, void *); void lammps_gather_atoms_concat(void *, char *, int, int, void *); @@ -69,6 +165,50 @@ void lammps_gather_atoms_subset(void *, char *, int, int, int, int *, void *); void lammps_scatter_atoms(void *, char *, int, int, void *); void lammps_scatter_atoms_subset(void *, char *, int, int, int, int *, void *); +/* ---------------------------------------------------------------------- + * Library functions for retrieving configuration information + * ---------------------------------------------------------------------- */ + +int lammps_config_has_mpi_support(); +int lammps_config_has_package(const char *); +int lammps_config_package_count(); +int lammps_config_package_name(int, char *, int); +int lammps_config_has_gzip_support(); +int lammps_config_has_png_support(); +int lammps_config_has_jpeg_support(); +int lammps_config_has_ffmpeg_support(); +int lammps_config_has_exceptions(); + +int lammps_has_style(void *, const char *, const char *); +int lammps_style_count(void *, const char *); +int lammps_style_name(void *, const char *, int, char *, int); + +int lammps_has_id(void *, const char *, const char *); +int lammps_id_count(void *, const char *); +int lammps_id_name(void *, const char *, int, char *, int); + +/* ---------------------------------------------------------------------- + * Library functions for accessing neighbor lists + * ---------------------------------------------------------------------- */ + +int lammps_find_pair_neighlist(void*, char *, int, int, int); +int lammps_find_fix_neighlist(void*, char *, int); +int lammps_find_compute_neighlist(void*, char *, int); +int lammps_neighlist_num_elements(void*, int); +void lammps_neighlist_element_neighbors(void *, int, int, int *, int *, int ** ); + +/* ---------------------------------------------------------------------- + * Utility functions + * ---------------------------------------------------------------------- */ + +#if !defined(LAMMPS_BIGBIG) +int lammps_encode_image_flags(int ix, int iy, int iz); +void lammps_decode_image_flags(int image, int *flags); +#else +int64_t lammps_encode_image_flags(int ix, int iy, int iz); +void lammps_decode_image_flags(int64_t image, int *flags); +#endif + #if defined(LAMMPS_BIGBIG) typedef void (*FixExternalFnPtr)(void *, int64_t, int, int64_t *, double **, double **); void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); @@ -79,49 +219,21 @@ void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); typedef void (*FixExternalFnPtr)(void *, int, int, int *, double **, double **); void lammps_set_fix_external_callback(void *, char *, FixExternalFnPtr, void*); #endif +void lammps_fix_external_set_energy_global(void *, char *, double); +void lammps_fix_external_set_virial_global(void *, char *, double *); -int lammps_config_has_package(char * package_name); -int lammps_config_package_count(); -int lammps_config_package_name(int index, char * buffer, int max_size); -int lammps_config_has_gzip_support(); -int lammps_config_has_png_support(); -int lammps_config_has_jpeg_support(); -int lammps_config_has_ffmpeg_support(); -int lammps_config_has_exceptions(); +int lammps_is_running(void *handle); +void lammps_force_timeout(void *handle); -int lammps_has_style(void* ptr, char * category, char * name); -int lammps_style_count(void* ptr, char * category); -int lammps_style_name(void*ptr, char * category, int index, char * buffer, int max_size); +int lammps_has_error(void *handle); +int lammps_get_last_error_message(void *handle, char *buffer, int buf_size); -int lammps_find_pair_neighlist(void* ptr, char * style, int exact, int nsub, int request); -int lammps_find_fix_neighlist(void* ptr, char * id, int request); -int lammps_find_compute_neighlist(void* ptr, char * id, int request); -int lammps_neighlist_num_elements(void* ptr, int idx); -void lammps_neighlist_element_neighbors(void * ptr, int idx, int element, int * iatom, int * numneigh, int ** neighbors); - -// lammps_create_atoms() takes tagint and imageint as args -// ifdef insures they are compatible with rest of LAMMPS -// caller must match to how LAMMPS library is built - -#ifdef LAMMPS_BIGBIG -void lammps_create_atoms(void *, int, int64_t *, int *, - double *, double *, int64_t *, int); -#else -void lammps_create_atoms(void *, int, int *, int *, - double *, double *, int *, int); -#endif - -#ifdef LAMMPS_EXCEPTIONS -int lammps_has_error(void *); -int lammps_get_last_error_message(void *, char *, int); -#endif - -#undef LAMMPS #ifdef __cplusplus } #endif #endif /* LAMMPS_LIBRARY_H */ + /* ERROR/WARNING messages: E: Library error: issuing LAMMPS command during run @@ -172,3 +284,7 @@ W: Library warning in lammps_create_atoms, invalid total atoms %ld %ld UNDOCUMENTED */ + +/* Local Variables: + * fill-column: 72 + * End: */ diff --git a/src/lmppython.cpp b/src/lmppython.cpp index 67bbca15b6..080a22cb60 100644 --- a/src/lmppython.cpp +++ b/src/lmppython.cpp @@ -26,7 +26,7 @@ Python::Python(LAMMPS *lmp) : Pointers(lmp) { // implementation of Python interface is only loaded on demand // and only if PYTHON package has been installed and compiled into binary - impl = NULL; + impl = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/lmptype.h b/src/lmptype.h index 68af28af61..e5dba94be0 100644 --- a/src/lmptype.h +++ b/src/lmptype.h @@ -42,10 +42,10 @@ #define __STDC_FORMAT_MACROS #endif -#include -#include -#include -#include +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export // grrr - IBM Power6 does not provide this def in their system header files @@ -79,6 +79,7 @@ namespace LAMMPS_NS { // for atomic problems that exceed 2 billion (2^31) atoms // 32-bit smallint/imageint/tagint, 64-bit bigint +// atom IDs and molecule IDs are limited to 32-bit #ifdef LAMMPS_SMALLBIG @@ -101,6 +102,11 @@ typedef int64_t bigint; #define ATOTAGINT atoi #define ATOBIGINT ATOLL +#define LAMMPS_TAGINT LAMMPS_INT +#define LAMMPS_TAGINT_2D LAMMPS_INT_2D +#define LAMMPS_BIGINT LAMMPS_INT64 +#define LAMMPS_BIGINT_2D LAMMPS_INT64_2D + #define IMGMASK 1023 #define IMGMAX 512 #define IMGBITS 10 @@ -133,6 +139,11 @@ typedef int64_t bigint; #define ATOTAGINT ATOLL #define ATOBIGINT ATOLL +#define LAMMPS_TAGINT LAMMPS_INT64 +#define LAMMPS_TAGINT_2D LAMMPS_INT64_2D +#define LAMMPS_BIGINT LAMMPS_INT64 +#define LAMMPS_BIGINT_2D LAMMPS_INT64_2D + #define IMGMASK 2097151 #define IMGMAX 1048576 #define IMGBITS 21 @@ -164,6 +175,11 @@ typedef int bigint; #define ATOTAGINT atoi #define ATOBIGINT atoi +#define LAMMPS_TAGINT LAMMPS_INT +#define LAMMPS_TAGINT_2D LAMMPS_INT_2D +#define LAMMPS_BIGINT LAMMPS_INT +#define LAMMPS_BIGINT_2D LAMMPS_INT_2D + #define IMGMASK 1023 #define IMGMAX 512 #define IMGBITS 10 @@ -171,22 +187,21 @@ typedef int bigint; #endif - /// Data structe for packing 32-bit and 64-bit integers - /// into double (communication) buffers - /// - /// Using this union avoids aliasing issues by having member types - /// (double, int) referencing the same buffer memory location. - /// - /// The explicit constructor for 32-bit integers prevents compilers - /// from (incorrectly) calling the double constructor when storing - /// an int into a double buffer. - /* +/** Data structure for packing 32-bit and 64-bit integers + * into double (communication) buffers + * + * Using this union avoids aliasing issues by having member types + * (double, int) referencing the same buffer memory location. + * + * The explicit constructor for 32-bit integers prevents compilers + * from (incorrectly) calling the double constructor when storing + * an int into a double buffer. \verbatim embed:rst + **Usage:** -To copy an integer into a double buffer: - -.. code-block: c++ +.. code-block:: c++ + :caption: To copy an integer into a double buffer: double buf[2]; int foo = 1; @@ -194,14 +209,13 @@ To copy an integer into a double buffer: buf[1] = ubuf(foo).d; buf[2] = ubuf(bar).d; -To copy from a double buffer back to an int: - -.. code-block: c++ +.. code-block:: c++ + :caption: To copy from a double buffer back to an int: foo = (int) ubuf(buf[1]).i; bar = (tagint) ubuf(buf[2]).i; -The typecast prevents compiler warnings about possible truncations. +The typecasts prevent compiler warnings about possible truncation issues. \endverbatim */ union ubuf { @@ -250,17 +264,23 @@ The typecast prevents compiler warnings about possible truncations. // functions and avoid compiler warnings about variable tracking. // Disable for broken -D_FORTIFY_SOURCE feature. -#if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) -#define _noopt -#elif defined(__clang__) +#if defined(__clang__) # define _noopt __attribute__((optnone)) #elif defined(__INTEL_COMPILER) # define _noopt #elif defined(__GNUC__) # if (__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 9)) -# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments"))) +# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) +# define _noopt __attribute__((optimize("no-var-tracking-assignments"))) +# else +# define _noopt __attribute__((optimize("O0","no-var-tracking-assignments"))) +# endif # else -# define _noopt __attribute__((optimize("O0"))) +# if defined(_FORTIFY_SOURCE) && (_FORTIFY_SOURCE > 0) +# define _noopt +# else +# define _noopt __attribute__((optimize("O0"))) +# endif # endif #else # define _noopt diff --git a/src/main.cpp b/src/main.cpp index 9fb084aaea..d705db4e5b 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -12,9 +12,11 @@ ------------------------------------------------------------------------- */ #include "lammps.h" -#include #include "input.h" +#include +#include + #if defined(LAMMPS_TRAP_FPE) && defined(_GNU_SOURCE) #include #endif diff --git a/src/math_eigen.cpp b/src/math_eigen.cpp new file mode 100644 index 0000000000..0c4895f0ed --- /dev/null +++ b/src/math_eigen.cpp @@ -0,0 +1,78 @@ +/* ---------------------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +/* ---------------------------------------------------------------------- + Contributing author: Andrew Jewett (Scripps Research) +------------------------------------------------------------------------- */ + +#include "math_eigen.h" +#include "math_eigen_impl.h" + +#include + +using std::vector; +using std::array; +using namespace MathEigen; + +// Special case: 3x3 matrices + +typedef Jacobi Jacobi_v1; +typedef Jacobi Jacobi_v2; + +int MathEigen::jacobi3(double const mat[3][3], double *eval, double evec[3][3]) +{ + // make copy of const matrix + + double mat_cpy[3][3] = { {mat[0][0], mat[0][1], mat[0][2]}, + {mat[1][0], mat[1][1], mat[1][2]}, + {mat[2][0], mat[2][1], mat[2][2]} }; + double *M[3] = { &(mat_cpy[0][0]), &(mat_cpy[1][0]), &(mat_cpy[2][0]) }; + int midx[3]; + + // create instance of generic Jacobi class and get eigenvalues and -vectors + + Jacobi_v1 ecalc3(3, M, midx); + int ierror = ecalc3.Diagonalize(mat, eval, evec, Jacobi_v1::SORT_DECREASING_EVALS); + + // transpose the evec matrix + + for (int i=0; i<3; i++) + for (int j=i+1; j<3; j++) + std::swap(evec[i][j], evec[j][i]); + + return ierror; +} + +int MathEigen::jacobi3(double const* const* mat, double *eval, double **evec) +{ + // make copy of const matrix + + double mat_cpy[3][3] = { {mat[0][0], mat[0][1], mat[0][2]}, + {mat[1][0], mat[1][1], mat[1][2]}, + {mat[2][0], mat[2][1], mat[2][2]} }; + double *M[3] = { &(mat_cpy[0][0]), &(mat_cpy[1][0]), &(mat_cpy[2][0]) }; + int midx[3]; + + // create instance of generic Jacobi class and get eigenvalues and -vectors + + Jacobi_v2 ecalc3(3, M, midx); + int ierror = ecalc3.Diagonalize(mat, eval, evec, Jacobi_v2::SORT_DECREASING_EVALS); + + // transpose the evec matrix + + for (int i=0; i<3; i++) + for (int j=i+1; j<3; j++) + std::swap(evec[i][j], evec[j][i]); + + return ierror; +} diff --git a/src/math_eigen.h b/src/math_eigen.h new file mode 100644 index 0000000000..7abf7eb539 --- /dev/null +++ b/src/math_eigen.h @@ -0,0 +1,36 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + + +#ifndef LMP_MATH_EIGEN_H +#define LMP_MATH_EIGEN_H + +namespace MathEigen { + +/** A specialized function which finds the eigenvalues and eigenvectors + * of a 3x3 matrix (in double ** format). + * + * \param mat the 3x3 matrix you wish to diagonalize + * \param eval store the eigenvalues here + * \param evec store the eigenvectors here... + * \return 0 if eigenvalue calculation converged, 1 if it failed */ + +int jacobi3(double const* const* mat, double *eval, double **evec); + +/** \overload */ + +int jacobi3(double const mat[3][3], double *eval, double evec[3][3]); + +} + +#endif //#ifndef LMP_MATH_EIGEN_H diff --git a/src/math_eigen_impl.h b/src/math_eigen_impl.h new file mode 100644 index 0000000000..7d6f0385ae --- /dev/null +++ b/src/math_eigen_impl.h @@ -0,0 +1,1374 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. (Some of the code in this file is also + available using a more premissive license. See below for details.) + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ +/* ---------------------------------------------------------------------- + Contributing authors: Yuya Kurebayashi (Tohoku University, Lanczos algorithm) + Andrew Jewett (Scripps Research, Jacobi algorithm) +------------------------------------------------------------------------- */ + +#ifndef LMP_MATH_EIGEN_IMPL_H +#define LMP_MATH_EIGEN_IMPL_H + +// This file contains a library of functions and classes which can +// efficiently perform eigendecomposition for an extremely broad +// range of matrix types: both real and complex, dense and sparse. +// Matrices need not be of type "double **", for example. +// In principle, almost any type of C++ container can be used. +// Some general C++11 compatible functions for allocating matrices and +// calculating norms of real and complex vectors are also provided. +// note +// The "Jacobi" and "PEigenDense" classes are used for calculating +// eigenvalues and eigenvectors of conventional dense square matrices. +// note +// The "LambdaLanczos" class can calculate eigenalues and eigenvectors +// of more general types of matrices, especially large, sparse matrices. +// It uses C++ lambda expressions to simplify and generalize the way +// matrices can be represented. This allows it to be applied to +// nearly any kind of sparse (or dense) matrix representation. +// note +// The source code for Jacobi and LambdaLanczos is also available at: +// https://github.com/jewettaij/jacobi_pd (CC0-1.0 license) +// https://github.com/mrcdr/lambda-lanczos (MIT license) + +//#include +#include +#include +#include +#include +#include +#include +#include + +namespace MathEigen { + + // --- Memory allocation for matrices --- + + // Allocate an arbitrary 2-dimensional array. (Uses row-major order.) + // note This function was intended for relatively small matrices (eg 4x4). + // For large arrays, please use the 2d create() function from "memory.h" + template + void Alloc2D(size_t nrows, // size of the array (number of rows) + size_t ncols, // size of the array (number of columns) + Entry ***paaX); // pointer to a 2D C-style array + + // Deallocate arrays that were created using Alloc2D(). + template + void Dealloc2D(Entry ***paaX); // pointer to 2D multidimensional array + + // --- Complex numbers --- + + /// @brief + /// "realTypeMap" struct is used to the define "real_t" type mapper. + /// The "real_t" type mapper is used by the "LambdaLanczos" and "PEigenDense" + /// classes, so it is documented here to help users understand those classes. + /// "real_t" returns the C++ type corresponding to the real component of T. + /// + /// @details + /// For example, suppose you have a matrix of type std::complex**. + /// The eigenvalues calculated by "LambdaLanczos" and "PEigenDense" should be + /// of type "double" (which is the same as "real_T>"), + /// not "std::complex". (This is because the algorithm assumes the + /// matrix is Hermitian, and the eigenvalues of a Hermitian matrix are always + /// real. So if you attempt to pass a reference to a complex number as the + /// first argument to LambdaLanczos::run(), the compiler will complain.) + /// + /// Implementation details: "real_t" is defined using C++ template + /// specializations. + + template + struct realTypeMap { + typedef T type; + }; + template + struct realTypeMap> { + typedef T type; + }; + template + using real_t = typename realTypeMap::type; + + + // --- Operations on vectors (of real and complex numbers) --- + + // Calculate the inner product of two vectors. + // (For vectors of complex numbers, std::conj() is used.) + template + T inner_prod(const std::vector& v1, const std::vector& v2); + + // Compute the sum of the absolute values of the entries in v + // returns a real number (of type real_t). + template + real_t l1_norm(const std::vector& v); + + // Calculate the l2_norm (Euclidian length) of vector v. + // returns a real number (of type real_t). + template + real_t l2_norm(const std::vector& v); + + /// Multiply a vector (v) by a scalar (c). + template + void scalar_mul(T1 c, std::vector& v); + + /// Divide vector "v" in-place by it's length (l2_norm(v)). + template + void normalize(std::vector& v); + + // ---- Eigendecomposition of small dense symmetric matrices ---- + + /// @class Jacobi + /// @brief Calculate the eigenvalues and eigenvectors of a symmetric matrix + /// using the Jacobi eigenvalue algorithm. This code (along with tests + /// and benchmarks) is available free of license restrictions at: + /// https://github.com/jewettaij/jacobi_pd + /// @note The "Vector", "Matrix", and "ConstMatrix" type arguments can be any + /// C or C++ object that supports indexing, including pointers or vectors. + + template + + class Jacobi + { + int n; //!< the size of the matrices you want to diagonalize + Scalar **M; //!< local copy of the current matrix being analyzed + // Precomputed cosine, sine, and tangent of the most recent rotation angle: + Scalar c; //!< = cos(θ) + Scalar s; //!< = sin(θ) + Scalar t; //!< = tan(θ), (note |t|<=1) + int *max_idx_row; //!< = keep track of the the maximum element in row i (>i) + + public: + /// @brief Specify the size of the matrices you want to diagonalize later. + /// @param n the size (ie. number of rows) of the (square) matrix. + Jacobi(int n); + + ~Jacobi(); + + /// @brief Change the size of the matrices you want to diagonalize. + /// @param n the size (ie. number of rows) of the (square) matrix. + void SetSize(int n); + + // @typedef choose the criteria for sorting eigenvalues and eigenvectors + typedef enum eSortCriteria { + DO_NOT_SORT, + SORT_DECREASING_EVALS, + SORT_INCREASING_EVALS, + SORT_DECREASING_ABS_EVALS, + SORT_INCREASING_ABS_EVALS + } SortCriteria; + + /// @brief Calculate the eigenvalues and eigenvectors of a symmetric matrix + /// using the Jacobi eigenvalue algorithm. + /// @returns 0 if the algorithm converged, + /// 1 if the algorithm failed to converge. (IE, if the number of + /// pivot iterations exceeded max_num_sweeps * iters_per_sweep, + /// where iters_per_sweep = (n*(n-1)/2)) + /// @note To reduce the computation time further, set calc_evecs=false. + int + Diagonalize(ConstMatrix mat, //!< the matrix you wish to diagonalize (size n) + Vector eval, //!< store the eigenvalues here + Matrix evec, //!< store the eigenvectors here (in rows) + SortCriteria sort_criteria=SORT_DECREASING_EVALS,//!& source); + Jacobi(Jacobi&& other); + void swap(Jacobi &other); + Jacobi& operator = (Jacobi source); + + }; // class Jacobi + + // ---- Eigendecomposition of large sparse (or dense) matrices ---- + + // The "LambdaLanczos" is a class useful for calculating eigenvalues + // and eigenvectors of large sparse matrices. Unfortunately, before the + // LambdaLanczos class can be declared, several additional expressions, + // classes and functions that it depends on must be declared first. + + // Create random vectors used at the beginning of the Lanczos algorithm. + // note "Partially specialization of function" is not allowed, so + // it is mimicked by wrapping the "init" function with a class template. + template + struct VectorRandomInitializer { + public: + static void init(std::vector&); + }; + + template + struct VectorRandomInitializer> { + public: + static void init(std::vector>&); + }; + + // Return the number of significant decimal digits of type T. + template + inline constexpr int sig_decimal_digit() { + return (int)(std::numeric_limits::digits * + std::log10(std::numeric_limits::radix)); + } + + // Return 10^-n where n=number of significant decimal digits of type T. + template + inline constexpr T minimum_effective_decimal() { + return std::pow(10, -sig_decimal_digit()); + } + + + /// @class LambdaLanczos + /// @brief The LambdaLanczos class provides a general way to calculate + /// the smallest or largest eigenvalue and the corresponding eigenvector + /// of a Hermitian matrix using the Lanczos algorithm. + /// The characteristic feature of LambdaLanczos is that the matrix-vector + /// multiplication routine used in the Lanczos algorithm is adaptable. + /// This code (along with automatic unit tests) is also distributed + /// under the MIT license at https://github.com/mrcdr/lambda-lanczos + /// + /// @note + /// If the matrices you want to analyze are ordinary square matrices, (as in + /// the example) it might be easier to use "PEigenDense" instead. (It is a + /// wrapper which takes care of all of the LambdaLanczos details for you.) + /// + /// @note + /// IMPORTANT: + /// Unless the matrix you are solving is positive or negative definite, you + /// MUST set the "eigenvalue_offset" parameter. See the "pg_developer" docs. + + template + class LambdaLanczos { + public: + LambdaLanczos(); + LambdaLanczos(std::function&, std::vector&)> mv_mul, int matrix_size, bool find_maximum); + LambdaLanczos(std::function&, std::vector&)> mv_mul, int matrix_size) : LambdaLanczos(mv_mul, matrix_size, true) {} + + /// @brief Calculate the principal (largest or smallest) eigenvalue + /// of the matrix (and its corresponding eigenvector). + int run(real_t&, std::vector&) const; + + // --- public data members --- + + /// @brief Specify the size of the matrix you will analyze. + /// (This equals the size of the eigenvector which will be returned.) + int matrix_size; + + /// @brief Specify the function used for matrix*vector multiplication + /// used by the Lanczos algorithm. For an ordinary dense matrix, + /// this function is the ordinary matrix*vector product. (See the + /// example above. For a sparse matrix, it will be something else.) + std::function&, std::vector&)> mv_mul; + + /// @brief Are we searching for the maximum or minimum eigenvalue? + /// @note (Usually, you must also specify eigenvalue_offset.) + bool find_maximum = false; + + /// @brief Shift all the eigenvalues by "eigenvalue_offset" during the Lanczos + /// iteration (ie. during LambdaLanczos::run()). The goal is to insure + /// that the correct eigenvalue is selected (the one with the maximum + /// magnitude). + /// @note Unless your matrix is positive definite or negative definite, you + /// MUST specify eigenvalue_offset. See comment above for details. + /// @note After LambdaLanczos::run() has finished, it will subtract this + /// number from the eigenvalue before it is returned to the caller. + real_t eigenvalue_offset = 0.0; + + /// @brief This function sets "eigenvalue_offset" automatically. + /// @note Using this function is not recommended because it is very slow. + /// For efficiency, set the "eigenvalue_offset" yourself. + void ChooseOffset(); + + // The remaining data members usually can be left alone: + int max_iteration; + real_t eps = minimum_effective_decimal>() * 1e3; + real_t tridiag_eps_ratio = 1e-1; + int initial_vector_size = 200; + std::function&)> init_vector = + VectorRandomInitializer::init; + + // (for those who prefer using "Set" functions...) + int SetSize(int matrix_size); + void SetMul(std::function&, + std::vector&)> mv_mul); + void SetInitVec(std::function&)> init_vector); + void SetFindMax(bool find_maximum); + void SetEvalOffset(T eigenvalue_offset); + void SetEpsilon(T eps); + void SetTriEpsRatio(T tridiag_eps_ratio); + + private: + static void schmidt_orth(std::vector&, const std::vector>&); + real_t find_minimum_eigenvalue(const std::vector>&, + const std::vector>&) const; + real_t find_maximum_eigenvalue(const std::vector>&, + const std::vector>&) const; + static real_t tridiagonal_eigen_limit(const std::vector>&, + const std::vector>&); + static int num_of_eigs_smaller_than(real_t, + const std::vector>&, + const std::vector>&); + real_t UpperBoundEvals() const; + }; + + + + /// @class PEigenDense + /// @brief + /// PEigenDense is a class containing only one useful member function: + /// PrincipalEigen(). This function calculates the principal (largest + /// or smallest) eigenvalue and corresponding eigenvector of a square + /// n x n matrix. This can be faster than diagonalizing the entire matrix. + /// @note + /// This code is a wrapper. Internally, it uses the "LambdaLanczos" class. + /// @note + /// For dense matrices smaller than 13x13, Jacobi::Diagonalize(), + /// is usually faster than PEigenDense::PrincipleEigen(). + + template + class PEigenDense + { + size_t n; // the size of the matrix + std::vector evec; // preallocated vector + + public: + PEigenDense(int matrix_size=0); + + /// @brief Calculate the principal eigenvalue and eigenvector of a matrix. + /// @return Return the principal eigenvalue of the matrix. + /// If you want the eigenvector, pass a non-null "evector" argument. + real_t + PrincipalEigen(ConstMatrix matrix, //!< the input matrix + Vector evector, //!< the eigenvector is stored here + bool find_max=false); //!< want the max or min eigenvalue? + + void SetSize(int matrix_size); //change matrix size after instantiation + + }; // class PEigenDense + + + +// -------------------------------------- +// ----------- IMPLEMENTATION ----------- +// -------------------------------------- + +// --- Implementation: Memory allocation for matrices --- +template +void Alloc2D(size_t nrows, // size of the array (number of rows) + size_t ncols, // size of the array (number of columns) + Entry ***paaX) // pointer to a 2D C-style array +{ + //assert(paaX); + *paaX = new Entry* [nrows]; //conventional 2D C array (pointer-to-pointer) + (*paaX)[0] = new Entry [nrows * ncols]; // 1D C array (contiguous memor) + for(size_t iy=0; iy +void Dealloc2D(Entry ***paaX) // pointer to a 2D C-style array +{ + if (paaX && *paaX) { + delete [] (*paaX)[0]; + delete [] (*paaX); + *paaX = nullptr; + } +} + +/// @brief ConjugateProduct::prod(a,b) is a function which returns a*b by +/// default. If the arguments are complex numbers, it returns conj(a)*b instead. +template +struct ConjugateProduct { +public: + static T prod(T a, T b) { return a*b; } +}; + +template +struct ConjugateProduct> { +public: + static std::complex prod(std::complex a, std::complex b) { + return std::conj(a)*b; + } +}; + + +// --- Implementation: Operations on vectors (of real and complex numbers) --- + +template +inline T inner_prod(const std::vector& v1, const std::vector& v2) { + return std::inner_product(std::begin(v1), std::end(v1), + std::begin(v2), T(), + [](T a, T b) -> T { return a+b; }, + ConjugateProduct::prod); + // T() means zero value of type T + // This spec is required because std::inner_product calculates + // v1*v2 not conj(v1)*v2 +} + +template +inline real_t l2_norm(const std::vector& vec) { + return std::sqrt(std::real(inner_prod(vec, vec))); + // The norm of any complex vector is real by definition. +} + +template +inline void scalar_mul(T1 a, std::vector& vec) { + int n = vec.size(); + for(int i = 0;i < n;i++) + vec[i] *= a; +} + +template +inline void normalize(std::vector& vec) { + scalar_mul(1.0/l2_norm(vec), vec); +} + +template +inline real_t l1_norm(const std::vector& vec) { + real_t norm = real_t(); // Zero initialization + for(const T& element : vec) + norm += std::abs(element); + return norm; +} + + + + +// --- Implementation: Eigendecomposition of small dense matrices --- + + +template +Jacobi:: +Jacobi(int n) { + _Jacobi(n, nullptr, nullptr); +} + + +template +Jacobi:: +Jacobi(int n, Scalar **M, int *max_idx_row) { + _Jacobi(n, M, max_idx_row); +} + + +// _Jacobi() is a function which is invoked by the two constructors and it +// does all of the work. (Splitting the constructor into multiple functions +// was technically unnecessary, but it makes documenting the code easier.) + +template +void +Jacobi:: +_Jacobi(int n, Scalar **M, int *max_idx_row) { + Init(); + if (M) { // if caller supplies their own "M" array, don't allocate M + is_preallocated = true; + this->n = n; + this->M = M; + this->max_idx_row = max_idx_row; + //assert(this->max_idx_row); + } + else { + is_preallocated = false; + SetSize(n); // allocate the "M" and "max_int_row" arrays + } +} + + +template +Jacobi:: +~Jacobi() { + if (! is_preallocated) + Dealloc(); +} + + +template +int Jacobi:: +Diagonalize(ConstMatrix mat, // the matrix you wish to diagonalize (size n) + Vector eval, // store the eigenvalues here + Matrix evec, // store the eigenvectors here (in rows) + SortCriteria sort_criteria, // sort results? + bool calc_evec, // calculate the eigenvectors? + int max_num_sweeps) // limit the number of iterations ("sweeps") +{ + // -- Initialization -- + for (int i = 0; i < n; i++) + for (int j = i; j < n; j++) //copy mat[][] into M[][] + M[i][j] = mat[i][j]; //(M[][] is a local copy we can modify) + + if (calc_evec) + for (int i = 0; i < n; i++) + for (int j = 0; j < n; j++) + evec[i][j] = (i==j) ? 1.0 : 0.0; //Set evec equal to the identity matrix + + for (int i = 0; i < n-1; i++) //Initialize the "max_idx_row[]" array + max_idx_row[i] = MaxEntryRow(M, i); //(which is needed by MaxEntry()) + + // -- Iteration -- + int n_iters; + int max_num_iters = max_num_sweeps*n*(n-1)/2; //"sweep" = n*(n-1)/2 iters + for (n_iters=0; n_iters < max_num_iters; n_iters++) { + int i,j; + MaxEntry(M, i, j); // Find the maximum entry in the matrix. Store in i,j + + // If M[i][j] is small compared to M[i][i] and M[j][j], set it to 0. + if ((M[i][i] + M[i][j] == M[i][i]) && (M[j][j] + M[i][j] == M[j][j])) { + M[i][j] = 0.0; + max_idx_row[i] = MaxEntryRow(M,i); //must also update max_idx_row[i] + } + + if (M[i][j] == 0.0) + break; + + // Otherwise, apply a rotation to make M[i][j] = 0 + CalcRot(M, i, j); // Calculate the parameters of the rotation matrix. + ApplyRot(M, i, j); // Apply this rotation to the M matrix. + if (calc_evec) // Optional: If the caller wants the eigenvectors, then + ApplyRotLeft(evec,i,j); // apply the rotation to the eigenvector matrix + + } //for (int n_iters=0; n_iters < max_num_iters; n_iters++) + + // -- Post-processing -- + for (int i = 0; i < n; i++) + eval[i] = M[i][i]; + + // Optional: Sort results by eigenvalue. + SortRows(eval, evec, n, sort_criteria); + + return (n_iters == max_num_iters); +} + + +/// brief Calculate the components of a rotation matrix which performs a +/// rotation in the i,j plane by an angle (θ) that (when multiplied on +/// both sides) will zero the ij'th element of M, so that afterwards +/// M[i][j] = 0. The results will be stored in c, s, and t +/// (which store cos(θ), sin(θ), and tan(θ), respectively). + +template +void Jacobi:: +CalcRot(Scalar const *const *M, //!< matrix + int i, //!< row index + int j) //!< column index +{ + t = 1.0; // = tan(θ) + Scalar M_jj_ii = (M[j][j] - M[i][i]); + if (M_jj_ii != 0.0) { + // kappa = (M[j][j] - M[i][i]) / (2*M[i][j]) + Scalar kappa = M_jj_ii; + t = 0.0; + Scalar M_ij = M[i][j]; + if (M_ij != 0.0) { + kappa /= (2.0*M_ij); + // t satisfies: t^2 + 2*t*kappa - 1 = 0 + // (choose the root which has the smaller absolute value) + t = 1.0 / (std::sqrt(1 + kappa*kappa) + std::abs(kappa)); + if (kappa < 0.0) + t = -t; + } + } + //assert(std::abs(t) <= 1.0); + c = 1.0 / std::sqrt(1 + t*t); + s = c*t; +} + + +/// brief Perform a similarity transformation by multiplying matrix M on both +/// sides by a rotation matrix (and its transpose) to eliminate M[i][j]. +/// details This rotation matrix performs a rotation in the i,j plane by +/// angle θ. This function assumes that c=cos(θ). s=som(θ), t=tan(θ) +/// have been calculated previously (using the CalcRot() function). +/// It also assumes that iv) are not computed. +/// +/// verbatim +/// +/// M' = R^T * M * R +/// where R the rotation in the i,j plane and ^T denotes the transpose. +/// i j +/// _ _ +/// | 1 | +/// | . | +/// | . | +/// | 1 | +/// | c ... s | +/// | . . . | +/// R = | . 1 . | +/// | . . . | +/// | -s ... c | +/// | 1 | +/// | . | +/// | . | +/// |_ 1 _| +/// +/// endverbatim +/// +/// Let M' denote the matrix M after multiplication by R^T and R. +/// The components of M' are: +/// M'_uv = Σ_w Σ_z R_wu * M_wz * R_zv +/// +/// note +/// The rotation at location i,j will modify all of the matrix +/// elements containing at least one index which is either i or j +/// such as: M[w][i], M[i][w], M[w][j], M[j][w]. +/// Check and see whether these modified matrix elements exceed the +/// corresponding values in max_idx_row[] array for that row. +/// If so, then update max_idx_row for that row. +/// This is somewhat complicated by the fact that we must only consider +/// matrix elements in the upper-right triangle strictly above the diagonal. +/// (ie. matrix elements whose second index is > the first index). + +template +void Jacobi:: +ApplyRot(Scalar **M, // matrix + int i, // row index + int j) // column index +{ + // Recall that c = cos(θ), s = sin(θ), t = tan(θ) (and t <= 1.0) + + // Compute the diagonal elements of M which have changed: + M[i][i] -= t * M[i][j]; + M[j][j] += t * M[i][j]; + + //Update the off-diagonal elements of M which will change (above the diagonal) + //assert(i < j); + M[i][j] = 0.0; + + //compute M[w][i] and M[i][w] for all w!=i,considering above-diagonal elements + for (int w=0; w < i; w++) { // 0 <= w < i < j < n + M[i][w] = M[w][i]; //backup the previous value. store below diagonal (i>w) + M[w][i] = c*M[w][i] - s*M[w][j]; //M[w][i], M[w][j] from previous iteration + if (i == max_idx_row[w]) max_idx_row[w] = MaxEntryRow(M, w); + else if (std::abs(M[w][i])>std::abs(M[w][max_idx_row[w]])) max_idx_row[w]=i; + //assert(max_idx_row[w] == MaxEntryRow(M, w)); + } + for (int w=i+1; w < j; w++) { // 0 <= i < w < j < n + M[w][i] = M[i][w]; //backup the previous value. store below diagonal (w>i) + M[i][w] = c*M[i][w] - s*M[w][j]; //M[i][w], M[w][j] from previous iteration + } + for (int w=j+1; w < n; w++) { // 0 <= i < j+1 <= w < n + M[w][i] = M[i][w]; //backup the previous value. store below diagonal (w>i) + M[i][w] = c*M[i][w] - s*M[j][w]; //M[i][w], M[j][w] from previous iteration + } + + // now that we're done modifying row i, we can update max_idx_row[i] + max_idx_row[i] = MaxEntryRow(M, i); + + //compute M[w][j] and M[j][w] for all w!=j,considering above-diagonal elements + for (int w=0; w < i; w++) { // 0 <= w < i < j < n + M[w][j] = s*M[i][w] + c*M[w][j]; //M[i][w], M[w][j] from previous iteration + if (j == max_idx_row[w]) max_idx_row[w] = MaxEntryRow(M, w); + else if (std::abs(M[w][j])>std::abs(M[w][max_idx_row[w]])) max_idx_row[w]=j; + //assert(max_idx_row[w] == MaxEntryRow(M, w)); + } + for (int w=i+1; w < j; w++) { // 0 <= i+1 <= w < j < n + M[w][j] = s*M[w][i] + c*M[w][j]; //M[w][i], M[w][j] from previous iteration + if (j == max_idx_row[w]) max_idx_row[w] = MaxEntryRow(M, w); + else if (std::abs(M[w][j])>std::abs(M[w][max_idx_row[w]])) max_idx_row[w]=j; + //assert(max_idx_row[w] == MaxEntryRow(M, w)); + } + for (int w=j+1; w < n; w++) { // 0 <= i < j < w < n + M[j][w] = s*M[w][i] + c*M[j][w]; //M[w][i], M[j][w] from previous iteration + } + // now that we're done modifying row j, we can update max_idx_row[j] + max_idx_row[j] = MaxEntryRow(M, j); +} //Jacobi::ApplyRot() + + +/// brief Multiply matrix E on the left by the (previously calculated) +/// rotation matrix. +/// +/// details +/// Multiply matrix M on the LEFT side by a transposed rotation matrix, R^T. +/// This matrix performs a rotation in the i,j plane by angle θ +/// (where the arguments "s" and "c" refer to cos(θ) and sin(θ), respectively). +/// +/// verbatim +/// E'_uv = Σ_w R_wu * E_wv +/// endverbatim + +template +void Jacobi:: +ApplyRotLeft(Matrix E, // matrix + int i, // row index + int j) // column index +{ + // recall that c = cos(θ) and s = sin(θ) + for (int v = 0; v < n; v++) { + Scalar Eiv = E[i][v]; //backup E[i][v] + E[i][v] = c*E[i][v] - s*E[j][v]; + E[j][v] = s*Eiv + c*E[j][v]; + } +} + +/// brief Find the off-diagonal index in row i whose absolute value is largest +template +int Jacobi:: +MaxEntryRow(Scalar const *const *M, int i) const { + int j_max = i+1; + for(int j = i+2; j < n; j++) + if (std::abs(M[i][j]) > std::abs(M[i][j_max])) + j_max = j; + return j_max; +} + +/// brief Find the indices (i_max, j_max) marking the location of the +/// entry in the matrix with the largest absolute value. This +/// uses the max_idx_row[] array to find the answer in O(n) time. +/// returns This function does not return a avalue. However after it is +/// invoked, the location of the largest matrix element will be +/// stored in the i_max and j_max arguments. +template +void Jacobi:: +MaxEntry(Scalar const *const *M, int& i_max, int& j_max) const { + // find the maximum entry in the matrix M in O(n) time + i_max = 0; + j_max = max_idx_row[i_max]; + Scalar max_entry = std::abs(M[i_max][j_max]); + int nm1 = n-1; + for (int i=1; i < nm1; i++) { + int j = max_idx_row[i]; + if (std::abs(M[i][j]) > max_entry) { + max_entry = std::abs(M[i][j]); + i_max = i; + j_max = j; + } + } +} + +/// brief Sort the rows in matrix "evec" according to the numbers in "eval". +template +void Jacobi:: +SortRows(Vector eval, // vector containing the keys used for sorting + Matrix evec, // matrix whose rows will be sorted according to v + int n, // size of the vector and matrix + SortCriteria sort_criteria) const // sort eigenvalues? +{ + for (int i = 0; i < n-1; i++) { + int i_max = i; + for (int j = i+1; j < n; j++) { + // find the "maximum" element in the array starting at position i+1 + switch (sort_criteria) { + case SORT_DECREASING_EVALS: + if (eval[j] > eval[i_max]) + i_max = j; + break; + case SORT_INCREASING_EVALS: + if (eval[j] < eval[i_max]) + i_max = j; + break; + case SORT_DECREASING_ABS_EVALS: + if (std::abs(eval[j]) > std::abs(eval[i_max])) + i_max = j; + break; + case SORT_INCREASING_ABS_EVALS: + if (std::abs(eval[j]) < std::abs(eval[i_max])) + i_max = j; + break; + default: + break; + } + } + std::swap(eval[i], eval[i_max]); // sort "eval" + for (int k = 0; k < n; k++) + std::swap(evec[i][k], evec[i_max][k]); // sort "evec" + } +} + +template +void Jacobi:: +Init() { + n = 0; + M = nullptr; + max_idx_row = nullptr; + is_preallocated = false; +} + +template +void Jacobi:: +SetSize(int n) { + Dealloc(); + Alloc(n); +} + +// Implementation: Jacobi memory management: + +template +void Jacobi:: +Alloc(int n) { + //assert(! is_preallocated); + this->n = n; + if (n > 0) { + max_idx_row = new int[n]; + Alloc2D(n, n, &M); + } +} + +template +void Jacobi:: +Dealloc() { + //assert(! is_preallocated); + Dealloc2D(&M); + delete[] max_idx_row; + max_idx_row = nullptr; + Init(); +} + +// Jacobi copy and move constructor, swap, and assignment operator: + +template +Jacobi:: +Jacobi(const Jacobi& source) +{ + Init(); + SetSize(source.n); + + //assert(n == source.n); + // The following lines aren't really necessary, because the contents + // of source.M and source.max_idx_row are not needed (since they are + // overwritten every time Jacobi::Diagonalize() is invoked). + std::copy(source.max_idx_row, + source.max_idx_row + n, + max_idx_row); + for (int i = 0; i < n; i++) + std::copy(source.M[i], + source.M[i] + n, + M[i]); +} + +template +void Jacobi:: +swap(Jacobi &other) { + std::swap(n, other.n); + std::swap(is_preallocated, other.is_preallocated); + std::swap(max_idx_row, other.max_idx_row); + std::swap(M, other.M); +} + +// Move constructor (C++11) +template +Jacobi:: +Jacobi(Jacobi&& other) { + Init(); + this->swap(other); +} + +// Using the "copy-swap" idiom for the assignment operator +template +Jacobi& +Jacobi:: +operator = (Jacobi source) { + this->swap(source); + return *this; +} + + + +// --- Implementation: Eigendecomposition of large matrices ---- + +template +inline LambdaLanczos::LambdaLanczos() { + this->matrix_size = 0; + this->max_iteration = 0; + this->find_maximum = false; +} + + +template +inline LambdaLanczos:: +LambdaLanczos(std::function&, + std::vector&)> mv_mul, + int matrix_size, + bool find_maximum) +{ + this->mv_mul = mv_mul; + this->matrix_size = matrix_size; + this->max_iteration = matrix_size; + this->find_maximum = find_maximum; +} + + +template +inline int LambdaLanczos:: +run(real_t& eigvalue, std::vector& eigvec) const +{ + //assert(matrix_size > 0); + //assert(0 < this->tridiag_eps_ratio && this->tridiag_eps_ratio < 1); + + std::vector> u; // Lanczos vectors + std::vector> alpha; // Diagonal elements of an approximated tridiagonal matrix + std::vector> beta; // Subdiagonal elements of an approximated tridiagonal matrix + + const int n = this->matrix_size; + + u.reserve(this->initial_vector_size); + alpha.reserve(this->initial_vector_size); + beta.reserve(this->initial_vector_size); + + u.emplace_back(n, 0.0); // Same as u.push_back(std::vector(n, 0.0)) + + std::vector vk(n, 0.0); + + real_t alphak = 0.0; + alpha.push_back(alphak); + real_t betak = 0.0; + beta.push_back(betak); + + std::vector uk(n); + this->init_vector(uk); + normalize(uk); + u.push_back(uk); + + real_t ev, pev; // Calculated eigenvalue and previous one + pev = std::numeric_limits>::max(); + + int itern = this->max_iteration; + for(int k = 1;k <= this->max_iteration;k++) { + // vk = (A + offset*E)uk, here E is the identity matrix + for(int i = 0;i < n;i++) { + vk[i] = uk[i]*this->eigenvalue_offset; + } + this->mv_mul(uk, vk); + + alphak = std::real(inner_prod(u.back(), vk)); + + // The inner product is real. + // Proof: + // = + // On the other hand its complex conjugate is + // ^* = = = + // here the condition that matrix A is a symmetric (Hermitian) is used. + // Therefore + // = ^* + // is real. + + alpha.push_back(alphak); + + for(int i = 0;i < n; i++) { + uk[i] = vk[i] - betak*u[k-1][i] - alphak*u[k][i]; + } + + schmidt_orth(uk, u); + + betak = l2_norm(uk); + beta.push_back(betak); + + if(this->find_maximum) { + ev = find_maximum_eigenvalue(alpha, beta); + } else { + ev = find_minimum_eigenvalue(alpha, beta); + } + + const real_t zero_threshold = minimum_effective_decimal>()*1e-1; + if(betak < zero_threshold) { + u.push_back(uk); + // This element will never be accessed, + // but this "push" guarantees u to always have one more element than + // alpha and beta do. + itern = k; + break; + } + + normalize(uk); + u.push_back(uk); + + if(abs(ev-pev) < std::min(abs(ev), abs(pev))*this->eps) { + itern = k; + break; + } else { + pev = ev; + } + } + + eigvalue = ev - this->eigenvalue_offset; + + int m = alpha.size(); + std::vector cv(m+1); + cv[0] = 0.0; + cv[m] = 0.0; + cv[m-1] = 1.0; + + beta[m-1] = 0.0; + + if(eigvec.size() < n) { + eigvec.resize(n); + } + + for(int i = 0;i < n;i++) { + eigvec[i] = cv[m-1]*u[m-1][i]; + } + + for(int k = m-2;k >= 1;k--) { + cv[k] = ((ev - alpha[k+1])*cv[k+1] - beta[k+1]*cv[k+2])/beta[k]; + + for(int i = 0;i < n;i++) { + eigvec[i] += cv[k]*u[k][i]; + } + } + + normalize(eigvec); + + return itern; + +} //LambdaLancos::run() + + + +template +inline void LambdaLanczos:: +schmidt_orth(std::vector& uorth, const std::vector>& u) +{ + // Vectors in u must be normalized, but uorth doesn't have to be. + + int n = uorth.size(); + + for(int k = 0;k < u.size();k++) { + T innprod = inner_prod(uorth, u[k]); + for(int i = 0;i < n;i++) + uorth[i] -= innprod * u[k][i]; + } +} + + +template +inline real_t LambdaLanczos:: +find_minimum_eigenvalue(const std::vector>& alpha, + const std::vector>& beta) const +{ + real_t eps = this->eps * this->tridiag_eps_ratio; + real_t pmid = std::numeric_limits>::max(); + real_t r = tridiagonal_eigen_limit(alpha, beta); + real_t lower = -r; + real_t upper = r; + real_t mid; + int nmid; // Number of eigenvalues smaller than the "mid" + + while(upper-lower > std::min(abs(lower), abs(upper))*eps) { + mid = (lower+upper)/2.0; + nmid = num_of_eigs_smaller_than(mid, alpha, beta); + if(nmid >= 1) { + upper = mid; + } else { + lower = mid; + } + + if(mid == pmid) { + break; // This avoids an infinite loop due to zero matrix + } + pmid = mid; + } + + return lower; // The "lower" almost equals the "upper" here. +} + + +template +inline real_t LambdaLanczos:: +find_maximum_eigenvalue(const std::vector>& alpha, + const std::vector>& beta) const +{ + real_t eps = this->eps * this->tridiag_eps_ratio; + real_t pmid = std::numeric_limits>::max(); + real_t r = tridiagonal_eigen_limit(alpha, beta); + real_t lower = -r; + real_t upper = r; + real_t mid; + int nmid; // Number of eigenvalues smaller than the "mid" + + int m = alpha.size() - 1; // Number of eigenvalues of the approximated + // triangular matrix, which equals the rank of it + + + while(upper-lower > std::min(abs(lower), abs(upper))*eps) { + mid = (lower+upper)/2.0; + nmid = num_of_eigs_smaller_than(mid, alpha, beta); + + if(nmid < m) { + lower = mid; + } else { + upper = mid; + } + + if(mid == pmid) { + break; // This avoids an infinite loop due to zero matrix + } + pmid = mid; + } + + return lower; // The "lower" almost equals the "upper" here. +} + + +/// @brief +/// Compute the upper bound of the absolute value of eigenvalues +/// by Gerschgorin theorem. This routine gives a rough upper bound, +/// but it is sufficient because the bisection routine using +/// the upper bound converges exponentially. + +template +inline real_t LambdaLanczos:: +tridiagonal_eigen_limit(const std::vector>& alpha, + const std::vector>& beta) +{ + real_t r = l1_norm(alpha); + r += 2*l1_norm(beta); + + return r; +} + + + +// Algorithm from +// Peter Arbenz et al. +// "High Performance Algorithms for Structured Matrix Problems" +// Nova Science Publishers, Inc. + +template +inline int LambdaLanczos:: +num_of_eigs_smaller_than(real_t c, + const std::vector>& alpha, + const std::vector>& beta) +{ + real_t q_i = 1.0; + int count = 0; + int m = alpha.size(); + + for(int i = 1;i < m;i++){ + q_i = alpha[i] - c - beta[i-1]*beta[i-1]/q_i; + if(q_i < 0){ + count++; + } + if(q_i == 0){ + q_i = minimum_effective_decimal>(); + } + } + + return count; +} + + +template +inline void LambdaLanczos::ChooseOffset() { + const auto n = this->matrix_size; + std::vector unit_vec_j(n); + std::vector matrix_column_j(n); + real_t eval_upper_bound = 0.0; + /// According to Gershgorin theorem, the maximum (magnitude) eigenvalue should + /// not exceed max_j{Σ_i|Mij|}. We can infer the contents of each column in + /// the matrix by multiplying it by different unit vectors. This is slow. + for (int j = 0; j < n; j++) { + std::fill(unit_vec_j.begin(), unit_vec_j.end(), 0); // fill with zeros + unit_vec_j[j] = 1.0; // = jth element is 1, all other elements are 0 + // Multiplying the matrix by a unit vector (a vector containing only one + // non-zero element at position j) extracts the jth column of the matrix. + this->mv_mul(unit_vec_j, matrix_column_j); + real_t sum_column = 0.0; // compute Σ_i|Mij| + for (int i = 0; i < n; i++) + sum_column += std::abs(matrix_column_j[i]); + if (eval_upper_bound < sum_column) + eval_upper_bound = sum_column; // compute max_j{Σ_i|Mij|} + } + if (find_maximum) + this->eigenvalue_offset = eval_upper_bound; + else + this->eigenvalue_offset = -eval_upper_bound; +} + + +template +inline int LambdaLanczos::SetSize(int matrix_size) +{ + this->matrix_size = matrix_size; + this->max_iteration = matrix_size; + return matrix_size; +} + +template +inline void LambdaLanczos::SetMul(std::function&, std::vector&)> mv_mul) +{ + this->mv_mul = mv_mul; +} + +template +inline void LambdaLanczos::SetInitVec(std::function&)> init_vector) +{ + this->init_vector = init_vector; +} + +template +inline void LambdaLanczos::SetFindMax(bool find_maximum) { + this->find_maximum = find_maximum; +} + +template +inline void LambdaLanczos::SetEvalOffset(T offset) +{ + this->eigenvalue_offset = offset; +} + +template +inline void LambdaLanczos::SetEpsilon(T epsilon) +{ + this->eps = epsilon; +} + +template +inline void LambdaLanczos::SetTriEpsRatio(T tri_eps_ratio) +{ + this->tridiag_eps_ratio = tri_eps_ratio; +} + + + + + +template +inline void VectorRandomInitializer:: +init(std::vector& v) +{ + std::random_device dev; + std::mt19937 mt(dev()); + std::uniform_real_distribution rand((T)(-1.0), (T)(1.0)); + + int n = v.size(); + for(int i = 0;i < n;i++) { + v[i] = rand(mt); + } + + normalize(v); +} + + +template +inline void VectorRandomInitializer>:: +init(std::vector>& v) +{ + std::random_device dev; + std::mt19937 mt(dev()); + std::uniform_real_distribution rand((T)(-1.0), (T)(1.0)); + + int n = v.size(); + for(int i = 0;i < n;i++) { + v[i] = std::complex(rand(mt), rand(mt)); + } + + normalize(v); +} + + +// --- Implementation of PEigenDense + +template +void PEigenDense:: +SetSize(int matrix_size) { + n = matrix_size; + evec.resize(n); +} + +template +PEigenDense:: +PEigenDense(int matrix_size):evec(matrix_size) { + SetSize(matrix_size); +} + +template +real_t PEigenDense:: +PrincipalEigen(ConstMatrix matrix, + Vector eigenvector, + bool find_max) +{ + //assert(n > 0); + auto matmul = [&](const std::vector& in, std::vector& out) { + for(int i = 0; i < n; i++) { + for(int j = 0; j < n; j++) { + out[i] += matrix[i][j]*in[j]; + } + } + }; + auto init_vec = [&](std::vector& vec) { + for(int i = 0; i < n; i++) + vec[i] = 0.0; + vec[0] = 1.0; + }; + + // "ll_engine" calculates the eigenvalue and eigenvector. + LambdaLanczos ll_engine(matmul, n, find_max); + + // The Lanczos algorithm selects the eigenvalue with the largest magnitude. + // In order to insure that this is the one we want (maxima or minima), we can + // add a constant to all of the eigenvalues by setting "eigenvalue_offset". + Scalar eval_upper_bound = 0.0; + for (int i = 0; i < n; i++) { + Scalar sum_row = 0.0; + for (int j = 0; j < n; i++) + sum_row += std::abs(matrix[i][j]); + if (eval_upper_bound < sum_row) + eval_upper_bound = sum_row; + } + if (find_max) + ll_engine.eigenvalue_offset = eval_upper_bound; + else + ll_engine.eigenvalue_offset = -eval_upper_bound; + + ll_engine.init_vector = init_vec; + + Scalar eval; + + // This line does all of the hard work: + ll_engine.run(eval, evec); + + for (int i = 0; i < n; i++) + eigenvector[i] = evec[i]; + + return eval; +} + +} //namespace MathEigen + + + + + + + +#endif //#ifndef LMP_MATH_EIGEN_IMPL_H diff --git a/src/math_extra.cpp b/src/math_extra.cpp index b04414a300..a7a8a98a90 100644 --- a/src/math_extra.cpp +++ b/src/math_extra.cpp @@ -19,8 +19,6 @@ #include #include -#define MAXJACOBI 50 - namespace MathExtra { /* ---------------------------------------------------------------------- @@ -92,88 +90,6 @@ int mldivide3(const double m[3][3], const double *v, double *ans) return 0; } -/* ---------------------------------------------------------------------- - compute evalues and evectors of 3x3 real symmetric matrix - based on Jacobi rotations - adapted from Numerical Recipes jacobi() function -------------------------------------------------------------------------- */ - -int jacobi(double matrix[3][3], double *evalues, double evectors[3][3]) -{ - int i,j,k; - double tresh,theta,tau,t,sm,s,h,g,c,b[3],z[3]; - - for (i = 0; i < 3; i++) { - for (j = 0; j < 3; j++) evectors[i][j] = 0.0; - evectors[i][i] = 1.0; - } - for (i = 0; i < 3; i++) { - b[i] = evalues[i] = matrix[i][i]; - z[i] = 0.0; - } - - for (int iter = 1; iter <= MAXJACOBI; iter++) { - sm = 0.0; - for (i = 0; i < 2; i++) - for (j = i+1; j < 3; j++) - sm += fabs(matrix[i][j]); - if (sm == 0.0) return 0; - - if (iter < 4) tresh = 0.2*sm/(3*3); - else tresh = 0.0; - - for (i = 0; i < 2; i++) { - for (j = i+1; j < 3; j++) { - g = 100.0*fabs(matrix[i][j]); - if (iter > 4 && fabs(evalues[i])+g == fabs(evalues[i]) - && fabs(evalues[j])+g == fabs(evalues[j])) - matrix[i][j] = 0.0; - else if (fabs(matrix[i][j]) > tresh) { - h = evalues[j]-evalues[i]; - if (fabs(h)+g == fabs(h)) t = (matrix[i][j])/h; - else { - theta = 0.5*h/(matrix[i][j]); - t = 1.0/(fabs(theta)+sqrt(1.0+theta*theta)); - if (theta < 0.0) t = -t; - } - c = 1.0/sqrt(1.0+t*t); - s = t*c; - tau = s/(1.0+c); - h = t*matrix[i][j]; - z[i] -= h; - z[j] += h; - evalues[i] -= h; - evalues[j] += h; - matrix[i][j] = 0.0; - for (k = 0; k < i; k++) rotate(matrix,k,i,k,j,s,tau); - for (k = i+1; k < j; k++) rotate(matrix,i,k,k,j,s,tau); - for (k = j+1; k < 3; k++) rotate(matrix,i,k,j,k,s,tau); - for (k = 0; k < 3; k++) rotate(evectors,k,i,k,j,s,tau); - } - } - } - - for (i = 0; i < 3; i++) { - evalues[i] = b[i] += z[i]; - z[i] = 0.0; - } - } - return 1; -} - -/* ---------------------------------------------------------------------- - perform a single Jacobi rotation -------------------------------------------------------------------------- */ - -void rotate(double matrix[3][3], int i, int j, int k, int l, - double s, double tau) -{ - double g = matrix[i][j]; - double h = matrix[k][l]; - matrix[i][j] = g-s*(h+g*tau); - matrix[k][l] = h+s*(g-h*tau); -} - /* ---------------------------------------------------------------------- Richardson iteration to update quaternion from angular momentum return new normalized quaternion q diff --git a/src/math_extra.h b/src/math_extra.h index af2dcbcfe7..6c58bc93c2 100644 --- a/src/math_extra.h +++ b/src/math_extra.h @@ -85,7 +85,6 @@ namespace MathExtra { void write3(const double mat[3][3]); int mldivide3(const double mat[3][3], const double *vec, double *ans); - int jacobi(double matrix[3][3], double *evalues, double evectors[3][3]); void rotate(double matrix[3][3], int i, int j, int k, int l, double s, double tau); void richardson(double *q, double *m, double *w, double *moments, double dtq); @@ -169,10 +168,13 @@ inline void MathExtra::zero3(double *v) inline void MathExtra::norm3(double *v) { - double scale = 1.0/sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); - v[0] *= scale; - v[1] *= scale; - v[2] *= scale; + const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + if (val > 0.0) { + const double scale = 1.0/sqrt(val); + v[0] *= scale; + v[1] *= scale; + v[2] *= scale; + } } /* ---------------------------------------------------------------------- @@ -181,10 +183,13 @@ inline void MathExtra::norm3(double *v) inline void MathExtra::normalize3(const double *v, double *ans) { - double scale = 1.0/sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); - ans[0] = v[0]*scale; - ans[1] = v[1]*scale; - ans[2] = v[2]*scale; + const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + if (val > 0.0) { + double scale = 1.0/sqrt(val); + ans[0] = v[0]*scale; + ans[1] = v[1]*scale; + ans[2] = v[2]*scale; + } } /* ---------------------------------------------------------------------- @@ -194,10 +199,13 @@ inline void MathExtra::normalize3(const double *v, double *ans) inline void MathExtra::snormalize3(const double length, const double *v, double *ans) { - double scale = length/sqrt(v[0]*v[0]+v[1]*v[1]+v[2]*v[2]); - ans[0] = v[0]*scale; - ans[1] = v[1]*scale; - ans[2] = v[2]*scale; + const double val = v[0]*v[0]+v[1]*v[1]+v[2]*v[2]; + if (val > 0.0) { + double scale = length/sqrt(val); + ans[0] = v[0]*scale; + ans[1] = v[1]*scale; + ans[2] = v[2]*scale; + } } /* ---------------------------------------------------------------------- diff --git a/src/memory.cpp b/src/memory.cpp index 6211687a7a..f0d8976ad1 100644 --- a/src/memory.cpp +++ b/src/memory.cpp @@ -12,9 +12,8 @@ ------------------------------------------------------------------------- */ #include "memory.h" -#include + #include "error.h" -#include "fmt/format.h" #if defined(LMP_USER_INTEL) && defined(__INTEL_COMPILER) #ifndef LMP_INTEL_NO_TBB @@ -46,7 +45,7 @@ Memory::Memory(LAMMPS *lmp) : Pointers(lmp) {} void *Memory::smalloc(bigint nbytes, const char *name) { - if (nbytes == 0) return NULL; + if (nbytes == 0) return nullptr; #if defined(LAMMPS_MEMALIGN) void *ptr; @@ -55,13 +54,13 @@ void *Memory::smalloc(bigint nbytes, const char *name) ptr = scalable_aligned_malloc(nbytes, LAMMPS_MEMALIGN); #else int retval = posix_memalign(&ptr, LAMMPS_MEMALIGN, nbytes); - if (retval) ptr = NULL; + if (retval) ptr = nullptr; #endif #else void *ptr = malloc(nbytes); #endif - if (ptr == NULL) + if (ptr == nullptr) error->one(FLERR,fmt::format("Failed to allocate {} bytes for array {}", nbytes,name)); return ptr; @@ -75,7 +74,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) { if (nbytes == 0) { destroy(ptr); - return NULL; + return nullptr; } #if defined(LMP_USE_TBB_ALLOCATOR) @@ -100,7 +99,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) #else ptr = realloc(ptr,nbytes); #endif - if (ptr == NULL) + if (ptr == nullptr) error->one(FLERR,fmt::format("Failed to reallocate {} bytes for array {}", nbytes,name)); return ptr; @@ -112,7 +111,7 @@ void *Memory::srealloc(void *ptr, bigint nbytes, const char *name) void Memory::sfree(void *ptr) { - if (ptr == NULL) return; + if (ptr == nullptr) return; #if defined(LMP_USE_TBB_ALLOCATOR) scalable_aligned_free(ptr); #else diff --git a/src/memory.h b/src/memory.h index 42c9bf6aba..64685feac0 100644 --- a/src/memory.h +++ b/src/memory.h @@ -50,7 +50,7 @@ class Memory : protected Pointers { template TYPE **create(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1d array @@ -59,7 +59,7 @@ class Memory : protected Pointers { template TYPE *grow(TYPE *&array, int n, const char *name) { - if (array == NULL) return create(array,n,name); + if (array == nullptr) return create(array,n,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n; array = (TYPE *) srealloc(array,nbytes,name); @@ -68,7 +68,7 @@ class Memory : protected Pointers { template TYPE **grow(TYPE **& /*array*/, int /*n*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 1d array @@ -77,7 +77,7 @@ class Memory : protected Pointers { template void destroy(TYPE *&array) { sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -96,7 +96,7 @@ class Memory : protected Pointers { template TYPE **create1d_offset(TYPE **& /*array*/, int /*nlo*/, int /*nhi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 1d array with index offset @@ -106,7 +106,7 @@ class Memory : protected Pointers { void destroy1d_offset(TYPE *&array, int offset) { if (array) sfree(&array[offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -131,7 +131,7 @@ class Memory : protected Pointers { template TYPE ***create(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 2d array @@ -141,7 +141,7 @@ class Memory : protected Pointers { template TYPE **grow(TYPE **&array, int n1, int n2, const char *name) { - if (array == NULL) return create(array,n1,n2,name); + if (array == nullptr) return create(array,n1,n2,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2; TYPE *data = (TYPE *) srealloc(array[0],nbytes,name); @@ -158,7 +158,7 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***& /*array*/, int /*n1*/, int /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 2d array @@ -167,10 +167,10 @@ class Memory : protected Pointers { template void destroy(TYPE **&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -198,7 +198,7 @@ class Memory : protected Pointers { template TYPE ***create_ragged(TYPE ***& /*array*/, int /*n1*/, int * /*n2*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- create a 2d array with 2nd index from n2lo to n2hi inclusive @@ -217,7 +217,7 @@ class Memory : protected Pointers { template TYPE ***create2d_offset(TYPE ***& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, - const char *name) {fail(name); return NULL;} + const char *name) {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 2d array with 2nd index offset @@ -226,10 +226,10 @@ class Memory : protected Pointers { template void destroy2d_offset(TYPE **&array, int offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[0][offset]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -262,7 +262,7 @@ class Memory : protected Pointers { template TYPE ****create(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 3d array @@ -272,7 +272,7 @@ class Memory : protected Pointers { template TYPE ***grow(TYPE ***&array, int n1, int n2, int n3, const char *name) { - if (array == NULL) return create(array,n1,n2,n3,name); + if (array == nullptr) return create(array,n1,n2,n3,name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; TYPE *data = (TYPE *) srealloc(array[0][0],nbytes,name); @@ -297,7 +297,7 @@ class Memory : protected Pointers { template TYPE ****grow(TYPE ****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 3d array @@ -306,11 +306,11 @@ class Memory : protected Pointers { template void destroy(TYPE ***&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -331,7 +331,7 @@ class Memory : protected Pointers { template TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2*/, int /*n3*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 3d array with 1st index offset @@ -340,11 +340,11 @@ class Memory : protected Pointers { template void destroy3d_offset(TYPE ***&array, int offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[offset][0][0]); sfree(&array[offset][0]); sfree(&array[offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -376,7 +376,7 @@ class Memory : protected Pointers { TYPE ****create3d_offset(TYPE ****& /*array*/, int /*n1lo*/, int /*n1hi*/, int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 3d array with all 3 indices offset @@ -386,11 +386,11 @@ class Memory : protected Pointers { void destroy3d_offset(TYPE ***&array, int n1_offset, int n2_offset, int n3_offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[n1_offset][n2_offset][n3_offset]); sfree(&array[n1_offset][n2_offset]); sfree(&array[n1_offset]); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -433,7 +433,7 @@ class Memory : protected Pointers { template TYPE *****create(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- grow or shrink 1st dim of a 4d array @@ -444,7 +444,7 @@ class Memory : protected Pointers { TYPE ****grow(TYPE ****&array, int n1, int n2, int n3, int n4, const char *name) { - if (array == NULL) return create(array, n1, n2, n3, n4, name); + if (array == nullptr) return create(array, n1, n2, n3, n4, name); bigint nbytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; TYPE *data = (TYPE *)srealloc(array[0][0][0], nbytes, name); @@ -479,7 +479,7 @@ class Memory : protected Pointers { TYPE *****grow(TYPE *****& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, const char *name) { - fail(name); return NULL; + fail(name); return nullptr; } /* ---------------------------------------------------------------------- @@ -489,12 +489,12 @@ class Memory : protected Pointers { template void destroy(TYPE ****&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0][0]); sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -527,7 +527,7 @@ class Memory : protected Pointers { TYPE ****create4d_offset(TYPE *****& /*array*/, int /*n1*/, int /*n2lo*/, int /*n2hi*/, int /*n3lo*/, int /*n3hi*/, int /*n4lo*/, int /*n4hi*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- free a 4d array with indices 2,3, and 4 offset @@ -537,12 +537,12 @@ class Memory : protected Pointers { void destroy4d_offset(TYPE ****&array, int n2_offset, int n3_offset, int n4_offset) { - if (array == NULL) return; + if (array == nullptr) return; sfree(&array[0][n2_offset][n3_offset][n4_offset]); sfree(&array[0][n2_offset][n3_offset]); sfree(&array[0][n2_offset]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -594,7 +594,7 @@ class Memory : protected Pointers { template TYPE ******create(TYPE ******& /*array*/, int /*n1*/, int /*n2*/, int /*n3*/, int /*n4*/, int /*n5*/, const char *name) - {fail(name); return NULL;} + {fail(name); return nullptr;} /* ---------------------------------------------------------------------- destroy a 5d array @@ -603,13 +603,13 @@ class Memory : protected Pointers { template void destroy(TYPE *****&array) { - if (array == NULL) return; + if (array == nullptr) return; sfree(array[0][0][0][0]); sfree(array[0][0][0]); sfree(array[0][0]); sfree(array[0]); sfree(array); - array = NULL; + array = nullptr; } /* ---------------------------------------------------------------------- @@ -617,40 +617,40 @@ class Memory : protected Pointers { ------------------------------------------------------------------------- */ template - bigint usage(TYPE *array, int n) + double usage(TYPE *array, int n) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n; + double bytes = ((double) sizeof(TYPE)) * n; return bytes; } template - bigint usage(TYPE **array, int n1, int n2) + double usage(TYPE **array, int n1, int n2) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2; - bytes += ((bigint) sizeof(TYPE *)) * n1; + double bytes = ((double) sizeof(TYPE)) * n1*n2; + bytes += ((double) sizeof(TYPE *)) * n1; return bytes; } template - bigint usage(TYPE ***array, int n1, int n2, int n3) + double usage(TYPE ***array, int n1, int n2, int n3) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2*n3; - bytes += ((bigint) sizeof(TYPE *)) * n1*n2; - bytes += ((bigint) sizeof(TYPE **)) * n1; + double bytes = ((double) sizeof(TYPE)) * n1*n2*n3; + bytes += ((double) sizeof(TYPE *)) * n1*n2; + bytes += ((double) sizeof(TYPE **)) * n1; return bytes; } template - bigint usage(TYPE ****array, int n1, int n2, int n3, int n4) + double usage(TYPE ****array, int n1, int n2, int n3, int n4) { (void) array; - bigint bytes = ((bigint) sizeof(TYPE)) * n1*n2*n3*n4; - bytes += ((bigint) sizeof(TYPE *)) * n1*n2*n3; - bytes += ((bigint) sizeof(TYPE **)) * n1*n2; - bytes += ((bigint) sizeof(TYPE ***)) * n1; + double bytes = ((double) sizeof(TYPE)) * n1*n2*n3*n4; + bytes += ((double) sizeof(TYPE *)) * n1*n2*n3; + bytes += ((double) sizeof(TYPE **)) * n1*n2; + bytes += ((double) sizeof(TYPE ***)) * n1; return bytes; } }; diff --git a/src/mergesort.h b/src/mergesort.h deleted file mode 100644 index edb745922f..0000000000 --- a/src/mergesort.h +++ /dev/null @@ -1,124 +0,0 @@ -/* -*- c++ -*- ---------------------------------------------------------- - LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator - http://lammps.sandia.gov, Sandia National Laboratories - Steve Plimpton, sjplimp@sandia.gov - - Copyright (2003) Sandia Corporation. Under the terms of Contract - DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains - certain rights in this software. This software is distributed under - the GNU General Public License. - - See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -#ifndef LMP_MERGESORT -#define LMP_MERGESORT - -#include - -// custom hybrid upward merge sort implementation with support to pass -// an opaque pointer to the comparison function, e.g. for access to -// class members. this avoids having to use global variables. -// for improved performance, we employ an in-place insertion sort on -// chunks of up to 64 elements and switch to merge sort from then on. - -// part 1. insertion sort for pre-sorting of small chunks - -static void insertion_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void*)) -{ - if (num < 2) return; - for (int i=1; i < num; ++i) { - int tmp = index[i]; - for (int j=i-1; j >= 0; --j) { - if ((*comp)(index[j],tmp,ptr) > 0) { - index[j+1] = index[j]; - } else { - index[j+1] = tmp; - break; - } - if (j == 0) index[0] = tmp; - } - } -} - -// part 2. merge two sublists - -static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, - void *ptr, int (*comp)(int, int, void *)) -{ - int i = llo; - int l = llo; - int r = rlo; - while ((l < lhi) && (r < rhi)) { - if ((*comp)(buf[l],buf[r],ptr) < 0) - idx[i++] = buf[l++]; - else idx[i++] = buf[r++]; - } - - while (l < lhi) idx[i++] = buf[l++]; - while (r < rhi) idx[i++] = buf[r++]; -} - -// part 3: loop over sublists doubling in size with each iteration. -// pre-sort sublists with insertion sort for better performance. - -static void merge_sort(int *index, int num, void *ptr, - int (*comp)(int, int, void *)) -{ - if (num < 2) return; - - int chunk,i,j; - - // do insertion sort on chunks of up to 64 elements - - chunk = 64; - for (i=0; i < num; i += chunk) { - j = (i+chunk > num) ? num-i : chunk; - insertion_sort(index+i,j,ptr,comp); - } - - // already done? - - if (chunk >= num) return; - - // continue with merge sort on the pre-sorted chunks. - // we need an extra buffer for temporary storage and two - // pointers to operate on, so we can swap the pointers - // rather than copying to the hold buffer in each pass - - int *buf = new int[num]; - int *dest = index; - int *hold = buf; - - while (chunk < num) { - int m; - - // swap hold and destination buffer - - int *tmp = dest; dest = hold; hold = tmp; - - // merge from hold array to destination array - - for (i=0; i < num-1; i += 2*chunk) { - j = i + 2*chunk; - if (j > num) j=num; - m = i+chunk; - if (m > num) m=num; - do_merge(dest,hold,i,m,m,j,ptr,comp); - } - - // copy all indices not handled by the chunked merge sort loop - - for ( ; i < num ; i++ ) dest[i] = hold[i]; - chunk *= 2; - } - - // if the final sorted data is in buf, copy back to index - - if (dest == buf) memcpy(index,buf,sizeof(int)*num); - - delete[] buf; -} - -#endif diff --git a/src/min.cpp b/src/min.cpp index b14137f689..7474025c1a 100644 --- a/src/min.cpp +++ b/src/min.cpp @@ -20,32 +20,32 @@ ------------------------------------------------------------------------- */ #include "min.h" -#include -#include -#include + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "domain.h" -#include "comm.h" -#include "update.h" -#include "modify.h" -#include "fix_minimize.h" -#include "compute.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" #include "bond.h" -#include "angle.h" +#include "comm.h" +#include "compute.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix_minimize.h" +#include "force.h" #include "improper.h" #include "kspace.h" -#include "output.h" -#include "thermo.h" -#include "timer.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "fmt/format.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" +#include "thermo.h" +#include "timer.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -71,17 +71,17 @@ Min::Min(LAMMPS *lmp) : Pointers(lmp) delaystep_start_flag = 1; max_vdotf_negatif = 2000; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nextra_global = 0; - fextra = NULL; + fextra = nullptr; nextra_atom = 0; - xextra_atom = fextra_atom = NULL; - extra_peratom = extra_nlen = NULL; - extra_max = NULL; - requestor = NULL; + xextra_atom = fextra_atom = nullptr; + extra_peratom = extra_nlen = nullptr; + extra_max = nullptr; + requestor = nullptr; external_force_clear = 0; @@ -128,7 +128,7 @@ void Min::init() nextra_global = 0; delete [] fextra; - fextra = NULL; + fextra = nullptr; nextra_atom = 0; memory->sfree(xextra_atom); @@ -137,10 +137,10 @@ void Min::init() memory->destroy(extra_nlen); memory->destroy(extra_max); memory->sfree(requestor); - xextra_atom = fextra_atom = NULL; - extra_peratom = extra_nlen = NULL; - extra_max = NULL; - requestor = NULL; + xextra_atom = fextra_atom = nullptr; + extra_peratom = extra_nlen = nullptr; + extra_max = nullptr; + requestor = nullptr; // virial_style: // 1 if computed explicitly by pair->compute via sum over pair interactions @@ -244,7 +244,7 @@ void Min::setup(int flag) bigint ndofme = 3 * static_cast(atom->nlocal); for (int m = 0; m < nextra_atom; m++) - ndofme += extra_peratom[m]*atom->nlocal; + ndofme += extra_peratom[m]*static_cast(atom->nlocal); MPI_Allreduce(&ndofme,&ndoftotal,1,MPI_LMP_BIGINT,MPI_SUM,world); ndoftotal += nextra_global; @@ -671,35 +671,35 @@ void Min::modify_params(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"dmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - dmax = force->numeric(FLERR,arg[iarg+1]); + dmax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"delaystep") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - delaystep = force->numeric(FLERR,arg[iarg+1]); + delaystep = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dtgrow") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - dtgrow = force->numeric(FLERR,arg[iarg+1]); + dtgrow = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"dtshrink") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - dtshrink = force->numeric(FLERR,arg[iarg+1]); + dtshrink = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"alpha0") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - alpha0 = force->numeric(FLERR,arg[iarg+1]); + alpha0 = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"alphashrink") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - alphashrink = force->numeric(FLERR,arg[iarg+1]); + alphashrink = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - tmax = force->numeric(FLERR,arg[iarg+1]); + tmax = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tmin") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - tmin = force->numeric(FLERR,arg[iarg+1]); + tmin = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"halfstepback") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); @@ -715,7 +715,7 @@ void Min::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"vdfmax") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); - max_vdotf_negatif = force->numeric(FLERR,arg[iarg+1]); + max_vdotf_negatif = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"integrator") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal min_modify command"); @@ -760,8 +760,8 @@ void Min::ev_setup() delete [] vlist_global; delete [] vlist_atom; delete [] cvlist_atom; - elist_global = elist_atom = NULL; - vlist_global = vlist_atom = cvlist_atom = NULL; + elist_global = elist_atom = nullptr; + vlist_global = vlist_atom = cvlist_atom = nullptr; nelist_global = nelist_atom = 0; nvlist_global = nvlist_atom = ncvlist_atom = 0; diff --git a/src/min.h b/src/min.h index b23c9b6670..438a775d16 100644 --- a/src/min.h +++ b/src/min.h @@ -14,7 +14,7 @@ #ifndef LMP_MIN_H #define LMP_MIN_H -#include "pointers.h" +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -36,7 +36,7 @@ class Min : protected Pointers { virtual void run(int); void cleanup(); int request(class Pair *, int, double); - virtual bigint memory_usage() {return 0;} + virtual double memory_usage() {return 0;} void modify_params(int, char **); virtual int modify_param(int, char **) {return 0;} virtual double fnorm_sqr(); diff --git a/src/min_cg.cpp b/src/min_cg.cpp index 46da4bfa5b..511b16cef8 100644 --- a/src/min_cg.cpp +++ b/src/min_cg.cpp @@ -12,12 +12,13 @@ ------------------------------------------------------------------------- */ #include "min_cg.h" -#include -#include + #include "error.h" -#include "update.h" #include "output.h" #include "timer.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/min_fire.cpp b/src/min_fire.cpp index 53bedfbb6c..b7225a1a5a 100644 --- a/src/min_fire.cpp +++ b/src/min_fire.cpp @@ -16,21 +16,18 @@ Erik Bitzek, FAU Erlangen-Nuernberg ------------------------------------------------------------------------- */ -#include #include "min_fire.h" -#include "universe.h" + #include "atom.h" +#include "comm.h" +#include "error.h" #include "force.h" -#include "update.h" #include "output.h" #include "timer.h" -#include "error.h" -#include "variable.h" -#include "modify.h" -#include "compute.h" -#include "domain.h" -#include "neighbor.h" -#include "comm.h" +#include "universe.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/min_fire_old.cpp b/src/min_fire_old.cpp index bd76b2d1fc..6efd00a4b8 100644 --- a/src/min_fire_old.cpp +++ b/src/min_fire_old.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "min_fire_old.h" -#include -#include -#include "universe.h" + #include "atom.h" #include "error.h" #include "force.h" -#include "update.h" #include "output.h" #include "timer.h" +#include "universe.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/min_hftn.cpp b/src/min_hftn.cpp index 63432aab63..54b1ee6361 100644 --- a/src/min_hftn.cpp +++ b/src/min_hftn.cpp @@ -18,17 +18,18 @@ ------------------------------------------------------------------------- */ #include "min_hftn.h" -#include -#include -#include + #include "atom.h" #include "error.h" #include "fix_minimize.h" #include "modify.h" #include "output.h" #include "pair.h" -#include "update.h" #include "timer.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -80,11 +81,11 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp) searchflag = 1; for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - _daExtraGlobal[i] = NULL; + _daExtraGlobal[i] = nullptr; for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - _daExtraAtom[i] = NULL; + _daExtraAtom[i] = nullptr; - _fpPrint = NULL; + _fpPrint = nullptr; return; } @@ -96,10 +97,10 @@ MinHFTN::MinHFTN(LAMMPS *lmp) : Min(lmp) MinHFTN::~MinHFTN (void) { for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - if (_daExtraGlobal[i] != NULL) + if (_daExtraGlobal[i] != nullptr) delete [] _daExtraGlobal[i]; for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) - if (_daExtraAtom[i] != NULL) + if (_daExtraAtom[i] != nullptr) delete [] _daExtraAtom[i]; return; @@ -117,14 +118,14 @@ void MinHFTN::init() error->all(FLERR,"Incorrect min_modify option"); for (int i = 1; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { - if (_daExtraGlobal[i] != NULL) + if (_daExtraGlobal[i] != nullptr) delete [] _daExtraGlobal[i]; - _daExtraGlobal[i] = NULL; + _daExtraGlobal[i] = nullptr; } for (int i = 0; i < NUM_HFTN_ATOM_BASED_VECTORS; i++) { - if (_daExtraAtom[i] != NULL) + if (_daExtraAtom[i] != nullptr) delete [] _daExtraAtom[i]; - _daExtraAtom[i] = NULL; + _daExtraAtom[i] = nullptr; } return; @@ -1617,7 +1618,7 @@ void MinHFTN::open_hftn_print_file_(void) char szTmp[50]; sprintf (szTmp, "progress_MinHFTN_%d.txt", nMyRank); _fpPrint = fopen (szTmp, "w"); - if (_fpPrint == NULL) { + if (_fpPrint == nullptr) { printf ("*** MinHFTN cannot open file '%s'\n", szTmp); printf ("*** continuing...\n"); return; @@ -1654,7 +1655,7 @@ void MinHFTN::hftn_print_line_(const bool bIsStepAccepted, const char sFormatR[] = "r %4d %5d %14.8f %11.5e %3s %9.3e %8.2e %10.3e %10.3e\n"; - if (_fpPrint == NULL) + if (_fpPrint == nullptr) return; char sStepType[4]; @@ -1700,6 +1701,6 @@ void MinHFTN::hftn_print_line_(const bool bIsStepAccepted, void MinHFTN::close_hftn_print_file_(void) { - if (_fpPrint != NULL) fclose (_fpPrint); + if (_fpPrint != nullptr) fclose (_fpPrint); return; } diff --git a/src/min_linesearch.cpp b/src/min_linesearch.cpp index a7a10dcd51..4ae8873129 100644 --- a/src/min_linesearch.cpp +++ b/src/min_linesearch.cpp @@ -22,15 +22,16 @@ ------------------------------------------------------------------------- */ #include "min_linesearch.h" -#include -#include + #include "atom.h" -#include "modify.h" #include "fix_minimize.h" -#include "pair.h" +#include "modify.h" #include "output.h" +#include "pair.h" #include "thermo.h" +#include + using namespace LAMMPS_NS; // ALPHA_MAX = max alpha allowed to avoid long backtracks @@ -53,8 +54,8 @@ using namespace LAMMPS_NS; MinLineSearch::MinLineSearch(LAMMPS *lmp) : Min(lmp) { searchflag = 1; - gextra = hextra = NULL; - x0extra_atom = gextra_atom = hextra_atom = NULL; + gextra = hextra = nullptr; + x0extra_atom = gextra_atom = hextra_atom = nullptr; } /* ---------------------------------------------------------------------- */ @@ -80,12 +81,12 @@ void MinLineSearch::init() delete [] gextra; delete [] hextra; - gextra = hextra = NULL; + gextra = hextra = nullptr; delete [] x0extra_atom; delete [] gextra_atom; delete [] hextra_atom; - x0extra_atom = gextra_atom = hextra_atom = NULL; + x0extra_atom = gextra_atom = hextra_atom = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/min_quickmin.cpp b/src/min_quickmin.cpp index 5e7643bf3b..025e80b95d 100644 --- a/src/min_quickmin.cpp +++ b/src/min_quickmin.cpp @@ -12,15 +12,16 @@ ------------------------------------------------------------------------- */ #include "min_quickmin.h" -#include -#include -#include "universe.h" + #include "atom.h" #include "error.h" #include "force.h" -#include "update.h" #include "output.h" #include "timer.h" +#include "universe.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/min_sd.cpp b/src/min_sd.cpp index d973ec1c82..5868acbe48 100644 --- a/src/min_sd.cpp +++ b/src/min_sd.cpp @@ -12,11 +12,13 @@ ------------------------------------------------------------------------- */ #include "min_sd.h" -#include + #include "error.h" -#include "update.h" #include "output.h" #include "timer.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/minimize.cpp b/src/minimize.cpp index 94fdcd8681..451412ecc8 100644 --- a/src/minimize.cpp +++ b/src/minimize.cpp @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #include "minimize.h" + #include "domain.h" -#include "update.h" -#include "min.h" -#include "finish.h" -#include "timer.h" #include "error.h" -#include "force.h" +#include "finish.h" +#include "min.h" +#include "timer.h" +#include "update.h" using namespace LAMMPS_NS; @@ -38,10 +38,10 @@ void Minimize::command(int narg, char **arg) // ignore minimize command, if walltime limit was already reached if (timer->is_timeout()) return; - update->etol = force->numeric(FLERR,arg[0]); - update->ftol = force->numeric(FLERR,arg[1]); - update->nsteps = force->inumeric(FLERR,arg[2]); - update->max_eval = force->inumeric(FLERR,arg[3]); + update->etol = utils::numeric(FLERR,arg[0],false,lmp); + update->ftol = utils::numeric(FLERR,arg[1],false,lmp); + update->nsteps = utils::inumeric(FLERR,arg[2],false,lmp); + update->max_eval = utils::inumeric(FLERR,arg[3],false,lmp); if (update->etol < 0.0 || update->ftol < 0.0) error->all(FLERR,"Illegal minimize command"); diff --git a/src/modify.cpp b/src/modify.cpp index 2d5dc4db8b..476f7ea9ab 100644 --- a/src/modify.cpp +++ b/src/modify.cpp @@ -12,24 +12,24 @@ ------------------------------------------------------------------------- */ #include "modify.h" -#include -#include #include "style_compute.h" #include "style_fix.h" + #include "atom.h" #include "comm.h" -#include "fix.h" #include "compute.h" -#include "group.h" -#include "update.h" #include "domain.h" -#include "region.h" -#include "input.h" -#include "variable.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "fix.h" +#include "group.h" +#include "input.h" +#include "memory.h" +#include "region.h" +#include "update.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace FixConst; @@ -54,34 +54,34 @@ Modify::Modify(LAMMPS *lmp) : Pointers(lmp) n_min_post_force = n_min_energy = 0; n_timeflag = -1; - fix = NULL; - fmask = NULL; - list_initial_integrate = list_post_integrate = NULL; - list_pre_exchange = list_pre_neighbor = list_post_neighbor = NULL; - list_pre_force = list_pre_reverse = list_post_force = NULL; - list_final_integrate = list_end_of_step = NULL; - list_thermo_energy = list_thermo_energy_atom = NULL; - list_initial_integrate_respa = list_post_integrate_respa = NULL; - list_pre_force_respa = list_post_force_respa = NULL; - list_final_integrate_respa = NULL; - list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = NULL; - list_min_pre_force = list_min_pre_reverse = list_min_post_force = NULL; - list_min_energy = NULL; + fix = nullptr; + fmask = nullptr; + list_initial_integrate = list_post_integrate = nullptr; + list_pre_exchange = list_pre_neighbor = list_post_neighbor = nullptr; + list_pre_force = list_pre_reverse = list_post_force = nullptr; + list_final_integrate = list_end_of_step = nullptr; + list_thermo_energy = list_thermo_energy_atom = nullptr; + list_initial_integrate_respa = list_post_integrate_respa = nullptr; + list_pre_force_respa = list_post_force_respa = nullptr; + list_final_integrate_respa = nullptr; + list_min_pre_exchange = list_min_pre_neighbor = list_min_post_neighbor = nullptr; + list_min_pre_force = list_min_pre_reverse = list_min_post_force = nullptr; + list_min_energy = nullptr; - end_of_step_every = NULL; + end_of_step_every = nullptr; - list_timeflag = NULL; + list_timeflag = nullptr; nfix_restart_global = 0; - id_restart_global = style_restart_global = NULL; - state_restart_global = NULL; - used_restart_global = NULL; + id_restart_global = style_restart_global = nullptr; + state_restart_global = nullptr; + used_restart_global = nullptr; nfix_restart_peratom = 0; - id_restart_peratom = style_restart_peratom = NULL; - index_restart_peratom = used_restart_peratom = NULL; + id_restart_peratom = style_restart_peratom = nullptr; + index_restart_peratom = used_restart_peratom = nullptr; ncompute = maxcompute = 0; - compute = NULL; + compute = nullptr; create_factories(); } @@ -795,17 +795,17 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // but can't think of better way // too late if instantiate fix, then check flag set in fix constructor, // since some fixes access domain settings in their constructor - // NULL must be last entry in this list + // nullptr must be last entry in this list const char *exceptions[] = {"GPU", "OMP", "INTEL", "property/atom", "cmap", "cmap3", "rx", - "deprecated", "STORE/KIM", NULL}; + "deprecated", "STORE/KIM", nullptr}; if (domain->box_exist == 0) { int m; - for (m = 0; exceptions[m] != NULL; m++) + for (m = 0; exceptions[m] != nullptr; m++) if (strcmp(arg[2],exceptions[m]) == 0) break; - if (exceptions[m] == NULL) + if (exceptions[m] == nullptr) error->all(FLERR,"Fix command before simulation box is defined"); } @@ -821,7 +821,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // warn if new group != old group // delete old fix, but do not call update_callback(), // since will replace this fix and thus other fix locs will not change - // set ptr to NULL in case new fix scans list of fixes, + // set ptr to a null pointer in case new fix scans list of fixes, // e.g. scan will occur in add_callback() if called by new fix // if fix ID does not exist: // set newflag = 1 so create new fix @@ -852,7 +852,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) if (fix[ifix]->igroup != igroup && comm->me == 0) error->warning(FLERR,"Replacing a fix, but new group != old group"); delete fix[ifix]; - fix[ifix] = NULL; + fix[ifix] = nullptr; } else { newflag = 1; @@ -866,7 +866,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) // create the Fix // try first with suffix appended - fix[ifix] = NULL; + fix[ifix] = nullptr; if (trysuffix && lmp->suffix_enable) { if (lmp->suffix) { @@ -879,7 +879,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) strcpy(fix[ifix]->style,estyle.c_str()); } } - if (fix[ifix] == NULL && lmp->suffix2) { + if (fix[ifix] == nullptr && lmp->suffix2) { std::string estyle = arg[2] + std::string("/") + lmp->suffix2; if (fix_map->find(estyle) != fix_map->end()) { FixCreator &fix_creator = (*fix_map)[estyle]; @@ -891,12 +891,12 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) } } - if (fix[ifix] == NULL && fix_map->find(arg[2]) != fix_map->end()) { + if (fix[ifix] == nullptr && fix_map->find(arg[2]) != fix_map->end()) { FixCreator &fix_creator = (*fix_map)[arg[2]]; fix[ifix] = fix_creator(lmp,narg,arg); } - if (fix[ifix] == NULL) + if (fix[ifix] == nullptr) error->all(FLERR,utils::check_packages_for_style("fix",arg[2],lmp)); // check if Fix is in restart_global list @@ -947,7 +947,7 @@ void Modify::add_fix(int narg, char **arg, int trysuffix) void Modify::add_fix(const std::string &fixcmd, int trysuffix) { - std::vector args = utils::split_words(fixcmd); + auto args = utils::split_words(fixcmd); char **newarg = new char*[args.size()]; int i=0; for (const auto &arg : args) { @@ -1105,7 +1105,7 @@ int Modify::check_rigid_group_overlap(int groupbit) for (int ifix = 0; ifix < nfix; ifix++) { if (utils::strmatch(fix[ifix]->style,"^rigid")) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((mask[i] & groupbit) && (body[i] >= 0)) ++n; @@ -1137,7 +1137,7 @@ int Modify::check_rigid_region_overlap(int groupbit, Region *reg) for (int ifix = 0; ifix < nfix; ifix++) { if (strncmp("rigid",fix[ifix]->style,5) == 0) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((mask[i] & groupbit) && (body[i] >= 0) @@ -1167,7 +1167,7 @@ int Modify::check_rigid_list_overlap(int *select) for (int ifix = 0; ifix < nfix; ifix++) { if (utils::strmatch(fix[ifix]->style,"^rigid")) { const int * const body = (const int *)fix[ifix]->extract("body",dim); - if ((body == NULL) || (dim != 1)) break; + if ((body == nullptr) || (dim != 1)) break; for (int i=0; (i < nlocal) && (n == 0); ++i) if ((body[i] >= 0) && select[i]) ++n; @@ -1193,7 +1193,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) for (int icompute = 0; icompute < ncompute; icompute++) if (strcmp(arg[0],compute[icompute]->id) == 0) - error->all(FLERR,"Reuse of compute ID"); + error->all(FLERR,fmt::format("Reuse of compute ID '{}'",arg[0])); // extend Compute list if necessary @@ -1206,7 +1206,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) // create the Compute // try first with suffix appended - compute[ncompute] = NULL; + compute[ncompute] = nullptr; if (trysuffix && lmp->suffix_enable) { if (lmp->suffix) { @@ -1219,7 +1219,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) strcpy(compute[ncompute]->style,estyle.c_str()); } } - if (compute[ncompute] == NULL && lmp->suffix2) { + if (compute[ncompute] == nullptr && lmp->suffix2) { std::string estyle = arg[2] + std::string("/") + lmp->suffix2; if (compute_map->find(estyle) != compute_map->end()) { ComputeCreator &compute_creator = (*compute_map)[estyle]; @@ -1231,13 +1231,13 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) } } - if (compute[ncompute] == NULL && + if (compute[ncompute] == nullptr && compute_map->find(arg[2]) != compute_map->end()) { ComputeCreator &compute_creator = (*compute_map)[arg[2]]; compute[ncompute] = compute_creator(lmp,narg,arg); } - if (compute[ncompute] == NULL) + if (compute[ncompute] == nullptr) error->all(FLERR,utils::check_packages_for_style("compute",arg[2],lmp)); ncompute++; @@ -1249,7 +1249,7 @@ void Modify::add_compute(int narg, char **arg, int trysuffix) void Modify::add_compute(const std::string &computecmd, int trysuffix) { - std::vector args = utils::split_words(computecmd); + auto args = utils::split_words(computecmd); char **newarg = new char*[args.size()]; int i=0; for (const auto &arg : args) { @@ -1428,7 +1428,7 @@ int Modify::read_restart(FILE *fp) // nfix_restart_global = # of restart entries with global state info int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nfix_restart_global,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nfix_restart_global,1,MPI_INT,0,world); // allocate space for each entry @@ -1445,22 +1445,22 @@ int Modify::read_restart(FILE *fp) int n; for (int i = 0; i < nfix_restart_global; i++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); id_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,id_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(id_restart_global[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); style_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,style_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(style_restart_global[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); state_restart_global[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,state_restart_global[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(state_restart_global[i],n,MPI_CHAR,0,world); used_restart_global[i] = 0; @@ -1470,7 +1470,7 @@ int Modify::read_restart(FILE *fp) int maxsize = 0; - if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nfix_restart_peratom,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nfix_restart_peratom,1,MPI_INT,0,world); // allocate space for each entry @@ -1487,19 +1487,19 @@ int Modify::read_restart(FILE *fp) // set index = which set of extra data this fix represents for (int i = 0; i < nfix_restart_peratom; i++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); id_restart_peratom[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,id_restart_peratom[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(id_restart_peratom[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); style_restart_peratom[i] = new char[n]; - if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,style_restart_peratom[i],sizeof(char),n,fp,nullptr,error); MPI_Bcast(style_restart_peratom[i],n,MPI_CHAR,0,world); - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); maxsize += n; @@ -1676,9 +1676,9 @@ void Modify::list_init_compute() return # of bytes of allocated memory from all fixes ------------------------------------------------------------------------- */ -bigint Modify::memory_usage() +double Modify::memory_usage() { - bigint bytes = 0; + double bytes = 0; for (int i = 0; i < nfix; i++) bytes += static_cast (fix[i]->memory_usage()); for (int i = 0; i < ncompute; i++) diff --git a/src/modify.h b/src/modify.h index 05eebc7e14..ee14baf638 100644 --- a/src/modify.h +++ b/src/modify.h @@ -15,11 +15,14 @@ #define LMP_MODIFY_H #include "pointers.h" + #include -#include namespace LAMMPS_NS { + class Compute; + class Fix; + class Modify : protected Pointers { friend class Info; friend class FixSRP; @@ -27,7 +30,6 @@ class Modify : protected Pointers { friend class RespaOMP; public: - int nfix,maxfix; int n_initial_integrate,n_post_integrate,n_pre_exchange; int n_pre_neighbor,n_post_neighbor; int n_pre_force,n_pre_reverse,n_post_force; @@ -41,11 +43,12 @@ class Modify : protected Pointers { int nfix_restart_global; // stored fix global info from restart file int nfix_restart_peratom; // stored fix peratom info from restart file - class Fix **fix; // list of fixes + int nfix,maxfix; + Fix **fix; // list of fixes int *fmask; // bit mask for when each fix is applied - int ncompute,maxcompute; // list of computes - class Compute **compute; + int ncompute,maxcompute; + Compute **compute; // list of computes Modify(class LAMMPS *); virtual ~Modify(); @@ -122,7 +125,7 @@ class Modify : protected Pointers { int read_restart(FILE *); void restart_deallocate(int); - bigint memory_usage(); + double memory_usage(); protected: diff --git a/src/molecule.cpp b/src/molecule.cpp index 9864ca4f4a..f4e1e4c098 100644 --- a/src/molecule.cpp +++ b/src/molecule.cpp @@ -12,21 +12,22 @@ ------------------------------------------------------------------------- */ #include "molecule.h" -#include -#include -#include -#include + #include "atom.h" #include "atom_vec.h" #include "atom_vec_body.h" -#include "force.h" #include "comm.h" #include "domain.h" -#include "math_extra.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "force.h" +#include "math_extra.h" +#include "math_eigen.h" +#include "memory.h" +#include "tokenizer.h" + +#include +#include +#include using namespace LAMMPS_NS; @@ -39,16 +40,16 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : - Pointers(lmp), id(NULL), x(NULL), type(NULL), molecule(NULL), q(NULL), radius(NULL), - rmass(NULL), num_bond(NULL), bond_type(NULL), bond_atom(NULL), - num_angle(NULL), angle_type(NULL), angle_atom1(NULL), angle_atom2(NULL), - angle_atom3(NULL), num_dihedral(NULL), dihedral_type(NULL), dihedral_atom1(NULL), - dihedral_atom2(NULL), dihedral_atom3(NULL), dihedral_atom4(NULL), num_improper(NULL), - improper_type(NULL), improper_atom1(NULL), improper_atom2(NULL), - improper_atom3(NULL), improper_atom4(NULL), nspecial(NULL), special(NULL), - shake_flag(NULL), shake_atom(NULL), shake_type(NULL), avec_body(NULL), ibodyparams(NULL), - dbodyparams(NULL), fragmentmask(NULL), fragmentnames(NULL), - dx(NULL), dxcom(NULL), dxbody(NULL), quat_external(NULL), fp(NULL), count(NULL) + Pointers(lmp), id(nullptr), x(nullptr), type(nullptr), molecule(nullptr), q(nullptr), radius(nullptr), + rmass(nullptr), num_bond(nullptr), bond_type(nullptr), bond_atom(nullptr), + num_angle(nullptr), angle_type(nullptr), angle_atom1(nullptr), angle_atom2(nullptr), + angle_atom3(nullptr), num_dihedral(nullptr), dihedral_type(nullptr), dihedral_atom1(nullptr), + dihedral_atom2(nullptr), dihedral_atom3(nullptr), dihedral_atom4(nullptr), num_improper(nullptr), + improper_type(nullptr), improper_atom1(nullptr), improper_atom2(nullptr), + improper_atom3(nullptr), improper_atom4(nullptr), nspecial(nullptr), special(nullptr), + shake_flag(nullptr), shake_atom(nullptr), shake_type(nullptr), avec_body(nullptr), ibodyparams(nullptr), + dbodyparams(nullptr), fragmentmask(nullptr), + dx(nullptr), dxcom(nullptr), dxbody(nullptr), quat_external(nullptr), fp(nullptr), count(nullptr) { me = comm->me; @@ -78,43 +79,43 @@ Molecule::Molecule(LAMMPS *lmp, int narg, char **arg, int &index) : while (iarg < narg) { if (strcmp(arg[iarg],"offset") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal molecule command"); - toffset = force->inumeric(FLERR,arg[iarg+1]); - boffset = force->inumeric(FLERR,arg[iarg+2]); - aoffset = force->inumeric(FLERR,arg[iarg+3]); - doffset = force->inumeric(FLERR,arg[iarg+4]); - ioffset = force->inumeric(FLERR,arg[iarg+5]); + toffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + boffset = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + aoffset = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + doffset = utils::inumeric(FLERR,arg[iarg+4],false,lmp); + ioffset = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (toffset < 0 || boffset < 0 || aoffset < 0 || doffset < 0 || ioffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 6; } else if (strcmp(arg[iarg],"toff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - toffset = force->inumeric(FLERR,arg[iarg+1]); + toffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (toffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"boff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - boffset = force->inumeric(FLERR,arg[iarg+1]); + boffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (boffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"aoff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - aoffset = force->inumeric(FLERR,arg[iarg+1]); + aoffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (aoffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"doff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - doffset = force->inumeric(FLERR,arg[iarg+1]); + doffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (doffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"ioff") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - ioffset = force->inumeric(FLERR,arg[iarg+1]); + ioffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ioffset < 0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else if (strcmp(arg[iarg],"scale") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal molecule command"); - sizescale = force->numeric(FLERR,arg[iarg+1]); + sizescale = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (sizescale <= 0.0) error->all(FLERR,"Illegal molecule command"); iarg += 2; } else break; @@ -349,7 +350,7 @@ void Molecule::compute_inertia() tensor[0][2] = tensor[2][0] = itensor[4]; tensor[0][1] = tensor[1][0] = itensor[5]; - if (MathExtra::jacobi(tensor,inertia,evectors)) + if (MathEigen::jacobi3(tensor,inertia,evectors)) error->all(FLERR,"Insufficient Jacobi rotations for rigid molecule"); ex[0] = evectors[0][0]; @@ -406,7 +407,7 @@ void Molecule::read(int flag) if (me == 0) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of molecule file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of molecule file"); } // read header lines @@ -424,65 +425,77 @@ void Molecule::read(int flag) if (strspn(line," \t\n\r") == strlen(line)) continue; // search line for header keywords and set corresponding variable + try { + ValueTokenizer values(line); - int nmatch = 0; - int nwant = 0; - if (strstr(line,"atoms")) { - nmatch = sscanf(line,"%d",&natoms); - nwant = 1; - } else if (strstr(line,"bonds")) { - nmatch = sscanf(line,"%d",&nbonds); - nwant = 1; - } else if (strstr(line,"angles")) { - nmatch = sscanf(line,"%d",&nangles); - nwant = 1; - } else if (strstr(line,"dihedrals")) { - nmatch = sscanf(line,"%d",&ndihedrals); - nwant = 1; - } else if (strstr(line,"impropers")) { - nmatch = sscanf(line,"%d",&nimpropers); - nwant = 1; - } else if (strstr(line,"fragments")) { - nmatch = sscanf(line,"%d",&nfragments); - nwant = 1; - } else if (strstr(line,"mass")) { - massflag = 1; - nmatch = sscanf(line,"%lg",&masstotal); - nwant = 1; - masstotal *= sizescale*sizescale*sizescale; - } else if (strstr(line,"com")) { - comflag = 1; - nmatch = sscanf(line,"%lg %lg %lg",&com[0],&com[1],&com[2]); - nwant = 3; - com[0] *= sizescale; - com[1] *= sizescale; - com[2] *= sizescale; - if (domain->dimension == 2 && com[2] != 0.0) - error->all(FLERR,"Molecule file z center-of-mass must be 0.0 for 2d"); - } else if (strstr(line,"inertia")) { - inertiaflag = 1; - nmatch = sscanf(line,"%lg %lg %lg %lg %lg %lg", - &itensor[0],&itensor[1],&itensor[2], - &itensor[3],&itensor[4],&itensor[5]); - nwant = 6; - const double scale5 = sizescale*sizescale*sizescale*sizescale*sizescale; - itensor[0] *= scale5; - itensor[1] *= scale5; - itensor[2] *= scale5; - itensor[3] *= scale5; - itensor[4] *= scale5; - itensor[5] *= scale5; - } else if (strstr(line,"body")) { - bodyflag = 1; - avec_body = (AtomVecBody *) atom->style_match("body"); - if (!avec_body) - error->all(FLERR,"Molecule file requires atom style body"); - nmatch = sscanf(line,"%d %d",&nibody,&ndbody); - nwant = 2; - } else break; + int nmatch = values.count(); + int nwant = 0; + if (values.contains("atoms")) { + natoms = values.next_int(); + nwant = 2; + } else if (values.contains("bonds")) { + nbonds = values.next_int(); + nwant = 2; + } else if (values.contains("angles")) { + nangles = values.next_int(); + nwant = 2; + } else if (values.contains("dihedrals")) { + ndihedrals = values.next_int(); + nwant = 2; + } else if (values.contains("impropers")) { + nimpropers = values.next_int(); + nwant = 2; + } else if (values.contains("fragments")) { + nfragments = values.next_int(); + nwant = 2; + } else if (values.contains("mass")) { + massflag = 1; + masstotal = values.next_double(); + nwant = 2; + masstotal *= sizescale*sizescale*sizescale; + } else if (values.contains("com")) { + comflag = 1; + com[0] = values.next_double(); + com[1] = values.next_double(); + com[2] = values.next_double(); + nwant = 4; + com[0] *= sizescale; + com[1] *= sizescale; + com[2] *= sizescale; + if (domain->dimension == 2 && com[2] != 0.0) + error->all(FLERR,"Molecule file z center-of-mass must be 0.0 for 2d"); + } else if (values.contains("inertia")) { + inertiaflag = 1; + itensor[0] = values.next_double(); + itensor[1] = values.next_double(); + itensor[2] = values.next_double(); + itensor[3] = values.next_double(); + itensor[4] = values.next_double(); + itensor[5] = values.next_double(); + nwant = 7; + const double scale5 = sizescale*sizescale*sizescale*sizescale*sizescale; + itensor[0] *= scale5; + itensor[1] *= scale5; + itensor[2] *= scale5; + itensor[3] *= scale5; + itensor[4] *= scale5; + itensor[5] *= scale5; + } else if (values.contains("body")) { + bodyflag = 1; + avec_body = (AtomVecBody *) atom->style_match("body"); + if (!avec_body) + error->all(FLERR,"Molecule file requires atom style body"); + nibody = values.next_int(); + ndbody = values.next_int(); + nwant = 3; + } else break; - if (nmatch != nwant) - error->all(FLERR,"Invalid header in molecule file"); + if (nmatch != nwant) + error->one(FLERR,"Invalid header in molecule file"); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid header in molecule file\n" + "{}", e.what())); + } } // error checks @@ -499,7 +512,7 @@ void Molecule::read(int flag) // count = vector for tallying bonds,angles,etc per atom if (flag == 0) memory->create(count,natoms,"molecule:count"); - else count = NULL; + else count = nullptr; // grab keyword and skip next line @@ -522,6 +535,8 @@ void Molecule::read(int flag) if (flag) molecules(line); else skip_lines(natoms,line); } else if (strcmp(keyword,"Fragments") == 0) { + if (nfragments == 0) + error->all(FLERR,"Molecule file has fragments but no nfragments setting"); fragmentflag = 1; if (flag) fragments(line); else skip_lines(nfragments,line); @@ -621,6 +636,8 @@ void Molecule::read(int flag) error->all(FLERR,"Molecule file has no Body Integers section"); if (bodyflag && ndbody && dbodyflag == 0) error->all(FLERR,"Molecule file has no Body Doubles section"); + if (nfragments > 0 && !fragmentflag) + error->all(FLERR,"Molecule file has no Fragments section"); } // auto-generate special bonds if needed and not in file @@ -659,15 +676,25 @@ void Molecule::read(int flag) void Molecule::coords(char *line) { - int tmp; - for (int i = 0; i < natoms; i++) { - readline(line); - if (4 != sscanf(line,"%d %lg %lg %lg",&tmp,&x[i][0],&x[i][1],&x[i][2])) - error->all(FLERR,"Invalid Coords section in molecule file"); + try { + for (int i = 0; i < natoms; i++) { + readline(line); - x[i][0] *= sizescale; - x[i][1] *= sizescale; - x[i][2] *= sizescale; + ValueTokenizer values(line); + if (values.count() != 4) error->one(FLERR,"Invalid Coords section in molecule file"); + + values.next_int(); + x[i][0] = values.next_double(); + x[i][1] = values.next_double(); + x[i][2] = values.next_double(); + + x[i][0] *= sizescale; + x[i][1] *= sizescale; + x[i][2] *= sizescale; + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Coords section in molecule file\n" + "{}", e.what())); } if (domain->dimension == 2) { @@ -684,12 +711,20 @@ void Molecule::coords(char *line) void Molecule::types(char *line) { - int tmp; - for (int i = 0; i < natoms; i++) { - readline(line); - if (2 != sscanf(line,"%d %d",&tmp,&type[i])) - error->all(FLERR,"Invalid Types section in molecule file"); - type[i] += toffset; + try { + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + if (values.count() != 2) error->one(FLERR,"Invalid Types section in molecule file"); + + values.next_int(); + type[i] = values.next_int(); + type[i] += toffset; + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Types section in molecule file\n" + "{}", e.what())); } for (int i = 0; i < natoms; i++) @@ -707,12 +742,19 @@ void Molecule::types(char *line) void Molecule::molecules(char *line) { - int tmp; - for (int i = 0; i < natoms; i++) { - readline(line); - if (2 != sscanf(line,"%d %d",&tmp,&molecule[i])) - error->all(FLERR,"Invalid Molecules section in molecule file"); - // molecule[i] += moffset; // placeholder for possible molecule offset + try { + for (int i = 0; i < natoms; i++) { + readline(line); + ValueTokenizer values(line); + if (values.count() != 2) error->one(FLERR,"Invalid Molecules section in molecule file"); + + values.next_int(); + molecule[i] = values.next_int(); + // molecule[i] += moffset; // placeholder for possible molecule offset + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Molecules section in molecule file\n" + "{}", e.what())); } for (int i = 0; i < natoms; i++) @@ -729,27 +771,28 @@ void Molecule::molecules(char *line) void Molecule::fragments(char *line) { - int n,m,atomID,nwords; - char **words = new char*[natoms+1]; + try { + for (int i = 0; i < nfragments; i++) { + readline(line); - for (int i = 0; i < nfragments; i++) { - readline(line); - nwords = parse(line,words,natoms+1); - if (nwords > natoms+1) - error->all(FLERR,"Invalid atom ID in Fragments section of molecule file"); - n = strlen(words[0]) + 1; - fragmentnames[i] = new char[n]; - strcpy(fragmentnames[i],words[0]); + ValueTokenizer values(line); - for (m = 1; m < nwords; m++) { - atomID = atoi(words[m]); - if (atomID <= 0 || atomID > natoms) - error->all(FLERR,"Invalid atom ID in Fragments section of molecule file"); - fragmentmask[i][atomID-1] = 1; + if ((int)values.count() > natoms+1) + error->one(FLERR,"Invalid atom ID in Fragments section of molecule file"); + + fragmentnames[i] = values.next_string(); + + while(values.has_next()) { + int atomID = values.next_int(); + if (atomID <= 0 || atomID > natoms) + error->one(FLERR,"Invalid atom ID in Fragments section of molecule file"); + fragmentmask[i][atomID-1] = 1; + } } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid atom ID in Fragments section of molecule file\n" + "{}", e.what())); } - - delete [] words; } /* ---------------------------------------------------------------------- @@ -758,11 +801,19 @@ void Molecule::fragments(char *line) void Molecule::charges(char *line) { - int tmp; - for (int i = 0; i < natoms; i++) { - readline(line); - if (2 != sscanf(line,"%d %lg",&tmp,&q[i])) - error->all(FLERR,"Invalid Charges section in molecule file"); + try { + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + if ((int)values.count() != 2) error->one(FLERR,"Invalid Charges section in molecule file"); + + values.next_int(); + q[i] = values.next_double(); + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Charges section in molecule file\n" + "{}", e.what())); } } @@ -772,15 +823,23 @@ void Molecule::charges(char *line) void Molecule::diameters(char *line) { - int tmp; - maxradius = 0.0; - for (int i = 0; i < natoms; i++) { - readline(line); - if (2 != sscanf(line,"%d %lg",&tmp,&radius[i])) - error->all(FLERR,"Invalid Diameters section in molecule file"); - radius[i] *= sizescale; - radius[i] *= 0.5; - maxradius = MAX(maxradius,radius[i]); + try { + maxradius = 0.0; + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + if (values.count() != 2) error->one(FLERR,"Invalid Diameters section in molecule file"); + + values.next_int(); + radius[i] = values.next_double(); + radius[i] *= sizescale; + radius[i] *= 0.5; + maxradius = MAX(maxradius,radius[i]); + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Diameters section in molecule file\n" + "{}", e.what())); } for (int i = 0; i < natoms; i++) @@ -794,12 +853,20 @@ void Molecule::diameters(char *line) void Molecule::masses(char *line) { - int tmp; - for (int i = 0; i < natoms; i++) { - readline(line); - if (2 != sscanf(line,"%d %lg",&tmp,&rmass[i])) - error->all(FLERR,"Invalid Masses section in molecule file"); - rmass[i] *= sizescale*sizescale*sizescale; + try { + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + if (values.count() != 2) error->one(FLERR,"Invalid Masses section in molecule file"); + + values.next_int(); + rmass[i] = values.next_double(); + rmass[i] *= sizescale*sizescale*sizescale; + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Masses section in molecule file\n" + "{}", e.what())); } for (int i = 0; i < natoms; i++) @@ -816,7 +883,7 @@ void Molecule::masses(char *line) void Molecule::bonds(int flag, char *line) { - int tmp,itype; + int itype; tagint m,atom1,atom2; int newton_bond = force->newton_bond; @@ -827,9 +894,19 @@ void Molecule::bonds(int flag, char *line) for (int i = 0; i < nbonds; i++) { readline(line); - if (4 != sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT, - &tmp,&itype,&atom1,&atom2)) - error->all(FLERR,"Invalid Bonds section in molecule file"); + + try { + ValueTokenizer values(line); + if (values.count() != 4) error->one(FLERR,"Invalid Bonds section in molecule file"); + values.next_int(); + itype = values.next_int(); + atom1 = values.next_tagint(); + atom2 = values.next_tagint(); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Bonds section in molecule file\n" + "{}", e.what())); + } + itype += boffset; if ((atom1 <= 0) || (atom1 > natoms) || @@ -874,7 +951,7 @@ void Molecule::bonds(int flag, char *line) void Molecule::angles(int flag, char *line) { - int tmp,itype; + int itype; tagint m,atom1,atom2,atom3; int newton_bond = force->newton_bond; @@ -885,9 +962,20 @@ void Molecule::angles(int flag, char *line) for (int i = 0; i < nangles; i++) { readline(line); - if (5 != sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " TAGINT_FORMAT, - &tmp,&itype,&atom1,&atom2,&atom3)) - error->all(FLERR,"Invalid Angles section in molecule file"); + + try { + ValueTokenizer values(line); + if (values.count() != 5) error->one(FLERR,"Invalid Angles section in molecule file"); + values.next_int(); + itype = values.next_int(); + atom1 = values.next_tagint(); + atom2 = values.next_tagint(); + atom3 = values.next_tagint(); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Angles section in molecule file\n" + "{}", e.what())); + } + itype += aoffset; if ((atom1 <= 0) || (atom1 > natoms) || @@ -947,7 +1035,7 @@ void Molecule::angles(int flag, char *line) void Molecule::dihedrals(int flag, char *line) { - int tmp,itype; + int itype; tagint m,atom1,atom2,atom3,atom4; int newton_bond = force->newton_bond; @@ -958,10 +1046,21 @@ void Molecule::dihedrals(int flag, char *line) for (int i = 0; i < ndihedrals; i++) { readline(line); - if (6 != sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT " ", - &tmp,&itype,&atom1,&atom2,&atom3,&atom4)) - error->all(FLERR,"Invalid Dihedrals section in molecule file"); + + try { + ValueTokenizer values(line); + if (values.count() != 6) error->one(FLERR,"Invalid Dihedrals section in molecule file"); + values.next_int(); + itype = values.next_int(); + atom1 = values.next_tagint(); + atom2 = values.next_tagint(); + atom3 = values.next_tagint(); + atom4 = values.next_tagint(); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Dihedrals section in molecule file\n" + "{}", e.what())); + } + itype += doffset; if ((atom1 <= 0) || (atom1 > natoms) || @@ -1036,7 +1135,7 @@ void Molecule::dihedrals(int flag, char *line) void Molecule::impropers(int flag, char *line) { - int tmp,itype; + int itype; tagint m,atom1,atom2,atom3,atom4; int newton_bond = force->newton_bond; @@ -1047,10 +1146,21 @@ void Molecule::impropers(int flag, char *line) for (int i = 0; i < nimpropers; i++) { readline(line); - if (6 != sscanf(line,"%d %d " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT " ", - &tmp,&itype,&atom1,&atom2,&atom3,&atom4)) - error->all(FLERR,"Invalid Impropers section in molecule file"); + + try { + ValueTokenizer values(line); + if (values.count() != 6) error->one(FLERR,"Invalid Impropers section in molecule file"); + values.next_int(); + itype = values.next_int(); + atom1 = values.next_tagint(); + atom2 = values.next_tagint(); + atom3 = values.next_tagint(); + atom4 = values.next_tagint(); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Impropers section in molecule file\n" + "{}", e.what())); + } + itype += ioffset; if ((atom1 <= 0) || (atom1 > natoms) || @@ -1124,15 +1234,24 @@ void Molecule::impropers(int flag, char *line) void Molecule::nspecial_read(int flag, char *line) { - int tmp,c1,c2,c3; - if (flag == 0) maxspecial = 0; for (int i = 0; i < natoms; i++) { readline(line); - if (4 != sscanf(line,"%d %d %d %d",&tmp,&c1,&c2,&c3)) - error->all(FLERR,"Invalid Special Bond Counts section in " - "molecule file"); + + int c1, c2, c3; + + try { + ValueTokenizer values(line); + if (values.count() != 4) error->one(FLERR,"Invalid Special Bond Counts section in molecule file"); + values.next_int(); + c1 = values.next_tagint(); + c2 = values.next_tagint(); + c3 = values.next_tagint(); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Special Bond Counts section in molecule file\n" + "{}", e.what())); + } if (flag) { nspecial[i][0] = c1; @@ -1148,25 +1267,30 @@ void Molecule::nspecial_read(int flag, char *line) void Molecule::special_read(char *line) { - int m,nwords; - char **words = new char*[maxspecial+1]; + try { + for (int i = 0; i < natoms; i++) { + readline(line); - for (int i = 0; i < natoms; i++) { - readline(line); - nwords = parse(line,words,maxspecial+1); - if (nwords != nspecial[i][2]+1) - error->all(FLERR,"Molecule file special list " - "does not match special count"); + ValueTokenizer values(line); + int nwords = values.count(); - for (m = 1; m < nwords; m++) { - special[i][m-1] = ATOTAGINT(words[m]); - if (special[i][m-1] <= 0 || special[i][m-1] > natoms || - special[i][m-1] == i+1) - error->all(FLERR,"Invalid special atom index in molecule file"); + if (nwords != nspecial[i][2]+1) + error->one(FLERR,"Molecule file special list " + "does not match special count"); + + values.next_int(); // ignore + + for (int m = 1; m < nwords; m++) { + special[i][m-1] = values.next_tagint(); + if (special[i][m-1] <= 0 || special[i][m-1] > natoms || + special[i][m-1] == i+1) + error->one(FLERR,"Invalid special atom index in molecule file"); + } } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Molecule file special list\n" + "{}", e.what())); } - - delete [] words; } /* ---------------------------------------------------------------------- @@ -1283,16 +1407,26 @@ void Molecule::special_generate() void Molecule::shakeflag_read(char *line) { - int tmp; - for (int i = 0; i < natoms; i++) { - readline(line); - if (2 != sscanf(line,"%d %d",&tmp,&shake_flag[i])) - error->all(FLERR,"Invalid Shake Flags section in molecule file"); + try { + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + + if (values.count() != 2) + error->one(FLERR,"Invalid Shake Flags section in molecule file"); + + values.next_int(); + shake_flag[i] = values.next_int(); + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid Shake Flags section in molecule file\n" + "{}", e.what())); } for (int i = 0; i < natoms; i++) if (shake_flag[i] < 0 || shake_flag[i] > 4) - error->all(FLERR,"Invalid shake flag in molecule file"); + error->one(FLERR,"Invalid shake flag in molecule file"); } /* ---------------------------------------------------------------------- @@ -1301,32 +1435,58 @@ void Molecule::shakeflag_read(char *line) void Molecule::shakeatom_read(char *line) { - int tmp, nmatch=0, nwant=0; - for (int i = 0; i < natoms; i++) { - readline(line); - if (shake_flag[i] == 1) { - nmatch = sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT - " " TAGINT_FORMAT,&tmp,&shake_atom[i][0], - &shake_atom[i][1],&shake_atom[i][2]); - nwant = 4; - } else if (shake_flag[i] == 2) { - nmatch = sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT, - &tmp,&shake_atom[i][0],&shake_atom[i][1]); - nwant = 3; - } else if (shake_flag[i] == 3) { - nmatch = sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT - " " TAGINT_FORMAT,&tmp,&shake_atom[i][0], - &shake_atom[i][1],&shake_atom[i][2]); - nwant = 4; - } else if (shake_flag[i] == 4) { - nmatch = sscanf(line,"%d " TAGINT_FORMAT " " TAGINT_FORMAT " " - TAGINT_FORMAT " " TAGINT_FORMAT, - &tmp,&shake_atom[i][0],&shake_atom[i][1], - &shake_atom[i][2],&shake_atom[i][3]); - nwant = 5; + int nmatch=0, nwant=0; + try { + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + nmatch = values.count(); + + switch (shake_flag[i]) { + case 1: + values.next_int(); + shake_atom[i][0] = values.next_tagint(); + shake_atom[i][1] = values.next_tagint(); + shake_atom[i][2] = values.next_tagint(); + nwant = 4; + break; + + case 2: + values.next_int(); + shake_atom[i][0] = values.next_tagint(); + shake_atom[i][1] = values.next_tagint(); + nwant = 3; + break; + + case 3: + values.next_int(); + shake_atom[i][0] = values.next_tagint(); + shake_atom[i][1] = values.next_tagint(); + shake_atom[i][2] = values.next_tagint(); + nwant = 4; + break; + + case 4: + values.next_int(); + shake_atom[i][0] = values.next_tagint(); + shake_atom[i][1] = values.next_tagint(); + shake_atom[i][2] = values.next_tagint(); + shake_atom[i][3] = values.next_tagint(); + nwant = 5; + break; + + default: + error->one(FLERR,"Invalid shake atom in molecule file"); + } + + if (nmatch != nwant) + error->one(FLERR,"Invalid shake atom in molecule file"); } - if (nmatch != nwant) - error->all(FLERR,"Invalid shake atom in molecule file"); + + } catch (TokenizerException &e) { + error->one(FLERR,fmt::format("Invalid shake atom in molecule file\n" + "{}", e.what())); } for (int i = 0; i < natoms; i++) { @@ -1334,7 +1494,7 @@ void Molecule::shakeatom_read(char *line) if (m == 1) m = 3; for (int j = 0; j < m; j++) if (shake_atom[i][j] <= 0 || shake_atom[i][j] > natoms) - error->all(FLERR,"Invalid shake atom in molecule file"); + error->one(FLERR,"Invalid shake atom in molecule file"); } } @@ -1344,27 +1504,54 @@ void Molecule::shakeatom_read(char *line) void Molecule::shaketype_read(char *line) { - int tmp, nmatch=0, nwant=0; - for (int i = 0; i < natoms; i++) { - readline(line); - if (shake_flag[i] == 1) { - nmatch = sscanf(line,"%d %d %d %d",&tmp,&shake_type[i][0], - &shake_type[i][1],&shake_type[i][2]); - nwant = 4; - } else if (shake_flag[i] == 2) { - nmatch = sscanf(line,"%d %d",&tmp,&shake_type[i][0]); - nwant = 2; - } else if (shake_flag[i] == 3) { - nmatch = sscanf(line,"%d %d %d",&tmp,&shake_type[i][0], - &shake_type[i][1]); - nwant = 3; - } else if (shake_flag[i] == 4) { - nmatch = sscanf(line,"%d %d %d %d",&tmp,&shake_type[i][0], - &shake_type[i][1],&shake_type[i][2]); - nwant = 4; + try { + int nmatch=0, nwant=0; + for (int i = 0; i < natoms; i++) { + readline(line); + + ValueTokenizer values(line); + nmatch = values.count(); + + switch (shake_flag[i]) { + case 1: + values.next_int(); + shake_type[i][0] = values.next_int(); + shake_type[i][1] = values.next_int(); + shake_type[i][2] = values.next_int(); + nwant = 4; + break; + + case 2: + values.next_int(); + shake_type[i][0] = values.next_int(); + nwant = 2; + break; + + case 3: + values.next_int(); + shake_type[i][0] = values.next_int(); + shake_type[i][1] = values.next_int(); + nwant = 3; + break; + + case 4: + values.next_int(); + shake_type[i][0] = values.next_int(); + shake_type[i][1] = values.next_int(); + shake_type[i][2] = values.next_int(); + nwant = 4; + break; + + default: + error->one(FLERR,"Invalid shake type data in molecule file"); + } + + if (nmatch != nwant) + error->one(FLERR,"Invalid shake type data in molecule file"); } - if (nmatch != nwant) - error->all(FLERR,"Invalid shake type data in molecule file"); + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid shake type data in molecule file\n", + "{}", e.what())); } for (int i = 0; i < natoms; i++) { @@ -1372,10 +1559,10 @@ void Molecule::shaketype_read(char *line) if (m == 1) m = 3; for (int j = 0; j < m-1; j++) if (shake_type[i][j] <= 0) - error->all(FLERR,"Invalid shake bond type in molecule file"); + error->one(FLERR,"Invalid shake bond type in molecule file"); if (shake_flag[i] == 1) if (shake_type[i][2] <= 0) - error->all(FLERR,"Invalid shake angle type in molecule file"); + error->one(FLERR,"Invalid shake angle type in molecule file"); } } @@ -1386,34 +1573,38 @@ void Molecule::shaketype_read(char *line) void Molecule::body(int flag, int pflag, char *line) { - int i,ncount; - int nparam = nibody; if (pflag) nparam = ndbody; int nword = 0; - while (nword < nparam) { - readline(line); - ncount = utils::trim_and_count_words(line); - if (ncount == 0) - error->one(FLERR,"Too few values in body section of molecule file"); - if (nword+ncount > nparam) - error->all(FLERR,"Too many values in body section of molecule file"); + try { + while (nword < nparam) { + readline(line); - if (flag) { - if (pflag == 0) { - ibodyparams[nword++] = force->inumeric(FLERR,strtok(line," \t\n\r\f")); - for (i = 1; i < ncount; i++) - ibodyparams[nword++] = - force->inumeric(FLERR,strtok(NULL," \t\n\r\f")); - } else { - dbodyparams[nword++] = force->numeric(FLERR,strtok(line," \t\n\r\f")); - for (i = 1; i < ncount; i++) - dbodyparams[nword++] = - force->numeric(FLERR,strtok(NULL," \t\n\r\f")); - } - } else nword += ncount; + ValueTokenizer values(line); + int ncount = values.count(); + + if (ncount == 0) + error->one(FLERR,"Too few values in body section of molecule file"); + if (nword+ncount > nparam) + error->one(FLERR,"Too many values in body section of molecule file"); + + if (flag) { + if (pflag == 0) { + while(values.has_next()) { + ibodyparams[nword++] = values.next_int(); + } + } else { + while(values.has_next()) { + dbodyparams[nword++] = values.next_double(); + } + } + } else nword += ncount; + } + } catch (TokenizerException &e) { + error->one(FLERR, fmt::format("Invalid body params in molecule file\n", + "{}", e.what())); } } @@ -1424,7 +1615,7 @@ void Molecule::body(int flag, int pflag, char *line) int Molecule::findfragment(const char *name) { for (int i = 0; i < nfragments; i++) - if (fragmentnames[i] && strcmp(name,fragmentnames[i]) == 0) return i; + if (fragmentnames[i] == name) return i; return -1; } @@ -1469,7 +1660,7 @@ void Molecule::check_attributes(int flag) // for molecular atom styles, check bond_per_atom,etc + maxspecial // do not check for atom style template, since nothing stored per atom - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow && atom->bond_per_atom < onemol->bond_per_atom) mismatch = 1; if (atom->avec->angles_allow && @@ -1504,6 +1695,7 @@ void Molecule::initialize() nmolecules = 1; nbondtypes = nangletypes = ndihedraltypes = nimpropertypes = 0; nibody = ndbody = 0; + nfragments = 0; bond_per_atom = angle_per_atom = dihedral_per_atom = improper_per_atom = 0; maxspecial = 0; @@ -1517,41 +1709,41 @@ void Molecule::initialize() centerflag = massflag = comflag = inertiaflag = 0; tag_require = 0; - x = NULL; - type = NULL; - q = NULL; - radius = NULL; - rmass = NULL; + x = nullptr; + type = nullptr; + q = nullptr; + radius = nullptr; + rmass = nullptr; - num_bond = NULL; - bond_type = NULL; - bond_atom = NULL; + num_bond = nullptr; + bond_type = nullptr; + bond_atom = nullptr; - num_angle = NULL; - angle_type = NULL; - angle_atom1 = angle_atom2 = angle_atom3 = NULL; + num_angle = nullptr; + angle_type = nullptr; + angle_atom1 = angle_atom2 = angle_atom3 = nullptr; - num_dihedral = NULL; - dihedral_type = NULL; - dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = NULL; + num_dihedral = nullptr; + dihedral_type = nullptr; + dihedral_atom1 = dihedral_atom2 = dihedral_atom3 = dihedral_atom4 = nullptr; - num_improper = NULL; - improper_type = NULL; - improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = NULL; + num_improper = nullptr; + improper_type = nullptr; + improper_atom1 = improper_atom2 = improper_atom3 = improper_atom4 = nullptr; - nspecial = NULL; - special = NULL; + nspecial = nullptr; + special = nullptr; - shake_flag = NULL; - shake_atom = NULL; - shake_type = NULL; + shake_flag = nullptr; + shake_atom = nullptr; + shake_type = nullptr; - ibodyparams = NULL; - dbodyparams = NULL; + ibodyparams = nullptr; + dbodyparams = nullptr; - dx = NULL; - dxcom = NULL; - dxbody = NULL; + dx = nullptr; + dxcom = nullptr; + dxbody = nullptr; } /* ---------------------------------------------------------------------- @@ -1565,7 +1757,7 @@ void Molecule::allocate() if (typeflag) memory->create(type,natoms,"molecule:type"); if (moleculeflag) memory->create(molecule,natoms,"molecule:molecule"); if (fragmentflag) { - fragmentnames = new char*[nfragments]; + fragmentnames.resize(nfragments); memory->create(fragmentmask,nfragments,natoms,"molecule:fragmentmask"); for (int i = 0; i < nfragments; i++) for (int j = 0; j < natoms; j++) fragmentmask[i][j] = 0; @@ -1664,9 +1856,9 @@ void Molecule::deallocate() memory->destroy(molecule); memory->destroy(fragmentmask); + if (fragmentflag) { - for (int i = 0; i < nfragments; i++) delete [] fragmentnames[i]; - delete [] fragmentnames; + fragmentnames.clear(); } memory->destroy(num_bond); @@ -1715,7 +1907,7 @@ void Molecule::deallocate() void Molecule::open(char *file) { fp = fopen(file,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open molecule file {}: {}", file, utils::getsyserror())); } @@ -1728,7 +1920,7 @@ void Molecule::readline(char *line) { int n; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -1751,11 +1943,11 @@ void Molecule::parse_keyword(int flag, char *line, char *keyword) int eof = 0; if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; while (eof == 0 && strspn(line," \t\n\r") == strlen(line)) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } - if (fgets(keyword,MAXLINE,fp) == NULL) eof = 1; + if (fgets(keyword,MAXLINE,fp) == nullptr) eof = 1; } // if eof, set keyword empty and return @@ -1793,27 +1985,6 @@ void Molecule::skip_lines(int n, char *line) for (int i = 0; i < n; i++) readline(line); } -/* ---------------------------------------------------------------------- - parse line into words separated by whitespace - return # of words - max = max pointers storable in words -------------------------------------------------------------------------- */ - -int Molecule::parse(char *line, char **words, int max) -{ - char *ptr; - - int nwords = 0; - words[nwords++] = strtok(line," \t\n\r\f"); - - while ((ptr = strtok(NULL," \t\n\r\f"))) { - if (nwords < max) words[nwords] = ptr; - nwords++; - } - - return nwords; -} - /* ---------------------------------------------------------------------- proc 0 prints molecule params ------------------------------------------------------------------------- */ diff --git a/src/molecule.h b/src/molecule.h index 49d0cd1ef0..3316cd3f1f 100644 --- a/src/molecule.h +++ b/src/molecule.h @@ -16,6 +16,8 @@ #include "pointers.h" +#include + namespace LAMMPS_NS { class Molecule : protected Pointers { @@ -94,7 +96,7 @@ class Molecule : protected Pointers { // fragment info int **fragmentmask; // nfragments by natoms - char **fragmentnames; + std::vector fragmentnames; double center[3]; // geometric center of molecule double masstotal; // total mass of molecule @@ -163,7 +165,6 @@ class Molecule : protected Pointers { void readline(char *); void parse_keyword(int, char *, char *); void skip_lines(int, char *); - int parse(char *, char **, int); // void print(); }; @@ -240,6 +241,10 @@ E: Molecule file has impropers but no nimpropers setting Self-explanatory. +E: Molecule file has fragments but no nfragments setting + +Self-explanatory. + E: Molecule file shake flags not before shake atoms The order of the two sections is important. @@ -276,6 +281,10 @@ E: Molecule file has no Body Doubles section Self-explanatory. +E: Molecule file has no Fragments section + +Self-explanatory. + E: Cannot auto-generate special bonds before simulation box is defined UNDOCUMENTED diff --git a/src/my_page.cpp b/src/my_page.cpp new file mode 100644 index 0000000000..2416c7e76b --- /dev/null +++ b/src/my_page.cpp @@ -0,0 +1,193 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. +------------------------------------------------------------------------- */ + +#include "my_page.h" + +#include + +#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32) +#define LAMMPS_MEMALIGN 64 +#endif + +using namespace LAMMPS_NS; + +/** \class LAMMPS_NS::MyPage + * \brief Templated class for storing chunks of datums in pages. + * + * The size of the chunk may vary from call to call, but must be + * less or equal than the *maxchunk* setting. + * The chunks are not returnable like with malloc() (i.e. you cannot + * call free() on them individually). One can only reset and start over. + * The purpose of this class is to replace many small memory allocations + * via malloc() with a few large ones. Since the pages are never freed + * until the class is re-initialized, they can be re-used without having + * to re-allocate them by calling the reset() method. + * + * The settings *maxchunk*, *pagesize*, and *pagedelta* control + * the memory allocation strategy. The *maxchunk* value represents + * the expected largest number of items per chunk. If there is + * less space left on the current page, a new page is allocated + * for the next chunk. The *pagesize* value represents how many + * items can fit on a single page. It should have space for multiple + * chunks of size *maxchunk*. The combination of these two + * parameters determines how much memory is wasted by either switching + * to the next page too soon or allocating too large pages that never + * get properly used. It is an error, if a requested chunk is larger + * than *maxchunk*. The *pagedelta* parameter determines how many + * pages are allocated in one go. In combination with the *pagesize* + * setting, this determines how often blocks of memory get allocated + * (fewer allocations will result in faster execution). + * + * \note + * This is a template class with explicit instantiation. If the class + * is used with a new data type a new explicit instantiation may need to + * be added at the end of the file ``src/my_page.cpp`` to avoid symbol + * lookup errors. */ + +/** Create a class instance + * + * Need to call init() before use to define allocation settings */ + +template +MyPage::MyPage() : ndatum(0), nchunk(0), pages(nullptr), page(nullptr), + npage(0), ipage(-1), index(-1), maxchunk(-1), + pagesize(-1), pagedelta(1), errorflag(0) {}; + +template +MyPage::~MyPage() { + deallocate(); +} + +/** (Re-)initialize the set of pages and allocation parameters. + * + * This also frees all previously allocated storage and allocates + * the first page(s). + * + * \param user_maxchunk Expected maximum number of items for one chunk + * \param user_pagesize Number of items on a single memory page + * \param user_pagedelta Number of pages to allocate with one malloc + * \return 1 if there were invalid parameters, 2 if there was an allocation error or 0 if successful */ + +template +int MyPage::init(int user_maxchunk, int user_pagesize, + int user_pagedelta) { + maxchunk = user_maxchunk; + pagesize = user_pagesize; + pagedelta = user_pagedelta; + + if (maxchunk <= 0 || pagesize <= 0 || pagedelta <= 0) return 1; + if (maxchunk > pagesize) return 1; + + // free storage if re-initialized + + deallocate(); + + // initial page allocation + + allocate(); + if (errorflag) return 2; + reset(); + return 0; + } + +/** Pointer to location that can store N items. + * + * This will allocate more pages as needed. + * If the parameter *N* is larger than the *maxchunk* + * setting an error is flagged. + * + * \param n number of items for which storage is requested + * \return memory location or null pointer, if error or allocation failed */ + +template +T *MyPage::get(int n) { + if (n > maxchunk) { + errorflag = 1; + return nullptr; + } + ndatum += n; + nchunk++; + + // return pointer from current page + if (index+n <= pagesize) { + int start = index; + index += n; + return &page[start]; + } + + // allocate new page + ipage++; + if (ipage == npage) { + allocate(); + if (errorflag) return nullptr; + } + page = pages[ipage]; + index = n; + return &page[0]; +} + + +/** Reset state of memory pool without freeing any memory */ + +template +void MyPage::reset() { + ndatum = nchunk = 0; + index = ipage = 0; + page = (pages != nullptr) ? pages[ipage] : nullptr; + errorflag = 0; +} + +/* ---------------------------------------------------------------------- */ + +template +void MyPage::allocate() { + npage += pagedelta; + pages = (T **) realloc(pages,npage*sizeof(T *)); + if (!pages) { + errorflag = 2; + return; + } + + for (int i = npage-pagedelta; i < npage; i++) { +#if defined(LAMMPS_MEMALIGN) + void *ptr; + if (posix_memalign(&ptr, LAMMPS_MEMALIGN, pagesize*sizeof(T))) + errorflag = 2; + pages[i] = (T *) ptr; +#else + pages[i] = (T *) malloc(pagesize*sizeof(T)); + if (!pages[i]) errorflag = 2; +#endif + } +} + +/** Free all allocated pages of this class instance */ + +template +void MyPage::deallocate() { + reset(); + for (int i = 0; i < npage; i++) free(pages[i]); + free(pages); + pages = nullptr; + npage = 0; +} + +// explicit instantiations + +namespace LAMMPS_NS { + template class MyPage; + template class MyPage; + template class MyPage; + template class MyPage; + template class MyPage; +} diff --git a/src/my_page.h b/src/my_page.h index 01542a9174..0e4375ed7f 100644 --- a/src/my_page.h +++ b/src/my_page.h @@ -12,160 +12,62 @@ ------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------- -MyPage = templated class for storing chunks of datums in pages - chunks are not returnable, can only reset and start over - replaces many small mallocs with a few large mallocs - pages are never freed, so can reuse w/out reallocs -usage: - request one datum at a time, repeat, clear - request chunks of datums in each get() or vget(), repeat, clear - chunk size can vary from request to request - chunk size can be known in advance or registered after usage via vgot() -inputs: - template T = one datum, e.g. int, double, struct, int[3] - for int[3], access datum as ivec[i][2] -methods: - T *get() = return ptr to one datum - T *get(N) = return ptr to N datums, N < maxchunk required - T *vget() = return ptr to maxchunk datums, use as needed, then call vgot() - all gets return NULL if error encountered - vgot(N) = used N datums of previous vget(), N < maxchunk required - void init(maxchunk, pagesize, pagedelta) - define allocation params and allocate first page(s) - call right after constructor - can call again to reset allocation params and free previous pages - maxchunk = max # of datums in one chunk, default = 1 - pagesize = # of datums in one page, default = 1024 - should be big enough to store multiple chunks - pagedelta = # of pages to allocate at a time, default = 1 - return 1 if bad params - void reset() = clear pages w/out freeing - int size() = return total size of allocated pages in bytes - int status() = return error status - 0 = ok, 1 = chunksize > maxchunk, 2 = allocation error + templated class for storing chunks of datums in pages ------------------------------------------------------------------------- */ #ifndef LAMMPS_MY_PAGE_H #define LAMMPS_MY_PAGE_H -#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32) -#define LAMMPS_MEMALIGN 64 -#endif +#include "lmptype.h" -#include namespace LAMMPS_NS { +struct HyperOneCoeff { + double biascoeff; + tagint tag; +}; + template class MyPage { public: int ndatum; // total # of stored datums int nchunk; // total # of stored chunks + MyPage(); + virtual ~MyPage(); - MyPage() { - ndatum = nchunk = 0; - pages = NULL; - npage = 0; - errorflag = 0; - } + int init(int user_maxchunk=1, int user_pagesize=1024, + int user_pagedelta=1); - // (re)initialize allocation params - // also allocate first page(s) + T *get(int n=1); - int init(int user_maxchunk = 1, int user_pagesize = 1024, - int user_pagedelta = 1) { - maxchunk = user_maxchunk; - pagesize = user_pagesize; - pagedelta = user_pagedelta; - - if (maxchunk <= 0 || pagesize <= 0 || pagedelta <= 0) return 1; - if (maxchunk > pagesize) return 1; - - // free any previously allocated pages - - for (int i = 0; i < npage; i++) free(pages[i]); - free(pages); - - // initial page allocation - - ndatum = nchunk = 0; - pages = NULL; - npage = 0; - allocate(); - if (errorflag) return 2; - ipage = index = 0; - page = pages[ipage]; - return 0; - } - - // free all allocated pages - - ~MyPage() { - for (int i = 0; i < npage; i++) free(pages[i]); - free(pages); - } - - // get ptr to one datum - // return NULL if run out of memory - - T *get() { - ndatum++; - nchunk++; - if (index < pagesize) return &page[index++]; - ipage++; - if (ipage == npage) { - allocate(); - if (errorflag) return NULL; - } - page = pages[ipage]; - index = 0; - return &page[index++]; - } - - // get ptr to location that can store N datums - // error if N > maxchunk - // return NULL if run out of memory - - T *get(int n) { - if (n > maxchunk) { - errorflag = 1; - return NULL; - } - ndatum += n; - nchunk++; - if (index+n <= pagesize) { - int start = index; - index += n; - return &page[start]; - } - ipage++; - if (ipage == npage) { - allocate(); - if (errorflag) return NULL; - } - page = pages[ipage]; - index = n; - return &page[0]; - } - - // get ptr to location that can store maxchunk datums - // will return same ptr as previous call if vgot() not called - // return NULL if run out of memory + /** Get pointer to location that can store *maxchunk* items. + * + * This will return the same pointer as the previous call to + * this function unless vgot() is called afterwards to record + * how many items of the chunk were actually used. + * + * \return pointer to chunk of memory or null pointer if run out of memory */ T *vget() { if (index+maxchunk <= pagesize) return &page[index]; ipage++; if (ipage == npage) { allocate(); - if (errorflag) return NULL; + if (errorflag) return nullptr; } page = pages[ipage]; index = 0; return &page[index]; } - // increment by N = # of values stored in loc returned by vget() - // OK to not call if vget() ptr was not used - // error if N > maxchunk + /** Mark *N* items as used of the chunk reserved with a preceding call to vget(). + * + * This will advance the internal pointer inside the current memory page. + * It is not necessary to call this function for *N* = 0, that is the reserved + * storage was not used. A following call to vget() will then reserve the + * same location again. It is an error if *N* > *maxchunk*. + * + * \param n Number of items used in previously reserved chunk */ void vgot(int n) { if (n > maxchunk) errorflag = 1; @@ -174,25 +76,21 @@ class MyPage { index += n; } - // clear all pages, without freeing any memory + void reset(); - void reset() { - ndatum = nchunk = 0; - index = ipage = 0; - page = pages[ipage]; + /** Return total size of allocated pages + * + * \return total storage used in bytes */ + + double size() const { + return (double)npage*pagesize*sizeof(T); } - // return total size of allocated pages + /** Return error status + * + * \return 0 if no error, 1 requested chunk size > maxchunk, 2 if malloc failed */ - int size() const { - return npage*pagesize*sizeof(T); - } - - // return error status - - int status() const { - return errorflag; - } + int status() const { return errorflag; } private: T **pages; // list of allocated pages @@ -208,27 +106,8 @@ class MyPage { int errorflag; // flag > 0 if error has occurred // 1 = chunk size exceeded maxchunk // 2 = memory allocation error - - void allocate() { - npage += pagedelta; - pages = (T **) realloc(pages,npage*sizeof(T *)); - if (!pages) { - errorflag = 2; - return; - } - - for (int i = npage-pagedelta; i < npage; i++) { -#if defined(LAMMPS_MEMALIGN) - void *ptr; - if (posix_memalign(&ptr, LAMMPS_MEMALIGN, pagesize*sizeof(T))) - errorflag = 2; - pages[i] = (T *) ptr; -#else - pages[i] = (T *) malloc(pagesize*sizeof(T)); - if (!pages[i]) errorflag = 2; -#endif - } - } + void allocate(); + void deallocate(); }; } diff --git a/src/my_pool_chunk.cpp b/src/my_pool_chunk.cpp new file mode 100644 index 0000000000..a8364f8d89 --- /dev/null +++ b/src/my_pool_chunk.cpp @@ -0,0 +1,228 @@ +/* -*- c++ -*- ---------------------------------------------------------- + LAMMPS - Large-scale Atomic/Molecular Massively Parallel Simulator + http://lammps.sandia.gov, Sandia National Laboratories + Steve Plimpton, sjplimp@sandia.gov + + Copyright (2003) Sandia Corporation. Under the terms of Contract + DE-AC04-94AL85000 with Sandia Corporation, the U.S. Government retains + certain rights in this software. This software is distributed under + the GNU General Public License. + + See the README file in the top-level LAMMPS directory. + ------------------------------------------------------------------------- */ + +#include "my_pool_chunk.h" + +#include +#include + +#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32) +#define LAMMPS_MEMALIGN 64 +#endif + +using namespace LAMMPS_NS; + +/** \class LAMMPS_NS::MyPoolChunk + * \brief Templated class for storing chunks of datums in pages + * + * The size of the chunk may vary from call to call between the + * *minchunk* and *maxchunk* setting. Chunks may be returned + * to the pool for re-use. Chunks can be reserved in *nbin* + * different sizes between *minchunk* and *maxchunk*. + * The *chunksperpage* setting specifies how many chunks are stored + * on any page and the *pagedelta* setting determines how many + * pages are allocated in one go. Pages are never freed, so they + * can be re-used without re-allocation. + * + * \note + * This is a template class with explicit instantiation. If the class + * is used with a new data type a new explicit instantiation may need + * to be added at the end of the file ``src/my_pool_chunk.cpp`` to + * avoid symbol lookup errors. */ + +/** Create a class instance and set memory pool parameters + * + * \param user_minchunk Minimal chunk size + * \param user_maxchunk Maximal chunk size + * \param user_nbin Number of bins of different chunk sizes + * \param user_chunkperpage Number of chunks per page + * \param user_pagedelta Number of pages to allocate in one go */ + +template +MyPoolChunk::MyPoolChunk(int user_minchunk, int user_maxchunk, int user_nbin, + int user_chunkperpage, int user_pagedelta) { + minchunk = user_minchunk; + maxchunk = user_maxchunk; + nbin = user_nbin; + chunkperpage = user_chunkperpage; + pagedelta = user_pagedelta; + + errorflag = 0; + if (minchunk <= 0 || minchunk > maxchunk) errorflag = 1; + if (user_nbin <= 0 || chunkperpage <= 0 || pagedelta <= 0) errorflag = 1; + + freehead = new int[nbin]; + chunksize = new int[nbin]; + if (!freehead || !chunksize) errorflag = 1; + if (errorflag) return; + + // insure nbin*binsize spans minchunk to maxchunk inclusive + + binsize = (maxchunk-minchunk+1) / nbin; + if (minchunk + nbin*binsize <= maxchunk) binsize++; + + freelist = nullptr; + for (int ibin = 0; ibin < nbin; ibin++) { + freehead[ibin] = -1; + chunksize[ibin] = minchunk + (ibin+1)*binsize - 1; + if (chunksize[ibin] > maxchunk) chunksize[ibin] = maxchunk; + } + + ndatum = nchunk = 0; + pages = nullptr; + whichbin = nullptr; + npage = 0; +} + +/** Destroy class instance and free all allocated memory */ +template +MyPoolChunk::~MyPoolChunk() { + delete [] freehead; + delete [] chunksize; + if (npage) { + free(freelist); + for (int i = 0; i < npage; i++) free(pages[i]); + free(pages); + free(whichbin); + } +} + +/** Return pointer/index of unused chunk of size maxchunk + * + * \param index Index of chunk in memory pool + * \return Pointer to requested chunk of storage */ + +template +T *MyPoolChunk::get(int &index) { + int ibin = nbin-1; + if (freehead[ibin] < 0) { + allocate(ibin); + if (errorflag) { + index = -1; + return nullptr; + } + } + + ndatum += maxchunk; + nchunk++; + index = freehead[ibin]; + int ipage = index/chunkperpage; + int ientry = index % chunkperpage; + freehead[ibin] = freelist[index]; + return &pages[ipage][ientry*chunksize[ibin]]; +} + +/** Return pointer/index of unused chunk of size N + * + * \param n Size of chunk + * \param index Index of chunk in memory pool + * \return Pointer to requested chunk of storage */ + +template +T *MyPoolChunk::get(int n, int &index) { + if (n < minchunk || n > maxchunk) { + errorflag = 3; + index = -1; + return nullptr; + } + + int ibin = (n-minchunk) / binsize; + if (freehead[ibin] < 0) { + allocate(ibin); + if (errorflag) { + index = -1; + return nullptr; + } + } + + ndatum += n; + nchunk++; + index = freehead[ibin]; + int ipage = index/chunkperpage; + int ientry = index % chunkperpage; + freehead[ibin] = freelist[index]; + return &pages[ipage][ientry*chunksize[ibin]]; +} + +/** Put indexed chunk back into memory pool via free list + * + * \param index Memory chunk index returned by call to get() */ + +template +void MyPoolChunk::put(int index) { + if (index < 0) return; + int ipage = index/chunkperpage; + int ibin = whichbin[ipage]; + nchunk--; + ndatum -= chunksize[ibin]; + freelist[index] = freehead[ibin]; + freehead[ibin] = index; + } + + +template +void MyPoolChunk::allocate(int ibin) { + int oldpage = npage; + npage += pagedelta; + freelist = (int *) realloc(freelist,npage*chunkperpage*sizeof(int)); + pages = (T **) realloc(pages,npage*sizeof(T *)); + whichbin = (int *) realloc(whichbin,npage*sizeof(int)); + if (!freelist || !pages) { + errorflag = 2; + return; + } + + // allocate pages with appropriate chunksize for ibin + + for (int i = oldpage; i < npage; i++) { + whichbin[i] = ibin; +#if defined(LAMMPS_MEMALIGN) + void *ptr; + if (posix_memalign(&ptr, LAMMPS_MEMALIGN, + chunkperpage*chunksize[ibin]*sizeof(T))) + errorflag = 2; + pages[i] = (T *) ptr; +#else + pages[i] = (T *) malloc(chunkperpage*chunksize[ibin]*sizeof(T)); + if (!pages[i]) errorflag = 2; +#endif + } + + // reset free list for unused chunks on new pages + + freehead[ibin] = oldpage*chunkperpage; + for (int i = freehead[ibin]; i < npage*chunkperpage; i++) freelist[i] = i+1; + freelist[npage*chunkperpage-1] = -1; +} + +/** Return total size of allocated pages + * + * \return total storage used in bytes */ + +template +double MyPoolChunk::size() const { + double bytes = npage*chunkperpage*sizeof(int); + bytes += npage*sizeof(T *); + bytes += npage*sizeof(int); + for (int i=0; i < npage; ++i) + bytes += chunkperpage*chunksize[i]*sizeof(T); + + return bytes; +} + +// explicit instantiations + +namespace LAMMPS_NS { + template class MyPoolChunk; + template class MyPoolChunk; +} diff --git a/src/my_pool_chunk.h b/src/my_pool_chunk.h index da196f5ec9..a9bcbd3e80 100644 --- a/src/my_pool_chunk.h +++ b/src/my_pool_chunk.h @@ -9,46 +9,11 @@ the GNU General Public License. See the README file in the top-level LAMMPS directory. -------------------------------------------------------------------------- */ - -/* ---------------------------------------------------------------------- -MyPoolChunk = templated class for storing chunks of datums in pages - chunks can be returned to pool for reuse - chunks come in nbin different fixed sizes so can reuse - replaces many small mallocs with a few large mallocs - pages are never freed, so can reuse w/out reallocs -usage: - continuously get() and put() chunks as needed - NOTE: could add a clear() if retain info on mapping of pages to bins -inputs: - template T = one datum, e.g. int, double, struct - minchunk = min # of datums in one chunk, def = 1 - maxchunk = max # of datums in one chunk, def = 1 - nbin = # of bins between minchunk and maxchunk - chunkperpage = # of chunks in one page, def = 1024 - pagedelta = # of pages to allocate at a time, def = 1 -methods: - T *get(index) = return ptr/index to unused chunk of size maxchunk - T *get(N,index) = return ptr/index to unused chunk of size N - minchunk <= N <= maxchunk required - put(index) = return indexed chunk to pool (same index returned by get) - int size() = return total size of allocated pages in bytes -public variables: - ndatum = total # of stored datums - nchunk = total # of stored chunks - size = total size of all allocated pages in daums - errorflag = flag for various error conditions -------------------------------------------------------------------------- */ + ------------------------------------------------------------------------- */ #ifndef LAMMPS_MY_POOL_CHUNK_H #define LAMMPS_MY_POOL_CHUNK_H -#if defined(LMP_USER_INTEL) && !defined(LAMMPS_MEMALIGN) && !defined(_WIN32) -#define LAMMPS_MEMALIGN 64 -#endif - -#include - namespace LAMMPS_NS { template @@ -56,113 +21,36 @@ class MyPoolChunk { public: int ndatum; // total # of stored datums int nchunk; // total # of stored chunks - int size; // total size of all allocated pages in datums - int errorflag; // flag > 1 if error has occurred - // 1 = invalid inputs - // 2 = memory allocation error - // 3 = chunk size exceeded maxchunk MyPoolChunk(int user_minchunk = 1, int user_maxchunk = 1, int user_nbin = 1, - int user_chunkperpage = 1024, int user_pagedelta = 1) { - minchunk = user_minchunk; - maxchunk = user_maxchunk; - nbin = user_nbin; - chunkperpage = user_chunkperpage; - pagedelta = user_pagedelta; - - errorflag = 0; - if (minchunk <= 0 || minchunk > maxchunk) errorflag = 1; - if (user_nbin <= 0 || chunkperpage <= 0 || pagedelta <= 0) errorflag = 1; - - freehead = new int[nbin]; - chunksize = new int[nbin]; - if (!freehead || !chunksize) errorflag = 1; - if (errorflag) return; - - // insure nbin*binsize spans minchunk to maxchunk inclusive - - binsize = (maxchunk-minchunk+1) / nbin; - if (minchunk + nbin*binsize <= maxchunk) binsize++; - - freelist = NULL; - for (int ibin = 0; ibin < nbin; ibin++) { - freehead[ibin] = -1; - chunksize[ibin] = minchunk + (ibin+1)*binsize - 1; - if (chunksize[ibin] > maxchunk) chunksize[ibin] = maxchunk; - } - - ndatum = nchunk = size = 0; - pages = NULL; - whichbin = NULL; - npage = 0; - } + int user_chunkperpage = 1024, int user_pagedelta = 1); // free all allocated memory - ~MyPoolChunk() { - delete [] freehead; - delete [] chunksize; - if (npage) { - free(freelist); - for (int i = 0; i < npage; i++) free(pages[i]); - free(pages); - free(whichbin); - } - } + ~MyPoolChunk(); // return pointer/index of unused chunk of size maxchunk - T *get(int &index) { - int ibin = nbin-1; - if (freehead[ibin] < 0) { - allocate(ibin); - if (errorflag) return NULL; - } - - ndatum += maxchunk; - nchunk++; - index = freehead[ibin]; - int ipage = index/chunkperpage; - int ientry = index % chunkperpage; - freehead[ibin] = freelist[index]; - return &pages[ipage][ientry*chunksize[ibin]]; - } + T *get(int &index); // return pointer/index of unused chunk of size N - T *get(int n, int &index) { - if (n < minchunk || n > maxchunk) { - errorflag = 3; - return NULL; - } - - int ibin = (n-minchunk) / binsize; - if (freehead[ibin] < 0) { - allocate(ibin); - if (errorflag) return NULL; - } - - ndatum += n; - nchunk++; - index = freehead[ibin]; - int ipage = index/chunkperpage; - int ientry = index % chunkperpage; - freehead[ibin] = freelist[index]; - return &pages[ipage][ientry*chunksize[ibin]]; - } + T *get(int n, int &index); // return indexed chunk to pool via free list // index = -1 if no allocated chunk - void put(int index) { - if (index < 0) return; - int ipage = index/chunkperpage; - int ibin = whichbin[ipage]; - nchunk--; - ndatum -= chunksize[ibin]; - freelist[index] = freehead[ibin]; - freehead[ibin] = index; - } + void put(int index); + + // total memory used in bytes + + double size() const; + + /** Return error status + * + * \return 0 if no error, 1 if invalid input, 2 if malloc() failed, 3 if chunk > maxchunk */ + + int status() const { return errorflag; } private: int minchunk; // min # of datums per chunk @@ -171,6 +59,10 @@ class MyPoolChunk { int chunkperpage; // # of chunks on every page, regardless of which bin int pagedelta; // # of pages to allocate at once, default = 1 int binsize; // delta in chunk sizes between adjacent bins + int errorflag; // flag > 0 if error has occurred + // 1 = invalid inputs + // 2 = memory allocation error + // 3 = chunk size exceeded maxchunk T **pages; // list of allocated pages int *whichbin; // which bin each page belongs to @@ -179,42 +71,7 @@ class MyPoolChunk { int *freehead; // index of first unused chunk in each bin int *chunksize; // size of chunks in each bin - void allocate(int ibin) { - int oldpage = npage; - npage += pagedelta; - freelist = (int *) realloc(freelist,npage*chunkperpage*sizeof(int)); - pages = (T **) realloc(pages,npage*sizeof(T *)); - whichbin = (int *) realloc(whichbin,npage*sizeof(int)); - if (!freelist || !pages) { - errorflag = 2; - return; - } - - // allocate pages with appropriate chunksize for ibin - - for (int i = oldpage; i < npage; i++) { - whichbin[i] = ibin; -#if defined(LAMMPS_MEMALIGN) - void *ptr; - if (posix_memalign(&ptr, LAMMPS_MEMALIGN, - chunkperpage*chunksize[ibin]*sizeof(T))) - errorflag = 2; - pages[i] = (T *) ptr; -#else - pages[i] = (T *) malloc(chunkperpage*chunksize[ibin]*sizeof(T)); - size += chunkperpage*chunksize[ibin]; - if (!pages[i]) errorflag = 2; -#endif - } - - // reset free list for unused chunks on new pages - - freehead[ibin] = oldpage*chunkperpage; - for (int i = freehead[ibin]; i < npage*chunkperpage; i++) freelist[i] = i+1; - freelist[npage*chunkperpage-1] = -1; - } + void allocate(int ibin); }; - } - #endif diff --git a/src/nbin.cpp b/src/nbin.cpp index 1092311f6a..1fe011e9f2 100644 --- a/src/nbin.cpp +++ b/src/nbin.cpp @@ -27,9 +27,9 @@ NBin::NBin(LAMMPS *lmp) : Pointers(lmp) { last_bin = -1; mbins = maxbin = maxatom = 0; - binhead = NULL; - bins = NULL; - atom2bin = NULL; + binhead = nullptr; + bins = nullptr; + atom2bin = nullptr; neighbor->last_setup_bins = -1; @@ -153,9 +153,9 @@ int NBin::coord2bin(double *x) /* ---------------------------------------------------------------------- */ -bigint NBin::memory_usage() +double NBin::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += maxbin*sizeof(int); bytes += 2*maxatom*sizeof(int); return bytes; diff --git a/src/nbin.h b/src/nbin.h index 54b8da171d..4bfe579514 100644 --- a/src/nbin.h +++ b/src/nbin.h @@ -42,7 +42,7 @@ class NBin : protected Pointers { void post_constructor(class NeighRequest *); virtual void copy_neighbor_info(); virtual void bin_atoms_setup(int); - bigint memory_usage(); + double memory_usage(); virtual void setup_bins(int) = 0; virtual void bin_atoms() = 0; diff --git a/src/neigh_list.cpp b/src/neigh_list.cpp index c01f8ca595..1ed21b49e6 100644 --- a/src/neigh_list.cpp +++ b/src/neigh_list.cpp @@ -33,9 +33,9 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) maxatom = 0; inum = gnum = 0; - ilist = NULL; - numneigh = NULL; - firstneigh = NULL; + ilist = nullptr; + numneigh = nullptr; + firstneigh = nullptr; // defaults, but may be reset by post_constructor() @@ -51,31 +51,31 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // ptrs - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; - listcopy = NULL; - listskip = NULL; - listfull = NULL; + listcopy = nullptr; + listskip = nullptr; + listfull = nullptr; - fix_bond = NULL; + fix_bond = nullptr; - ipage = NULL; + ipage = nullptr; // extra rRESPA lists inum_inner = gnum_inner = 0; - ilist_inner = NULL; - numneigh_inner = NULL; - firstneigh_inner = NULL; + ilist_inner = nullptr; + numneigh_inner = nullptr; + firstneigh_inner = nullptr; inum_middle = gnum_middle = 0; - ilist_middle = NULL; - numneigh_middle = NULL; - firstneigh_middle = NULL; + ilist_middle = nullptr; + numneigh_middle = nullptr; + firstneigh_middle = nullptr; - ipage_inner = NULL; - ipage_middle = NULL; + ipage_inner = nullptr; + ipage_middle = nullptr; // Kokkos package @@ -85,9 +85,9 @@ NeighList::NeighList(LAMMPS *lmp) : Pointers(lmp) // USER-DPD package - np = NULL; + np = nullptr; - requestor = NULL; + requestor = nullptr; requestor_type = NeighList::NONE; } @@ -294,9 +294,9 @@ void NeighList::print_attributes() if stencilflag = 0, maxstencil * maxstencil_multi will also be 0 ------------------------------------------------------------------------- */ -bigint NeighList::memory_usage() +double NeighList::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += memory->usage(ilist,maxatom); bytes += memory->usage(numneigh,maxatom); bytes += maxatom * sizeof(int *); diff --git a/src/neigh_list.h b/src/neigh_list.h index 501188a724..d69b844dc8 100644 --- a/src/neigh_list.h +++ b/src/neigh_list.h @@ -14,7 +14,7 @@ #ifndef LMP_NEIGH_LIST_H #define LMP_NEIGH_LIST_H -#include "pointers.h" +#include "pointers.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -107,7 +107,7 @@ class NeighList : protected Pointers { void grow(int,int); // grow all data structs void print_attributes(); // debug routine int get_maxlocal() {return maxatom;} - bigint memory_usage(); + double memory_usage(); }; } diff --git a/src/neigh_request.cpp b/src/neigh_request.cpp index 006ff5e87b..f4c7e7e0bf 100644 --- a/src/neigh_request.cpp +++ b/src/neigh_request.cpp @@ -71,12 +71,12 @@ NeighRequest::NeighRequest(LAMMPS *lmp) : Pointers(lmp) // skip info, default is no skipping skip = 0; - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; // only set when command = 1; - command_style = NULL; + command_style = nullptr; // info set by Neighbor class when morphing original requests @@ -217,8 +217,8 @@ void NeighRequest::copy_request(NeighRequest *other, int skipflag) cut = other->cut; cutoff = other->cutoff; - iskip = NULL; - ijskip = NULL; + iskip = nullptr; + ijskip = nullptr; if (!skipflag) return; diff --git a/src/neighbor.cpp b/src/neighbor.cpp index 70333461ba..58737b815d 100644 --- a/src/neighbor.cpp +++ b/src/neighbor.cpp @@ -16,38 +16,37 @@ ------------------------------------------------------------------------- */ #include "neighbor.h" -#include -#include -#include -#include "neigh_list.h" -#include "neigh_request.h" -#include "nbin.h" -#include "nstencil.h" -#include "npair.h" -#include "ntopo.h" -#include "style_nbin.h" -#include "style_nstencil.h" -#include "style_npair.h" -#include "style_ntopo.h" + #include "atom.h" #include "atom_vec.h" +#include "citeme.h" #include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "fix.h" #include "force.h" +#include "group.h" +#include "memory.h" +#include "modify.h" +#include "nbin.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "npair.h" +#include "nstencil.h" +#include "ntopo.h" +#include "output.h" #include "pair.h" #include "pair_hybrid.h" -#include "domain.h" -#include "group.h" -#include "modify.h" -#include "fix.h" -#include "compute.h" -#include "update.h" #include "respa.h" -#include "output.h" -#include "citeme.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "style_nbin.h" +#include "style_npair.h" +#include "style_nstencil.h" +#include "style_ntopo.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; using namespace NeighConst; @@ -77,7 +76,7 @@ static const char cite_neigh_multi[] = /* ---------------------------------------------------------------------- */ Neighbor::Neighbor(LAMMPS *lmp) : Pointers(lmp), -pairclass(NULL), pairnames(NULL), pairmasks(NULL) +pairclass(nullptr), pairnames(nullptr), pairmasks(nullptr) { MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); @@ -96,62 +95,62 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) ago = -1; cutneighmax = 0.0; - cutneighsq = NULL; - cutneighghostsq = NULL; - cuttype = NULL; - cuttypesq = NULL; - fixchecklist = NULL; + cutneighsq = nullptr; + cutneighghostsq = nullptr; + cuttype = nullptr; + cuttypesq = nullptr; + fixchecklist = nullptr; // pairwise neighbor lists and associated data structs nlist = 0; - lists = NULL; + lists = nullptr; nbin = 0; - neigh_bin = NULL; + neigh_bin = nullptr; nstencil = 0; - neigh_stencil = NULL; + neigh_stencil = nullptr; - neigh_pair = NULL; + neigh_pair = nullptr; nstencil_perpetual = 0; - slist = NULL; + slist = nullptr; npair_perpetual = 0; - plist = NULL; + plist = nullptr; nrequest = maxrequest = 0; - requests = NULL; + requests = nullptr; old_nrequest = 0; - old_requests = NULL; + old_requests = nullptr; old_style = style; old_triclinic = 0; old_pgsize = pgsize; old_oneatom = oneatom; - binclass = NULL; - binnames = NULL; - binmasks = NULL; - stencilclass = NULL; - stencilnames = NULL; - stencilmasks = NULL; + binclass = nullptr; + binnames = nullptr; + binmasks = nullptr; + stencilclass = nullptr; + stencilnames = nullptr; + stencilmasks = nullptr; // topology lists bondwhich = anglewhich = dihedralwhich = improperwhich = NONE; - neigh_bond = NULL; - neigh_angle = NULL; - neigh_dihedral = NULL; - neigh_improper = NULL; + neigh_bond = nullptr; + neigh_angle = nullptr; + neigh_dihedral = nullptr; + neigh_improper = nullptr; // coords at last neighboring maxhold = 0; - xhold = NULL; + xhold = nullptr; lastcall = -1; last_setup_bins = -1; @@ -160,14 +159,14 @@ pairclass(NULL), pairnames(NULL), pairmasks(NULL) includegroup = 0; nex_type = maxex_type = 0; - ex1_type = ex2_type = NULL; - ex_type = NULL; + ex1_type = ex2_type = nullptr; + ex_type = nullptr; nex_group = maxex_group = 0; - ex1_group = ex2_group = ex1_bit = ex2_bit = NULL; + ex1_group = ex2_group = ex1_bit = ex2_bit = nullptr; nex_mol = maxex_mol = 0; - ex_mol_group = ex_mol_bit = ex_mol_intra = NULL; + ex_mol_group = ex_mol_bit = ex_mol_intra = nullptr; // Kokkos setting @@ -271,7 +270,7 @@ void Neighbor::init() // set neighbor cutoffs (force cutoff + skin) // trigger determines when atoms migrate and neighbor lists are rebuilt // needs to be non-zero for migration distance check - // even if pair = NULL and no neighbor lists are used + // even if pair = nullptr and no neighbor lists are used // cutneigh = force cutoff + skin if cutforce > 0, else cutneigh = 0 // cutneighghost = pair cutghost if it requests it, else same as cutneigh @@ -282,7 +281,7 @@ void Neighbor::init() boxcheck = 1; n = atom->ntypes; - if (cutneighsq == NULL) { + if (cutneighsq == nullptr) { if (lmp->kokkos) init_cutneighsq_kokkos(n); else memory->create(cutneighsq,n+1,n+1,"neigh:cutneighsq"); memory->create(cutneighghostsq,n+1,n+1,"neigh:cutneighghostsq"); @@ -339,7 +338,7 @@ void Neighbor::init() if (output->restart_flag) restart_check = 1; delete [] fixchecklist; - fixchecklist = NULL; + fixchecklist = nullptr; fixchecklist = new int[modify->nfix]; fix_check = 0; @@ -379,7 +378,7 @@ void Neighbor::init() // We cannot remove special neighbors with kspace or kspace-like pair styles // as the exclusion needs to remove the full coulomb and not the damped interaction. // Special treatment is required for hybrid pair styles since Force::pair_match() - // will only return a non-NULL pointer if there is only one substyle of the kind. + // will only return a non-null pointer if there is only one substyle of the kind. if (force->kspace) { special_flag[1] = special_flag[2] = special_flag[3] = 2; @@ -411,7 +410,7 @@ void Neighbor::init() if (dist_check == 0) { memory->destroy(xhold); maxhold = 0; - xhold = NULL; + xhold = nullptr; } // first time allocation @@ -516,7 +515,7 @@ void Neighbor::init() for (int i = 0; i < nrequest; i++) { delete requests[i]; - requests[i] = NULL; + requests[i] = nullptr; } nrequest = 0; @@ -810,7 +809,7 @@ int Neighbor::init_pair() if (lists[i]->bin_method > 0) { neigh_stencil[nstencil]->nb = neigh_bin[requests[i]->index_bin]; - if (neigh_stencil[nstencil]->nb == NULL) + if (neigh_stencil[nstencil]->nb == nullptr) error->all(FLERR,"Could not assign bin method to neighbor stencil"); } @@ -824,7 +823,7 @@ int Neighbor::init_pair() requests[i]->index_pair = -1; flag = lists[i]->pair_method; if (flag == 0) { - neigh_pair[i] = NULL; + neigh_pair[i] = nullptr; continue; } @@ -835,12 +834,12 @@ int Neighbor::init_pair() if (lists[i]->bin_method > 0) { neigh_pair[i]->nb = neigh_bin[requests[i]->index_bin]; - if (neigh_pair[i]->nb == NULL) + if (neigh_pair[i]->nb == nullptr) error->all(FLERR,"Could not assign bin method to neighbor pair"); } if (lists[i]->stencil_method > 0) { neigh_pair[i]->ns = neigh_stencil[requests[i]->index_stencil]; - if (neigh_pair[i]->ns == NULL) + if (neigh_pair[i]->ns == nullptr) error->all(FLERR,"Could not assign stencil method to neighbor pair"); } @@ -906,11 +905,11 @@ int Neighbor::init_pair() done = 1; for (i = 0; i < npair_perpetual; i++) { for (k = 0; k < 3; k++) { - ptr = NULL; + ptr = nullptr; if (k == 0) ptr = lists[plist[i]]->listcopy; if (k == 1) ptr = lists[plist[i]]->listskip; if (k == 2) ptr = lists[plist[i]]->listfull; - if (ptr == NULL) continue; + if (ptr == nullptr) continue; for (m = 0; m < nrequest; m++) if (ptr == lists[m]) break; for (j = 0; j < npair_perpetual; j++) @@ -1297,11 +1296,11 @@ void Neighbor::init_topology() { int i,m; - if (!atom->molecular) return; + if (atom->molecular == Atom::ATOMIC) return; // set flags that determine which topology neighbor classes to use // these settings could change from run to run, depending on fixes defined - // bonds,etc can only be broken for atom->molecular = 1, not 2 + // bonds,etc can only be broken for atom->molecular = Atom::MOLECULAR, not Atom::TEMPLATE // SHAKE sets bonds and angles negative // gcmc sets all bonds, angles, etc negative // bond_quartic sets bonds to 0 @@ -1315,7 +1314,7 @@ void Neighbor::init_topology() bond_off = angle_off = 1; if (force->bond && force->bond_match("quartic")) bond_off = 1; - if (atom->avec->bonds_allow && atom->molecular == 1) { + if (atom->avec->bonds_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (bond_off) break; for (m = 0; m < atom->num_bond[i]; m++) @@ -1323,7 +1322,7 @@ void Neighbor::init_topology() } } - if (atom->avec->angles_allow && atom->molecular == 1) { + if (atom->avec->angles_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (angle_off) break; for (m = 0; m < atom->num_angle[i]; m++) @@ -1332,7 +1331,7 @@ void Neighbor::init_topology() } int dihedral_off = 0; - if (atom->avec->dihedrals_allow && atom->molecular == 1) { + if (atom->avec->dihedrals_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (dihedral_off) break; for (m = 0; m < atom->num_dihedral[i]; m++) @@ -1341,7 +1340,7 @@ void Neighbor::init_topology() } int improper_off = 0; - if (atom->avec->impropers_allow && atom->molecular == 1) { + if (atom->avec->impropers_allow && atom->molecular == Atom::MOLECULAR) { for (i = 0; i < atom->nlocal; i++) { if (improper_off) break; for (m = 0; m < atom->num_improper[i]; m++) @@ -1368,7 +1367,7 @@ void Neighbor::init_topology() if (atom->avec->bonds_allow) { int old_bondwhich = bondwhich; - if (atom->molecular == 2) bondwhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) bondwhich = TEMPLATE; else if (bond_off) bondwhich = PARTIAL; else bondwhich = ALL; if (!neigh_bond || bondwhich != old_bondwhich) { @@ -1384,7 +1383,7 @@ void Neighbor::init_topology() if (atom->avec->angles_allow) { int old_anglewhich = anglewhich; - if (atom->molecular == 2) anglewhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) anglewhich = TEMPLATE; else if (angle_off) anglewhich = PARTIAL; else anglewhich = ALL; if (!neigh_angle || anglewhich != old_anglewhich) { @@ -1400,7 +1399,7 @@ void Neighbor::init_topology() if (atom->avec->dihedrals_allow) { int old_dihedralwhich = dihedralwhich; - if (atom->molecular == 2) dihedralwhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) dihedralwhich = TEMPLATE; else if (dihedral_off) dihedralwhich = PARTIAL; else dihedralwhich = ALL; if (!neigh_dihedral || dihedralwhich != old_dihedralwhich) { @@ -1416,7 +1415,7 @@ void Neighbor::init_topology() if (atom->avec->impropers_allow) { int old_improperwhich = improperwhich; - if (atom->molecular == 2) improperwhich = TEMPLATE; + if (atom->molecular == Atom::TEMPLATE) improperwhich = TEMPLATE; else if (improper_off) improperwhich = PARTIAL; else improperwhich = ALL; if (!neigh_improper || improperwhich != old_improperwhich) { @@ -1576,17 +1575,17 @@ void Neighbor::requests_new2old() /* ---------------------------------------------------------------------- find and return request made by classptr - if not found or classpt = NULL, return NULL + if not found or classpt = nullptr, return nullptr ------------------------------------------------------------------------- */ NeighRequest *Neighbor::find_request(void *classptr) { - if (classptr == NULL) return NULL; + if (classptr == nullptr) return nullptr; for (int i = 0; i < nrequest; i++) if (requests[i]->requestor == classptr) return requests[i]; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- @@ -1800,9 +1799,9 @@ int Neighbor::choose_pair(NeighRequest *rq) // if molecular on, do not match ATOMONLY (b/c a MOLONLY Npair exists) // if molecular off, do not match MOLONLY (b/c an ATOMONLY Npair exists) - if (molecular) { + if (molecular != Atom::ATOMIC) { if (mask & NP_ATOMONLY) continue; - } else if (!molecular) { + } else if (molecular == Atom::ATOMIC) { if (mask & NP_MOLONLY) continue; } @@ -2098,7 +2097,7 @@ void Neighbor::build(int topoflag) // build topology lists for bonds/angles/etc - if (atom->molecular && topoflag) build_topology(); + if ((atom->molecular != Atom::ATOMIC) && topoflag) build_topology(); } /* ---------------------------------------------------------------------- @@ -2139,7 +2138,7 @@ void Neighbor::build_one(class NeighList *mylist, int preflag) { // check if list structure is initialized - if (mylist == NULL) + if (mylist == nullptr) error->all(FLERR,"Trying to build an occasional neighbor list " "before initialization completed"); @@ -2194,7 +2193,7 @@ void Neighbor::set(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal neighbor command"); - skin = force->numeric(FLERR,arg[0]); + skin = utils::numeric(FLERR,arg[0],false,lmp); if (skin < 0.0) error->all(FLERR,"Illegal neighbor command"); if (strcmp(arg[1],"nsq") == 0) style = Neighbor::NSQ; @@ -2236,12 +2235,12 @@ void Neighbor::modify_params(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); - every = force->inumeric(FLERR,arg[iarg+1]); + every = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (every <= 0) error->all(FLERR,"Illegal neigh_modify command"); iarg += 2; } else if (strcmp(arg[iarg],"delay") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); - delay = force->inumeric(FLERR,arg[iarg+1]); + delay = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (delay < 0) error->all(FLERR,"Illegal neigh_modify command"); iarg += 2; } else if (strcmp(arg[iarg],"check") == 0) { @@ -2259,16 +2258,16 @@ void Neighbor::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"page") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); old_pgsize = pgsize; - pgsize = force->inumeric(FLERR,arg[iarg+1]); + pgsize = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"one") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); old_oneatom = oneatom; - oneatom = force->inumeric(FLERR,arg[iarg+1]); + oneatom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"binsize") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal neigh_modify command"); - binsize_user = force->numeric(FLERR,arg[iarg+1]); + binsize_user = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (binsize_user <= 0.0) binsizeflag = 0; else binsizeflag = 1; iarg += 2; @@ -2284,7 +2283,7 @@ void Neighbor::modify_params(int narg, char **arg) includegroup = group->find(arg[iarg+1]); if (includegroup < 0) error->all(FLERR,"Invalid group ID in neigh_modify command"); - if (includegroup && (atom->firstgroupname == NULL || + if (includegroup && (atom->firstgroupname == nullptr || strcmp(arg[iarg+1],atom->firstgroupname) != 0)) error->all(FLERR, "Neigh_modify include group != atom_modify first group"); @@ -2300,8 +2299,8 @@ void Neighbor::modify_params(int narg, char **arg) memory->grow(ex1_type,maxex_type,"neigh:ex1_type"); memory->grow(ex2_type,maxex_type,"neigh:ex2_type"); } - ex1_type[nex_type] = force->inumeric(FLERR,arg[iarg+2]); - ex2_type[nex_type] = force->inumeric(FLERR,arg[iarg+3]); + ex1_type[nex_type] = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + ex2_type[nex_type] = utils::inumeric(FLERR,arg[iarg+3],false,lmp); nex_type++; iarg += 4; @@ -2391,9 +2390,9 @@ int Neighbor::exclude_setting() return # of bytes of allocated memory ------------------------------------------------------------------------- */ -bigint Neighbor::memory_usage() +double Neighbor::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += memory->usage(xhold,maxhold,3); for (int i = 0; i < nlist; i++) diff --git a/src/neighbor.h b/src/neighbor.h index 8fe423c60c..9ee2af9c75 100644 --- a/src/neighbor.h +++ b/src/neighbor.h @@ -123,7 +123,7 @@ class Neighbor : protected Pointers { int exclude_setting(); // return exclude value to accelerator pkg class NeighRequest *find_request(void *); // find a neighbor request - bigint memory_usage(); + double memory_usage(); bigint last_setup_bins; // step of last neighbor::setup_bins() call diff --git a/src/npair.cpp b/src/npair.cpp index b63135fad6..698ff28067 100644 --- a/src/npair.cpp +++ b/src/npair.cpp @@ -27,10 +27,10 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ NPair::NPair(LAMMPS *lmp) - : Pointers(lmp), nb(NULL), ns(NULL), bins(NULL), stencil(NULL) + : Pointers(lmp), nb(nullptr), ns(nullptr), bins(nullptr), stencil(nullptr) { last_build = -1; - mycutneighsq = NULL; + mycutneighsq = nullptr; molecular = atom->molecular; copymode = 0; execution_space = Host; diff --git a/src/npair_full_bin.cpp b/src/npair_full_bin.cpp index 464dca9251..d1eecb7832 100644 --- a/src/npair_full_bin.cpp +++ b/src/npair_full_bin.cpp @@ -51,7 +51,7 @@ void NPairFullBin::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -94,7 +94,7 @@ void NPairFullBin::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_bin_ghost.cpp b/src/npair_full_bin_ghost.cpp index 61b27dd99d..6ea7e018dc 100644 --- a/src/npair_full_bin_ghost.cpp +++ b/src/npair_full_bin_ghost.cpp @@ -53,7 +53,7 @@ void NPairFullBinGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -100,7 +100,7 @@ void NPairFullBinGhost::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_multi.cpp b/src/npair_full_multi.cpp index 40ed2275be..316e61afbb 100644 --- a/src/npair_full_multi.cpp +++ b/src/npair_full_multi.cpp @@ -53,7 +53,7 @@ void NPairFullMulti::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -101,7 +101,7 @@ void NPairFullMulti::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_nsq.cpp b/src/npair_full_nsq.cpp index 76b66fd004..9ce3885eaf 100644 --- a/src/npair_full_nsq.cpp +++ b/src/npair_full_nsq.cpp @@ -56,7 +56,7 @@ void NPairFullNsq::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -95,7 +95,7 @@ void NPairFullNsq::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_full_nsq_ghost.cpp b/src/npair_full_nsq_ghost.cpp index b20fa9b8ce..3b42b73ece 100644 --- a/src/npair_full_nsq_ghost.cpp +++ b/src/npair_full_nsq_ghost.cpp @@ -52,7 +52,7 @@ void NPairFullNsqGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -94,7 +94,7 @@ void NPairFullNsqGhost::build(NeighList *list) delz = ztmp - x[j][2]; rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newtoff.cpp b/src/npair_half_bin_newtoff.cpp index 65768918c9..4670d9c1d0 100644 --- a/src/npair_half_bin_newtoff.cpp +++ b/src/npair_half_bin_newtoff.cpp @@ -53,7 +53,7 @@ void NPairHalfBinNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -98,7 +98,7 @@ void NPairHalfBinNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newtoff_ghost.cpp b/src/npair_half_bin_newtoff_ghost.cpp index 91fbf049cb..003b083cb4 100644 --- a/src/npair_half_bin_newtoff_ghost.cpp +++ b/src/npair_half_bin_newtoff_ghost.cpp @@ -57,7 +57,7 @@ void NPairHalfBinNewtoffGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -106,7 +106,7 @@ void NPairHalfBinNewtoffGhost::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newton.cpp b/src/npair_half_bin_newton.cpp index fe388e1144..d8ced569ae 100644 --- a/src/npair_half_bin_newton.cpp +++ b/src/npair_half_bin_newton.cpp @@ -52,7 +52,7 @@ void NPairHalfBinNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -99,7 +99,7 @@ void NPairHalfBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -130,7 +130,7 @@ void NPairHalfBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_bin_newton_tri.cpp b/src/npair_half_bin_newton_tri.cpp index 1f0e3c1187..7745b99e39 100644 --- a/src/npair_half_bin_newton_tri.cpp +++ b/src/npair_half_bin_newton_tri.cpp @@ -52,7 +52,7 @@ void NPairHalfBinNewtonTri::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -104,7 +104,7 @@ void NPairHalfBinNewtonTri::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_multi_newtoff.cpp b/src/npair_half_multi_newtoff.cpp index 57dcf29cc7..d9db19d5f6 100644 --- a/src/npair_half_multi_newtoff.cpp +++ b/src/npair_half_multi_newtoff.cpp @@ -55,7 +55,7 @@ void NPairHalfMultiNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -105,7 +105,7 @@ void NPairHalfMultiNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_multi_newton.cpp b/src/npair_half_multi_newton.cpp index a9293d3d64..8d6adce3e1 100644 --- a/src/npair_half_multi_newton.cpp +++ b/src/npair_half_multi_newton.cpp @@ -54,7 +54,7 @@ void NPairHalfMultiNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -101,7 +101,7 @@ void NPairHalfMultiNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -138,7 +138,7 @@ void NPairHalfMultiNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_multi_newton_tri.cpp b/src/npair_half_multi_newton_tri.cpp index c1d845cb38..ac7372466d 100644 --- a/src/npair_half_multi_newton_tri.cpp +++ b/src/npair_half_multi_newton_tri.cpp @@ -54,7 +54,7 @@ void NPairHalfMultiNewtonTri::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -113,7 +113,7 @@ void NPairHalfMultiNewtonTri::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_nsq_newtoff.cpp b/src/npair_half_nsq_newtoff.cpp index db369687d0..f278ebe78b 100644 --- a/src/npair_half_nsq_newtoff.cpp +++ b/src/npair_half_nsq_newtoff.cpp @@ -57,7 +57,7 @@ void NPairHalfNsqNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -96,7 +96,7 @@ void NPairHalfNsqNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_nsq_newtoff_ghost.cpp b/src/npair_half_nsq_newtoff_ghost.cpp index 0a9b6d0f45..a8f907608b 100644 --- a/src/npair_half_nsq_newtoff_ghost.cpp +++ b/src/npair_half_nsq_newtoff_ghost.cpp @@ -59,7 +59,7 @@ void NPairHalfNsqNewtoffGhost::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -105,7 +105,7 @@ void NPairHalfNsqNewtoffGhost::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_nsq_newton.cpp b/src/npair_half_nsq_newton.cpp index 69489915b2..98a4fd8108 100644 --- a/src/npair_half_nsq_newton.cpp +++ b/src/npair_half_nsq_newton.cpp @@ -57,7 +57,7 @@ void NPairHalfNsqNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -113,7 +113,7 @@ void NPairHalfNsqNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_bin_newtoff.cpp b/src/npair_half_respa_bin_newtoff.cpp index 8c1d8d684f..699ea015c3 100644 --- a/src/npair_half_respa_bin_newtoff.cpp +++ b/src/npair_half_respa_bin_newtoff.cpp @@ -54,7 +54,7 @@ void NPairHalfRespaBinNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -122,7 +122,7 @@ void NPairHalfRespaBinNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_bin_newton.cpp b/src/npair_half_respa_bin_newton.cpp index d2598fa1a4..b86e9acb98 100644 --- a/src/npair_half_respa_bin_newton.cpp +++ b/src/npair_half_respa_bin_newton.cpp @@ -53,7 +53,7 @@ void NPairHalfRespaBinNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -124,7 +124,7 @@ void NPairHalfRespaBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) @@ -168,7 +168,7 @@ void NPairHalfRespaBinNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_bin_newton_tri.cpp b/src/npair_half_respa_bin_newton_tri.cpp index efe48d48e1..a8cb061d36 100644 --- a/src/npair_half_respa_bin_newton_tri.cpp +++ b/src/npair_half_respa_bin_newton_tri.cpp @@ -54,7 +54,7 @@ void NPairHalfRespaBinNewtonTri::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -130,7 +130,7 @@ void NPairHalfRespaBinNewtonTri::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_nsq_newtoff.cpp b/src/npair_half_respa_nsq_newtoff.cpp index 334ebb5ca8..e888ca5496 100644 --- a/src/npair_half_respa_nsq_newtoff.cpp +++ b/src/npair_half_respa_nsq_newtoff.cpp @@ -58,7 +58,7 @@ void NPairHalfRespaNsqNewtoff::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -120,7 +120,7 @@ void NPairHalfRespaNsqNewtoff::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/npair_half_respa_nsq_newton.cpp b/src/npair_half_respa_nsq_newton.cpp index 7ecd02b0c5..bbb434b59c 100644 --- a/src/npair_half_respa_nsq_newton.cpp +++ b/src/npair_half_respa_nsq_newton.cpp @@ -60,7 +60,7 @@ void NPairHalfRespaNsqNewton::build(NeighList *list) int *molindex = atom->molindex; int *molatom = atom->molatom; Molecule **onemols = atom->avec->onemols; - if (molecular == 2) moltemplate = 1; + if (molecular == Atom::TEMPLATE) moltemplate = 1; else moltemplate = 0; int *ilist = list->ilist; @@ -139,7 +139,7 @@ void NPairHalfRespaNsqNewton::build(NeighList *list) rsq = delx*delx + dely*dely + delz*delz; if (rsq <= cutneighsq[itype][jtype]) { - if (molecular) { + if (molecular != Atom::ATOMIC) { if (!moltemplate) which = find_special(special[i],nspecial[i],tag[j]); else if (imol >= 0) diff --git a/src/nstencil.cpp b/src/nstencil.cpp index 431906e898..861fcd537e 100644 --- a/src/nstencil.cpp +++ b/src/nstencil.cpp @@ -59,11 +59,11 @@ NStencil::NStencil(LAMMPS *lmp) : Pointers(lmp) xyzflag = 0; maxstencil = maxstencil_multi = 0; - stencil = NULL; - stencilxyz = NULL; - nstencil_multi = NULL; - stencil_multi = NULL; - distsq_multi = NULL; + stencil = nullptr; + stencilxyz = nullptr; + nstencil_multi = nullptr; + stencil_multi = nullptr; + distsq_multi = nullptr; dimension = domain->dimension; } @@ -179,8 +179,8 @@ void NStencil::create_setup() distsq_multi = new double*[n+1]; for (i = 1; i <= n; i++) { nstencil_multi[i] = 0; - stencil_multi[i] = NULL; - distsq_multi[i] = NULL; + stencil_multi[i] = nullptr; + distsq_multi[i] = nullptr; } } if (smax > maxstencil_multi) { @@ -222,9 +222,9 @@ double NStencil::bin_distance(int i, int j, int k) /* ---------------------------------------------------------------------- */ -bigint NStencil::memory_usage() +double NStencil::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (neighstyle == Neighbor::BIN) { bytes += memory->usage(stencil,maxstencil); bytes += memory->usage(stencilxyz,maxstencil,3); diff --git a/src/nstencil.h b/src/nstencil.h index a4c6a4af66..75e678b483 100644 --- a/src/nstencil.h +++ b/src/nstencil.h @@ -39,7 +39,7 @@ class NStencil : protected Pointers { void post_constructor(class NeighRequest *); void copy_neighbor_info(); virtual void create_setup(); - bigint memory_usage(); + double memory_usage(); virtual void create() = 0; diff --git a/src/ntopo.cpp b/src/ntopo.cpp index ca63b85328..d4163b0140 100644 --- a/src/ntopo.cpp +++ b/src/ntopo.cpp @@ -12,13 +12,13 @@ ------------------------------------------------------------------------- */ #include "ntopo.h" -#include + #include "atom.h" -#include "neighbor.h" #include "comm.h" #include "domain.h" -#include "memory.h" #include "error.h" +#include "memory.h" +#include "neighbor.h" using namespace LAMMPS_NS; @@ -33,7 +33,7 @@ NTopo::NTopo(LAMMPS *lmp) : Pointers(lmp) nbondlist = nanglelist = ndihedrallist = nimproperlist = 0; maxbond = maxangle = maxdihedral = maximproper = 0; - bondlist = anglelist = dihedrallist = improperlist = NULL; + bondlist = anglelist = dihedrallist = improperlist = nullptr; cluster_check = neighbor->cluster_check; } @@ -206,9 +206,9 @@ void NTopo::dihedral_check(int nlist, int **list) /* ---------------------------------------------------------------------- */ -bigint NTopo::memory_usage() +double NTopo::memory_usage() { - bigint bytes = 0; + double bytes = 0; bytes += 3*maxbond * sizeof(int); bytes += 4*maxangle * sizeof(int); bytes += 5*maxdihedral * sizeof(int); diff --git a/src/ntopo.h b/src/ntopo.h index b115b32965..3e4204cead 100644 --- a/src/ntopo.h +++ b/src/ntopo.h @@ -28,7 +28,7 @@ class NTopo : protected Pointers { virtual void build() = 0; - bigint memory_usage(); + double memory_usage(); protected: int me,nprocs; diff --git a/src/ntopo_angle_all.cpp b/src/ntopo_angle_all.cpp index 71521e6891..21ac894d92 100644 --- a/src/ntopo_angle_all.cpp +++ b/src/ntopo_angle_all.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_angle_all.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_angle_partial.cpp b/src/ntopo_angle_partial.cpp index c72073718e..583339ed11 100644 --- a/src/ntopo_angle_partial.cpp +++ b/src/ntopo_angle_partial.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_angle_partial.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_angle_template.cpp b/src/ntopo_angle_template.cpp index d6303a0ad4..17e17ca462 100644 --- a/src/ntopo_angle_template.cpp +++ b/src/ntopo_angle_template.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_angle_template.h" -#include + #include "atom.h" #include "atom_vec.h" #include "force.h" @@ -23,7 +23,7 @@ #include "molecule.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_bond_all.cpp b/src/ntopo_bond_all.cpp index 9fac01bdba..20ec5aa290 100644 --- a/src/ntopo_bond_all.cpp +++ b/src/ntopo_bond_all.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_bond_all.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_bond_partial.cpp b/src/ntopo_bond_partial.cpp index 138f8f4330..9b5914b2c8 100644 --- a/src/ntopo_bond_partial.cpp +++ b/src/ntopo_bond_partial.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_bond_partial.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_bond_template.cpp b/src/ntopo_bond_template.cpp index a651715320..88a31460d9 100644 --- a/src/ntopo_bond_template.cpp +++ b/src/ntopo_bond_template.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_bond_template.h" -#include + #include "atom.h" #include "atom_vec.h" #include "force.h" @@ -23,7 +23,7 @@ #include "molecule.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_dihedral_all.cpp b/src/ntopo_dihedral_all.cpp index 81193605c1..bcfe8ce712 100644 --- a/src/ntopo_dihedral_all.cpp +++ b/src/ntopo_dihedral_all.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_dihedral_all.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_dihedral_partial.cpp b/src/ntopo_dihedral_partial.cpp index 855fa800b6..31a78c5c48 100644 --- a/src/ntopo_dihedral_partial.cpp +++ b/src/ntopo_dihedral_partial.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_dihedral_partial.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_dihedral_template.cpp b/src/ntopo_dihedral_template.cpp index 06fac50400..0d2a9451e0 100644 --- a/src/ntopo_dihedral_template.cpp +++ b/src/ntopo_dihedral_template.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_dihedral_template.h" -#include + #include "atom.h" #include "atom_vec.h" #include "force.h" @@ -23,7 +23,7 @@ #include "molecule.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_improper_all.cpp b/src/ntopo_improper_all.cpp index e839e9161b..53f229a86a 100644 --- a/src/ntopo_improper_all.cpp +++ b/src/ntopo_improper_all.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_improper_all.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_improper_partial.cpp b/src/ntopo_improper_partial.cpp index c4c6ec3177..8fc619c9e4 100644 --- a/src/ntopo_improper_partial.cpp +++ b/src/ntopo_improper_partial.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_improper_partial.h" -#include + #include "atom.h" #include "force.h" #include "domain.h" @@ -21,7 +21,7 @@ #include "thermo.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/ntopo_improper_template.cpp b/src/ntopo_improper_template.cpp index 060ba173fd..bd19d5877c 100644 --- a/src/ntopo_improper_template.cpp +++ b/src/ntopo_improper_template.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "ntopo_improper_template.h" -#include + #include "atom.h" #include "atom_vec.h" #include "force.h" @@ -23,7 +23,7 @@ #include "molecule.h" #include "memory.h" #include "error.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; diff --git a/src/omp_compat.h b/src/omp_compat.h index d80d6f6f7f..366dd9371c 100644 --- a/src/omp_compat.h +++ b/src/omp_compat.h @@ -25,11 +25,30 @@ // so this is what LAMMPS primarily uses. For those compilers // that strictly implement OpenMP 4.0 (such as GCC 9.0 and later // or Clang 10.0 and later), we give up default(none). -#if LAMMPS_OMP_COMPAT == 4 -# define LMP_SHARED(...) -# define LMP_DEFAULT_NONE default(shared) -#else -# define LMP_SHARED(...) shared(__VA_ARGS__) -# define LMP_DEFAULT_NONE default(none) + +// autodetect OpenMP compatibility if not explicitly set + +#ifndef LAMMPS_OMP_COMPAT +# if defined(__INTEL_COMPILER) +# if __INTEL_COMPILER > 18 +# define LAMMPS_OMP_COMPAT 4 +# endif +# elif defined(__clang__) +# if __clang_major__ >= 10 +# define LAMMPS_OMP_COMPAT 4 +# endif +# elif defined(__GNUC__) +# if __GNUC__ >= 9 +# define LAMMPS_OMP_COMPAT 4 +# endif +# endif +#endif + +#if LAMMPS_OMP_COMPAT == 4 +# define LMP_SHARED(...) +# define LMP_DEFAULT_NONE default(shared) +#else +# define LMP_SHARED(...) shared(__VA_ARGS__) +# define LMP_DEFAULT_NONE default(none) #endif diff --git a/src/output.cpp b/src/output.cpp index 6051e04055..450bc46750 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -12,27 +12,26 @@ ------------------------------------------------------------------------- */ #include "output.h" -#include -#include -#include -#include "style_dump.h" +#include "style_dump.h" // IWYU pragma: keep + #include "atom.h" -#include "neighbor.h" -#include "input.h" -#include "variable.h" #include "comm.h" -#include "update.h" -#include "group.h" #include "domain.h" -#include "thermo.h" -#include "modify.h" -#include "force.h" #include "dump.h" -#include "write_restart.h" -#include "memory.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "force.h" +#include "group.h" +#include "info.h" +#include "input.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" +#include "thermo.h" +#include "update.h" +#include "variable.h" +#include "write_restart.h" + +#include using namespace LAMMPS_NS; @@ -58,30 +57,30 @@ Output::Output(LAMMPS *lmp) : Pointers(lmp) delete [] newarg; thermo_every = 0; - var_thermo = NULL; + var_thermo = nullptr; ndump = 0; max_dump = 0; - every_dump = NULL; - next_dump = NULL; - last_dump = NULL; - var_dump = NULL; - ivar_dump = NULL; - dump = NULL; + every_dump = nullptr; + next_dump = nullptr; + last_dump = nullptr; + var_dump = nullptr; + ivar_dump = nullptr; + dump = nullptr; restart_flag = restart_flag_single = restart_flag_double = 0; restart_every_single = restart_every_double = 0; last_restart = -1; - restart1 = restart2a = restart2b = NULL; - var_restart_single = var_restart_double = NULL; - restart = NULL; + restart1 = restart2a = restart2b = nullptr; + var_restart_single = var_restart_double = nullptr; + restart = nullptr; dump_map = new DumpCreatorMap(); #define DUMP_CLASS #define DumpStyle(key,Class) \ (*dump_map)[#key] = &dump_creator; -#include "style_dump.h" +#include "style_dump.h" // IWYU pragma: keep #undef DumpStyle #undef DUMP_CLASS } @@ -541,7 +540,7 @@ void Output::add_dump(int narg, char **arg) error->all(FLERR,"Reuse of dump ID"); int igroup = group->find(arg[1]); if (igroup == -1) error->all(FLERR,"Could not find dump group ID"); - if (force->inumeric(FLERR,arg[3]) <= 0) + if (utils::inumeric(FLERR,arg[3],false,lmp) <= 0) error->all(FLERR,"Invalid dump frequency"); // extend Dump list if necessary @@ -562,7 +561,7 @@ void Output::add_dump(int narg, char **arg) every_dump[ndump] = 0; last_dump[ndump] = -1; - var_dump[ndump] = NULL; + var_dump[ndump] = nullptr; ivar_dump[ndump] = -1; // create the Dump @@ -572,10 +571,10 @@ void Output::add_dump(int narg, char **arg) dump[ndump] = dump_creator(lmp, narg, arg); } else error->all(FLERR,utils::check_packages_for_style("dump",arg[2],lmp)); - every_dump[ndump] = force->inumeric(FLERR,arg[3]); + every_dump[ndump] = utils::inumeric(FLERR,arg[3],false,lmp); if (every_dump[ndump] <= 0) error->all(FLERR,"Illegal dump command"); last_dump[ndump] = -1; - var_dump[ndump] = NULL; + var_dump[ndump] = nullptr; ndump++; } @@ -643,7 +642,7 @@ void Output::delete_dump(char *id) int Output::find_dump(const char *id) { - if (id == NULL) return -1; + if (id == nullptr) return -1; int idump; for (idump = 0; idump < ndump; idump++) if (strcmp(id,dump[idump]->id) == 0) break; @@ -663,14 +662,14 @@ void Output::set_thermo(int narg, char **arg) // variable spaced thermo outputs to constant spaced ones. delete [] var_thermo; - var_thermo = NULL; + var_thermo = nullptr; if (strstr(arg[0],"v_") == arg[0]) { int n = strlen(&arg[0][2]) + 1; var_thermo = new char[n]; strcpy(var_thermo,&arg[0][2]); } else { - thermo_every = force->inumeric(FLERR,arg[0]); + thermo_every = utils::inumeric(FLERR,arg[0],false,lmp); if (thermo_every < 0) error->all(FLERR,"Illegal thermo command"); } } @@ -694,10 +693,10 @@ void Output::create_thermo(int narg, char **arg) error->warning(FLERR,"New thermo_style command, " "previous thermo_modify settings will be lost"); - // set thermo = NULL in case new Thermo throws an error + // set thermo = nullptr in case new Thermo throws an error delete thermo; - thermo = NULL; + thermo = nullptr; thermo = new Thermo(lmp,narg,arg); } @@ -714,7 +713,7 @@ void Output::create_restart(int narg, char **arg) int varflag = 0; if (strstr(arg[0],"v_") == arg[0]) varflag = 1; - else every = force->inumeric(FLERR,arg[0]); + else every = utils::inumeric(FLERR,arg[0],false,lmp); if (!varflag && every == 0) { if (narg != 1) error->all(FLERR,"Illegal restart command"); @@ -723,14 +722,14 @@ void Output::create_restart(int narg, char **arg) last_restart = -1; delete restart; - restart = NULL; + restart = nullptr; delete [] restart1; delete [] restart2a; delete [] restart2b; - restart1 = restart2a = restart2b = NULL; + restart1 = restart2a = restart2b = nullptr; delete [] var_restart_single; delete [] var_restart_double; - var_restart_single = var_restart_double = NULL; + var_restart_single = var_restart_double = nullptr; return; } @@ -756,7 +755,7 @@ void Output::create_restart(int narg, char **arg) delete [] restart1; restart1 = new char[n]; strcpy(restart1,arg[1]); - if (strchr(restart1,'*') == NULL) strcat(restart1,".*"); + if (strchr(restart1,'*') == nullptr) strcat(restart1,".*"); } if (nfile == 2) { @@ -819,28 +818,19 @@ void Output::create_restart(int narg, char **arg) void Output::memory_usage() { - bigint bytes = 0; - bytes += atom->memory_usage(); - bytes += neighbor->memory_usage(); - bytes += comm->memory_usage(); - bytes += update->memory_usage(); - bytes += force->memory_usage(); - bytes += modify->memory_usage(); - for (int i = 0; i < ndump; i++) bytes += dump[i]->memory_usage(); + double meminfo[3]; + Info info(lmp); - double mbytes = bytes/1024.0/1024.0; - double mbavg,mbmin,mbmax; + info.get_memory_info(meminfo); + double mbytes = meminfo[0]; + double mbmin,mbavg,mbmax; MPI_Reduce(&mbytes,&mbavg,1,MPI_DOUBLE,MPI_SUM,0,world); MPI_Reduce(&mbytes,&mbmin,1,MPI_DOUBLE,MPI_MIN,0,world); MPI_Reduce(&mbytes,&mbmax,1,MPI_DOUBLE,MPI_MAX,0,world); + mbavg /= comm->nprocs; - if (comm->me == 0) { - mbavg /= comm->nprocs; - if (screen) - fprintf(screen,"Per MPI rank memory allocation (min/avg/max) = " - "%.4g | %.4g | %.4g Mbytes\n",mbmin,mbavg,mbmax); - if (logfile) - fprintf(logfile,"Per MPI rank memory allocation (min/avg/max) = " - "%.4g | %.4g | %.4g Mbytes\n",mbmin,mbavg,mbmax); - } + if (comm->me == 0) + utils::logmesg(lmp,fmt::format("Per MPI rank memory allocation (min/avg/" + "max) = {:.4} | {:.4} | {:.4} Mbytes\n", + mbmin,mbavg,mbmax)); } diff --git a/src/output.h b/src/output.h index 1bf4128ee0..1af03df228 100644 --- a/src/output.h +++ b/src/output.h @@ -15,11 +15,13 @@ #define LMP_OUTPUT_H #include "pointers.h" + #include -#include namespace LAMMPS_NS { +class Dump; + class Output : protected Pointers { public: bigint next; // next timestep for any kind of output @@ -27,7 +29,7 @@ class Output : protected Pointers { bigint next_thermo; // next timestep for thermo output int thermo_every; // output freq for thermo, 0 if first/last only bigint last_thermo; // last timestep thermo was output - char *var_thermo; // variable name for thermo freq, NULL if every + char *var_thermo; // variable name for thermo freq, null pointer if every int ivar_thermo; // variable index for thermo frequency class Thermo *thermo; // Thermodynamic computations @@ -39,7 +41,7 @@ class Output : protected Pointers { bigint *last_dump; // last timestep each snapshot was output char **var_dump; // variable name for dump frequency int *ivar_dump; // variable index for dump frequency - class Dump **dump; // list of defined Dumps + Dump **dump; // list of defined Dumps int restart_flag; // 1 if any restart files are written int restart_flag_single; // 1 if single restart files are written diff --git a/src/pair.cpp b/src/pair.cpp index 432680b324..60a5c0d8bf 100644 --- a/src/pair.cpp +++ b/src/pair.cpp @@ -16,28 +16,26 @@ ------------------------------------------------------------------------- */ #include "pair.h" -#include + +#include "atom.h" +#include "atom_masks.h" +#include "comm.h" +#include "compute.h" +#include "domain.h" +#include "error.h" +#include "force.h" +#include "kspace.h" +#include "math_const.h" +#include "memory.h" +#include "neighbor.h" +#include "suffix.h" +#include "update.h" + #include // IWYU pragma: keep #include // IWYU pragma: keep #include #include #include -#include -#include "atom.h" -#include "neighbor.h" -#include "domain.h" -#include "comm.h" -#include "force.h" -#include "kspace.h" -#include "compute.h" -#include "suffix.h" -#include "atom_masks.h" -#include "memory.h" -#include "math_const.h" -#include "error.h" -#include "update.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -69,12 +67,12 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) unit_convert_flag = utils::NOCONVERT; nextra = 0; - pvector = NULL; + pvector = nullptr; single_extra = 0; - svector = NULL; + svector = nullptr; - setflag = NULL; - cutsq = NULL; + setflag = nullptr; + cutsq = nullptr; ewaldflag = pppmflag = msmflag = dispersionflag = tip4pflag = dipoleflag = spinflag = 0; reinitflag = 1; @@ -86,25 +84,26 @@ Pair::Pair(LAMMPS *lmp) : Pointers(lmp) manybody_flag = 0; offset_flag = 0; mix_flag = GEOMETRIC; + mixed_flag = 1; tail_flag = 0; etail = ptail = etail_ij = ptail_ij = 0.0; ncoultablebits = 12; ndisptablebits = 12; tabinner = sqrt(2.0); tabinner_disp = sqrt(2.0); - ftable = NULL; - fdisptable = NULL; + ftable = nullptr; + fdisptable = nullptr; allocated = 0; suffix_flag = Suffix::NONE; maxeatom = maxvatom = maxcvatom = 0; - eatom = NULL; - vatom = NULL; - cvatom = NULL; + eatom = nullptr; + vatom = nullptr; + cvatom = nullptr; num_tally_compute = 0; - list_tally_compute = NULL; + list_tally_compute = nullptr; nondefault_history_transfer = 0; beyond_contact = 0; @@ -124,7 +123,7 @@ Pair::~Pair() { num_tally_compute = 0; memory->sfree((void *) list_tally_compute); - list_tally_compute = NULL; + list_tally_compute = nullptr; if (copymode) return; @@ -160,23 +159,23 @@ void Pair::modify_params(int narg, char **arg) iarg += 2; } else if (strcmp(arg[iarg],"table") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - ncoultablebits = force->inumeric(FLERR,arg[iarg+1]); + ncoultablebits = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ncoultablebits > (int)sizeof(float)*CHAR_BIT) error->all(FLERR,"Too many total bits for bitmapped lookup table"); iarg += 2; } else if (strcmp(arg[iarg],"table/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - ndisptablebits = force->inumeric(FLERR,arg[iarg+1]); + ndisptablebits = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (ndisptablebits > (int)sizeof(float)*CHAR_BIT) error->all(FLERR,"Too many total bits for bitmapped lookup table"); iarg += 2; } else if (strcmp(arg[iarg],"tabinner") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - tabinner = force->numeric(FLERR,arg[iarg+1]); + tabinner = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tabinner/disp") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); - tabinner_disp = force->numeric(FLERR,arg[iarg+1]); + tabinner_disp = utils::numeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"tail") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal pair_modify command"); @@ -251,10 +250,12 @@ void Pair::init() cutforce = 0.0; etail = ptail = 0.0; + mixed_flag = 1; double cut; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { + if ((i != j) && setflag[i][j]) mixed_flag = 0; cut = init_one(i,j); cutsq[i][j] = cutsq[j][i] = cut*cut; cutforce = MAX(cutforce,cut); @@ -330,7 +331,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) double r,grij,expm2,derfc,egamma,fgamma,rsw; double qqrd2e = force->qqrd2e; - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); double g_ewald = force->kspace->g_ewald; @@ -358,8 +359,8 @@ void Pair::init_tables(double cut_coul, double *cut_respa) memory->create(dctable,ntable,"pair:dctable"); memory->create(detable,ntable,"pair:detable"); - if (cut_respa == NULL) { - vtable = ptable = dvtable = dptable = NULL; + if (cut_respa == nullptr) { + vtable = ptable = dvtable = dptable = nullptr; } else { memory->create(vtable,ntable,"pair:vtable"); memory->create(ptable,ntable,"pair:ptable"); @@ -390,7 +391,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) expm2 = exp(-grij*grij); derfc = erfc(grij); } - if (cut_respa == NULL) { + if (cut_respa == nullptr) { rtable[i] = rsq_lookup.f; ctable[i] = qqrd2e/r; if (msmflag) { @@ -487,7 +488,7 @@ void Pair::init_tables(double cut_coul, double *cut_respa) expm2 = exp(-grij*grij); derfc = erfc(grij); } - if (cut_respa == NULL) { + if (cut_respa == nullptr) { c_tmp = qqrd2e/r; if (msmflag) { f_tmp = qqrd2e/r * fgamma; @@ -1619,12 +1620,12 @@ void Pair::write_file(int narg, char **arg) // parse arguments - int itype = force->inumeric(FLERR,arg[0]); - int jtype = force->inumeric(FLERR,arg[1]); + int itype = utils::inumeric(FLERR,arg[0],false,lmp); + int jtype = utils::inumeric(FLERR,arg[1],false,lmp); if (itype < 1 || itype > atom->ntypes || jtype < 1 || jtype > atom->ntypes) error->all(FLERR,"Invalid atom types in pair_write command"); - int n = force->inumeric(FLERR,arg[2]); + int n = utils::inumeric(FLERR,arg[2],false,lmp); int style = NONE; if (strcmp(arg[3],"r") == 0) style = RLINEAR; @@ -1632,8 +1633,8 @@ void Pair::write_file(int narg, char **arg) else if (strcmp(arg[3],"bitmap") == 0) style = BMP; else error->all(FLERR,"Invalid style in pair_write command"); - double inner = force->numeric(FLERR,arg[4]); - double outer = force->numeric(FLERR,arg[5]); + double inner = utils::numeric(FLERR,arg[4],false,lmp); + double outer = utils::numeric(FLERR,arg[5],false,lmp); if (inner <= 0.0 || inner >= outer) error->all(FLERR,"Invalid cutoffs in pair_write command"); @@ -1663,7 +1664,7 @@ void Pair::write_file(int narg, char **arg) fp = fopen(table_file.c_str(),"a"); } else { char datebuf[16]; - time_t tv = time(NULL); + time_t tv = time(nullptr); strftime(datebuf,15,"%Y-%m-%d",localtime(&tv)); utils::logmesg(lmp,fmt::format("Creating table file {} with " "DATE: {}\n", table_file, datebuf)); @@ -1671,7 +1672,7 @@ void Pair::write_file(int narg, char **arg) if (fp) fmt::print(fp,"# DATE: {} UNITS: {} Created by pair_write\n", datebuf, update->unit_style); } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open pair_write file {}: {}", table_file, utils::getsyserror())); fprintf(fp,"# Pair potential %s for atom types %d %d: i,r,energy,force\n", @@ -1706,8 +1707,8 @@ void Pair::write_file(int narg, char **arg) double q[2]; q[0] = q[1] = 1.0; if (narg == 10) { - q[0] = force->numeric(FLERR,arg[8]); - q[1] = force->numeric(FLERR,arg[9]); + q[0] = utils::numeric(FLERR,arg[8],false,lmp); + q[1] = utils::numeric(FLERR,arg[9],false,lmp); } double *q_hold; diff --git a/src/pair.h b/src/pair.h index 0664e97462..ace233539f 100644 --- a/src/pair.h +++ b/src/pair.h @@ -105,6 +105,7 @@ class Pair : protected Pointers { int allocated; // 0/1 = whether arrays are allocated // public so external driver can check int compute_flag; // 0 if skip compute() + int mixed_flag; // 1 if all itype != jtype coeffs are from mixing enum{GEOMETRIC,ARITHMETIC,SIXTHPOWER}; // mixing options @@ -196,7 +197,7 @@ class Pair : protected Pointers { // specific child-class methods for certain Pair styles - virtual void *extract(const char *, int &) {return NULL;} + virtual void *extract(const char *, int &) {return nullptr;} virtual void swap_eam(double *, double **) {} virtual void reset_dt() {} virtual void min_xf_pointers(int, double **, double **) {} diff --git a/src/pair_beck.cpp b/src/pair_beck.cpp index 31dd2ef62f..777c7e4c48 100644 --- a/src/pair_beck.cpp +++ b/src/pair_beck.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_beck.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "memory.h" #include "error.h" #include "math_special.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathSpecial; @@ -132,6 +132,7 @@ void PairBeck::compute(int eflag, int vflag) term1inv = 1.0/term1; evdwl = AA[itype][jtype]*exp(-1.0*r*term4); evdwl -= BB[itype][jtype]*term6*(1.0+(2.709+3.0*aaij*aaij)*term1inv); + evdwl *= factor_lj; } if (evflag) ev_tally(i,j,nlocal,newton_pair, @@ -175,7 +176,7 @@ void PairBeck::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -198,17 +199,17 @@ void PairBeck::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double AA_one = force->numeric(FLERR,arg[2]); - double BB_one = force->numeric(FLERR,arg[3]); - double aa_one = force->numeric(FLERR,arg[4]); - double alpha_one = force->numeric(FLERR,arg[5]); - double beta_one = force->numeric(FLERR,arg[6]); + double AA_one = utils::numeric(FLERR,arg[2],false,lmp); + double BB_one = utils::numeric(FLERR,arg[3],false,lmp); + double aa_one = utils::numeric(FLERR,arg[4],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[5],false,lmp); + double beta_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -280,16 +281,16 @@ void PairBeck::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&AA[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&BB[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&aa[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&beta[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&AA[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&BB[i][j],1,MPI_DOUBLE,0,world); @@ -319,8 +320,8 @@ void PairBeck::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/pair_born.cpp b/src/pair_born.cpp index b0aba57df5..fee494fd9c 100644 --- a/src/pair_born.cpp +++ b/src/pair_born.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_born.h" -#include + #include #include #include "atom.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -177,7 +177,7 @@ void PairBorn::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -199,18 +199,18 @@ void PairBorn::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_one = cut_global; - if (narg == 8) cut_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -330,16 +330,16 @@ void PairBorn::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -370,10 +370,10 @@ void PairBorn::write_restart_settings(FILE *fp) void PairBorn::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -433,5 +433,5 @@ void *PairBorn::extract(const char *str, int &dim) if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; if (strcmp(str,"d") == 0) return (void *) d; - return NULL; + return nullptr; } diff --git a/src/pair_born_coul_dsf.cpp b/src/pair_born_coul_dsf.cpp index 3e8c76696b..abe3d1e071 100644 --- a/src/pair_born_coul_dsf.cpp +++ b/src/pair_born_coul_dsf.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_born_coul_dsf.h" -#include + #include #include "atom.h" #include "comm.h" @@ -28,7 +28,7 @@ #include "memory.h" #include "error.h" #include "math_special.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -216,10 +216,10 @@ void PairBornCoulDSF::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alpha = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + alpha = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); if (allocated) { int i,j; @@ -240,18 +240,18 @@ void PairBornCoulDSF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -361,16 +361,16 @@ void PairBornCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -402,11 +402,11 @@ void PairBornCoulDSF::write_restart_settings(FILE *fp) void PairBornCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_born_coul_wolf.cpp b/src/pair_born_coul_wolf.cpp index dc4e4b8e3f..a873ec6c62 100644 --- a/src/pair_born_coul_wolf.cpp +++ b/src/pair_born_coul_wolf.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_born_coul_wolf.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -219,10 +219,10 @@ void PairBornCoulWolf::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alf = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + alf = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); if (allocated) { int i,j; @@ -243,18 +243,18 @@ void PairBornCoulWolf::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); - double sigma_one = force->numeric(FLERR,arg[4]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[4],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[5]); - double d_one = force->numeric(FLERR,arg[6]); + double c_one = utils::numeric(FLERR,arg[5],false,lmp); + double d_one = utils::numeric(FLERR,arg[6],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 8) cut_lj_one = force->numeric(FLERR,arg[7]); + if (narg == 8) cut_lj_one = utils::numeric(FLERR,arg[7],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -360,16 +360,16 @@ void PairBornCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&d[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -401,11 +401,11 @@ void PairBornCoulWolf::write_restart_settings(FILE *fp) void PairBornCoulWolf::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_buck.cpp b/src/pair_buck.cpp index 6fc1c782e0..6de115a0e5 100644 --- a/src/pair_buck.cpp +++ b/src/pair_buck.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_buck.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -169,7 +169,7 @@ void PairBuck::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -192,16 +192,16 @@ void PairBuck::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -309,14 +309,14 @@ void PairBuck::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -345,10 +345,10 @@ void PairBuck::write_restart_settings(FILE *fp) void PairBuck::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -405,5 +405,5 @@ void *PairBuck::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"a") == 0) return (void *) a; if (strcmp(str,"c") == 0) return (void *) c; - return NULL; + return nullptr; } diff --git a/src/pair_buck_coul_cut.cpp b/src/pair_buck_coul_cut.cpp index de36b58df2..9cc90ebc81 100644 --- a/src/pair_buck_coul_cut.cpp +++ b/src/pair_buck_coul_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_buck_coul_cut.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -197,9 +197,9 @@ void PairBuckCoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -225,18 +225,18 @@ void PairBuckCoulCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double rho_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double rho_one = utils::numeric(FLERR,arg[3],false,lmp); if (rho_one <= 0) error->all(FLERR,"Incorrect args for pair coefficients"); - double c_one = force->numeric(FLERR,arg[4]); + double c_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 6) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[5]); - if (narg == 7) cut_coul_one = force->numeric(FLERR,arg[6]); + if (narg >= 6) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[5],false,lmp); + if (narg == 7) cut_coul_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -364,15 +364,15 @@ void PairBuckCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&rho[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&c[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&rho[i][j],1,MPI_DOUBLE,0,world); @@ -403,11 +403,11 @@ void PairBuckCoulCut::write_restart_settings(FILE *fp) void PairBuckCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_coul_cut.cpp b/src/pair_coul_cut.cpp index a197955085..5aa281190e 100644 --- a/src/pair_coul_cut.cpp +++ b/src/pair_coul_cut.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_cut.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -149,7 +149,7 @@ void PairCoulCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -172,11 +172,11 @@ void PairCoulCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (narg == 3) cut_one = force->numeric(FLERR,arg[2]); + if (narg == 3) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -247,10 +247,10 @@ void PairCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { - if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } } @@ -274,9 +274,9 @@ void PairCoulCut::write_restart_settings(FILE *fp) void PairCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -307,5 +307,5 @@ void *PairCoulCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"cut_coul") == 0) return (void *) &cut; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/pair_coul_debye.cpp b/src/pair_coul_debye.cpp index b45353837a..31838fbee5 100644 --- a/src/pair_coul_debye.cpp +++ b/src/pair_coul_debye.cpp @@ -12,14 +12,14 @@ ------------------------------------------------------------------------- */ #include "pair_coul_debye.h" -#include + #include #include "atom.h" #include "comm.h" #include "force.h" #include "neigh_list.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -114,8 +114,8 @@ void PairCoulDebye::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -146,10 +146,10 @@ void PairCoulDebye::write_restart_settings(FILE *fp) void PairCoulDebye::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&kappa,1,MPI_DOUBLE,0,world); diff --git a/src/pair_coul_dsf.cpp b/src/pair_coul_dsf.cpp index 992ee33ecb..94106405b0 100644 --- a/src/pair_coul_dsf.cpp +++ b/src/pair_coul_dsf.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_dsf.h" -#include + #include #include #include "atom.h" @@ -28,7 +28,7 @@ #include "memory.h" #include "math_const.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -171,8 +171,8 @@ void PairCoulDSF::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - alpha = force->numeric(FLERR,arg[0]); - cut_coul = force->numeric(FLERR,arg[1]); + alpha = utils::numeric(FLERR,arg[0],false,lmp); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- @@ -185,8 +185,8 @@ void PairCoulDSF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -254,7 +254,7 @@ void PairCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -278,10 +278,10 @@ void PairCoulDSF::write_restart_settings(FILE *fp) void PairCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); @@ -327,5 +327,5 @@ void *PairCoulDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/pair_coul_streitz.cpp b/src/pair_coul_streitz.cpp index 2d4e7b4b35..6fb7d63a86 100644 --- a/src/pair_coul_streitz.cpp +++ b/src/pair_coul_streitz.cpp @@ -16,22 +16,22 @@ ------------------------------------------------------------------------- */ #include "pair_coul_streitz.h" -#include -#include -#include -#include + #include "atom.h" #include "comm.h" +#include "error.h" #include "force.h" #include "kspace.h" -#include "neighbor.h" -#include "neigh_list.h" -#include "neigh_request.h" #include "math_const.h" #include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "neigh_list.h" +#include "neigh_request.h" +#include "neighbor.h" +#include "potential_file_reader.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -51,11 +51,11 @@ PairCoulStreitz::PairCoulStreitz(LAMMPS *lmp) : Pair(lmp) nmax = 0; nelements = 0; - elements = NULL; + elements = nullptr; nparams = 0; maxparam = 0; - params = NULL; - elem2param = NULL; + params = nullptr; + elem2param = nullptr; } /* ---------------------------------------------------------------------- @@ -111,11 +111,11 @@ void PairCoulStreitz::settings(int narg, char **arg) { if (narg < 2) error->all(FLERR,"Illegal pair_style command"); - cut_coul = force->numeric(FLERR,arg[0]); + cut_coul = utils::numeric(FLERR,arg[0],false,lmp); if (strcmp(arg[1],"wolf") == 0){ kspacetype = 1; - g_wolf = force->numeric(FLERR,arg[2]); + g_wolf = utils::numeric(FLERR,arg[2],false,lmp); } else if (strcmp(arg[1],"ewald") == 0){ ewaldflag = pppmflag = 1; kspacetype = 2; @@ -143,7 +143,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) error->all(FLERR,"Incorrect args for pair coefficients"); // read args that map atom types to elements in potential file - // map[i] = which element the Ith atom type is, -1 if NULL + // map[i] = which element the Ith atom type is, -1 if "NULL" // nelements = # of unique elements // elements = list of element names @@ -152,7 +152,7 @@ void PairCoulStreitz::coeff(int narg, char **arg) delete [] elements; } elements = new char*[atom->ntypes]; - for (i = 0; i < atom->ntypes; i++) elements[i] = NULL; + for (i = 0; i < atom->ntypes; i++) elements[i] = nullptr; nelements = 0; for (i = 3; i < narg; i++) { @@ -215,7 +215,7 @@ void PairCoulStreitz::init_style() // insure use of KSpace long-range solver when ewald specified, set g_ewald if (ewaldflag) { - if (force->kspace == NULL) + if (force->kspace == nullptr) error->all(FLERR,"Pair style requires a KSpace style"); g_ewald = force->kspace->g_ewald; } @@ -237,109 +237,71 @@ double PairCoulStreitz::init_one(int i, int j) void PairCoulStreitz::read_file(char *file) { - int params_per_line = 6; - char **words = new char*[params_per_line+1]; - memory->sfree(params); - params = NULL; + params = nullptr; nparams = 0; maxparam = 0; // open file on proc 0 - - FILE *fp; if (comm->me == 0) { - fp = force->open_potential(file); - if (fp == NULL) - error->one(FLERR,fmt::format("Cannot open coul/streitz potential " - "file {}",file)); - } + PotentialFileReader reader(lmp, file, "coul/streitz"); + char * line; - // read each line out of file, skipping blank lines or leading '#' - // store line of params if all 3 element tags are in element list + while((line = reader.next_line(NPARAMS_PER_LINE))) { + try { + ValueTokenizer values(line); - int n,nwords,ielement; - char line[MAXLINE],*ptr; - int eof = 0; + std::string iname = values.next_string(); - while (1) { - if (comm->me == 0) { - ptr = fgets(line,MAXLINE,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; - } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); + // ielement = 1st args + int ielement; - // strip comment, skip line if blank + for (ielement = 0; ielement < nelements; ielement++) + if (iname == elements[ielement]) break; - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nwords = utils::count_words(line); - if (nwords == 0) continue; + // load up parameter settings and error check their values - // concatenate additional lines until have params_per_line words + if (nparams == maxparam) { + maxparam += DELTA; + params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), + "pair:params"); - while (nwords < params_per_line) { - n = strlen(line); - if (comm->me == 0) { - ptr = fgets(&line[n],MAXLINE-n,fp); - if (ptr == NULL) { - eof = 1; - fclose(fp); - } else n = strlen(line) + 1; + // make certain all addional allocated storage is initialized + // to avoid false positives when checking with valgrind + + memset(params + nparams, 0, DELTA*sizeof(Param)); + } + + + params[nparams].ielement = ielement; + params[nparams].chi = values.next_double(); + params[nparams].eta = values.next_double(); + params[nparams].gamma = values.next_double(); + params[nparams].zeta = values.next_double(); + params[nparams].zcore = values.next_double(); + + } catch (TokenizerException &e) { + error->one(FLERR, e.what()); } - MPI_Bcast(&eof,1,MPI_INT,0,world); - if (eof) break; - MPI_Bcast(&n,1,MPI_INT,0,world); - MPI_Bcast(line,n,MPI_CHAR,0,world); - if ((ptr = strchr(line,'#'))) *ptr = '\0'; - nwords = utils::count_words(line); + + // parameter sanity check + + if (params[nparams].eta < 0.0 || params[nparams].zeta < 0.0 || + params[nparams].zcore < 0.0 || params[nparams].gamma != 0.0 ) + error->one(FLERR,"Illegal coul/streitz parameter"); + + nparams++; } - - if (nwords != params_per_line) - error->all(FLERR,"Incorrect format in coul/streitz potential file"); - - // words = ptrs to all words in line - - nwords = 0; - words[nwords++] = strtok(line," \t\n\r\f"); - while ((words[nwords++] = strtok(NULL," \t\n\r\f"))) continue; - - // ielement = 1st args - - for (ielement = 0; ielement < nelements; ielement++) - if (strcmp(words[0],elements[ielement]) == 0) break; - if (ielement == nelements) continue; - - // load up parameter settings and error check their values - - if (nparams == maxparam) { - maxparam += DELTA; - params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), - "pair:params"); - } - - params[nparams].ielement = ielement; - params[nparams].chi = atof(words[1]); - params[nparams].eta = atof(words[2]); - params[nparams].gamma = atof(words[3]); - params[nparams].zeta = atof(words[4]); - params[nparams].zcore = atof(words[5]); - - // parameter sanity check - - if (params[nparams].eta < 0.0 || params[nparams].zeta < 0.0 || - params[nparams].zcore < 0.0 || params[nparams].gamma != 0.0 ) - error->all(FLERR,"Illegal coul/streitz parameter"); - - nparams++; } - delete [] words; + MPI_Bcast(&nparams, 1, MPI_INT, 0, world); + MPI_Bcast(&maxparam, 1, MPI_INT, 0, world); + + if(comm->me != 0) { + params = (Param *) memory->srealloc(params,maxparam*sizeof(Param), "pair:params"); + } + + MPI_Bcast(params, maxparam*sizeof(Param), MPI_BYTE, 0, world); } /* ---------------------------------------------------------------------- */ @@ -837,5 +799,5 @@ void *PairCoulStreitz::extract(const char *str, int &dim) if (kspacetype == 1) return (void *) &g_wolf; if (kspacetype == 2) return (void *) &g_ewald; } - return NULL; + return nullptr; } diff --git a/src/pair_coul_streitz.h b/src/pair_coul_streitz.h index 0f23c111c7..d5a4a2de5c 100644 --- a/src/pair_coul_streitz.h +++ b/src/pair_coul_streitz.h @@ -36,6 +36,8 @@ class PairCoulStreitz : public Pair { double memory_usage(); virtual void *extract(const char *, int &); + static const int NPARAMS_PER_LINE = 6; + protected: struct Param { double chi, eta, gamma, zeta, zcore; diff --git a/src/pair_coul_wolf.cpp b/src/pair_coul_wolf.cpp index b34877f508..994e74fc90 100644 --- a/src/pair_coul_wolf.cpp +++ b/src/pair_coul_wolf.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_coul_wolf.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -172,8 +172,8 @@ void PairCoulWolf::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - alf = force->numeric(FLERR,arg[0]); - cut_coul = force->numeric(FLERR,arg[1]); + alf = utils::numeric(FLERR,arg[0],false,lmp); + cut_coul = utils::numeric(FLERR,arg[1],false,lmp); } /* ---------------------------------------------------------------------- @@ -186,8 +186,8 @@ void PairCoulWolf::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -250,7 +250,7 @@ void PairCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); } } @@ -274,10 +274,10 @@ void PairCoulWolf::write_restart_settings(FILE *fp) void PairCoulWolf::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul,1,MPI_DOUBLE,0,world); diff --git a/src/pair_deprecated.cpp b/src/pair_deprecated.cpp index 75cb7efcdf..046726892e 100644 --- a/src/pair_deprecated.cpp +++ b/src/pair_deprecated.cpp @@ -16,12 +16,12 @@ ------------------------------------------------------------------------- */ #include "pair_deprecated.h" -#include + #include "pair_hybrid.h" #include "comm.h" #include "force.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; diff --git a/src/pair_dpd.cpp b/src/pair_dpd.cpp index ef0b7dd21d..d92f4b7cca 100644 --- a/src/pair_dpd.cpp +++ b/src/pair_dpd.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_dpd.h" -#include + #include #include "atom.h" #include "comm.h" @@ -27,7 +27,7 @@ #include "random_mars.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -38,7 +38,7 @@ using namespace LAMMPS_NS; PairDPD::PairDPD(LAMMPS *lmp) : Pair(lmp) { writedata = 1; - random = NULL; + random = nullptr; } /* ---------------------------------------------------------------------- */ @@ -190,9 +190,9 @@ void PairDPD::settings(int narg, char **arg) { if (narg != 3) error->all(FLERR,"Illegal pair_style command"); - temperature = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); - seed = force->inumeric(FLERR,arg[2]); + temperature = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); + seed = utils::inumeric(FLERR,arg[2],false,lmp); // initialize Marsaglia RNG with processor-unique seed @@ -221,14 +221,14 @@ void PairDPD::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a0_one = force->numeric(FLERR,arg[2]); - double gamma_one = force->numeric(FLERR,arg[3]); + double a0_one = utils::numeric(FLERR,arg[2],false,lmp); + double gamma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -314,13 +314,13 @@ void PairDPD::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); @@ -348,10 +348,10 @@ void PairDPD::write_restart_settings(FILE *fp) void PairDPD::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&temperature,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&temperature,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&temperature,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_dpd_tstat.cpp b/src/pair_dpd_tstat.cpp index 8366ff459f..4b9c186dab 100644 --- a/src/pair_dpd_tstat.cpp +++ b/src/pair_dpd_tstat.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_dpd_tstat.h" -#include + #include #include "atom.h" #include "update.h" @@ -21,7 +21,7 @@ #include "comm.h" #include "random_mars.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -142,10 +142,10 @@ void PairDPDTstat::settings(int narg, char **arg) { if (narg != 4) error->all(FLERR,"Illegal pair_style command"); - t_start = force->numeric(FLERR,arg[0]); - t_stop = force->numeric(FLERR,arg[1]); - cut_global = force->numeric(FLERR,arg[2]); - seed = force->inumeric(FLERR,arg[3]); + t_start = utils::numeric(FLERR,arg[0],false,lmp); + t_stop = utils::numeric(FLERR,arg[1],false,lmp); + cut_global = utils::numeric(FLERR,arg[2],false,lmp); + seed = utils::inumeric(FLERR,arg[3],false,lmp); temperature = t_start; @@ -176,14 +176,14 @@ void PairDPDTstat::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double a0_one = 0.0; - double gamma_one = force->numeric(FLERR,arg[2]); + double gamma_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -232,12 +232,12 @@ void PairDPDTstat::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&gamma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&gamma[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -265,11 +265,11 @@ void PairDPDTstat::write_restart_settings(FILE *fp) void PairDPDTstat::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&t_start,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&t_stop,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&seed,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&t_start,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&t_stop,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&seed,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&t_start,1,MPI_DOUBLE,0,world); MPI_Bcast(&t_stop,1,MPI_DOUBLE,0,world); diff --git a/src/pair_gauss.cpp b/src/pair_gauss.cpp index dcc3ac5f51..39c8caa732 100644 --- a/src/pair_gauss.cpp +++ b/src/pair_gauss.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_gauss.h" -#include + #include #include #include "atom.h" @@ -25,7 +25,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -164,7 +164,7 @@ void PairGauss::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -187,14 +187,14 @@ void PairGauss::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); - double b_one = force->numeric(FLERR,arg[3]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); + double b_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -280,13 +280,13 @@ void PairGauss::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&b[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&b[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&b[i][j],1,MPI_DOUBLE,0,world); @@ -313,9 +313,9 @@ void PairGauss::write_restart_settings(FILE *fp) void PairGauss::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -361,5 +361,5 @@ void *PairGauss::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"a") == 0) return (void *) a; - return NULL; + return nullptr; } diff --git a/src/pair_hybrid.cpp b/src/pair_hybrid.cpp index 646ddefc3e..7f7f795b80 100644 --- a/src/pair_hybrid.cpp +++ b/src/pair_hybrid.cpp @@ -13,7 +13,7 @@ ------------------------------------------------------------------------- */ #include "pair_hybrid.h" -#include + #include #include #include "atom.h" @@ -26,17 +26,17 @@ #include "memory.h" #include "error.h" #include "respa.h" -#include "utils.h" + #include "suffix.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ PairHybrid::PairHybrid(LAMMPS *lmp) : Pair(lmp), - styles(NULL), keywords(NULL), multiple(NULL), nmap(NULL), - map(NULL), special_lj(NULL), special_coul(NULL), compute_tally(NULL) + styles(nullptr), keywords(nullptr), multiple(nullptr), nmap(nullptr), + map(nullptr), special_lj(nullptr), special_coul(nullptr), compute_tally(nullptr) { nstyles = 0; @@ -116,7 +116,7 @@ void PairHybrid::compute(int eflag, int vflag) // check if we are running with r-RESPA using the hybrid keyword - Respa *respa = NULL; + Respa *respa = nullptr; respaflag = 0; if (strstr(update->integrate_style,"respa")) { respa = (Respa *) update->integrate; @@ -324,7 +324,7 @@ void PairHybrid::settings(int narg, char **arg) styles[nstyles] = force->new_pair(arg[iarg],1,dummy); force->store_style(keywords[nstyles],arg[iarg],0); - special_lj[nstyles] = special_coul[nstyles] = NULL; + special_lj[nstyles] = special_coul[nstyles] = nullptr; compute_tally[nstyles] = 1; // determine list of arguments for pair style settings @@ -438,8 +438,8 @@ void PairHybrid::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // 3rd arg = pair sub-style name // 4th arg = pair sub-style index if name used multiple times @@ -456,7 +456,7 @@ void PairHybrid::coeff(int narg, char **arg) if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients"); if (!isdigit(arg[3][0])) error->all(FLERR,"Incorrect args for pair coefficients"); - int index = force->inumeric(FLERR,arg[3]); + int index = utils::inumeric(FLERR,arg[3],false,lmp); if (index == multiple[m]) break; else continue; } else break; @@ -706,10 +706,10 @@ void PairHybrid::write_restart(FILE *fp) fwrite(keywords[m],sizeof(char),n,fp); styles[m]->write_restart_settings(fp); // write out per style special settings, if present - n = (special_lj[m] == NULL) ? 0 : 1; + n = (special_lj[m] == nullptr) ? 0 : 1; fwrite(&n,sizeof(int),1,fp); if (n) fwrite(special_lj[m],sizeof(double),4,fp); - n = (special_coul[m] == NULL) ? 0 : 1; + n = (special_coul[m] == nullptr) ? 0 : 1; fwrite(&n,sizeof(int),1,fp); if (n) fwrite(special_coul[m],sizeof(double),4,fp); } @@ -722,7 +722,7 @@ void PairHybrid::write_restart(FILE *fp) void PairHybrid::read_restart(FILE *fp) { int me = comm->me; - if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&nstyles,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&nstyles,1,MPI_INT,0,world); // allocate list of sub-styles @@ -745,32 +745,32 @@ void PairHybrid::read_restart(FILE *fp) // each sub-style is created via new_pair() // each reads its settings, but no coeff info - if (me == 0) utils::sfread(FLERR,compute_tally,sizeof(int),nstyles,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,compute_tally,sizeof(int),nstyles,fp,nullptr,error); MPI_Bcast(compute_tally,nstyles,MPI_INT,0,world); int n,dummy; for (int m = 0; m < nstyles; m++) { - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); keywords[m] = new char[n]; - if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,keywords[m],sizeof(char),n,fp,nullptr,error); MPI_Bcast(keywords[m],n,MPI_CHAR,0,world); styles[m] = force->new_pair(keywords[m],1,dummy); styles[m]->read_restart_settings(fp); // read back per style special settings, if present - special_lj[m] = special_coul[m] = NULL; - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + special_lj[m] = special_coul[m] = nullptr; + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n > 0 ) { special_lj[m] = new double[4]; - if (me == 0) utils::sfread(FLERR,special_lj[m],sizeof(double),4,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,special_lj[m],sizeof(double),4,fp,nullptr,error); MPI_Bcast(special_lj[m],4,MPI_DOUBLE,0,world); } - if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); MPI_Bcast(&n,1,MPI_INT,0,world); if (n > 0 ) { special_coul[m] = new double[4]; - if (me == 0) utils::sfread(FLERR,special_coul[m],sizeof(double),4,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,special_coul[m],sizeof(double),4,fp,nullptr,error); MPI_Bcast(special_coul[m],4,MPI_DOUBLE,0,world); } } @@ -813,8 +813,8 @@ double PairHybrid::single(int i, int j, int itype, int jtype, if (styles[map[itype][jtype][m]]->single_enable == 0) error->one(FLERR,"Pair hybrid sub-style does not support single call"); - if ((special_lj[map[itype][jtype][m]] != NULL) || - (special_coul[map[itype][jtype][m]] != NULL)) + if ((special_lj[map[itype][jtype][m]] != nullptr) || + (special_coul[map[itype][jtype][m]] != nullptr)) error->one(FLERR,"Pair hybrid single calls do not support" " per sub-style special bond values"); @@ -864,7 +864,7 @@ void PairHybrid::modify_params(int narg, char **arg) if (multiple[m]) { if (narg < 3) error->all(FLERR,"Illegal pair_modify command"); - int multiflag = force->inumeric(FLERR,arg[2]); + int multiflag = utils::inumeric(FLERR,arg[2],false,lmp); for (m = 0; m < nstyles; m++) if (strcmp(arg[1],keywords[m]) == 0 && multiflag == multiple[m]) break; if (m == nstyles) @@ -934,9 +934,9 @@ void PairHybrid::modify_special(int m, int /*narg*/, char **arg) int i; special[0] = 1.0; - special[1] = force->numeric(FLERR,arg[1]); - special[2] = force->numeric(FLERR,arg[2]); - special[3] = force->numeric(FLERR,arg[3]); + special[1] = utils::numeric(FLERR,arg[1],false,lmp); + special[2] = utils::numeric(FLERR,arg[2],false,lmp); + special[3] = utils::numeric(FLERR,arg[3],false,lmp); // have to cast to PairHybrid to work around C++ access restriction @@ -1006,13 +1006,13 @@ void PairHybrid::restore_special(double *saved) /* ---------------------------------------------------------------------- extract a ptr to a particular quantity stored by pair pass request thru to sub-styles - return first non-NULL result except for cut_coul request - for cut_coul, insure all non-NULL results are equal since required by Kspace + return first non-nullptr result except for cut_coul request + for cut_coul, insure all non-nullptr results are equal since required by Kspace ------------------------------------------------------------------------- */ void *PairHybrid::extract(const char *str, int &dim) { - void *cutptr = NULL; + void *cutptr = nullptr; void *ptr; double cutvalue = 0.0; int couldim = -1; @@ -1037,7 +1037,7 @@ void *PairHybrid::extract(const char *str, int &dim) } if (strcmp(str,"cut_coul") == 0) return cutptr; - return NULL; + return nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/pair_hybrid_overlay.cpp b/src/pair_hybrid_overlay.cpp index 4c2acfe8ba..8d352e9f2e 100644 --- a/src/pair_hybrid_overlay.cpp +++ b/src/pair_hybrid_overlay.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "pair_hybrid_overlay.h" + +#include "atom.h" +#include "error.h" + #include #include -#include "atom.h" -#include "force.h" -#include "error.h" using namespace LAMMPS_NS; @@ -34,8 +35,8 @@ void PairHybridOverlay::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); // 3rd arg = pair sub-style name // 4th arg = pair sub-style index if name used multiple times @@ -52,7 +53,7 @@ void PairHybridOverlay::coeff(int narg, char **arg) if (narg < 4) error->all(FLERR,"Incorrect args for pair coefficients"); if (!isdigit(arg[3][0])) error->all(FLERR,"Incorrect args for pair coefficients"); - int index = force->inumeric(FLERR,arg[3]); + int index = utils::inumeric(FLERR,arg[3],false,lmp); if (index == multiple[m]) break; else continue; } else break; @@ -139,7 +140,7 @@ void PairHybridOverlay::copy_svector(int itype, int jtype) if (m == map[itype][jtype][k]) { this_style = styles[m]; } else { - this_style = NULL; + this_style = nullptr; } } for (int l = 0; l < styles[m]->single_extra; ++l) { diff --git a/src/pair_lj96_cut.cpp b/src/pair_lj96_cut.cpp index 8be6fefa44..444538b253 100644 --- a/src/pair_lj96_cut.cpp +++ b/src/pair_lj96_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj96_cut.h" -#include + #include #include #include "atom.h" @@ -30,7 +30,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -41,7 +41,7 @@ PairLJ96Cut::PairLJ96Cut(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; writedata = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -433,7 +433,7 @@ void PairLJ96Cut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -456,14 +456,14 @@ void PairLJ96Cut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -508,7 +508,7 @@ void PairLJ96Cut::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -607,13 +607,13 @@ void PairLJ96Cut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -642,10 +642,10 @@ void PairLJ96Cut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); diff --git a/src/pair_lj_cubic.cpp b/src/pair_lj_cubic.cpp index 366554178f..f5f8038bef 100644 --- a/src/pair_lj_cubic.cpp +++ b/src/pair_lj_cubic.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cubic.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace PairLJCubicConstants; @@ -192,11 +192,11 @@ void PairLJCubic::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double rmin = sigma_one*RT6TWO; int count = 0; @@ -279,14 +279,14 @@ void PairLJCubic::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -313,7 +313,7 @@ void PairLJCubic::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&mix_flag,1,MPI_INT,0,world); } diff --git a/src/pair_lj_cut.cpp b/src/pair_lj_cut.cpp index 60bb7bceee..f9b5a25523 100644 --- a/src/pair_lj_cut.cpp +++ b/src/pair_lj_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut.h" -#include + #include #include #include "atom.h" @@ -30,7 +30,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -427,7 +427,7 @@ void PairLJCut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -450,14 +450,14 @@ void PairLJCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -502,7 +502,7 @@ void PairLJCut::init_style() if (utils::strmatch(update->integrate_style,"^respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -601,13 +601,13 @@ void PairLJCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -636,10 +636,10 @@ void PairLJCut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -693,5 +693,5 @@ void *PairLJCut::extract(const char *str, int &dim) dim = 2; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_cut.cpp b/src/pair_lj_cut_coul_cut.cpp index 7f0f89a5bf..38f4316d29 100644 --- a/src/pair_lj_cut_coul_cut.cpp +++ b/src/pair_lj_cut_coul_cut.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_cut.h" -#include + #include #include #include "atom.h" @@ -23,7 +23,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -189,9 +189,9 @@ void PairLJCutCoulCut::settings(int narg, char **arg) { if (narg < 1 || narg > 2) error->all(FLERR,"Illegal pair_style command"); - cut_lj_global = force->numeric(FLERR,arg[0]); + cut_lj_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 1) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[1]); + else cut_coul_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -217,16 +217,16 @@ void PairLJCutCoulCut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; double cut_coul_one = cut_coul_global; - if (narg >= 5) cut_coul_one = cut_lj_one = force->numeric(FLERR,arg[4]); - if (narg == 6) cut_coul_one = force->numeric(FLERR,arg[5]); + if (narg >= 5) cut_coul_one = cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); + if (narg == 6) cut_coul_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -354,14 +354,14 @@ void PairLJCutCoulCut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -391,11 +391,11 @@ void PairLJCutCoulCut::write_restart_settings(FILE *fp) void PairLJCutCoulCut::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); @@ -466,5 +466,5 @@ void *PairLJCutCoulCut::extract(const char *str, int &dim) if (strcmp(str,"cut_coul") == 0) return (void *) &cut_coul; if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_debye.cpp b/src/pair_lj_cut_coul_debye.cpp index a65d7aa50f..ed09e98062 100644 --- a/src/pair_lj_cut_coul_debye.cpp +++ b/src/pair_lj_cut_coul_debye.cpp @@ -12,14 +12,14 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_debye.h" -#include + #include #include "atom.h" #include "neigh_list.h" #include "force.h" #include "comm.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -133,10 +133,10 @@ void PairLJCutCoulDebye::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul_global = cut_lj_global; - else cut_coul_global = force->numeric(FLERR,arg[2]); + else cut_coul_global = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that were previously set from data file @@ -171,11 +171,11 @@ void PairLJCutCoulDebye::write_restart_settings(FILE *fp) void PairLJCutCoulDebye::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_coul_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_cut_coul_dsf.cpp b/src/pair_lj_cut_coul_dsf.cpp index 9dc6c001f4..f2c48b2229 100644 --- a/src/pair_lj_cut_coul_dsf.cpp +++ b/src/pair_lj_cut_coul_dsf.cpp @@ -17,7 +17,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_dsf.h" -#include + #include #include #include "atom.h" @@ -28,7 +28,7 @@ #include "memory.h" #include "math_const.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -214,10 +214,10 @@ void PairLJCutCoulDSF::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alpha = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); + alpha = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) cut_coul = cut_lj_global; - else cut_coul = force->numeric(FLERR,arg[2]); + else cut_coul = utils::numeric(FLERR,arg[2],false,lmp); // reset cutoffs that have been explicitly set @@ -241,14 +241,14 @@ void PairLJCutCoulDSF::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -377,13 +377,13 @@ void PairLJCutCoulDSF::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -413,12 +413,12 @@ void PairLJCutCoulDSF::write_restart_settings(FILE *fp) void PairLJCutCoulDSF::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&alpha,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alpha,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alpha,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); @@ -477,5 +477,5 @@ void *PairLJCutCoulDSF::extract(const char *str, int &dim) dim = 0; return (void *) &cut_coul; } - return NULL; + return nullptr; } diff --git a/src/pair_lj_cut_coul_wolf.cpp b/src/pair_lj_cut_coul_wolf.cpp index 303d9a88bb..e6b00b9a56 100644 --- a/src/pair_lj_cut_coul_wolf.cpp +++ b/src/pair_lj_cut_coul_wolf.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_cut_coul_wolf.h" -#include + #include #include "atom.h" #include "comm.h" @@ -26,7 +26,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -212,9 +212,9 @@ void PairLJCutCoulWolf::settings(int narg, char **arg) { if (narg < 2 || narg > 3) error->all(FLERR,"Illegal pair_style command"); - alf = force->numeric(FLERR,arg[0]); - cut_lj_global = force->numeric(FLERR,arg[1]); - if (narg == 3) cut_coul = force->numeric(FLERR,arg[2]); + alf = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj_global = utils::numeric(FLERR,arg[1],false,lmp); + if (narg == 3) cut_coul = utils::numeric(FLERR,arg[2],false,lmp); else cut_coul = cut_lj_global; if (allocated) { @@ -236,14 +236,14 @@ void PairLJCutCoulWolf::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_lj_one = cut_lj_global; - if (narg == 5) cut_lj_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_lj_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -370,13 +370,13 @@ void PairLJCutCoulWolf::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -407,12 +407,12 @@ void PairLJCutCoulWolf::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&alf,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&alf,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&alf,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_expand.cpp b/src/pair_lj_expand.cpp index 98c8a808e2..c68c2298e5 100644 --- a/src/pair_lj_expand.cpp +++ b/src/pair_lj_expand.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_expand.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -172,7 +172,7 @@ void PairLJExpand::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -194,15 +194,15 @@ void PairLJExpand::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double shift_one = force->numeric(FLERR,arg[4]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double shift_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -325,14 +325,14 @@ void PairLJExpand::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&shift[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -361,10 +361,10 @@ void PairLJExpand::write_restart_settings(FILE *fp) void PairLJExpand::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -423,5 +423,5 @@ void *PairLJExpand::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"delta") == 0) return (void *) shift; - return NULL; + return nullptr; } diff --git a/src/pair_lj_gromacs.cpp b/src/pair_lj_gromacs.cpp index 73f4307d62..05f30bcdd5 100644 --- a/src/pair_lj_gromacs.cpp +++ b/src/pair_lj_gromacs.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_gromacs.h" -#include + #include #include "atom.h" #include "comm.h" @@ -24,7 +24,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -190,8 +190,8 @@ void PairLJGromacs::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -220,17 +220,17 @@ void PairLJGromacs::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) @@ -339,14 +339,14 @@ void PairLJGromacs::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -376,10 +376,10 @@ void PairLJGromacs::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_gromacs_coul_gromacs.cpp b/src/pair_lj_gromacs_coul_gromacs.cpp index a5663ecfd8..481e657236 100644 --- a/src/pair_lj_gromacs_coul_gromacs.cpp +++ b/src/pair_lj_gromacs_coul_gromacs.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_gromacs_coul_gromacs.h" -#include + #include #include "atom.h" #include "comm.h" @@ -25,7 +25,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -220,14 +220,14 @@ void PairLJGromacsCoulGromacs::settings(int narg, char **arg) if (narg != 2 && narg != 4) error->all(FLERR,"Illegal pair_style command"); - cut_lj_inner = force->numeric(FLERR,arg[0]); - cut_lj = force->numeric(FLERR,arg[1]); + cut_lj_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_lj = utils::numeric(FLERR,arg[1],false,lmp); if (narg == 2) { cut_coul_inner = cut_lj_inner; cut_coul = cut_lj; } else { - cut_coul_inner = force->numeric(FLERR,arg[2]); - cut_coul = force->numeric(FLERR,arg[3]); + cut_coul_inner = utils::numeric(FLERR,arg[2],false,lmp); + cut_coul = utils::numeric(FLERR,arg[3],false,lmp); } if (cut_lj_inner <= 0.0 || cut_coul_inner < 0.0) @@ -246,11 +246,11 @@ void PairLJGromacsCoulGromacs::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -379,12 +379,12 @@ void PairLJGromacsCoulGromacs::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -413,12 +413,12 @@ void PairLJGromacsCoulGromacs::write_restart_settings(FILE *fp) void PairLJGromacsCoulGromacs::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_lj_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_lj,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_coul,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_lj_inner,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_lj,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_smooth.cpp b/src/pair_lj_smooth.cpp index bf97a44732..7afc667358 100644 --- a/src/pair_lj_smooth.cpp +++ b/src/pair_lj_smooth.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_smooth.h" -#include + #include #include "atom.h" #include "comm.h" @@ -24,7 +24,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -195,8 +195,8 @@ void PairLJSmooth::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner_global = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner_global = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner_global <= 0.0 || cut_inner_global > cut_global) error->all(FLERR,"Illegal pair_style command"); @@ -225,17 +225,17 @@ void PairLJSmooth::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_inner_one = cut_inner_global; double cut_one = cut_global; if (narg == 6) { - cut_inner_one = force->numeric(FLERR,arg[4]); - cut_one = force->numeric(FLERR,arg[5]); + cut_inner_one = utils::numeric(FLERR,arg[4],false,lmp); + cut_one = utils::numeric(FLERR,arg[5],false,lmp); } if (cut_inner_one <= 0.0 || cut_inner_one > cut_one) @@ -353,14 +353,14 @@ void PairLJSmooth::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -390,10 +390,10 @@ void PairLJSmooth::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_inner_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_inner_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_lj_smooth_linear.cpp b/src/pair_lj_smooth_linear.cpp index 19e84f971d..78a538f131 100644 --- a/src/pair_lj_smooth_linear.cpp +++ b/src/pair_lj_smooth_linear.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_lj_smooth_linear.h" -#include + #include #include "atom.h" #include "comm.h" @@ -24,7 +24,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -170,7 +170,7 @@ void PairLJSmoothLinear::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -194,15 +194,15 @@ void PairLJSmoothLinear::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; if (narg == 5) { - cut_one = force->numeric(FLERR,arg[4]); + cut_one = utils::numeric(FLERR,arg[4],false,lmp); } int count = 0; @@ -286,13 +286,13 @@ void PairLJSmoothLinear::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -319,8 +319,8 @@ void PairLJSmoothLinear::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); diff --git a/src/pair_mie_cut.cpp b/src/pair_mie_cut.cpp index f031401a00..5030ffc2af 100644 --- a/src/pair_mie_cut.cpp +++ b/src/pair_mie_cut.cpp @@ -16,7 +16,7 @@ ------------------------------------------------------------------------- */ #include "pair_mie_cut.h" -#include + #include #include #include "atom.h" @@ -30,7 +30,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -40,7 +40,7 @@ using namespace MathConst; PairMIECut::PairMIECut(LAMMPS *lmp) : Pair(lmp) { respa_enable = 1; - cut_respa = NULL; + cut_respa = nullptr; } /* ---------------------------------------------------------------------- */ @@ -438,7 +438,7 @@ void PairMIECut::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -461,16 +461,16 @@ void PairMIECut::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); - double gamR_one = force->numeric(FLERR,arg[4]); - double gamA_one = force->numeric(FLERR,arg[5]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); + double gamR_one = utils::numeric(FLERR,arg[4],false,lmp); + double gamA_one = utils::numeric(FLERR,arg[5],false,lmp); double cut_one = cut_global; - if (narg == 7) cut_one = force->numeric(FLERR,arg[6]); + if (narg == 7) cut_one = utils::numeric(FLERR,arg[6],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -517,7 +517,7 @@ void PairMIECut::init_style() if (strstr(update->integrate_style,"respa") && ((Respa *) update->integrate)->level_inner >= 0) cut_respa = ((Respa *) update->integrate)->cutoff; - else cut_respa = NULL; + else cut_respa = nullptr; } /* ---------------------------------------------------------------------- @@ -628,15 +628,15 @@ void PairMIECut::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamR[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&gamA[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamR[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&gamA[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -667,10 +667,10 @@ void PairMIECut::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -706,5 +706,5 @@ void *PairMIECut::extract(const char *str, int &dim) if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"gamR") == 0) return (void *) gamR; if (strcmp(str,"gamA") == 0) return (void *) gamA; - return NULL; + return nullptr; } diff --git a/src/pair_morse.cpp b/src/pair_morse.cpp index b883036c18..b55fc7a858 100644 --- a/src/pair_morse.cpp +++ b/src/pair_morse.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_morse.h" -#include + #include #include #include "atom.h" @@ -21,7 +21,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -158,7 +158,7 @@ void PairMorse::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -181,15 +181,15 @@ void PairMorse::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double d0_one = force->numeric(FLERR,arg[2]); - double alpha_one = force->numeric(FLERR,arg[3]); - double r0_one = force->numeric(FLERR,arg[4]); + double d0_one = utils::numeric(FLERR,arg[2],false,lmp); + double alpha_one = utils::numeric(FLERR,arg[3],false,lmp); + double r0_one = utils::numeric(FLERR,arg[4],false,lmp); double cut_one = cut_global; - if (narg == 6) cut_one = force->numeric(FLERR,arg[5]); + if (narg == 6) cut_one = utils::numeric(FLERR,arg[5],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -266,14 +266,14 @@ void PairMorse::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&d0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&alpha[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&r0[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&d0[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&alpha[i][j],1,MPI_DOUBLE,0,world); @@ -301,9 +301,9 @@ void PairMorse::write_restart_settings(FILE *fp) void PairMorse::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -357,5 +357,5 @@ void *PairMorse::extract(const char *str, int &dim) if (strcmp(str,"d0") == 0) return (void *) d0; if (strcmp(str,"r0") == 0) return (void *) r0; if (strcmp(str,"alpha") == 0) return (void *) alpha; - return NULL; + return nullptr; } diff --git a/src/pair_soft.cpp b/src/pair_soft.cpp index ddfc4476dc..b6a3151987 100644 --- a/src/pair_soft.cpp +++ b/src/pair_soft.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_soft.h" -#include + #include #include #include "atom.h" @@ -22,7 +22,7 @@ #include "math_const.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; using namespace MathConst; @@ -149,7 +149,7 @@ void PairSoft::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -172,13 +172,13 @@ void PairSoft::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double prefactor_one = force->numeric(FLERR,arg[2]); + double prefactor_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -245,12 +245,12 @@ void PairSoft::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&prefactor[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&prefactor[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&prefactor[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -275,8 +275,8 @@ void PairSoft::write_restart_settings(FILE *fp) void PairSoft::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&mix_flag,1,MPI_INT,0,world); @@ -326,5 +326,5 @@ void *PairSoft::extract(const char *str, int &dim) { dim = 2; if (strcmp(str,"a") == 0) return (void *) prefactor; - return NULL; + return nullptr; } diff --git a/src/pair_table.cpp b/src/pair_table.cpp index bd2a6be654..f7933f5d9a 100644 --- a/src/pair_table.cpp +++ b/src/pair_table.cpp @@ -16,21 +16,21 @@ ------------------------------------------------------------------------- */ #include "pair_table.h" -#include + #include -#include + #include -#include + #include "atom.h" #include "force.h" #include "comm.h" #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + #include "tokenizer.h" #include "table_file_reader.h" -#include "fmt/format.h" + using namespace LAMMPS_NS; @@ -43,7 +43,7 @@ enum{NONE,RLINEAR,RSQ,BMP}; PairTable::PairTable(LAMMPS *lmp) : Pair(lmp) { ntables = 0; - tables = NULL; + tables = nullptr; unit_convert_flag = utils::get_supported_conversions(utils::ENERGY); } @@ -216,7 +216,7 @@ void PairTable::settings(int narg, char **arg) else if (strcmp(arg[0],"bitmap") == 0) tabstyle = BITMAP; else error->all(FLERR,"Unknown table style in pair_style command"); - tablength = force->inumeric(FLERR,arg[1]); + tablength = utils::inumeric(FLERR,arg[1],false,lmp); if (tablength < 2) error->all(FLERR,"Illegal number of pair table entries"); // optional keywords @@ -246,7 +246,7 @@ void PairTable::settings(int narg, char **arg) allocated = 0; ntables = 0; - tables = NULL; + tables = nullptr; } /* ---------------------------------------------------------------------- @@ -259,8 +259,8 @@ void PairTable::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); int me; MPI_Comm_rank(world,&me); @@ -273,7 +273,7 @@ void PairTable::coeff(int narg, char **arg) // set table cutoff - if (narg == 5) tb->cut = force->numeric(FLERR,arg[4]); + if (narg == 5) tb->cut = utils::numeric(FLERR,arg[4],false,lmp); else if (tb->rflag) tb->cut = tb->rhi; else tb->cut = tb->rfile[tb->ninput-1]; @@ -402,7 +402,7 @@ void PairTable::read_table(Table *tb, char *file, char *keyword) rfile = values.next_double(); tb->efile[i] = conversion_factor * values.next_double(); tb->ffile[i] = conversion_factor * values.next_double(); - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { ++cerror; } @@ -571,7 +571,7 @@ void PairTable::param_extract(Table *tb, char *line) error->one(FLERR,fmt::format("Invalid keyword {} in pair table parameters", word).c_str()); } } - } catch (TokenizerException & e) { + } catch (TokenizerException &e) { error->one(FLERR, e.what()); } @@ -821,15 +821,15 @@ void PairTable::compute_table(Table *tb) } /* ---------------------------------------------------------------------- - set all ptrs in a table to NULL, so can be freed safely + set all ptrs in a table to a null pointer, so can be freed safely ------------------------------------------------------------------------- */ void PairTable::null_table(Table *tb) { - tb->rfile = tb->efile = tb->ffile = NULL; - tb->e2file = tb->f2file = NULL; - tb->rsq = tb->drsq = tb->e = tb->de = NULL; - tb->f = tb->df = tb->e2 = tb->f2 = NULL; + tb->rfile = tb->efile = tb->ffile = nullptr; + tb->e2file = tb->f2file = nullptr; + tb->rsq = tb->drsq = tb->e = tb->de = nullptr; + tb->f = tb->df = tb->e2 = tb->f2 = nullptr; } /* ---------------------------------------------------------------------- @@ -951,13 +951,13 @@ void PairTable::write_restart_settings(FILE *fp) void PairTable::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tablength,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&ewaldflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&pppmflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&msmflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tip4pflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&tabstyle,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tablength,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&ewaldflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&pppmflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&msmflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&dispersionflag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tip4pflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&tabstyle,1,MPI_INT,0,world); MPI_Bcast(&tablength,1,MPI_INT,0,world); @@ -1029,7 +1029,7 @@ double PairTable::single(int /*i*/, int /*j*/, int itype, int jtype, double rsq, void *PairTable::extract(const char *str, int &dim) { - if (strcmp(str,"cut_coul") != 0) return NULL; + if (strcmp(str,"cut_coul") != 0) return nullptr; if (ntables == 0) error->all(FLERR,"All pair coeffs are not set"); // only check for cutoff consistency if claiming to be KSpace compatible @@ -1042,5 +1042,5 @@ void *PairTable::extract(const char *str, int &dim) "Pair table cutoffs must all be equal to use with KSpace"); dim = 0; return &tables[0].cut; - } else return NULL; + } else return nullptr; } diff --git a/src/pair_ufm.cpp b/src/pair_ufm.cpp index 3b94902af7..e1e378155a 100644 --- a/src/pair_ufm.cpp +++ b/src/pair_ufm.cpp @@ -18,7 +18,7 @@ ------------------------------------------------------------------------- */ #include "pair_ufm.h" -#include + #include #include #include "atom.h" @@ -27,7 +27,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -164,7 +164,7 @@ void PairUFM::settings(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); // reset cutoffs that have been explicitly set @@ -187,15 +187,15 @@ void PairUFM::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double epsilon_one = force->numeric(FLERR,arg[2]); - double sigma_one = force->numeric(FLERR,arg[3]); + double epsilon_one = utils::numeric(FLERR,arg[2],false,lmp); + double sigma_one = utils::numeric(FLERR,arg[3],false,lmp); double cut_one = cut_global; - if (narg == 5) cut_one = force->numeric(FLERR,arg[4]); + if (narg == 5) cut_one = utils::numeric(FLERR,arg[4],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -278,14 +278,14 @@ void PairUFM::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&epsilon[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&sigma[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&scale[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&epsilon[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&sigma[i][j],1,MPI_DOUBLE,0,world); @@ -314,9 +314,9 @@ void PairUFM::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&offset_flag,1,MPI_INT,0,world); @@ -365,5 +365,5 @@ void *PairUFM::extract(const char *str, int &dim) if (strcmp(str,"epsilon") == 0) return (void *) epsilon; if (strcmp(str,"sigma") == 0) return (void *) sigma; if (strcmp(str,"scale") == 0) return (void *) scale; - return NULL; + return nullptr; } diff --git a/src/pair_yukawa.cpp b/src/pair_yukawa.cpp index d1e06fdb84..6118e5f36b 100644 --- a/src/pair_yukawa.cpp +++ b/src/pair_yukawa.cpp @@ -12,7 +12,7 @@ ------------------------------------------------------------------------- */ #include "pair_yukawa.h" -#include + #include #include "atom.h" #include "force.h" @@ -20,7 +20,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; @@ -153,8 +153,8 @@ void PairYukawa::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - kappa = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + kappa = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); // reset cutoffs that have been explicitly set @@ -177,13 +177,13 @@ void PairYukawa::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - double a_one = force->numeric(FLERR,arg[2]); + double a_one = utils::numeric(FLERR,arg[2],false,lmp); double cut_one = cut_global; - if (narg == 4) cut_one = force->numeric(FLERR,arg[3]); + if (narg == 4) cut_one = utils::numeric(FLERR,arg[3],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -253,12 +253,12 @@ void PairYukawa::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&a[i][j],sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&a[i][j],1,MPI_DOUBLE,0,world); MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); @@ -285,10 +285,10 @@ void PairYukawa::write_restart_settings(FILE *fp) void PairYukawa::read_restart_settings(FILE *fp) { if (comm->me == 0) { - utils::sfread(FLERR,&kappa,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&kappa,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&kappa,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); diff --git a/src/pair_zbl.cpp b/src/pair_zbl.cpp index 2ba499a911..7b028de65a 100644 --- a/src/pair_zbl.cpp +++ b/src/pair_zbl.cpp @@ -24,7 +24,7 @@ #include "neigh_list.h" #include "memory.h" #include "error.h" -#include "utils.h" + // From J.F. Zeigler, J. P. Biersack and U. Littmark, // "The Stopping and Range of Ions in Matter" volume 1, Pergamon, 1985. @@ -183,8 +183,8 @@ void PairZBL::settings(int narg, char **arg) { if (narg != 2) error->all(FLERR,"Illegal pair_style command"); - cut_inner = force->numeric(FLERR,arg[0]); - cut_global = force->numeric(FLERR,arg[1]); + cut_inner = utils::numeric(FLERR,arg[0],false,lmp); + cut_global = utils::numeric(FLERR,arg[1],false,lmp); if (cut_inner <= 0.0 ) error->all(FLERR,"Illegal pair_style command"); @@ -206,13 +206,13 @@ void PairZBL::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); int jlo,jhi; - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); - z_one = force->numeric(FLERR,arg[2]); - z_two = force->numeric(FLERR,arg[3]); + z_one = utils::numeric(FLERR,arg[2],false,lmp); + z_two = utils::numeric(FLERR,arg[3],false,lmp); // set flag for each i-j pair // set z-parameter only for i-i pairs @@ -285,10 +285,10 @@ void PairZBL::read_restart(FILE *fp) int i,j; int me = comm->me; for (i = 1; i <= atom->ntypes; i++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][i],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][i],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][i],1,MPI_INT,0,world); if (setflag[i][i]) { - if (me == 0) utils::sfread(FLERR,&z[i],sizeof(double),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&z[i],sizeof(double),1,fp,nullptr,error); MPI_Bcast(&z[i],1,MPI_DOUBLE,0,world); } } @@ -319,11 +319,11 @@ void PairZBL::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&cut_inner,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,NULL,error); - utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&cut_inner,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&offset_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&mix_flag,sizeof(int),1,fp,nullptr,error); + utils::sfread(FLERR,&tail_flag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&cut_inner,1,MPI_DOUBLE,0,world); diff --git a/src/pair_zero.cpp b/src/pair_zero.cpp index 6ab108ff4f..a45fef67a5 100644 --- a/src/pair_zero.cpp +++ b/src/pair_zero.cpp @@ -16,14 +16,13 @@ ------------------------------------------------------------------------- */ #include "pair_zero.h" -#include -#include + #include "atom.h" #include "comm.h" -#include "force.h" #include "memory.h" #include "error.h" -#include "utils.h" + +#include using namespace LAMMPS_NS; @@ -89,7 +88,7 @@ void PairZero::settings(int narg, char **arg) if ((narg != 1) && (narg != 2)) error->all(FLERR,"Illegal pair_style command"); - cut_global = force->numeric(FLERR,arg[0]); + cut_global = utils::numeric(FLERR,arg[0],false,lmp); if (narg == 2) { if (strcmp("nocoeff",arg[1]) == 0) coeffflag=0; else error->all(FLERR,"Illegal pair_style command"); @@ -117,11 +116,11 @@ void PairZero::coeff(int narg, char **arg) if (!allocated) allocate(); int ilo,ihi,jlo,jhi; - force->bounds(FLERR,arg[0],atom->ntypes,ilo,ihi); - force->bounds(FLERR,arg[1],atom->ntypes,jlo,jhi); + utils::bounds(FLERR,arg[0],1,atom->ntypes,ilo,ihi,error); + utils::bounds(FLERR,arg[1],1,atom->ntypes,jlo,jhi,error); double cut_one = cut_global; - if (coeffflag && (narg == 3)) cut_one = force->numeric(FLERR,arg[2]); + if (coeffflag && (narg == 3)) cut_one = utils::numeric(FLERR,arg[2],false,lmp); int count = 0; for (int i = ilo; i <= ihi; i++) { @@ -179,11 +178,11 @@ void PairZero::read_restart(FILE *fp) int me = comm->me; for (i = 1; i <= atom->ntypes; i++) for (j = i; j <= atom->ntypes; j++) { - if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,&setflag[i][j],sizeof(int),1,fp,nullptr,error); MPI_Bcast(&setflag[i][j],1,MPI_INT,0,world); if (setflag[i][j]) { if (me == 0) { - utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,NULL,error); + utils::sfread(FLERR,&cut[i][j],sizeof(double),1,fp,nullptr,error); } MPI_Bcast(&cut[i][j],1,MPI_DOUBLE,0,world); } @@ -208,8 +207,8 @@ void PairZero::read_restart_settings(FILE *fp) { int me = comm->me; if (me == 0) { - utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,NULL,error); - utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&cut_global,sizeof(double),1,fp,nullptr,error); + utils::sfread(FLERR,&coeffflag,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&cut_global,1,MPI_DOUBLE,0,world); MPI_Bcast(&coeffflag,1,MPI_INT,0,world); diff --git a/src/pointers.h b/src/pointers.h index 2d528db392..5dc1a63078 100644 --- a/src/pointers.h +++ b/src/pointers.h @@ -21,11 +21,14 @@ #ifndef LMP_POINTERS_H #define LMP_POINTERS_H -#include "lmptype.h" // IWYU pragma: export -#include // IWYU pragma: export -#include // IWYU pragme: export -#include // IWYU pragma: export -#include "lammps.h" // IWYU pragma: export +#include "lmptype.h" // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragme: export +#include // IWYU pragma: export +#include // IWYU pragma: export +#include "lammps.h" // IWYU pragma: export +#include "utils.h" // IWYU pragma: export +#include "fmt/format.h" // IWYU pragma: export namespace LAMMPS_NS { @@ -45,6 +48,20 @@ enum ExecutionSpace{Host,Device}; template class MyPoolChunk; template class MyPage; +/** \class LAMMPS_NS::Pointers + * \brief Base class for LAMMPS features + * + * The Pointers class contains references to many of the pointers + * and members of the LAMMPS_NS::LAMMPS class. Derived classes thus + * gain access to the constituent class instances in the LAMMPS + * composite class and thus to the core functionality of LAMMPS. + * + * This kind of construct is needed, since the LAMMPS constructor + * should only be run once per LAMMPS instance and thus classes + * cannot be derived from LAMMPS itself. The Pointers class + * constructor instead only initializes C++ references to component + * pointer in the LAMMPS class. */ + class Pointers { public: Pointers(LAMMPS *ptr) : diff --git a/src/potential_file_reader.cpp b/src/potential_file_reader.cpp index 47283fd574..6b41a35f0a 100644 --- a/src/potential_file_reader.cpp +++ b/src/potential_file_reader.cpp @@ -15,20 +15,33 @@ Contributing authors: Richard Berger (Temple U) ------------------------------------------------------------------------- */ -#include "lammps.h" -#include "force.h" -#include "error.h" -#include "comm.h" #include "potential_file_reader.h" -#include "update.h" -#include "utils.h" -#include "tokenizer.h" -#include "fmt/format.h" -#include +#include "comm.h" +#include "error.h" +#include "text_file_reader.h" +#include "tokenizer.h" +#include "update.h" using namespace LAMMPS_NS; +/** Class for reading and parsing LAMMPS potential files + * + * The value of the class member variable *ignore_comments* controls + * whether any text following the pound sign (#) should be ignored (true) + * or not (false). Default: true, i.e. ignore. +\verbatim embed:rst + +*See also* + :cpp:class:`TextFileReader` + +\endverbatim + * + * \param lmp Pointer to LAMMPS instance + * \param filename Name of file to be read + * \param potential_name Name of potential style for error messages + * \param auto_convert Bitmask of supported unit conversions */ + PotentialFileReader::PotentialFileReader(LAMMPS *lmp, const std::string &filename, const std::string &potential_name, @@ -48,103 +61,172 @@ PotentialFileReader::PotentialFileReader(LAMMPS *lmp, if(!reader) { error->one(FLERR, fmt::format("cannot open {} potential file {}", potential_name, filename)); } - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } } +/** Closes the file */ + PotentialFileReader::~PotentialFileReader() { delete reader; } +/** Set comment (= text after '#') handling preference for the file to be read + * + * \param value Comment text is ignored if true, or not if false */ void PotentialFileReader::ignore_comments(bool value) { reader->ignore_comments = value; } +/** Read a line but ignore its content */ + void PotentialFileReader::skip_line() { try { reader->skip_line(); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } } +/** Read the next line(s) until *nparams* words have been read. + * + * This reads a line and counts the words in it, if the number + * is less than the requested number, it will read the next + * line, as well. Output will be a string with all read lines + * combined. The purpose is to somewhat replicate the reading + * behavior of formatted files in Fortran. + * + * \param nparams Number of words that must be read. Default: 0 + * \return String with the concatenated text */ + char *PotentialFileReader::next_line(int nparams) { try { return reader->next_line(nparams); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return nullptr; } +/** Read lines until *n* doubles have been read and stored in array *list* + * + * This reads lines from the file using the next_line() function, + * and splits them into floating-point numbers using the + * ValueTokenizer class and stores the number is the provided list. + * + * \param list Pointer to array with suitable storage for *n* doubles + * \param n Number of doubles to be read */ + void PotentialFileReader::next_dvector(double * list, int n) { try { return reader->next_dvector(list, n); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } } -ValueTokenizer PotentialFileReader::next_values(int nparams, const std::string & separators) { +/** Read text until *nparams* words are read and passed to a tokenizer object for custom parsing. + * + * This reads lines from the file using the next_line() function, + * and splits them into floating-point numbers using the + * ValueTokenizer class and stores the number is the provided list. + * + * \param nparams Number of words to be read + * \param separators String with list of separators. + * \return ValueTokenizer object for read in text */ + +ValueTokenizer PotentialFileReader::next_values(int nparams, const std::string &separators) { try { return reader->next_values(nparams, separators); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return ValueTokenizer(""); } +/** Read next line and convert first word to a double + * + * \return Value of first word in line as double */ + double PotentialFileReader::next_double() { try { char * line = reader->next_line(1); return ValueTokenizer(line).next_double(); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return 0.0; } +/** Read next line and convert first word to an int + * + * \return Value of first word in line as int */ + int PotentialFileReader::next_int() { try { char * line = reader->next_line(1); return ValueTokenizer(line).next_int(); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return 0; } +/** Read next line and convert first word to a tagint + * + * \return Value of first word in line as tagint */ + tagint PotentialFileReader::next_tagint() { try { char * line = reader->next_line(1); return ValueTokenizer(line).next_tagint(); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return 0; } +/** Read next line and convert first word to a bigint + * + * \return Value of first word in line as bigint */ + bigint PotentialFileReader::next_bigint() { try { char * line = reader->next_line(1); return ValueTokenizer(line).next_bigint(); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return 0; } +/** Read next line and return first word + * + * \return First word of read in line */ + std::string PotentialFileReader::next_string() { try { char * line = reader->next_line(1); return ValueTokenizer(line).next_string(); - } catch (FileReaderException & e) { + } catch (FileReaderException &e) { error->one(FLERR, e.what()); } return ""; } +/** Look up and open the potential file + * +\verbatim embed:rst + +*See also* + :cpp:func:`utils::open_potential`, + :cpp:class:`TextFileReader` + +\endverbatim + * \param path Path of the potential file to open + * \return Pointer to TextFileReader object created */ + TextFileReader *PotentialFileReader::open_potential(const std::string &path) { std::string filepath = utils::get_potential_file_path(path); diff --git a/src/potential_file_reader.h b/src/potential_file_reader.h index 9094d3957a..d3befca282 100644 --- a/src/potential_file_reader.h +++ b/src/potential_file_reader.h @@ -18,14 +18,13 @@ #ifndef LMP_POTENTIAL_FILE_READER_H #define LMP_POTENTIAL_FILE_READER_H -#include - -#include "pointers.h" +#include "pointers.h" // IWYU pragma: export #include "tokenizer.h" -#include "text_file_reader.h" namespace LAMMPS_NS { + class TextFileReader; + class PotentialFileReader : protected Pointers { protected: TextFileReader *reader; diff --git a/src/procmap.cpp b/src/procmap.cpp index 1741e351fe..b85b0abd01 100644 --- a/src/procmap.cpp +++ b/src/procmap.cpp @@ -16,18 +16,18 @@ ------------------------------------------------------------------------- */ #include "procmap.h" -#include + +#include "comm.h" +#include "domain.h" +#include "error.h" +#include "math_extra.h" +#include "memory.h" +#include "universe.h" + #include #include #include -#include #include -#include "universe.h" -#include "comm.h" -#include "domain.h" -#include "math_extra.h" -#include "memory.h" -#include "error.h" using namespace LAMMPS_NS; @@ -49,7 +49,7 @@ void ProcMap::onelevel_grid(int nprocs, int *user_procgrid, int *procgrid, // factors = list of all possible 3 factors of processor count - int npossible = factor(nprocs,NULL); + int npossible = factor(nprocs,nullptr); memory->create(factors,npossible,3,"procmap:factors"); npossible = factor(nprocs,factors); @@ -93,7 +93,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid, // nfactors = list of all possible 3 factors of node count // constrain by 2d - int nnpossible = factor(nprocs/ncores,NULL); + int nnpossible = factor(nprocs/ncores,nullptr); memory->create(nfactors,nnpossible,3,"procmap:nfactors"); nnpossible = factor(nprocs/ncores,nfactors); @@ -102,7 +102,7 @@ void ProcMap::twolevel_grid(int nprocs, int *user_procgrid, int *procgrid, // cfactors = list of all possible 3 factors of core count // constrain by 2d - int ncpossible = factor(ncores,NULL); + int ncpossible = factor(ncores,nullptr); memory->create(cfactors,ncpossible,3,"procmap:cfactors"); ncpossible = factor(ncores,cfactors); @@ -205,7 +205,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, // initial factorization within NUMA node int **numafactors; - int numapossible = factor(procs_per_numa,NULL); + int numapossible = factor(procs_per_numa,nullptr); memory->create(numafactors,numapossible,3,"procmap:numafactors"); numapossible = factor(procs_per_numa,numafactors); @@ -230,7 +230,7 @@ void ProcMap::numa_grid(int nprocs, int *user_procgrid, int *procgrid, int node_count = nprocs / procs_per_numa; int **nodefactors; - int nodepossible = factor(node_count,NULL); + int nodepossible = factor(node_count,nullptr); memory->create(nodefactors,nodepossible,3,"procmap:nodefactors"); nodepossible = factor(node_count,nodefactors); @@ -281,11 +281,11 @@ void ProcMap::custom_grid(char *cfile, int nprocs, MPI_Comm_rank(world,&me); char line[MAXLINE]; - FILE *fp = NULL; + FILE *fp = nullptr; if (me == 0) { fp = fopen(cfile,"r"); - if (fp == NULL) error->one(FLERR,"Cannot open custom file"); + if (fp == nullptr) error->one(FLERR,"Cannot open custom file"); // skip header = blank and comment lines @@ -662,7 +662,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc) FILE *fp; if (me == 0) { fp = fopen(file,"w"); - if (fp == NULL) error->one(FLERR,"Cannot open processors output file"); + if (fp == nullptr) error->one(FLERR,"Cannot open processors output file"); fprintf(fp,"LAMMPS mapping of processors to 3d grid\n"); fprintf(fp,"partition = %d\n",universe->iworld+1); fprintf(fp,"Px Py Pz = %d %d %d\n",procgrid[0],procgrid[1],procgrid[2]); @@ -722,7 +722,7 @@ void ProcMap::output(char *file, int *procgrid, int ***grid2proc) /* ---------------------------------------------------------------------- generate all possible 3-integer factorizations of N - store them in factors if non-NULL + store them in factors if non-nullptr return # of factorizations ------------------------------------------------------------------------- */ diff --git a/src/random_mars.cpp b/src/random_mars.cpp index 29314525a5..3f5bd7a62f 100644 --- a/src/random_mars.cpp +++ b/src/random_mars.cpp @@ -27,7 +27,7 @@ enum{ADD,SUBTRACT}; /* ---------------------------------------------------------------------- */ RanMars::RanMars(LAMMPS *lmp, int seed) : Pointers(lmp), - u(NULL) + u(nullptr) { int ij,kl,i,j,k,l,ii,jj,m; double s,t; diff --git a/src/rcb.cpp b/src/rcb.cpp index 2cc70a2de9..1d31918742 100644 --- a/src/rcb.cpp +++ b/src/rcb.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "rcb.h" -#include -#include + #include "irregular.h" #include "memory.h" +#include + using namespace LAMMPS_NS; #define MYHUGE 1.0e30 @@ -38,19 +39,19 @@ RCB::RCB(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_size(world,&nprocs); ndot = maxdot = 0; - dots = NULL; + dots = nullptr; nlist = maxlist = 0; - dotlist = dotmark = dotmark_select = NULL; + dotlist = dotmark = dotmark_select = nullptr; maxbuf = 0; - buf = NULL; + buf = nullptr; maxrecv = maxsend = 0; - recvproc = recvindex = sendproc = sendindex = NULL; + recvproc = recvindex = sendproc = sendindex = nullptr; - tree = NULL; - irregular = NULL; + tree = nullptr; + irregular = nullptr; // create MPI data and function types for box and median AllReduce ops @@ -94,7 +95,7 @@ RCB::~RCB() NEW version: each RCB cut is tested in all dimensions dimeension that produces 2 boxes with largest min size is selected this is to prevent very narrow boxes from being produced - if wt = NULL, ignore per-particle weights + if wt = nullptr, ignore per-particle weights if wt defined, per-particle weights > 0.0 dimension = 2 or 3 as documented in rcb.h: @@ -572,10 +573,10 @@ void RCB::compute(int dimension, int n, double **x, double *wt, // handshake before sending dots to insure recvs have been posted if (readnumber > 0) { - MPI_Send(NULL,0,MPI_INT,procpartner,0,world); - if (readnumber == 2) MPI_Send(NULL,0,MPI_INT,procpartner2,0,world); + MPI_Send(nullptr,0,MPI_INT,procpartner,0,world); + if (readnumber == 2) MPI_Send(nullptr,0,MPI_INT,procpartner2,0,world); } - MPI_Recv(NULL,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); + MPI_Recv(nullptr,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); // send dots to partner @@ -631,7 +632,7 @@ void RCB::compute(int dimension, int n, double **x, double *wt, /* ---------------------------------------------------------------------- perform RCB balancing of N particles at coords X in bounding box LO/HI OLD version: each RCB cut is made in longest dimension of sub-box - if wt = NULL, ignore per-particle weights + if wt = nullptr, ignore per-particle weights if wt defined, per-particle weights > 0.0 dimension = 2 or 3 as documented in rcb.h: @@ -1064,10 +1065,10 @@ void RCB::compute_old(int dimension, int n, double **x, double *wt, // handshake before sending dots to insure recvs have been posted if (readnumber > 0) { - MPI_Send(NULL,0,MPI_INT,procpartner,0,world); - if (readnumber == 2) MPI_Send(NULL,0,MPI_INT,procpartner2,0,world); + MPI_Send(nullptr,0,MPI_INT,procpartner,0,world); + if (readnumber == 2) MPI_Send(nullptr,0,MPI_INT,procpartner2,0,world); } - MPI_Recv(NULL,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); + MPI_Recv(nullptr,0,MPI_INT,procpartner,0,world,MPI_STATUS_IGNORE); // send dots to partner @@ -1260,9 +1261,9 @@ void RCB::invert(int sortflag) memory use of Irregular ------------------------------------------------------------------------- */ -bigint RCB::memory_usage() +double RCB::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (irregular) bytes += irregular->memory_usage(); return bytes; } diff --git a/src/rcb.h b/src/rcb.h index 555c4142b5..a3dc37bb9b 100644 --- a/src/rcb.h +++ b/src/rcb.h @@ -43,7 +43,7 @@ class RCB : protected Pointers { void compute(int, int, double **, double *, double *, double *); void compute_old(int, int, double **, double *, double *, double *); void invert(int sortflag = 0); - bigint memory_usage(); + double memory_usage(); // DEBUG methods //void check(); diff --git a/src/read_data.cpp b/src/read_data.cpp index 19e5c56b81..06113baf77 100644 --- a/src/read_data.cpp +++ b/src/read_data.cpp @@ -16,34 +16,32 @@ // before lmptype.h can set flags to insure it is done correctly #include "read_data.h" -#include -#include -#include -#include + +#include "angle.h" #include "atom.h" #include "atom_vec.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "molecule.h" -#include "group.h" +#include "bond.h" #include "comm.h" -#include "update.h" -#include "modify.h" +#include "dihedral.h" +#include "domain.h" +#include "error.h" #include "fix.h" #include "force.h" -#include "pair.h" -#include "domain.h" -#include "bond.h" -#include "angle.h" -#include "dihedral.h" +#include "group.h" #include "improper.h" -#include "special.h" #include "irregular.h" -#include "error.h" #include "memory.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" +#include "molecule.h" +#include "pair.h" +#include "special.h" +#include "update.h" + +#include +#include using namespace LAMMPS_NS; @@ -64,7 +62,7 @@ enum{NONE,APPEND,VALUE,MERGE}; const char *suffixes[] = {"/cuda","/gpu","/opt","/omp","/kk", "/coul/cut","/coul/long","/coul/msm", "/coul/dsf","/coul/debye","/coul/charmm", - NULL}; + nullptr}; /* ---------------------------------------------------------------------- */ @@ -76,8 +74,8 @@ ReadData::ReadData(LAMMPS *lmp) : Pointers(lmp) style = new char[MAXLINE]; buffer = new char[CHUNK*MAXLINE]; narg = maxarg = 0; - arg = NULL; - fp = NULL; + arg = nullptr; + fp = nullptr; // customize for new sections // pointers to atom styles that store bonus info @@ -134,9 +132,9 @@ void ReadData::command(int narg, char **arg) groupbit = 0; nfix = 0; - fix_index = NULL; - fix_header = NULL; - fix_section = NULL; + fix_index = nullptr; + fix_header = nullptr; + fix_section = nullptr; int iarg = 1; while (iarg < narg) { @@ -148,13 +146,13 @@ void ReadData::command(int narg, char **arg) if (atom->molecule_flag && (iarg+3 > narg)) error->all(FLERR,"Illegal read_data command"); addflag = VALUE; - bigint offset = force->bnumeric(FLERR,arg[iarg+1]); + bigint offset = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (offset > MAXTAGINT) error->all(FLERR,"Read data add atomID offset is too big"); id_offset = offset; if (atom->molecule_flag) { - offset = force->bnumeric(FLERR,arg[iarg+2]); + offset = utils::bnumeric(FLERR,arg[iarg+2],false,lmp); if (offset > MAXTAGINT) error->all(FLERR,"Read data add molID offset is too big"); mol_offset = offset; @@ -165,11 +163,11 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(arg[iarg],"offset") == 0) { if (iarg+6 > narg) error->all(FLERR,"Illegal read_data command"); offsetflag = 1; - toffset = force->inumeric(FLERR,arg[iarg+1]); - boffset = force->inumeric(FLERR,arg[iarg+2]); - aoffset = force->inumeric(FLERR,arg[iarg+3]); - doffset = force->inumeric(FLERR,arg[iarg+4]); - ioffset = force->inumeric(FLERR,arg[iarg+5]); + toffset = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + boffset = utils::inumeric(FLERR,arg[iarg+2],false,lmp); + aoffset = utils::inumeric(FLERR,arg[iarg+3],false,lmp); + doffset = utils::inumeric(FLERR,arg[iarg+4],false,lmp); + ioffset = utils::inumeric(FLERR,arg[iarg+5],false,lmp); if (toffset < 0 || boffset < 0 || aoffset < 0 || doffset < 0 || ioffset < 0) error->all(FLERR,"Illegal read_data command"); @@ -177,9 +175,9 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(arg[iarg],"shift") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal read_data command"); shiftflag = 1; - shift[0] = force->numeric(FLERR,arg[iarg+1]); - shift[1] = force->numeric(FLERR,arg[iarg+2]); - shift[2] = force->numeric(FLERR,arg[iarg+3]); + shift[0] = utils::numeric(FLERR,arg[iarg+1],false,lmp); + shift[1] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + shift[2] = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (domain->dimension == 2 && shift[2] != 0.0) error->all(FLERR,"Non-zero read_data shift z value for 2d simulation"); iarg += 4; @@ -188,28 +186,28 @@ void ReadData::command(int narg, char **arg) iarg ++; } else if (strcmp(arg[iarg],"extra/atom/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); - extra_atom_types = force->inumeric(FLERR,arg[iarg+1]); + extra_atom_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_atom_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; } else if (strcmp(arg[iarg],"extra/bond/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->bonds_allow) error->all(FLERR,"No bonds allowed with this atom style"); - extra_bond_types = force->inumeric(FLERR,arg[iarg+1]); + extra_bond_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_bond_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; } else if (strcmp(arg[iarg],"extra/angle/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->angles_allow) error->all(FLERR,"No angles allowed with this atom style"); - extra_angle_types = force->inumeric(FLERR,arg[iarg+1]); + extra_angle_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_angle_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; } else if (strcmp(arg[iarg],"extra/dihedral/types") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->dihedrals_allow) error->all(FLERR,"No dihedrals allowed with this atom style"); - extra_dihedral_types = force->inumeric(FLERR,arg[iarg+1]); + extra_dihedral_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_dihedral_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -217,7 +215,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (!atom->avec->impropers_allow) error->all(FLERR,"No impropers allowed with this atom style"); - extra_improper_types = force->inumeric(FLERR,arg[iarg+1]); + extra_improper_types = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (extra_improper_types < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -225,7 +223,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No bonds allowed with this atom style"); - atom->extra_bond_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_bond_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_bond_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -233,7 +231,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No angles allowed with this atom style"); - atom->extra_angle_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_angle_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_angle_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -241,7 +239,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No dihedrals allowed with this atom style"); - atom->extra_dihedral_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_dihedral_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_dihedral_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -249,7 +247,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No impropers allowed with this atom style"); - atom->extra_improper_per_atom = force->inumeric(FLERR,arg[iarg+1]); + atom->extra_improper_per_atom = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->extra_improper_per_atom < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -257,7 +255,7 @@ void ReadData::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal read_data command"); if (! atom->molecular) error->all(FLERR,"No bonded interactions allowed with this atom style"); - force->special_extra = force->inumeric(FLERR,arg[iarg+1]); + force->special_extra = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (force->special_extra < 0) error->all(FLERR,"Illegal read_data command"); iarg += 2; @@ -279,7 +277,7 @@ void ReadData::command(int narg, char **arg) fix_index[nfix] = modify->find_fix(arg[iarg+1]); if (fix_index[nfix] < 0) error->all(FLERR,"Fix ID for read_data does not exist"); - if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = NULL; + if (strcmp(arg[iarg+2],"NULL") == 0) fix_header[nfix] = nullptr; else { int n = strlen(arg[iarg+2]) + 1; fix_header[nfix] = new char[n]; @@ -296,8 +294,11 @@ void ReadData::command(int narg, char **arg) // error checks - if (domain->dimension == 2 && domain->zperiodic == 0) + if ((domain->dimension == 2) && (domain->zperiodic == 0)) error->all(FLERR,"Cannot run 2d simulation with nonperiodic Z dimension"); + if ((domain->nonperiodic == 2) && utils::strmatch(force->kspace_style,"^msm")) + error->all(FLERR,"Reading a data file with shrinkwrap boundaries is " + "not compatible with a MSM KSpace style"); if (domain->box_exist && !addflag) error->all(FLERR,"Cannot read_data without add keyword " "after simulation box is defined"); @@ -336,12 +337,12 @@ void ReadData::command(int narg, char **arg) // set up pointer to hold original styles while we replace them with "zero" - Pair *saved_pair = NULL; - Bond *saved_bond = NULL; - Angle *saved_angle = NULL; - Dihedral *saved_dihedral = NULL; - Improper *saved_improper = NULL; - KSpace *saved_kspace = NULL; + Pair *saved_pair = nullptr; + Bond *saved_bond = nullptr; + Angle *saved_angle = nullptr; + Dihedral *saved_dihedral = nullptr; + Improper *saved_improper = nullptr; + KSpace *saved_kspace = nullptr; if (coeffflag == 0) { char *coeffs[2]; @@ -349,33 +350,33 @@ void ReadData::command(int narg, char **arg) coeffs[1] = (char *) "nocoeff"; saved_pair = force->pair; - force->pair = NULL; + force->pair = nullptr; force->create_pair("zero",0); if (force->pair) force->pair->settings(2,coeffs); coeffs[0] = coeffs[1]; saved_bond = force->bond; - force->bond = NULL; + force->bond = nullptr; force->create_bond("zero",0); if (force->bond) force->bond->settings(1,coeffs); saved_angle = force->angle; - force->angle = NULL; + force->angle = nullptr; force->create_angle("zero",0); if (force->angle) force->angle->settings(1,coeffs); saved_dihedral = force->dihedral; - force->dihedral = NULL; + force->dihedral = nullptr; force->create_dihedral("zero",0); if (force->dihedral) force->dihedral->settings(1,coeffs); saved_improper = force->improper; - force->improper = NULL; + force->improper = nullptr; force->create_improper("zero",0); if (force->improper) force->improper->settings(1,coeffs); saved_kspace = force->kspace; - force->kspace = NULL; + force->kspace = nullptr; } // ----------------------------------------------------------------- @@ -416,7 +417,7 @@ void ReadData::command(int narg, char **arg) if (me == 0) { if (firstpass) utils::logmesg(lmp,"Reading data file ...\n"); open(arg[0]); - } else fp = NULL; + } else fp = nullptr; // read header info @@ -580,7 +581,7 @@ void ReadData::command(int narg, char **arg) if (firstpass) mass(); else skip_lines(ntypes); } else if (strcmp(keyword,"Pair Coeffs") == 0) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Must define pair_style before Pair Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->pair_style)) @@ -589,7 +590,7 @@ void ReadData::command(int narg, char **arg) paircoeffs(); } else skip_lines(ntypes); } else if (strcmp(keyword,"PairIJ Coeffs") == 0) { - if (force->pair == NULL) + if (force->pair == nullptr) error->all(FLERR,"Must define pair_style before PairIJ Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->pair_style)) @@ -600,7 +601,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Bond Coeffs") == 0) { if (atom->avec->bonds_allow == 0) error->all(FLERR,"Invalid data file section: Bond Coeffs"); - if (force->bond == NULL) + if (force->bond == nullptr) error->all(FLERR,"Must define bond_style before Bond Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->bond_style)) @@ -611,7 +612,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Angle Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: Angle Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before Angle Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->angle_style)) @@ -622,7 +623,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Dihedral Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: Dihedral Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR,"Must define dihedral_style before Dihedral Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->dihedral_style)) @@ -633,7 +634,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"Improper Coeffs") == 0) { if (atom->avec->impropers_allow == 0) error->all(FLERR,"Invalid data file section: Improper Coeffs"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR,"Must define improper_style before Improper Coeffs"); if (firstpass) { if (me == 0 && !style_match(style,force->improper_style)) @@ -645,14 +646,14 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"BondBond Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: BondBond Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before BondBond Coeffs"); if (firstpass) anglecoeffs(1); else skip_lines(nangletypes); } else if (strcmp(keyword,"BondAngle Coeffs") == 0) { if (atom->avec->angles_allow == 0) error->all(FLERR,"Invalid data file section: BondAngle Coeffs"); - if (force->angle == NULL) + if (force->angle == nullptr) error->all(FLERR,"Must define angle_style before BondAngle Coeffs"); if (firstpass) anglecoeffs(2); else skip_lines(nangletypes); @@ -661,7 +662,7 @@ void ReadData::command(int narg, char **arg) if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Invalid data file section: MiddleBondTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before " "MiddleBondTorsion Coeffs"); @@ -670,7 +671,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"EndBondTorsion Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: EndBondTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before EndBondTorsion Coeffs"); if (firstpass) dihedralcoeffs(2); @@ -678,7 +679,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"AngleTorsion Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: AngleTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before AngleTorsion Coeffs"); if (firstpass) dihedralcoeffs(3); @@ -687,7 +688,7 @@ void ReadData::command(int narg, char **arg) if (atom->avec->dihedrals_allow == 0) error->all(FLERR, "Invalid data file section: AngleAngleTorsion Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before " "AngleAngleTorsion Coeffs"); @@ -696,7 +697,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"BondBond13 Coeffs") == 0) { if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Invalid data file section: BondBond13 Coeffs"); - if (force->dihedral == NULL) + if (force->dihedral == nullptr) error->all(FLERR, "Must define dihedral_style before BondBond13 Coeffs"); if (firstpass) dihedralcoeffs(5); @@ -705,7 +706,7 @@ void ReadData::command(int narg, char **arg) } else if (strcmp(keyword,"AngleAngle Coeffs") == 0) { if (atom->avec->impropers_allow == 0) error->all(FLERR,"Invalid data file section: AngleAngle Coeffs"); - if (force->improper == NULL) + if (force->improper == nullptr) error->all(FLERR, "Must define improper_style before AngleAngle Coeffs"); if (firstpass) impropercoeffs(1); @@ -727,7 +728,7 @@ void ReadData::command(int narg, char **arg) if (me == 0) { if (compressed) pclose(fp); else fclose(fp); - fp = NULL; + fp = nullptr; } // done if this was 2nd pass @@ -775,14 +776,14 @@ void ReadData::command(int narg, char **arg) // create special bond lists for molecular systems - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } // for atom style template systems, count total bonds,angles,etc - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { Molecule **onemols = atom->avec->onemols; int *molindex = atom->molindex; int *molatom = atom->molatom; @@ -833,7 +834,7 @@ void ReadData::command(int narg, char **arg) // insure nbondtypes,etc are still consistent with template molecules, // in case data file re-defined them - if (atom->molecular == 2) atom->avec->onemols[0]->check_attributes(1); + if (atom->molecular == Atom::TEMPLATE) atom->avec->onemols[0]->check_attributes(1); // if adding atoms, migrate atoms to new processors // use irregular() b/c box size could have changed dramaticaly @@ -931,7 +932,7 @@ void ReadData::header(int firstpass) if (me == 0) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); } while (1) { @@ -939,7 +940,7 @@ void ReadData::header(int firstpass) // read a line and bcast length if (me == 0) { - if (fgets(line,MAXLINE,fp) == NULL) n = 0; + if (fgets(line,MAXLINE,fp) == nullptr) n = 0; else n = strlen(line) + 1; } MPI_Bcast(&n,1,MPI_INT,0,world); @@ -1185,7 +1186,7 @@ void ReadData::header(int firstpass) if (atom->nimpropers > 0 && atom->nimpropertypes <= 0) error->all(FLERR,"Impropers defined but no improper types"); - if (atom->molecular == 2) { + if (atom->molecular == Atom::TEMPLATE) { if (atom->nbonds || atom->nangles || atom->ndihedrals || atom->nimpropers) error->all(FLERR,"No molecule topology allowed with atom style template"); } @@ -1233,7 +1234,7 @@ void ReadData::atoms() // create global mapping of atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -1251,7 +1252,7 @@ void ReadData::velocities() if (me == 0) utils::logmesg(lmp," reading velocities ...\n"); int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -1269,7 +1270,7 @@ void ReadData::velocities() if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } if (me == 0) utils::logmesg(lmp,fmt::format(" {} velocities\n",natoms)); @@ -1291,7 +1292,7 @@ void ReadData::bonds(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1365,7 +1366,7 @@ void ReadData::angles(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1439,7 +1440,7 @@ void ReadData::dihedrals(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1513,7 +1514,7 @@ void ReadData::impropers(int firstpass) // allocate count if firstpass int nlocal = atom->nlocal; - int *count = NULL; + int *count = nullptr; if (firstpass) { memory->create(count,nlocal,"read_data:count"); memset(count,0,nlocal*sizeof(int)); @@ -1581,7 +1582,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) int nchunk,eof; int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -1600,7 +1601,7 @@ void ReadData::bonus(bigint nbonus, AtomVec *ptr, const char *type) if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } if (me == 0) @@ -1620,7 +1621,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) char *eof; int mapflag = 0; - if (atom->map_style == 0 && firstpass) { + if (atom->map_style == Atom::MAP_NONE && firstpass) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -1643,7 +1644,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) while (nchunk < nmax && nline <= CHUNK-MAXBODY) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); rv = sscanf(&buffer[m],"%d %d %d",&tmp,&ninteger,&ndouble); if (rv != 3) error->one(FLERR,"Incorrect format in Bodies section of data file"); @@ -1657,7 +1658,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) nword = 0; while (nword < ninteger) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); ncount = utils::trim_and_count_words(&buffer[m]); if (ncount == 0) error->one(FLERR,"Too few values in body lines in data file"); @@ -1671,7 +1672,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) nword = 0; while (nword < ndouble) { eof = fgets(&buffer[m],MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); ncount = utils::trim_and_count_words(&buffer[m]); if (ncount == 0) error->one(FLERR,"Too few values in body lines in data file"); @@ -1704,7 +1705,7 @@ void ReadData::bodies(int firstpass, AtomVec *ptr) if (mapflag && firstpass) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } if (me == 0 && firstpass) @@ -1745,7 +1746,7 @@ void ReadData::paircoeffs() for (int i = 0; i < ntypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,1,2,toffset); + parse_coeffs(buf,nullptr,1,2,toffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in PairCoeffs section"); force->pair->coeff(narg,arg); @@ -1772,7 +1773,7 @@ void ReadData::pairIJcoeffs() for (j = i; j < ntypes; j++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,0,2,toffset); + parse_coeffs(buf,nullptr,0,2,toffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in PairCoeffs section"); force->pair->coeff(narg,arg); @@ -1797,7 +1798,7 @@ void ReadData::bondcoeffs() for (int i = 0; i < nbondtypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - parse_coeffs(buf,NULL,0,1,boffset); + parse_coeffs(buf,nullptr,0,1,boffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in BondCoeffs section"); force->bond->coeff(narg,arg); @@ -1822,7 +1823,7 @@ void ReadData::anglecoeffs(int which) for (int i = 0; i < nangletypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,aoffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,aoffset); else if (which == 1) parse_coeffs(buf,"bb",0,1,aoffset); else if (which == 2) parse_coeffs(buf,"ba",0,1,aoffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in AngleCoeffs section"); @@ -1848,7 +1849,7 @@ void ReadData::dihedralcoeffs(int which) for (int i = 0; i < ndihedraltypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,doffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,doffset); else if (which == 1) parse_coeffs(buf,"mbt",0,1,doffset); else if (which == 2) parse_coeffs(buf,"ebt",0,1,doffset); else if (which == 3) parse_coeffs(buf,"at",0,1,doffset); @@ -1878,7 +1879,7 @@ void ReadData::impropercoeffs(int which) for (int i = 0; i < nimpropertypes; i++) { next = strchr(buf,'\n'); *next = '\0'; - if (which == 0) parse_coeffs(buf,NULL,0,1,ioffset); + if (which == 0) parse_coeffs(buf,nullptr,0,1,ioffset); else if (which == 1) parse_coeffs(buf,"aa",0,1,ioffset); if (narg == 0) error->all(FLERR,"Unexpected empty line in ImproperCoeffs section"); force->improper->coeff(narg,arg); @@ -1947,7 +1948,7 @@ void ReadData::open(char *file) #endif } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file {}: {}", file, utils::getsyserror())); } @@ -1972,15 +1973,15 @@ void ReadData::parse_keyword(int first) if (me == 0) { if (!first) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } while (eof == 0 && done == 0) { int blank = strspn(line," \t\n\r"); if ((blank == (int)strlen(line)) || (line[blank] == '#')) { - if (fgets(line,MAXLINE,fp) == NULL) eof = 1; + if (fgets(line,MAXLINE,fp) == nullptr) eof = 1; } else done = 1; } - if (fgets(buffer,MAXLINE,fp) == NULL) { + if (fgets(buffer,MAXLINE,fp) == nullptr) { eof = 1; buffer[0] = '\0'; } @@ -2033,16 +2034,16 @@ void ReadData::skip_lines(bigint n) { if (me) return; if (n <= 0) return; - char *eof = NULL; + char *eof = nullptr; for (bigint i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of data file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of data file"); } /* ---------------------------------------------------------------------- parse a line of coeffs into words, storing them in narg,arg trim anything from '#' onward word strings remain in line, are not copied - if addstr != NULL, add addstr as extra arg for class2 angle/dihedral/improper + if addstr != nullptr, add addstr as extra arg for class2 angle/dihedral/improper if 2nd word starts with letter, then is hybrid style, add addstr after it else add addstr before 2nd word if dupflag, duplicate 1st word, so pair_coeff "2" becomes "2 2" @@ -2067,7 +2068,7 @@ void ReadData::parse_coeffs(char *line, const char *addstr, arg[narg++] = word; if (addstr && narg == 2 && islower(word[0])) arg[narg++] = (char *) addstr; if (dupflag && narg == 1) arg[narg++] = word; - word = strtok(NULL," \t\n\r\f"); + word = strtok(nullptr," \t\n\r\f"); } // to avoid segfaults on empty lines @@ -2075,11 +2076,11 @@ void ReadData::parse_coeffs(char *line, const char *addstr, if (narg == 0) return; if (noffset) { - int value = force->inumeric(FLERR,arg[0]); + int value = utils::inumeric(FLERR,arg[0],false,lmp); sprintf(argoffset1,"%d",value+offset); arg[0] = argoffset1; if (noffset == 2) { - value = force->inumeric(FLERR,arg[1]); + value = utils::inumeric(FLERR,arg[1],false,lmp); sprintf(argoffset2,"%d",value+offset); arg[1] = argoffset2; } @@ -2096,12 +2097,12 @@ int ReadData::style_match(const char *one, const char *two) { int i,delta,len,len1,len2; - if ((one == NULL) || (two == NULL)) return 1; + if ((one == nullptr) || (two == nullptr)) return 1; len1 = strlen(one); len2 = strlen(two); - for (i = 0; suffixes[i] != NULL; i++) { + for (i = 0; suffixes[i] != nullptr; i++) { len = strlen(suffixes[i]); if ((delta = len1 - len) > 0) if (strcmp(one+delta,suffixes[i]) == 0) len1 = delta; diff --git a/src/read_dump.cpp b/src/read_dump.cpp index f47eda3262..8ea965b8e1 100644 --- a/src/read_dump.cpp +++ b/src/read_dump.cpp @@ -20,22 +20,19 @@ // before lmptype.h can set flags to insure it is done correctly #include "read_dump.h" -#include -#include -#include -#include "reader.h" -#include "style_reader.h" + #include "atom.h" #include "atom_vec.h" -#include "update.h" -#include "domain.h" #include "comm.h" -#include "force.h" -#include "irregular.h" +#include "domain.h" #include "error.h" +#include "irregular.h" #include "memory.h" -#include "utils.h" -#include "fmt/format.h" +#include "reader.h" +#include "style_reader.h" // IWYU pragma: keep +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -58,22 +55,22 @@ ReadDump::ReadDump(LAMMPS *lmp) : Pointers(lmp) triclinic = domain->triclinic; nfile = 0; - files = NULL; + files = nullptr; nnew = maxnew = 0; nfield = 0; - fieldtype = NULL; - fieldlabel = NULL; - fields = NULL; - buf = NULL; + fieldtype = nullptr; + fieldlabel = nullptr; + fields = nullptr; + buf = nullptr; int n = strlen("native") + 1; readerstyle = new char[n]; strcpy(readerstyle,"native"); nreader = 0; - readers = NULL; - nsnapatoms = NULL; + readers = nullptr; + nsnapatoms = nullptr; clustercomm = MPI_COMM_NULL; filereader = 0; parallel = 0; @@ -110,13 +107,13 @@ void ReadDump::command(int narg, char **arg) if (narg < 2) error->all(FLERR,"Illegal read_dump command"); store_files(1,&arg[0]); - bigint nstep = force->bnumeric(FLERR,arg[1]); + bigint nstep = utils::bnumeric(FLERR,arg[1],false,lmp); int nremain = narg - 2; if (nremain) nremain = fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = fields_and_keywords(0,NULL); + else nremain = fields_and_keywords(0,nullptr); if (nremain) setup_reader(nremain,&arg[narg-nremain]); - else setup_reader(0,NULL); + else setup_reader(0,nullptr); // find the snapshot and read/bcast/process header info @@ -246,7 +243,7 @@ void ReadDump::setup_reader(int narg, char **arg) for (int i = 0; i < nreader; i++) \ readers[i] = new Class(lmp); \ } -#include "style_reader.h" +#include "style_reader.h" // IWYU pragma: keep #undef READER_CLASS // unrecognized style @@ -600,7 +597,7 @@ void ReadDump::atoms() // if purgeflag set, delete all current atoms if (purgeflag) { - if (atom->map_style) atom->map_clear(); + if (atom->map_style != Atom::MAP_NONE) atom->map_clear(); npurge = atom->nlocal; atom->nlocal = atom->nghost = 0; atom->natoms = 0; @@ -625,7 +622,7 @@ void ReadDump::atoms() // this will be needed to match new atoms to old atoms int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->map_init(); atom->map_set(); @@ -646,7 +643,7 @@ void ReadDump::atoms() if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } else { atom->nghost = 0; atom->map_init(); @@ -716,7 +713,7 @@ void ReadDump::read_atoms() if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -756,7 +753,7 @@ void ReadDump::read_atoms() nnew = static_cast (olast - ofirst); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -782,7 +779,7 @@ void ReadDump::read_atoms() nnew = static_cast (sum); if (nnew > maxnew || maxnew == 0) { memory->destroy(fields); - maxnew = MAX(nnew,1); // avoid NULL ptr + maxnew = MAX(nnew,1); // avoid null pointer memory->create(fields,maxnew,nfield,"read_dump:fields"); } @@ -1108,7 +1105,7 @@ void ReadDump::migrate_new_atoms() Irregular *irregular = new Irregular(lmp); int nrecv = irregular->create_data(nnew,procassign,1); int newmaxnew = MAX(nrecv,maxnew); - newmaxnew = MAX(newmaxnew,1); // avoid NULL ptr + newmaxnew = MAX(newmaxnew,1); // avoid null pointer memory->create(newfields,newmaxnew,nfield,"read_dump:newfields"); irregular->exchange_data((char *) &fields[0][0],nfield*sizeof(double), (char *) &newfields[0][0]); @@ -1210,14 +1207,14 @@ int ReadDump::fields_and_keywords(int narg, char **arg) purgeflag = 0; trimflag = 0; addflag = NOADD; - for (int i = 0; i < nfield; i++) fieldlabel[i] = NULL; + for (int i = 0; i < nfield; i++) fieldlabel[i] = nullptr; scaleflag = 0; wrapflag = 1; while (iarg < narg) { if (strcmp(arg[iarg],"nfile") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); - multiproc_nfile = force->inumeric(FLERR,arg[iarg+1]); + multiproc_nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"box") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal read_dump command"); diff --git a/src/read_restart.cpp b/src/read_restart.cpp index 157992bce3..de1a089ebe 100644 --- a/src/read_restart.cpp +++ b/src/read_restart.cpp @@ -12,31 +12,30 @@ ------------------------------------------------------------------------- */ #include "read_restart.h" -#include -#include -#include + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "domain.h" -#include "comm.h" -#include "irregular.h" -#include "update.h" -#include "modify.h" -#include "fix_read_restart.h" -#include "group.h" -#include "force.h" -#include "pair.h" #include "bond.h" -#include "angle.h" +#include "comm.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix_read_restart.h" +#include "force.h" +#include "group.h" #include "improper.h" +#include "irregular.h" +#include "memory.h" +#include "modify.h" +#include "mpiio.h" +#include "pair.h" #include "special.h" #include "universe.h" -#include "mpiio.h" -#include "memory.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "update.h" + +#include +#include #include "lmprestart.h" @@ -109,7 +108,7 @@ void ReadRestart::command(int narg, char **arg) hfile.replace(hfile.find("%"),1,"base"); } fp = fopen(hfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", hfile, utils::getsyserror())); } @@ -167,7 +166,7 @@ void ReadRestart::command(int narg, char **arg) if (multiproc && me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } // read per-proc info @@ -175,7 +174,7 @@ void ReadRestart::command(int narg, char **arg) AtomVec *avec = atom->avec; int maxbuf = 0; - double *buf = NULL; + double *buf = nullptr; int m,flag; // MPI-IO input from single file @@ -256,7 +255,7 @@ void ReadRestart::command(int narg, char **arg) if (me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } } @@ -271,34 +270,34 @@ void ReadRestart::command(int narg, char **arg) std::string procfile = file; procfile.replace(procfile.find("%"),1,fmt::format("{}",iproc)); fp = fopen(procfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", procfile, utils::getsyserror())); - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); int procsperfile; - utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,nullptr,error); for (int i = 0; i < procsperfile; i++) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PERPROC) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); if (n > maxbuf) { maxbuf = n; memory->destroy(buf); memory->create(buf,maxbuf,"read_restart:buf"); } - utils::sfread(FLERR,buf,sizeof(double),n,fp,NULL,error); + utils::sfread(FLERR,buf,sizeof(double),n,fp,nullptr,error); m = 0; while (m < n) m += avec->unpack_restart(&buf[m]); } fclose(fp); - fp = NULL; + fp = nullptr; } } @@ -335,7 +334,7 @@ void ReadRestart::command(int narg, char **arg) std::string procfile = file; procfile.replace(procfile.find("%"),1,fmt::format("{}",icluster)); fp = fopen(procfile.c_str(),"rb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open restart file {}: {}", procfile, utils::getsyserror())); } @@ -343,10 +342,10 @@ void ReadRestart::command(int narg, char **arg) int flag,procsperfile; if (filereader) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PROCSPERFILE) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&procsperfile,sizeof(int),1,fp,nullptr,error); } MPI_Bcast(&procsperfile,1,MPI_INT,0,clustercomm); @@ -355,17 +354,17 @@ void ReadRestart::command(int narg, char **arg) for (int i = 0; i < procsperfile; i++) { if (filereader) { - utils::sfread(FLERR,&flag,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&flag,sizeof(int),1,fp,nullptr,error); if (flag != PERPROC) error->one(FLERR,"Invalid flag in peratom section of restart file"); - utils::sfread(FLERR,&n,sizeof(int),1,fp,NULL,error); + utils::sfread(FLERR,&n,sizeof(int),1,fp,nullptr,error); if (n > maxbuf) { maxbuf = n; memory->destroy(buf); memory->create(buf,maxbuf,"read_restart:buf"); } - utils::sfread(FLERR,buf,sizeof(double),n,fp,NULL,error); + utils::sfread(FLERR,buf,sizeof(double),n,fp,nullptr,error); if (i % nclusterprocs) { iproc = me + (i % nclusterprocs); @@ -392,9 +391,9 @@ void ReadRestart::command(int narg, char **arg) } } - if (filereader && fp != NULL) { + if (filereader && fp != nullptr) { fclose(fp); - fp = NULL; + fp = nullptr; } MPI_Comm_free(&clustercomm); } @@ -432,7 +431,7 @@ void ReadRestart::command(int narg, char **arg) // in case read by different proc than wrote restart file // first do map_init() since irregular->migrate_atoms() will do map_clear() - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } @@ -494,14 +493,14 @@ void ReadRestart::command(int narg, char **arg) // create global mapping of atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } // create special bond lists for molecular systems - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } @@ -571,11 +570,11 @@ void ReadRestart::file_search(char *inpfile, char *outfile) struct dirent *ep; DIR *dp = opendir(dirname); - if (dp == NULL) + if (dp == nullptr) error->one(FLERR,"Cannot open dir to search for restart file"); while ((ep = readdir(dp))) { if (strstr(ep->d_name,begin) != ep->d_name) continue; - if ((ptr = strstr(&ep->d_name[nbegin],end)) == NULL) continue; + if ((ptr = strstr(&ep->d_name[nbegin],end)) == nullptr) continue; if (strlen(end) == 0) ptr = ep->d_name + strlen(ep->d_name); *ptr = '\0'; if ((int)strlen(&ep->d_name[nbegin]) < n) { @@ -622,7 +621,7 @@ void ReadRestart::header() char *version = read_string(); if (me == 0) utils::logmesg(lmp,fmt::format(" restart file = {}, LAMMPS = {}\n", - version,universe->version)); + version,lmp->version)); delete [] version; // we have no forward compatibility, thus exit with error @@ -1035,7 +1034,7 @@ void ReadRestart::file_layout() memory->create(nproc_chunk_number,nprocs, "write_restart:nproc_chunk_number"); - utils::sfread(FLERR,all_written_send_sizes,sizeof(int),nprocs_file,fp,NULL,error); + utils::sfread(FLERR,all_written_send_sizes,sizeof(int),nprocs_file,fp,nullptr,error); if ((nprocs != nprocs_file) && !(atom->nextra_store)) { // nprocs differ, but atom sizes are fixed length, yeah! @@ -1233,7 +1232,7 @@ double ReadRestart::read_double() } /* ---------------------------------------------------------------------- - read a char string (including NULL) and bcast it + read a char string (including nullptr) and bcast it str is allocated here, ptr is returned, caller must deallocate ------------------------------------------------------------------------- */ @@ -1242,7 +1241,7 @@ char *ReadRestart::read_string() int n = read_int(); if (n < 0) error->all(FLERR,"Illegal size string or corrupt restart"); char *value = new char[n]; - if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,value,sizeof(char),n,fp,nullptr,error); MPI_Bcast(value,n,MPI_CHAR,0,world); return value; } @@ -1254,7 +1253,7 @@ char *ReadRestart::read_string() void ReadRestart::read_int_vec(int n, int *vec) { if (n < 0) error->all(FLERR,"Illegal size integer vector read requested"); - if (me == 0) utils::sfread(FLERR,vec,sizeof(int),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,vec,sizeof(int),n,fp,nullptr,error); MPI_Bcast(vec,n,MPI_INT,0,world); } @@ -1265,6 +1264,6 @@ void ReadRestart::read_int_vec(int n, int *vec) void ReadRestart::read_double_vec(int n, double *vec) { if (n < 0) error->all(FLERR,"Illegal size double vector read requested"); - if (me == 0) utils::sfread(FLERR,vec,sizeof(double),n,fp,NULL,error); + if (me == 0) utils::sfread(FLERR,vec,sizeof(double),n,fp,nullptr,error); MPI_Bcast(vec,n,MPI_DOUBLE,0,world); } diff --git a/src/reader.cpp b/src/reader.cpp index 2a6e4bf90c..218fd75dfa 100644 --- a/src/reader.cpp +++ b/src/reader.cpp @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #include "reader.h" -#include + #include "error.h" -#include "utils.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; @@ -25,7 +25,7 @@ using namespace LAMMPS_NS; Reader::Reader(LAMMPS *lmp) : Pointers(lmp) { - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -35,7 +35,7 @@ Reader::Reader(LAMMPS *lmp) : Pointers(lmp) void Reader::open_file(const char *file) { - if (fp != NULL) close_file(); + if (fp != nullptr) close_file(); compressed = 0; const char *suffix = file + strlen(file) - 3; @@ -55,7 +55,7 @@ void Reader::open_file(const char *file) #endif } - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file {}: {}", file, utils::getsyserror())); } @@ -67,10 +67,10 @@ void Reader::open_file(const char *file) void Reader::close_file() { - if (fp == NULL) return; + if (fp == nullptr) return; if (compressed) pclose(fp); else fclose(fp); - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- diff --git a/src/reader_native.cpp b/src/reader_native.cpp index 9f7caa01da..93a62e6cbf 100644 --- a/src/reader_native.cpp +++ b/src/reader_native.cpp @@ -12,12 +12,13 @@ ------------------------------------------------------------------------- */ #include "reader_native.h" -#include -#include -#include "atom.h" -#include "memory.h" + #include "error.h" -#include "utils.h" +#include "memory.h" +#include "tokenizer.h" + +#include +#include using namespace LAMMPS_NS; @@ -33,8 +34,7 @@ enum{UNSET,NOSCALE_NOWRAP,NOSCALE_WRAP,SCALE_NOWRAP,SCALE_WRAP}; ReaderNative::ReaderNative(LAMMPS *lmp) : Reader(lmp) { line = new char[MAXLINE]; - words = NULL; - fieldindex = NULL; + fieldindex = nullptr; } /* ---------------------------------------------------------------------- */ @@ -42,7 +42,6 @@ ReaderNative::ReaderNative(LAMMPS *lmp) : Reader(lmp) ReaderNative::~ReaderNative() { delete [] line; - delete [] words; memory->destroy(fieldindex); } @@ -55,7 +54,7 @@ ReaderNative::~ReaderNative() int ReaderNative::read_time(bigint &ntimestep) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) return 1; + if (eof == nullptr) return 1; // skip over unit and time information, if present. @@ -111,7 +110,7 @@ void ReaderNative::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flags = scaleflag+wrapflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 @@ -162,19 +161,16 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, char *labelline = &line[strlen("ITEM: ATOMS ")]; - nwords = utils::trim_and_count_words(labelline); - char **labels = new char*[nwords]; - labels[0] = strtok(labelline," \t\n\r\f"); - if (labels[0] == NULL) { - delete[] labels; - return 1; + std::map labels; + Tokenizer tokens(labelline); + nwords = 0; + + while(tokens.has_next()) { + labels[tokens.next()] = nwords++; } - for (int m = 1; m < nwords; m++) { - labels[m] = strtok(NULL," \t\n\r\f"); - if (labels[m] == NULL) { - delete[] labels; - return 1; - } + + if(nwords == 0) { + return 1; } // match each field with a column of per-atom data @@ -191,25 +187,25 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, for (int i = 0; i < nfield; i++) { if (fieldlabel[i]) { - fieldindex[i] = find_label(fieldlabel[i],nwords,labels); + fieldindex[i] = find_label(fieldlabel[i], labels); if (fieldtype[i] == X) xflag = 2*scaleflag + wrapflag + 1; else if (fieldtype[i] == Y) yflag = 2*scaleflag + wrapflag + 1; else if (fieldtype[i] == Z) zflag = 2*scaleflag + wrapflag + 1; } else if (fieldtype[i] == ID) - fieldindex[i] = find_label("id",nwords,labels); + fieldindex[i] = find_label("id", labels); else if (fieldtype[i] == TYPE) - fieldindex[i] = find_label("type",nwords,labels); + fieldindex[i] = find_label("type", labels); else if (fieldtype[i] == X) { - fieldindex[i] = find_label("x",nwords,labels); + fieldindex[i] = find_label("x", labels); xflag = NOSCALE_WRAP; if (fieldindex[i] < 0) { fieldindex[i] = nwords; - s_index = find_label("xs",nwords,labels); - u_index = find_label("xu",nwords,labels); - su_index = find_label("xsu",nwords,labels); + s_index = find_label("xs", labels); + u_index = find_label("xu", labels); + su_index = find_label("xsu", labels); if (s_index >= 0 && s_index < fieldindex[i]) { fieldindex[i] = s_index; xflag = SCALE_WRAP; @@ -226,13 +222,13 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, if (fieldindex[i] == nwords) fieldindex[i] = -1; } else if (fieldtype[i] == Y) { - fieldindex[i] = find_label("y",nwords,labels); + fieldindex[i] = find_label("y", labels); yflag = NOSCALE_WRAP; if (fieldindex[i] < 0) { fieldindex[i] = nwords; - s_index = find_label("ys",nwords,labels); - u_index = find_label("yu",nwords,labels); - su_index = find_label("ysu",nwords,labels); + s_index = find_label("ys", labels); + u_index = find_label("yu", labels); + su_index = find_label("ysu", labels); if (s_index >= 0 && s_index < fieldindex[i]) { fieldindex[i] = s_index; yflag = SCALE_WRAP; @@ -249,13 +245,13 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, if (fieldindex[i] == nwords) fieldindex[i] = -1; } else if (fieldtype[i] == Z) { - fieldindex[i] = find_label("z",nwords,labels); + fieldindex[i] = find_label("z", labels); zflag = NOSCALE_WRAP; if (fieldindex[i] < 0) { fieldindex[i] = nwords; - s_index = find_label("zs",nwords,labels); - u_index = find_label("zu",nwords,labels); - su_index = find_label("zsu",nwords,labels); + s_index = find_label("zs", labels); + u_index = find_label("zu", labels); + su_index = find_label("zsu", labels); if (s_index >= 0 && s_index < fieldindex[i]) { fieldindex[i] = s_index; zflag = SCALE_WRAP; @@ -272,42 +268,36 @@ bigint ReaderNative::read_header(double box[3][3], int &boxinfo, int &triclinic, if (fieldindex[i] == nwords) fieldindex[i] = -1; } else if (fieldtype[i] == VX) - fieldindex[i] = find_label("vx",nwords,labels); + fieldindex[i] = find_label("vx", labels); else if (fieldtype[i] == VY) - fieldindex[i] = find_label("vy",nwords,labels); + fieldindex[i] = find_label("vy", labels); else if (fieldtype[i] == VZ) - fieldindex[i] = find_label("vz",nwords,labels); + fieldindex[i] = find_label("vz", labels); else if (fieldtype[i] == FX) - fieldindex[i] = find_label("fx",nwords,labels); + fieldindex[i] = find_label("fx", labels); else if (fieldtype[i] == FY) - fieldindex[i] = find_label("fy",nwords,labels); + fieldindex[i] = find_label("fy", labels); else if (fieldtype[i] == FZ) - fieldindex[i] = find_label("fz",nwords,labels); + fieldindex[i] = find_label("fz", labels); else if (fieldtype[i] == Q) - fieldindex[i] = find_label("q",nwords,labels); + fieldindex[i] = find_label("q", labels); else if (fieldtype[i] == IX) - fieldindex[i] = find_label("ix",nwords,labels); + fieldindex[i] = find_label("ix", labels); else if (fieldtype[i] == IY) - fieldindex[i] = find_label("iy",nwords,labels); + fieldindex[i] = find_label("iy", labels); else if (fieldtype[i] == IZ) - fieldindex[i] = find_label("iz",nwords,labels); + fieldindex[i] = find_label("iz", labels); } - delete [] labels; - // set fieldflag = -1 if any unfound fields fieldflag = 0; for (int i = 0; i < nfield; i++) if (fieldindex[i] < 0) fieldflag = -1; - // create internal vector of word ptrs for future parsing of per-atom lines - - words = new char*[nwords]; - return natoms; } @@ -325,18 +315,17 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields) for (i = 0; i < n; i++) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); // tokenize the line + std::vector words = Tokenizer(line).as_vector(); - words[0] = strtok(line," \t\n\r\f"); - for (m = 1; m < nwords; m++) - words[m] = strtok(NULL," \t\n\r\f"); + if ((int)words.size() < nwords) error->one(FLERR,"Insufficient columns in dump file"); // convert selected fields to floats for (m = 0; m < nfield; m++) - fields[i][m] = atof(words[fieldindex[m]]); + fields[i][m] = atof(words[fieldindex[m]].c_str()); } } @@ -345,10 +334,12 @@ void ReaderNative::read_atoms(int n, int nfield, double **fields) return index of match or -1 if no match ------------------------------------------------------------------------- */ -int ReaderNative::find_label(const char *label, int n, char **labels) +int ReaderNative::find_label(const std::string &label, const std::map & labels) { - for (int i = 0; i < n; i++) - if (strcmp(label,labels[i]) == 0) return i; + auto it = labels.find(label); + if (it != labels.end()) { + return it->second; + } return -1; } @@ -360,8 +351,8 @@ int ReaderNative::find_label(const char *label, int n, char **labels) void ReaderNative::read_lines(int n) { - char *eof = NULL; + char *eof = nullptr; if (n <= 0) return; for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); } diff --git a/src/reader_native.h b/src/reader_native.h index de43e43003..f34bd094ab 100644 --- a/src/reader_native.h +++ b/src/reader_native.h @@ -24,6 +24,8 @@ ReaderStyle(native,ReaderNative) #include "reader.h" +#include + namespace LAMMPS_NS { class ReaderNative : public Reader { @@ -41,10 +43,9 @@ private: char *line; // line read from dump file int nwords; // # of per-atom columns in dump file - char **words; // ptrs to values in parsed per-atom line int *fieldindex; // - int find_label(const char *, int, char **); + int find_label(const std::string &label, const std::map & labels); void read_lines(int); }; diff --git a/src/reader_xyz.cpp b/src/reader_xyz.cpp index a5209956b9..82fe756c2e 100644 --- a/src/reader_xyz.cpp +++ b/src/reader_xyz.cpp @@ -16,10 +16,9 @@ ------------------------------------------------------------------------- */ #include "reader_xyz.h" -#include + #include "memory.h" #include "error.h" -#include "force.h" using namespace LAMMPS_NS; @@ -32,7 +31,7 @@ enum{ID,TYPE,X,Y,Z}; ReaderXYZ::ReaderXYZ(LAMMPS *lmp) : Reader(lmp) { line = new char[MAXLINE]; - fieldindex = NULL; + fieldindex = nullptr; nstep = 0; } @@ -53,7 +52,7 @@ ReaderXYZ::~ReaderXYZ() int ReaderXYZ::read_time(bigint &ntimestep) { char *eof = fgets(line,MAXLINE,fp); - if (eof == NULL) return 1; + if (eof == nullptr) return 1; // first line has to have the number of atoms // truncate the string to the first whitespace, @@ -65,7 +64,7 @@ int ReaderXYZ::read_time(bigint &ntimestep) break; } } - natoms = force->bnumeric(FLERR,line); + natoms = utils::bnumeric(FLERR,line,false,lmp); if (natoms < 1) error->one(FLERR,"Dump file is incorrectly formatted"); @@ -110,7 +109,7 @@ void ReaderXYZ::skip() match Nfield fields to per-atom column labels allocate and set fieldindex = which column each field maps to fieldtype = X,VX,IZ etc - fieldlabel = user-specified label or NULL if use fieldtype default + fieldlabel = user-specified label or nullptr if use fieldtype default xyz flag = scaledflag if has fieldlabel name, else set by x,xs,xu,xsu only called by proc 0 ------------------------------------------------------------------------- */ @@ -175,7 +174,7 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields) for (i = 0; i < n; i++) { eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); ++nid; rv = sscanf(line,"%*s%lg%lg%lg", &myx, &myy, &myz); @@ -217,8 +216,8 @@ void ReaderXYZ::read_atoms(int n, int nfield, double **fields) void ReaderXYZ::read_lines(int n) { - char *eof = NULL; + char *eof = nullptr; if (n <= 0) return; for (int i = 0; i < n; i++) eof = fgets(line,MAXLINE,fp); - if (eof == NULL) error->one(FLERR,"Unexpected end of dump file"); + if (eof == nullptr) error->one(FLERR,"Unexpected end of dump file"); } diff --git a/src/region.cpp b/src/region.cpp index 7a676de1af..c7c2627885 100644 --- a/src/region.cpp +++ b/src/region.cpp @@ -12,16 +12,17 @@ ------------------------------------------------------------------------- */ #include "region.h" + +#include "domain.h" +#include "error.h" +#include "input.h" +#include "lattice.h" +#include "math_extra.h" +#include "update.h" +#include "variable.h" + #include #include -#include "update.h" -#include "domain.h" -#include "lattice.h" -#include "input.h" -#include "variable.h" -#include "math_extra.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; @@ -29,8 +30,8 @@ using namespace LAMMPS_NS; Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) : Pointers(lmp), - id(NULL), style(NULL), contact(NULL), list(NULL), - xstr(NULL), ystr(NULL), zstr(NULL), tstr(NULL) + id(nullptr), style(nullptr), contact(nullptr), list(nullptr), + xstr(nullptr), ystr(nullptr), zstr(nullptr), tstr(nullptr) { int n = strlen(arg[0]) + 1; id = new char[n]; @@ -41,13 +42,13 @@ Region::Region(LAMMPS *lmp, int /*narg*/, char **arg) : strcpy(style,arg[1]); varshape = 0; - xstr = ystr = zstr = tstr = NULL; + xstr = ystr = zstr = tstr = nullptr; dx = dy = dz = 0.0; size_restart = 5; reset_vel(); copymode = 0; - list = NULL; + list = nullptr; nregion = 1; } @@ -365,18 +366,18 @@ void Region::options(int narg, char **arg) int n = strlen(&arg[iarg+1][2]) + 1; tstr = new char[n]; strcpy(tstr,&arg[iarg+1][2]); - point[0] = force->numeric(FLERR,arg[iarg+2]); - point[1] = force->numeric(FLERR,arg[iarg+3]); - point[2] = force->numeric(FLERR,arg[iarg+4]); - axis[0] = force->numeric(FLERR,arg[iarg+5]); - axis[1] = force->numeric(FLERR,arg[iarg+6]); - axis[2] = force->numeric(FLERR,arg[iarg+7]); + point[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + point[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); + point[2] = utils::numeric(FLERR,arg[iarg+4],false,lmp); + axis[0] = utils::numeric(FLERR,arg[iarg+5],false,lmp); + axis[1] = utils::numeric(FLERR,arg[iarg+6],false,lmp); + axis[2] = utils::numeric(FLERR,arg[iarg+7],false,lmp); rotateflag = 1; iarg += 8; } else if (strcmp(arg[iarg],"open") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal region command"); - int iface = force->inumeric(FLERR,arg[iarg+1]); + int iface = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (iface < 1 || iface > 6) error->all(FLERR,"Illegal region command"); // additional checks on valid face index are done by region classes open_faces[iface-1] = 1; diff --git a/src/region_block.cpp b/src/region_block.cpp index 8ea8b3f202..2204f2e6a4 100644 --- a/src/region_block.cpp +++ b/src/region_block.cpp @@ -12,11 +12,12 @@ ------------------------------------------------------------------------- */ #include "region_block.h" -#include -#include "force.h" + #include "domain.h" -#include "math_extra.h" #include "error.h" +#include "math_extra.h" + +#include using namespace LAMMPS_NS; @@ -34,7 +35,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[2],"INF") == 0) xlo = -BIG; else if (domain->triclinic == 0) xlo = domain->boxlo[0]; else xlo = domain->boxlo_bound[0]; - } else xlo = xscale*force->numeric(FLERR,arg[2]); + } else xlo = xscale*utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) { if (domain->box_exist == 0) @@ -42,7 +43,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[3],"INF") == 0) xhi = BIG; else if (domain->triclinic == 0) xhi = domain->boxhi[0]; else xhi = domain->boxhi_bound[0]; - } else xhi = xscale*force->numeric(FLERR,arg[3]); + } else xhi = xscale*utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) { if (domain->box_exist == 0) @@ -50,7 +51,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[4],"INF") == 0) ylo = -BIG; else if (domain->triclinic == 0) ylo = domain->boxlo[1]; else ylo = domain->boxlo_bound[1]; - } else ylo = yscale*force->numeric(FLERR,arg[4]); + } else ylo = yscale*utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) { if (domain->box_exist == 0) @@ -58,7 +59,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[5],"INF") == 0) yhi = BIG; else if (domain->triclinic == 0) yhi = domain->boxhi[1]; else yhi = domain->boxhi_bound[1]; - } else yhi = yscale*force->numeric(FLERR,arg[5]); + } else yhi = yscale*utils::numeric(FLERR,arg[5],false,lmp); if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) { if (domain->box_exist == 0) @@ -66,7 +67,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[6],"INF") == 0) zlo = -BIG; else if (domain->triclinic == 0) zlo = domain->boxlo[2]; else zlo = domain->boxlo_bound[2]; - } else zlo = zscale*force->numeric(FLERR,arg[6]); + } else zlo = zscale*utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { if (domain->box_exist == 0) @@ -74,7 +75,7 @@ RegBlock::RegBlock(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) if (strcmp(arg[7],"INF") == 0) zhi = BIG; else if (domain->triclinic == 0) zhi = domain->boxhi[2]; else zhi = domain->boxhi_bound[2]; - } else zhi = zscale*force->numeric(FLERR,arg[7]); + } else zhi = zscale*utils::numeric(FLERR,arg[7],false,lmp); // error check diff --git a/src/region_cone.cpp b/src/region_cone.cpp index 3c7d0a29d8..d669008e93 100644 --- a/src/region_cone.cpp +++ b/src/region_cone.cpp @@ -16,11 +16,12 @@ ------------------------------------------------------------------------- */ #include "region_cone.h" -#include -#include + #include "domain.h" #include "error.h" -#include "force.h" + +#include +#include using namespace LAMMPS_NS; @@ -43,20 +44,20 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : axis = arg[2][0]; if (axis == 'x') { - c1 = yscale*force->numeric(FLERR,arg[3]); - c2 = zscale*force->numeric(FLERR,arg[4]); - radiuslo = yscale*force->numeric(FLERR,arg[5]); - radiushi = yscale*force->numeric(FLERR,arg[6]); + c1 = yscale*utils::numeric(FLERR,arg[3],false,lmp); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); + radiuslo = yscale*utils::numeric(FLERR,arg[5],false,lmp); + radiushi = yscale*utils::numeric(FLERR,arg[6],false,lmp); } else if (axis == 'y') { - c1 = xscale*force->numeric(FLERR,arg[3]); - c2 = zscale*force->numeric(FLERR,arg[4]); - radiuslo = xscale*force->numeric(FLERR,arg[5]); - radiushi = xscale*force->numeric(FLERR,arg[6]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); + radiuslo = xscale*utils::numeric(FLERR,arg[5],false,lmp); + radiushi = xscale*utils::numeric(FLERR,arg[6],false,lmp); } else if (axis == 'z') { - c1 = xscale*force->numeric(FLERR,arg[3]); - c2 = yscale*force->numeric(FLERR,arg[4]); - radiuslo = xscale*force->numeric(FLERR,arg[5]); - radiushi = xscale*force->numeric(FLERR,arg[6]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); + c2 = yscale*utils::numeric(FLERR,arg[4],false,lmp); + radiuslo = xscale*utils::numeric(FLERR,arg[5],false,lmp); + radiushi = xscale*utils::numeric(FLERR,arg[6],false,lmp); } if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { @@ -78,9 +79,9 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : else lo = domain->boxlo_bound[2]; } } else { - if (axis == 'x') lo = xscale*force->numeric(FLERR,arg[7]); - if (axis == 'y') lo = yscale*force->numeric(FLERR,arg[7]); - if (axis == 'z') lo = zscale*force->numeric(FLERR,arg[7]); + if (axis == 'x') lo = xscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'y') lo = yscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'z') lo = zscale*utils::numeric(FLERR,arg[7],false,lmp); } if (strcmp(arg[8],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { @@ -102,9 +103,9 @@ RegCone::RegCone(LAMMPS *lmp, int narg, char **arg) : else hi = domain->boxhi_bound[2]; } } else { - if (axis == 'x') hi = xscale*force->numeric(FLERR,arg[8]); - if (axis == 'y') hi = yscale*force->numeric(FLERR,arg[8]); - if (axis == 'z') hi = zscale*force->numeric(FLERR,arg[8]); + if (axis == 'x') hi = xscale*utils::numeric(FLERR,arg[8],false,lmp); + if (axis == 'y') hi = yscale*utils::numeric(FLERR,arg[8],false,lmp); + if (axis == 'z') hi = zscale*utils::numeric(FLERR,arg[8],false,lmp); } // error check diff --git a/src/region_cylinder.cpp b/src/region_cylinder.cpp index b2c06270d0..2d40052e06 100644 --- a/src/region_cylinder.cpp +++ b/src/region_cylinder.cpp @@ -12,14 +12,15 @@ ------------------------------------------------------------------------- */ #include "region_cylinder.h" + +#include "domain.h" +#include "error.h" +#include "input.h" +#include "update.h" +#include "variable.h" + #include #include -#include "update.h" -#include "domain.h" -#include "input.h" -#include "variable.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; @@ -29,7 +30,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), c1str(NULL), c2str(NULL), rstr(NULL) + Region(lmp, narg, arg), c1str(nullptr), c2str(nullptr), rstr(nullptr) { options(narg-8,&arg[8]); @@ -51,7 +52,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = VARIABLE; varshape = 1; } else { - c1 = yscale*force->numeric(FLERR,arg[3]); + c1 = yscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -62,7 +63,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = VARIABLE; varshape = 1; } else { - c2 = zscale*force->numeric(FLERR,arg[4]); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); c2style = CONSTANT; } } else if (axis == 'y') { @@ -74,7 +75,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = VARIABLE; varshape = 1; } else { - c1 = xscale*force->numeric(FLERR,arg[3]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -85,7 +86,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = VARIABLE; varshape = 1; } else { - c2 = zscale*force->numeric(FLERR,arg[4]); + c2 = zscale*utils::numeric(FLERR,arg[4],false,lmp); c2style = CONSTANT; } } else if (axis == 'z') { @@ -97,7 +98,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c1style = VARIABLE; varshape = 1; } else { - c1 = xscale*force->numeric(FLERR,arg[3]); + c1 = xscale*utils::numeric(FLERR,arg[3],false,lmp); c1style = CONSTANT; } if (strstr(arg[4],"v_") == arg[4]) { @@ -108,7 +109,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : c2style = VARIABLE; varshape = 1; } else { - c2 = yscale*force->numeric(FLERR,arg[4]); + c2 = yscale*utils::numeric(FLERR,arg[4],false,lmp); c2style = CONSTANT; } } @@ -121,7 +122,7 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : rstyle = VARIABLE; varshape = 1; } else { - radius = force->numeric(FLERR,arg[5]); + radius = utils::numeric(FLERR,arg[5],false,lmp); if (axis == 'x') radius *= yscale; else radius *= xscale; rstyle = CONSTANT; @@ -151,9 +152,9 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : else lo = domain->boxlo_bound[2]; } } else { - if (axis == 'x') lo = xscale*force->numeric(FLERR,arg[6]); - if (axis == 'y') lo = yscale*force->numeric(FLERR,arg[6]); - if (axis == 'z') lo = zscale*force->numeric(FLERR,arg[6]); + if (axis == 'x') lo = xscale*utils::numeric(FLERR,arg[6],false,lmp); + if (axis == 'y') lo = yscale*utils::numeric(FLERR,arg[6],false,lmp); + if (axis == 'z') lo = zscale*utils::numeric(FLERR,arg[6],false,lmp); } if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { @@ -175,9 +176,9 @@ RegCylinder::RegCylinder(LAMMPS *lmp, int narg, char **arg) : else hi = domain->boxhi_bound[2]; } } else { - if (axis == 'x') hi = xscale*force->numeric(FLERR,arg[7]); - if (axis == 'y') hi = yscale*force->numeric(FLERR,arg[7]); - if (axis == 'z') hi = zscale*force->numeric(FLERR,arg[7]); + if (axis == 'x') hi = xscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'y') hi = yscale*utils::numeric(FLERR,arg[7],false,lmp); + if (axis == 'z') hi = zscale*utils::numeric(FLERR,arg[7],false,lmp); } // error check diff --git a/src/region_deprecated.cpp b/src/region_deprecated.cpp index afbe9e4189..137c167ab9 100644 --- a/src/region_deprecated.cpp +++ b/src/region_deprecated.cpp @@ -12,10 +12,10 @@ ------------------------------------------------------------------------- */ #include "region_deprecated.h" -#include + #include "comm.h" #include "error.h" -#include "utils.h" + using namespace LAMMPS_NS; diff --git a/src/region_intersect.cpp b/src/region_intersect.cpp index fe074a6b4c..35c6c502ab 100644 --- a/src/region_intersect.cpp +++ b/src/region_intersect.cpp @@ -12,22 +12,23 @@ ------------------------------------------------------------------------- */ #include "region_intersect.h" -#include + #include "domain.h" #include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ RegIntersect::RegIntersect(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), idsub(NULL) + Region(lmp, narg, arg), idsub(nullptr) { nregion = 0; if (narg < 5) error->all(FLERR,"Illegal region command"); - int n = force->inumeric(FLERR,arg[2]); + int n = utils::inumeric(FLERR,arg[2],false,lmp); if (n < 2) error->all(FLERR,"Illegal region command"); options(narg-(n+3),&arg[n+3]); diff --git a/src/region_plane.cpp b/src/region_plane.cpp index 85671357ef..4895c1f081 100644 --- a/src/region_plane.cpp +++ b/src/region_plane.cpp @@ -12,9 +12,10 @@ ------------------------------------------------------------------------- */ #include "region_plane.h" -#include + #include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; @@ -25,12 +26,12 @@ RegPlane::RegPlane(LAMMPS *lmp, int narg, char **arg) : { options(narg-8,&arg[8]); - xp = xscale*force->numeric(FLERR,arg[2]); - yp = yscale*force->numeric(FLERR,arg[3]); - zp = zscale*force->numeric(FLERR,arg[4]); - normal[0] = xscale*force->numeric(FLERR,arg[5]); - normal[1] = yscale*force->numeric(FLERR,arg[6]); - normal[2] = zscale*force->numeric(FLERR,arg[7]); + xp = xscale*utils::numeric(FLERR,arg[2],false,lmp); + yp = yscale*utils::numeric(FLERR,arg[3],false,lmp); + zp = zscale*utils::numeric(FLERR,arg[4],false,lmp); + normal[0] = xscale*utils::numeric(FLERR,arg[5],false,lmp); + normal[1] = yscale*utils::numeric(FLERR,arg[6],false,lmp); + normal[2] = zscale*utils::numeric(FLERR,arg[7],false,lmp); // enforce unit normal diff --git a/src/region_prism.cpp b/src/region_prism.cpp index b6c54c2fb9..af270cc47f 100644 --- a/src/region_prism.cpp +++ b/src/region_prism.cpp @@ -16,11 +16,12 @@ ------------------------------------------------------------------------- */ #include "region_prism.h" -#include + #include "domain.h" -#include "force.h" -#include "math_extra.h" #include "error.h" +#include "math_extra.h" + +#include using namespace LAMMPS_NS; @@ -37,46 +38,46 @@ RegPrism::RegPrism(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[2],"INF") == 0) xlo = -BIG; else xlo = domain->boxlo[0]; - } else xlo = xscale*force->numeric(FLERR,arg[2]); + } else xlo = xscale*utils::numeric(FLERR,arg[2],false,lmp); if (strcmp(arg[3],"INF") == 0 || strcmp(arg[3],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[3],"INF") == 0) xhi = BIG; else xhi = domain->boxhi[0]; - } else xhi = xscale*force->numeric(FLERR,arg[3]); + } else xhi = xscale*utils::numeric(FLERR,arg[3],false,lmp); if (strcmp(arg[4],"INF") == 0 || strcmp(arg[4],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[4],"INF") == 0) ylo = -BIG; else ylo = domain->boxlo[1]; - } else ylo = yscale*force->numeric(FLERR,arg[4]); + } else ylo = yscale*utils::numeric(FLERR,arg[4],false,lmp); if (strcmp(arg[5],"INF") == 0 || strcmp(arg[5],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[5],"INF") == 0) yhi = BIG; else yhi = domain->boxhi[1]; - } else yhi = yscale*force->numeric(FLERR,arg[5]); + } else yhi = yscale*utils::numeric(FLERR,arg[5],false,lmp); if (strcmp(arg[6],"INF") == 0 || strcmp(arg[6],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[6],"INF") == 0) zlo = -BIG; else zlo = domain->boxlo[2]; - } else zlo = zscale*force->numeric(FLERR,arg[6]); + } else zlo = zscale*utils::numeric(FLERR,arg[6],false,lmp); if (strcmp(arg[7],"INF") == 0 || strcmp(arg[7],"EDGE") == 0) { if (domain->box_exist == 0) error->all(FLERR,"Cannot use region INF or EDGE when box does not exist"); if (strcmp(arg[7],"INF") == 0) zhi = BIG; else zhi = domain->boxhi[2]; - } else zhi = zscale*force->numeric(FLERR,arg[7]); + } else zhi = zscale*utils::numeric(FLERR,arg[7],false,lmp); - xy = xscale*force->numeric(FLERR,arg[8]); - xz = xscale*force->numeric(FLERR,arg[9]); - yz = yscale*force->numeric(FLERR,arg[10]); + xy = xscale*utils::numeric(FLERR,arg[8],false,lmp); + xz = xscale*utils::numeric(FLERR,arg[9],false,lmp); + yz = yscale*utils::numeric(FLERR,arg[10],false,lmp); // error check // prism cannot be 0 thickness in any dim, else inverse blows up diff --git a/src/region_sphere.cpp b/src/region_sphere.cpp index bf874ad311..5282095c87 100644 --- a/src/region_sphere.cpp +++ b/src/region_sphere.cpp @@ -12,13 +12,14 @@ ------------------------------------------------------------------------- */ #include "region_sphere.h" + +#include "error.h" +#include "input.h" +#include "update.h" +#include "variable.h" + #include #include -#include "update.h" -#include "input.h" -#include "variable.h" -#include "error.h" -#include "force.h" using namespace LAMMPS_NS; @@ -27,7 +28,7 @@ enum{CONSTANT,VARIABLE}; /* ---------------------------------------------------------------------- */ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : - Region(lmp, narg, arg), xstr(NULL), ystr(NULL), zstr(NULL), rstr(NULL) + Region(lmp, narg, arg), xstr(nullptr), ystr(nullptr), zstr(nullptr), rstr(nullptr) { options(narg-6,&arg[6]); @@ -39,7 +40,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : xstyle = VARIABLE; varshape = 1; } else { - xc = xscale*force->numeric(FLERR,arg[2]); + xc = xscale*utils::numeric(FLERR,arg[2],false,lmp); xstyle = CONSTANT; } @@ -51,7 +52,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : ystyle = VARIABLE; varshape = 1; } else { - yc = yscale*force->numeric(FLERR,arg[3]); + yc = yscale*utils::numeric(FLERR,arg[3],false,lmp); ystyle = CONSTANT; } @@ -63,7 +64,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : zstyle = VARIABLE; varshape = 1; } else { - zc = zscale*force->numeric(FLERR,arg[4]); + zc = zscale*utils::numeric(FLERR,arg[4],false,lmp); zstyle = CONSTANT; } @@ -75,7 +76,7 @@ RegSphere::RegSphere(LAMMPS *lmp, int narg, char **arg) : rstyle = VARIABLE; varshape = 1; } else { - radius = xscale*force->numeric(FLERR,arg[5]); + radius = xscale*utils::numeric(FLERR,arg[5],false,lmp); rstyle = CONSTANT; } diff --git a/src/region_union.cpp b/src/region_union.cpp index be1fe6eeff..3ee0765f0b 100644 --- a/src/region_union.cpp +++ b/src/region_union.cpp @@ -12,10 +12,11 @@ ------------------------------------------------------------------------- */ #include "region_union.h" -#include + #include "domain.h" #include "error.h" -#include "force.h" + +#include using namespace LAMMPS_NS; @@ -24,11 +25,11 @@ using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ RegUnion::RegUnion(LAMMPS *lmp, int narg, char **arg) : Region(lmp, narg, arg), - idsub(NULL) + idsub(nullptr) { nregion = 0; if (narg < 5) error->all(FLERR,"Illegal region command"); - int n = force->inumeric(FLERR,arg[2]); + int n = utils::inumeric(FLERR,arg[2],false,lmp); if (n < 2) error->all(FLERR,"Illegal region command"); options(narg-(n+3),&arg[n+3]); diff --git a/src/replicate.cpp b/src/replicate.cpp index 6fe37bc600..b555a442bd 100644 --- a/src/replicate.cpp +++ b/src/replicate.cpp @@ -12,19 +12,17 @@ ------------------------------------------------------------------------- */ #include "replicate.h" -#include -#include + +#include "accelerator_kokkos.h" #include "atom.h" #include "atom_vec.h" -#include "force.h" -#include "domain.h" #include "comm.h" -#include "special.h" -#include "accelerator_kokkos.h" -#include "memory.h" +#include "domain.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "memory.h" +#include "special.h" + +#include using namespace LAMMPS_NS; @@ -52,9 +50,9 @@ void Replicate::command(int narg, char **arg) // nrep = total # of replications - int nx = force->inumeric(FLERR,arg[0]); - int ny = force->inumeric(FLERR,arg[1]); - int nz = force->inumeric(FLERR,arg[2]); + int nx = utils::inumeric(FLERR,arg[0],false,lmp); + int ny = utils::inumeric(FLERR,arg[1],false,lmp); + int nz = utils::inumeric(FLERR,arg[2],false,lmp); int nrep = nx*ny*nz; int bbox_flag = 0; @@ -156,7 +154,7 @@ void Replicate::command(int narg, char **arg) // also set atomKK for Kokkos version of Atom class Atom *old = atom; - atomKK = NULL; + atomKK = nullptr; if (lmp->kokkos) atom = atomKK = new AtomKokkos(lmp); else atom = new Atom(lmp); @@ -593,7 +591,7 @@ void Replicate::command(int narg, char **arg) if (atom->molecular) { if (atom->molecule[i] > 0) atom->molecule[i] += mol_offset; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow) for (j = 0; j < atom->num_bond[i]; j++) atom->bond_atom[i][j] += atom_offset; @@ -695,7 +693,7 @@ void Replicate::command(int narg, char **arg) if (atom->molecular) { if (atom->molecule[i] > 0) atom->molecule[i] += mol_offset; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->avec->bonds_allow) for (j = 0; j < atom->num_bond[i]; j++) atom->bond_atom[i][j] += atom_offset; @@ -768,14 +766,14 @@ void Replicate::command(int narg, char **arg) // create global mapping of atoms - if (atom->map_style) { + if (atom->map_style != Atom::MAP_NONE) { atom->map_init(); atom->map_set(); } // create special bond lists for molecular systems - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } diff --git a/src/rerun.cpp b/src/rerun.cpp index 3cd1c53628..00cd1d4080 100644 --- a/src/rerun.cpp +++ b/src/rerun.cpp @@ -12,17 +12,18 @@ ------------------------------------------------------------------------- */ #include "rerun.h" -#include -#include "read_dump.h" + #include "domain.h" -#include "update.h" +#include "error.h" +#include "finish.h" #include "integrate.h" #include "modify.h" #include "output.h" -#include "finish.h" +#include "read_dump.h" #include "timer.h" -#include "error.h" -#include "force.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -70,34 +71,34 @@ void Rerun::command(int narg, char **arg) while (iarg < narg) { if (strcmp(arg[iarg],"first") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - first = force->bnumeric(FLERR,arg[iarg+1]); + first = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (first < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"last") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - last = force->bnumeric(FLERR,arg[iarg+1]); + last = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (last < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"skip") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); - nskip = force->inumeric(FLERR,arg[iarg+1]); + nskip = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nskip <= 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); startflag = 1; - start = force->bnumeric(FLERR,arg[iarg+1]); + start = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (start < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"stop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal rerun command"); stopflag = 1; - stop = force->bnumeric(FLERR,arg[iarg+1]); + stop = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); if (stop < 0) error->all(FLERR,"Illegal rerun command"); iarg += 2; } else if (strcmp(arg[iarg],"dump") == 0) { @@ -119,9 +120,9 @@ void Rerun::command(int narg, char **arg) rd->store_files(nfile,arg); if (nremain) nremain = rd->fields_and_keywords(nremain,&arg[narg-nremain]); - else nremain = rd->fields_and_keywords(0,NULL); + else nremain = rd->fields_and_keywords(0,nullptr); if (nremain) rd->setup_reader(nremain,&arg[narg-nremain]); - else rd->setup_reader(0,NULL); + else rd->setup_reader(0,nullptr); // perform the pseudo run // invoke lmp->init() only once diff --git a/src/reset_atom_ids.cpp b/src/reset_atom_ids.cpp index 526de60cba..55513a1109 100644 --- a/src/reset_atom_ids.cpp +++ b/src/reset_atom_ids.cpp @@ -12,19 +12,19 @@ ------------------------------------------------------------------------- */ #include "reset_atom_ids.h" -#include -#include + #include "atom.h" #include "atom_vec.h" -#include "domain.h" #include "comm.h" -#include "modify.h" -#include "fix.h" -#include "special.h" -#include "memory.h" +#include "domain.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "fix.h" +#include "memory.h" +#include "modify.h" +#include "special.h" + +#include +#include using namespace LAMMPS_NS; @@ -34,7 +34,6 @@ using namespace LAMMPS_NS; ResetIDs::AtomRvous *ResetIDs::sortrvous; static int compare_coords(const void *, const void *); #else -#include "mergesort.h" // prototype for non-class function static int compare_coords(const int, const int, void *); #endif @@ -79,7 +78,7 @@ void ResetIDs::command(int narg, char **arg) // create an atom map if one doesn't exist already int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->nghost = 0; atom->map_init(); @@ -139,12 +138,12 @@ void ResetIDs::command(int narg, char **arg) comm->forward_comm_array(1,newIDs); // loop over bonds, angles, etc and reset IDs in stored topology arrays - // only necessary for molecular = 1, not molecular = 2 + // only necessary for molecular = Atom::MOLECULAR, not molecular = Atom::TEMPLATE // badcount = atom IDs that could not be found int badcount = 0; - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { int j,m; tagint oldID; @@ -267,7 +266,7 @@ void ResetIDs::command(int narg, char **arg) // need to update exclusions with new atom IDs - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { Special special(lmp); special.build(); } @@ -276,7 +275,7 @@ void ResetIDs::command(int narg, char **arg) if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } // clean up @@ -369,9 +368,9 @@ void ResetIDs::sort() // bins are numbered from 0 to Nbins-1 bigint nbins = (bigint) nbinx*nbiny*nbinz; - int nlo = nbins / nprocs; - int nhi = nlo + 1; - int nplo = nprocs - (nbins % nprocs); + bigint nlo = nbins / nprocs; + bigint nhi = nlo + 1; + bigint nplo = nprocs - (nbins % nprocs); bigint nbinlo = nplo*nlo; if (me < nplo) { @@ -509,7 +508,7 @@ int ResetIDs::sort_bins(int n, char *inbuf, sortrvous = in; qsort(order,count[ibin],sizeof(int),compare_coords); #else - merge_sort(order,count[ibin],(void *) in,compare_coords); + utils::merge_sort(order,count[ibin],(void *) in,compare_coords); #endif head[ibin] = last[ibin] = -1; diff --git a/src/reset_mol_ids.cpp b/src/reset_mol_ids.cpp index e3cc877548..970ac6beb4 100644 --- a/src/reset_mol_ids.cpp +++ b/src/reset_mol_ids.cpp @@ -16,46 +16,61 @@ ------------------------------------------------------------------------- */ #include "reset_mol_ids.h" -#include -#include + #include "atom.h" -#include "domain.h" #include "comm.h" +#include "compute_chunk_atom.h" +#include "compute_fragment_atom.h" +#include "domain.h" +#include "error.h" #include "group.h" #include "modify.h" -#include "compute_fragment_atom.h" -#include "compute_chunk_atom.h" -#include "utils.h" -#include "error.h" -#include "fmt/format.h" + +#include using namespace LAMMPS_NS; /* ---------------------------------------------------------------------- */ -ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) {} +ResetMolIDs::ResetMolIDs(LAMMPS *lmp) : Pointers(lmp) { + cfa = nullptr; + cca = nullptr; + + // default settings + + compressflag = 1; + singleflag = 0; + offset = -1; + + idfrag.clear(); + idchunk.clear(); +} /* ---------------------------------------------------------------------- */ +ResetMolIDs::~ResetMolIDs() +{ + if (!idfrag.empty()) modify->delete_compute(idfrag); + if (compressflag && !idchunk.empty()) modify->delete_compute(idchunk); +} + +/* ---------------------------------------------------------------------- + called as reset_mol_ids command in input script +------------------------------------------------------------------------- */ + void ResetMolIDs::command(int narg, char **arg) { if (domain->box_exist == 0) error->all(FLERR,"Reset_mol_ids command before simulation box is defined"); if (atom->tag_enable == 0) error->all(FLERR,"Cannot use reset_mol_ids unless atoms have IDs"); - if (atom->molecular != 1) + if (atom->molecular != Atom::MOLECULAR) error->all(FLERR,"Can only use reset_mol_ids on molecular systems"); // process args if (narg < 1) error->all(FLERR,"Illegal reset_mol_ids command"); - int igroup = group->find(arg[0]); - if (igroup == -1) error->all(FLERR,"Could not find reset_mol_ids group ID"); - int groupbit = group->bitmask[igroup]; - - int compressflag = 1; - int singleflag = 0; - tagint offset = -1; + char *groupid = arg[0]; int iarg = 1; while (iarg < narg) { @@ -86,20 +101,6 @@ void ResetMolIDs::command(int narg, char **arg) MPI_Barrier(world); double time1 = MPI_Wtime(); - // create instances of compute fragment/atom, compute reduce (if needed), - // and compute chunk/atom. all use the group-ID for this command - - const std::string idfrag = "reset_mol_ids_FRAGMENT_ATOM"; - if (singleflag) - modify->add_compute(fmt::format("{} {} fragment/atom single yes",idfrag,arg[0])); - else - modify->add_compute(fmt::format("{} {} fragment/atom single no",idfrag,arg[0])); - - const std::string idchunk = "reset_mol_ids_CHUNK_ATOM"; - if (compressflag) - modify->add_compute(fmt::format("{} {} chunk/atom molecule compress yes", - idchunk,arg[0])); - // initialize system since comm->borders() will be invoked lmp->init(); @@ -116,12 +117,73 @@ void ResetMolIDs::command(int narg, char **arg) comm->borders(); if (domain->triclinic) domain->lamda2x(atom->nlocal+atom->nghost); + // create computes + + create_computes((char *) "COMMAND",groupid); + + // reset molecule IDs + + reset(); + + // total time + + MPI_Barrier(world); + + if (comm->me == 0) { + if (nchunk < 0) + utils::logmesg(lmp,fmt::format(" number of new molecule IDs = unknown\n")); + else + utils::logmesg(lmp,fmt::format(" number of new molecule IDs = {}\n",nchunk)); + utils::logmesg(lmp,fmt::format(" reset_mol_ids CPU = {:.3f} seconds\n", + MPI_Wtime()-time1)); + } +} + +/* ---------------------------------------------------------------------- + create computes used by reset_mol_ids +------------------------------------------------------------------------- */ + +void ResetMolIDs::create_computes(char *fixid, char *groupid) +{ + int igroup = group->find(groupid); + if (igroup == -1) error->all(FLERR,"Could not find reset_mol_ids group ID"); + groupbit = group->bitmask[igroup]; + + // create instances of compute fragment/atom, compute reduce (if needed), + // and compute chunk/atom. all use the group-ID for this command. + // 'fixid' allows for creating independent instances of the computes + + idfrag = fmt::format("{}_reset_mol_ids_FRAGMENT_ATOM",fixid); + if (singleflag) + modify->add_compute(fmt::format("{} {} fragment/atom single yes",idfrag,groupid)); + else + modify->add_compute(fmt::format("{} {} fragment/atom single no",idfrag,groupid)); + + idchunk = fmt::format("{}_reset_mol_ids_CHUNK_ATOM",fixid); + if (compressflag) + modify->add_compute(fmt::format("{} {} chunk/atom molecule compress yes", + idchunk,groupid)); + + int icompute = modify->find_compute(idfrag); + cfa = (ComputeFragmentAtom *) modify->compute[icompute]; + + + if (compressflag) { + icompute = modify->find_compute(idchunk); + cca = (ComputeChunkAtom *) modify->compute[icompute]; + } +} + +/* ---------------------------------------------------------------------- + called from command() and directly from fixes that update molecules +------------------------------------------------------------------------- */ + +void ResetMolIDs::reset() +{ // invoke peratom method of compute fragment/atom // walks bond connectivity and assigns each atom a fragment ID // if singleflag = 0, atoms w/out bonds will be assigned fragID = 0 - int icompute = modify->find_compute(idfrag); - ComputeFragmentAtom *cfa = (ComputeFragmentAtom *) modify->compute[icompute]; cfa->compute_peratom(); double *fragIDs = cfa->vector_atom; @@ -138,15 +200,13 @@ void ResetMolIDs::command(int narg, char **arg) // if compressflag = 0, done // set nchunk = -1 since cannot easily determine # of new molecule IDs - int nchunk = -1; + nchunk = -1; // if compressflag = 1, invoke peratom method of compute chunk/atom // will compress new molecule IDs to be contiguous 1 to Nmol // NOTE: use of compute chunk/atom limits Nmol to a 32-bit int if (compressflag) { - icompute = modify->find_compute(idchunk); - ComputeChunkAtom *cca = (ComputeChunkAtom *) modify->compute[icompute]; cca->compute_peratom(); double *chunkIDs = cca->vector_atom; nchunk = cca->nchunk; @@ -193,22 +253,4 @@ void ResetMolIDs::command(int narg, char **arg) } } } - - // clean up - - modify->delete_compute(idfrag); - if (compressflag) modify->delete_compute(idchunk); - - // total time - - MPI_Barrier(world); - - if (comm->me == 0) { - if (nchunk < 0) - utils::logmesg(lmp,fmt::format(" number of new molecule IDs = unknown\n")); - else - utils::logmesg(lmp,fmt::format(" number of new molecule IDs = {}\n",nchunk)); - utils::logmesg(lmp,fmt::format(" reset_mol_ids CPU = {:.3f} seconds\n", - MPI_Wtime()-time1)); - } } diff --git a/src/reset_mol_ids.h b/src/reset_mol_ids.h index 83c0b5d80f..fbb6fceb03 100644 --- a/src/reset_mol_ids.h +++ b/src/reset_mol_ids.h @@ -27,7 +27,21 @@ namespace LAMMPS_NS { class ResetMolIDs : protected Pointers { public: ResetMolIDs(class LAMMPS *); + ~ResetMolIDs(); void command(int, char **); + void create_computes(char *, char *); + void reset(); + +private: + std::string idfrag, idchunk; + int nchunk; + int groupbit; + int compressflag; // 1 = contiguous values for new IDs + int singleflag; // 0 = mol IDs of single atoms set to 0 + tagint offset; // offset for contiguous mol ID values + + class ComputeFragmentAtom *cfa; + class ComputeChunkAtom *cca; }; } diff --git a/src/respa.cpp b/src/respa.cpp index f894333e39..ecc6cc58f3 100644 --- a/src/respa.cpp +++ b/src/respa.cpp @@ -16,30 +16,29 @@ ------------------------------------------------------------------------- */ #include "respa.h" -#include -#include -#include "neighbor.h" + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "domain.h" -#include "comm.h" -#include "fix.h" -#include "force.h" -#include "pair.h" #include "bond.h" -#include "angle.h" +#include "comm.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "fix_respa.h" +#include "force.h" #include "improper.h" #include "kspace.h" -#include "output.h" -#include "update.h" #include "modify.h" -#include "fix_respa.h" -#include "timer.h" -#include "error.h" -#include "utils.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" #include "pair_hybrid.h" -#include "fmt/format.h" +#include "timer.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -47,19 +46,19 @@ using namespace LAMMPS_NS; Respa::Respa(LAMMPS *lmp, int narg, char **arg) : Integrate(lmp, narg, arg), - step(NULL), loop(NULL), hybrid_level(NULL), hybrid_compute(NULL), - newton(NULL), fix_respa(NULL) + step(nullptr), loop(nullptr), hybrid_level(nullptr), hybrid_compute(nullptr), + newton(nullptr), fix_respa(nullptr) { nhybrid_styles = 0; if (narg < 1) error->all(FLERR,"Illegal run_style respa command"); - nlevels = force->inumeric(FLERR,arg[0]); + nlevels = utils::inumeric(FLERR,arg[0],false,lmp); if (nlevels < 1) error->all(FLERR,"Respa levels must be >= 1"); if (narg < nlevels) error->all(FLERR,"Illegal run_style respa command"); loop = new int[nlevels]; for (int iarg = 1; iarg < nlevels; iarg++) { - loop[iarg-1] = force->inumeric(FLERR,arg[iarg]); + loop[iarg-1] = utils::inumeric(FLERR,arg[iarg],false,lmp); if (loop[iarg-1] <= 0) error->all(FLERR,"Illegal run_style respa command"); } loop[nlevels-1] = 1; @@ -81,43 +80,43 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : while (iarg < narg) { if (strcmp(arg[iarg],"bond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_bond = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_bond = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_angle = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_angle = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"dihedral") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_dihedral = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_dihedral = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"improper") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_improper = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_improper = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"pair") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_pair = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_pair = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"inner") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_inner = force->inumeric(FLERR,arg[iarg+1]) - 1; - cutoff[0] = force->numeric(FLERR,arg[iarg+2]); - cutoff[1] = force->numeric(FLERR,arg[iarg+3]); + level_inner = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; + cutoff[0] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + cutoff[1] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"middle") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_middle = force->inumeric(FLERR,arg[iarg+1]) - 1; - cutoff[2] = force->numeric(FLERR,arg[iarg+2]); - cutoff[3] = force->numeric(FLERR,arg[iarg+3]); + level_middle = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; + cutoff[2] = utils::numeric(FLERR,arg[iarg+2],false,lmp); + cutoff[3] = utils::numeric(FLERR,arg[iarg+3],false,lmp); iarg += 4; } else if (strcmp(arg[iarg],"outer") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_outer = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_outer = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"kspace") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run_style respa command"); - level_kspace = force->inumeric(FLERR,arg[iarg+1]) - 1; + level_kspace = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; iarg += 2; } else if (strcmp(arg[iarg],"hybrid") == 0) { // the hybrid keyword requires a hybrid pair style @@ -132,7 +131,7 @@ Respa::Respa(LAMMPS *lmp, int narg, char **arg) : hybrid_compute = new int[nhybrid_styles]; for (int i=0; i < nhybrid_styles; ++i) { ++iarg; - hybrid_level[i] = force->inumeric(FLERR,arg[iarg])-1; + hybrid_level[i] = utils::inumeric(FLERR,arg[iarg],false,lmp)-1; } ++iarg; } else error->all(FLERR,"Illegal run_style respa command"); diff --git a/src/run.cpp b/src/run.cpp index 2c2f00a7a8..2e55fba439 100644 --- a/src/run.cpp +++ b/src/run.cpp @@ -12,17 +12,18 @@ ------------------------------------------------------------------------- */ #include "run.h" -#include + #include "domain.h" -#include "update.h" -#include "force.h" +#include "error.h" +#include "finish.h" +#include "input.h" #include "integrate.h" #include "modify.h" #include "output.h" -#include "finish.h" -#include "input.h" #include "timer.h" -#include "error.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -45,7 +46,7 @@ void Run::command(int narg, char **arg) if (timer->is_timeout()) return; - bigint nsteps_input = force->bnumeric(FLERR,arg[0]); + bigint nsteps_input = utils::bnumeric(FLERR,arg[0],false,lmp); // parse optional args @@ -68,12 +69,12 @@ void Run::command(int narg, char **arg) } else if (strcmp(arg[iarg],"start") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run command"); startflag = 1; - start = force->bnumeric(FLERR,arg[iarg+1]); + start = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"stop") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run command"); stopflag = 1; - stop = force->bnumeric(FLERR,arg[iarg+1]); + stop = utils::bnumeric(FLERR,arg[iarg+1],false,lmp); iarg += 2; } else if (strcmp(arg[iarg],"pre") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal run command"); @@ -90,11 +91,11 @@ void Run::command(int narg, char **arg) // all remaining args are commands // first,last = arg index of first/last commands - // set ncommands = 0 if single command and it is NULL + // set ncommands = 0 if single command and it is "NULL" } else if (strcmp(arg[iarg],"every") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal run command"); - nevery = force->inumeric(FLERR,arg[iarg+1]); + nevery = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nevery <= 0) error->all(FLERR,"Illegal run command"); first = iarg+2; last = narg-1; @@ -139,7 +140,7 @@ void Run::command(int narg, char **arg) // if nevery, make copies of arg strings that are commands // required because re-parsing commands via input->one() will wipe out args - char **commands = NULL; + char **commands = nullptr; if (nevery && ncommands > 0) { commands = new char*[ncommands]; ncommands = 0; diff --git a/src/set.cpp b/src/set.cpp index 01176f68c0..253e9118d3 100644 --- a/src/set.cpp +++ b/src/set.cpp @@ -12,32 +12,30 @@ ------------------------------------------------------------------------- */ #include "set.h" -#include -#include -#include -#include + #include "atom.h" #include "atom_vec.h" +#include "atom_vec_body.h" #include "atom_vec_ellipsoid.h" #include "atom_vec_line.h" #include "atom_vec_tri.h" -#include "atom_vec_body.h" -#include "domain.h" -#include "region.h" -#include "group.h" #include "comm.h" -#include "force.h" -#include "input.h" -#include "variable.h" -#include "random_park.h" -#include "random_mars.h" -#include "math_extra.h" -#include "math_const.h" -#include "memory.h" +#include "domain.h" #include "error.h" +#include "force.h" +#include "group.h" +#include "input.h" +#include "math_const.h" +#include "math_extra.h" +#include "memory.h" #include "modify.h" -#include "utils.h" -#include "fmt/format.h" +#include "random_mars.h" +#include "random_park.h" +#include "region.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -76,7 +74,7 @@ void Set::command(int narg, char **arg) int n = strlen(arg[1]) + 1; id = new char[n]; strcpy(id,arg[1]); - select = NULL; + select = nullptr; selection(atom->nlocal); // loop over keyword/value pairs @@ -95,15 +93,15 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg],"type") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ivalue = force->inumeric(FLERR,arg[iarg+1]); + else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); set(TYPE); iarg += 2; } else if (strcmp(arg[iarg],"type/fraction") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - newtype = force->inumeric(FLERR,arg[iarg+1]); - fraction = force->numeric(FLERR,arg[iarg+2]); - ivalue = force->inumeric(FLERR,arg[iarg+3]); + newtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + fraction = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (newtype <= 0 || newtype > atom->ntypes) error->all(FLERR,"Invalid value in set command"); if (fraction < 0.0 || fraction > 1.0) @@ -115,9 +113,9 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"type/ratio") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - newtype = force->inumeric(FLERR,arg[iarg+1]); - fraction = force->numeric(FLERR,arg[iarg+2]); - ivalue = force->inumeric(FLERR,arg[iarg+3]); + newtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + fraction = utils::numeric(FLERR,arg[iarg+2],false,lmp); + ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (newtype <= 0 || newtype > atom->ntypes) error->all(FLERR,"Invalid value in set command"); if (fraction < 0.0 || fraction > 1.0) @@ -129,9 +127,9 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"type/subset") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); - newtype = force->inumeric(FLERR,arg[iarg+1]); - nsubset = force->bnumeric(FLERR,arg[iarg+2]); - ivalue = force->inumeric(FLERR,arg[iarg+3]); + newtype = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + nsubset = utils::bnumeric(FLERR,arg[iarg+2],false,lmp); + ivalue = utils::inumeric(FLERR,arg[iarg+3],false,lmp); if (newtype <= 0 || newtype > atom->ntypes) error->all(FLERR,"Invalid value in set command"); if (nsubset < 0) @@ -144,7 +142,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"mol") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ivalue = force->inumeric(FLERR,arg[iarg+1]); + else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->molecule_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(MOLECULE); @@ -153,49 +151,49 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"x") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(X); iarg += 2; } else if (strcmp(arg[iarg],"y") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(Y); iarg += 2; } else if (strcmp(arg[iarg],"z") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(Z); iarg += 2; } else if (strcmp(arg[iarg],"vx") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VX); iarg += 2; } else if (strcmp(arg[iarg],"vy") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VY); iarg += 2; } else if (strcmp(arg[iarg],"vz") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); set(VZ); iarg += 2; } else if (strcmp(arg[iarg],"charge") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->q_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(CHARGE); @@ -204,7 +202,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"mass") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rmass_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(MASS); @@ -213,11 +211,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"shape") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->ellipsoid_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(SHAPE); @@ -226,7 +224,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"length") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->line_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(LENGTH); @@ -235,7 +233,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"tri") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->tri_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(TRI); @@ -244,11 +242,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dipole") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->mu_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(DIPOLE); @@ -256,8 +254,8 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dipole/random") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); - dvalue = force->numeric(FLERR,arg[iarg+2]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (!atom->mu_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -270,13 +268,13 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"spin") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else xvalue = force->numeric(FLERR,arg[iarg+2]); + else xvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else yvalue = force->numeric(FLERR,arg[iarg+3]); + else yvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); - else zvalue = force->numeric(FLERR,arg[iarg+4]); + else zvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (!atom->sp_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(SPIN); @@ -284,8 +282,8 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"spin/random") == 0) { if (iarg+3 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); - dvalue = force->numeric(FLERR,arg[iarg+2]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (!atom->sp_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -298,13 +296,13 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat") == 0) { if (iarg+5 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (strstr(arg[iarg+4],"v_") == arg[iarg+4]) varparse(arg[iarg+4],4); - else wvalue = force->numeric(FLERR,arg[iarg+4]); + else wvalue = utils::numeric(FLERR,arg[iarg+4],false,lmp); if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(QUAT); @@ -312,7 +310,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"quat/random") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->ellipsoid_flag && !atom->tri_flag && !atom->body_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -324,7 +322,7 @@ void Set::command(int narg, char **arg) if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); dvalue *= MY_PI/180.0; } if (!atom->line_flag) @@ -334,7 +332,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"theta/random") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (!atom->line_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0) @@ -345,11 +343,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"angmom") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->angmom_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(ANGMOM); @@ -358,11 +356,11 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"omega") == 0) { if (iarg+4 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else xvalue = force->numeric(FLERR,arg[iarg+1]); + else xvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yvalue = force->numeric(FLERR,arg[iarg+2]); + else yvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zvalue = force->numeric(FLERR,arg[iarg+3]); + else zvalue = utils::numeric(FLERR,arg[iarg+3],false,lmp); if (!atom->omega_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(OMEGA); @@ -371,7 +369,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"diameter") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->radius_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); set(DIAMETER); @@ -381,7 +379,7 @@ void Set::command(int narg, char **arg) (strcmp(arg[iarg],"density/disc") == 0)) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rmass_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (dvalue <= 0.0) error->all(FLERR,"Invalid density in set command"); @@ -397,7 +395,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"volume") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->vfrac_flag) error->all(FLERR,"Cannot set this attribute for this atom style"); if (dvalue <= 0.0) error->all(FLERR,"Invalid volume in set command"); @@ -410,17 +408,17 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") != 0) { ximageflag = 1; if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ximage = force->inumeric(FLERR,arg[iarg+1]); + else ximage = utils::inumeric(FLERR,arg[iarg+1],false,lmp); } if (strcmp(arg[iarg+2],"NULL") != 0) { yimageflag = 1; if (strstr(arg[iarg+2],"v_") == arg[iarg+2]) varparse(arg[iarg+2],2); - else yimage = force->inumeric(FLERR,arg[iarg+2]); + else yimage = utils::inumeric(FLERR,arg[iarg+2],false,lmp); } if (strcmp(arg[iarg+3],"NULL") != 0) { zimageflag = 1; if (strstr(arg[iarg+3],"v_") == arg[iarg+3]) varparse(arg[iarg+3],3); - else zimage = force->inumeric(FLERR,arg[iarg+3]); + else zimage = utils::inumeric(FLERR,arg[iarg+3],false,lmp); } if (ximageflag && ximage && !domain->xperiodic) error->all(FLERR, @@ -436,7 +434,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"bond") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->bonds_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->nbondtypes) @@ -446,7 +444,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"angle") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->angles_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->nangletypes) @@ -456,7 +454,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"dihedral") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->dihedrals_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->ndihedraltypes) @@ -466,7 +464,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"improper") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); - ivalue = force->inumeric(FLERR,arg[iarg+1]); + ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (atom->avec->impropers_allow == 0) error->all(FLERR,"Cannot set this attribute for this atom style"); if (ivalue <= 0 || ivalue > atom->nimpropertypes) @@ -477,7 +475,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/e") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->esph_flag) error->all(FLERR,"Cannot set meso/e for this atom style"); set(SPH_E); @@ -486,7 +484,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/cv") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->cv_flag) error->all(FLERR,"Cannot set meso/cv for this atom style"); set(SPH_CV); @@ -495,7 +493,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"sph/rho") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->rho_flag) error->all(FLERR,"Cannot set meso/rho for this atom style"); set(SPH_RHO); @@ -506,7 +504,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); } if (!atom->edpd_flag) @@ -519,7 +517,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); } if (!atom->edpd_flag) @@ -532,8 +530,8 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - cc_index = force->inumeric(FLERR,arg[iarg+1]); - dvalue = force->numeric(FLERR,arg[iarg+2]); + cc_index = utils::inumeric(FLERR,arg[iarg+1],false,lmp); + dvalue = utils::numeric(FLERR,arg[iarg+2],false,lmp); if (cc_index < 1) error->all(FLERR,"Illegal set command"); } if (!atom->tdpd_flag) @@ -544,7 +542,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"smd/mass/density") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->smd_flag) error->all(FLERR,"Cannot set smd/mass/density for this atom style"); set(SMD_MASS_DENSITY); @@ -553,7 +551,7 @@ void Set::command(int narg, char **arg) } else if (strcmp(arg[iarg],"smd/contact/radius") == 0) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (!atom->smd_flag) error->all(FLERR,"Cannot set smd/contact/radius " "for this atom style"); @@ -565,7 +563,7 @@ void Set::command(int narg, char **arg) if (strcmp(arg[iarg+1],"NULL") == 0) dvalue = -1.0; else if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); else { - dvalue = force->numeric(FLERR,arg[iarg+1]); + dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); if (dvalue < 0.0) error->all(FLERR,"Illegal set command"); } if (!atom->dpd_flag) @@ -576,7 +574,7 @@ void Set::command(int narg, char **arg) } else if (strstr(arg[iarg],"i_") == arg[iarg]) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else ivalue = force->inumeric(FLERR,arg[iarg+1]); + else ivalue = utils::inumeric(FLERR,arg[iarg+1],false,lmp); int flag; index_custom = atom->find_custom(&arg[iarg][2],flag); if (index_custom < 0 || flag != 0) @@ -587,7 +585,7 @@ void Set::command(int narg, char **arg) } else if (strstr(arg[iarg],"d_") == arg[iarg]) { if (iarg+2 > narg) error->all(FLERR,"Illegal set command"); if (strstr(arg[iarg+1],"v_") == arg[iarg+1]) varparse(arg[iarg+1],1); - else dvalue = force->numeric(FLERR,arg[iarg+1]); + else dvalue = utils::numeric(FLERR,arg[iarg+1],false,lmp); int flag; index_custom = atom->find_custom(&arg[iarg][2],flag); if (index_custom < 0 || flag != 1) @@ -633,7 +631,7 @@ void Set::selection(int n) if (atom->tag_enable == 0) error->all(FLERR,"Cannot use set atom with no atom IDs defined"); bigint nlobig,nhibig; - force->boundsbig(FLERR,id,MAXTAGINT,nlobig,nhibig); + utils::bounds(FLERR,id,1,MAXTAGINT,nlobig,nhibig,error); tagint *tag = atom->tag; for (int i = 0; i < n; i++) @@ -644,7 +642,7 @@ void Set::selection(int n) if (atom->molecule_flag == 0) error->all(FLERR,"Cannot use set mol with no molecule IDs defined"); bigint nlobig,nhibig; - force->boundsbig(FLERR,id,MAXTAGINT,nlobig,nhibig); + utils::bounds(FLERR,id,1,MAXTAGINT,nlobig,nhibig,error); tagint *molecule = atom->molecule; for (int i = 0; i < n; i++) @@ -652,7 +650,7 @@ void Set::selection(int n) else select[i] = 0; } else if (style == TYPE_SELECT) { - force->bounds(FLERR,id,atom->ntypes,nlo,nhi); + utils::bounds(FLERR,id,1,atom->ntypes,nlo,nhi,error); int *type = atom->type; for (int i = 0; i < n; i++) @@ -691,7 +689,7 @@ void Set::set(int keyword) { // evaluate atom-style variable(s) if necessary - vec1 = vec2 = vec3 = vec4 = NULL; + vec1 = vec2 = vec3 = vec4 = nullptr; if (varflag) { int nlocal = atom->nlocal; @@ -909,7 +907,7 @@ void Set::set(int keyword) // enforce quat rotation vector in z dir for 2d systems else if (keyword == QUAT) { - double *quat = NULL; + double *quat = nullptr; if (avec_ellipsoid && atom->ellipsoid[i] >= 0) quat = avec_ellipsoid->bonus[atom->ellipsoid[i]].quat; else if (avec_tri && atom->tri[i] >= 0) @@ -1256,7 +1254,7 @@ void Set::topology(int keyword) // error check - if (atom->molecular == 2) + if (atom->molecular == Atom::TEMPLATE) error->all(FLERR,"Cannot set bond topology types for atom style template"); // border swap to acquire ghost atom info @@ -1353,17 +1351,10 @@ void Set::topology(int keyword) /* ---------------------------------------------------------------------- */ -void Set::varparse(char *name, int m) +void Set::varparse(const char *name, int m) { varflag = 1; - - name = &name[2]; - int n = strlen(name) + 1; - char *str = new char[n]; - strcpy(str,name); - - int ivar = input->variable->find(str); - delete [] str; + int ivar = input->variable->find(name+2); if (ivar < 0) error->all(FLERR,"Variable name for set command does not exist"); diff --git a/src/set.h b/src/set.h index 6788849677..29f1ea526e 100644 --- a/src/set.h +++ b/src/set.h @@ -48,7 +48,7 @@ class Set : protected Pointers { void set(int); void setrandom(int); void topology(int); - void varparse(char *, int); + void varparse(const char *, int); }; } diff --git a/src/special.cpp b/src/special.cpp index 3780fab5c0..9661fa5ad8 100644 --- a/src/special.cpp +++ b/src/special.cpp @@ -12,18 +12,16 @@ ------------------------------------------------------------------------- */ #include "special.h" -#include -#include "atom.h" -#include "atom_vec.h" -#include "force.h" -#include "comm.h" -#include "modify.h" -#include "fix.h" + #include "accelerator_kokkos.h" // IWYU pragma: export +#include "atom.h" #include "atom_masks.h" +#include "atom_vec.h" +#include "comm.h" +#include "fix.h" +#include "force.h" #include "memory.h" -#include "utils.h" -#include "fmt/format.h" +#include "modify.h" using namespace LAMMPS_NS; @@ -36,7 +34,7 @@ Special::Special(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); MPI_Comm_size(world,&nprocs); - onetwo = onethree = onefour = NULL; + onetwo = onethree = onefour = nullptr; } /* ---------------------------------------------------------------------- */ diff --git a/src/table_file_reader.cpp b/src/table_file_reader.cpp index 525db24961..9006b44af9 100644 --- a/src/table_file_reader.cpp +++ b/src/table_file_reader.cpp @@ -15,14 +15,10 @@ Contributing authors: Richard Berger (Temple U) ------------------------------------------------------------------------- */ -#include "lammps.h" -#include "error.h" #include "table_file_reader.h" -#include "utils.h" -#include "tokenizer.h" -#include "fmt/format.h" -#include +#include "text_file_reader.h" +#include "tokenizer.h" using namespace LAMMPS_NS; @@ -37,7 +33,7 @@ TableFileReader::TableFileReader(LAMMPS *lmp, TableFileReader::~TableFileReader() { } -char *TableFileReader::find_section_start(const std::string & keyword) { +char *TableFileReader::find_section_start(const std::string &keyword) { char *line = nullptr; while ((line = reader->next_line())) { ValueTokenizer values(line); diff --git a/src/text_file_reader.cpp b/src/text_file_reader.cpp index 8abe1b001f..a1892edfad 100644 --- a/src/text_file_reader.cpp +++ b/src/text_file_reader.cpp @@ -15,19 +15,31 @@ Contributing authors: Richard Berger (Temple U) ------------------------------------------------------------------------- */ -#include "lammps.h" -#include "force.h" -#include "error.h" -#include "comm.h" -#include "utils.h" #include "text_file_reader.h" -#include "tokenizer.h" + #include "fmt/format.h" +#include "tokenizer.h" +#include "utils.h" #include using namespace LAMMPS_NS; +/** Class for reading and parsing text files + * + * The value of the class member variable *ignore_comments* controls + * whether any text following the pound sign (#) should be ignored (true) + * or not (false). Default: true, i.e. ignore. +\verbatim embed:rst + +*See also* + :cpp:class:`TextFileReader` + +\endverbatim + * + * \param filename Name of file to be read + * \param filetype Description of file type for error messages */ + TextFileReader::TextFileReader(const std::string &filename, const std::string &filetype) : filename(filename), filetype(filetype), ignore_comments(true) { @@ -38,10 +50,14 @@ TextFileReader::TextFileReader(const std::string &filename, const std::string &f } } +/** Closes the file */ + TextFileReader::~TextFileReader() { fclose(fp); } +/** Read the next line and ignore it */ + void TextFileReader::skip_line() { char *ptr = fgets(line, MAXLINE, fp); if (ptr == nullptr) { @@ -50,6 +66,20 @@ void TextFileReader::skip_line() { } } +/** Read the next line(s) until *nparams* words have been read. + * + * This reads a line and counts the words in it, if the number + * is less than the requested number, it will read the next + * line, as well. Output will be a string with all read lines + * combined. The purpose is to somewhat replicate the reading + * behavior of formatted files in Fortran. + * + * If the *ignore_comments* class member has the value *true*, + * then any text read in is truncated at the first '#' character. + * + * \param nparams Number of words that must be read. Default: 0 + * \return String with the concatenated text */ + char *TextFileReader::next_line(int nparams) { // concatenate lines until have nparams words int n = 0; @@ -82,7 +112,6 @@ char *TextFileReader::next_line(int nparams) { return nullptr; } - // strip comment if (ignore_comments && (ptr = strchr(line, '#'))) *ptr = '\0'; @@ -97,6 +126,15 @@ char *TextFileReader::next_line(int nparams) { return line; } +/** Read lines until *n* doubles have been read and stored in array *list* + * + * This reads lines from the file using the next_line() function, + * and splits them into floating-point numbers using the + * ValueTokenizer class and stores the number is the provided list. + * + * \param list Pointer to array with suitable storage for *n* doubles + * \param n Number of doubles to be read */ + void TextFileReader::next_dvector(double * list, int n) { int i = 0; while (i < n) { @@ -116,6 +154,16 @@ void TextFileReader::next_dvector(double * list, int n) { } } -ValueTokenizer TextFileReader::next_values(int nparams, const std::string & separators) { +/** Read text until *nparams* words are read and passed to a tokenizer object for custom parsing. + * + * This reads lines from the file using the next_line() function, + * and splits them into floating-point numbers using the + * ValueTokenizer class and stores the number is the provided list. + * + * \param nparams Number of words to be read + * \param separators String with list of separators. + * \return ValueTokenizer object for read in text */ + +ValueTokenizer TextFileReader::next_values(int nparams, const std::string &separators) { return ValueTokenizer(next_line(nparams), separators); } diff --git a/src/text_file_reader.h b/src/text_file_reader.h index 80a5d756ea..0b90304911 100644 --- a/src/text_file_reader.h +++ b/src/text_file_reader.h @@ -18,11 +18,10 @@ #ifndef LMP_TEXT_FILE_READER_H #define LMP_TEXT_FILE_READER_H -#include -#include -#include #include "tokenizer.h" +#include + namespace LAMMPS_NS { class TextFileReader { @@ -33,7 +32,7 @@ namespace LAMMPS_NS FILE *fp; public: - bool ignore_comments; + bool ignore_comments; //!< Controls whether comments are ignored TextFileReader(const std::string &filename, const std::string &filetype); ~TextFileReader(); @@ -42,13 +41,13 @@ namespace LAMMPS_NS char * next_line(int nparams = 0); void next_dvector(double * list, int n); - ValueTokenizer next_values(int nparams, const std::string & separators = TOKENIZER_DEFAULT_SEPARATORS); + ValueTokenizer next_values(int nparams, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); }; class FileReaderException : public std::exception { std::string message; public: - FileReaderException(const std::string & msg) : message(msg) { + FileReaderException(const std::string &msg) : message(msg) { } ~FileReaderException() throw() { @@ -61,7 +60,7 @@ namespace LAMMPS_NS class EOFException : public FileReaderException { public: - EOFException(const std::string & msg) : FileReaderException(msg) { + EOFException(const std::string &msg) : FileReaderException(msg) { } }; diff --git a/src/thermo.cpp b/src/thermo.cpp index dddfb8b21c..485974cc81 100644 --- a/src/thermo.cpp +++ b/src/thermo.cpp @@ -16,36 +16,36 @@ // before lmptype.h can set flags to insure it is done correctly #include "thermo.h" -#include + +#include "angle.h" +#include "atom.h" +#include "bond.h" +#include "comm.h" +#include "compute.h" +#include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "fix.h" +#include "force.h" +#include "group.h" +#include "improper.h" +#include "input.h" +#include "kspace.h" +#include "lattice.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" +#include "timer.h" +#include "tokenizer.h" +#include "universe.h" +#include "update.h" +#include "variable.h" + #include #include -#include "atom.h" -#include "update.h" -#include "comm.h" -#include "domain.h" -#include "universe.h" -#include "lattice.h" -#include "group.h" -#include "modify.h" -#include "fix.h" -#include "compute.h" -#include "input.h" -#include "variable.h" -#include "neighbor.h" -#include "force.h" -#include "pair.h" -#include "bond.h" -#include "angle.h" -#include "dihedral.h" -#include "improper.h" -#include "kspace.h" -#include "output.h" -#include "timer.h" -#include "memory.h" -#include "error.h" -#include "math_const.h" -#include "utils.h" -#include "fmt/format.h" using namespace LAMMPS_NS; using namespace MathConst; @@ -125,7 +125,7 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) int expand = 0; char **earg; - int nvalues = input->expand_args(narg-1,&arg[1],0,earg); + int nvalues = utils::expand_args(FLERR,narg-1,&arg[1],0,earg,lmp); if (earg != &arg[1]) expand = 1; line = new char[256+nvalues*64]; @@ -147,9 +147,9 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) // ptrs, flags, IDs for compute objects thermo may use or create - temperature = NULL; - pressure = NULL; - pe = NULL; + temperature = nullptr; + pressure = nullptr; + pe = nullptr; index_temp = index_press_scalar = index_press_vector = index_pe = -1; @@ -179,10 +179,10 @@ Thermo::Thermo(LAMMPS *lmp, int narg, char **arg) : Pointers(lmp) sprintf(format_bigint_one_def,"%%8%s",&bigint_format[1]); sprintf(format_bigint_multi_def,"%%14%s",&bigint_format[1]); - format_line_user = NULL; - format_float_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; + format_line_user = nullptr; + format_float_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; } /* ---------------------------------------------------------------------- */ @@ -226,37 +226,36 @@ void Thermo::init() // add '/n' every 3 values if lineflag = MULTILINE // add trailing '/n' to last value - char *format_line = NULL; + ValueTokenizer * format_line = nullptr; if (format_line_user) { - int n = strlen(format_line_user) + 1; - format_line = new char[n]; - strcpy(format_line,format_line_user); + format_line = new ValueTokenizer(format_line_user); } - char *ptr,*format_line_ptr; + const char *ptr = nullptr; + std::string format_line_user_def; for (i = 0; i < nfield; i++) { + format[i][0] = '\0'; if (lineflag == MULTILINE && i % 3 == 0) strcat(format[i],"\n"); - if (format_line) { - if (i == 0) format_line_ptr = strtok(format_line," \0"); - else format_line_ptr = strtok(NULL," \0"); + if (format_line_user) { + format_line_user_def = format_line->next_string(); } if (format_column_user[i]) ptr = format_column_user[i]; else if (vtype[i] == FLOAT) { if (format_float_user) ptr = format_float_user; - else if (format_line_user) ptr = format_line_ptr; + else if (format_line_user) ptr = format_line_user_def.c_str(); else if (lineflag == ONELINE) ptr = format_float_one_def; else if (lineflag == MULTILINE) ptr = format_float_multi_def; } else if (vtype[i] == INT) { if (format_int_user) ptr = format_int_user; - else if (format_line_user) ptr = format_line_ptr; + else if (format_line_user) ptr = format_line_user_def.c_str(); else if (lineflag == ONELINE) ptr = format_int_one_def; else if (lineflag == MULTILINE) ptr = format_int_multi_def; } else if (vtype[i] == BIGINT) { if (format_bigint_user) ptr = format_bigint_user; - else if (format_line_user) ptr = format_line_ptr; + else if (format_line_user) ptr = format_line_user_def.c_str(); else if (lineflag == ONELINE) ptr = format_bigint_one_def; else if (lineflag == MULTILINE) ptr = format_bigint_multi_def; } @@ -267,7 +266,7 @@ void Thermo::init() } strcat(format[nfield-1],"\n"); - delete [] format_line; + delete format_line; // find current ptr for each Compute ID @@ -564,13 +563,13 @@ void Thermo::modify_params(int narg, char **arg) delete [] format_int_user; delete [] format_bigint_user; delete [] format_float_user; - format_line_user = NULL; - format_int_user = NULL; - format_bigint_user = NULL; - format_float_user = NULL; + format_line_user = nullptr; + format_int_user = nullptr; + format_bigint_user = nullptr; + format_float_user = nullptr; for (int i = 0; i < nfield_initial+1; i++) { delete [] format_column_user[i]; - format_column_user[i] = NULL; + format_column_user[i] = nullptr; } iarg += 2; continue; @@ -594,7 +593,7 @@ void Thermo::modify_params(int narg, char **arg) // replace "d" in format_int_user with bigint format specifier // use of &str[1] removes leading '%' from BIGINT_FORMAT string char *ptr = strchr(format_int_user,'d'); - if (ptr == NULL) + if (ptr == nullptr) error->all(FLERR, "Thermo_modify int format does not contain d character"); char str[8]; @@ -608,7 +607,7 @@ void Thermo::modify_params(int narg, char **arg) format_float_user = new char[n]; strcpy(format_float_user,arg[iarg+2]); } else { - int i = force->inumeric(FLERR,arg[iarg+1]) - 1; + int i = utils::inumeric(FLERR,arg[iarg+1],false,lmp) - 1; if (i < 0 || i >= nfield_initial+1) error->all(FLERR,"Illegal thermo_modify command"); if (format_column_user[i]) delete [] format_column_user[i]; @@ -633,14 +632,14 @@ void Thermo::allocate() int n = nfield_initial + 1; keyword = new char*[n]; - for (int i = 0; i < n; i++) keyword[i] = NULL; + for (int i = 0; i < n; i++) keyword[i] = nullptr; vfunc = new FnPtr[n]; vtype = new int[n]; format = new char*[n]; for (int i = 0; i < n; i++) format[i] = new char[32]; format_column_user = new char*[n]; - for (int i = 0; i < n; i++) format_column_user[i] = NULL; + for (int i = 0; i < n; i++) format_column_user[i] = nullptr; field2index = new int[n]; argindex1 = new int[n]; @@ -709,191 +708,192 @@ void Thermo::parse_fields(char *str) // customize a new keyword by adding to if statement - char *word = strtok(str," \0"); - while (word) { + ValueTokenizer keywords(str); + while (keywords.has_next()) { + std::string word = keywords.next_string(); - if (strcmp(word,"step") == 0) { + if (word == "step") { addfield("Step",&Thermo::compute_step,BIGINT); - } else if (strcmp(word,"elapsed") == 0) { + } else if (word == "elapsed") { addfield("Elapsed",&Thermo::compute_elapsed,BIGINT); - } else if (strcmp(word,"elaplong") == 0) { + } else if (word == "elaplong") { addfield("Elaplong",&Thermo::compute_elapsed_long,BIGINT); - } else if (strcmp(word,"dt") == 0) { + } else if (word == "dt") { addfield("Dt",&Thermo::compute_dt,FLOAT); - } else if (strcmp(word,"time") == 0) { + } else if (word == "time") { addfield("Time",&Thermo::compute_time,FLOAT); - } else if (strcmp(word,"cpu") == 0) { + } else if (word == "cpu") { addfield("CPU",&Thermo::compute_cpu,FLOAT); - } else if (strcmp(word,"tpcpu") == 0) { + } else if (word == "tpcpu") { addfield("T/CPU",&Thermo::compute_tpcpu,FLOAT); - } else if (strcmp(word,"spcpu") == 0) { + } else if (word == "spcpu") { addfield("S/CPU",&Thermo::compute_spcpu,FLOAT); - } else if (strcmp(word,"cpuremain") == 0) { + } else if (word == "cpuremain") { addfield("CPULeft",&Thermo::compute_cpuremain,FLOAT); - } else if (strcmp(word,"part") == 0) { + } else if (word == "part") { addfield("Part",&Thermo::compute_part,INT); - } else if (strcmp(word,"timeremain") == 0) { + } else if (word == "timeremain") { addfield("TimeoutLeft",&Thermo::compute_timeremain,FLOAT); - } else if (strcmp(word,"atoms") == 0) { + } else if (word == "atoms") { addfield("Atoms",&Thermo::compute_atoms,BIGINT); - } else if (strcmp(word,"temp") == 0) { + } else if (word == "temp") { addfield("Temp",&Thermo::compute_temp,FLOAT); index_temp = add_compute(id_temp,SCALAR); - } else if (strcmp(word,"press") == 0) { + } else if (word == "press") { addfield("Press",&Thermo::compute_press,FLOAT); index_press_scalar = add_compute(id_press,SCALAR); - } else if (strcmp(word,"pe") == 0) { + } else if (word == "pe") { addfield("PotEng",&Thermo::compute_pe,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"ke") == 0) { + } else if (word == "ke") { addfield("KinEng",&Thermo::compute_ke,FLOAT); index_temp = add_compute(id_temp,SCALAR); - } else if (strcmp(word,"etotal") == 0) { + } else if (word == "etotal") { addfield("TotEng",&Thermo::compute_etotal,FLOAT); index_temp = add_compute(id_temp,SCALAR); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"enthalpy") == 0) { + } else if (word == "enthalpy") { addfield("Enthalpy",&Thermo::compute_enthalpy,FLOAT); index_temp = add_compute(id_temp,SCALAR); index_press_scalar = add_compute(id_press,SCALAR); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"evdwl") == 0) { + } else if (word == "evdwl") { addfield("E_vdwl",&Thermo::compute_evdwl,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"ecoul") == 0) { + } else if (word == "ecoul") { addfield("E_coul",&Thermo::compute_ecoul,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"epair") == 0) { + } else if (word == "epair") { addfield("E_pair",&Thermo::compute_epair,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"ebond") == 0) { + } else if (word == "ebond") { addfield("E_bond",&Thermo::compute_ebond,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"eangle") == 0) { + } else if (word == "eangle") { addfield("E_angle",&Thermo::compute_eangle,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"edihed") == 0) { + } else if (word == "edihed") { addfield("E_dihed",&Thermo::compute_edihed,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"eimp") == 0) { + } else if (word == "eimp") { addfield("E_impro",&Thermo::compute_eimp,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"emol") == 0) { + } else if (word == "emol") { addfield("E_mol",&Thermo::compute_emol,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"elong") == 0) { + } else if (word == "elong") { addfield("E_long",&Thermo::compute_elong,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"etail") == 0) { + } else if (word == "etail") { addfield("E_tail",&Thermo::compute_etail,FLOAT); index_pe = add_compute(id_pe,SCALAR); - } else if (strcmp(word,"vol") == 0) { + } else if (word == "vol") { addfield("Volume",&Thermo::compute_vol,FLOAT); - } else if (strcmp(word,"density") == 0) { + } else if (word == "density") { addfield("Density",&Thermo::compute_density,FLOAT); - } else if (strcmp(word,"lx") == 0) { + } else if (word == "lx") { addfield("Lx",&Thermo::compute_lx,FLOAT); - } else if (strcmp(word,"ly") == 0) { + } else if (word == "ly") { addfield("Ly",&Thermo::compute_ly,FLOAT); - } else if (strcmp(word,"lz") == 0) { + } else if (word == "lz") { addfield("Lz",&Thermo::compute_lz,FLOAT); - } else if (strcmp(word,"xlo") == 0) { + } else if (word == "xlo") { addfield("Xlo",&Thermo::compute_xlo,FLOAT); - } else if (strcmp(word,"xhi") == 0) { + } else if (word == "xhi") { addfield("Xhi",&Thermo::compute_xhi,FLOAT); - } else if (strcmp(word,"ylo") == 0) { + } else if (word == "ylo") { addfield("Ylo",&Thermo::compute_ylo,FLOAT); - } else if (strcmp(word,"yhi") == 0) { + } else if (word == "yhi") { addfield("Yhi",&Thermo::compute_yhi,FLOAT); - } else if (strcmp(word,"zlo") == 0) { + } else if (word == "zlo") { addfield("Zlo",&Thermo::compute_zlo,FLOAT); - } else if (strcmp(word,"zhi") == 0) { + } else if (word == "zhi") { addfield("Zhi",&Thermo::compute_zhi,FLOAT); - } else if (strcmp(word,"xy") == 0) { + } else if (word == "xy") { addfield("Xy",&Thermo::compute_xy,FLOAT); - } else if (strcmp(word,"xz") == 0) { + } else if (word == "xz") { addfield("Xz",&Thermo::compute_xz,FLOAT); - } else if (strcmp(word,"yz") == 0) { + } else if (word == "yz") { addfield("Yz",&Thermo::compute_yz,FLOAT); - } else if (strcmp(word,"xlat") == 0) { + } else if (word == "xlat") { addfield("Xlat",&Thermo::compute_xlat,FLOAT); - } else if (strcmp(word,"ylat") == 0) { + } else if (word == "ylat") { addfield("Ylat",&Thermo::compute_ylat,FLOAT); - } else if (strcmp(word,"zlat") == 0) { + } else if (word == "zlat") { addfield("Zlat",&Thermo::compute_zlat,FLOAT); - } else if (strcmp(word,"bonds") == 0) { + } else if (word == "bonds") { addfield("Bonds",&Thermo::compute_bonds,BIGINT); - } else if (strcmp(word,"angles") == 0) { + } else if (word == "angles") { addfield("Angles",&Thermo::compute_angles,BIGINT); - } else if (strcmp(word,"dihedrals") == 0) { + } else if (word == "dihedrals") { addfield("Diheds",&Thermo::compute_dihedrals,BIGINT); - } else if (strcmp(word,"impropers") == 0) { + } else if (word == "impropers") { addfield("Impros",&Thermo::compute_impropers,BIGINT); - } else if (strcmp(word,"pxx") == 0) { + } else if (word == "pxx") { addfield("Pxx",&Thermo::compute_pxx,FLOAT); index_press_vector = add_compute(id_press,VECTOR); - } else if (strcmp(word,"pyy") == 0) { + } else if (word == "pyy") { addfield("Pyy",&Thermo::compute_pyy,FLOAT); index_press_vector = add_compute(id_press,VECTOR); - } else if (strcmp(word,"pzz") == 0) { + } else if (word == "pzz") { addfield("Pzz",&Thermo::compute_pzz,FLOAT); index_press_vector = add_compute(id_press,VECTOR); - } else if (strcmp(word,"pxy") == 0) { + } else if (word == "pxy") { addfield("Pxy",&Thermo::compute_pxy,FLOAT); index_press_vector = add_compute(id_press,VECTOR); - } else if (strcmp(word,"pxz") == 0) { + } else if (word == "pxz") { addfield("Pxz",&Thermo::compute_pxz,FLOAT); index_press_vector = add_compute(id_press,VECTOR); - } else if (strcmp(word,"pyz") == 0) { + } else if (word == "pyz") { addfield("Pyz",&Thermo::compute_pyz,FLOAT); index_press_vector = add_compute(id_press,VECTOR); - } else if (strcmp(word,"fmax") == 0) { + } else if (word == "fmax") { addfield("Fmax",&Thermo::compute_fmax,FLOAT); - } else if (strcmp(word,"fnorm") == 0) { + } else if (word == "fnorm") { addfield("Fnorm",&Thermo::compute_fnorm,FLOAT); - } else if (strcmp(word,"nbuild") == 0) { + } else if (word == "nbuild") { addfield("Nbuild",&Thermo::compute_nbuild,BIGINT); - } else if (strcmp(word,"ndanger") == 0) { + } else if (word == "ndanger") { addfield("Ndanger",&Thermo::compute_ndanger,BIGINT); - } else if (strcmp(word,"cella") == 0) { + } else if (word == "cella") { addfield("Cella",&Thermo::compute_cella,FLOAT); - } else if (strcmp(word,"cellb") == 0) { + } else if (word == "cellb") { addfield("Cellb",&Thermo::compute_cellb,FLOAT); - } else if (strcmp(word,"cellc") == 0) { + } else if (word == "cellc") { addfield("Cellc",&Thermo::compute_cellc,FLOAT); - } else if (strcmp(word,"cellalpha") == 0) { + } else if (word == "cellalpha") { addfield("CellAlpha",&Thermo::compute_cellalpha,FLOAT); - } else if (strcmp(word,"cellbeta") == 0) { + } else if (word == "cellbeta") { addfield("CellBeta",&Thermo::compute_cellbeta,FLOAT); - } else if (strcmp(word,"cellgamma") == 0) { + } else if (word == "cellgamma") { addfield("CellGamma",&Thermo::compute_cellgamma,FLOAT); // compute value = c_ID, fix value = f_ID, variable value = v_ID // count trailing [] and store int arguments - } else if ((strncmp(word,"c_",2) == 0) || (strncmp(word,"f_",2) == 0) || - (strncmp(word,"v_",2) == 0)) { + } else if ((word.substr(0, 2) == "c_") || (word.substr(0, 2) == "f_") || + (word.substr(0, 2) == "v_")) { - int n = strlen(word); + int n = word.length() - 1; char *id = new char[n]; - strcpy(id,&word[2]); + strcpy(id, &word.c_str()[2]); // parse zero or one or two trailing brackets from ID // argindex1,argindex2 = int inside each bracket pair, 0 if no bracket char *ptr = strchr(id,'['); - if (ptr == NULL) argindex1[nfield] = argindex2[nfield] = 0; + if (ptr == nullptr) argindex1[nfield] = argindex2[nfield] = 0; else { *ptr = '\0'; argindex1[nfield] = @@ -929,12 +929,12 @@ void Thermo::parse_fields(char *str) } if (argindex1[nfield] == 0) - field2index[nfield] = add_compute(id,SCALAR); + field2index[nfield] = add_compute(id, SCALAR); else if (argindex2[nfield] == 0) - field2index[nfield] = add_compute(id,VECTOR); + field2index[nfield] = add_compute(id, VECTOR); else - field2index[nfield] = add_compute(id,ARRAY); - addfield(word,&Thermo::compute_compute,FLOAT); + field2index[nfield] = add_compute(id, ARRAY); + addfield(word.c_str(), &Thermo::compute_compute, FLOAT); } else if (word[0] == 'f') { n = modify->find_fix(id); @@ -959,7 +959,7 @@ void Thermo::parse_fields(char *str) } field2index[nfield] = add_fix(id); - addfield(word,&Thermo::compute_fix,FLOAT); + addfield(word.c_str(), &Thermo::compute_fix, FLOAT); } else if (word[0] == 'v') { n = input->variable->find(id); @@ -975,14 +975,13 @@ void Thermo::parse_fields(char *str) error->all(FLERR,"Thermo custom variable cannot have two indices"); field2index[nfield] = add_variable(id); - addfield(word,&Thermo::compute_variable,FLOAT); + addfield(word.c_str(), &Thermo::compute_variable, FLOAT); } delete [] id; } else error->all(FLERR,"Unknown keyword in thermo_style custom command"); - word = strtok(NULL," \0"); } } diff --git a/src/timer.cpp b/src/timer.cpp index 41a0166a89..adf143b4ae 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -12,12 +12,11 @@ ------------------------------------------------------------------------- */ #include "timer.h" -#include -#include -#include + #include "comm.h" #include "error.h" -#include "force.h" + +#include #ifdef _WIN32 #include @@ -31,32 +30,6 @@ using namespace LAMMPS_NS; -// convert a timespec ([[HH:]MM:]SS) to seconds -// the strings "off" and "unlimited" result in -1; - -static double timespec2seconds(char *timespec) -{ - double vals[3]; - char *num; - int i = 0; - - // first handle allowed textual inputs - if (strcmp(timespec,"off") == 0) return -1; - if (strcmp(timespec,"unlimited") == 0) return -1; - - vals[0] = vals[1] = vals[2] = 0; - - num = strtok(timespec,":"); - while ((num != NULL) && (i < 3)) { - vals[i] = atoi(num); - ++i; - num = strtok(NULL,":"); - } - - if (i == 3) return (vals[0]*60 + vals[1])*60 + vals[2]; - else if (i == 2) return vals[0]*60 + vals[1]; - else return vals[0]; -} // Return the CPU time for the current process in seconds very // much in the same way as MPI_Wtime() returns the wall time. @@ -297,12 +270,12 @@ void Timer::modify_params(int narg, char **arg) } else if (strcmp(arg[iarg],"timeout") == 0) { ++iarg; if (iarg < narg) { - _timeout = timespec2seconds(arg[iarg]); + _timeout = utils::timespec2seconds(arg[iarg]); } else error->all(FLERR,"Illegal timers command"); } else if (strcmp(arg[iarg],"every") == 0) { ++iarg; if (iarg < narg) { - _checkfreq = force->inumeric(FLERR,arg[iarg]); + _checkfreq = utils::inumeric(FLERR,arg[iarg],false,lmp); if (_checkfreq <= 0) error->all(FLERR,"Illegal timers command"); } else error->all(FLERR,"Illegal timers command"); diff --git a/src/tokenizer.cpp b/src/tokenizer.cpp index 7ea7c88e5e..725f6f1b61 100644 --- a/src/tokenizer.cpp +++ b/src/tokenizer.cpp @@ -19,9 +19,12 @@ #include "utils.h" #include "fmt/format.h" +#include +#include + using namespace LAMMPS_NS; -TokenizerException::TokenizerException(const std::string & msg, const std::string & token){ +TokenizerException::TokenizerException(const std::string &msg, const std::string &token){ if(token.empty()) { message = msg; } else { @@ -29,13 +32,28 @@ TokenizerException::TokenizerException(const std::string & msg, const std::strin } } -Tokenizer::Tokenizer(const std::string & str, const std::string & separators) : +/** Class for splitting text into words + * + * This tokenizer will break down a string into sub-strings (i.e words) + * separated by the given separator characters. + * +\verbatim embed:rst + +*See also* + :cpp:class:`ValueTokenizer`, :cpp:func:`utils::split_words` + +\endverbatim + * + * \param str string to be processed + * \param separators string with separator characters (default: " \t\r\n\f") */ + +Tokenizer::Tokenizer(const std::string &str, const std::string &separators) : text(str), separators(separators), start(0), ntokens(std::string::npos) { reset(); } -Tokenizer::Tokenizer(const Tokenizer & rhs) : +Tokenizer::Tokenizer(const Tokenizer &rhs) : text(rhs.text), separators(rhs.separators), ntokens(rhs.ntokens) { reset(); @@ -47,10 +65,23 @@ Tokenizer::Tokenizer(Tokenizer && rhs) : reset(); } +/*! Re-position the tokenizer state to the first word, + * i.e. the first non-separator character */ void Tokenizer::reset() { start = text.find_first_not_of(separators); } +/*! Search the text to be processed for a sub-string. + * + * \param str string to be searched for + * \return true if string was found, false if not */ +bool Tokenizer::contains(const std::string &str) const { + return text.find(str) != std::string::npos; +} + +/*! Skip over a given number of tokens + * + * \param n number of tokens to skip over */ void Tokenizer::skip(int n) { for(int i = 0; i < n; ++i) { if(!has_next()) throw TokenizerException("No more tokens", ""); @@ -65,10 +96,16 @@ void Tokenizer::skip(int n) { } } +/*! Indicate whether more tokens are available + * + * \return true if there are more tokens, false if not */ bool Tokenizer::has_next() const { return start != std::string::npos; } +/*! Retrieve next token. + * + * \return string with the next token */ std::string Tokenizer::next() { if(!has_next()) throw TokenizerException("No more tokens", ""); @@ -85,6 +122,9 @@ std::string Tokenizer::next() { return token; } +/*! Count number of tokens in text. + * + * \return number of counted tokens */ size_t Tokenizer::count() { // lazy evaluation if (ntokens == std::string::npos) { @@ -93,6 +133,9 @@ size_t Tokenizer::count() { return ntokens; } +/*! Retrieve the entire text converted to an STL vector of tokens. + * + * \return The STL vector */ std::vector Tokenizer::as_vector() { // store current state size_t current = start; @@ -112,20 +155,47 @@ std::vector Tokenizer::as_vector() { return tokens; } +/*! Class for reading text with numbers + * +\verbatim embed:rst -ValueTokenizer::ValueTokenizer(const std::string & str, const std::string & separators) : tokens(str, separators) { +*See also* + :cpp:class:`Tokenizer` + +\endverbatim + * + * \param str String to be processed + * \param separators String with separator characters (default: " \t\r\n\f") + * + * \see Tokenizer InvalidIntegerException InvalidFloatException */ + +ValueTokenizer::ValueTokenizer(const std::string &str, const std::string &separators) : tokens(str, separators) { } -ValueTokenizer::ValueTokenizer(const ValueTokenizer & rhs) : tokens(rhs.tokens) { +ValueTokenizer::ValueTokenizer(const ValueTokenizer &rhs) : tokens(rhs.tokens) { } -ValueTokenizer::ValueTokenizer(ValueTokenizer && rhs) : tokens(std::move(rhs.tokens)) { +ValueTokenizer::ValueTokenizer(ValueTokenizer &&rhs) : tokens(std::move(rhs.tokens)) { } +/*! Indicate whether more tokens are available + * + * \return true if there are more tokens, false if not */ bool ValueTokenizer::has_next() const { return tokens.has_next(); } +/*! Search the text to be processed for a sub-string. + * + * \param value string with value to be searched for + * \return true if string was found, false if not */ +bool ValueTokenizer::contains(const std::string &value) const { + return tokens.contains(value); +} + +/*! Retrieve next token + * + * \return string with next token */ std::string ValueTokenizer::next_string() { if (has_next()) { std::string value = tokens.next(); @@ -134,6 +204,9 @@ std::string ValueTokenizer::next_string() { return ""; } +/*! Retrieve next token and convert to int + * + * \return value of next token */ int ValueTokenizer::next_int() { if (has_next()) { std::string current = tokens.next(); @@ -146,6 +219,9 @@ int ValueTokenizer::next_int() { return 0; } +/*! Retrieve next token and convert to bigint + * + * \return value of next token */ bigint ValueTokenizer::next_bigint() { if (has_next()) { std::string current = tokens.next(); @@ -158,6 +234,9 @@ bigint ValueTokenizer::next_bigint() { return 0; } +/*! Retrieve next token and convert to tagint + * + * \return value of next token */ tagint ValueTokenizer::next_tagint() { if (has_next()) { std::string current = tokens.next(); @@ -170,6 +249,9 @@ tagint ValueTokenizer::next_tagint() { return 0; } +/*! Retrieve next token and convert to double + * + * \return value of next token */ double ValueTokenizer::next_double() { if (has_next()) { std::string current = tokens.next(); @@ -182,10 +264,16 @@ double ValueTokenizer::next_double() { return 0.0; } +/*! Skip over a given number of tokens + * + * \param n number of tokens to skip over */ void ValueTokenizer::skip(int n) { tokens.skip(n); } +/*! Count number of tokens in text. + * + * \return number of counted tokens */ size_t ValueTokenizer::count() { return tokens.count(); } diff --git a/src/tokenizer.h b/src/tokenizer.h index 8ad19ce960..2db9870866 100644 --- a/src/tokenizer.h +++ b/src/tokenizer.h @@ -18,10 +18,11 @@ #ifndef LMP_TOKENIZER_H #define LMP_TOKENIZER_H -#include -#include #include "lmptype.h" -#include + +#include // IWYU pragma: export +#include // IWYU pragma: export +#include // IWYU pragma: export namespace LAMMPS_NS { @@ -33,7 +34,7 @@ class Tokenizer { size_t start; size_t ntokens; public: - Tokenizer(const std::string & str, const std::string & separators = TOKENIZER_DEFAULT_SEPARATORS); + Tokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); Tokenizer(Tokenizer &&); Tokenizer(const Tokenizer &); Tokenizer& operator=(const Tokenizer&) = default; @@ -42,6 +43,7 @@ public: void reset(); void skip(int n); bool has_next() const; + bool contains(const std::string &str) const; std::string next(); size_t count(); @@ -51,11 +53,17 @@ public: class TokenizerException : public std::exception { std::string message; public: - TokenizerException(const std::string & msg, const std::string & token); + /** Thrown during retrieving or skipping tokens + * + * \param msg String with error message + * \param token String of the token/word that caused the error */ + TokenizerException(const std::string &msg, const std::string &token); ~TokenizerException() throw() { } + /** Retrieve message describing the thrown exception + * \return string with error message */ virtual const char * what() const throw() { return message.c_str(); } @@ -63,20 +71,26 @@ public: class InvalidIntegerException : public TokenizerException { public: - InvalidIntegerException(const std::string & token) : TokenizerException("Not a valid integer number", token) { - } + /** Thrown during converting string to integer number + * + * \param token String of the token/word that caused the error */ + InvalidIntegerException(const std::string &token) + : TokenizerException("Not a valid integer number", token) {} }; class InvalidFloatException : public TokenizerException { public: - InvalidFloatException(const std::string & token) : TokenizerException("Not a valid floating-point number", token) { - } + /** Thrown during converting string to floating point number + * + * \param token String of the token/word that caused the error */ + InvalidFloatException(const std::string &token) + : TokenizerException("Not a valid floating-point number", token) {} }; class ValueTokenizer { Tokenizer tokens; public: - ValueTokenizer(const std::string & str, const std::string & separators = TOKENIZER_DEFAULT_SEPARATORS); + ValueTokenizer(const std::string &str, const std::string &separators = TOKENIZER_DEFAULT_SEPARATORS); ValueTokenizer(const ValueTokenizer &); ValueTokenizer(ValueTokenizer &&); ValueTokenizer& operator=(const ValueTokenizer&) = default; @@ -89,7 +103,8 @@ public: double next_double(); bool has_next() const; - void skip(int n); + bool contains(const std::string &value) const; + void skip(int ntokens); size_t count(); }; diff --git a/src/universe.cpp b/src/universe.cpp index 0fad232d2c..38d2d48990 100644 --- a/src/universe.cpp +++ b/src/universe.cpp @@ -12,43 +12,35 @@ ------------------------------------------------------------------------- */ #include "universe.h" -#include -#include -#include -#include -#include "version.h" + #include "error.h" -#include "force.h" #include "memory.h" -#include "utils.h" -#include "fmt/format.h" +#include "version.h" + +#include +#include using namespace LAMMPS_NS; #define MAXLINE 256 -static char *date2num(const char *version); - /* ---------------------------------------------------------------------- create & initialize the universe of processors in communicator ------------------------------------------------------------------------- */ Universe::Universe(LAMMPS *lmp, MPI_Comm communicator) : Pointers(lmp) { - version = (const char *) LAMMPS_VERSION; - num_ver = date2num(version); - uworld = uorig = communicator; MPI_Comm_rank(uworld,&me); MPI_Comm_size(uworld,&nprocs); uscreen = stdout; - ulogfile = NULL; + ulogfile = nullptr; existflag = 0; nworlds = 0; - procs_per_world = NULL; - root_proc = NULL; + procs_per_world = nullptr; + root_proc = nullptr; memory->create(uni2orig,nprocs,"universe:uni2orig"); for (int i = 0; i < nprocs; i++) uni2orig[i] = i; @@ -62,7 +54,6 @@ Universe::~Universe() memory->destroy(procs_per_world); memory->destroy(root_proc); memory->destroy(uni2orig); - delete [] num_ver; } /* ---------------------------------------------------------------------- @@ -84,7 +75,7 @@ void Universe::reorder(char *style, char *arg) if (uworld != uorig) MPI_Comm_free(&uworld); if (strcmp(style,"nth") == 0) { - int n = force->inumeric(FLERR,arg); + int n = utils::inumeric(FLERR,arg,false,lmp); if (n <= 0) error->universe_all(FLERR,"Invalid -reorder N value"); if (nprocs % n) @@ -98,7 +89,7 @@ void Universe::reorder(char *style, char *arg) if (me == 0) { FILE *fp = fopen(arg,"r"); - if (fp == NULL) + if (fp == nullptr) error->universe_one(FLERR,fmt::format("Cannot open -reorder " "file {}: {}",arg, utils::getsyserror())); @@ -159,7 +150,7 @@ void Universe::reorder(char *style, char *arg) /* ---------------------------------------------------------------------- add 1 or more worlds to universe - str == NULL -> add 1 world with all procs in universe + str == nullptr -> add 1 world with all procs in universe str = NxM -> add N worlds, each with M procs str = P -> add 1 world with P procs ------------------------------------------------------------------------- */ @@ -172,7 +163,7 @@ void Universe::add_world(char *str) n = 1; nper = 0; - if (str != NULL) { + if (str != nullptr) { // check for valid partition argument @@ -187,7 +178,7 @@ void Universe::add_world(char *str) else valid = false; if (valid) { - if ((ptr = strchr(str,'x')) != NULL) { + if ((ptr = strchr(str,'x')) != nullptr) { // 'x' may not be the first or last character @@ -237,43 +228,3 @@ int Universe::consistent() if (n == nprocs) return 1; else return 0; } - -// helper function to convert the LAMMPS date string to a version id -// that can be used for both string and numerical comparisons -// where newer versions are larger than older ones. - -char *date2num(const char *version) -{ - int day,month,year; - day = month = year = 0; - - if (version) { - - day = atoi(version); - - while (*version != '\0' && (isdigit(*version) || *version == ' ')) - ++version; - - if (strncmp(version,"Jan",3) == 0) month = 1; - if (strncmp(version,"Feb",3) == 0) month = 2; - if (strncmp(version,"Mar",3) == 0) month = 3; - if (strncmp(version,"Apr",3) == 0) month = 4; - if (strncmp(version,"May",3) == 0) month = 5; - if (strncmp(version,"Jun",3) == 0) month = 6; - if (strncmp(version,"Jul",3) == 0) month = 7; - if (strncmp(version,"Aug",3) == 0) month = 8; - if (strncmp(version,"Sep",3) == 0) month = 9; - if (strncmp(version,"Oct",3) == 0) month = 10; - if (strncmp(version,"Nov",3) == 0) month = 11; - if (strncmp(version,"Dec",3) == 0) month = 12; - - while (*version != '\0' && !isdigit(*version)) - ++version; - - year = atoi(version); - } - - char *ver = new char[12]; - snprintf(ver,12,"%04d%02d%02d", year % 10000, month, day % 100); - return ver; -} diff --git a/src/universe.h b/src/universe.h index fd6655c749..e37f07930b 100644 --- a/src/universe.h +++ b/src/universe.h @@ -20,10 +20,6 @@ namespace LAMMPS_NS { class Universe : protected Pointers { public: - const char *version; // LAMMPS version string = date - const char *num_ver; // numeric version id derived from version that - // can be used for string or numeric comparisons - MPI_Comm uworld; // communicator for entire universe int me,nprocs; // my place in universe diff --git a/src/update.cpp b/src/update.cpp index 612b4de409..41a0910556 100644 --- a/src/update.cpp +++ b/src/update.cpp @@ -12,18 +12,22 @@ ------------------------------------------------------------------------- */ #include "update.h" -#include -#include "integrate.h" -#include "min.h" -#include "style_integrate.h" -#include "style_minimize.h" -#include "neighbor.h" -#include "force.h" -#include "modify.h" -#include "fix.h" + +#include "style_integrate.h" // IWYU pragma: keep +#include "style_minimize.h" // IWYU pragma: keep + +#include "comm.h" #include "compute.h" -#include "output.h" +#include "integrate.h" #include "error.h" +#include "fix.h" +#include "force.h" +#include "min.h" +#include "modify.h" +#include "neighbor.h" +#include "output.h" + +#include using namespace LAMMPS_NS; @@ -47,21 +51,23 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp) multireplica = 0; eflag_global = vflag_global = -1; + eflag_atom = vflag_atom = 0; - unit_style = NULL; + dt_default = 1; + unit_style = nullptr; set_units("lj"); - integrate_style = NULL; - integrate = NULL; - minimize_style = NULL; - minimize = NULL; + integrate_style = nullptr; + integrate = nullptr; + minimize_style = nullptr; + minimize = nullptr; integrate_map = new IntegrateCreatorMap(); #define INTEGRATE_CLASS #define IntegrateStyle(key,Class) \ (*integrate_map)[#key] = &integrate_creator; -#include "style_integrate.h" +#include "style_integrate.h" // IWYU pragma: keep #undef IntegrateStyle #undef INTEGRATE_CLASS @@ -70,7 +76,7 @@ Update::Update(LAMMPS *lmp) : Pointers(lmp) #define MINIMIZE_CLASS #define MinimizeStyle(key,Class) \ (*minimize_map)[#key] = &minimize_creator; -#include "style_minimize.h" +#include "style_minimize.h" // IWYU pragma: keep #undef MinimizeStyle #undef MINIMIZE_CLASS @@ -121,6 +127,8 @@ void Update::set_units(const char *style) // http://physics.nist.gov/cuu/Constants/Table/allascii.txt // using thermochemical calorie = 4.184 J + double dt_old = dt; + if (strcmp(style,"lj") == 0) { force->boltz = 1.0; force->hplanck = 1.0; @@ -295,6 +303,14 @@ void Update::set_units(const char *style) int n = strlen(style) + 1; unit_style = new char[n]; strcpy(unit_style,style); + + // check if timestep was changed from default value + if (!dt_default && (comm->me == 0)) { + error->warning(FLERR,fmt::format("Changing timestep from {:.6} to {:.6} " + "due to changing units to {}", + dt_old, dt, unit_style)); + } + dt_default = 1; } /* ---------------------------------------------------------------------- */ @@ -446,7 +462,7 @@ Min *Update::minimize_creator(LAMMPS *lmp) void Update::reset_timestep(int narg, char **arg) { if (narg != 1) error->all(FLERR,"Illegal reset_timestep command"); - bigint newstep = force->bnumeric(FLERR,arg[0]); + bigint newstep = utils::bnumeric(FLERR,arg[0],false,lmp); reset_timestep(newstep); } @@ -522,9 +538,9 @@ void Update::update_time() memory usage of update and integrate/minimize ------------------------------------------------------------------------- */ -bigint Update::memory_usage() +double Update::memory_usage() { - bigint bytes = 0; + double bytes = 0; if (whichflag == 1) bytes += integrate->memory_usage(); else if (whichflag == 2) bytes += minimize->memory_usage(); return bytes; diff --git a/src/update.h b/src/update.h index e70325a498..f2a28619fb 100644 --- a/src/update.h +++ b/src/update.h @@ -15,8 +15,8 @@ #define LMP_UPDATE_H #include "pointers.h" + #include -#include namespace LAMMPS_NS { @@ -37,6 +37,7 @@ class Update : protected Pointers { int setupflag; // set when setup() is computing forces int post_integrate; // 1 if now at post_integrate() in timestep int multireplica; // 1 if min across replicas, else 0 + int dt_default; // 1 if dt is at default value, else 0 bigint eflag_global,eflag_atom; // timestep global/peratom eng is tallied on bigint vflag_global,vflag_atom; // ditto for virial @@ -67,7 +68,7 @@ class Update : protected Pointers { void reset_timestep(int, char **); void reset_timestep(bigint); void update_time(); - bigint memory_usage(); + double memory_usage(); private: void new_integrate(char *, int, char **, int, int &); diff --git a/src/utils.cpp b/src/utils.cpp index 3369f684ba..b0928fd18a 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -12,14 +12,20 @@ ------------------------------------------------------------------------- */ #include "utils.h" -#include -#include -#include -#include "lammps.h" + +#include "comm.h" +#include "compute.h" #include "error.h" -#include "tokenizer.h" +#include "fix.h" +#include "memory.h" +#include "modify.h" #include "text_file_reader.h" -#include "fmt/format.h" +#include "tokenizer.h" +#include "update.h" + +#include +#include +#include #if defined(__linux__) #include // for readlink @@ -65,13 +71,23 @@ extern "C" static int re_match(const char *text, const char *pattern); } +//////////////////////////////////////////////////////////////////////// +// Merge sort support functions + +static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, + void *ptr, int (*comp)(int, int, void *)); +static void insertion_sort(int *index, int num, void *ptr, + int (*comp)(int, int, void*)); + +//////////////////////////////////////////////////////////////////////// + using namespace LAMMPS_NS; /** More flexible and specific matching of a string against a pattern. * This function is supposed to be a more safe, more specific and * simple to use API to find pattern matches. The purpose is to replace * uses of either strncmp() or strstr() in the code base to find - * substrings safely. With strncmp() finding prefixes, the number of + * sub-strings safely. With strncmp() finding prefixes, the number of * characters to match must be counted, which can lead to errors, * while using "^pattern" will do the same with less problems. * Matching for suffixes using strstr() is not as specific as 'pattern$', @@ -88,7 +104,7 @@ bool utils::strmatch(const std::string &text, const std::string &pattern) return (pos >= 0); } -/* This simplifies the repetitive task of outputting some +/** This function simplifies the repetitive task of outputting some * message to both the screen and/or the log file. In combination * with using fmt::format(), which returns the formatted text * in a std::string() instance, this can be used to reduce @@ -109,9 +125,11 @@ std::string utils::getsyserror() return std::string(strerror(errno)); } -/* - * On Linux the folder /proc/self/fd holds symbolic links to the actual +/** On Linux the folder /proc/self/fd holds symbolic links to the actual * pathnames associated with each open file descriptor of the current process. + * + * This function is used to provide a filename with error messages in functions + * where the filename is not passed as an argument, but the FILE * pointer. */ const char *utils::guesspath(char *buf, int len, FILE *fp) { @@ -134,7 +152,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, Error *error) { char *rv = fgets(s,size,fp); - if (rv == NULL) { // something went wrong + if (rv == nullptr) { // something went wrong char buf[MAXPATHLENBUF]; std::string errmsg; @@ -153,7 +171,7 @@ void utils::sfgets(const char *srcname, int srcline, char *s, int size, errmsg += "'"; if (error) error->one(srcname,srcline,errmsg); - if (s) *s = '\0'; // truncate string to empty in case error is NULL + if (s) *s = '\0'; // truncate string to empty in case error is null pointer } return; } @@ -348,11 +366,189 @@ tagint utils::tnumeric(const char *file, int line, const char *str, return ATOTAGINT(str); } +/* ---------------------------------------------------------------------- + compute bounds implied by numeric str with a possible wildcard asterisk +------------------------------------------------------------------------- */ +template +void utils::bounds(const char *file, int line, const std::string &str, + bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error) +{ + size_t found = str.find_first_of("*"); + + nlo = nhi = -1; + if (found == std::string::npos) { // contains no '*' + nlo = nhi = strtol(str.c_str(),nullptr,10); + } else if (str.size() == 1) { // is only '*' + nlo = nmin; + nhi = nmax; + } else if (found == 0) { // is '*j' + nlo = nmin; + nhi = strtol(str.substr(1).c_str(),nullptr,10); + } else if (str.size() == found+1) { // is 'i*' + nlo = strtol(str.c_str(),nullptr,10); + nhi = nmax; + } else { // is 'i*j' + nlo = strtol(str.c_str(),nullptr,10); + nhi = strtol(str.substr(found+1).c_str(),nullptr,10); + } + + if (error) { + if (nlo < nmin) + error->all(file,line,fmt::format("Numeric index {} is out of bounds" + "({}-{})",nlo,nmin,nmax)); + else if (nhi > nmax) + error->all(file,line,fmt::format("Numeric index {} is out of bounds" + "({}-{})",nhi,nmin,nmax)); + else if (nlo > nhi) + error->all(file,line,fmt::format("Numeric index {} is out of bounds" + "({}-{})",nlo,nmin,nhi)); + } +} + +template void utils::bounds<>(const char *, int, const std::string &, + bigint, bigint, int &, int &, Error *); +template void utils::bounds<>(const char *, int, const std::string &, + bigint, bigint, long &, long &, Error *); +template void utils::bounds<>(const char *, int, const std::string &, + bigint, bigint, long long &, long long &, Error *); + +/* ------------------------------------------------------------------------- + Expand list of arguments in arg to earg if arg contains wildcards +------------------------------------------------------------------------- */ + +int utils::expand_args(const char *file, int line, int narg, char **arg, + int mode, char **&earg, LAMMPS *lmp) +{ + int n,iarg,index,nlo,nhi,nmax,expandflag,icompute,ifix; + char *ptr1,*ptr2,*str; + + ptr1 = nullptr; + for (iarg = 0; iarg < narg; iarg++) { + ptr1 = strchr(arg[iarg],'*'); + if (ptr1) break; + } + + if (!ptr1) { + earg = arg; + return narg; + } + + // maxarg should always end up equal to newarg, so caller can free earg + + int maxarg = narg-iarg; + earg = (char **) lmp->memory->smalloc(maxarg*sizeof(char *),"input:earg"); + + int newarg = 0; + for (iarg = 0; iarg < narg; iarg++) { + expandflag = 0; + + if (strncmp(arg[iarg],"c_",2) == 0 || + strncmp(arg[iarg],"f_",2) == 0) { + + ptr1 = strchr(&arg[iarg][2],'['); + if (ptr1) { + ptr2 = strchr(ptr1,']'); + if (ptr2) { + *ptr2 = '\0'; + if (strchr(ptr1,'*')) { + if (arg[iarg][0] == 'c') { + *ptr1 = '\0'; + icompute = lmp->modify->find_compute(&arg[iarg][2]); + *ptr1 = '['; + + // check for global vector/array, peratom array, local array + + if (icompute >= 0) { + if (mode == 0 && lmp->modify->compute[icompute]->vector_flag) { + nmax = lmp->modify->compute[icompute]->size_vector; + expandflag = 1; + } else if (mode == 1 && lmp->modify->compute[icompute]->array_flag) { + nmax = lmp->modify->compute[icompute]->size_array_cols; + expandflag = 1; + } else if (lmp->modify->compute[icompute]->peratom_flag && + lmp->modify->compute[icompute]->size_peratom_cols) { + nmax = lmp->modify->compute[icompute]->size_peratom_cols; + expandflag = 1; + } else if (lmp->modify->compute[icompute]->local_flag && + lmp->modify->compute[icompute]->size_local_cols) { + nmax = lmp->modify->compute[icompute]->size_local_cols; + expandflag = 1; + } + } + } else if (arg[iarg][0] == 'f') { + *ptr1 = '\0'; + ifix = lmp->modify->find_fix(&arg[iarg][2]); + *ptr1 = '['; + + // check for global vector/array, peratom array, local array + + if (ifix >= 0) { + if (mode == 0 && lmp->modify->fix[ifix]->vector_flag) { + nmax = lmp->modify->fix[ifix]->size_vector; + expandflag = 1; + } else if (mode == 1 && lmp->modify->fix[ifix]->array_flag) { + nmax = lmp->modify->fix[ifix]->size_array_cols; + expandflag = 1; + } else if (lmp->modify->fix[ifix]->peratom_flag && + lmp->modify->fix[ifix]->size_peratom_cols) { + nmax = lmp->modify->fix[ifix]->size_peratom_cols; + expandflag = 1; + } else if (lmp->modify->fix[ifix]->local_flag && + lmp->modify->fix[ifix]->size_local_cols) { + nmax = lmp->modify->fix[ifix]->size_local_cols; + expandflag = 1; + } + } + } + } + *ptr2 = ']'; + } + } + } + + if (expandflag) { + *ptr2 = '\0'; + bounds(file,line,ptr1+1,1,nmax,nlo,nhi,lmp->error); + *ptr2 = ']'; + if (newarg+nhi-nlo+1 > maxarg) { + maxarg += nhi-nlo+1; + earg = (char **) + lmp->memory->srealloc(earg,maxarg*sizeof(char *),"input:earg"); + } + for (index = nlo; index <= nhi; index++) { + n = strlen(arg[iarg]) + 16; // 16 = space for large inserted integer + str = earg[newarg] = new char[n]; + strncpy(str,arg[iarg],ptr1+1-arg[iarg]); + sprintf(&str[ptr1+1-arg[iarg]],"%d",index); + strcat(str,ptr2); + newarg++; + } + + } else { + if (newarg == maxarg) { + maxarg++; + earg = (char **) + lmp->memory->srealloc(earg,maxarg*sizeof(char *),"input:earg"); + } + n = strlen(arg[iarg]) + 1; + earg[newarg] = new char[n]; + strcpy(earg[newarg],arg[iarg]); + newarg++; + } + } + + //printf("NEWARG %d\n",newarg); + //for (int i = 0; i < newarg; i++) + // printf(" arg %d: %s\n",i,earg[i]); + + return newarg; +} + /* ---------------------------------------------------------------------- Return string without leading or trailing whitespace ------------------------------------------------------------------------- */ -std::string utils::trim(const std::string & line) { +std::string utils::trim(const std::string &line) { int beg = re_match(line.c_str(),"\\S+"); int end = re_match(line.c_str(),"\\s+$"); if (beg < 0) beg = 0; @@ -365,7 +561,7 @@ std::string utils::trim(const std::string & line) { Return string without trailing # comment ------------------------------------------------------------------------- */ -std::string utils::trim_comment(const std::string & line) { +std::string utils::trim_comment(const std::string &line) { auto end = line.find_first_of("#"); if (end != std::string::npos) { return line.substr(0, end); @@ -377,7 +573,7 @@ std::string utils::trim_comment(const std::string & line) { return number of words ------------------------------------------------------------------------- */ -size_t utils::count_words(const char * text) { +size_t utils::count_words(const char *text) { size_t count = 0; const char * buf = text; char c = *buf; @@ -406,7 +602,7 @@ size_t utils::count_words(const char * text) { return number of words ------------------------------------------------------------------------- */ -size_t utils::count_words(const std::string & text) { +size_t utils::count_words(const std::string &text) { return utils::count_words(text.c_str()); } @@ -414,7 +610,7 @@ size_t utils::count_words(const std::string & text) { Return number of words ------------------------------------------------------------------------- */ -size_t utils::count_words(const std::string & text, const std::string & separators) { +size_t utils::count_words(const std::string &text, const std::string &separators) { size_t count = 0; size_t start = text.find_first_not_of(separators); @@ -435,7 +631,7 @@ size_t utils::count_words(const std::string & text, const std::string & separato Trim comment from string and return number of words ------------------------------------------------------------------------- */ -size_t utils::trim_and_count_words(const std::string & text, const std::string & separators) { +size_t utils::trim_and_count_words(const std::string &text, const std::string &separators) { return utils::count_words(utils::trim_comment(text), separators); } @@ -526,7 +722,7 @@ std::vector utils::split_words(const std::string &text) Return whether string is a valid integer number ------------------------------------------------------------------------- */ -bool utils::is_integer(const std::string & str) { +bool utils::is_integer(const std::string &str) { if (str.size() == 0) { return false; } @@ -542,7 +738,7 @@ bool utils::is_integer(const std::string & str) { Return whether string is a valid floating-point number ------------------------------------------------------------------------- */ -bool utils::is_double(const std::string & str) { +bool utils::is_double(const std::string &str) { if (str.size() == 0) { return false; } @@ -560,7 +756,7 @@ bool utils::is_double(const std::string & str) { strip off leading part of path, return just the filename ------------------------------------------------------------------------- */ -std::string utils::path_basename(const std::string & path) { +std::string utils::path_basename(const std::string &path) { #if defined(_WIN32) size_t start = path.find_last_of("/\\"); #else @@ -580,7 +776,7 @@ std::string utils::path_basename(const std::string & path) { join two paths ------------------------------------------------------------------------- */ -std::string utils::path_join(const std::string & a, const std::string & b) { +std::string utils::path_join(const std::string &a, const std::string &b) { #if defined(_WIN32) return fmt::format("{}\\{}", a, b); #else @@ -592,7 +788,7 @@ std::string utils::path_join(const std::string & a, const std::string & b) { try to open file for reading ------------------------------------------------------------------------- */ -bool utils::file_is_readable(const std::string & path) { +bool utils::file_is_readable(const std::string &path) { FILE * fp = fopen(path.c_str(), "r"); if(fp) { fclose(fp); @@ -606,8 +802,13 @@ bool utils::file_is_readable(const std::string & path) { search current directory and the LAMMPS_POTENTIALS directory if specified ------------------------------------------------------------------------- */ +#if defined(_WIN32) +#define OS_PATH_VAR_SEP ";" +#else +#define OS_PATH_VAR_SEP ":" +#endif -std::string utils::get_potential_file_path(const std::string& path) { +std::string utils::get_potential_file_path(const std::string &path) { std::string filepath = path; std::string filename = utils::path_basename(path); @@ -615,38 +816,40 @@ std::string utils::get_potential_file_path(const std::string& path) { return filepath; } else { // try the environment variable directory - const char *path = getenv("LAMMPS_POTENTIALS"); + const char *var = getenv("LAMMPS_POTENTIALS"); - if (path != nullptr){ - std::string pot = utils::path_basename(filepath); - filepath = utils::path_join(path, pot); + if (var != nullptr){ + Tokenizer dirs(var,OS_PATH_VAR_SEP); - if (utils::file_is_readable(filepath)) { - return filepath; + while (dirs.has_next()) { + auto pot = utils::path_basename(filepath); + auto path = dirs.next(); + filepath = utils::path_join(path, pot); + + if (utils::file_is_readable(filepath)) { + return filepath; + } } } } return ""; } +#undef OS_PATH_VAR_SEP /* ---------------------------------------------------------------------- read first line of potential file if it has a DATE field, return the following word ------------------------------------------------------------------------- */ -std::string utils::get_potential_date(const std::string & path, const std::string & potential_name) { +std::string utils::get_potential_date(const std::string &path, const std::string &potential_name) { TextFileReader reader(path, potential_name); reader.ignore_comments = false; char *line = reader.next_line(); - ValueTokenizer values(line); - while (values.has_next()) { - std::string word = values.next_string(); - if (word == "DATE:") { - if (values.has_next()) { - std::string date = values.next_string(); - return date; - } + Tokenizer words(line); + while (words.has_next()) { + if (words.next() == "DATE:") { + if (words.has_next()) return words.next(); } } return ""; @@ -657,19 +860,15 @@ std::string utils::get_potential_date(const std::string & path, const std::strin if it has UNITS field, return following word ------------------------------------------------------------------------- */ -std::string utils::get_potential_units(const std::string & path, const std::string & potential_name) { +std::string utils::get_potential_units(const std::string &path, const std::string &potential_name) { TextFileReader reader(path, potential_name); reader.ignore_comments = false; char *line = reader.next_line(); - ValueTokenizer values(line); - while (values.has_next()) { - std::string word = values.next_string(); - if (word == "UNITS:") { - if (values.has_next()) { - std::string units = values.next_string(); - return units; - } + Tokenizer words(line); + while (words.has_next()) { + if (words.next() == "UNITS:") { + if (words.has_next()) return words.next(); } } return ""; @@ -705,6 +904,230 @@ double utils::get_conversion_factor(const int property, const int conversion) return 0.0; } +/* ---------------------------------------------------------------------- + open a potential file as specified by name + if fails, search in dir specified by env variable LAMMPS_POTENTIALS +------------------------------------------------------------------------- */ + +FILE *utils::open_potential(const std::string &name, LAMMPS *lmp, + int *auto_convert) +{ + auto error = lmp->error; + auto me = lmp->comm->me; + + std::string filepath = get_potential_file_path(name); + + if(!filepath.empty()) { + std::string unit_style = lmp->update->unit_style; + std::string date = get_potential_date(filepath, "potential"); + std::string units = get_potential_units(filepath, "potential"); + + if(!date.empty() && (me == 0)) { + logmesg(lmp, fmt::format("Reading potential file {} " + "with DATE: {}\n", name, date)); + } + + if (auto_convert == nullptr) { + if (!units.empty() && (units != unit_style) && (me == 0)) { + error->one(FLERR, fmt::format("Potential file {} requires {} units " + "but {} units are in use", name, units, + unit_style)); + return nullptr; + } + } else { + if (units.empty() || units == unit_style) { + *auto_convert = NOCONVERT; + } else { + if ((units == "metal") && (unit_style == "real") + && (*auto_convert & METAL2REAL)) { + *auto_convert = METAL2REAL; + } else if ((units == "real") && (unit_style == "metal") + && (*auto_convert & REAL2METAL)) { + *auto_convert = REAL2METAL; + } else { + error->one(FLERR, fmt::format("Potential file {} requires {} units " + "but {} units are in use", name, + units, unit_style)); + return nullptr; + } + } + if ((*auto_convert != NOCONVERT) && (me == 0)) + error->warning(FLERR, fmt::format("Converting potential file in " + "{} units to {} units", + units, unit_style)); + } + return fopen(filepath.c_str(), "r"); + } + return nullptr; +} + +/* ---------------------------------------------------------------------- + convert a timespec ([[HH:]MM:]SS) to seconds + the strings "off" and "unlimited" result in -1.0; +------------------------------------------------------------------------- */ + +double utils::timespec2seconds(const std::string ×pec) +{ + double vals[3]; + int i = 0; + + // first handle allowed textual inputs + if (timespec == "off") return -1.0; + if (timespec == "unlimited") return -1.0; + + vals[0] = vals[1] = vals[2] = 0; + + ValueTokenizer values(timespec, ":"); + + try { + for (i = 0; i < 3; i++) { + if (!values.has_next()) break; + vals[i] = values.next_int(); + } + } catch (TokenizerException &e) { + return -1.0; + } + + if (i == 3) return (vals[0]*60 + vals[1])*60 + vals[2]; + else if (i == 2) return vals[0]*60 + vals[1]; + return vals[0]; +} + +/* ---------------------------------------------------------------------- + convert a LAMMPS version date (1Jan01) to a number +------------------------------------------------------------------------- */ + +int utils::date2num(const std::string &date) +{ + std::size_t found = date.find_first_not_of("0123456789 "); + int num = strtol(date.substr(0,found).c_str(),nullptr,10); + auto month = date.substr(found); + found = month.find_first_of("0123456789 "); + num += strtol(month.substr(found).c_str(),nullptr,10)*10000; + if (num < 1000000) num += 20000000; + + if (strmatch(month,"^Jan")) num += 100; + else if (strmatch(month,"^Feb")) num += 200; + else if (strmatch(month,"^Mar")) num += 300; + else if (strmatch(month,"^Apr")) num += 400; + else if (strmatch(month,"^May")) num += 500; + else if (strmatch(month,"^Jun")) num += 600; + else if (strmatch(month,"^Jul")) num += 700; + else if (strmatch(month,"^Aug")) num += 800; + else if (strmatch(month,"^Sep")) num += 900; + else if (strmatch(month,"^Oct")) num += 1000; + else if (strmatch(month,"^Nov")) num += 1100; + else if (strmatch(month,"^Dec")) num += 1200; + return num; +} + +/* ---------------------------------------------------------------------- + * Merge sort part 1: Loop over sublists doubling in size with each iteration. + * Pre-sort small sublists with insertion sort for better overall performance. +------------------------------------------------------------------------- */ + +void utils::merge_sort(int *index, int num, void *ptr, + int (*comp)(int, int, void *)) +{ + if (num < 2) return; + + int chunk,i,j; + + // do insertion sort on chunks of up to 64 elements + + chunk = 64; + for (i=0; i < num; i += chunk) { + j = (i+chunk > num) ? num-i : chunk; + insertion_sort(index+i,j,ptr,comp); + } + + // already done? + + if (chunk >= num) return; + + // continue with merge sort on the pre-sorted chunks. + // we need an extra buffer for temporary storage and two + // pointers to operate on, so we can swap the pointers + // rather than copying to the hold buffer in each pass + + int *buf = new int[num]; + int *dest = index; + int *hold = buf; + + while (chunk < num) { + int m; + + // swap hold and destination buffer + + int *tmp = dest; dest = hold; hold = tmp; + + // merge from hold array to destination array + + for (i=0; i < num-1; i += 2*chunk) { + j = i + 2*chunk; + if (j > num) j=num; + m = i+chunk; + if (m > num) m=num; + do_merge(dest,hold,i,m,m,j,ptr,comp); + } + + // copy all indices not handled by the chunked merge sort loop + + for ( ; i < num ; i++ ) dest[i] = hold[i]; + chunk *= 2; + } + + // if the final sorted data is in buf, copy back to index + + if (dest == buf) memcpy(index,buf,sizeof(int)*num); + + delete[] buf; +} + +/* ------------------------------------------------------------------ */ + +/* ---------------------------------------------------------------------- + * Merge sort part 2: Insertion sort for pre-sorting of small chunks +------------------------------------------------------------------------- */ + +void insertion_sort(int *index, int num, void *ptr, + int (*comp)(int, int, void*)) +{ + if (num < 2) return; + for (int i=1; i < num; ++i) { + int tmp = index[i]; + for (int j=i-1; j >= 0; --j) { + if ((*comp)(index[j],tmp,ptr) > 0) { + index[j+1] = index[j]; + } else { + index[j+1] = tmp; + break; + } + if (j == 0) index[0] = tmp; + } + } +} + +/* ---------------------------------------------------------------------- + * Merge sort part 3: Merge two sublists +------------------------------------------------------------------------- */ + +static void do_merge(int *idx, int *buf, int llo, int lhi, int rlo, int rhi, + void *ptr, int (*comp)(int, int, void *)) +{ + int i = llo; + int l = llo; + int r = rlo; + while ((l < lhi) && (r < rhi)) { + if ((*comp)(buf[l],buf[r],ptr) < 0) + idx[i++] = buf[l++]; + else idx[i++] = buf[r++]; + } + + while (l < lhi) idx[i++] = buf[l++]; + while (r < rhi) idx[i++] = buf[r++]; +} + /* ------------------------------------------------------------------ */ extern "C" { diff --git a/src/utils.h b/src/utils.h index 9762087ca4..7515f1f21b 100644 --- a/src/utils.h +++ b/src/utils.h @@ -29,30 +29,30 @@ namespace LAMMPS_NS { namespace utils { - /** \brief Match text against a simplified regex pattern + /** Match text against a simplified regex pattern * * \param text the text to be matched against the pattern * \param pattern the search pattern, which may contain regexp markers - * \return true if the pattern matches, false if not - */ + * \return true if the pattern matches, false if not */ + bool strmatch(const std::string &text, const std::string &pattern); - /** \brief Send message to screen and logfile, if available + /** Send message to screen and logfile, if available * * \param lmp pointer to LAMMPS class instance - * \param mesg message to be printed - */ + * \param mesg message to be printed */ + void logmesg(LAMMPS *lmp, const std::string &mesg); - /** \brief return a string representing the current system error status + /** return a string representing the current system error status * * This is a wrapper around calling strerror(errno). * - * \return error string - */ + * \return error string */ + std::string getsyserror(); - /** \brief safe wrapper around fgets() which aborts on errors + /** safe wrapper around fgets() which aborts on errors * or EOF and prints a suitable error message to help debugging * * \param srcname name of the calling source file (from FLERR macro) @@ -60,13 +60,13 @@ namespace LAMMPS_NS { * \param s buffer for storing the result of fgets() * \param size size of buffer s (max number of bytes read by fgets()) * \param fp file pointer used by fgets() - * \param filename file name associated with fp (may be NULL; then LAMMPS will try to detect) - * \param error pointer to Error class instance (for abort) - */ + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) + * \param error pointer to Error class instance (for abort) */ + void sfgets(const char *srcname, int srcline, char *s, int size, FILE *fp, const char *filename, Error *error); - /** \brief safe wrapper around fread() which aborts on errors + /** safe wrapper around fread() which aborts on errors * or EOF and prints a suitable error message to help debugging * * \param srcname name of the calling source file (from FLERR macro) @@ -75,222 +75,349 @@ namespace LAMMPS_NS { * \param size size of data elements read by fread() * \param num number of data elements read by fread() * \param fp file pointer used by fread() - * \param filename file name associated with fp (may be NULL; then LAMMPS will try to detect) - * \param error pointer to Error class instance (for abort) - */ + * \param filename file name associated with fp (may be a null pointer; then LAMMPS will try to detect) + * \param error pointer to Error class instance (for abort) */ + void sfread(const char *srcname, int srcline, void *s, size_t size, size_t num, FILE *fp, const char *filename, Error *error); - /** \brief Report if a requested style is in a package or may have a typo + /** Report if a requested style is in a package or may have a typo * * \param style type of style that is to be checked for * \param name name of style that was not found * \param lmp pointer to top-level LAMMPS class instance - * \return string usable for error messages - */ + * \return string usable for error messages */ + std::string check_packages_for_style(const std::string &style, const std::string &name, LAMMPS *lmp); - /** \brief Convert a string to a floating point number while checking - if it is a valid floating point or integer number + /** Convert a string to a floating point number while checking + * if it is a valid floating point or integer number * - * \param file name of source file for error message - * \param line in source file for error message - * \param str string to be converted to number + * \param file name of source file for error message + * \param line line number in source file for error message + * \param str string to be converted to number * \param do_abort determines whether to call Error::one() or Error::all() - * \param lmp pointer to top-level LAMMPS class instance - * \return double precision floating point number + * \param lmp pointer to top-level LAMMPS class instance + * \return double precision floating point number */ double numeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** \brief Convert a string to an integer number while checking - if it is a valid integer number (regular int) + /** Convert a string to an integer number while checking + * if it is a valid integer number (regular int) * - * \param file name of source file for error message - * \param line in source file for error message - * \param str string to be converted to number + * \param file name of source file for error message + * \param line line number in source file for error message + * \param str string to be converted to number * \param do_abort determines whether to call Error::one() or Error::all() - * \param lmp pointer to top-level LAMMPS class instance - * \return integer number (regular int) - */ + * \param lmp pointer to top-level LAMMPS class instance + * \return integer number (regular int) */ + int inumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** \brief Convert a string to an integer number while checking - if it is a valid integer number (bigint) + /** Convert a string to an integer number while checking + * if it is a valid integer number (bigint) * - * \param file name of source file for error message - * \param line in source file for error message - * \param str string to be converted to number + * \param file name of source file for error message + * \param line line number in source file for error message + * \param str string to be converted to number * \param do_abort determines whether to call Error::one() or Error::all() - * \param lmp pointer to top-level LAMMPS class instance - * \return integer number (bigint) - */ + * \param lmp pointer to top-level LAMMPS class instance + * \return integer number (bigint) */ + bigint bnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** \brief Convert a string to an integer number while checking - if it is a valid integer number (tagint) + /** Convert a string to an integer number while checking + * if it is a valid integer number (tagint) * - * \param file name of source file for error message - * \param line in source file for error message - * \param str string to be converted to number - * \param do_abort determines whether to call Error::one() or Error::all() - * \param lmp pointer to top-level LAMMPS class instance - * \return integer number (tagint) - */ + * \param file name of source file for error message + * \param line line number in source file for error message + * \param str string to be converted to number + * \param do_abort determines whether to call Error::one() or Error::all() + * \param lmp pointer to top-level LAMMPS class instance + * \return integer number (tagint) */ + tagint tnumeric(const char *file, int line, const char *str, bool do_abort, LAMMPS *lmp); - /** - * \brief Trim leading and trailing whitespace. Like TRIM() in Fortran. + /** Compute index bounds derived from a string with a possible wildcard + * + * This functions processes the string in *str* and set the values of *nlo* + * and *nhi* according to the following five cases: + * + * - a single number, i: nlo = i; nhi = i; + * - a single asterisk, \*: nlo = nmin; nhi = nmax; + * - a single number followed by an asterisk, i\*: nlo = i; nhi = nmax; + * - a single asterisk followed by a number, \*i: nlo = nmin; nhi = i; + * - two numbers with an asterisk in between. i\*j: nlo = i; nhi = j; + * + * \param file name of source file for error message + * \param line line number in source file for error message + * \param str string to be processed + * \param nmin smallest possible lower bound + * \param nmax largest allowed upper bound + * \param nlo lower bound + * \param nhi upper bound + * \param error pointer to Error class for out-of-bounds messages */ + + template + void bounds(const char *file, int line, const std::string &str, + bigint nmin, bigint nmax, TYPE &nlo, TYPE &nhi, Error *error); + + /** Expand list of arguments when containing fix/compute wildcards + * + * This function searches the list of arguments in *arg* for strings + * of the kind c_ID[*] or f_ID[*] referring to computes or fixes. + * Any such strings are replaced by one or more strings with the + * '*' character replaced by the corresponding possible numbers as + * determined from the fix or compute instance. Other strings are + * just copied. If the *mode* parameter is set to 0, expand global + * vectors, but not global arrays; if it is set to 1, expand global + * arrays (by column) but not global vectors. + * + * If any expansion happens, the earg list and all its + * strings are new allocations and must be freed explicitly by the + * caller. Otherwise arg and earg will point to the same address + * and no explicit de-allocation is needed by the caller. + * + * \param file name of source file for error message + * \param line line number in source file for error message + * \param narg number of arguments in current list + * \param arg argument list, possibly containing wildcards + * \param mode select between global vectors(=0) and arrays (=1) + * \param earg new argument list with wildcards expanded + * \param lmp pointer to top-level LAMMPS class instance + * \return number of arguments in expanded list */ + + int expand_args(const char *file, int line, int narg, char **arg, + int mode, char **&earg, LAMMPS *lmp); + + /** Trim leading and trailing whitespace. Like TRIM() in Fortran. + * * \param line string that should be trimmed - * \return new string without whitespace (string) - */ + * \return new string without whitespace (string) */ + std::string trim(const std::string &line); - /** - * \brief Trim anything from '#' onward + /** Return string with anything from '#' onward removed + * * \param line string that should be trimmed - * \return new string without comment (string) - */ + * \return new string without comment (string) */ + std::string trim_comment(const std::string &line); - /** - * \brief Count words in string + /** Count words in string with custom choice of separating characters + * * \param text string that should be searched * \param separators string containing characters that will be treated as whitespace - * \return number of words found - */ - size_t count_words(const std::string & text, const std::string & separators); + * \return number of words found */ - /** - * \brief Count words in string, ignore any whitespace matching " \t\r\n\f" + size_t count_words(const std::string &text, const std::string &separators); + + /** Count words in string, ignore any whitespace matching " \t\r\n\f" + * * \param text string that should be searched - * \param separators string containing characters that will be treated as whitespace - * \return number of words found - */ - size_t count_words(const std::string & text); + * \return number of words found */ - /** - * \brief Count words in C-string, ignore any whitespace matching " \t\r\n\f" + size_t count_words(const std::string &text); + + /** Count words in C-string, ignore any whitespace matching " \t\r\n\f" + * * \param text string that should be searched - * \param separators string containing characters that will be treated as whitespace - * \return number of words found - */ - size_t count_words(const char * text); + * \return number of words found */ - /** - * \brief Count words in a single line, trim anything from '#' onward + size_t count_words(const char *text); + + /** Count words in a single line, trim anything from '#' onward + * * \param text string that should be trimmed and searched * \param separators string containing characters that will be treated as whitespace - * \return number of words found - */ - size_t trim_and_count_words(const std::string & text, const std::string & separators = " \t\r\n\f"); + * \return number of words found */ - /** - * \brief Take text and split into non-whitespace words. + size_t trim_and_count_words(const std::string &text, const std::string &separators = " \t\r\n\f"); + + /** Take text and split into non-whitespace words. * - * This can handle single and double quotes, escaped quotes, - * and escaped codes within quotes, but due to using an STL - * container and STL strings is rather slow because of making - * copies. Designed for parsing command lines and similar text - * and not for time critical processing. Use a tokenizer for that. + * This can handle strings with single and double quotes, escaped quotes, + * and escaped codes within quotes, but due to using an STL container and + * STL strings is rather slow because of making copies. Designed for parsing + * command lines and similar text and not for time critical processing. + * Use a tokenizer class for that. + * +\verbatim embed:rst + +*See also* + :cpp:class:`Tokenizer`, :cpp:class:`ValueTokenizer` + +\endverbatim * * \param text string that should be split - * \return STL vector with the words - */ + * \return STL vector with the words */ + std::vector split_words(const std::string &text); - /** - * \brief Check if string can be converted to valid integer - * \param text string that should be checked - * \return true, if string contains valid integer, false otherwise - */ - bool is_integer(const std::string & str); + /** Check if string can be converted to valid integer + * + * \param str string that should be checked + * \return true, if string contains valid a integer, false otherwise */ - /** - * \brief Check if string can be converted to valid floating-point number - * \param text string that should be checked - * \return true, if string contains valid floating-point number, false otherwise - */ - bool is_double(const std::string & str); + bool is_integer(const std::string &str); - /** \brief try to detect pathname from FILE pointer. + /** Check if string can be converted to valid floating-point number + * + * \param str string that should be checked + * \return true, if string contains valid number, false otherwise */ + + bool is_double(const std::string &str); + + /** Try to detect pathname from FILE pointer. * * Currently only supported on Linux, otherwise will report "(unknown)". * * \param buf storage buffer for pathname. output will be truncated if not large enough * \param len size of storage buffer. output will be truncated to this length - 1 - * \param fp FILE pointer structe from STDIO library for which we want to detect the name - * \return pointer to the storage buffer, i.e. buf - */ + * \param fp FILE pointer struct from STDIO library for which we want to detect the name + * \return pointer to the storage buffer, i.e. buf */ + const char *guesspath(char *buf, int len, FILE *fp); - /** - * \brief Strip off leading part of path, return just the filename + /** Strip off leading part of path, return just the filename + * * \param path file path - * \return file name - */ - std::string path_basename(const std::string & path); + * \return file name */ - /** - * \brief Join two paths - * \param a first path - * \param b second path - * \return combined path - */ - std::string path_join(const std::string & a, const std::string & b); + std::string path_basename(const std::string &path); - /** - * \brief Check if file exists and is readable + /** Join two pathname segments + * + * This uses the forward slash '/' character unless LAMMPS is compiled + * for Windows where it used the equivalent backward slash '\\'. + * + * \param a first path + * \param b second path + * \return combined path */ + + std::string path_join(const std::string &a, const std::string &b); + + /** Check if file exists and is readable + * * \param path file path - * \return true if file exists and is readable - */ - bool file_is_readable(const std::string & path); + * \return true if file exists and is readable */ - /** - * \brief Determine full path of potential file - * If file is not found in current directory, search LAMMPS_POTENTIALS folder + bool file_is_readable(const std::string &path); + + /** Determine full path of potential file. If file is not found in current directory, + * search directories listed in LAMMPS_POTENTIALS environment variable + * * \param path file path - * \return full path to potential file - */ - std::string get_potential_file_path(const std::string& path); + * \return full path to potential file */ - /** - * \brief Read potential file and return DATE field if it is present + std::string get_potential_file_path(const std::string &path); + + /** Read potential file and return DATE field if it is present + * * \param path file path * \param potential_name name of potential that is being read - * \return DATE field if present - */ - std::string get_potential_date(const std::string & path, const std::string & potential_name); + * \return DATE field if present */ - /** - * \brief Read potential file and return UNITS field if it is present + std::string get_potential_date(const std::string &path, + const std::string &potential_name); + + /** Read potential file and return UNITS field if it is present + * * \param path file path * \param potential_name name of potential that is being read - * \return UNITS field if present - */ - std::string get_potential_units(const std::string & path, const std::string & potential_name); + * \return UNITS field if present */ + + std::string get_potential_units(const std::string &path, + const std::string &potential_name); enum { NOCONVERT = 0, METAL2REAL = 1, REAL2METAL = 1<<1 }; enum { UNKNOWN = 0, ENERGY }; - /** - * \brief Return bitmask of available conversion factors for a given propert + /** Return bitmask of available conversion factors for a given property + * * \param property property to be converted - * \return bitmask indicating available conversions - */ + * \return bitmask indicating available conversions */ int get_supported_conversions(const int property); - /** - * \brief Return unit conversion factor for given property and selected from/to units + /** Return unit conversion factor for given property and selected from/to units + * * \param property property to be converted * \param conversion constant indicating the conversion - * \return conversion factor - */ + * \return conversion factor */ + double get_conversion_factor(const int property, const int conversion); + + /** Open a potential file as specified by *name* + * + * If opening the file directly fails, the function will search for + * it in the list of folder pointed to by the environment variable + * ``LAMMPS_POTENTIALS`` (if it is set). + * + * If the potential file has a ``UNITS`` tag in the first line, the + * tag's value is compared to the current unit style setting. + * The behavior of the function then depends on the value of the + * *auto_convert* parameter. If it is a null pointer, then the unit + * values must match or else the open will fail with an error. Otherwise + * the bitmask that *auto_convert* points to is used check for + * compatibility with possible automatic conversions by the calling + * function. If compatible, the bitmask is set to the required + * conversion or ``utils::NOCONVERT``. + * + * \param name file- or pathname of the potential file + * \param lmp pointer to top-level LAMMPS class instance + * \param auto_convert pointer to unit conversion bitmask or ``nullptr`` + * \return FILE pointer of the opened potential file or ``nullptr`` */ + + FILE *open_potential(const std::string &name, LAMMPS *lmp, int *auto_convert); + + /** Convert a time string to seconds + * + * The strings "off" and "unlimited" result in -1 + * + * \param timespec a string in the following format: ([[HH:]MM:]SS) + * \return total in seconds */ + + double timespec2seconds(const std::string ×pec); + + /** Convert a LAMMPS version date to a number + * + * This will generate a number YYYYMMDD from a date string + * (with or without blanks) that is suitable for numerical + * comparisons, i.e. later dates will generate a larger number. + * + * The day may or may not have a leading zero, the month + * is identified by the first 3 letters (so there may be more) + * and the year may be 2 or 4 digits (the missing 2 digits will + * be assumed as 20. That is 04 corresponds to 2004). + * + * No check is made whether the date is valid. + * + * \param date string in the format (Day Month Year) + * \return date code */ + int date2num(const std::string &date); + + /** Custom merge sort implementation + * + * This function provides a custom upward hybrid merge sort + * implementation with support to pass an opaque pointer to + * the comparison function, e.g. for access to class members. + * This avoids having to use global variables. For improved + * performance, it uses an in-place insertion sort on initial + * chunks of up to 64 elements and switches to merge sort from + * then on. + * + * \param index Array with indices to be sorted + * \param num Length of the index array + * \param ptr Pointer to opaque object passed to comparison function + * \param comp Pointer to comparison function */ + + void merge_sort(int *index, int num, void *ptr, + int (*comp)(int, int, void *)); } } diff --git a/src/variable.cpp b/src/variable.cpp index 8eecc4690f..6931fd9122 100644 --- a/src/variable.cpp +++ b/src/variable.cpp @@ -12,36 +12,33 @@ ------------------------------------------------------------------------- */ #include "variable.h" -#include -#include -#include -#include -#include -#include -#include -#include "universe.h" + #include "atom.h" -#include "update.h" -#include "group.h" -#include "domain.h" #include "comm.h" -#include "region.h" -#include "modify.h" #include "compute.h" -#include "input.h" +#include "domain.h" +#include "error.h" #include "fix.h" #include "fix_store.h" -#include "force.h" -#include "output.h" -#include "thermo.h" -#include "random_mars.h" -#include "math_const.h" -#include "lmppython.h" -#include "memory.h" +#include "group.h" #include "info.h" -#include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "input.h" +#include "lmppython.h" +#include "math_const.h" +#include "memory.h" +#include "modify.h" +#include "output.h" +#include "random_mars.h" +#include "region.h" +#include "thermo.h" +#include "universe.h" +#include "update.h" + +#include +#include +#include +#include +#include using namespace LAMMPS_NS; using namespace MathConst; @@ -89,20 +86,20 @@ Variable::Variable(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_rank(world,&me); nvar = maxvar = 0; - names = NULL; - style = NULL; - num = NULL; - which = NULL; - pad = NULL; - reader = NULL; - data = NULL; - dvalue = NULL; - vecs = NULL; + names = nullptr; + style = nullptr; + num = nullptr; + which = nullptr; + pad = nullptr; + reader = nullptr; + data = nullptr; + dvalue = nullptr; + vecs = nullptr; - eval_in_progress = NULL; + eval_in_progress = nullptr; - randomequal = NULL; - randomatom = NULL; + randomequal = nullptr; + randomatom = nullptr; // customize by assigning a precedence level @@ -189,7 +186,7 @@ void Variable::set(int narg, char **arg) int nfirst = 0,nlast = 0; if (narg == 3 || (narg == 4 && strcmp(arg[3],"pad") == 0)) { nfirst = 1; - nlast = force->inumeric(FLERR,arg[2]); + nlast = utils::inumeric(FLERR,arg[2],false,lmp); if (nlast <= 0) error->all(FLERR,"Illegal variable command"); if (narg == 4 && strcmp(arg[3],"pad") == 0) { char digits[12]; @@ -197,8 +194,8 @@ void Variable::set(int narg, char **arg) pad[nvar] = strlen(digits); } else pad[nvar] = 0; } else if (narg == 4 || (narg == 5 && strcmp(arg[4],"pad") == 0)) { - nfirst = force->inumeric(FLERR,arg[2]); - nlast = force->inumeric(FLERR,arg[3]); + nfirst = utils::inumeric(FLERR,arg[2],false,lmp); + nlast = utils::inumeric(FLERR,arg[3],false,lmp); if (nfirst > nlast || nlast < 0) error->all(FLERR,"Illegal variable command"); if (narg == 5 && strcmp(arg[4],"pad") == 0) { @@ -210,7 +207,7 @@ void Variable::set(int narg, char **arg) num[nvar] = nlast; which[nvar] = nfirst-1; data[nvar] = new char*[1]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; // WORLD // num = listed args, which = partition this proc is in, data = copied args @@ -252,9 +249,9 @@ void Variable::set(int narg, char **arg) if (find(arg[0]) >= 0) return; if (nvar == maxvar) grow(); style[nvar] = ULOOP; - num[nvar] = force->inumeric(FLERR,arg[2]); + num[nvar] = utils::inumeric(FLERR,arg[2],false,lmp); data[nvar] = new char*[1]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; if (narg == 4) { char digits[12]; sprintf(digits,"%d",num[nvar]); @@ -268,12 +265,12 @@ void Variable::set(int narg, char **arg) if (universe->me == 0) { FILE *fp = fopen("tmp.lammps.variable","w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,"Cannot open temporary file for world counter: " + utils::getsyserror()); fprintf(fp,"%d\n",universe->nworlds); fclose(fp); - fp = NULL; + fp = nullptr; } for (int jvar = 0; jvar < nvar; jvar++) @@ -358,7 +355,7 @@ void Variable::set(int narg, char **arg) // ATOMFILE for numbers // which = 1st value - // data = NULL + // data = nullptr } else if (strcmp(arg[1],"atomfile") == 0) { if (narg != 3) error->all(FLERR,"Illegal variable command"); @@ -369,7 +366,7 @@ void Variable::set(int narg, char **arg) which[nvar] = 0; pad[nvar] = 0; data[nvar] = new char*[num[nvar]]; - data[nvar][0] = NULL; + data[nvar][0] = nullptr; reader[nvar] = new VarReader(lmp,arg[0],arg[2],ATOMFILE); int flag = reader[nvar]->read_peratom(); if (flag) error->all(FLERR,"Atomfile variable could not read values"); @@ -508,7 +505,7 @@ void Variable::set(int narg, char **arg) if (ivar >= 0) { if (style[ivar] != INTERNAL) error->all(FLERR,"Cannot redefine variable as a different style"); - dvalue[nvar] = force->numeric(FLERR,arg[2]); + dvalue[nvar] = utils::numeric(FLERR,arg[2],false,lmp); replaceflag = 1; } else { if (nvar == maxvar) grow(); @@ -518,7 +515,7 @@ void Variable::set(int narg, char **arg) pad[nvar] = 0; data[nvar] = new char*[num[nvar]]; data[nvar][0] = new char[VALUELENGTH]; - dvalue[nvar] = force->numeric(FLERR,arg[2]); + dvalue[nvar] = utils::numeric(FLERR,arg[2],false,lmp); } } else error->all(FLERR,"Illegal variable command"); @@ -709,7 +706,7 @@ int Variable::next(int narg, char **arg) char buf[64]; for (int loopmax = 0; loopmax < 100; ++loopmax) { fp = fopen("tmp.lammps.variable.lock","r"); - if (fp == NULL) goto uloop_again; + if (fp == nullptr) goto uloop_again; buf[0] = buf[1] = '\0'; fread(buf,1,64,fp); @@ -734,7 +731,7 @@ int Variable::next(int narg, char **arg) fprintf(fp,"%d\n",nextindex+1); //printf("WRITE %d %d\n",universe->me,nextindex+1); fclose(fp); - fp = NULL; + fp = nullptr; rename("tmp.lammps.variable.lock","tmp.lammps.variable"); if (universe->uscreen) fprintf(universe->uscreen, @@ -843,15 +840,15 @@ int Variable::vectorstyle(int ivar) check if variable with name is PYTHON and matches funcname called by Python class before it invokes a Python function return data storage so Python function can return a value for this variable - return NULL if not a match + return nullptr if not a match ------------------------------------------------------------------------- */ char *Variable::pythonstyle(char *name, char *funcname) { int ivar = find(name); - if (ivar < 0) return NULL; - if (style[ivar] != PYTHON) return NULL; - if (strcmp(data[ivar][0],funcname) != 0) return NULL; + if (ivar < 0) return nullptr; + if (style[ivar] != PYTHON) return nullptr; + if (strcmp(data[ivar][0],funcname) != 0) return nullptr; return data[ivar][1]; } @@ -876,23 +873,23 @@ int Variable::internalstyle(int ivar) if GETENV, query environment and put result in str if PYTHON, evaluate Python function, it will put result in str if INTERNAL, convert dvalue and put result in str - if ATOM or ATOMFILE or VECTOR, return NULL - return NULL if no variable with name, or which value is bad, + if ATOM or ATOMFILE or VECTOR, return nullptr + return nullptr if no variable with name, or which value is bad, caller must respond ------------------------------------------------------------------------- */ char *Variable::retrieve(const char *name) { int ivar = find(name); - if (ivar < 0) return NULL; - if (which[ivar] >= num[ivar]) return NULL; + if (ivar < 0) return nullptr; + if (which[ivar] >= num[ivar]) return nullptr; if (eval_in_progress[ivar]) - print_var_error(FLERR,"Variable has a circular dependency",ivar); + print_var_error(FLERR,"has a circular dependency",ivar); eval_in_progress[ivar] = 1; - char *str = NULL; + char *str = nullptr; if (style[ivar] == INDEX || style[ivar] == WORLD || style[ivar] == UNIVERSE || style[ivar] == STRING || style[ivar] == SCALARFILE) { @@ -911,19 +908,19 @@ char *Variable::retrieve(const char *name) strcpy(data[ivar][0],result); str = data[ivar][0]; } else if (style[ivar] == EQUAL) { - double answer = evaluate(data[ivar][0],NULL,ivar); + double answer = evaluate(data[ivar][0],nullptr,ivar); sprintf(data[ivar][1],"%.15g",answer); str = data[ivar][1]; } else if (style[ivar] == FORMAT) { int jvar = find(data[ivar][0]); - if (jvar == -1) return NULL; - if (!equalstyle(jvar)) return NULL; + if (jvar == -1) return nullptr; + if (!equalstyle(jvar)) return nullptr; double answer = compute_equal(jvar); sprintf(data[ivar][2],data[ivar][1],answer); str = data[ivar][2]; } else if (style[ivar] == GETENV) { const char *result = getenv(data[ivar][0]); - if (result == NULL) result = (const char *) ""; + if (result == nullptr) result = (const char *) ""; int n = strlen(result) + 1; if (n > VALUELENGTH) { delete [] data[ivar][1]; @@ -934,8 +931,8 @@ char *Variable::retrieve(const char *name) } else if (style[ivar] == PYTHON) { int ifunc = python->variable_match(data[ivar][0],name,0); if (ifunc < 0) - error->all(FLERR,fmt::format("Python variable '{}' does not match " - "Python function", name)); + error->all(FLERR,fmt::format("Python variable {} does not match " + "Python function {}", name, data[ivar][0])); python->invoke_function(ifunc,data[ivar][1]); str = data[ivar][1]; // if Python func returns a string longer than VALUELENGTH @@ -946,7 +943,7 @@ char *Variable::retrieve(const char *name) sprintf(data[ivar][0],"%.15g",dvalue[ivar]); str = data[ivar][0]; } else if (style[ivar] == ATOM || style[ivar] == ATOMFILE || - style[ivar] == VECTOR) return NULL; + style[ivar] == VECTOR) return nullptr; eval_in_progress[ivar] = 0; @@ -963,17 +960,18 @@ char *Variable::retrieve(const char *name) double Variable::compute_equal(int ivar) { if (eval_in_progress[ivar]) - print_var_error(FLERR,"Variable has a circular dependency",ivar); + print_var_error(FLERR,"has a circular dependency",ivar); eval_in_progress[ivar] = 1; double value = 0.0; - if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],NULL,ivar); + if (style[ivar] == EQUAL) value = evaluate(data[ivar][0],nullptr,ivar); else if (style[ivar] == INTERNAL) value = dvalue[ivar]; else if (style[ivar] == PYTHON) { int ifunc = python->find(data[ivar][0]); if (ifunc < 0) - print_var_error(FLERR,"Python variable has no function",ivar); + print_var_error(FLERR,fmt::format("cannot find python function {}", + data[ivar][0]),ivar); python->invoke_function(ifunc,data[ivar][1]); value = atof(data[ivar][1]); } @@ -990,7 +988,7 @@ double Variable::compute_equal(int ivar) double Variable::compute_equal(char *str) { - return evaluate(str,NULL,-1); + return evaluate(str,nullptr,-1); } /* ---------------------------------------------------------------------- @@ -1003,11 +1001,11 @@ double Variable::compute_equal(char *str) void Variable::compute_atom(int ivar, int igroup, double *result, int stride, int sumflag) { - Tree *tree = NULL; + Tree *tree = nullptr; double *vstore; if (eval_in_progress[ivar]) - print_var_error(FLERR,"Variable has a circular dependency",ivar); + print_var_error(FLERR,"has a circular dependency",ivar); eval_in_progress[ivar] = 1; @@ -1017,7 +1015,7 @@ void Variable::compute_atom(int ivar, int igroup, collapse_tree(tree); } else vstore = reader[ivar]->fixstore->vstore; - if (result == NULL) { + if (result == nullptr) { if (style[ivar] == ATOM) free_tree(tree); eval_in_progress[ivar] = 0; return; @@ -1076,14 +1074,14 @@ void Variable::compute_atom(int ivar, int igroup, int Variable::compute_vector(int ivar, double **result) { - Tree *tree = NULL; + Tree *tree = nullptr; if (vecs[ivar].currentstep == update->ntimestep) { *result = vecs[ivar].values; return vecs[ivar].n; } if (eval_in_progress[ivar]) - print_var_error(FLERR,"Variable has a circular dependency",ivar); + print_var_error(FLERR,"has a circular dependency",ivar); eval_in_progress[ivar] = 1; @@ -1169,7 +1167,7 @@ void Variable::grow() reader = (VarReader **) memory->srealloc(reader,maxvar*sizeof(VarReader *),"var:reader"); - for (int i = old; i < maxvar; i++) reader[i] = NULL; + for (int i = old; i < maxvar; i++) reader[i] = nullptr; data = (char ***) memory->srealloc(data,maxvar*sizeof(char **),"var:data"); memory->grow(dvalue,maxvar,"var:dvalue"); @@ -1178,7 +1176,7 @@ void Variable::grow() for (int i = old; i < maxvar; i++) { vecs[i].nmax = 0; vecs[i].currentstep = -1; - vecs[i].values = NULL; + vecs[i].values = nullptr; } memory->grow(eval_in_progress,maxvar,"var:eval_in_progress"); @@ -1217,9 +1215,9 @@ void Variable::copy(int narg, char **from, char **to) compute = c_ID, c_ID[i], c_ID[i][j] fix = f_ID, f_ID[i], f_ID[i][j] variable = v_name, v_name[i] - equal-style variables passes in tree = NULL: + equal-style variables passes in tree = nullptr: evaluate the formula, return result as a double - atom-style and vector-style variables pass in tree = non-NULL: + atom-style and vector-style variables pass in tree = non-nullptr: parse the formula but do not evaluate it create a parse tree and return it ------------------------------------------------------------------------- */ @@ -1264,10 +1262,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) // evaluate contents and push on stack if (tree) { - Tree *newtree = NULL; + Tree *newtree = nullptr; evaluate(contents,&newtree,ivar); treestack[ntreestack++] = newtree; - } else argstack[nargstack++] = evaluate(contents,NULL,ivar); + } else argstack[nargstack++] = evaluate(contents,nullptr,ivar); delete [] contents; @@ -1300,7 +1298,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(number); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->extra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(number); @@ -1392,7 +1390,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1421,7 +1419,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1453,7 +1451,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1462,7 +1460,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && compute->vector_flag) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Compute global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1486,7 +1484,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = compute->size_vector; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1494,7 +1492,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && compute->array_flag) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Compute global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1518,7 +1516,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = compute->size_array_rows; newtree->nstride = compute->size_array_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1536,7 +1534,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) compute->invoked_flag |= INVOKED_PERATOM; } - peratom2global(1,NULL,compute->vector_atom,1,index1, + peratom2global(1,nullptr,compute->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); // c_ID[i][j] = scalar from per-atom array @@ -1557,11 +1555,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } if (compute->array_atom) - peratom2global(1,NULL,&compute->array_atom[0][index2-1], + peratom2global(1,nullptr,&compute->array_atom[0][index2-1], compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,NULL,NULL, + peratom2global(1,nullptr,nullptr, compute->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1570,7 +1568,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && compute->peratom_flag && compute->size_peratom_cols == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom compute in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1590,7 +1588,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = compute->vector_atom; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1599,7 +1597,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && compute->peratom_flag && compute->size_peratom_cols > 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom compute in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1622,10 +1620,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (compute->array_atom) newtree->array = &compute->array_atom[0][index1-1]; else - newtree->array = NULL; + newtree->array = nullptr; newtree->nstride = compute->size_peratom_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1689,7 +1687,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1711,7 +1709,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1736,7 +1734,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1748,7 +1746,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->global_freq) print_var_error(FLERR,"Fix in variable not computed at " "compatible time",ivar); - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Fix global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1770,7 +1768,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1781,7 +1779,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (update->whichflag > 0 && update->ntimestep % fix->global_freq) print_var_error(FLERR,"Fix in variable not computed " "at a compatible time",ivar); - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Fix global vector in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -1803,7 +1801,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1817,7 +1815,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) print_var_error(FLERR,"Fix in variable not computed " "at a compatible time",ivar); - peratom2global(1,NULL,fix->vector_atom,1,index1, + peratom2global(1,nullptr,fix->vector_atom,1,index1, tree,treestack,ntreestack,argstack,nargstack); // f_ID[i][j] = scalar from per-atom array @@ -1834,11 +1832,11 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) "at a compatible time",ivar); if (fix->array_atom) - peratom2global(1,NULL,&fix->array_atom[0][index2-1], + peratom2global(1,nullptr,&fix->array_atom[0][index2-1], fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); else - peratom2global(1,NULL,NULL, + peratom2global(1,nullptr,nullptr, fix->size_peratom_cols,index1, tree,treestack,ntreestack,argstack,nargstack); @@ -1847,7 +1845,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && fix->peratom_flag && fix->size_peratom_cols == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom fix in " "equal-style variable formula",ivar); if (update->whichflag > 0 && @@ -1860,7 +1858,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = fix->vector_atom; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1869,7 +1867,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 1 && fix->peratom_flag && fix->size_peratom_cols > 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Per-atom fix in " "equal-style variable formula",ivar); if (index1 > fix->size_peratom_cols) @@ -1885,10 +1883,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) if (fix->array_atom) newtree->array = &fix->array_atom[0][index1-1]; else - newtree->array = NULL; + newtree->array = nullptr; newtree->nstride = fix->size_peratom_cols; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1902,10 +1900,10 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) int ivar = find(word+2); if (ivar < 0) - print_var_error(FLERR,"Invalid variable reference " - "in variable formula",ivar); + print_var_error(FLERR,fmt::format("Invalid variable reference " + "{} in variable formula",word),ivar); if (eval_in_progress[ivar]) - print_var_error(FLERR,"Variable has circular dependency",ivar); + print_var_error(FLERR,"has a circular dependency",ivar); // parse zero or one trailing brackets // point i beyond last bracket @@ -1932,7 +1930,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -1944,14 +1942,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) style[ivar] != ATOMFILE && style[ivar] != VECTOR) { char *var = retrieve(word+2); - if (var == NULL) + if (var == nullptr) print_var_error(FLERR,"Invalid variable evaluation in " "variable formula",ivar); if (tree) { Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = atof(var); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = atof(var); @@ -1961,14 +1959,14 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOM) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atom-style variable in " "equal-style variable formula",ivar); if (treetype == VECTOR) print_var_error(FLERR,"Atom-style variable in " "vector-style variable formula",ivar); - Tree *newtree = NULL; + Tree *newtree = nullptr; evaluate(data[ivar][0],&newtree,ivar); treestack[ntreestack++] = newtree; @@ -1976,7 +1974,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == ATOMFILE) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atomfile-style variable in " "equal-style variable formula",ivar); if (treetype == VECTOR) @@ -1988,7 +1986,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->array = reader[ivar]->fixstore->vstore; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -1997,7 +1995,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket == 0 && style[ivar] == VECTOR) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Vector-style variable in " "equal-style variable formula",ivar); if (treetype == ATOM) @@ -2013,7 +2011,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->nvector = nvec; newtree->nstride = 1; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -2026,7 +2024,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) double *result; memory->create(result,atom->nlocal,"variable:result"); compute_atom(ivar,0,result,1,0); - peratom2global(1,NULL,result,1,index, + peratom2global(1,nullptr,result,1,index, tree,treestack,ntreestack,argstack,nargstack); memory->destroy(result); @@ -2034,7 +2032,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) } else if (nbracket && style[ivar] == ATOMFILE) { - peratom2global(1,NULL,reader[ivar]->fixstore->vstore,1,index, + peratom2global(1,nullptr,reader[ivar]->fixstore->vstore,1,index, tree,treestack,ntreestack,argstack,nargstack); // v_name[N] = scalar from vector-style variable @@ -2053,7 +2051,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = vec[m-1]; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = vec[m-1]; @@ -2101,7 +2099,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) tagint id = int_between_brackets(ptr,1); i = ptr-str+1; - peratom2global(0,word,NULL,0,id, + peratom2global(0,word,nullptr,0,id, tree,treestack,ntreestack,argstack,nargstack); // ---------------- @@ -2125,7 +2123,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -2147,7 +2145,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value1; @@ -2227,7 +2225,7 @@ double Variable::evaluate(char *str, Tree **tree, int ivar) newtree->type = opprevious; if ((opprevious == UNARY) || (opprevious == NOT)) { newtree->first = treestack[--ntreestack]; - newtree->second = NULL; + newtree->second = nullptr; newtree->nextra = 0; } else { newtree->second = treestack[--ntreestack]; @@ -2630,7 +2628,7 @@ double Variable::collapse_tree(Tree *tree) if (tree->type == RANDOM) { collapse_tree(tree->first); collapse_tree(tree->second); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (collapse_tree(tree->extra[0])); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -2644,7 +2642,7 @@ double Variable::collapse_tree(Tree *tree) double sigma = collapse_tree(tree->second); if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula"); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (collapse_tree(tree->extra[0])); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -2689,23 +2687,23 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == STAGGER) { - int ivalue1 = static_cast (collapse_tree(tree->first)); - int ivalue2 = static_cast (collapse_tree(tree->second)); + bigint ivalue1 = static_cast (collapse_tree(tree->first)); + bigint ivalue2 = static_cast (collapse_tree(tree->second)); if (tree->first->type != VALUE || tree->second->type != VALUE) return 0.0; tree->type = VALUE; if (ivalue1 <= 0 || ivalue2 <= 0 || ivalue1 <= ivalue2) error->one(FLERR,"Invalid math function in variable formula"); - int lower = update->ntimestep/ivalue1 * ivalue1; - int delta = update->ntimestep - lower; + bigint lower = update->ntimestep/ivalue1 * ivalue1; + bigint delta = update->ntimestep - lower; if (delta < ivalue2) tree->value = lower+ivalue2; else tree->value = lower+ivalue1; return tree->value; } if (tree->type == LOGFREQ) { - int ivalue1 = static_cast (collapse_tree(tree->first)); - int ivalue2 = static_cast (collapse_tree(tree->second)); - int ivalue3 = static_cast (collapse_tree(tree->extra[0])); + bigint ivalue1 = static_cast (collapse_tree(tree->first)); + bigint ivalue2 = static_cast (collapse_tree(tree->second)); + bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2713,9 +2711,9 @@ double Variable::collapse_tree(Tree *tree) error->one(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) tree->value = ivalue1; else { - int lower = ivalue1; + bigint lower = ivalue1; while (update->ntimestep >= ivalue3*lower) lower *= ivalue3; - int multiple = update->ntimestep/lower; + bigint multiple = update->ntimestep/lower; if (multiple < ivalue2) tree->value = (multiple+1)*lower; else tree->value = lower*ivalue3; } @@ -2723,9 +2721,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == LOGFREQ2) { - int ivalue1 = static_cast (collapse_tree(tree->first)); - int ivalue2 = static_cast (collapse_tree(tree->second)); - int ivalue3 = static_cast (collapse_tree(tree->extra[0])); + bigint ivalue1 = static_cast (collapse_tree(tree->first)); + bigint ivalue2 = static_cast (collapse_tree(tree->second)); + bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2735,7 +2733,7 @@ double Variable::collapse_tree(Tree *tree) else { tree->value = ivalue1; double delta = ivalue1*(ivalue3-1.0)/ivalue2; - int count = 0; + bigint count = 0; while (update->ntimestep >= tree->value) { tree->value += delta; count++; @@ -2747,9 +2745,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == LOGFREQ3) { - int ivalue1 = static_cast (collapse_tree(tree->first)); - int ivalue2 = static_cast (collapse_tree(tree->second)); - int ivalue3 = static_cast (collapse_tree(tree->extra[0])); + bigint ivalue1 = static_cast (collapse_tree(tree->first)); + bigint ivalue2 = static_cast (collapse_tree(tree->second)); + bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2762,7 +2760,7 @@ double Variable::collapse_tree(Tree *tree) tree->value = ivalue1; double logsp = ivalue1; double factor = pow(((double)ivalue3)/ivalue1, 1.0/(ivalue2-1)); - int linsp = ivalue1; + bigint linsp = ivalue1; while (update->ntimestep >= (tree->value)) { logsp *= factor; linsp++; @@ -2776,9 +2774,9 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == STRIDE) { - int ivalue1 = static_cast (collapse_tree(tree->first)); - int ivalue2 = static_cast (collapse_tree(tree->second)); - int ivalue3 = static_cast (collapse_tree(tree->extra[0])); + bigint ivalue1 = static_cast (collapse_tree(tree->first)); + bigint ivalue2 = static_cast (collapse_tree(tree->second)); + bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE) return 0.0; tree->type = VALUE; @@ -2786,7 +2784,7 @@ double Variable::collapse_tree(Tree *tree) error->one(FLERR,"Invalid math function in variable formula"); if (update->ntimestep < ivalue1) tree->value = ivalue1; else if (update->ntimestep < ivalue2) { - int offset = update->ntimestep - ivalue1; + bigint offset = update->ntimestep - ivalue1; tree->value = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (tree->value > ivalue2) tree->value = (double) MAXBIGINT; } else tree->value = (double) MAXBIGINT; @@ -2794,12 +2792,12 @@ double Variable::collapse_tree(Tree *tree) } if (tree->type == STRIDE2) { - int ivalue1 = static_cast (collapse_tree(tree->first)); - int ivalue2 = static_cast (collapse_tree(tree->second)); - int ivalue3 = static_cast (collapse_tree(tree->extra[0])); - int ivalue4 = static_cast (collapse_tree(tree->extra[1])); - int ivalue5 = static_cast (collapse_tree(tree->extra[2])); - int ivalue6 = static_cast (collapse_tree(tree->extra[3])); + bigint ivalue1 = static_cast (collapse_tree(tree->first)); + bigint ivalue2 = static_cast (collapse_tree(tree->second)); + bigint ivalue3 = static_cast (collapse_tree(tree->extra[0])); + bigint ivalue4 = static_cast (collapse_tree(tree->extra[1])); + bigint ivalue5 = static_cast (collapse_tree(tree->extra[2])); + bigint ivalue6 = static_cast (collapse_tree(tree->extra[3])); if (tree->first->type != VALUE || tree->second->type != VALUE || tree->extra[0]->type != VALUE || tree->extra[1]->type != VALUE || tree->extra[2]->type != VALUE || tree->extra[3]->type != VALUE) @@ -2815,15 +2813,15 @@ double Variable::collapse_tree(Tree *tree) if (update->ntimestep < ivalue1) istep = ivalue1; else if (update->ntimestep < ivalue2) { if (update->ntimestep < ivalue4 || update->ntimestep > ivalue5) { - int offset = update->ntimestep - ivalue1; + bigint offset = update->ntimestep - ivalue1; istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (update->ntimestep < ivalue2 && istep > ivalue4) tree->value = ivalue4; } else { - int offset = update->ntimestep - ivalue4; + bigint offset = update->ntimestep - ivalue4; istep = ivalue4 + (offset/ivalue6)*ivalue6 + ivalue6; if (istep > ivalue5) { - int offset = ivalue5 - ivalue1; + bigint offset = ivalue5 - ivalue1; istep = ivalue1 + (offset/ivalue3)*ivalue3 + ivalue3; if (istep > ivalue2) istep = MAXBIGINT; } @@ -3024,7 +3022,7 @@ double Variable::eval_tree(Tree *tree, int i) if (tree->type == RANDOM) { double lower = eval_tree(tree->first,i); double upper = eval_tree(tree->second,i); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (eval_tree(tree->extra[0],i)); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3037,7 +3035,7 @@ double Variable::eval_tree(Tree *tree, int i) double sigma = eval_tree(tree->second,i); if (sigma < 0.0) error->one(FLERR,"Invalid math function in variable formula"); - if (randomatom == NULL) { + if (randomatom == nullptr) { int seed = static_cast (eval_tree(tree->extra[0],i)); if (seed <= 0) error->one(FLERR,"Invalid math function in variable formula"); @@ -3347,7 +3345,7 @@ tagint Variable::int_between_brackets(char *&ptr, int varallow) error->all(FLERR,"Invalid variable name in variable formula"); char *var = retrieve(id); - if (var == NULL) + if (var == nullptr) error->all(FLERR,"Invalid variable evaluation in variable formula"); index = static_cast (atof(var)); @@ -3402,15 +3400,15 @@ int Variable::math_function(char *word, char *contents, Tree **tree, char *args[MAXFUNCARG]; int narg = parse_args(contents,args); - Tree *newtree = NULL; + Tree *newtree = nullptr; double value1,value2; double values[MAXFUNCARG-2]; if (tree) { newtree = new Tree(); - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; - Tree *argtree = NULL; + Tree *argtree = nullptr; evaluate(args[0],&argtree,ivar); newtree->first = argtree; if (narg > 1) { @@ -3428,12 +3426,12 @@ int Variable::math_function(char *word, char *contents, Tree **tree, treestack[ntreestack++] = newtree; } else { - value1 = evaluate(args[0],NULL,ivar); + value1 = evaluate(args[0],nullptr,ivar); if (narg > 1) { - value2 = evaluate(args[1],NULL,ivar); + value2 = evaluate(args[1],nullptr,ivar); if (narg > 2) { for (int i = 2; i < narg; i++) - values[i-2] = evaluate(args[i],NULL,ivar); + values[i-2] = evaluate(args[i],nullptr,ivar); } } } @@ -3533,7 +3531,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Invalid math function in variable formula",ivar); if (tree) newtree->type = RANDOM; else { - if (randomequal == NULL) { + if (randomequal == nullptr) { int seed = static_cast (values[0]); if (seed <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -3548,7 +3546,7 @@ int Variable::math_function(char *word, char *contents, Tree **tree, else { if (value2 < 0.0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); - if (randomequal == NULL) { + if (randomequal == nullptr) { int seed = static_cast (values[0]); if (seed <= 0) print_var_error(FLERR,"Invalid math function in variable formula",ivar); @@ -4032,7 +4030,7 @@ int Variable::group_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4110,8 +4108,8 @@ int Variable::special_function(char *word, char *contents, Tree **tree, if (narg != 1) print_var_error(FLERR,"Invalid special function in variable formula",ivar); - Compute *compute = NULL; - Fix *fix = NULL; + Compute *compute = nullptr; + Fix *fix = nullptr; int ivar = -1; int index,nvec,nstride; char *ptr1,*ptr2; @@ -4220,7 +4218,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, print_var_error(FLERR,"Mis-matched special function variable " "in variable formula",ivar); if (eval_in_progress[ivar]) - print_var_error(FLERR,"Variable has circular dependency",ivar); + print_var_error(FLERR,"has a circular dependency",ivar); double *vec; nvec = compute_vector(ivar,&vec); @@ -4242,7 +4240,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, double *vec; if (index) { if (compute->array) vec = &compute->array[0][index-1]; - else vec = NULL; + else vec = nullptr; } else vec = compute->vector; int j = 0; @@ -4323,7 +4321,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4331,7 +4329,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // mask special functions } else if (strcmp(word,"gmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Gmask function in equal-style " "variable formula",ivar); if (narg != 1) @@ -4344,12 +4342,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = GMASK; newtree->ivalue1 = group->bitmask[igroup]; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else if (strcmp(word,"rmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Rmask function in equal-style " "variable formula",ivar); if (narg != 1) @@ -4361,12 +4359,12 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = RMASK; newtree->ivalue1 = iregion; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else if (strcmp(word,"grmask") == 0) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Grmask function in equal-style " "variable formula",ivar); if (narg != 2) @@ -4382,7 +4380,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, newtree->type = GRMASK; newtree->ivalue1 = group->bitmask[igroup]; newtree->ivalue2 = iregion; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4412,7 +4410,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4422,7 +4420,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, // set selfalloc = 1 so result will be deleted by free_tree() after eval } else if (style[ivar] == ATOMFILE) { - if (tree == NULL) + if (tree == nullptr) print_var_error(FLERR,"Atomfile variable in " "equal-style variable formula",ivar); @@ -4438,7 +4436,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, newtree->array = result; newtree->nstride = 1; newtree->selfalloc = 1; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4459,7 +4457,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4478,7 +4476,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4497,7 +4495,7 @@ int Variable::special_function(char *word, char *contents, Tree **tree, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4528,7 +4526,7 @@ void Variable::peratom2global(int flag, char *word, // error check for ID larger than any atom // int_between_brackets() already checked for ID <= 0 - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR, "Indexed per-atom vector in variable formula without atom map"); @@ -4582,7 +4580,7 @@ void Variable::peratom2global(int flag, char *word, Tree *newtree = new Tree(); newtree->type = VALUE; newtree->value = value; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; } else argstack[nargstack++] = value; @@ -4625,14 +4623,14 @@ int Variable::is_atom_vector(char *word) void Variable::atom_vector(char *word, Tree **tree, Tree **treestack, int &ntreestack) { - if (tree == NULL) + if (tree == nullptr) error->all(FLERR,"Atom vector in equal-style variable formula"); Tree *newtree = new Tree(); newtree->type = ATOMARRAY; newtree->nstride = 3; newtree->selfalloc = 0; - newtree->first = newtree->second = NULL; + newtree->first = newtree->second = nullptr; newtree->nextra = 0; treestack[ntreestack++] = newtree; @@ -4716,7 +4714,7 @@ int Variable::is_constant(char *word) double Variable::constant(char *word) { if (strcmp(word,"PI") == 0) return MY_PI; - if (strcmp(word,"version") == 0) return atof(universe->num_ver); + if (strcmp(word,"version") == 0) return lmp->num_ver; if (strcmp(word,"yes") == 0) return 1.0; if (strcmp(word,"no") == 0) return 0.0; if (strcmp(word,"on") == 0) return 1.0; @@ -4759,7 +4757,7 @@ int Variable::parse_args(char *str, char **args) /* ---------------------------------------------------------------------- find next comma in str skip commas inside one or more nested parenthesis - only return ptr to comma at level 0, else NULL if not found + only return ptr to comma at level 0, else nullptr if not found ------------------------------------------------------------------------- */ char *Variable::find_next_comma(char *str) @@ -4770,7 +4768,7 @@ char *Variable::find_next_comma(char *str) else if (')' == *p) level--; else if (',' == *p && !level) return p; } - return NULL; + return nullptr; } @@ -5072,11 +5070,11 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : { me = comm->me; style = flag; - fp = NULL; + fp = nullptr; if (me == 0) { fp = fopen(file,"r"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open file variable file {}: {}", file, utils::getsyserror())); } @@ -5085,12 +5083,12 @@ VarReader::VarReader(LAMMPS *lmp, char *name, char *file, int flag) : // allocate a new fix STORE, so they persist // id = variable-ID + VARIABLE_STORE, fix group = all - fixstore = NULL; - id_fix = NULL; - buffer = NULL; + fixstore = nullptr; + id_fix = nullptr; + buffer = nullptr; if (style == ATOMFILE) { - if (atom->map_style == 0) + if (atom->map_style == Atom::MAP_NONE) error->all(FLERR,"Cannot use atomfile-style " "variable unless an atom map exists"); @@ -5112,7 +5110,7 @@ VarReader::~VarReader() { if (me == 0) { fclose(fp); - fp = NULL; + fp = nullptr; } // check modify in case all fixes have already been deleted @@ -5140,12 +5138,12 @@ int VarReader::read_scalar(char *str) if (me == 0) { while (1) { - if (fgets(str,MAXLINE,fp) == NULL) n = 0; + if (fgets(str,MAXLINE,fp) == nullptr) n = 0; else n = strlen(str); if (n == 0) break; // end of file str[n-1] = '\0'; // strip newline if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment - if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank + if (strtok(str," \t\n\r\f") == nullptr) continue; // skip if blank n = strlen(str) + 1; break; } @@ -5183,12 +5181,12 @@ int VarReader::read_peratom() char str[MAXLINE]; if (me == 0) { while (1) { - if (fgets(str,MAXLINE,fp) == NULL) n = 0; + if (fgets(str,MAXLINE,fp) == nullptr) n = 0; else n = strlen(str); if (n == 0) break; // end of file str[n-1] = '\0'; // strip newline if ((ptr = strchr(str,'#'))) *ptr = '\0'; // strip comment - if (strtok(str," \t\n\r\f") == NULL) continue; // skip if blank + if (strtok(str," \t\n\r\f") == nullptr) continue; // skip if blank n = strlen(str) + 1; break; } @@ -5198,7 +5196,7 @@ int VarReader::read_peratom() if (n == 0) return 1; MPI_Bcast(str,n,MPI_CHAR,0,world); - bigint nlines = force->bnumeric(FLERR,str); + bigint nlines = utils::bnumeric(FLERR,str,false,lmp); tagint map_tag_max = atom->map_tag_max; bigint nread = 0; diff --git a/src/variable.h b/src/variable.h index f5ea11c0b4..2519bc7ac9 100644 --- a/src/variable.h +++ b/src/variable.h @@ -15,7 +15,6 @@ #define LMP_VARIABLE_H #include "pointers.h" -#include namespace LAMMPS_NS { @@ -50,11 +49,13 @@ class Variable : protected Pointers { tagint int_between_brackets(char *&, int); double evaluate_boolean(char *); + public: + int nvar; // # of defined variables + char **names; // name of each variable + private: int me; - int nvar; // # of defined variables int maxvar; // max # of variables following lists can hold - char **names; // name of each variable int *style; // style of each variable int *num; // # of values for each variable int *which; // next available value for each variable @@ -94,9 +95,9 @@ class Variable : protected Pointers { Tree **extra; // ptrs further down tree for nextra args Tree() : - array(NULL), iarray(NULL), barray(NULL), + array(nullptr), iarray(nullptr), barray(nullptr), selfalloc(0), ivalue1(0), ivalue2(0), nextra(0), - first(NULL), second(NULL), extra(NULL) {} + first(nullptr), second(nullptr), extra(nullptr) {} }; int compute_python(int); diff --git a/src/velocity.cpp b/src/velocity.cpp index c2776ea174..7057d68bce 100644 --- a/src/velocity.cpp +++ b/src/velocity.cpp @@ -12,24 +12,24 @@ ------------------------------------------------------------------------- */ #include "velocity.h" -#include -#include + #include "atom.h" -#include "domain.h" -#include "lattice.h" -#include "input.h" -#include "variable.h" -#include "force.h" -#include "modify.h" -#include "fix.h" +#include "comm.h" #include "compute.h" #include "compute_temp.h" -#include "random_park.h" -#include "group.h" -#include "comm.h" -#include "memory.h" +#include "domain.h" #include "error.h" -#include "utils.h" +#include "fix.h" +#include "group.h" +#include "input.h" +#include "lattice.h" +#include "memory.h" +#include "modify.h" +#include "random_park.h" +#include "variable.h" + +#include +#include using namespace LAMMPS_NS; @@ -82,7 +82,7 @@ void Velocity::command(int narg, char **arg) // set defaults - temperature = NULL; + temperature = nullptr; dist_flag = 0; sum_flag = 0; momentum_flag = 1; @@ -127,8 +127,8 @@ void Velocity::command(int narg, char **arg) // create() invoked differently, so can be called externally if (style == CREATE) { - double t_desired = force->numeric(FLERR,arg[2]); - int seed = force->inumeric(FLERR,arg[3]); + double t_desired = utils::numeric(FLERR,arg[2],false,lmp); + int seed = utils::inumeric(FLERR,arg[3],false,lmp); create(t_desired,seed); } else if (style == SET) set(narg-2,&arg[2]); @@ -147,7 +147,7 @@ void Velocity::init_external(const char *extgroup) if (igroup == -1) error->all(FLERR,"Could not find velocity group ID"); groupbit = group->bitmask[igroup]; - temperature = NULL; + temperature = nullptr; dist_flag = 0; sum_flag = 0; momentum_flag = 1; @@ -179,18 +179,18 @@ void Velocity::create(double t_desired, int seed) } } - // if temperature = NULL or bias_flag set, + // if temperature = nullptr or bias_flag set, // create a new ComputeTemp with the velocity group int tcreate_flag = 0; - Compute *temperature_nobias = NULL; + Compute *temperature_nobias = nullptr; - if (temperature == NULL || bias_flag) { + if (temperature == nullptr || bias_flag) { char **arg = new char*[3]; arg[0] = (char *) "velocity_temp"; arg[1] = group->names[igroup]; arg[2] = (char *) "temp"; - if (temperature == NULL) { + if (temperature == nullptr) { temperature = new ComputeTemp(lmp,3,arg); tcreate_flag = 1; } else temperature_nobias = new ComputeTemp(lmp,3,arg); @@ -245,14 +245,14 @@ void Velocity::create(double t_desired, int seed) int m; double vx,vy,vz,factor; - RanPark *random = NULL; + RanPark *random = nullptr; if (loop_flag == ALL) { // create an atom map if one doesn't exist already int mapflag = 0; - if (atom->map_style == 0) { + if (atom->map_style == Atom::MAP_NONE) { mapflag = 1; atom->nghost = 0; atom->map_init(); @@ -304,7 +304,7 @@ void Velocity::create(double t_desired, int seed) if (mapflag) { atom->map_delete(); - atom->map_style = 0; + atom->map_style = Atom::MAP_NONE; } } else if (loop_flag == LOCAL) { @@ -368,7 +368,7 @@ void Velocity::create(double t_desired, int seed) // no-bias compute calculates temp only for new thermal velocities double t; - if ((bias_flag == 0) || (temperature_nobias == NULL)) + if ((bias_flag == 0) || (temperature_nobias == nullptr)) t = temperature->compute_scalar(); else t = temperature_nobias->compute_scalar(); rescale(t,t_desired); @@ -417,28 +417,28 @@ void Velocity::set(int /*narg*/, char **arg) // parse 3 args xstyle = ystyle = zstyle = CONSTANT; - xstr = ystr = zstr = NULL; + xstr = ystr = zstr = nullptr; if (strstr(arg[0],"v_") == arg[0]) { int n = strlen(&arg[0][2]) + 1; xstr = new char[n]; strcpy(xstr,&arg[0][2]); } else if (strcmp(arg[0],"NULL") == 0) xstyle = NONE; - else vx = force->numeric(FLERR,arg[0]); + else vx = utils::numeric(FLERR,arg[0],false,lmp); if (strstr(arg[1],"v_") == arg[1]) { int n = strlen(&arg[1][2]) + 1; ystr = new char[n]; strcpy(ystr,&arg[1][2]); } else if (strcmp(arg[1],"NULL") == 0) ystyle = NONE; - else vy = force->numeric(FLERR,arg[1]); + else vy = utils::numeric(FLERR,arg[1],false,lmp); if (strstr(arg[2],"v_") == arg[2]) { int n = strlen(&arg[2][2]) + 1; zstr = new char[n]; strcpy(zstr,&arg[2][2]); } else if (strcmp(arg[2],"NULL") == 0) zstyle = NONE; - else vz = force->numeric(FLERR,arg[2]); + else vz = utils::numeric(FLERR,arg[2],false,lmp); // set and apply scale factors @@ -501,7 +501,7 @@ void Velocity::set(int /*narg*/, char **arg) // allocate vfield array if necessary - double **vfield = NULL; + double **vfield = nullptr; if (varflag == ATOM) memory->create(vfield,atom->nlocal,3,"velocity:vfield"); // set velocities via constants @@ -531,17 +531,17 @@ void Velocity::set(int /*narg*/, char **arg) if (xstyle == EQUAL) vx = input->variable->compute_equal(xvar); else if (xstyle == ATOM) { if (vfield) input->variable->compute_atom(xvar,igroup,&vfield[0][0],3,0); - else input->variable->compute_atom(xvar,igroup,NULL,3,0); + else input->variable->compute_atom(xvar,igroup,nullptr,3,0); } if (ystyle == EQUAL) vy = input->variable->compute_equal(yvar); else if (ystyle == ATOM) { if (vfield) input->variable->compute_atom(yvar,igroup,&vfield[0][1],3,0); - else input->variable->compute_atom(yvar,igroup,NULL,3,0); + else input->variable->compute_atom(yvar,igroup,nullptr,3,0); } if (zstyle == EQUAL) vz = input->variable->compute_equal(zvar); else if (zstyle == ATOM) { if (vfield) input->variable->compute_atom(zvar,igroup,&vfield[0][2],3,0); - else input->variable->compute_atom(zvar,igroup,NULL,3,0); + else input->variable->compute_atom(zvar,igroup,nullptr,3,0); } for (int i = 0; i < nlocal; i++) @@ -578,12 +578,12 @@ void Velocity::set(int /*narg*/, char **arg) void Velocity::scale(int /*narg*/, char **arg) { - double t_desired = force->numeric(FLERR,arg[0]); + double t_desired = utils::numeric(FLERR,arg[0],false,lmp); - // if temperature = NULL, create a new ComputeTemp with the velocity group + // if temperature = nullptr, create a new ComputeTemp with the velocity group int tflag = 0; - if (temperature == NULL) { + if (temperature == nullptr) { char **arg = new char*[3]; arg[0] = (char *) "velocity_temp"; arg[1] = group->names[igroup]; @@ -649,14 +649,14 @@ void Velocity::ramp(int /*narg*/, char **arg) double v_lo,v_hi; if (v_dim == 0) { - v_lo = xscale*force->numeric(FLERR,arg[1]); - v_hi = xscale*force->numeric(FLERR,arg[2]); + v_lo = xscale*utils::numeric(FLERR,arg[1],false,lmp); + v_hi = xscale*utils::numeric(FLERR,arg[2],false,lmp); } else if (v_dim == 1) { - v_lo = yscale*force->numeric(FLERR,arg[1]); - v_hi = yscale*force->numeric(FLERR,arg[2]); + v_lo = yscale*utils::numeric(FLERR,arg[1],false,lmp); + v_hi = yscale*utils::numeric(FLERR,arg[2],false,lmp); } else if (v_dim == 2) { - v_lo = zscale*force->numeric(FLERR,arg[1]); - v_hi = zscale*force->numeric(FLERR,arg[2]); + v_lo = zscale*utils::numeric(FLERR,arg[1],false,lmp); + v_hi = zscale*utils::numeric(FLERR,arg[2],false,lmp); } int coord_dim = 0; @@ -667,14 +667,14 @@ void Velocity::ramp(int /*narg*/, char **arg) double coord_lo,coord_hi; if (coord_dim == 0) { - coord_lo = xscale*force->numeric(FLERR,arg[4]); - coord_hi = xscale*force->numeric(FLERR,arg[5]); + coord_lo = xscale*utils::numeric(FLERR,arg[4],false,lmp); + coord_hi = xscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (coord_dim == 1) { - coord_lo = yscale*force->numeric(FLERR,arg[4]); - coord_hi = yscale*force->numeric(FLERR,arg[5]); + coord_lo = yscale*utils::numeric(FLERR,arg[4],false,lmp); + coord_hi = yscale*utils::numeric(FLERR,arg[5],false,lmp); } else if (coord_dim == 2) { - coord_lo = zscale*force->numeric(FLERR,arg[4]); - coord_hi = zscale*force->numeric(FLERR,arg[5]); + coord_lo = zscale*utils::numeric(FLERR,arg[4],false,lmp); + coord_hi = zscale*utils::numeric(FLERR,arg[5],false,lmp); } // vramp = ramped velocity component for v_dim @@ -901,7 +901,7 @@ void Velocity::options(int narg, char **arg) // error check - if (bias_flag && temperature == NULL) + if (bias_flag && temperature == nullptr) error->all(FLERR,"Cannot use velocity bias command without temp keyword"); if (bias_flag && temperature->tempbias == 0) error->all(FLERR,"Velocity temperature ID does calculate a velocity bias"); diff --git a/src/verlet.cpp b/src/verlet.cpp index 97c5f918b5..a7b9ba4c22 100644 --- a/src/verlet.cpp +++ b/src/verlet.cpp @@ -12,26 +12,26 @@ ------------------------------------------------------------------------- */ #include "verlet.h" -#include -#include -#include "neighbor.h" -#include "domain.h" -#include "comm.h" + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "force.h" -#include "pair.h" #include "bond.h" -#include "angle.h" +#include "comm.h" #include "dihedral.h" +#include "domain.h" +#include "error.h" +#include "force.h" #include "improper.h" #include "kspace.h" -#include "output.h" -#include "update.h" #include "modify.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" #include "timer.h" -#include "error.h" -#include "fmt/format.h" +#include "update.h" + +#include using namespace LAMMPS_NS; diff --git a/src/version.h b/src/version.h index c5f372c0ed..84d15a17dd 100644 --- a/src/version.h +++ b/src/version.h @@ -1 +1 @@ -#define LAMMPS_VERSION "21 Jul 2020" +#define LAMMPS_VERSION "18 Sep 2020" diff --git a/src/write_coeff.cpp b/src/write_coeff.cpp index 612f5bb123..f6d1af9e01 100644 --- a/src/write_coeff.cpp +++ b/src/write_coeff.cpp @@ -12,22 +12,21 @@ ------------------------------------------------------------------------- */ #include "write_coeff.h" -#include -#include -#include -#include -#include "pair.h" -#include "bond.h" + #include "angle.h" -#include "dihedral.h" -#include "improper.h" +#include "bond.h" #include "comm.h" -#include "force.h" -#include "universe.h" -#include "error.h" +#include "dihedral.h" #include "domain.h" -#include "utils.h" -#include "fmt/format.h" +#include "error.h" +#include "force.h" +#include "improper.h" +#include "pair.h" +#include "universe.h" + +#include +#include +#include using namespace LAMMPS_NS; @@ -57,7 +56,7 @@ void WriteCoeff::command(int narg, char **arg) char str[256], coeff[256]; FILE *one = fopen(file,"wb+"); - if (one == NULL) + if (one == nullptr) error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", file, utils::getsyserror())); @@ -91,24 +90,24 @@ void WriteCoeff::command(int narg, char **arg) rewind(one); FILE *two = fopen(file+4,"w"); - if (two == NULL) + if (two == nullptr) error->one(FLERR,fmt::format("Cannot open coeff file {}: {}", file+4, utils::getsyserror())); fprintf(two,"# LAMMPS coeff file via write_coeff, version %s\n", - universe->version); + lmp->version); while(1) { int coeff_mode = REGULAR_MODE; - if (fgets(str,256,one) == NULL) break; + if (fgets(str,256,one) == nullptr) break; // some coeffs need special treatment - if (strstr(str,"class2") != NULL) { - if (strstr(str,"angle_style") != NULL) + if (strstr(str,"class2") != nullptr) { + if (strstr(str,"angle_style") != nullptr) coeff_mode = CLASS2_MODE; - else if (strstr(str,"dihedral_style") != NULL) + else if (strstr(str,"dihedral_style") != nullptr) coeff_mode = CLASS2_MODE; - else if (strstr(str,"improper_style") != NULL) + else if (strstr(str,"improper_style") != nullptr) coeff_mode = CLASS2_MODE; } diff --git a/src/write_data.cpp b/src/write_data.cpp index 511552cf69..6b4c5ef209 100644 --- a/src/write_data.cpp +++ b/src/write_data.cpp @@ -12,29 +12,27 @@ ------------------------------------------------------------------------- */ #include "write_data.h" -#include -#include -#include + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "force.h" -#include "pair.h" #include "bond.h" -#include "angle.h" -#include "dihedral.h" -#include "improper.h" -#include "update.h" -#include "modify.h" -#include "fix.h" -#include "domain.h" -#include "universe.h" #include "comm.h" -#include "output.h" -#include "thermo.h" -#include "memory.h" +#include "dihedral.h" +#include "domain.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "fix.h" +#include "force.h" +#include "improper.h" +#include "memory.h" +#include "modify.h" +#include "output.h" +#include "pair.h" +#include "thermo.h" +#include "universe.h" +#include "update.h" + +#include using namespace LAMMPS_NS; @@ -154,22 +152,22 @@ void WriteData::write(const std::string &file) // sum up bond,angle,dihedral,improper counts // may be different than atom->nbonds,nangles, etc. if broken/turned-off - if (atom->molecular == 1 && (atom->nbonds || atom->nbondtypes)) { - nbonds_local = atom->avec->pack_bond(NULL); + if (atom->molecular == Atom::MOLECULAR && (atom->nbonds || atom->nbondtypes)) { + nbonds_local = atom->avec->pack_bond(nullptr); MPI_Allreduce(&nbonds_local,&nbonds,1,MPI_LMP_BIGINT,MPI_SUM,world); } - if (atom->molecular == 1 && (atom->nangles || atom->nangletypes)) { - nangles_local = atom->avec->pack_angle(NULL); + if (atom->molecular == Atom::MOLECULAR && (atom->nangles || atom->nangletypes)) { + nangles_local = atom->avec->pack_angle(nullptr); MPI_Allreduce(&nangles_local,&nangles,1,MPI_LMP_BIGINT,MPI_SUM,world); } - if (atom->molecular == 1 && (atom->ndihedrals || atom->ndihedraltypes)) { - ndihedrals_local = atom->avec->pack_dihedral(NULL); + if (atom->molecular == Atom::MOLECULAR && (atom->ndihedrals || atom->ndihedraltypes)) { + ndihedrals_local = atom->avec->pack_dihedral(nullptr); MPI_Allreduce(&ndihedrals_local,&ndihedrals,1,MPI_LMP_BIGINT,MPI_SUM,world); } - if (atom->molecular == 1 && (atom->nimpropers || atom->nimpropertypes)) { - nimpropers_local = atom->avec->pack_improper(NULL); + if (atom->molecular == Atom::MOLECULAR && (atom->nimpropers || atom->nimpropertypes)) { + nimpropers_local = atom->avec->pack_improper(nullptr); MPI_Allreduce(&nimpropers_local,&nimpropers,1,MPI_LMP_BIGINT,MPI_SUM,world); } @@ -177,7 +175,7 @@ void WriteData::write(const std::string &file) if (me == 0) { fp = fopen(file.c_str(),"w"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR,fmt::format("Cannot open data file {}: {}", file, utils::getsyserror())); } @@ -198,7 +196,7 @@ void WriteData::write(const std::string &file) // molecular topology info if defined // do not write molecular topology for atom_style template - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->nbonds && nbonds) bonds(); if (atom->nangles && nangles) angles(); if (atom->ndihedrals) dihedrals(); @@ -231,13 +229,13 @@ void WriteData::write(const std::string &file) void WriteData::header() { fmt::print(fp,"LAMMPS data file via write_data, version {}, " - "timestep = {}\n\n",universe->version,update->ntimestep); + "timestep = {}\n\n",lmp->version,update->ntimestep); fmt::print(fp,"{} atoms\n{} atom types\n",atom->natoms,atom->ntypes); // do not write molecular topology info for atom_style template - if (atom->molecular == 1) { + if (atom->molecular == Atom::MOLECULAR) { if (atom->nbonds || atom->nbondtypes) fmt::print(fp,"{} bonds\n{} bond types\n", nbonds,atom->nbondtypes); @@ -303,6 +301,9 @@ void WriteData::force_fields() { if (force->pair && force->pair->writedata) { if (pairflag == II) { + if ((comm->me == 0) && (force->pair->mixed_flag == 0)) + error->warning(FLERR,"Not all mixed pair coeffs generated from mixing. " + "Use write_data with 'pair ij' option to store all pair coeffs."); fmt::print(fp,"\nPair Coeffs # {}\n\n", force->pair_style); force->pair->write_data(fp); } else if (pairflag == IJ) { @@ -664,7 +665,7 @@ void WriteData::bonus(int flag) // communication buffer for all my Bonus info // maxvalues = largest buffer needed by any proc - int nvalues = atom->avec->pack_data_bonus(NULL,flag); + int nvalues = atom->avec->pack_data_bonus(nullptr,flag); int maxvalues; MPI_Allreduce(&nvalues,&maxvalues,1,MPI_INT,MPI_MAX,world); diff --git a/src/write_data.h b/src/write_data.h index e94e7f5595..a4e71c9cda 100644 --- a/src/write_data.h +++ b/src/write_data.h @@ -21,7 +21,6 @@ CommandStyle(write_data,WriteData) #define LMP_WRITE_DATA_H #include "pointers.h" -#include namespace LAMMPS_NS { diff --git a/src/write_dump.cpp b/src/write_dump.cpp index 9b257b9ab0..fd359ec2ba 100644 --- a/src/write_dump.cpp +++ b/src/write_dump.cpp @@ -16,15 +16,16 @@ ------------------------------------------------------------------------- */ #include "write_dump.h" -#include -#include #include "style_dump.h" + +#include "comm.h" #include "dump.h" #include "dump_image.h" -#include "comm.h" -#include "update.h" #include "error.h" -#include "utils.h" +#include "update.h" + +#include + using namespace LAMMPS_NS; @@ -44,7 +45,7 @@ void WriteDump::command(int narg, char **arg) // create the Dump instance // create dump command line with extra required args - Dump *dump = NULL; + Dump *dump = nullptr; char **dumpargs = new char*[modindex+2]; dumpargs[0] = (char *) "WRITE_DUMP"; // dump id diff --git a/src/write_restart.cpp b/src/write_restart.cpp index 062add3b3c..6f2b393603 100644 --- a/src/write_restart.cpp +++ b/src/write_restart.cpp @@ -12,32 +12,30 @@ ------------------------------------------------------------------------- */ #include "write_restart.h" -#include -#include -#include + +#include "angle.h" #include "atom.h" #include "atom_vec.h" -#include "group.h" -#include "force.h" -#include "pair.h" #include "bond.h" -#include "angle.h" -#include "dihedral.h" -#include "improper.h" -#include "update.h" -#include "neighbor.h" -#include "domain.h" -#include "modify.h" -#include "fix.h" -#include "universe.h" #include "comm.h" -#include "output.h" -#include "thermo.h" -#include "mpiio.h" -#include "memory.h" +#include "dihedral.h" +#include "domain.h" #include "error.h" -#include "utils.h" -#include "fmt/format.h" +#include "fix.h" +#include "force.h" +#include "group.h" +#include "improper.h" +#include "memory.h" +#include "modify.h" +#include "mpiio.h" +#include "neighbor.h" +#include "output.h" +#include "pair.h" +#include "thermo.h" +#include "universe.h" +#include "update.h" + +#include #include "lmprestart.h" @@ -51,7 +49,7 @@ WriteRestart::WriteRestart(LAMMPS *lmp) : Pointers(lmp) MPI_Comm_size(world,&nprocs); multiproc = 0; noinit = 0; - fp = NULL; + fp = nullptr; } /* ---------------------------------------------------------------------- @@ -159,7 +157,7 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, if (!multiproc) error->all(FLERR,"Cannot use write_restart fileper " "without % in restart file name"); - int nper = force->inumeric(FLERR,arg[iarg+1]); + int nper = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nper <= 0) error->all(FLERR,"Illegal write_restart command"); multiproc = nprocs/nper; @@ -177,7 +175,7 @@ void WriteRestart::multiproc_options(int multiproc_caller, int mpiioflag_caller, if (!multiproc) error->all(FLERR,"Cannot use write_restart nfile " "without % in restart file name"); - int nfile = force->inumeric(FLERR,arg[iarg+1]); + int nfile = utils::inumeric(FLERR,arg[iarg+1],false,lmp); if (nfile <= 0) error->all(FLERR,"Illegal write_restart command"); nfile = MIN(nfile,nprocs); @@ -233,7 +231,7 @@ void WriteRestart::write(std::string file) if (multiproc) base.replace(base.find("%"),1,"base"); fp = fopen(base.c_str(),"wb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR, fmt::format("Cannot open restart file {}: {}", base, utils::getsyserror())); } @@ -288,7 +286,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } std::string multiname = file; @@ -296,7 +294,7 @@ void WriteRestart::write(std::string file) if (filewriter) { fp = fopen(multiname.c_str(),"wb"); - if (fp == NULL) + if (fp == nullptr) error->one(FLERR, fmt::format("Cannot open restart file {}: {}", multiname, utils::getsyserror())); write_int(PROCSPERFILE,nclusterprocs); @@ -365,7 +363,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } mpiio->openForWrite(file.c_str()); mpiio->write(headerOffset,send_size,buf); @@ -395,7 +393,7 @@ void WriteRestart::write(std::string file) magic_string(); if (ferror(fp)) io_error = 1; fclose(fp); - fp = NULL; + fp = nullptr; } else { MPI_Recv(&tmp,0,MPI_INT,fileproc,0,world,MPI_STATUS_IGNORE); @@ -426,7 +424,7 @@ void WriteRestart::write(std::string file) void WriteRestart::header() { - write_string(VERSION,universe->version); + write_string(VERSION,lmp->version); write_int(SMALLINT,sizeof(smallint)); write_int(IMAGEINT,sizeof(imageint)); write_int(TAGINT,sizeof(tagint)); @@ -633,7 +631,7 @@ void WriteRestart::version_numeric() } /* ---------------------------------------------------------------------- - write a flag and an int into restart file + write a flag and an int into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_int(int flag, int value) @@ -643,7 +641,7 @@ void WriteRestart::write_int(int flag, int value) } /* ---------------------------------------------------------------------- - write a flag and a bigint into restart file + write a flag and a bigint into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_bigint(int flag, bigint value) @@ -653,7 +651,7 @@ void WriteRestart::write_bigint(int flag, bigint value) } /* ---------------------------------------------------------------------- - write a flag and a double into restart file + write a flag and a double into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_double(int flag, double value) @@ -663,7 +661,8 @@ void WriteRestart::write_double(int flag, double value) } /* ---------------------------------------------------------------------- - write a flag and a char string (including NULL) into restart file + write a flag and a C-style char string (including the terminating null + byte) into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_string(int flag, const char *value) @@ -675,7 +674,7 @@ void WriteRestart::write_string(int flag, const char *value) } /* ---------------------------------------------------------------------- - write a flag and vector of N ints into restart file + write a flag and vector of N ints into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_int_vec(int flag, int n, int *vec) @@ -686,7 +685,7 @@ void WriteRestart::write_int_vec(int flag, int n, int *vec) } /* ---------------------------------------------------------------------- - write a flag and vector of N doubles into restart file + write a flag and vector of N doubles into the restart file ------------------------------------------------------------------------- */ void WriteRestart::write_double_vec(int flag, int n, double *vec) diff --git a/src/write_restart.h b/src/write_restart.h index 5056f50636..a4a606482e 100644 --- a/src/write_restart.h +++ b/src/write_restart.h @@ -21,7 +21,6 @@ CommandStyle(write_restart,WriteRestart) #define LMP_WRITE_RESTART_H #include "pointers.h" -#include namespace LAMMPS_NS { diff --git a/tools/README b/tools/README index bed062f918..e98e552b61 100644 --- a/tools/README +++ b/tools/README @@ -29,6 +29,7 @@ fep scripts for free-energy perturbation with USER-FEP pkg i-pi Python wrapper for performing path-integral MD (PIMD) ipp input pre-processor Perl tool for creating input scripts kate add-ons to Kate editor for editing LAMMPS input scripts +lammps-shell LAMMPS executable enhanced for interactive use lmp2arc convert LAMMPS output to Accelrys Insight format lmp2cfg convert LAMMPS output to CFG files for AtomEye viz matlab MatLab scripts for post-processing LAMMPS output diff --git a/tools/binary2txt.cpp b/tools/binary2txt.cpp index 119e9e3574..fcfb4729fd 100644 --- a/tools/binary2txt.cpp +++ b/tools/binary2txt.cpp @@ -90,9 +90,16 @@ int main(int narg, char **arg) FILE *fptxt = fopen(filetxt,"w"); delete [] filetxt; + // detect newer format + char * magic_string = nullptr; + char * columns = nullptr; + char * unit_style = nullptr; + // loop over snapshots in file while (1) { + int endian = 0x0001; + int revision = 0x0001; fread(&ntimestep,sizeof(bigint),1,fp); @@ -104,6 +111,26 @@ int main(int narg, char **arg) break; } + // detect newer format + if (ntimestep < 0) { + // first bigint encodes negative format name length + bigint magic_string_len = -ntimestep; + + delete [] magic_string; + magic_string = new char[magic_string_len + 1]; + fread(magic_string, sizeof(char), magic_string_len, fp); + magic_string[magic_string_len] = '\0'; + + // read endian flag + fread(&endian, sizeof(int), 1, fp); + + // read revision number + fread(&revision, sizeof(int), 1, fp); + + // read the real ntimestep + fread(&ntimestep,sizeof(bigint),1,fp); + } + fread(&natoms,sizeof(bigint),1,fp); fread(&triclinic,sizeof(int),1,fp); fread(&boundary[0][0],6*sizeof(int),1,fp); @@ -119,6 +146,39 @@ int main(int narg, char **arg) fread(&yz,sizeof(double),1,fp); } fread(&size_one,sizeof(int),1,fp); + + if (magic_string && revision > 0x0001) { + // newer format includes units string, columns string + // and time + int len = 0; + fread(&len, sizeof(int), 1, fp); + + if (len > 0) { + // has units + delete [] unit_style; + unit_style = new char[len+1]; + fread(unit_style, sizeof(char), len, fp); + unit_style[len] = '\0'; + fprintf(fptxt, "ITEM: UNITS\n"); + fprintf(fptxt, "%s\n", unit_style); + } + + char flag = 0; + fread(&flag, sizeof(char), 1, fp); + + if (flag) { + double time; + fread(&time, sizeof(double), 1, fp); + fprintf(fptxt, "ITEM: TIME\n%.16g\n", time); + } + + fread(&len, sizeof(int), 1, fp); + delete [] columns; + columns = new char[len+1]; + fread(columns, sizeof(char), len, fp); + columns[len] = '\0'; + } + fread(&nchunk,sizeof(int),1,fp); fprintf(fptxt,"ITEM: TIMESTEP\n"); @@ -140,18 +200,20 @@ int main(int narg, char **arg) if (!triclinic) { fprintf(fptxt,"ITEM: BOX BOUNDS %s\n",boundstr); - fprintf(fptxt,"%g %g\n",xlo,xhi); - fprintf(fptxt,"%g %g\n",ylo,yhi); - fprintf(fptxt,"%g %g\n",zlo,zhi); + fprintf(fptxt,"%-1.16e %-1.16e\n",xlo,xhi); + fprintf(fptxt,"%-1.16e %-1.16e\n",ylo,yhi); + fprintf(fptxt,"%-1.16e %-1.16e\n",zlo,zhi); } else { - fprintf(fptxt,"ITEM: BOX BOUNDS %s xy xz yz\n",boundstr); - fprintf(fptxt,"%g %g %g\n",xlo,xhi,xy); - fprintf(fptxt,"%g %g %g\n",ylo,yhi,xz); - fprintf(fptxt,"%g %g %g\n",zlo,zhi,yz); + fprintf(fptxt,"ITEM: BOX BOUNDS xy xz yz %s\n",boundstr); + fprintf(fptxt,"%-1.16e %-1.16e %-1.16e\n",xlo,xhi,xy); + fprintf(fptxt,"%-1.16e %-1.16e %-1.16e\n",ylo,yhi,xz); + fprintf(fptxt,"%-1.16e %-1.16e %-1.16e\n",zlo,zhi,yz); } - fprintf(fptxt,"ITEM: ATOMS\n"); - + if (columns) + fprintf(fptxt,"ITEM: ATOMS %s\n", columns); + else + fprintf(fptxt,"ITEM: ATOMS\n"); // loop over processor chunks in file @@ -172,7 +234,13 @@ int main(int narg, char **arg) n /= size_one; m = 0; for (j = 0; j < n; j++) { - for (k = 0; k < size_one; k++) fprintf(fptxt,"%g ",buf[m++]); + for (k = 0; k < size_one; k++) { + if(k+1 < size_one) { + fprintf(fptxt,"%g ",buf[m++]); + } else { + fprintf(fptxt,"%g",buf[m++]); + } + } fprintf(fptxt,"\n"); } } @@ -181,6 +249,12 @@ int main(int narg, char **arg) fflush(stdout); } printf("\n"); + delete [] columns; + delete [] magic_string; + delete [] unit_style; + columns = nullptr; + magic_string = nullptr; + unit_style = nullptr; } if (buf) delete [] buf; diff --git a/tools/doxygen/Developer.dox.lammps b/tools/doxygen/Developer.dox.lammps deleted file mode 100644 index 8e9e3de232..0000000000 --- a/tools/doxygen/Developer.dox.lammps +++ /dev/null @@ -1,456 +0,0 @@ -/** - -@mainpage Lammps Developer Guide -@tableofcontents - -

    LAMMPS Documentation

    -

    and

    -

    LAMMPS Developer Guide

    -

    LAMMPS_VERSION

    - - -This document is a developer guide to the LAMMPS molecular dynamics package, whose WWW site is at lammps.sandia.gov. It describes the internal structure and algorithms of the code. Sections will be added as we have time, and in response to requests from developers and users. - - -@section SCT_Lammps_source_files LAMMPS source files - -LAMMPS source files are in two directories of the distribution tarball. The src directory has the majority of them, all of which are C++ files (*.cpp and *.h). Many of these files are in the src directory itself. There are also dozens of "packages", which can be included or excluded when LAMMPS is built. See the doc/Section_start.html section of the manual for more information about packages, or type "make" from within the src directory, which lists package-related commands, such as "make package-status". The source files for each package are in an all-uppercase sub-directory of src, like src/MOLECULE or src/USER-CUDA. If the package is currently installed, copies of the package source files will also exist in the src directory itself. The src/STUBS sub-directory is not a package but contains a dummy version of the MPI library, used when building a serial version of the code. - -The lib directory also contains source code for external libraries, used by a few of the packages. Each sub-directory, like meam or gpu, contains the source files, some of which are in different languages such as Fortran. The files are compiled into libraries from within each sub-directory, e.g. performing a "make" in the lib/meam directory creates a libmeam.a file. These libraries are statically linked to during a LAMMPS build, if the corresponding package is installed. - -LAMMPS C++ source files almost always come in pairs, such as run.cpp and run.h. The pair of files defines a C++ class, the LAMMPS_NS::Run class in this case, which contains the code invoked by the run command in a LAMMPS input script. As this example illustrates, source file and class names often have a one-to-one correspondence with a command used in a LAMMPS input script. Some source files and classes do not have a corresponding input script command, e.g. force.cpp and the LAMMPS_NS::Force class. They are discussed in the next section. - - -@section SCT_Class_hierarchy_of_LAMMPS Class hierarchy of LAMMPS - -Though LAMMPS has a lot of source files and classes, its class hierarchy is quite simple, as outlined in figure @ref classes. Each boxed name refers to a class and has a pair of associated source files in lammps/src, e.g. memory.cpp and memory.h. More details on the class and its methods and data structures can be found by examining its *.h file. - -LAMMPS_NS::LAMMPS (src/lammps.cpp and src/lammps.h) is the top-level class for the entire code. It holds an "instance" of LAMMPS and can be instantiated one or more times by a calling code. For example, the file src/main.cpp simply instantiates one instance of LAMMPS and passes it the input script. - -The file src/library.cpp contains a C-style library interface to the LAMMPS_NS::LAMMPS class. See the lammps/couple and lammps/python directories for examples of simple programs that use LAMMPS through its library interface. A driver program can instantiate the LAMMPS_NS::LAMMPS class multiple times, e.g. to embed several atomistic simulation regions within a mesoscale or continuum simulation domain. - -There are a dozen or so top-level classes within the LAMMPS_NS::LAMMPS class that are visible everywhere in the code. They are shaded blue in figure @ref classes. Thus any class can refer to the y-coordinate of local atom "i" as atom@f$\rightarrow@f$x[i][1]. This visibility is enabled by a bit of cleverness in the LAMMPS_NS::Pointers class (see src/pointers.h) which every class inherits from. - -There are a handful of virtual parent classes in LAMMPS that define what LAMMPS calls "styles". They are shaded red in figure @ref classes. Each of these are parents of a number of child classes that implement the interface defined by the parent class. For example, the "fix style" has around 100 child classes. They are the possible fixes that can be specified by the fix command in an input script, e.g. fix nve, fix shake, fix ave/time, etc. The corresponding classes are LAMMPS_NS::Fix (for the parent class), LAMMPS_NS::FixNVE, LAMMPS_NS::FixShake, LAMMPS_NS::FixAveTime, etc. The source files for these classes are easy to identify in the src directory, since they begin with the word "fix", e,g, fix_nve.cpp, fix_shake.cpp, fix_ave_time.cpp, etc. - -The one exception is child class files for the "command" style. These implement specific commands in the input script that can be invoked before/after/between runs or which launch a simulation. Examples are the create_box, minimize, run, and velocity commands which encode the LAMMPS_NS::CreateBox, LAMMPS_NS::Minimize, LAMMPS_NS::Run, and LAMMPS_NS::Velocity classes. The corresponding files are create_box.cpp, minimize.cpp, run.cpp, and velocity.cpp. - -The list of command style files can be found by typing "grep COMMAND_CLASS *.h" from within the src directory, since that word in the header file identifies the class as an input script command. Similar words can be grepped to list files for the other LAMMPS styles. E.g. ATOM_CLASS, PAIR_CLASS, BOND_CLASS, REGION_CLASS, FIX_CLASS, COMPUTE_CLASS, DUMP_CLASS, etc. - -
    - -@anchor classes @image html classes.png "Class hierarchy within LAMMPS source code" - -@anchor classes @image latex classes.eps "Class hierarchy within LAMMPS source code" - -
    - -More details on individual classes in figure @ref classes are as -follows: - -- The LAMMPS_NS::Memory class handles allocation of all large vectors and arrays. - -- The LAMMPS_NS::Error class prints all error and warning messages. - -- The LAMMPS_NS::Universe class sets up partitions of processors so that multiple simulations can be run, each on a subset of the processors allocated for a run, e.g. by the mpirun command. - -- The LAMMPS_NS::Input class reads an input script, stores variables, and invokes stand-alone commands that are child classes of the LAMMPS_NS::Command class. - -- As discussed above, the LAMMPS_NS::Command class is a parent class for certain input script commands that perform a one-time operation before/after/between simulations or which invoke a simulation. They are instantiated from within the LAMMPS_NS::Input class, invoked, then immediately destructed. - -- The LAMMPS_NS::Finish class is instantiated to print statistics to the screen after a simulation is performed, by commands like run and minimize. - -- The LAMMPS_NS::Special class walks the bond topology of a molecular system to find 1st, 2nd, 3rd neighbors of each atom. It is invoked by several commands, like read_data, read_restart, and replicate. - -- The LAMMPS_NS::Atom class stores all per-atom arrays. More precisely, they are allocated and stored by the LAMMPS_NS::AtomVec class, and the LAMMPS_NS::Atom class simply stores a pointer to them. The LAMMPS_NS::AtomVec class is a parent class for atom styles, defined by the atom_style command. - -- The LAMMPS_NS::Update class holds an integrator and a minimizer. The LAMMPS_NS::Integrate class is a parent style for the Verlet and rRESPA time integrators, as defined by the run_style input command. The LAMMPS_NS::Min class is a parent style for various energy minimizers. - -- The LAMMPS_NS::Neighbor class builds and stores neighbor lists. The LAMMPS_NS::NeighList class stores a single list (for all atoms). The LAMMPS_NS::NeighRequest class is called by pair, fix, or compute styles when they need a particular kind of neighbor list. - -- The LAMMPS_NS::Comm class performs interprocessor communication, typically of ghost atom information. This usually involves MPI message exchanges with 6 neighboring processors in the 3d logical grid of processors mapped to the simulation box. Sometimes the LAMMPS_NS::Irregular class is used, when atoms may migrate to arbitrary processors. - -- The LAMMPS_NS::Domain class stores the simulation box geometry, as well as the geometric LAMMPS_NS::Region and any user definition of a LAMMPS_NS::Lattice. The latter are defined by region and lattice commands in an input script. - -- The LAMMPS_NS::Force class computes various forces between atoms. The LAMMPS_NS::Pair parent class is for non-bonded or pair-wise forces, which in LAMMPS lingo includes many-body forces such as the Tersoff 3-body potential. The LAMMPS_NS::Bond, LAMMPS_NS::Angle, LAMMPS_NS::Dihedral, LAMMPS_NS::Improper parent classes are styles for bonded interactions within a static molecular topology. The LAMMPS_NS::KSpace parent class is for computing long-range Coulombic interactions. One of its child classes, LAMMPS_NS::PPPM, uses the LAMMPS_NS::FFT3d and LAMMPS_NS::Remap classes to communicate grid-based information with neighboring processors. - -- The LAMMPS_NS::Modify class stores lists of LAMMPS_NS::Fix and LAMMPS_NS::Compute classes, both of which are parent styles. - -- The LAMMPS_NS::Group class manipulates groups that atoms are assigned to via the group command. It also computes various attributes of groups of atoms. - -- The LAMMPS_NS::Output class is used to generate 3 kinds of output from a LAMMPS simulation: thermodynamic information printed to the screen and log file, dump file snapshots, and restart files. These correspond to the LAMMPS_NS::Thermo, LAMMPS_NS::Dump, and LAMMPS_NS::WriteRestart classes respectively. The LAMMPS_NS::Dump class is a parent style. - -- The LAMMPS_NS::Timer class logs MPI timing information, output at the end of a run. - - -@section SCT_How_a_timestep_works How a timestep works - -The first and most fundamental operation within LAMMPS to understand is how a timestep is structured. Timestepping is performed by the LAMMPS_NS::Integrate class within the LAMMPS_NS::Update class. Since LAMMPS_NS::Integrate is a parent class, corresponding to the run_style input script command, it has child classes. In this section, the timestep implemented by the LAMMPS_NS::Verlet child class is described. A similar timestep is implemented by the LAMMPS_NS::Respa child class, for the rRESPA hierarchical timestepping method. The LAMMPS_NS::Min parent class performs energy minimization, so does not perform a literal timestep. But it has logic similar to what is described here, to compute forces and invoke fixes at each iteration of a minimization. Differences between time integration and minimization are highlighted at the end of this section. - -The LAMMPS_NS::Verlet class is encoded in the src/verlet.cpp and verlet.h files. It implements the velocity-Verlet timestepping algorithm. The workhorse method is LAMMPS_NS::Verlet::run(), but first we highlight several other methods in the class. - -- The LAMMPS_NS::Verlet::init() method is called at the beginning of each dynamics run. It simply sets some internal flags, based on user settings in other parts of the code. - -- The LAMMPS_NS::Verlet::setup() or LAMMPS_NS::Verlet::setup_minimal() methods are also called before each run. The velocity-Verlet method requires current forces be calculated before the first timestep, so these routines compute forces due to all atomic interactions, using the same logic that appears in the timestepping described next. A few fixes are also invoked, using the mechanism described in the next section. Various counters are also initialized before the run begins. The LAMMPS_NS::Verlet::setup_minimal() method is a variant that has a flag for performing less setup. This is used when runs are continued and information from the previous run is still valid. For example, if repeated short LAMMPS runs are being invoked, interleaved by other commands, via the "pre no" and "every" options of the run command, the LAMMPS_NS::Verlet::setup_minimal() method is used. - -- The LAMMPS_NS::Verlet::force_clear() method initializes force and other arrays to zero before each timestep, so that forces (torques, etc) can be accumulated. - -Now for the LAMMPS_NS::Verlet::run() method. Its structure in hi-level pseudo code is shown in figure @ref Verlet. In the actual code in src/verlet.cpp some of these operations are conditionally invoked. - - -@verbatim - -loop over N timesteps: - ev_set() - - fix->initial_integrate() - fix->post_integrate() - - nflag = neighbor->decide() - if nflag: - fix->pre_exchange() - domain->pbc() - domain->reset_box() - comm->setup() - neighbor->setup_bins() - comm->exchange() - comm->borders() - fix->pre_neighbor() - neighbor->build() - else - comm->forward_comm() - - force_clear() - fix->pre_force() - - pair->compute() - bond->compute() - angle->compute() - dihedral->compute() - improper->compute() - kspace->compute() - - comm->reverse_comm() - - fix->post_force() - fix->final_integrate() - fix->end_of_step() - - if any output on this step: output->write() - -@endverbatim - -@anchor Verlet
    **Pseudo-code for the Verlet::run() method**
    - - -The LAMMPS_NS::Integrate::ev_set() method (in the parent LAMMPS_NS::Integrate class), sets two flags LAMMPS_NS::Integrate::eflag and LAMMPS_NS::Integrate::vflag for energy and virial computation. Each flag encodes whether global and/or per-atom energy and virial should be calculated on this timestep, because some fix or variable or output will need it. These flags are passed to the various methods that compute particle interactions, so that they can skip the extra calculations if the energy and virial are not needed. See the comments with the LAMMPS_NS::Integrate::ev_set() method which document the flag values. - -At various points of the timestep, fixes are invoked, e.g. fix@f$\rightarrow@f$initial_integrate(). In the code, this is actually done via the LAMMPS_NS::Modify class which stores all the Fix objects and lists of which should be invoked at what point in the timestep. Fixes are the LAMMPS mechanism for tailoring the operations of a timestep for a particular simulation. As described elsewhere (unwritten section), each fix has one or more methods, each of which is invoked at a specific stage of the timestep, as in figure @ref Verlet. All the fixes defined in an input script with an LAMMPS_NS::Fix::initial_integrate() method are invoked at the beginning of each timestep. The fix commands fix nve, fix nvt and fix npt are examples, since they perform the start-of-timestep velocity-Verlet integration to update velocities by a half-step, and coordinates by a full step. The LAMMPS_NS::Fix::post_integrate() method is next. Only a few fixes use this, e.g. to reflect particles off box boundaries in the LAMMPS_NS::FixWallReflect class. - -The LAMMPS_NS::Neighbor::decide() method in the Neighbor class determines whether neighbor lists need to be rebuilt on the current timestep. If not, coordinates of ghost atoms are acquired by each processor via the LAMMPS_NS::Comm::forward_comm() method of the LAMMPS_NS::Comm class. If neighbor lists need to be built, several operations within the inner if clause of figure @ref Verlet are first invoked. The LAMMPS_NS::Fix::pre_exchange() method of any defined fixes is invoked first. Typically this inserts or deletes particles from the system. - -Periodic boundary conditions are then applied by the LAMMPS_NS::Domain class via its LAMMPS_NS::Domain::pbc() method to remap particles that have moved outside the simulation box back into the box. Note that this is not done every timestep. but only when neighbor lists are rebuilt. This is so that each processor’s sub-domain will have consistent (nearby) atom coordinates for its owned and ghost atoms. It is also why dumped atom coordinates can be slightly outside the simulation box. - -The box boundaries are then reset (if needed) via the LAMMPS_NS::Domain::reset_box() method of the Domain class, e.g. if box boundaries are shrink-wrapped to current particle coordinates. A change in the box size or shape requires internal information for communicating ghost atoms (LAMMPS_NS::Comm class) and neighbor list bins (LAMMPS_NS::Neighbor class) be updated. The LAMMPS_NS::Comm::setup() method of the LAMMPS_NS::Comm class and LAMMPS_NS::Neighbor::setup_bins() method of the LAMMPS_NS::Neighbor class perform the update. - -The code is now ready to migrate atoms that have left a processor’s geometric sub-domain to new processors. The LAMMPS_NS::Comm::exchange() method of the LAMMPS_NS::Comm class performs this operation. The LAMMPS_NS::Comm::borders() method of the LAMMPS_NS::Comm class then identifies ghost atoms surrounding each processor’s sub-domain and communicates ghost atom information to neighboring processors. It does this by looping over all the atoms owned by a processor to make lists of those to send to each neighbor processor. On subsequent timesteps, the lists are used by the LAMMPS_NS::Comm::forward_comm() method. - -Fixes with a LAMMPS_NS::Fix::pre_neighbor() method are then called. These typically re-build some data structure stored by the fix that depends on the current atoms owned by each processor. - -Now that each processor has a current list of its owned and ghost atoms, LAMMPS is ready to rebuild neighbor lists via the LAMMPS_NS::Neighbor::build() method of the LAMMPS_NS::Neighbor class. This is typically done by binning all owned and ghost atoms, and scanning a stencil of bins around each owned atom’s bin to make a Verlet list of neighboring atoms within the force cutoff plus neighbor skin distance. - -In the next portion of the timestep, all interaction forces between particles are computed, after zeroing the per-atom force vector via the LAMMPS_NS::Verlet::force_clear() method. If the newton flag is set to "on" by the newton command, forces on both owned and ghost atoms are calculated. - -Pairwise forces are calculated first, which enables the global virial (if requested) to be calculated cheaply (at the end of the LAMMPS_NS::Pair::compute() method), by a dot product of atom coordinates and forces. By including owned and ghost atoms in the dot product, the effect of periodic boundary conditions is correctly accounted for. Molecular topology interactions (bonds, angles, dihedrals, impropers) are calculated next. The final contribution is from long-range Coulombic interactions, invoked by the LAMMPS_NS::KSpace class. - -If the newton flag is on, forces on ghost atoms are communicated and summed back to their corresponding owned atoms. The LAMMPS_NS::Comm::reverse_comm() method of the LAMMPS_NS::Comm class performs this operation, which is essentially the inverse operation of sending copies of owned atom coordinates to other processor’s ghost atoms. - -At this point in the timestep, the total force on each atom is known. Additional force constraints (external forces, SHAKE, etc) are applied by Fixes that have a LAMMPS_NS::Fix::post_force() method. The second half of the velocity-Verlet integration is then performed (another half-step update of the velocities) via fixes like fix nve, fix nvt and fix npt. - -At the end of the timestep, fixes that define an LAMMPS_NS::Fix::end_of_step() method are invoked. These typically perform a diagnostic calculation, e.g. the fix ave/time and fix ave/spatial fixes. - -The final operation of the timestep is to perform any requested output, via the LAMMPS_NS::Output::write() method of the LAMMPS_NS::Output class. There are 3 kinds of LAMMPS output: - -- thermodynamic output to the screen and log file, -- snapshots of atom data to a dump file, and -- restart files. - -See the thermo_style, dump, and restart commands for more details. - -The iteration performed by an energy minimization is similar to the dynamics timestep of figure @ref Verlet. Forces are computed, neighbor lists are built as needed, atoms migrate to new processors, and atom coordinates and forces are communicated to neighboring processors. The only difference is what LAMMPS_NS::Fix class operations are invoked when. Only a subset of LAMMPS fixes are useful during energy minimization, as explained in their individual doc pages. The relevant LAMMPS_NS::Fix class methods are LAMMPS_NS::Fix::min_pre_exchange(), LAMMPS_NS::Fix::min_pre_force(), and LAMMPS_NS::Fix::min_post_force(). Each is invoked at the appropriate place within the minimization iteration. For example, the LAMMPS_NS::Fix::min_post_force() method is analogous to the LAMMPS_NS::Fix::post_force() method for dynamics; it is used to alter or constrain forces on each atom, which affects the minimization procedure. - - -@section SCT_Extending_LAMMPS Extending LAMMPS - -The Section_modify.html file in the doc directory of the LAMMPS distribution gives an overview of how LAMMPS can be extended by writing new classes that derive from existing parent classes in LAMMPS. - - -@subsection SST_New_fixes New fixes - -(this section has been provided by Kirill Lykov) - -Here, some specific coding details are provided for writing a new fix. - -Writing fixes is a flexible way of extending LAMMPS. Users can implement many things using fixes: - -- changing particles attributes (positions, velocities, forces, etc.). Example: LAMMPS_NS::FixFreeze. - -- reading/writing data. Example: LAMMPS_NS::FixReadRestart. - -- implementing boundary conditions. Example: LAMMPS_NS::FixWall. - -- saving information about particles for future use (previous positions, for instance). Example: LAMMPS_NS::FixStoreState. - -All fixes are derived from class LAMMPS_NS::Fix and must have constructor with the signature: - -@verbatim - -FixMine(class LAMMPS *, int, char **) - -@endverbatim - -Every fix must be registered in LAMMPS by writing the following lines of code in the header before include guards: - -@verbatim - -#ifdef FIX_CLASS -FixStyle(your/fix/name,FixMine) -#else - -@endverbatim - -Where `your/fix/name` is a name of your fix in the script and `FixMine` is the name of the class. This code allows LAMMPS to find your fix when it parses input script. In addition, your fix header must be included in the file style_fix.h. In case if you use LAMMPS make, this file is generated automatically - all files starting with prefix `fix_` are included, so call your header the same way. Otherwise, don’t forget to add your include into style_fix.h. - -Let’s write a simple fix which will print average velocity at the end of each timestep. First of all, implement a constructor: - -@verbatim - -FixPrintVel::FixPrintVel(LAMMPS *lmp, int narg, char **arg) : Fix(lmp, narg, arg) -{ - - if (narg < 4) - error->all(FLERR,"Illegal fix print command"); - - nevery = atoi(arg[3]); - - if (nevery <= 0) - error->all(FLERR,"Illegal fix print command"); -} - -@endverbatim - -In the constructor you should parse your fix arguments which are specified in the script. All fixes have pretty the same syntax: - -@verbatim - -fix [fix_identifier] [group_name] [fix_name] [fix_arguments]. - -@endverbatim - -The first 3 parameters are parsed by Fix class constructor, while `[fix_arguments]` should be parsed by you. In our case, we need to specify how often we want to print an average velocity. For instance, once in 50 timesteps: `fix 1 print/vel 50`. There is a special variable in Fix class called nevery which specifies how often the method `end_of_step()` is called. Thus all we need to do is just set it up. - -The next method we need to implement is `setmask()`: - -@verbatim - -int FixPrintVel::setmask() -{ - int mask = 0; - mask |= FixConst::END_OF_STEP; - return mask; -} - -@endverbatim - -Here user specifies which methods of your fix should be called during the execution. For instance, `END_OF_STEP` corresponds to the LAMMPS_NS::Fix::end_of_step() method. Overall, there are 8 most important methods that are called in predefined order during the execution of the Verlet algorithm as was mentioned in Section 3: - -- LAMMPS_NS::Fix::initial_integrate() - -- LAMMPS_NS::Fix::post_integrate() - -- LAMMPS_NS::Fix::pre_exchange() - -- LAMMPS_NS::Fix::pre_neighbor() - -- LAMMPS_NS::Fix::pre_force() - -- LAMMPS_NS::Fix::post_force() - -- LAMMPS_NS::Fix::final_integrate() - -- LAMMPS_NS::Fix::end_of_step() - -The fix developer must understand when he wants to execute his code. In case if we want to write `FixPrintVel`, we need only LAMMPS_NS::Fix::end_of_step(): - -@verbatim - -void FixPrintVel::end_of_step() -{ - // for add3, scale3 - using namespace MathExtra; - - double** v = atom->v; - int nlocal = atom->nlocal; - double localAvgVel[4]; // 4th element for particles count - memset(localAvgVel, 0, 4 * sizeof(double)); - for (int particleInd = 0; particleInd < nlocal; ++particleInd) { - add3(localAvgVel, v[particleInd], localAvgVel); - } - localAvgVel[3] = nlocal; - double globalAvgVel[4]; - memset(globalAvgVel, 0, 4 * sizeof(double)); - MPI_Allreduce(localAvgVel, globalAvgVel, 4, MPI_DOUBLE, MPI_SUM, world); - scale3(1.0 / globalAvgVel[3], globalAvgVel); - if (comm->me == 0) { - printf("%e, %e, %e\n", globalAvgVel[0], globalAvgVel[1], globalAvgVel[2]); - } -} - -@endverbatim - - -In the code above, we use MathExtra routines defined in math_extra.h. There are bunch of math functions to work with arrays of doubles as with math vectors. - -In this code we use an instance of LAMMPS_NS::Atom class. This object is stored in the LAMMPS_NS::Pointers class (see pointers.h). This object contains all global information about the simulation system. Data from LAMMPS_NS::Pointers class available to all classes inherited from it using protected inheritance. Hence when you write you own class, which is going to use LAMMPS data, don’t forget to inherit from the class LAMMPS_NS::Pointers. When writing fixes we inherit from class LAMMPS_NS::Fix which is inherited from LAMMPS_NS::Pointers so there is no need to inherit from it directly. - -The code above computes average velocity for all particles in the simulation. Yet you have one unused parameter in fix call from the script - `[group_name]`. This parameter specifies the group of atoms used in the fix. So we should compute average for all particles in the simulation if `group_name == all`, but it can be any group. The group information is specified by groupbit which is defined in class LAMMPS_NS::Fix: - -@verbatim - -for (int particleInd = 0; particleInd < nlocal; ++particleInd) { - if (atom->mask[particleInd] & groupbit) { - // Do all job here - } - } - -@endverbatim - -Class LAMMPS_NS::Atom encapsulates atoms positions, velocities, forces, etc. The user can access them using particle index. Note, that particle indexes are usually changed every timestep because of sorting. - -Lets consider another LAMMPS_NS::Fix example. We want to have a fix which stores atoms position from previous time step in your fix. The local atoms indexes will not be valid on the next iteration. In order to handle this situation there are several methods which should be implemented: - -- LAMMPS_NS::Fix::memory_usage() `/double memory_usage(void)/` - return how much memory fix uses - -- LAMMPS_NS::Fix::grow_arrays() `/void grow_arrays(int)/` - do reallocation of the per particle arrays in your fix - -- LAMMPS_NS::Fix::copy_arrays() `/void copy_arrays(int i, int j)/` - copy i-th per-particle information to j-th. Used when atoms sorting is performed - -- LAMMPS_NS::Fix::set_arrays() `/void set_arrays(int i)/` - sets i-th particle related information to zero - -Note, that if your class implements these methods, it must call add calls of LAMMPS_NS::Atom::add_callback and LAMMPS_NS::Atom::delete_callback to constructor and destructor: - -@verbatim - -FixSavePos::FixSavePos(LAMMPS *lmp, int narg, char **arg) -{ - //... - atom->add_callback(0); -} - -FixSavePos::~FixSavePos() -{ - atom->delete_callback(id, 0); -} - -@endverbatim - -Since we want to store positions of atoms from previous timestep, we -need to add `double** x` to the header file. Than add allocation code to -constructor: - -@verbatim - -memory->create(this->x, atom->nmax, 3, "FixSavePos:x"); . - -@endverbatim - -Free memory at destructor: - -@verbatim - -memory->destroy(x); - -@endverbatim - -Finally, implement mentioned methods: - -@verbatim - -double FixSavePos::memory_usage() -{ - int nmax = atom->nmax; - double bytes = 0.0; - bytes += nmax * 3 * sizeof(double); - return bytes; -} - -void FixSavePos::grow_arrays(int nmax) -{ - memory->grow(this->x, nmax, 3, "FixSavePos:x"); -} - -void FixSavePos::copy_arrays(int i, int j) -{ - memcpy(this->x[j], this->x[i], sizeof(double) * 3); -} - -void FixSavePos::set_arrays(int i) -{ - memset(this->x[i], 0, sizeof(double) * 3); -} - -int FixSavePos::pack_exchange(int i, double *buf) -{ - int m = 0; - buf[m++] = x[i][0]; - buf[m++] = x[i][1]; - buf[m++] = x[i][2]; - - return m; -} - -int FixSavePos::unpack_exchange(int nlocal, double *buf) -{ - int m = 0; - x[nlocal][0] = buf[m++]; - x[nlocal][1] = buf[m++]; - x[nlocal][2] = buf[m++]; - - return m; -} - -@endverbatim - -Now, a little bit about memory allocation. We used LAMMPS_NS::Memory class which is just a bunch of template functions for allocating 1D and 2D arrays. So you need to add include memory.h to have access to them. - -Finally, if you need to write or read some global information used in your fix to of from a restart file, you might do it by setting flag - -@verbatim - -restart_global = 1 - -@endverbatim - -in the constructor and implementing methods LAMMPS_NS::Fix::write_restart() `/void write_restart(FILE *fp)/` and LAMMPS_NS::Fix::restart() `/void restart(char *buf)/`. - - -@subsection SST_New_commands New commands - -New commands can be added to LAMMPS input scripts by adding new classes that have a “command” method. For example, the create_atoms, read_data, velocity and run commands are all implemented in this fashion. When such a command is encountered in the LAMMPS input script, LAMMPS simply creates a class with the corresponding name, invokes the “command” method of the class, and passes it the arguments from the input script. The command method can perform whatever operations it wishes on LAMMPS data structures. - - -@subsection SST_New_computes New computes - -Classes that compute scalar and vector quantities like temperature and the pressure tensor, as well as classes that compute per-atom quantities like kinetic energy and the centro-symmetry parameter are derived from the LAMMPS_NS::Compute class. New styles can be created to add new calculations to LAMMPS. Compute_temp.cpp is a simple example of computing a scalar temperature. - - -@subsection SST_New_pair_styles New pair styles - -Classes that compute pairwise interactions are derived from the LAMMPS_NS::Pair class. In LAMMPS, pairwise calculation include manybody potentials such as EAM or Tersoff where particles interact without a static bond topology. New styles can be created to add new pair potentials to LAMMPS. - - -@subsection SST_New_bonds_angles_dihedrals_impropers New bonds, angles, dihedrals and impropers - -Classes that compute molecular interactions are derived from the LAMMPS_NS::Bond, LAMMPS_NS::Angle, LAMMPS_NS::Dihedral, and LAMMPS_NS::Improper classes. New styles can be created to add new potentials to LAMMPS. - -*/ diff --git a/tools/doxygen/Doxyfile.lammps b/tools/doxygen/Doxyfile.lammps deleted file mode 100644 index f872541857..0000000000 --- a/tools/doxygen/Doxyfile.lammps +++ /dev/null @@ -1,2557 +0,0 @@ -# Doxyfile 1.8.15 - -# This file describes the settings to be used by the documentation system -# doxygen (www.doxygen.org) for a project. -# -# All text after a double hash (##) is considered a comment and is placed in -# front of the TAG it is preceding. -# -# All text after a single hash (#) is considered a comment and will be ignored. -# The format is: -# TAG = value [value, ...] -# For lists, items can also be appended using: -# TAG += value [value, ...] -# Values that contain spaces should be placed between quotes (\" \"). - -#--------------------------------------------------------------------------- -# Project related configuration options -#--------------------------------------------------------------------------- - -# This tag specifies the encoding used for all characters in the config file -# that follow. The default is UTF-8 which is also the encoding used for all text -# before the first occurrence of this tag. Doxygen uses libiconv (or the iconv -# built into libc) for the transcoding. See -# https://www.gnu.org/software/libiconv/ for the list of possible encodings. -# The default value is: UTF-8. - -DOXYFILE_ENCODING = UTF-8 - -# The PROJECT_NAME tag is a single word (or a sequence of words surrounded by -# double-quotes, unless you are using Doxywizard) that should identify the -# project for which the documentation is generated. This name is used in the -# title of most generated pages and in a few other places. -# The default value is: My Project. - -PROJECT_NAME = "LAMMPS - Large Atomic and Molecular Massive Parallel Simulator" - -# The PROJECT_NUMBER tag can be used to enter a project or revision number. This -# could be handy for archiving the generated documentation or if some version -# control system is used. - -PROJECT_NUMBER = - -# Using the PROJECT_BRIEF tag one can provide an optional one line description -# for a project that appears at the top of each page and should give viewer a -# quick idea about the purpose of the project. Keep the description short. - -PROJECT_BRIEF = "LAMMPS - Developer Guide - LAMMPS_VERSION" - -# With the PROJECT_LOGO tag one can specify a logo or an icon that is included -# in the documentation. The maximum height of the logo should not exceed 55 -# pixels and the maximum width should not exceed 200 pixels. Doxygen will copy -# the logo to the output directory. - -PROJECT_LOGO = - -# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) path -# into which the generated documentation will be written. If a relative path is -# entered, it will be relative to the location where doxygen was started. If -# left blank the current directory will be used. - -OUTPUT_DIRECTORY = tools/doxygen/doc - -# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub- -# directories (in 2 levels) under the output directory of each output format and -# will distribute the generated files over these directories. Enabling this -# option can be useful when feeding doxygen a huge amount of source files, where -# putting all generated files in the same directory would otherwise causes -# performance problems for the file system. -# The default value is: NO. - -CREATE_SUBDIRS = NO - -# If the ALLOW_UNICODE_NAMES tag is set to YES, doxygen will allow non-ASCII -# characters to appear in the names of generated files. If set to NO, non-ASCII -# characters will be escaped, for example _xE3_x81_x84 will be used for Unicode -# U+3044. -# The default value is: NO. - -ALLOW_UNICODE_NAMES = NO - -# The OUTPUT_LANGUAGE tag is used to specify the language in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all constant output in the proper language. -# Possible values are: Afrikaans, Arabic, Armenian, Brazilian, Catalan, Chinese, -# Chinese-Traditional, Croatian, Czech, Danish, Dutch, English (United States), -# Esperanto, Farsi (Persian), Finnish, French, German, Greek, Hungarian, -# Indonesian, Italian, Japanese, Japanese-en (Japanese with English messages), -# Korean, Korean-en (Korean with English messages), Latvian, Lithuanian, -# Macedonian, Norwegian, Persian (Farsi), Polish, Portuguese, Romanian, Russian, -# Serbian, Serbian-Cyrillic, Slovak, Slovene, Spanish, Swedish, Turkish, -# Ukrainian and Vietnamese. -# The default value is: English. - -OUTPUT_LANGUAGE = English - -# The OUTPUT_TEXT_DIRECTION tag is used to specify the direction in which all -# documentation generated by doxygen is written. Doxygen will use this -# information to generate all generated output in the proper direction. -# Possible values are: None, LTR, RTL and Context. -# The default value is: None. - -OUTPUT_TEXT_DIRECTION = None - -# If the BRIEF_MEMBER_DESC tag is set to YES, doxygen will include brief member -# descriptions after the members that are listed in the file and class -# documentation (similar to Javadoc). Set to NO to disable this. -# The default value is: YES. - -BRIEF_MEMBER_DESC = YES - -# If the REPEAT_BRIEF tag is set to YES, doxygen will prepend the brief -# description of a member or function before the detailed description -# -# Note: If both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the -# brief descriptions will be completely suppressed. -# The default value is: YES. - -REPEAT_BRIEF = YES - -# This tag implements a quasi-intelligent brief description abbreviator that is -# used to form the text in various listings. Each string in this list, if found -# as the leading text of the brief description, will be stripped from the text -# and the result, after processing the whole list, is used as the annotated -# text. Otherwise, the brief description is used as-is. If left blank, the -# following values are used ($name is automatically replaced with the name of -# the entity):The $name class, The $name widget, The $name file, is, provides, -# specifies, contains, represents, a, an and the. - -ABBREVIATE_BRIEF = "The $name class" \ - "The $name widget" \ - "The $name file" \ - is \ - provides \ - specifies \ - contains \ - represents \ - a \ - an \ - the - -# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then -# doxygen will generate a detailed section even if there is only a brief -# description. -# The default value is: NO. - -ALWAYS_DETAILED_SEC = NO - -# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all -# inherited members of a class in the documentation of that class as if those -# members were ordinary class members. Constructors, destructors and assignment -# operators of the base classes will not be shown. -# The default value is: NO. - -INLINE_INHERITED_MEMB = NO - -# If the FULL_PATH_NAMES tag is set to YES, doxygen will prepend the full path -# before files name in the file list and in the header files. If set to NO the -# shortest path that makes the file name unique will be used -# The default value is: YES. - -FULL_PATH_NAMES = YES - -# The STRIP_FROM_PATH tag can be used to strip a user-defined part of the path. -# Stripping is only done if one of the specified strings matches the left-hand -# part of the path. The tag can be used to show relative paths in the file list. -# If left blank the directory from which doxygen is run is used as the path to -# strip. -# -# Note that you can specify absolute paths here, but also relative paths, which -# will be relative from the directory where doxygen is started. -# This tag requires that the tag FULL_PATH_NAMES is set to YES. - -STRIP_FROM_PATH = - -# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of the -# path mentioned in the documentation of a class, which tells the reader which -# header file to include in order to use a class. If left blank only the name of -# the header file containing the class definition is used. Otherwise one should -# specify the list of include paths that are normally passed to the compiler -# using the -I flag. - -STRIP_FROM_INC_PATH = - -# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter (but -# less readable) file names. This can be useful is your file systems doesn't -# support long names like on DOS, Mac, or CD-ROM. -# The default value is: NO. - -SHORT_NAMES = NO - -# If the JAVADOC_AUTOBRIEF tag is set to YES then doxygen will interpret the -# first line (until the first dot) of a Javadoc-style comment as the brief -# description. If set to NO, the Javadoc-style will behave just like regular Qt- -# style comments (thus requiring an explicit @brief command for a brief -# description.) -# The default value is: NO. - -JAVADOC_AUTOBRIEF = NO - -# If the QT_AUTOBRIEF tag is set to YES then doxygen will interpret the first -# line (until the first dot) of a Qt-style comment as the brief description. If -# set to NO, the Qt-style will behave just like regular Qt-style comments (thus -# requiring an explicit \brief command for a brief description.) -# The default value is: NO. - -QT_AUTOBRIEF = NO - -# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make doxygen treat a -# multi-line C++ special comment block (i.e. a block of //! or /// comments) as -# a brief description. This used to be the default behavior. The new default is -# to treat a multi-line C++ comment block as a detailed description. Set this -# tag to YES if you prefer the old behavior instead. -# -# Note that setting this tag to YES also means that rational rose comments are -# not recognized any more. -# The default value is: NO. - -MULTILINE_CPP_IS_BRIEF = NO - -# If the INHERIT_DOCS tag is set to YES then an undocumented member inherits the -# documentation from any documented member that it re-implements. -# The default value is: YES. - -INHERIT_DOCS = YES - -# If the SEPARATE_MEMBER_PAGES tag is set to YES then doxygen will produce a new -# page for each member. If set to NO, the documentation of a member will be part -# of the file/class/namespace that contains it. -# The default value is: NO. - -SEPARATE_MEMBER_PAGES = NO - -# The TAB_SIZE tag can be used to set the number of spaces in a tab. Doxygen -# uses this value to replace tabs by spaces in code fragments. -# Minimum value: 1, maximum value: 16, default value: 4. - -TAB_SIZE = 4 - -# This tag can be used to specify a number of aliases that act as commands in -# the documentation. An alias has the form: -# name=value -# For example adding -# "sideeffect=@par Side Effects:\n" -# will allow you to put the command \sideeffect (or @sideeffect) in the -# documentation, which will result in a user-defined paragraph with heading -# "Side Effects:". You can put \n's in the value part of an alias to insert -# newlines (in the resulting output). You can put ^^ in the value part of an -# alias to insert a newline as if a physical newline was in the original file. - -ALIASES = - -# This tag can be used to specify a number of word-keyword mappings (TCL only). -# A mapping has the form "name=value". For example adding "class=itcl::class" -# will allow you to use the command class in the itcl::class meaning. - -TCL_SUBST = - -# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C sources -# only. Doxygen will then generate output that is more tailored for C. For -# instance, some of the names that are used will be different. The list of all -# members will be omitted, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_FOR_C = YES - -# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java or -# Python sources only. Doxygen will then generate output that is more tailored -# for that language. For instance, namespaces will be presented as packages, -# qualified scopes will look different, etc. -# The default value is: NO. - -OPTIMIZE_OUTPUT_JAVA = NO - -# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran -# sources. Doxygen will then generate output that is tailored for Fortran. -# The default value is: NO. - -OPTIMIZE_FOR_FORTRAN = NO - -# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL -# sources. Doxygen will then generate output that is tailored for VHDL. -# The default value is: NO. - -OPTIMIZE_OUTPUT_VHDL = NO - -# Doxygen selects the parser to use depending on the extension of the files it -# parses. With this tag you can assign which parser to use for a given -# extension. Doxygen has a built-in mapping, but you can override or extend it -# using this tag. The format is ext=language, where ext is a file extension, and -# language is one of the parsers supported by doxygen: IDL, Java, Javascript, -# C#, C, C++, D, PHP, Objective-C, Python, Fortran (fixed format Fortran: -# FortranFixed, free formatted Fortran: FortranFree, unknown formatted Fortran: -# Fortran. In the later case the parser tries to guess whether the code is fixed -# or free formatted code, this is the default for Fortran type files), VHDL. For -# instance to make doxygen treat .inc files as Fortran files (default is PHP), -# and .f files as C (default is Fortran), use: inc=Fortran f=C. -# -# Note: For files without extension you can use no_extension as a placeholder. -# -# Note that for custom extensions you also need to set FILE_PATTERNS otherwise -# the files are not read by doxygen. - -EXTENSION_MAPPING = - -# If the MARKDOWN_SUPPORT tag is enabled then doxygen pre-processes all comments -# according to the Markdown format, which allows for more readable -# documentation. See http://daringfireball.net/projects/markdown/ for details. -# The output of markdown processing is further processed by doxygen, so you can -# mix doxygen, HTML, and XML commands with Markdown formatting. Disable only in -# case of backward compatibilities issues. -# The default value is: YES. - -MARKDOWN_SUPPORT = YES - -# When the TOC_INCLUDE_HEADINGS tag is set to a non-zero value, all headings up -# to that level are automatically included in the table of contents, even if -# they do not have an id attribute. -# Note: This feature currently applies only to Markdown headings. -# Minimum value: 0, maximum value: 99, default value: 0. -# This tag requires that the tag MARKDOWN_SUPPORT is set to YES. - -TOC_INCLUDE_HEADINGS = 0 - -# When enabled doxygen tries to link words that correspond to documented -# classes, or namespaces to their corresponding documentation. Such a link can -# be prevented in individual cases by putting a % sign in front of the word or -# globally by setting AUTOLINK_SUPPORT to NO. -# The default value is: YES. - -AUTOLINK_SUPPORT = YES - -# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want -# to include (a tag file for) the STL sources as input, then you should set this -# tag to YES in order to let doxygen match functions declarations and -# definitions whose arguments contain STL classes (e.g. func(std::string); -# versus func(std::string) {}). This also make the inheritance and collaboration -# diagrams that involve STL classes more complete and accurate. -# The default value is: NO. - -BUILTIN_STL_SUPPORT = NO - -# If you use Microsoft's C++/CLI language, you should set this option to YES to -# enable parsing support. -# The default value is: NO. - -CPP_CLI_SUPPORT = NO - -# Set the SIP_SUPPORT tag to YES if your project consists of sip (see: -# https://www.riverbankcomputing.com/software/sip/intro) sources only. Doxygen -# will parse them like normal C++ but will assume all classes use public instead -# of private inheritance when no explicit protection keyword is present. -# The default value is: NO. - -SIP_SUPPORT = NO - -# For Microsoft's IDL there are propget and propput attributes to indicate -# getter and setter methods for a property. Setting this option to YES will make -# doxygen to replace the get and set methods by a property in the documentation. -# This will only work if the methods are indeed getting or setting a simple -# type. If this is not the case, or you want to show the methods anyway, you -# should set this option to NO. -# The default value is: YES. - -IDL_PROPERTY_SUPPORT = YES - -# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC -# tag is set to YES then doxygen will reuse the documentation of the first -# member in the group (if any) for the other members of the group. By default -# all members of a group must be documented explicitly. -# The default value is: NO. - -DISTRIBUTE_GROUP_DOC = NO - -# If one adds a struct or class to a group and this option is enabled, then also -# any nested class or struct is added to the same group. By default this option -# is disabled and one has to add nested compounds explicitly via \ingroup. -# The default value is: NO. - -GROUP_NESTED_COMPOUNDS = NO - -# Set the SUBGROUPING tag to YES to allow class member groups of the same type -# (for instance a group of public functions) to be put as a subgroup of that -# type (e.g. under the Public Functions section). Set it to NO to prevent -# subgrouping. Alternatively, this can be done per class using the -# \nosubgrouping command. -# The default value is: YES. - -SUBGROUPING = YES - -# When the INLINE_GROUPED_CLASSES tag is set to YES, classes, structs and unions -# are shown inside the group in which they are included (e.g. using \ingroup) -# instead of on a separate page (for HTML and Man pages) or section (for LaTeX -# and RTF). -# -# Note that this feature does not work in combination with -# SEPARATE_MEMBER_PAGES. -# The default value is: NO. - -INLINE_GROUPED_CLASSES = NO - -# When the INLINE_SIMPLE_STRUCTS tag is set to YES, structs, classes, and unions -# with only public data fields or simple typedef fields will be shown inline in -# the documentation of the scope in which they are defined (i.e. file, -# namespace, or group documentation), provided this scope is documented. If set -# to NO, structs, classes, and unions are shown on a separate page (for HTML and -# Man pages) or section (for LaTeX and RTF). -# The default value is: NO. - -INLINE_SIMPLE_STRUCTS = NO - -# When TYPEDEF_HIDES_STRUCT tag is enabled, a typedef of a struct, union, or -# enum is documented as struct, union, or enum with the name of the typedef. So -# typedef struct TypeS {} TypeT, will appear in the documentation as a struct -# with name TypeT. When disabled the typedef will appear as a member of a file, -# namespace, or class. And the struct will be named TypeS. This can typically be -# useful for C code in case the coding convention dictates that all compound -# types are typedef'ed and only the typedef is referenced, never the tag name. -# The default value is: NO. - -TYPEDEF_HIDES_STRUCT = NO - -# The size of the symbol lookup cache can be set using LOOKUP_CACHE_SIZE. This -# cache is used to resolve symbols given their name and scope. Since this can be -# an expensive process and often the same symbol appears multiple times in the -# code, doxygen keeps a cache of pre-resolved symbols. If the cache is too small -# doxygen will become slower. If the cache is too large, memory is wasted. The -# cache size is given by this formula: 2^(16+LOOKUP_CACHE_SIZE). The valid range -# is 0..9, the default is 0, corresponding to a cache size of 2^16=65536 -# symbols. At the end of a run doxygen will report the cache usage and suggest -# the optimal cache size from a speed point of view. -# Minimum value: 0, maximum value: 9, default value: 0. - -LOOKUP_CACHE_SIZE = 0 - -#--------------------------------------------------------------------------- -# Build related configuration options -#--------------------------------------------------------------------------- - -# If the EXTRACT_ALL tag is set to YES, doxygen will assume all entities in -# documentation are documented, even if no documentation was available. Private -# class members and static file members will be hidden unless the -# EXTRACT_PRIVATE respectively EXTRACT_STATIC tags are set to YES. -# Note: This will also disable the warnings about undocumented members that are -# normally produced when WARNINGS is set to YES. -# The default value is: NO. - -EXTRACT_ALL = YES - -# If the EXTRACT_PRIVATE tag is set to YES, all private members of a class will -# be included in the documentation. -# The default value is: NO. - -EXTRACT_PRIVATE = YES - -# If the EXTRACT_PACKAGE tag is set to YES, all members with package or internal -# scope will be included in the documentation. -# The default value is: NO. - -EXTRACT_PACKAGE = YES - -# If the EXTRACT_STATIC tag is set to YES, all static members of a file will be -# included in the documentation. -# The default value is: NO. - -EXTRACT_STATIC = YES - -# If the EXTRACT_LOCAL_CLASSES tag is set to YES, classes (and structs) defined -# locally in source files will be included in the documentation. If set to NO, -# only classes defined in header files are included. Does not have any effect -# for Java sources. -# The default value is: YES. - -EXTRACT_LOCAL_CLASSES = YES - -# This flag is only useful for Objective-C code. If set to YES, local methods, -# which are defined in the implementation section but not in the interface are -# included in the documentation. If set to NO, only methods in the interface are -# included. -# The default value is: NO. - -EXTRACT_LOCAL_METHODS = YES - -# If this flag is set to YES, the members of anonymous namespaces will be -# extracted and appear in the documentation as a namespace called -# 'anonymous_namespace{file}', where file will be replaced with the base name of -# the file that contains the anonymous namespace. By default anonymous namespace -# are hidden. -# The default value is: NO. - -EXTRACT_ANON_NSPACES = YES - -# If the HIDE_UNDOC_MEMBERS tag is set to YES, doxygen will hide all -# undocumented members inside documented classes or files. If set to NO these -# members will be included in the various overviews, but no documentation -# section is generated. This option has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_MEMBERS = NO - -# If the HIDE_UNDOC_CLASSES tag is set to YES, doxygen will hide all -# undocumented classes that are normally visible in the class hierarchy. If set -# to NO, these classes will be included in the various overviews. This option -# has no effect if EXTRACT_ALL is enabled. -# The default value is: NO. - -HIDE_UNDOC_CLASSES = NO - -# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend -# (class|struct|union) declarations. If set to NO, these declarations will be -# included in the documentation. -# The default value is: NO. - -HIDE_FRIEND_COMPOUNDS = NO - -# If the HIDE_IN_BODY_DOCS tag is set to YES, doxygen will hide any -# documentation blocks found inside the body of a function. If set to NO, these -# blocks will be appended to the function's detailed documentation block. -# The default value is: NO. - -HIDE_IN_BODY_DOCS = NO - -# The INTERNAL_DOCS tag determines if documentation that is typed after a -# \internal command is included. If the tag is set to NO then the documentation -# will be excluded. Set it to YES to include the internal documentation. -# The default value is: NO. - -INTERNAL_DOCS = NO - -# If the CASE_SENSE_NAMES tag is set to NO then doxygen will only generate file -# names in lower-case letters. If set to YES, upper-case letters are also -# allowed. This is useful if you have classes or files whose names only differ -# in case and if your file system supports case sensitive file names. Windows -# and Mac users are advised to set this option to NO. -# The default value is: system dependent. - -CASE_SENSE_NAMES = YES - -# If the HIDE_SCOPE_NAMES tag is set to NO then doxygen will show members with -# their full class and namespace scopes in the documentation. If set to YES, the -# scope will be hidden. -# The default value is: NO. - -HIDE_SCOPE_NAMES = NO - -# If the HIDE_COMPOUND_REFERENCE tag is set to NO (default) then doxygen will -# append additional text to a page's title, such as Class Reference. If set to -# YES the compound reference will be hidden. -# The default value is: NO. - -HIDE_COMPOUND_REFERENCE= NO - -# If the SHOW_INCLUDE_FILES tag is set to YES then doxygen will put a list of -# the files that are included by a file in the documentation of that file. -# The default value is: YES. - -SHOW_INCLUDE_FILES = YES - -# If the SHOW_GROUPED_MEMB_INC tag is set to YES then Doxygen will add for each -# grouped member an include statement to the documentation, telling the reader -# which file to include in order to use the member. -# The default value is: NO. - -SHOW_GROUPED_MEMB_INC = NO - -# If the FORCE_LOCAL_INCLUDES tag is set to YES then doxygen will list include -# files with double quotes in the documentation rather than with sharp brackets. -# The default value is: NO. - -FORCE_LOCAL_INCLUDES = NO - -# If the INLINE_INFO tag is set to YES then a tag [inline] is inserted in the -# documentation for inline members. -# The default value is: YES. - -INLINE_INFO = YES - -# If the SORT_MEMBER_DOCS tag is set to YES then doxygen will sort the -# (detailed) documentation of file and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. -# The default value is: YES. - -SORT_MEMBER_DOCS = YES - -# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the brief -# descriptions of file, namespace and class members alphabetically by member -# name. If set to NO, the members will appear in declaration order. Note that -# this will also influence the order of the classes in the class list. -# The default value is: NO. - -SORT_BRIEF_DOCS = NO - -# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the -# (brief and detailed) documentation of class members so that constructors and -# destructors are listed first. If set to NO the constructors will appear in the -# respective orders defined by SORT_BRIEF_DOCS and SORT_MEMBER_DOCS. -# Note: If SORT_BRIEF_DOCS is set to NO this option is ignored for sorting brief -# member documentation. -# Note: If SORT_MEMBER_DOCS is set to NO this option is ignored for sorting -# detailed member documentation. -# The default value is: NO. - -SORT_MEMBERS_CTORS_1ST = NO - -# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the hierarchy -# of group names into alphabetical order. If set to NO the group names will -# appear in their defined order. -# The default value is: NO. - -SORT_GROUP_NAMES = YES - -# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be sorted by -# fully-qualified names, including namespaces. If set to NO, the class list will -# be sorted only by class name, not including the namespace part. -# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. -# Note: This option applies only to the class list, not to the alphabetical -# list. -# The default value is: NO. - -SORT_BY_SCOPE_NAME = YES - -# If the STRICT_PROTO_MATCHING option is enabled and doxygen fails to do proper -# type resolution of all parameters of a function it will reject a match between -# the prototype and the implementation of a member function even if there is -# only one candidate or it is obvious which candidate to choose by doing a -# simple string match. By disabling STRICT_PROTO_MATCHING doxygen will still -# accept a match between prototype and implementation in such cases. -# The default value is: NO. - -STRICT_PROTO_MATCHING = NO - -# The GENERATE_TODOLIST tag can be used to enable (YES) or disable (NO) the todo -# list. This list is created by putting \todo commands in the documentation. -# The default value is: YES. - -GENERATE_TODOLIST = YES - -# The GENERATE_TESTLIST tag can be used to enable (YES) or disable (NO) the test -# list. This list is created by putting \test commands in the documentation. -# The default value is: YES. - -GENERATE_TESTLIST = YES - -# The GENERATE_BUGLIST tag can be used to enable (YES) or disable (NO) the bug -# list. This list is created by putting \bug commands in the documentation. -# The default value is: YES. - -GENERATE_BUGLIST = YES - -# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or disable (NO) -# the deprecated list. This list is created by putting \deprecated commands in -# the documentation. -# The default value is: YES. - -GENERATE_DEPRECATEDLIST= YES - -# The ENABLED_SECTIONS tag can be used to enable conditional documentation -# sections, marked by \if ... \endif and \cond -# ... \endcond blocks. - -ENABLED_SECTIONS = - -# The MAX_INITIALIZER_LINES tag determines the maximum number of lines that the -# initial value of a variable or macro / define can have for it to appear in the -# documentation. If the initializer consists of more lines than specified here -# it will be hidden. Use a value of 0 to hide initializers completely. The -# appearance of the value of individual variables and macros / defines can be -# controlled using \showinitializer or \hideinitializer command in the -# documentation regardless of this setting. -# Minimum value: 0, maximum value: 10000, default value: 30. - -MAX_INITIALIZER_LINES = 30 - -# Set the SHOW_USED_FILES tag to NO to disable the list of files generated at -# the bottom of the documentation of classes and structs. If set to YES, the -# list will mention the files that were used to generate the documentation. -# The default value is: YES. - -SHOW_USED_FILES = YES - -# Set the SHOW_FILES tag to NO to disable the generation of the Files page. This -# will remove the Files entry from the Quick Index and from the Folder Tree View -# (if specified). -# The default value is: YES. - -SHOW_FILES = YES - -# Set the SHOW_NAMESPACES tag to NO to disable the generation of the Namespaces -# page. This will remove the Namespaces entry from the Quick Index and from the -# Folder Tree View (if specified). -# The default value is: YES. - -SHOW_NAMESPACES = YES - -# The FILE_VERSION_FILTER tag can be used to specify a program or script that -# doxygen should invoke to get the current version for each file (typically from -# the version control system). Doxygen will invoke the program by executing (via -# popen()) the command command input-file, where command is the value of the -# FILE_VERSION_FILTER tag, and input-file is the name of an input file provided -# by doxygen. Whatever the program writes to standard output is used as the file -# version. For an example see the documentation. - -FILE_VERSION_FILTER = - -# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed -# by doxygen. The layout file controls the global structure of the generated -# output files in an output format independent way. To create the layout file -# that represents doxygen's defaults, run doxygen with the -l option. You can -# optionally specify a file name after the option, if omitted DoxygenLayout.xml -# will be used as the name of the layout file. -# -# Note that if you run doxygen from a directory containing a file called -# DoxygenLayout.xml, doxygen will parse it automatically even if the LAYOUT_FILE -# tag is left empty. - -LAYOUT_FILE = - -# The CITE_BIB_FILES tag can be used to specify one or more bib files containing -# the reference definitions. This must be a list of .bib files. The .bib -# extension is automatically appended if omitted. This requires the bibtex tool -# to be installed. See also https://en.wikipedia.org/wiki/BibTeX for more info. -# For LaTeX the style of the bibliography can be controlled using -# LATEX_BIB_STYLE. To use this feature you need bibtex and perl available in the -# search path. See also \cite for info how to create references. - -CITE_BIB_FILES = - -#--------------------------------------------------------------------------- -# Configuration options related to warning and progress messages -#--------------------------------------------------------------------------- - -# The QUIET tag can be used to turn on/off the messages that are generated to -# standard output by doxygen. If QUIET is set to YES this implies that the -# messages are off. -# The default value is: NO. - -QUIET = NO - -# The WARNINGS tag can be used to turn on/off the warning messages that are -# generated to standard error (stderr) by doxygen. If WARNINGS is set to YES -# this implies that the warnings are on. -# -# Tip: Turn warnings on while writing the documentation. -# The default value is: YES. - -WARNINGS = YES - -# If the WARN_IF_UNDOCUMENTED tag is set to YES then doxygen will generate -# warnings for undocumented members. If EXTRACT_ALL is set to YES then this flag -# will automatically be disabled. -# The default value is: YES. - -WARN_IF_UNDOCUMENTED = YES - -# If the WARN_IF_DOC_ERROR tag is set to YES, doxygen will generate warnings for -# potential errors in the documentation, such as not documenting some parameters -# in a documented function, or documenting parameters that don't exist or using -# markup commands wrongly. -# The default value is: YES. - -WARN_IF_DOC_ERROR = YES - -# This WARN_NO_PARAMDOC option can be enabled to get warnings for functions that -# are documented, but have no documentation for their parameters or return -# value. If set to NO, doxygen will only warn about wrong or incomplete -# parameter documentation, but not about the absence of documentation. -# The default value is: NO. - -WARN_NO_PARAMDOC = NO - -# If the WARN_AS_ERROR tag is set to YES then doxygen will immediately stop when -# a warning is encountered. -# The default value is: NO. - -WARN_AS_ERROR = NO - -# The WARN_FORMAT tag determines the format of the warning messages that doxygen -# can produce. The string should contain the $file, $line, and $text tags, which -# will be replaced by the file and line number from which the warning originated -# and the warning text. Optionally the format may contain $version, which will -# be replaced by the version of the file (if it could be obtained via -# FILE_VERSION_FILTER) -# The default value is: $file:$line: $text. - -WARN_FORMAT = "$file:$line: $text" - -# The WARN_LOGFILE tag can be used to specify a file to which warning and error -# messages should be written. If left blank the output is written to standard -# error (stderr). - -WARN_LOGFILE = - -#--------------------------------------------------------------------------- -# Configuration options related to the input files -#--------------------------------------------------------------------------- - -# The INPUT tag is used to specify the files and/or directories that contain -# documented source files. You may enter file names like myfile.cpp or -# directories like /usr/src/myproject. Separate the files or directories with -# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING -# Note: If this tag is empty the current directory is searched. - -INPUT = tools/doxygen/Developer.dox \ - src/ \ - src/ASPHERE \ - src/BODY \ - src/CLASS2 \ - src/COLLOID \ - src/COMPRESS \ - src/CORESHELL \ - src/DEPEND \ - src/DIPOLE \ - src/GPU \ - src/GRANULAR \ - src/KIM \ - src/KOKKOS \ - src/KSPACE \ - src/LATTE \ - src/MAKE \ - src/MANYBODY \ - src/MC \ - src/MEAM \ - src/MISC \ - src/MOLECULE \ - src/MPIIO \ - src/MSCG \ - src/OPT \ - src/PERI \ - src/POEMS \ - src/PYTHON \ - src/QEQ \ - src/REAX \ - src/REPLICA \ - src/RIGID \ - src/SHOCK \ - src/SNAP \ - src/SRD \ - src/VORONOI \ - src/USER-AWPMD \ - src/USER-CGDNA \ - src/USER-CGSDK \ - src/USER-COLVARS \ - src/USER-DIFFRACTION \ - src/USER-DPD \ - src/USER-DRUDE \ - src/USER-EFF \ - src/USER-FEP \ - src/USER-H5MD \ - src/USER-INTEL \ - src/USER-LB \ - src/USER-MANIFOLD \ - src/USER-MEAMC \ - src/USER-MESO \ - src/USER-MGPT \ - src/USER-MISC \ - src/USER-MOLFILE \ - src/USER-NETCDF \ - src/USER-OMP \ - src/USER-PHONON \ - src/USER-QMMM \ - src/USER-QTB \ - src/USER-QUIP \ - src/USER-REAXC \ - src/USER-SMD \ - src/USER-SMTBQ \ - src/USER-SPH \ - src/USER-TALLY \ - src/USER-UEF \ - src/USER-VTK \ - src/STUBS - -# This tag can be used to specify the character encoding of the source files -# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses -# libiconv (or the iconv built into libc) for the transcoding. See the libiconv -# documentation (see: https://www.gnu.org/software/libiconv/) for the list of -# possible encodings. -# The default value is: UTF-8. - -INPUT_ENCODING = UTF-8 - -# If the value of the INPUT tag contains directories, you can use the -# FILE_PATTERNS tag to specify one or more wildcard patterns (like *.cpp and -# *.h) to filter out the source-files in the directories. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# read by doxygen. -# -# If left blank the following patterns are tested:*.c, *.cc, *.cxx, *.cpp, -# *.c++, *.java, *.ii, *.ixx, *.ipp, *.i++, *.inl, *.idl, *.ddl, *.odl, *.h, -# *.hh, *.hxx, *.hpp, *.h++, *.cs, *.d, *.php, *.php4, *.php5, *.phtml, *.inc, -# *.m, *.markdown, *.md, *.mm, *.dox, *.py, *.pyw, *.f90, *.f95, *.f03, *.f08, -# *.f, *.for, *.tcl, *.vhd, *.vhdl, *.ucf and *.qsf. - -FILE_PATTERNS = *.c \ - *.cc \ - *.cxx \ - *.cpp \ - *.c++ \ - *.java \ - *.ii \ - *.ixx \ - *.ipp \ - *.i++ \ - *.inl \ - *.idl \ - *.ddl \ - *.odl \ - *.h \ - *.hh \ - *.hxx \ - *.hpp \ - *.h++ \ - *.cs \ - *.d \ - *.php \ - *.php4 \ - *.php5 \ - *.phtml \ - *.inc \ - *.m \ - *.markdown \ - *.md \ - *.mm \ - *.dox \ - *.py \ - *.pyw \ - *.f90 \ - *.f95 \ - *.f03 \ - *.f08 \ - *.f \ - *.for \ - *.tcl \ - *.vhd \ - *.vhdl \ - *.ucf \ - *.qsf - -# The RECURSIVE tag can be used to specify whether or not subdirectories should -# be searched for input files as well. -# The default value is: NO. - -RECURSIVE = NO - -# The EXCLUDE tag can be used to specify files and/or directories that should be -# excluded from the INPUT source files. This way you can easily exclude a -# subdirectory from a directory tree whose root is specified with the INPUT tag. -# -# Note that relative paths are relative to the directory from which doxygen is -# run. - -EXCLUDE = - -# The EXCLUDE_SYMLINKS tag can be used to select whether or not files or -# directories that are symbolic links (a Unix file system feature) are excluded -# from the input. -# The default value is: NO. - -EXCLUDE_SYMLINKS = NO - -# If the value of the INPUT tag contains directories, you can use the -# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude -# certain files from those directories. -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories for example use the pattern */test/* - -EXCLUDE_PATTERNS = - -# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names -# (namespaces, classes, functions, etc.) that should be excluded from the -# output. The symbol name can be a fully qualified name, a word, or if the -# wildcard * is used, a substring. Examples: ANamespace, AClass, -# AClass::ANamespace, ANamespace::*Test -# -# Note that the wildcards are matched against the file with absolute path, so to -# exclude all test directories use the pattern */test/* - -EXCLUDE_SYMBOLS = - -# The EXAMPLE_PATH tag can be used to specify one or more files or directories -# that contain example code fragments that are included (see the \include -# command). - -EXAMPLE_PATH = examples - -# If the value of the EXAMPLE_PATH tag contains directories, you can use the -# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and -# *.h) to filter out the source-files in the directories. If left blank all -# files are included. - -EXAMPLE_PATTERNS = in.* - -# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be -# searched for input files to be used with the \include or \dontinclude commands -# irrespective of the value of the RECURSIVE tag. -# The default value is: NO. - -EXAMPLE_RECURSIVE = NO - -# The IMAGE_PATH tag can be used to specify one or more files or directories -# that contain images that are to be included in the documentation (see the -# \image command). - -IMAGE_PATH = tools/doxygen - -# The INPUT_FILTER tag can be used to specify a program that doxygen should -# invoke to filter for each input file. Doxygen will invoke the filter program -# by executing (via popen()) the command: -# -# -# -# where is the value of the INPUT_FILTER tag, and is the -# name of an input file. Doxygen will then use the output that the filter -# program writes to standard output. If FILTER_PATTERNS is specified, this tag -# will be ignored. -# -# Note that the filter must not add or remove lines; it is applied before the -# code is scanned, but not when the output code is generated. If lines are added -# or removed, the anchors will not be placed correctly. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -INPUT_FILTER = - -# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern -# basis. Doxygen will compare the file name with each pattern and apply the -# filter if there is a match. The filters are a list of the form: pattern=filter -# (like *.cpp=my_cpp_filter). See INPUT_FILTER for further information on how -# filters are used. If the FILTER_PATTERNS tag is empty or if none of the -# patterns match the file name, INPUT_FILTER is applied. -# -# Note that for custom extensions or not directly supported extensions you also -# need to set EXTENSION_MAPPING for the extension otherwise the files are not -# properly processed by doxygen. - -FILTER_PATTERNS = - -# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using -# INPUT_FILTER) will also be used to filter the input files that are used for -# producing the source files to browse (i.e. when SOURCE_BROWSER is set to YES). -# The default value is: NO. - -FILTER_SOURCE_FILES = NO - -# The FILTER_SOURCE_PATTERNS tag can be used to specify source filters per file -# pattern. A pattern will override the setting for FILTER_PATTERN (if any) and -# it is also possible to disable source filtering for a specific pattern using -# *.ext= (so without naming a filter). -# This tag requires that the tag FILTER_SOURCE_FILES is set to YES. - -FILTER_SOURCE_PATTERNS = - -# If the USE_MDFILE_AS_MAINPAGE tag refers to the name of a markdown file that -# is part of the input, its contents will be placed on the main page -# (index.html). This can be useful if you have a project on for instance GitHub -# and want to reuse the introduction page also for the doxygen output. - -USE_MDFILE_AS_MAINPAGE = - -#--------------------------------------------------------------------------- -# Configuration options related to source browsing -#--------------------------------------------------------------------------- - -# If the SOURCE_BROWSER tag is set to YES then a list of source files will be -# generated. Documented entities will be cross-referenced with these sources. -# -# Note: To get rid of all source code in the generated output, make sure that -# also VERBATIM_HEADERS is set to NO. -# The default value is: NO. - -SOURCE_BROWSER = YES - -# Setting the INLINE_SOURCES tag to YES will include the body of functions, -# classes and enums directly into the documentation. -# The default value is: NO. - -INLINE_SOURCES = YES - -# Setting the STRIP_CODE_COMMENTS tag to YES will instruct doxygen to hide any -# special comment blocks from generated source code fragments. Normal C, C++ and -# Fortran comments will always remain visible. -# The default value is: YES. - -STRIP_CODE_COMMENTS = YES - -# If the REFERENCED_BY_RELATION tag is set to YES then for each documented -# function all documented functions referencing it will be listed. -# The default value is: NO. - -REFERENCED_BY_RELATION = NO - -# If the REFERENCES_RELATION tag is set to YES then for each documented function -# all documented entities called/used by that function will be listed. -# The default value is: NO. - -REFERENCES_RELATION = NO - -# If the REFERENCES_LINK_SOURCE tag is set to YES and SOURCE_BROWSER tag is set -# to YES then the hyperlinks from functions in REFERENCES_RELATION and -# REFERENCED_BY_RELATION lists will link to the source code. Otherwise they will -# link to the documentation. -# The default value is: YES. - -REFERENCES_LINK_SOURCE = YES - -# If SOURCE_TOOLTIPS is enabled (the default) then hovering a hyperlink in the -# source code will show a tooltip with additional information such as prototype, -# brief description and links to the definition and documentation. Since this -# will make the HTML file larger and loading of large files a bit slower, you -# can opt to disable this feature. -# The default value is: YES. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -SOURCE_TOOLTIPS = YES - -# If the USE_HTAGS tag is set to YES then the references to source code will -# point to the HTML generated by the htags(1) tool instead of doxygen built-in -# source browser. The htags tool is part of GNU's global source tagging system -# (see https://www.gnu.org/software/global/global.html). You will need version -# 4.8.6 or higher. -# -# To use it do the following: -# - Install the latest version of global -# - Enable SOURCE_BROWSER and USE_HTAGS in the config file -# - Make sure the INPUT points to the root of the source tree -# - Run doxygen as normal -# -# Doxygen will invoke htags (and that will in turn invoke gtags), so these -# tools must be available from the command line (i.e. in the search path). -# -# The result: instead of the source browser generated by doxygen, the links to -# source code will now point to the output of htags. -# The default value is: NO. -# This tag requires that the tag SOURCE_BROWSER is set to YES. - -USE_HTAGS = NO - -# If the VERBATIM_HEADERS tag is set the YES then doxygen will generate a -# verbatim copy of the header file for each class for which an include is -# specified. Set to NO to disable this. -# See also: Section \class. -# The default value is: YES. - -VERBATIM_HEADERS = YES - -#--------------------------------------------------------------------------- -# Configuration options related to the alphabetical class index -#--------------------------------------------------------------------------- - -# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index of all -# compounds will be generated. Enable this if the project contains a lot of -# classes, structs, unions or interfaces. -# The default value is: YES. - -ALPHABETICAL_INDEX = YES - -# The COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns in -# which the alphabetical index list will be split. -# Minimum value: 1, maximum value: 20, default value: 5. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -COLS_IN_ALPHA_INDEX = 5 - -# In case all classes in a project start with a common prefix, all classes will -# be put under the same header in the alphabetical index. The IGNORE_PREFIX tag -# can be used to specify a prefix (or a list of prefixes) that should be ignored -# while generating the index headers. -# This tag requires that the tag ALPHABETICAL_INDEX is set to YES. - -IGNORE_PREFIX = - -#--------------------------------------------------------------------------- -# Configuration options related to the HTML output -#--------------------------------------------------------------------------- - -# If the GENERATE_HTML tag is set to YES, doxygen will generate HTML output -# The default value is: YES. - -GENERATE_HTML = YES - -# The HTML_OUTPUT tag is used to specify where the HTML docs will be put. If a -# relative path is entered the value of OUTPUT_DIRECTORY will be put in front of -# it. -# The default directory is: html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_OUTPUT = html - -# The HTML_FILE_EXTENSION tag can be used to specify the file extension for each -# generated HTML page (for example: .htm, .php, .asp). -# The default value is: .html. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FILE_EXTENSION = .html - -# The HTML_HEADER tag can be used to specify a user-defined HTML header file for -# each generated HTML page. If the tag is left blank doxygen will generate a -# standard header. -# -# To get valid HTML the header file that includes any scripts and style sheets -# that doxygen needs, which is dependent on the configuration options used (e.g. -# the setting GENERATE_TREEVIEW). It is highly recommended to start with a -# default header using -# doxygen -w html new_header.html new_footer.html new_stylesheet.css -# YourConfigFile -# and then modify the file new_header.html. See also section "Doxygen usage" -# for information on how to generate the default header that doxygen normally -# uses. -# Note: The header is subject to change so you typically have to regenerate the -# default header when upgrading to a newer version of doxygen. For a description -# of the possible markers and block names see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_HEADER = - -# The HTML_FOOTER tag can be used to specify a user-defined HTML footer for each -# generated HTML page. If the tag is left blank doxygen will generate a standard -# footer. See HTML_HEADER for more information on how to generate a default -# footer and what special commands can be used inside the footer. See also -# section "Doxygen usage" for information on how to generate the default footer -# that doxygen normally uses. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_FOOTER = - -# The HTML_STYLESHEET tag can be used to specify a user-defined cascading style -# sheet that is used by each HTML page. It can be used to fine-tune the look of -# the HTML output. If left blank doxygen will generate a default style sheet. -# See also section "Doxygen usage" for information on how to generate the style -# sheet that doxygen normally uses. -# Note: It is recommended to use HTML_EXTRA_STYLESHEET instead of this tag, as -# it is more robust and this tag (HTML_STYLESHEET) will in the future become -# obsolete. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_STYLESHEET = - -# The HTML_EXTRA_STYLESHEET tag can be used to specify additional user-defined -# cascading style sheets that are included after the standard style sheets -# created by doxygen. Using this option one can overrule certain style aspects. -# This is preferred over using HTML_STYLESHEET since it does not replace the -# standard style sheet and is therefore more robust against future updates. -# Doxygen will copy the style sheet files to the output directory. -# Note: The order of the extra style sheet files is of importance (e.g. the last -# style sheet in the list overrules the setting of the previous ones in the -# list). For an example see the documentation. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_STYLESHEET = - -# The HTML_EXTRA_FILES tag can be used to specify one or more extra images or -# other source files which should be copied to the HTML output directory. Note -# that these files will be copied to the base HTML output directory. Use the -# $relpath^ marker in the HTML_HEADER and/or HTML_FOOTER files to load these -# files. In the HTML_STYLESHEET file, use the file name only. Also note that the -# files will be copied as-is; there are no commands or markers available. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_EXTRA_FILES = - -# The HTML_COLORSTYLE_HUE tag controls the color of the HTML output. Doxygen -# will adjust the colors in the style sheet and background images according to -# this color. Hue is specified as an angle on a colorwheel, see -# https://en.wikipedia.org/wiki/Hue for more information. For instance the value -# 0 represents red, 60 is yellow, 120 is green, 180 is cyan, 240 is blue, 300 -# purple, and 360 is red again. -# Minimum value: 0, maximum value: 359, default value: 220. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_HUE = 220 - -# The HTML_COLORSTYLE_SAT tag controls the purity (or saturation) of the colors -# in the HTML output. For a value of 0 the output will use grayscales only. A -# value of 255 will produce the most vivid colors. -# Minimum value: 0, maximum value: 255, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_SAT = 100 - -# The HTML_COLORSTYLE_GAMMA tag controls the gamma correction applied to the -# luminance component of the colors in the HTML output. Values below 100 -# gradually make the output lighter, whereas values above 100 make the output -# darker. The value divided by 100 is the actual gamma applied, so 80 represents -# a gamma of 0.8, The value 220 represents a gamma of 2.2, and 100 does not -# change the gamma. -# Minimum value: 40, maximum value: 240, default value: 80. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_COLORSTYLE_GAMMA = 80 - -# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML -# page will contain the date and time when the page was generated. Setting this -# to YES can help to show when doxygen was last run and thus if the -# documentation is up to date. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_TIMESTAMP = NO - -# If the HTML_DYNAMIC_MENUS tag is set to YES then the generated HTML -# documentation will contain a main index with vertical navigation menus that -# are dynamically created via Javascript. If disabled, the navigation index will -# consists of multiple levels of tabs that are statically embedded in every HTML -# page. Disable this option to support browsers that do not have Javascript, -# like the Qt help browser. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_MENUS = YES - -# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML -# documentation will contain sections that can be hidden and shown after the -# page has loaded. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_DYNAMIC_SECTIONS = NO - -# With HTML_INDEX_NUM_ENTRIES one can control the preferred number of entries -# shown in the various tree structured indices initially; the user can expand -# and collapse entries dynamically later on. Doxygen will expand the tree to -# such a level that at most the specified number of entries are visible (unless -# a fully collapsed tree already exceeds this amount). So setting the number of -# entries 1 will produce a full collapsed tree by default. 0 is a special value -# representing an infinite number of entries and will result in a full expanded -# tree by default. -# Minimum value: 0, maximum value: 9999, default value: 100. -# This tag requires that the tag GENERATE_HTML is set to YES. - -HTML_INDEX_NUM_ENTRIES = 100 - -# If the GENERATE_DOCSET tag is set to YES, additional index files will be -# generated that can be used as input for Apple's Xcode 3 integrated development -# environment (see: https://developer.apple.com/tools/xcode/), introduced with -# OSX 10.5 (Leopard). To create a documentation set, doxygen will generate a -# Makefile in the HTML output directory. Running make will produce the docset in -# that directory and running make install will install the docset in -# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find it at -# startup. See https://developer.apple.com/tools/creatingdocsetswithdoxygen.html -# for more information. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_DOCSET = NO - -# This tag determines the name of the docset feed. A documentation feed provides -# an umbrella under which multiple documentation sets from a single provider -# (such as a company or product suite) can be grouped. -# The default value is: Doxygen generated docs. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_FEEDNAME = "Doxygen generated docs" - -# This tag specifies a string that should uniquely identify the documentation -# set bundle. This should be a reverse domain-name style string, e.g. -# com.mycompany.MyDocSet. Doxygen will append .docset to the name. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_BUNDLE_ID = org.doxygen.Project - -# The DOCSET_PUBLISHER_ID tag specifies a string that should uniquely identify -# the documentation publisher. This should be a reverse domain-name style -# string, e.g. com.mycompany.MyDocSet.documentation. -# The default value is: org.doxygen.Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_ID = org.doxygen.Publisher - -# The DOCSET_PUBLISHER_NAME tag identifies the documentation publisher. -# The default value is: Publisher. -# This tag requires that the tag GENERATE_DOCSET is set to YES. - -DOCSET_PUBLISHER_NAME = Publisher - -# If the GENERATE_HTMLHELP tag is set to YES then doxygen generates three -# additional HTML index files: index.hhp, index.hhc, and index.hhk. The -# index.hhp is a project file that can be read by Microsoft's HTML Help Workshop -# (see: http://www.microsoft.com/en-us/download/details.aspx?id=21138) on -# Windows. -# -# The HTML Help Workshop contains a compiler that can convert all HTML output -# generated by doxygen into a single compiled HTML file (.chm). Compiled HTML -# files are now used as the Windows 98 help format, and will replace the old -# Windows help format (.hlp) on all Windows platforms in the future. Compressed -# HTML files also contain an index, a table of contents, and you can search for -# words in the documentation. The HTML workshop also contains a viewer for -# compressed HTML files. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_HTMLHELP = NO - -# The CHM_FILE tag can be used to specify the file name of the resulting .chm -# file. You can add a path in front of the file if the result should not be -# written to the html output directory. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_FILE = - -# The HHC_LOCATION tag can be used to specify the location (absolute path -# including file name) of the HTML help compiler (hhc.exe). If non-empty, -# doxygen will try to run the HTML help compiler on the generated index.hhp. -# The file has to be specified with full path. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -HHC_LOCATION = - -# The GENERATE_CHI flag controls if a separate .chi index file is generated -# (YES) or that it should be included in the master .chm file (NO). -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -GENERATE_CHI = NO - -# The CHM_INDEX_ENCODING is used to encode HtmlHelp index (hhk), content (hhc) -# and project file content. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -CHM_INDEX_ENCODING = - -# The BINARY_TOC flag controls whether a binary table of contents is generated -# (YES) or a normal table of contents (NO) in the .chm file. Furthermore it -# enables the Previous and Next buttons. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -BINARY_TOC = NO - -# The TOC_EXPAND flag can be set to YES to add extra items for group members to -# the table of contents of the HTML help documentation and to the tree view. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTMLHELP is set to YES. - -TOC_EXPAND = NO - -# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and -# QHP_VIRTUAL_FOLDER are set, an additional index file will be generated that -# can be used as input for Qt's qhelpgenerator to generate a Qt Compressed Help -# (.qch) of the generated HTML documentation. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_QHP = NO - -# If the QHG_LOCATION tag is specified, the QCH_FILE tag can be used to specify -# the file name of the resulting .qch file. The path specified is relative to -# the HTML output folder. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QCH_FILE = - -# The QHP_NAMESPACE tag specifies the namespace to use when generating Qt Help -# Project output. For more information please see Qt Help Project / Namespace -# (see: http://doc.qt.io/qt-4.8/qthelpproject.html#namespace). -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_NAMESPACE = org.doxygen.Project - -# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating Qt -# Help Project output. For more information please see Qt Help Project / Virtual -# Folders (see: http://doc.qt.io/qt-4.8/qthelpproject.html#virtual-folders). -# The default value is: doc. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_VIRTUAL_FOLDER = doc - -# If the QHP_CUST_FILTER_NAME tag is set, it specifies the name of a custom -# filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_NAME = - -# The QHP_CUST_FILTER_ATTRS tag specifies the list of the attributes of the -# custom filter to add. For more information please see Qt Help Project / Custom -# Filters (see: http://doc.qt.io/qt-4.8/qthelpproject.html#custom-filters). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_CUST_FILTER_ATTRS = - -# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this -# project's filter section matches. Qt Help Project / Filter Attributes (see: -# http://doc.qt.io/qt-4.8/qthelpproject.html#filter-attributes). -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHP_SECT_FILTER_ATTRS = - -# The QHG_LOCATION tag can be used to specify the location of Qt's -# qhelpgenerator. If non-empty doxygen will try to run qhelpgenerator on the -# generated .qhp file. -# This tag requires that the tag GENERATE_QHP is set to YES. - -QHG_LOCATION = - -# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files will be -# generated, together with the HTML files, they form an Eclipse help plugin. To -# install this plugin and make it available under the help contents menu in -# Eclipse, the contents of the directory containing the HTML and XML files needs -# to be copied into the plugins directory of eclipse. The name of the directory -# within the plugins directory should be the same as the ECLIPSE_DOC_ID value. -# After copying Eclipse needs to be restarted before the help appears. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_ECLIPSEHELP = NO - -# A unique identifier for the Eclipse help plugin. When installing the plugin -# the directory name containing the HTML and XML files should also have this -# name. Each documentation set should have its own identifier. -# The default value is: org.doxygen.Project. -# This tag requires that the tag GENERATE_ECLIPSEHELP is set to YES. - -ECLIPSE_DOC_ID = org.doxygen.Project - -# If you want full control over the layout of the generated HTML pages it might -# be necessary to disable the index and replace it with your own. The -# DISABLE_INDEX tag can be used to turn on/off the condensed index (tabs) at top -# of each HTML page. A value of NO enables the index and the value YES disables -# it. Since the tabs in the index contain the same information as the navigation -# tree, you can set this option to YES if you also set GENERATE_TREEVIEW to YES. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -DISABLE_INDEX = NO - -# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index -# structure should be generated to display hierarchical information. If the tag -# value is set to YES, a side panel will be generated containing a tree-like -# index structure (just like the one that is generated for HTML Help). For this -# to work a browser that supports JavaScript, DHTML, CSS and frames is required -# (i.e. any modern browser). Windows users are probably better off using the -# HTML help feature. Via custom style sheets (see HTML_EXTRA_STYLESHEET) one can -# further fine-tune the look of the index. As an example, the default style -# sheet generated by doxygen has an example that shows how to put an image at -# the root of the tree instead of the PROJECT_NAME. Since the tree basically has -# the same information as the tab index, you could consider setting -# DISABLE_INDEX to YES when enabling this option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -GENERATE_TREEVIEW = YES - -# The ENUM_VALUES_PER_LINE tag can be used to set the number of enum values that -# doxygen will group on one line in the generated HTML documentation. -# -# Note that a value of 0 will completely suppress the enum values from appearing -# in the overview section. -# Minimum value: 0, maximum value: 20, default value: 4. -# This tag requires that the tag GENERATE_HTML is set to YES. - -ENUM_VALUES_PER_LINE = 4 - -# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be used -# to set the initial width (in pixels) of the frame in which the tree is shown. -# Minimum value: 0, maximum value: 1500, default value: 250. -# This tag requires that the tag GENERATE_HTML is set to YES. - -TREEVIEW_WIDTH = 250 - -# If the EXT_LINKS_IN_WINDOW option is set to YES, doxygen will open links to -# external symbols imported via tag files in a separate window. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -EXT_LINKS_IN_WINDOW = NO - -# Use this tag to change the font size of LaTeX formulas included as images in -# the HTML documentation. When you change the font size after a successful -# doxygen run you need to manually remove any form_*.png images from the HTML -# output directory to force them to be regenerated. -# Minimum value: 8, maximum value: 50, default value: 10. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_FONTSIZE = 10 - -# Use the FORMULA_TRANSPARENT tag to determine whether or not the images -# generated for formulas are transparent PNGs. Transparent PNGs are not -# supported properly for IE 6.0, but are supported on all modern browsers. -# -# Note that when changing this option you need to delete any form_*.png files in -# the HTML output directory before the changes have effect. -# The default value is: YES. -# This tag requires that the tag GENERATE_HTML is set to YES. - -FORMULA_TRANSPARENT = YES - -# Enable the USE_MATHJAX option to render LaTeX formulas using MathJax (see -# https://www.mathjax.org) which uses client side Javascript for the rendering -# instead of using pre-rendered bitmaps. Use this if you do not have LaTeX -# installed or if you want to formulas look prettier in the HTML output. When -# enabled you may also need to install MathJax separately and configure the path -# to it using the MATHJAX_RELPATH option. -# The default value is: NO. -# This tag requires that the tag GENERATE_HTML is set to YES. - -USE_MATHJAX = NO - -# When MathJax is enabled you can set the default output format to be used for -# the MathJax output. See the MathJax site (see: -# http://docs.mathjax.org/en/latest/output.html) for more details. -# Possible values are: HTML-CSS (which is slower, but has the best -# compatibility), NativeMML (i.e. MathML) and SVG. -# The default value is: HTML-CSS. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_FORMAT = HTML-CSS - -# When MathJax is enabled you need to specify the location relative to the HTML -# output directory using the MATHJAX_RELPATH option. The destination directory -# should contain the MathJax.js script. For instance, if the mathjax directory -# is located at the same level as the HTML output directory, then -# MATHJAX_RELPATH should be ../mathjax. The default value points to the MathJax -# Content Delivery Network so you can quickly see the result without installing -# MathJax. However, it is strongly recommended to install a local copy of -# MathJax from https://www.mathjax.org before deployment. -# The default value is: https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_RELPATH = http://cdn.mathjax.org/mathjax/latest - -# The MATHJAX_EXTENSIONS tag can be used to specify one or more MathJax -# extension names that should be enabled during MathJax rendering. For example -# MATHJAX_EXTENSIONS = TeX/AMSmath TeX/AMSsymbols -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_EXTENSIONS = - -# The MATHJAX_CODEFILE tag can be used to specify a file with javascript pieces -# of code that will be used on startup of the MathJax code. See the MathJax site -# (see: http://docs.mathjax.org/en/latest/output.html) for more details. For an -# example see the documentation. -# This tag requires that the tag USE_MATHJAX is set to YES. - -MATHJAX_CODEFILE = - -# When the SEARCHENGINE tag is enabled doxygen will generate a search box for -# the HTML output. The underlying search engine uses javascript and DHTML and -# should work on any modern browser. Note that when using HTML help -# (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) -# there is already a search function so this one should typically be disabled. -# For large projects the javascript based search engine can be slow, then -# enabling SERVER_BASED_SEARCH may provide a better solution. It is possible to -# search using the keyboard; to jump to the search box use + S -# (what the is depends on the OS and browser, but it is typically -# , /